/*
  Page shell for the four quiz pages (quiz, founder, success, cancel).

  What it does: the dark ground with its two thin rings, the header with the
  path (the test, your card, Founder membership), the content column, the
  footer and page level heading sizes. The founder
  page's own parts live in /quiz/founder.css. Everything shared with the
  home page lives in /tokens.css and /components.css.

  Who loads it: /quiz/ links /tokens.css, /components.css and this file
  directly, so each sheet is fetched once. The founder, success and cancel
  pages link only /quiz/quiz.css, which imports all three for them.

  How to change it: colours, sizes, radii and timings are tokens in
  /tokens.css; this file holds layout only.
*/
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;min-height:100svh;display:flex;flex-direction:column;background:var(--bg-0);color:var(--ink-0);
  font-family:var(--f-sans);font-weight:500;font-size:var(--t-md);line-height:1.6;-webkit-font-smoothing:antialiased;overflow-x:hidden;position:relative}
/* the ground: two thin rings, drawn sharp (no blur), the same rings as the home page's hero */
body::before,body::after{content:"";position:fixed;border-radius:50%;pointer-events:none;z-index:0;border:1px solid var(--line-0)}
body::before{width:90vmax;height:90vmax;right:-46vmax;top:-52vmax}
body::after{width:58vmax;height:58vmax;right:-30vmax;top:-36vmax;border-color:var(--line-1)}
a{color:inherit}
button{font:inherit;cursor:pointer}
h1,h2,h3{margin:0;font-weight:700}
p{margin:0}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--ai-0);outline-offset:3px;border-radius:var(--r-sm)}
.skip{position:fixed;left:16px;top:-60px;z-index:100;background:var(--ink-0);color:var(--bg-0);padding:10px 16px;border-radius:var(--r-pill);text-decoration:none;font-weight:700;transition:transform var(--dur-base)}
.skip:focus{transform:translateY(72px)}

/* header and footer */
.q-header{position:relative;z-index:2;min-height:var(--header-h);display:flex;align-items:center;border-bottom:1px solid var(--line-0);background:var(--bg-0)}
.q-header .col{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:0 20px}
.brand{display:inline-flex;align-items:center;min-height:var(--tap);text-decoration:none}
.brand svg{width:72px;height:auto}
.q-out{display:inline-flex;align-items:center;min-height:var(--tap);font-size:var(--t-sm);font-weight:700;color:var(--ink-1);text-decoration:underline;text-underline-offset:4px;text-decoration-color:var(--line-1);transition:color var(--dur-fast)}
.q-out:hover{color:var(--ink-0)}
/* the path: where this page sits between the test and Founder membership. Words joined by a thin rule; the step in hand is bright,
   a step already done is a link back to it. On phones it takes its own row under the logo. */
.q-path{order:3;flex:1 0 100%;border-top:1px solid var(--line-0);margin:0 calc(var(--gutter) * -1);padding:0 var(--gutter)}
.q-path ol{list-style:none;margin:0;padding:0;display:flex;align-items:center;min-height:var(--tap);gap:10px}
.q-path li{display:flex;align-items:center;gap:10px;font-family:var(--f-mono);font-size:var(--t-xs);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-2);white-space:nowrap}
.q-path li + li::before{content:"";width:clamp(12px,4vw,36px);height:1px;background:var(--line-1)}
.q-path a{display:inline-flex;align-items:center;min-height:var(--tap);color:var(--ink-1);text-decoration:underline;text-underline-offset:4px;text-decoration-color:var(--line-1)}
.q-path a:hover{color:var(--ink-0)}
.q-path [aria-current]{color:var(--ink-0)}
.q-path [aria-current] span{padding-bottom:3px;background:linear-gradient(var(--warm-0),var(--warm-0)) 0 100%/100% 2px no-repeat}
/* the last step is a flex link, which drops the space before " membership" at every width, so it is put back here (one place) */
.q-path a > .q-path-x{margin-left:.6em}
/* narrow phones: the path stays on one line (tighter spacing, and the last step reads Founder) */
@media(max-width:419px){
  .q-path ol,.q-path li{gap:6px}
  .q-path li{letter-spacing:.03em}
  .q-path li + li::before{width:10px}
  .q-path [aria-current] .q-path-x{padding:0;background:none}
}
@media(max-width:379px){
  .q-path-x{display:none}
}
@media(min-width:860px){
  .q-path{order:0;flex:0 1 auto;border-top:0;margin:0;padding:0}
}
.q-footer{position:relative;z-index:2;margin-top:auto;border-top:1px solid var(--line-0);padding:20px 0 28px}
.q-footer .col{display:flex;flex-wrap:wrap;gap:4px 24px;align-items:center;font-size:var(--t-sm);color:var(--ink-2)}
.q-footer a{display:inline-flex;align-items:center;min-height:var(--tap);color:var(--ink-1);text-decoration:none;transition:color var(--dur-fast)}
.q-footer a:hover{color:var(--ink-0)}

