/* CouchWand wrapper site. Default HTML is the no-JS-safe state; JS adds html.js. */
:root {
  --night: #1E0E1B;
  --nightSoft: #34182E;
  --aubergine: #4B2342;
  --paper: #F6EAD0;
  --paperDim: #C8B79B;
  --ion: #E3A92F;        /* mustard; token name kept */
  --mustardDeep: #C98F22;
  --ember: #EC7A42;      /* rust; token name kept */
  --ink: #2B2118;
  --graphite: #9C8795;
  /* rgb channels, so translucent tints live in one place */
  --night-rgb: 30, 14, 27;
  --soft-rgb: 52, 24, 46;
  --aubergine-rgb: 75, 35, 66;
  --ion-rgb: 227, 169, 47;
  --ember-rgb: 236, 122, 66;
  --graphite-rgb: 156, 135, 149;
  --display: system-ui, -apple-system, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 5vw, 80px);
  --bar: 60px;
  --hair: rgba(var(--graphite-rgb), .38);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--night); color-scheme: dark; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; background: var(--night); color: var(--paper);
  font: 400 clamp(15px, 1.25vw, 18px)/1.5 var(--display);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { max-width: 100%; }
a { color: var(--ion); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ion); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
#main:focus { outline: none; }
::selection { background: var(--ion); color: var(--ink); }

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 200; padding: 12px 16px; min-height: 44px;
  background: var(--paper); color: var(--night); font-weight: 700; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.mono, .kicker, .pill, .endorse, .hint, .req, .gate-label, .tlabel, .tip, .legal, .foot-brand .mono {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .14em;
}

/* ---------- backdrop and canvas ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% 50%, rgba(var(--ion-rgb), .14), rgba(var(--ion-rgb), 0) 70%),
    linear-gradient(180deg, var(--night) 0%, var(--aubergine) 58%, var(--night) 100%);
}
.backdrop::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--ion) 18%, var(--ion) 82%, transparent);
  box-shadow: 0 0 22px 2px rgba(var(--ion-rgb), .45);
}
html.js:not(.no-webgl) .backdrop { display: none; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; background: var(--night); }
html:not(.js) #stage, html.no-webgl #stage { display: none; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 30; height: var(--bar);
  display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right));
  background: rgba(var(--night-rgb), .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 26px; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--night-rgb), .94), rgba(var(--night-rgb), 0));
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--paper); text-decoration: none; flex: none; }
.brand-icon { width: 28px; height: 28px; border-radius: 7px; display: block; }
.brand-name { font-weight: 800; letter-spacing: -.02em; font-size: 16px; }
.endorse { font-size: 11px; color: var(--paperDim); white-space: nowrap; }
.pill {
  margin-left: 8px; display: inline-flex; align-items: center; gap: 9px; min-width: 0;
  padding: 6px 12px; font-size: 11px; color: var(--paperDim); white-space: nowrap;
  border: 1px solid var(--hair); border-radius: 999px; background: rgba(var(--soft-rgb), .55);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--graphite); flex: none; transition: background .4s, box-shadow .4s; }
html.paired .pill-dot { background: var(--ion); box-shadow: 0 0 8px var(--ion); }
.pill-name { color: var(--paper); }
html:not(.js) .pill { display: none; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.tbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; min-height: 44px; padding: 0 12px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--paper); text-decoration: none;
  background: rgba(var(--soft-rgb), .55); border: 1px solid var(--hair); border-radius: 999px;
  transition: border-color .2s, color .2s, background .2s;
}
.tbtn:hover { border-color: var(--paper); }
.tbtn[aria-pressed="true"] { color: var(--ion); border-color: var(--ion); }
.tbtn[disabled] { opacity: .4; cursor: default; }
.tlabel { font-size: 11px; }
.tbtn-cta { background: var(--ion); border-color: var(--ion); color: var(--ink); padding: 0 16px; font-weight: 800; }
.tbtn-cta:hover { background: var(--mustardDeep); border-color: var(--mustardDeep); }
#sound-toggle .wave { opacity: .3; }
#sound-toggle[aria-pressed="true"] .wave { opacity: 1; }

/* ---------- progress rail ---------- */
.rail { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 25; }
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail a { position: relative; display: flex; align-items: center; justify-content: flex-end; width: 44px; height: 30px; text-decoration: none; }
.tick { display: block; width: 14px; height: 2px; background: var(--graphite); opacity: .7; transition: width .25s, background .25s, opacity .25s; }
.rail a:hover .tick, .rail a:focus-visible .tick { width: 24px; opacity: 1; }
.rail a[aria-current="true"] .tick { width: 28px; background: var(--ion); opacity: 1; box-shadow: 0 0 10px rgba(var(--ember-rgb), .75); }
.tip {
  position: absolute; right: 44px; font-size: 11px; color: var(--paper); white-space: nowrap;
  padding: 3px 8px; background: rgba(var(--night-rgb), .85); border-radius: 4px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.rail a:hover .tip, .rail a:focus-visible .tip { opacity: 1; }
html:not(.js) .rail { display: none; }

/* ---------- chapters ---------- */
main { position: relative; z-index: 2; }
.chapter { position: relative; height: 220vh; }
.chapter.last { height: 170vh; }
.stick {
  position: sticky; top: 0; height: 100vh; display: flex; align-items: center;
  padding: calc(var(--bar) + 2vh) var(--gutter) 4vh;
}
.chapter[data-side="right"] .stick { justify-content: flex-end; }
.panel { position: relative; isolation: isolate; width: min(40rem, 46vw); }
.panel-wide { width: min(44rem, 54vw); }
.panel-final { width: min(60rem, calc(66vw - var(--gutter))); }
@media (min-width: 900px) { .chapter[data-side="right"] .panel { margin-right: 44px; } }

/* soft halo behind text, not a box */
.panel::before {
  content: ""; position: absolute; z-index: -1; inset: -8vh -5vw; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--night-rgb), .84) 0%, rgba(var(--night-rgb), .66) 55%, rgba(var(--night-rgb), 0) 100%);
}
.panel { text-shadow: 0 1px 14px rgba(var(--night-rgb), .7); }

