/* IDLEWHARF landing ("/") — "tidal lock": fixed 3D stage behind, hero copy + HUD over it, glass panels below. */

.home { background: var(--bg); }

/* ---------- fixed stage ---------- */
.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(120% 90% at 66% 38%, #0f1b27 0%, #070B10 62%); }
.lock-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.1s ease; }
.stage.is-ready .lock-canvas { opacity: 1; }
.stage-dim { position: absolute; inset: 0; background: #070B10; opacity: var(--dim, 0); pointer-events: none; }
.stage.is-scrolled .lock-canvas { filter: blur(calc(var(--dimblur, 0) * 1px)); }
.poster { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 34vw; opacity: .9; transition: opacity .8s; }
.poster-lock { width: min(44vw, 620px); height: auto; filter: drop-shadow(0 30px 60px rgba(127, 227, 216, .08)); }
.stage.is-ready .poster { opacity: 0; }
.gl .poster { opacity: 0; }
.no-gl .poster { opacity: .9; }
/* desktop fallback: a frame rendered from the real scene (landing/poster.webp, 1600×1000, same placement as the live canvas) */
@media (min-width: 761px) {
  .no-gl .poster { padding: 0; background: url(/landing/poster.webp) 50% 50% / cover no-repeat; opacity: 1; }
  .no-gl .poster-lock { display: none; }
}

/* ---------- callouts (desktop) ---------- */
.callouts { position: absolute; inset: 0; pointer-events: none; visibility: hidden; opacity: var(--co, 1); transition: opacity .25s; }
.callouts.is-on { visibility: visible; }
.no-gl .callouts, .stage:not(.is-ready) .callouts { display: none; }
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.leaders polyline { fill: none; stroke: rgba(127, 227, 216, .55); stroke-width: 1; }
.callout { position: absolute; left: 0; top: 0; will-change: transform; }
.c-dot { position: absolute; left: -3.5px; top: -3.5px; width: 7px; height: 7px; border-radius: 50%; background: #7FE3D8; box-shadow: 0 0 0 3px rgba(127, 227, 216, .16); }
.c-box { position: absolute; min-width: 200px; padding: 8px 12px 9px; font-family: var(--f-mono); background: rgba(7, 11, 16, .5); border: 1px solid rgba(127, 227, 216, .28); border-radius: 3px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); white-space: nowrap; }
.c-box .label { color: var(--accent); font-size: 10.5px; }
.c-val { margin-top: 5px; font-size: 19px; font-weight: 350; letter-spacing: -.01em; color: var(--ink); }
.c-val .unit { font-size: 10.5px; color: var(--ink-3); letter-spacing: .08em; }
.c-k { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.c-sub { margin-top: 4px; font-size: 11.5px; color: var(--ink-2); }
.c-box { left: 0; top: 0; }

/* ---------- top bar over the stage ---------- */
.home .topbar { position: absolute; top: 0; left: 0; right: 0; background: linear-gradient(180deg, rgba(7, 11, 16, .75), rgba(7, 11, 16, 0)); border-bottom: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------- hero ---------- */
main { position: relative; z-index: 1; }
.hero::before { content: ''; position: absolute; left: 50%; width: 100vw; transform: translateX(-50%); bottom: 0; height: 42%; background: linear-gradient(180deg, rgba(7, 11, 16, 0), rgba(7, 11, 16, .82) 62%); pointer-events: none; z-index: -1; }
.hero { position: relative; isolation: isolate; min-height: max(640px, 100svh); display: grid; grid-template-rows: 1fr auto; padding: 96px var(--gutter) 22px; max-width: 1480px; margin: 0 auto; }
.hero-copy { align-self: center; max-width: 560px; padding-bottom: 6vh; }
.hero-copy .kicker { color: var(--ink-3); }
.hero h1 { margin-top: 18px; font-size: clamp(40px, 4.7vw, 70px); line-height: 1.02; font-weight: 300; letter-spacing: -.045em; color: var(--ink); text-wrap: balance; }
.hero h1 span { color: #fff; font-weight: 350; }
.hero .lead { margin-top: 22px; font-size: 17.5px; line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* HUD strip */
.hud { font-family: var(--f-mono); }
.banners { display: grid; gap: 8px; margin-bottom: 12px; max-width: 760px; }
.banners:not(:has(.notice:not([hidden]))) { display: none; }
.hud-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px; }
.cell { display: grid; grid-template-rows: auto auto auto 1fr; min-width: 0; }
.bar { display: block; height: 1px; background: var(--rule-2); position: relative; margin-bottom: 11px; }
.bar b { position: absolute; left: 0; top: -0.5px; height: 2px; width: var(--w, 0%); background: var(--accent); box-shadow: 0 0 8px rgba(127, 227, 216, .5); transition: width 1.2s cubic-bezier(.2, .7, .2, 1); }
.gasbar b { background: var(--gas); box-shadow: none; }
.cell .label { font-size: 10.5px; }
.cell .val { display: flex; align-items: baseline; gap: 7px; margin-top: 6px; font-size: clamp(22px, 2.1vw, 30px); font-weight: 330; letter-spacing: -.02em; white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; }
.cell .val .unit { font-size: 10.5px; letter-spacing: .1em; color: var(--ink-3); font-weight: 400; }
.cell .val .tail, .c-val .tail, .c-sub .tail { color: var(--ink-3); }
.cell .sub { margin-top: 6px; font-size: 11px; line-height: 1.45; color: var(--ink-3); }
.hud-gate { display: none; }
.ticks { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 4px 26px; font-size: 11.5px; color: var(--ink-2); border-top: 1px solid var(--rule); padding-top: 10px; }
.ticks li { display: flex; gap: 8px; min-width: 0; }
.ticks .k { color: var(--ink-3); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; padding-top: 1px; }
.ticks .v .sep { color: var(--ink-3); margin: 0 .45em; }
.is-stale .val, .is-stale .c-val { opacity: .45; }

/* ---------- sections over the dimmed stage ---------- */
.sections { max-width: 1180px; margin: 0 auto; padding: 40px var(--gutter) 0; display: grid; gap: 22px; }
.panel { padding: 22px 24px 24px; border-radius: 6px; }
.panel .sec-head { margin-top: -4px; border-top: 0; padding-top: 0; border-bottom: 1px solid var(--rule); padding-bottom: 10px; }
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.p-lead { color: var(--ink-2); font-size: 15.5px; }

/* try */
.try-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 26px; }
.try-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-top: 18px; }
.try-run { height: 42px; padding: 0 20px; }
.curl { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 7px 8px 7px 12px; border: 1px solid var(--rule-2); border-radius: var(--radius); background: rgba(4, 9, 14, .6); }
.curl-line { flex: 1; min-width: 0; background: none; border: 0; padding: 0; font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.curl-line::-webkit-scrollbar { display: none; }
.curl-line::before { content: '$ '; color: var(--accent); }
.tiers { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 18px 0 0; font-size: 13.5px; color: var(--ink-2); }
.tiers dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); padding-top: 3px; }
.tiers dd { margin: 0; }
.try-pay { margin-top: 18px; }
.try-out { min-width: 0; }
.verdict { font-family: var(--f-mono); font-size: 13px; line-height: 1.55; color: var(--ink); }
.verdict.muted { color: var(--ink-3); }
.verdict .vk { display: inline-block; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; border: 1px solid var(--accent); color: var(--accent); padding: 0 7px; margin-right: 9px; border-radius: 2px; }
.verdict.is-err { color: var(--warn-ink); }
.json { margin-top: 10px; max-height: 380px; }

/* tape */
.tape .move { display: inline-flex; gap: 8px; align-items: baseline; }
.tape .tx a { text-decoration: none; color: var(--ink-2); }
.tape .tx a:hover { color: var(--accent); }
.tape .amt-gas { color: var(--gas); }
.tape tr.in .move { color: var(--accent); }
.tape .empty-row td { white-space: normal; padding: 18px 0; font-family: var(--f-text); font-size: 16px; line-height: 1.5; color: var(--ink); }
.tape .empty-row .muted { display: block; font-size: 14px; margin-top: 4px; }
.tape-note { margin-top: 12px; }

/* rule */
.rule-list { margin: 0; padding-left: 1.4em; font-size: 16.5px; line-height: 1.5; color: var(--ink); }
.rule-list li + li { margin-top: 8px; }
.rule-list li::marker { font-family: var(--f-mono); font-size: 12px; color: var(--accent); }
.calc { margin-top: 20px; }
.calc-body { margin-top: 8px; padding: 4px 14px; font-size: 12px; line-height: 1.5; }
.c-row { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 0; align-items: baseline; }
.c-row + .c-row { border-top: 1px solid var(--rule); }
.c-n { color: var(--ink); }
.c-f { color: var(--ink-3); min-width: 0; }
.c-r { font-weight: 500; text-align: right; white-space: nowrap; color: var(--accent); }
.calc-verdict { margin-top: 14px; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.calc-verdict b { color: var(--ink); font-weight: 500; }
.calc-verdict .mono { font-size: .86em; color: var(--ink); }
.params { margin-top: 14px; font-family: var(--f-mono); font-size: 11.5px; }

/* chart */
.chart-box { min-height: 150px; }
.chart-svg { width: 100%; height: auto; overflow: visible; font-family: var(--f-mono); }
.chart-svg .grid { stroke: var(--rule); stroke-width: 1; }
.chart-svg .axis { fill: var(--ink-3); font-size: 10px; }
.chart-svg .l-vault { fill: none; stroke: #7FE3D8; stroke-width: 1.6; }
.chart-svg .l-wallet { fill: none; stroke: var(--gas); stroke-width: 1.3; stroke-dasharray: 4 3; }
.chart-svg .a-vault { fill: rgba(127, 227, 216, .1); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; color: var(--ink-3); }
.key { display: inline-block; width: 16px; height: 0; border-top: 2px solid #7FE3D8; vertical-align: middle; margin-right: 8px; transform: translateY(-2px); }
.key-wallet { border-top: 2px dashed var(--gas); }

/* contract + risk */
.contract .prose { color: var(--ink-2); font-size: 15.5px; }
.panel.risk { padding: 0; }
.risk .warnbox { background: rgba(14, 12, 10, .55); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); border-radius: 6px; padding: 22px 24px 20px; }
.risk-list { list-style: none; padding: 0; margin: 12px 0 14px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.risk-list li { padding: 9px 0; border-top: 1px solid rgba(242, 166, 90, .16); }
.risk-list li:first-child { border-top: 0; padding-top: 2px; }
.risk-list b { font-weight: 500; color: var(--ink); }

/* stub marker (local dev only) */
.stub-badge { position: fixed; left: 12px; bottom: 12px; z-index: 70; background: var(--warn); color: #120c06; font: 600 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 7px 9px; pointer-events: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .try-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .duo { grid-template-columns: minmax(0, 1fr); }
  .hud-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
}
@media (max-width: 760px) {
  /* object upper-centre (scene layout), headline above it, HUD 2×2 under it; callouts collapse into the HUD */
  .callouts { display: none; }
  .poster { padding: 0 0 18vh; }
  .poster-lock { width: 78vw; }
  .hero { padding: 104px var(--gutter) 18px; min-height: max(700px, 100svh); grid-template-rows: auto 1fr auto; }
  .hero-copy { align-self: start; padding-bottom: 0; }
  .hero h1 { font-size: 34px; margin-top: 12px; }
  .hero .lead { display: none; }
  .hero-cta { display: none; }
  .hero::after { content: ''; }
  .hud { grid-row: 3; }
  .hud-gate { display: block; margin: 12px 0 0; font-size: 11px; color: var(--ink-2); border-top: 1px solid var(--rule); padding-top: 9px; }
  .cell .val { font-size: 21px; }
  .cell .sub { display: none; }
  .ticks { gap: 2px 16px; font-size: 11px; }
  .ticks li[data-t='read'], .ticks li[data-t='sweep'] { display: none; }
  .ticks li[data-t='read']:has(.warn-text) { display: flex; }
  .home .hero .kicker { font-size: 10px; }
}
@media (max-width: 640px) {
  .panel { padding: 18px 16px 20px; }
  .try-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .try-run { grid-column: 1 / -1; }
  .try-pay .btn { width: 100%; white-space: normal; height: auto; min-height: 40px; padding: 9px 12px; text-align: center; }
  .c-row { grid-template-columns: minmax(0, 1fr) auto; }
  .c-f { grid-column: 1 / -1; grid-row: 2; font-size: 11px; }
  table.tide { font-size: 12px; }
  .tiers { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tiers dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .lock-canvas { transition: none; }
}

/* dev: ?poster renders the scene alone (to capture poster.webp) */
.poster-mode main, .poster-mode .topbar, .poster-mode .footer, .poster-mode .callouts, .poster-mode .stub-badge { display: none !important; }

/* ---------- measured layouts (hero.js): side = lock right of the text; stacked = lock between headline and HUD ---------- */
.stage.co-off .callouts { display: none; }
.hero.co-off .hud-gate { display: block; margin: 12px 0 0; font-size: 11.5px; color: var(--ink-2); border-top: 1px solid var(--rule); padding-top: 9px; }
.hero.is-stacked { grid-template-rows: auto minmax(230px, 1fr) auto; min-height: max(560px, 100svh); padding-top: 92px; }
.hero.is-stacked .hero-copy { align-self: start; padding-bottom: 0; max-width: 820px; }
.hero.is-stacked h1 { font-size: clamp(32px, 5.2vw, 52px); margin-top: 12px; }
.hero.is-stacked .lead { font-size: 16px; margin-top: 14px; max-width: 60ch; }
.hero.is-stacked .hero-cta { margin-top: 18px; }
.hero.is-stacked .hud { grid-row: 3; }
.hero.is-stacked .cell .sub { display: none; }
.hero.is-stacked .cell .val { font-size: clamp(20px, 3vw, 26px); }
@media (min-width: 600px) {
  .hero.is-stacked .hud-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 18px; }
}
/* short or narrow stacked windows: keep the headline, fold the lead + buttons (the Try panel is right below) */
@media (max-height: 899px), (max-width: 759px) {
  .hero.is-stacked .lead, .hero.is-stacked .hero-cta { display: none; }
}
@media (max-width: 760px) {
  .hero.is-stacked { padding-top: 104px; }
  .hero.is-stacked h1 { font-size: 34px; }
}