/* /quiz/: the question asked before leaving part way through */
.q-leave{position:relative;z-index:2;background:var(--bg-2);border-bottom:1px solid var(--line-1);padding:14px 0}
.q-leave .col{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 20px}
.q-leave p{font-weight:700;font-size:var(--t-base)}
.q-leave p:focus{outline:none}
.q-leave-row{display:flex;flex-wrap:wrap;gap:10px}

.col{width:100%;max-width:640px;margin:0 auto;padding:0 var(--gutter)}
.col.wide{max-width:960px}
/* the quiz needs room for the deck beside its answers, and the result is wider still:
   header and footer follow so the logo lines up with the content */
.quiz-page .col{max-width:1180px}

/* ── /quiz/ only: the test on the left, what it reads on the right ──
   The side holds the card waiting face down, the four things being read (the one in hand lit by the page script from the quiz's
   onStep hook) and the next step. From 1040px it stands beside the quiz and stays in view; below that it follows the quiz.
   Once the card is shown (body[data-step="result"]) the side steps away and the result takes the whole width. */
.q-grid{display:grid;gap:clamp(32px,5vw,56px)}
.q-main{min-width:0;max-width:960px}
.q-side{min-width:0;display:grid;gap:28px;align-content:start;padding-top:28px;border-top:1px solid var(--line-0)}
.q-wait{display:flex;align-items:center;gap:20px}
.q-cardback{flex:none;position:relative;width:92px;aspect-ratio:5/7;border-radius:var(--r-sm);background:var(--bg-3);border:1px solid var(--line-1);display:grid;place-items:center;
  box-shadow:var(--shadow-lift);transform:perspective(600px) rotateY(calc(26deg - var(--q, 0) * 26deg)) rotateZ(calc(-7deg + var(--q, 0) * 7deg));transition:transform var(--dur-slow) var(--ease)}
.q-cardback::before{content:"";position:absolute;inset:7px;border-radius:var(--r-xs);border:1px solid var(--line-1)}
.q-cardback svg{width:54%;height:auto}
.q-wait p{font-size:var(--t-sm);line-height:1.5;color:var(--ink-1);max-width:26ch}
.q-wait b{display:block;font-family:var(--f-mono);font-weight:500;font-size:var(--d-1);letter-spacing:-.04em;line-height:1.1;color:var(--ink-0)}
.q-reads{list-style:none;margin:0;padding:0;border-top:1px solid var(--line-0)}
.q-reads li{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--line-0);font-size:var(--t-base);font-weight:600;color:var(--ink-2);transition:color var(--dur-base) var(--ease)}
.q-reads b{font-family:var(--f-mono);font-weight:500;font-size:var(--t-base);color:inherit}
.q-reads li.done{color:var(--ink-1)}
.q-reads li.on{color:var(--ink-0)}
.q-reads li.on b{color:var(--k)}
.q-reads li.on span{background:linear-gradient(var(--k),var(--k)) 0 100%/100% 2px no-repeat;padding-bottom:2px}
.q-readline{font-size:var(--t-sm);line-height:1.5;color:var(--ink-1);min-height:3em}
.q-next{font-size:var(--t-sm);line-height:1.5;color:var(--ink-1)}
.q-next b{display:block;font-size:var(--t-md);color:var(--ink-0)}
.q-next a{display:inline-flex;align-items:center;min-height:var(--tap);font-weight:700;color:var(--warm-0);text-underline-offset:3px}
.q-next a:hover{color:var(--warm-2)}
body[data-step="result"] .q-side,body[data-step="plain"] .q-side{display:none}
/* the result takes the full column: an explicit width, because a centred grid item with auto margins would otherwise shrink to its
   content, and the quiz's container query (components.css) would then see a column a few words wide */
