/* The /quiz funnel. Tokens and the brand mark come from /tools/tools.css. */

.quiz-body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* Header: back, brand, and the progress bar split by section */
.qtop { position: sticky; top: 0; z-index: 50; background: rgba(246, 240, 228, 0.92); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); padding: 10px 16px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
.qtop-row { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.qtop .brand { grid-column: 2; justify-self: center; }
.qtop .back { grid-column: 1; grid-row: 1; }
.back { width: 44px; height: 44px; border: 0; background: none; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; border-radius: 12px; }
.back:hover { color: var(--ink); background: var(--paper-2); }
.back:focus-visible { outline: 2px solid var(--red); }
.sections { max-width: 560px; margin: 8px auto 0; display: flex; gap: 6px; }
.sections:empty { display: none; }
.sec { flex: 1; }
.sec i { display: block; height: 4px; border-radius: 4px; background: var(--paper-2); overflow: hidden; position: relative; }
.sec i::after { content: ""; position: absolute; inset: 0; width: var(--fill, 0%); background: var(--ink); border-radius: 4px; transition: width .35s ease; }
.sec span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; text-align: center; }
.sec.on span { color: var(--ink); }

/* One screen at a time */
.stage { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 22px 16px 32px; }
.screen { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } .sec i::after { transition: none; } }

.intro { margin-bottom: 22px; }
.intro .eyebrow { margin-bottom: 10px; }
.intro .display { font-size: clamp(40px, 11vw, 60px); }
.intro p { color: var(--ink-2); margin-top: 12px; font-size: 16px; }

.q { font-family: var(--display); font-stretch: 85%; font-weight: 800; font-size: clamp(26px, 7vw, 34px); line-height: 1.05; letter-spacing: -0.01em; outline: none; }
.sub { color: var(--ink-2); margin-top: 8px; font-size: 15.5px; }
.opts { display: grid; gap: 10px; margin-top: 22px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 16px 16px; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.opt:hover { border-color: rgba(20,18,16,.32); }
.opt:active { transform: scale(.99); }
.opt:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.opt[aria-pressed="true"], .opt[aria-checked="true"] { border-color: var(--ink); background: #fff; }
.opt .txt { flex: 1; min-width: 0; }
.opt b { display: block; font-size: 16.5px; font-weight: 600; }
.opt small { display: block; font-size: 14px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; }
.opt .tag { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin-bottom: 3px; }
.opt .mark { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); flex-shrink: 0; display: grid; place-items: center; }
.opt.multi .mark { border-radius: 7px; }
.opt[aria-pressed="true"] .mark, .opt[aria-checked="true"] .mark { background: var(--ink); border-color: var(--ink); }
.opt[aria-pressed="true"] .mark::after, .opt[aria-checked="true"] .mark::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--paper); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.opts.grid2 { grid-template-columns: 1fr 1fr; }
.opts.grid2 .opt { justify-content: center; text-align: center; padding: 18px 10px; }
.opts.grid2 .opt .mark { display: none; }
.opts.grid2 .opt b { font-family: var(--display); font-stretch: 85%; font-size: 26px; font-weight: 800; }
.opt[disabled] { opacity: .45; cursor: not-allowed; }

/* Sticky action bar for screens that need one */
.actions { position: sticky; bottom: 0; padding: 16px 0 max(14px, env(safe-area-inset-bottom)); margin-top: 18px; background: linear-gradient(rgba(246,240,228,0), var(--paper) 30%); display: grid; gap: 8px; }
.go { width: 100%; justify-content: center; font-size: 16px; padding: 16px 20px; }
.go[disabled] { opacity: .35; cursor: not-allowed; background: var(--ink) !important; }
.skip { background: none; border: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; padding: 8px; text-decoration: underline; text-underline-offset: 3px; }
.counter { font-size: 13px; color: var(--ink-3); margin-top: 12px; }