.kicker { display: flex; align-items: center; gap: 12px; margin: 0 0 .9em; font-size: 12px; color: var(--ion); }
.kicker::before { content: ""; width: 28px; height: 2px; background: var(--ember); flex: none; }

h1, h2 {
  margin: 0 0 .4em; font-family: var(--display); font-weight: 800;
  font-size: clamp(36px, 5.6vw, 84px); line-height: .95; letter-spacing: -.04em;
  text-wrap: balance; overflow-wrap: break-word; color: var(--paper);
}
#honest h2 { font-size: clamp(34px, 4.2vw, 62px); }
.lede { margin: 0 0 1.1em; color: var(--paper); max-width: 34em; }
.cue { margin: 1.6em 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--paperDim); }
.cue::after { content: ""; display: block; width: 1px; height: 34px; margin-top: 10px; background: linear-gradient(var(--ion), transparent); }

.shot { margin: 1.2em 0 0; width: fit-content; max-width: 100%; }
.shot img {
  display: block; width: auto; height: auto; max-height: 30vh; max-width: 100%;
  border-radius: 12px; border: 1px solid var(--hair); background: var(--nightSoft);
}
.shot-wide img { max-height: 26vh; }
.hint { display: none; margin: 1em 0 0; font-size: 11px; color: var(--paperDim); }
html.js:not(.no-webgl):not(.calm) .hint { display: block; }
@media (hover: none) and (pointer: coarse) { html .hint { display: none !important; } }

/* honest list */
.fine { list-style: none; margin: 0; padding: 0; font-size: 1em; }
.fine li { position: relative; padding: 0 0 0 22px; margin: 0 0 .7em; }
.fine li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 2px; background: var(--ion); }
.fine li.caution::before { background: var(--ember); box-shadow: 0 0 8px rgba(var(--ember-rgb), .6); }