body[data-step="result"] .q-main,body[data-step="plain"] .q-main{width:100%;max-width:1120px;justify-self:center}
@media(min-width:1040px){
  .q-grid{grid-template-columns:minmax(0,1fr) 300px;align-items:start}
  .q-side{position:sticky;top:28px;padding-top:0;border-top:0;padding-left:32px;border-left:1px solid var(--line-0)}
  body[data-step="result"] .q-grid,body[data-step="plain"] .q-grid{grid-template-columns:minmax(0,1fr)}
}
main{position:relative;z-index:1;flex:1;padding:clamp(20px,5vw,56px) 0 clamp(48px,8vw,96px)}

/* page level type */
h1.display{font-size:var(--d-3);margin-top:16px}
h2.display{font-size:var(--d-2);margin-top:14px}
h1:focus,h2:focus{outline:none}
.lead{margin-top:18px}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
}

/* the quiz's own small label over its first title is not shown on these pages: the path in the header says where you are */
.quiz-page .pq-screen[data-screen="start"] .kicker{display:none}

/* ── /quiz/: the quiz as one card on the table (redesign, Nov 2026) ──
   Styling only, over the shared look in /components.css; quiz.js and its markup are untouched. While the visitor is on the
   date of birth, the questions or the last step, the stage is a card standing off the page with two more under it, and the
   ring sits on its top right corner as a solid badge (no glow behind it). Answers are rows on the dark ground of the card;
   the one picked fills coral. The working and result views keep the shared look. */
.q-header::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--grad-score);transform-origin:0 50%;transform:scaleX(var(--q,0));transition:transform var(--dur-slow) var(--ease)}
.quiz-page .pq-glow{display:none}
.quiz-page .pq:is([data-step="start"],[data-step="ask"],[data-step="reveal"]){position:relative;isolation:isolate;padding-bottom:18px}
.quiz-page .pq:is([data-step="start"],[data-step="ask"],[data-step="reveal"])::before,
.quiz-page .pq:is([data-step="start"],[data-step="ask"],[data-step="reveal"])::after{content:"";position:absolute;z-index:-1;left:0;right:0;top:52px;bottom:18px;border-radius:var(--r-xl);background:var(--bg-3);border:1px solid var(--line-1)}
.quiz-page .pq:is([data-step="start"],[data-step="ask"],[data-step="reveal"])::before{transform:rotate(-1.6deg) translate(-6px,14px)}
.quiz-page .pq:is([data-step="start"],[data-step="ask"],[data-step="reveal"])::after{transform:rotate(1.1deg) translate(8px,8px);background:var(--bg-2)}
.quiz-page .pq:is([data-step="start"],[data-step="ask"],[data-step="reveal"]) .pq-progress{position:relative;z-index:2;justify-content:flex-end;margin:0 clamp(16px,4vw,36px) -58px 0;pointer-events:none}
.quiz-page .pq:is([data-step="start"],[data-step="ask"],[data-step="reveal"]) .pq-ring{width:116px;border-radius:50%;background:var(--bg-0);box-shadow:var(--shadow-lift)}
.quiz-page .pq-count{font-size:var(--t-lg)}
.quiz-page .pq:is([data-step="start"],[data-step="ask"],[data-step="reveal"]) .pq-stage,
.quiz-page .pq[data-step="reveal"] .pq-reveal{position:relative;border-radius:var(--r-xl);background:var(--bg-1);border:1px solid var(--line-1);box-shadow:var(--shadow-deep);padding:clamp(64px,8vw,76px) clamp(20px,5vw,48px) clamp(24px,5vw,44px)}
.quiz-page .pq-q,.quiz-page .pq .pq-title{max-width:16ch}
.quiz-page .pq:is([data-step="start"],[data-step="ask"]) .pq-stage{min-height:440px}
.quiz-page .pq-reveal .kicker{display:none}
.quiz-page .pq-ask .q-nav{margin:-44px 0 -8px}
.quiz-page .pq-answers{max-width:none}
.quiz-page .opt{border-radius:var(--r-md);background:var(--bg-0);border-color:var(--line-0)}
.quiz-page .opt .key{border-radius:var(--r-sm);background:var(--bg-3);font-family:var(--f-mono);font-weight:500;font-size:var(--t-base)}
.quiz-page .opt[aria-pressed="true"]{background:var(--grad-warm);border-color:transparent;color:var(--bg-0)}
.quiz-page .opt[aria-pressed="true"] .key{background:var(--bg-0);color:var(--ink-0)}
@media(hover:hover) and (pointer:fine){
  .quiz-page .opt[aria-pressed="false"]:hover{border-color:var(--ai-1);background:var(--bg-2)}
}