/* Number entry */
.num { margin-top: 22px; }
.num .suffix input { font-size: 30px; font-family: var(--display); font-stretch: 85%; font-weight: 800; padding: 16px 64px 16px 18px; }
.num .seg { margin-bottom: 14px; max-width: 200px; }
.num .hint { font-size: 13.5px; }
.num .err { color: var(--red); font-size: 13.5px; margin-top: 8px; min-height: 1.2em; }

/* Interstitials: a look at the product, never a claim about other people */
.info { background: var(--night); color: var(--cream); border-radius: 26px; padding: 26px 22px; }
.info .eyebrow { color: #E2444B; }
.info h2 { font-family: var(--display); font-stretch: 80%; font-weight: 850; text-transform: uppercase; font-size: clamp(34px, 9vw, 46px); line-height: .95; }
.info h2 em { font-style: normal; color: #E2444B; }
.info p { color: rgba(240,230,211,.78); margin-top: 12px; font-size: 15.5px; }
.info ul { list-style: none; margin-top: 18px; display: grid; gap: 10px; }
.info li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: rgba(240,230,211,.9); }
.info li::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--green); }

/* A tree, drawn as a ladder of nodes */
.ladder { margin-top: 18px; display: grid; gap: 0; }
.node { display: grid; grid-template-columns: 28px 1fr; gap: 12px; position: relative; padding-bottom: 14px; }
.node::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--night-line); }
.node:last-child::before { display: none; }
.node .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(240,230,211,.25); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: rgba(240,230,211,.6); background: var(--night); position: relative; }
.node.done .dot { background: var(--green); border-color: var(--green); color: var(--night); }
.node.here .dot { border-color: var(--purple); color: var(--cream); box-shadow: 0 0 0 4px rgba(168,107,255,.22); }
.node b { display: block; font-size: 15px; color: var(--cream); font-weight: 600; }
.node small { display: block; font-size: 13px; color: rgba(240,230,211,.6); }
.node .you { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--purple); margin-left: 6px; }
.info .ladder + .ladder { margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--night-line); }
.ladder h3 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: rgba(240,230,211,.55); margin-bottom: 12px; }

/* Loader */
.build { padding-top: 24px; }
.build .q { margin-bottom: 22px; }
.steps { list-style: none; display: grid; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: center; font-size: 16px; color: var(--ink-3); transition: color .2s; }
.steps li::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; transition: background .2s, border-color .2s; }
.steps li.doing { color: var(--ink); }
.steps li.doing::before { border-color: var(--ink); border-right-color: transparent; animation: spin .8s linear infinite; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--green); border-color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 6px; background: var(--paper-2); border-radius: 6px; overflow: hidden; margin-top: 26px; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s linear; }

