/* ===== Tokens ===== */
:root {
  --bg: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --soft: #f5f7fb;
  --navy: #1d2d5c;
  --coral: #ff7a59;
  --within: #dbe7ff;
  --within-ink: #1d2d5c;
  --above: #f2f4f7;
  --above-ink: #98a2b3;
  --radius: 12px;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --t2: #1d2d5c; --t3: #0e9384; --t4: #ff7a59;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
section.wrap { padding-block: 28px; }
h1, h2 { font-family: var(--serif); font-weight: 400; color: var(--navy); margin: 0 0 6px; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.05; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--coral); font-weight: 600; margin: 0 0 10px; }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 20; background: #ffffffee; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-family: var(--serif); font-size: 1.3rem; color: var(--navy); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--coral); }
.agent { font-size: 13px; color: var(--muted); padding-left: 18px; border-left: 1px solid var(--line); }
.burger { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 10px; cursor: pointer; }
.burger span { display: block; height: 2px; background: var(--navy); margin: 5px 0; transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; padding-block: 36px 12px; }
.lede { font-size: 17px; max-width: 52ch; color: #344054; }
.facts { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: #344054; }
.hero-art { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 400/260; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.caption { position: absolute; right: 12px; bottom: 8px; font-size: 11px; color: var(--muted); }

/* ===== Controls ===== */
.controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 14px; align-items: end; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.controls label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: #344054; }
.controls small { font-weight: 400; color: var(--muted); }
.controls input { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; width: 100%; }
.controls input:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.actions { display: flex; gap: 8px; }
.count { grid-column: 1 / -1; margin: 0; font-size: 13px; color: #344054; }
.btn { font: inherit; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer; }
.btn:hover { background: #14204a; }
.btn.ghost { background: #fff; color: var(--navy); }
.btn.ghost:hover { background: var(--soft); }
.link { background: none; border: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; margin-top: 18px; border-block: 1px solid var(--line); }
.card { padding: 14px 16px; border-right: 1px solid var(--line); }
.card:last-child { border-right: 0; }
.card .tag { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.card .tag i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.card .from { font-size: 12px; color: var(--muted); }
.card .price { font-size: 22px; font-weight: 700; color: var(--navy); }
.card .meta { font-size: 12px; color: var(--muted); }

/* ===== Compare ===== */
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.compare { border: 1px dashed #c7cdd8; border-radius: var(--radius); padding: 18px; color: var(--muted); text-align: center; }
.compare.filled { border-style: solid; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); text-align: left; color: var(--ink); overflow: hidden; }
.cmp { padding: 16px; border-right: 1px solid var(--line); position: relative; }
.cmp:last-child { border-right: 0; }
.cmp h3 { margin: 0 0 4px; font-size: 15px; }
.cmp .big { font-size: 22px; font-weight: 700; color: var(--navy); }
.cmp dl { margin: 10px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.cmp dt { color: var(--muted); } .cmp dd { margin: 0; text-align: right; }
.cmp button { position: absolute; top: 8px; right: 8px; border: 0; background: var(--soft); border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }

/* ===== Chart ===== */
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0 0 12px; font-size: 12px; color: #344054; }
.legend li { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }
.sw.within { background: var(--within); } .sw.above { background: var(--above); }
.sw.top { background: var(--within); box-shadow: inset 0 -3px 0 var(--coral); }
.sw.pes { background: #fff; position: relative; overflow: hidden; }
.sw.pes::after { content: ""; position: absolute; top: 0; left: 0; border: 5px solid transparent; border-top-color: var(--navy); border-left-color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { font: inherit; font-size: 13px; border: 1px solid #d0d5dd; background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip i { width: 8px; height: 8px; border-radius: 50%; }
.chip small { color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip[aria-pressed="true"] small { color: #cbd5ff; }
.notice { background: #eef3ff; border: 1px solid #d5e0ff; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }

.chart-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--radius); }
table.chart { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.chart th, .chart td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid #f0f2f6; }
.chart thead th { position: sticky; top: 0; background: #fff; z-index: 3; text-align: center; border-bottom: 1px solid var(--line); vertical-align: top; }
.chart thead th .stack { font-weight: 700; color: var(--navy); background: none; border: 0; cursor: pointer; text-decoration: underline; font: inherit; font-weight: 700; }
.chart thead th .type { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.chart .lvl { position: sticky; left: 0; background: #fff; z-index: 2; text-align: center; font-weight: 600; border-right: 1px solid var(--line); }
.chart thead .lvl { z-index: 4; }
.chart td.cell { cursor: pointer; background: var(--within); color: var(--within-ink); position: relative; transition: outline .1s; }
.chart td.cell.above { background: var(--above); color: var(--above-ink); }
.chart td.cell.top { box-shadow: inset 0 -3px 0 var(--coral); font-weight: 700; }
.chart td.cell.pes::before { content: ""; position: absolute; top: 0; left: 0; border: 5px solid transparent; border-top-color: var(--navy); border-left-color: var(--navy); }
.chart td.cell.picked { outline: 2px solid var(--coral); outline-offset: -2px; font-weight: 700; }
.chart td.cell:hover { outline: 2px solid var(--navy); outline-offset: -2px; }
.chart td.empty { background: #fff; }

/* ===== Method / mix ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 14px 0 0; display: grid; gap: 16px; }
.steps li { counter-increment: s; padding-left: 40px; position: relative; font-size: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; display: grid; place-items: center; }
.steps b { display: block; }
.steps code { display: inline-block; margin-top: 6px; background: var(--soft); padding: 4px 8px; border-radius: 6px; font-size: 13px; }
.bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin: 16px 0 10px; }
.bar span { display: block; }
.mix { list-style: none; padding: 0; margin: 0; }
.mix li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mix li i { width: 10px; height: 10px; border-radius: 2px; }
.mix li span:nth-child(2) { margin-left: auto; font-weight: 700; }
.mix li span:last-child { width: 44px; text-align: right; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); margin-top: 32px; padding: 24px 0 40px; background: var(--soft); }
.fine { font-size: 12px; color: var(--muted); max-width: 70ch; }

/* ===== Site plan (3D) ===== */
.seg { display: inline-flex; gap: 2px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-b { font: inherit; font-size: 13px; border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: #344054; }
.seg-b[aria-pressed="true"] { background: #fff; color: var(--navy); font-weight: 600; box-shadow: 0 1px 3px #1d2d5c22; }
.btn[aria-pressed="false"] { background: #fff; color: var(--navy); }
.site-box { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.stage { position: relative; height: clamp(380px, 62vh, 680px); background: #eef3fb; touch-action: none; overflow: hidden; }
.stage canvas { display: block; }
#siteLabels { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.s-lbl { position: absolute; left: 0; top: 0; font-size: 11px; font-weight: 700; color: var(--navy); background: #ffffffd9; border-radius: 999px; padding: 0 6px; line-height: 18px; will-change: transform; }
.compass { position: absolute; top: 12px; right: 12px; width: 64px; height: 64px; border-radius: 50%; background: #ffffffe6; border: 1px solid var(--line); font-size: 10px; font-weight: 700; color: #344054; pointer-events: none; }
.compass span { position: absolute; }
.cn { top: 3px; left: 50%; transform: translateX(-50%); color: var(--coral); }
.cs { bottom: 3px; left: 50%; transform: translateX(-50%); }
.ce { right: 5px; top: 50%; transform: translateY(-50%); }
.cw { left: 5px; top: 50%; transform: translateY(-50%); }
.compass i { position: absolute; left: 50%; top: 50%; width: 3px; height: 28px; margin: -14px 0 0 -1.5px; background: linear-gradient(var(--coral) 50%, #98a2b3 50%); border-radius: 2px; }
.tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; transform: translate(12px, -130%); z-index: 5; }
.site-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.find { display: flex; gap: 6px; margin-left: auto; }
.find input { font: inherit; font-size: 14px; padding: 7px 12px; border: 1px solid #d0d5dd; border-radius: 999px; width: 170px; }
.find .btn { padding: 7px 14px; border-radius: 999px; }
.site-status { margin: 0; padding: 10px 14px; background: var(--soft); font-size: 13px; border-top: 1px solid var(--line); }
#siteLegend { padding: 10px 14px; margin: 0; }
@media (max-width: 720px) { .find { margin-left: 0; width: 100%; } .find input { flex: 1; width: auto; } }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero, .two-col { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr 1fr; }
  .actions { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .burger { display: block; }
  .nav { position: absolute; top: 60px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: flex-start; gap: 0; border-bottom: 1px solid var(--line); max-height: 0; overflow: hidden; transition: max-height .25s; }
  .nav.open { max-height: 320px; }
  .nav a, .agent { padding: 14px 16px; width: 100%; border: 0; border-top: 1px solid var(--line); }
  .controls { grid-template-columns: 1fr; }
  .card { border-right: 0; border-bottom: 1px solid var(--line); }
  .cmp { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media print {
  .site-header, .controls .actions, .chips, #clearCompare { display: none; }
  .chart-scroll { max-height: none; overflow: visible; }
}
