/* ============================================================================
   Compare dashboard — Chris Yap · Property, Clearly
   Editorial ledger on cream: ink type, one gold accent, hairlines, numbered
   steps. Project A is always blue, project B always gold (validated palette).
   ========================================================================== */

@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --ink: #0F1418; --ink-2: #2A3138; --slate: #6B7480; --navy: #233040;
  --cream: #F4EFE3; --paper: #F6F4EF; --card: #FFFFFF; --well: #FBF7EE;
  --line: #D9D2C2; --line-2: rgba(15, 20, 24, 0.08);
  --gold: #B08A3E; --gold-2: #C9A24F;
  --green: #2C7A4B; --green-bg: #EAF5EE; --red: #A4453A; --red-bg: #FBEDEA;
  --a: #2E5FA3; --b: #A07C30; --a-bg: rgba(46, 95, 163, 0.08); --b-bg: rgba(160, 124, 48, 0.10);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-pill: 999px;
  --s0: 0 1px 2px rgba(15,20,24,.05); --s1: 0 4px 14px rgba(15,20,24,.07); --s2: 0 12px 34px rgba(15,20,24,.12);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans); color: var(--ink); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  background-image:
    radial-gradient(90% 60% at 20% 0%, rgba(201,162,79,.10), rgba(201,162,79,0) 60%),
    radial-gradient(70% 50% at 100% 20%, rgba(255,255,255,.7), rgba(255,255,255,0) 55%);
  background-attachment: fixed;
}
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -0.012em; }
.num { font-variant-numeric: tabular-nums; }
button { font: inherit; cursor: pointer; }
svg { display: block; }
strong { font-weight: 600; }
a { color: inherit; }

/* ---- chrome ------------------------------------------------------------- */
.client-banner {
  display: none; background: var(--navy); color: var(--cream); font-size: 12.5px;
  padding: 8px 16px; text-align: center; line-height: 1.4;
}
.client-banner b { color: var(--gold-2); font-weight: 600; }
body.client .client-banner, body.preview .client-banner { display: block; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 22px; border-bottom: 1px solid var(--line);
  background: rgba(246,244,239,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}
.wordmark { font-family: var(--serif); font-size: 15px; color: var(--ink); white-space: nowrap; }
.wordmark em { font-style: normal; color: var(--gold); }
.wordmark .tag {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold); border-radius: var(--r-pill); padding: 2px 8px; margin-left: 8px; vertical-align: 2px;
}
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--r-pill); padding: 8px 15px; font-size: 13.5px; font-weight: 600;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--s1); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 12.5px; }

/* advisor gating: hidden for everyone except an embedded advisor payload; preview hides advisor content but keeps the tools */
body:not(.advisor) .advisor-tool, body:not(.advisor) .advisor-only, body.preview .advisor-only { display: none !important; }