/* Result */
.result .eyebrow { margin-bottom: 8px; }
.result h1 { font-size: clamp(40px, 11vw, 64px); }
.result .lede { font-size: 16.5px; margin-top: 12px; }
.checks { list-style: none; margin-top: 16px; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; font-size: 15px; color: var(--ink); }
.checks li::before { content: "✓"; color: var(--green); font-weight: 800; }
.top-cta { margin-top: 20px; }
.block { margin-top: 26px; }
.block > h2 { font-family: var(--display); font-stretch: 80%; font-weight: 850; text-transform: uppercase; font-size: 28px; line-height: 1; margin-bottom: 12px; }
.block > p.note { font-size: 13.5px; color: var(--ink-3); margin-top: 10px; }
.week { display: grid; gap: 8px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.day summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.day summary::-webkit-details-marker { display: none; }
.day summary .n { font-family: var(--display); font-stretch: 85%; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); width: 46px; flex-shrink: 0; }
.day summary b { flex: 1; font-weight: 600; font-size: 15.5px; }
.day summary::after { content: "+"; font-size: 20px; color: var(--ink-3); line-height: 1; }
.day[open] summary::after { content: "–"; }
.day summary:focus-visible { outline: 2px solid var(--red); border-radius: 16px; }
.day ol { list-style: none; padding: 0 16px 14px 74px; display: grid; gap: 6px; }
.day li { font-size: 14px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 12px; }
.day li span:last-child { color: var(--ink-3); white-space: nowrap; }
.day li.skill span:first-child { color: var(--purple); font-weight: 600; }
.day.plain summary { cursor: default; }
.day.plain summary::after { content: none; }
.targets { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.target { background: var(--night); color: var(--cream); border-radius: 18px; padding: 16px; }
.target .mid { font-size: 34px; }
.target .res-label { margin-bottom: 4px; }
.target p { font-size: 13px; color: rgba(240,230,211,.65); margin-top: 6px; line-height: 1.4; }
.result .info { margin-top: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 500; }
.getit { margin-top: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 22px; display: grid; gap: 14px; justify-items: start; }
.getit .head2 { display: flex; gap: 14px; align-items: center; }
.getit img.icon { width: 56px; height: 56px; border-radius: 13px; }
.getit b { font-size: 18px; }
.getit p { font-size: 14.5px; color: var(--ink-2); }
.getit a.badge img { height: 48px; width: auto; }
.getit ol { padding-left: 20px; font-size: 14.5px; color: var(--ink-2); display: grid; gap: 4px; }
.again { margin-top: 18px; display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.again a, .again button { color: var(--ink-2); font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.qfoot { max-width: 560px; width: 100%; margin: 0 auto; padding: 20px 16px max(28px, env(safe-area-inset-bottom)); font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; border-top: 1px solid var(--line); }
.qfoot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.qfoot a { text-decoration: none; }
.qfoot a:hover { color: var(--ink); }
.nojs { color: var(--ink-2); }

/* Pictures: photo cards for the first question, thumbnails elsewhere */
.opt.photo { flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; gap: 0; }
.opt.photo .ph { width: 100%; height: 132px; object-fit: cover; display: block; }
.opt.photo .txt { padding: 14px 52px 16px 16px; }
.opt.photo .mark { position: absolute; right: 16px; bottom: 18px; background: var(--card); }
.opt.photo { position: relative; }
.opt.photo[aria-pressed="true"] .mark { background: var(--ink); }
.opt .thumb { width: 64px; height: 64px; border-radius: 12px; background: #fff; object-fit: contain; flex-shrink: 0; }
.opt .thumb.blank { display: block; background: var(--paper-2); }

/* App screens inside the dark cards */
.info.has-shot { padding-top: 22px; }
.info .shot { width: 100%; max-height: 300px; object-fit: contain; margin: 0 auto 18px; filter: drop-shadow(0 18px 30px rgba(0,0,0,.45)); }
.info .fine { font-size: 12.5px; color: rgba(240,230,211,.5); }
.pace { width: 100%; height: auto; margin-top: 16px; }

/* Research proof */
.study { margin: 18px 0 4px; border-left: 3px solid var(--green); padding: 4px 0 4px 14px; }
.study blockquote { font-size: 16.5px; color: var(--cream); line-height: 1.45; }
.study figcaption { font-size: 12.5px; color: rgba(240,230,211,.55); margin-top: 8px; }

/* Real reviews, when there are any */
.reviews { display: grid; gap: 10px; margin-top: 20px; }
.review { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.review .stars { color: #E8A317; letter-spacing: 2px; }
.review blockquote { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.review figcaption { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }

/* Loader reel */
.reel { position: relative; height: 260px; margin: 0 auto 22px; }
.reel img { position: absolute; inset: 0; margin: auto; height: 100%; width: auto; opacity: 0; transition: opacity .4s; filter: drop-shadow(0 16px 26px rgba(20,18,16,.25)); }
.reel img.on { opacity: 1; }

.hero-shot { float: right; width: 120px; margin: -6px -4px 8px 12px; filter: drop-shadow(0 14px 24px rgba(20,18,16,.25)); }
@media (min-width: 520px) { .hero-shot { width: 150px; } }