/* seated CTA */
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 .8em; }
.badge { display: inline-flex; align-items: center; min-height: 48px; }
.badge img { display: block; height: 48px; width: auto; }
.alt { margin: 0 0 1.4em; font-size: .9em; }
.alt a { display: inline-block; padding: 12px 0; }
.req { margin: 0 0 .9em; font-size: 11px; line-height: 1.8; color: var(--paperDim); }
.note { margin: 0 0 1.4em; color: var(--paperDim); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  font: inherit; font-weight: 700; color: var(--paper); text-decoration: none; cursor: pointer;
  border: 1px solid var(--paper); border-radius: 999px; background: transparent; text-shadow: none;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--paper); color: var(--ink); }
.btn-primary { background: var(--ion); border-color: var(--ion); color: var(--ink); }
.btn-primary:hover { background: var(--mustardDeep); border-color: var(--mustardDeep); color: var(--ink); }
.btn-ghost { border-color: var(--hair); color: var(--paperDim); font-weight: 600; }

/* reveals: content is visible by default; main.js adds html.reveal */
html.reveal:not(.calm) .rv { transition: opacity .8s ease, transform .8s ease; transition-delay: calc(var(--i, 0) * 90ms); }
html.reveal:not(.calm) .chapter:not(.is-in) .rv { opacity: 0; transform: translateY(18px); }
.panel > .rv:nth-child(2) { --i: 1; }
.panel > .rv:nth-child(3) { --i: 2; }
.panel > .rv:nth-child(4) { --i: 3; }
.panel > .rv:nth-child(5) { --i: 4; }
.panel > .rv:nth-child(6) { --i: 5; }
.panel > .rv:nth-child(7) { --i: 6; }
html.calm *, html.calm *::before, html.calm *::after { animation: none !important; transition: none !important; }

/* ---------- questions and footer ---------- */
.questions { position: relative; z-index: 3; background: var(--night); padding: clamp(64px, 12vh, 140px) var(--gutter); }
.questions::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 16vh; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--night-rgb), 0) 0%, rgba(var(--night-rgb), .35) 45%, var(--night) 100%);
}
.nw { white-space: nowrap; }
.q-wrap { max-width: 52rem; margin: 0 auto; }
.questions h2 { font-size: clamp(32px, 4.6vw, 64px); margin-bottom: .6em; }
.faq details { border-bottom: 1px solid var(--hair); }
.faq details:first-child { border-top: 1px solid var(--hair); }
.faq summary {
  position: relative; list-style: none; cursor: pointer; min-height: 56px; padding: 16px 48px 16px 0;
  font-weight: 700; font-size: 1.05em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font: 400 24px/1 var(--mono); color: var(--ion); transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: 0 0 1.2em; max-width: 42em; color: var(--paperDim); }
.faq details p a { display: inline-block; padding: 2px 0; }

.site-footer { position: relative; z-index: 3; background: var(--night); border-top: 1px solid var(--hair); padding: 48px var(--gutter) 96px; }
.foot-wrap { max-width: 72rem; margin: 0 auto; }
.foot-brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 0 0 20px; }
.foot-brand strong { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.foot-brand .mono { font-size: 11px; color: var(--paperDim); }
.foot-links { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 0 22px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--paper); text-decoration: none; font-size: 15px; overflow-wrap: anywhere; }
.foot-links a:hover { color: var(--ion); text-decoration: underline; }
.legal { max-width: 52rem; margin: 0; font-size: 11px; line-height: 1.8; letter-spacing: .06em; color: var(--paperDim); text-transform: none; font-family: var(--display); }