/* ---- layout ------------------------------------------------------------- */
.wrap { max-width: 900px; margin: 0 auto; padding: 26px 20px 80px; }
.step {
  display: flex; align-items: center; gap: 12px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 12px;
}
.step::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.block { margin-top: 36px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 20px 22px; box-shadow: var(--s0);
}
.card + .card { margin-top: 14px; }
.card h3 { font-size: 19px; margin-bottom: 6px; }
.card .sub { font-size: 13.5px; color: var(--slate); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lines p { margin-top: 10px; font-size: 15.5px; }
.lines p:first-child { margin-top: 0; }
.note { font-size: 12.5px; color: var(--slate); margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: var(--well); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 13px;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; }
.chip.a::before { background: var(--a); }
.chip.b::before { background: var(--b); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* ---- 01 the question ---------------------------------------------------- */
.hero { padding: 34px 0 6px; }
.hero h1 { font-size: clamp(28px, 5.4vw, 46px); line-height: 1.1; max-width: 22ch; }
.hero .lede { margin-top: 14px; font-size: 15.5px; color: var(--ink-2); max-width: 60ch; }
.hero .cat { font-family: var(--serif); font-size: 17px; color: var(--slate); margin-bottom: 10px; }

/* ---- 02 projects ------------------------------------------------------- */
.pj { position: relative; overflow: hidden; padding-top: 24px; }
.pj::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 5px; background: var(--a); }
.pj.b::before { background: var(--b); }
.pj h2 { font-size: 23px; line-height: 1.15; }
.pj .meta { font-size: 12.5px; color: var(--slate); margin-top: 3px; }
.pj .line { margin-top: 12px; font-size: 15px; }
.pj .line + .line { margin-top: 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--slate); margin-top: 12px; }
.facts b { color: var(--ink-2); font-weight: 600; }
.downside {
  margin-top: 14px; background: var(--red-bg); border-left: 3px solid var(--red);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 10px 14px; font-size: 14px; color: var(--ink-2);
}
.downside .lab { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--red); font-weight: 600; margin-bottom: 3px; }
.strengths { list-style: none; margin-top: 12px; }
.strengths li { position: relative; padding-left: 18px; font-size: 14px; margin-top: 6px; color: var(--ink-2); }
.strengths li::before { content: ""; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }

/* ---- charts ------------------------------------------------------------- */
.chart { margin-top: 14px; }
.chart-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.chart-box { position: relative; }
.chart-foot { font-size: 11.5px; color: var(--slate); margin-top: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin: 2px 0 6px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; display: none;
  background: var(--ink); color: var(--cream); font-size: 12.5px; line-height: 1.4;
  border-radius: 8px; padding: 7px 11px; box-shadow: var(--s2); white-space: nowrap;
}
.chart-tip b { color: var(--gold-2); font-weight: 600; }
.chart-text { list-style: none; font-size: 14px; }
.chart-text li { padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.chart-text li:last-child { border-bottom: 0; }

/* ---- 03 contrast -------------------------------------------------------- */
.contrast h3 { font-size: clamp(21px, 3.4vw, 27px); max-width: 26ch; }
.contrast .lines { margin-top: 12px; }
.contrast strong { color: var(--ink); background: linear-gradient(transparent 62%, rgba(201,162,79,.35) 62%); }

/* ---- 05 budget fit ------------------------------------------------------ */
.fit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.fit .col h4 { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.fit .col.a h4 { color: var(--a); } .fit .col.b h4 { color: var(--b); }
.fit ul { list-style: none; font-size: 13.5px; color: var(--ink-2); }
.fit li { padding: 5px 0; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 10px; }
.fit li.stretch { color: var(--slate); }
.fit li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- 06 money ----------------------------------------------------------- */
.money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.money .col { background: var(--well); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.money .col h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.money .col.a h4 { color: var(--a); } .money .col.b h4 { color: var(--b); }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.kv:last-child { border-bottom: 0; }
.kv span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.kv.big span:last-child { font-family: var(--serif); font-size: 18px; }

/* ---- role: my honest take ---------------------------------------------- */
.role {
  position: relative; overflow: hidden; margin-top: 36px;
  background: var(--ink); color: var(--cream); border-radius: var(--r-lg); padding: 28px 26px 26px;
}
.role::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(110% 80% at 100% 0%, rgba(201,162,79,.22), rgba(201,162,79,0) 55%);
}
.role > * { position: relative; }
.role .step { color: var(--gold-2); }
.role .step::after { background: rgba(246,244,239,.16); }
.role h2 { font-size: clamp(22px, 3.8vw, 31px); line-height: 1.2; color: var(--cream); max-width: 30ch; }
.role h2 strong { color: var(--gold-2); }
.role .trade { margin-top: 12px; color: rgba(246,244,239,.72); font-size: 15px; max-width: 60ch; }
.next { margin-top: 20px; border: 1px solid rgba(201,162,79,.55); border-radius: 12px; padding: 12px 14px; max-width: 60ch; }
.next .lab { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); font-weight: 600; margin-bottom: 3px; }
.role .q { font-family: var(--serif); font-size: clamp(19px, 3vw, 23px); margin-top: 24px; color: var(--cream); max-width: 34ch; }
.wa {
  display: inline-block; margin-top: 18px; background: var(--gold); color: #fff; padding: 11px 18px;
  border-radius: var(--r-pill); text-decoration: none; font-weight: 600; font-size: 14px;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.wa:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,.35); }