/* ---------- pairing gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(var(--night-rgb), .94); transition: opacity .6s ease;
}
.gate.is-out { opacity: 0; pointer-events: none; }
.gate:focus { outline: none; }
.gate-close {
  position: absolute; top: 12px; right: 12px; width: 48px; height: 48px; display: grid; place-items: center;
  color: var(--paperDim); background: transparent; border: 1px solid var(--hair); border-radius: 50%; cursor: pointer;
}
.gate-close:hover { color: var(--paper); border-color: var(--paper); }
.gate-card { width: min(100%, 26rem); text-align: center; }
.gate-label { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px; font-size: 12px; color: var(--paperDim); }
.gate-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--graphite); transition: background .4s, box-shadow .4s; }
.gate.is-connected .gate-dot { background: var(--ion); box-shadow: 0 0 14px var(--ion); }
.gate.is-connected .gate-label { color: var(--ion); }
.gate-digits { display: flex; justify-content: center; gap: clamp(6px, 2vw, 10px); margin: 0 0 32px; }
.gd {
  width: clamp(38px, 11vw, 48px); height: clamp(52px, 15vw, 64px); display: grid; place-items: center;
  font: 500 clamp(24px, 7vw, 32px)/1 var(--mono); color: var(--paper);
  border: 1px solid var(--graphite); border-radius: 10px; background: var(--nightSoft);
  transition: border-color .2s, box-shadow .2s;
}
.gd.on { border-color: var(--ion); box-shadow: 0 0 14px rgba(var(--ion-rgb), .25); }
.gate.is-connected .gd { border-color: var(--ion); }
.gate-actions { display: flex; flex-direction: column; gap: 12px; opacity: 0; transform: translateY(10px); visibility: hidden; transition: opacity .5s, transform .5s, visibility 0s .5s; }
.gate.is-connected .gate-actions { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }

/* ---------- 404 ---------- */
.page-404 .nf { position: relative; z-index: 2; min-height: 100vh; display: flex; align-items: center; padding: calc(var(--bar) + 24px) var(--gutter) 48px; }
.page-404 .panel { width: min(40rem, 100%); }

/* ---------- narrow, portrait, short ---------- */
@media (max-width: 1000px) { .tlabel { display: none; } }
@media (max-width: 860px) { .pill-name { display: none; } }
@media (max-width: 720px) {
  .tbtn-cta { padding: 0 14px; }
  .stick { padding-right: 52px; }
  .questions, .site-footer { padding-right: 52px; }
}
@media (max-width: 899px) { .rail { display: none; } }
@media (max-width: 719px) { .endorse { display: none; } }
@media (max-width: 420px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .topbar { gap: 8px; }
  .pill { margin-left: 0; padding: 6px 10px; }
}

/* text sits in the lower part of the screen when portrait */
@media (max-aspect-ratio: 1/1) {
  .stick { align-items: flex-end; justify-content: flex-start !important; padding-bottom: 5vh; }
  .panel, .panel-wide, .panel-final { width: 100%; margin-right: 0 !important; }
  .panel::before {
    inset: -9vh calc(-1 * var(--gutter)) -9vh;
    background: linear-gradient(180deg, rgba(var(--night-rgb), 0) 0%, rgba(var(--night-rgb), .66) 32%, rgba(var(--night-rgb), .8) 70%, rgba(var(--night-rgb), 0) 100%);
  }
  .shot img { max-height: 20vh; }
  .shot-wide img { max-height: 16vh; }
  h1, h2 { margin-bottom: .3em; }
  #honest h2 { font-size: clamp(32px, 9vw, 52px); }
}
@media (max-aspect-ratio: 1/1) and (max-width: 720px) { .panel::before { right: -52px; } }
@media (max-height: 560px) { .shot { display: none; } }

/* tall content flows normally instead of sticking where it would be cut off */
@media (max-width: 899px), (max-height: 760px) {
  #honest.chapter { height: auto; }
  #honest .stick { position: relative; height: auto; min-height: 100vh; padding-top: calc(var(--bar) + 8vh); padding-bottom: 10vh; }
}
@media (max-width: 899px) and (max-aspect-ratio: 1/1), (max-height: 640px) {
  #seated.chapter { height: auto; }
  #seated .stick { position: relative; height: auto; min-height: 100vh; padding-top: calc(var(--bar) + 8vh); padding-bottom: 20vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .panel::before { display: none; }
}