/* ---- footer ------------------------------------------------------------- */
.foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--slate); }
.foot .prov { font-size: 14px; color: var(--ink-2); max-width: 70ch; }
.foot .contact { margin-top: 14px; line-height: 1.5; }
.foot .contact b { color: var(--ink); font-weight: 600; }
.foot .disc { margin-top: 12px; font-size: 11px; line-height: 1.5; max-width: 90ch; }

/* ---- advisor panel ------------------------------------------------------ */
.advisor-card { border-color: var(--gold); background: var(--well); }
.advisor-card h3 { display: flex; align-items: center; gap: 10px; }
.advisor-card h3 .pill { font-family: var(--sans); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--gold); border-radius: var(--r-pill); padding: 3px 9px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 12px; }
.tbl th, .tbl td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; font-variant-numeric: tabular-nums; }
.tbl th:first-child, .tbl td:first-child { text-align: left; color: var(--slate); font-weight: 400; }
.tbl thead th { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); border-bottom: 1px solid var(--line); font-weight: 600; }
.tbl thead th.a { color: var(--a); } .tbl thead th.b { color: var(--b); }
.tbl-wrap { overflow-x: auto; }
.adv-list { list-style: none; margin-top: 8px; font-size: 13.5px; }
.adv-list li { padding: 5px 0 5px 16px; position: relative; border-bottom: 1px solid var(--line-2); }
.adv-list li::before { content: ""; position: absolute; left: 0; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.adv-h { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-top: 18px; }
.objection { margin-top: 8px; font-size: 14px; }
.objection .qte { font-family: var(--serif); font-size: 16px; color: var(--ink); }
pre.msg {
  white-space: pre-wrap; font: 13px/1.5 var(--sans); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 14px; margin-top: 8px; color: var(--ink-2);
}

/* ---- error, toast, reveal ---------------------------------------------- */
.error-card { text-align: center; padding: 44px 22px; }
.error-card h2 { font-size: 24px; margin-bottom: 8px; }
.error-card p { color: var(--slate); max-width: 46ch; margin: 0 auto; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(16px); z-index: 80;
  background: var(--ink); color: var(--cream); padding: 10px 16px; border-radius: var(--r-pill);
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.on { opacity: 1; transform: none; }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 720px) {
  .grid2, .fit, .money { grid-template-columns: 1fr; }
  .wrap { padding: 16px 14px 60px; }
  .card { padding: 16px 16px; border-radius: 14px; }
  .topbar { padding: 10px 14px; }
  .actions .btn { padding: 6px 10px; font-size: 12px; }
  .hero { padding-top: 22px; }
  .role { padding: 22px 18px; }
}

/* ---- print --------------------------------------------------------------- */
@page { size: A4; margin: 14mm 12mm; }
@media print {
  body { background: #fff; font-size: 12.5px; }
  .topbar, .toast, .client-banner, .wa, .chart-tip { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card, .role, .pj { break-inside: avoid; page-break-inside: avoid; }
  .step { break-after: avoid; page-break-after: avoid; }
  .card { box-shadow: none; }
  .role { background: #fff; color: var(--ink); border: 1px solid var(--line); }
  .role::before { display: none; }
  .role h2, .role .q { color: var(--ink); }
  .role .trade { color: var(--ink-2); }
  .role .step { color: var(--gold); }
  .next { border-color: var(--gold); }
  .next .lab { color: var(--gold); }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .advisor-only { display: none !important; }
  body.print-advisor:not(.preview) .advisor-only { display: block !important; }
}

/* ---- reduced motion -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
