/* ═══════════════════════════════════════════════════════════════════
   /waitlist: the Join the waitlist page (templates/waitlist.html,
   static/js/waitlist.js). Approved design "page-waitlist", review 3,
   2026-10-07:
   1. hero: the navy band, a big globe behind the headline, the form beside;
   2. the stamped ticket, which replaces the form after a successful signup
      (built from a <template>; never on the page before that);
   3. Compare cohorts: two cohort cards, one over the other, split by a
      divider you drag, swipe or move with the arrow keys;
   4. closing: the running cohort's faces and live line.

   Scoped to .dfw. Layout and the page's own objects only: every field and
   button is the shared standard in static/css/df-forms.css (.dff-*), not
   restyled here. Every colour is a token from df-tokens.css (tests/
   test_theme_tokens.py forbids raw values here). The navy band uses the
   theme-stable --df-navy / --df-on-navy* tokens (never the footer ones).
   ═══════════════════════════════════════════════════════════════════ */

.dfw {
    --dfw-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --dfw-ease: cubic-bezier(.22, 1, .36, 1);
    --dfw-band: var(--df-navy);
    --dfw-band-ink: var(--df-on-navy);
    --dfw-band-ink-2: var(--df-on-navy-2);
    --dfw-band-grid: color-mix(in srgb, var(--df-on-navy) 4.5%, transparent);
    --dfw-grid: color-mix(in srgb, var(--df-ink) 4%, transparent);
    --dfw-teal: color-mix(in srgb, var(--df-brand-teal) 62%, var(--df-navy));
    --dfw-grad: var(--df-brand-gradient);
    max-width: 1304px; margin: 0 auto; padding: 12px 12px clamp(24px, 5vh, 48px);
    display: flex; flex-direction: column; gap: clamp(12px, 1.8vw, 20px);
}
.dfw :focus-visible { outline: 3px solid var(--df-accent); outline-offset: 3px; }
.dfw-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

/* Display recipe and sizes come from the shared type system (df-tokens.css). */
body.public .dfw-disp {
    font-family: var(--df-font-display); font-stretch: var(--df-display-stretch); font-variation-settings: var(--df-display-wdth); font-weight: var(--df-display-weight);
    text-transform: uppercase; line-height: var(--df-display-lh); letter-spacing: var(--df-display-ls); margin: 0; max-width: none;
}
.dfw-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--df-brand-teal); animation: dfw-blink 2s infinite; }
@keyframes dfw-blink { 50% { opacity: .35; } }

/* ── 1. Hero ──────────────────────────────────────────────────────── */
.dfw-hero {
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 56px; align-items: center;
    min-height: min(784px, calc(100svh - var(--df-nav-h) - 24px));
    padding: 36px 56px; border-radius: 28px;
    color: var(--dfw-band-ink);
    background-color: var(--dfw-band);
    background-image: linear-gradient(var(--dfw-band-grid) 1px, transparent 1px), linear-gradient(90deg, var(--dfw-band-grid) 1px, transparent 1px);
    background-size: 48px 48px;
}
.dfw-hero :focus-visible { outline-color: var(--df-on-navy-accent); }
.dfw-globe {
    position: absolute; z-index: 0; left: -6%; top: 50%; width: min(980px, 78vw); aspect-ratio: 1; transform: translateY(-46%);
    -webkit-mask: radial-gradient(closest-side at 50% 50%, black 60%, rgba(0, 0, 0, .55) 100%);
    mask: radial-gradient(closest-side at 50% 50%, black 60%, rgba(0, 0, 0, .55) 100%);
}
.dfw-globe::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse 50% 42% at 30% 52%, color-mix(in srgb, var(--dfw-band) 80%, transparent), color-mix(in srgb, var(--dfw-band) 35%, transparent) 70%, transparent 90%);
}
.dfw-gl { display: block; width: 100%; height: 100%; opacity: .72; touch-action: pan-y; cursor: grab; }
.dfw-gl.is-drag { cursor: grabbing; }
.dfw-call {
    position: absolute; z-index: 3; right: 16%; top: 16%;
    background: var(--df-on-navy); color: var(--df-navy); border-radius: 14px; padding: 9px 13px;
    font-size: 13.5px; line-height: 1.3; transform: rotate(-2deg); pointer-events: none;
    box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .45);
}
.dfw-call b { display: block; font-size: 15px; }
.dfw-hcopy, .dfw-side { position: relative; z-index: 2; min-width: 0; }
.dfw-hcopy { pointer-events: none; }
.dfw-hcopy a { pointer-events: auto; }
.dfw-eb {
    display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
    padding: 7px 14px 7px 12px; border-radius: 999px; font-size: 14px; font-weight: 500;
    background: color-mix(in srgb, var(--df-on-navy) 12%, transparent);
}
.dfw-eb .dfw-dot { background: var(--df-on-navy-now); }
.dfw-eb span { opacity: .75; }
body.public .dfw-h1 { font-size: var(--df-type-hero); color: var(--dfw-band-ink); margin: 0 0 18px; max-width: 7ch; text-shadow: 0 2px 30px color-mix(in srgb, var(--dfw-band) 60%, transparent); }
.dfw-lede { font-family: var(--df-font-text); font-size: var(--df-type-lede); line-height: var(--df-type-lede-lh); color: color-mix(in srgb, var(--dfw-band-ink) 82%, transparent); margin: 0; max-width: 40ch; text-shadow: 0 1px 16px color-mix(in srgb, var(--dfw-band) 80%, transparent); }
.dfw-jump, .dfw-side-t { display: none; }

/* the form card (fields are .dff-*; this is the card and the extras) */
.dfw-card { background: var(--df-surface); color: var(--df-ink); border-radius: 24px; padding: 28px; container-type: inline-size; }
.dfw-card .dff:last-of-type { margin-bottom: 14px; }
.dfw-ck { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 2px 0 16px; padding: 0; list-style: none; font-size: 14px; line-height: 1.45; color: var(--df-ink-3); }
.dfw-ck[hidden] { display: none; }
.dfw-ck li { display: flex; gap: 7px; align-items: center; transition: color .2s; }
.dfw-ck i { width: 9px; height: 9px; border-radius: 50%; background: var(--df-line); transition: background .2s; }
.dfw-ck li.ok { color: var(--df-ink-2); }
.dfw-ck li.ok i { background: var(--df-ok); }
.dfw-ck li.bad i { background: var(--df-danger); }
.dfw-ck li.chk i { background: var(--df-accent); animation: dfw-blink .8s infinite; }
.dfw-form-err { margin: 0 0 14px; }
.dfw-foot { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.dfw-arr { transition: transform .25s var(--dfw-ease); }
.dfw-card .dff-b1:hover .dfw-arr { transform: translateX(4px); }
.dfw-spn { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: dfw-spin .7s linear infinite; }
@keyframes dfw-spin { to { transform: rotate(360deg); } }
.dfw-card .dff-b1.is-busy { opacity: .85; cursor: progress; }
.dfw-card .dff-b1.is-busy .dfw-spn { display: block; }
.dfw-card .dff-b1.is-busy .dfw-arr { display: none; }
.dfw-card .dff-b1.is-nope { animation: dfw-nope .35s; }
@keyframes dfw-nope { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.dfw-note { font-size: 14px; color: var(--df-ink-3); margin: 0; display: flex; gap: 8px; align-items: center; line-height: 1.45; }
.dfw-note::before {
    content: ""; flex: none; width: 16px; height: 12px; background: var(--df-line-strong);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12'%3E%3Crect x='.8' y='.8' width='14.4' height='10.4' rx='2' fill='none' stroke='black' stroke-width='1.4'/%3E%3Cpath d='M1.5 1.8L8 6.6l6.5-4.8' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat center / contain; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12'%3E%3Crect x='.8' y='.8' width='14.4' height='10.4' rx='2' fill='none' stroke='black' stroke-width='1.4'/%3E%3Cpath d='M1.5 1.8L8 6.6l6.5-4.8' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat center / contain;
}
.dfw-sugg:empty { display: none; }

/* ── 2. The stamped ticket (after a successful signup only) ───────── */
.dfw-card.is-done { padding: 0; background: transparent; }
.dfw-tk { display: grid; grid-template-columns: minmax(0, 1fr); color: var(--df-ink); text-align: left; animation: dfw-rise .6s var(--dfw-ease); }
@keyframes dfw-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.dfw-tk-main { background: var(--df-surface); border-radius: 22px 22px 0 0; padding: 24px 24px 20px; }
.dfw .dfw-tk-main:focus, .dfw .dfw-tk-main:focus-visible { outline: none; }
.dfw-stub { position: relative; background: var(--df-surface); border-radius: 0 0 22px 22px; border-top: 2px dashed var(--df-line); padding: 18px 24px 20px; display: flex; flex-direction: column; gap: 12px; }
.dfw-stub-h { display: none; }
.dfw-lbl { font: 500 12px var(--dfw-mono); color: var(--df-ink-3); margin-bottom: 3px; }
.dfw-tk-f { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.dfw-tk-f > div { flex: 1 1 auto; max-width: 100%; }
.dfw-val { font-size: 15.5px; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; overflow-wrap: break-word; }
.dfw-bar { display: flex; gap: 2px; height: 24px; }
.dfw-bar i { flex: 1; background: var(--df-ink); border-radius: 1px; }
.dfw-bar i.t { opacity: .15; }
.dfw-stamp {
    position: absolute; right: 16px; bottom: 16px; transform: rotate(-12deg);
    background: var(--df-ok); color: var(--df-on-status); border-radius: 10px; padding: 6px 11px;
    font-weight: 700; font-size: 15px; white-space: nowrap;
    animation: dfw-stamp .5s .35s var(--dfw-ease) both;
}
@keyframes dfw-stamp { from { opacity: 0; transform: rotate(-12deg) scale(1.9); } to { opacity: 1; transform: rotate(-12deg) scale(1); } }
.dfw-done-ic { width: 46px; height: 46px; border-radius: 50%; background: var(--df-ok); color: var(--df-on-status); display: grid; place-items: center; margin-bottom: 14px; }
.dfw-done-ic path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: dfw-draw .6s .15s var(--dfw-ease) forwards; }
@keyframes dfw-draw { to { stroke-dashoffset: 0; } }
body.public .dfw-done-h { font-size: clamp(2.1rem, 9cqw, 2.6rem); color: var(--df-ink); margin: 0 0 12px; }
.dfw-next { margin: 0; padding: 0; }
.dfw-next div { display: grid; gap: 2px; padding: 9px 0; border-top: 1px solid var(--df-line); }
.dfw-next dt { font-size: 13.5px; font-weight: 600; color: var(--df-accent); }
.dfw-next dd { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.dfw-tk .dfw-note { margin-top: 12px; }

/* ── 3. Compare cohorts ───────────────────────────────────────────── */
.dfw-sec {
    position: relative; border-radius: 28px; overflow: hidden; color: var(--df-ink);
    background-color: var(--df-surface);
    background-image: linear-gradient(var(--dfw-grid) 1px, transparent 1px), linear-gradient(90deg, var(--dfw-grid) 1px, transparent 1px);
    background-size: 48px 48px;
}
.dfw-why { padding: 44px 48px; min-height: min(700px, calc(100svh - var(--df-nav-h) - 24px)); display: flex; flex-direction: column; justify-content: center; }
body.public .dfw-why-h { font-size: var(--df-type-h2); color: var(--df-ink); margin: 0 0 22px; }
.dfw-cmp {
    --x: 50%; position: relative; display: grid; border-radius: 24px; overflow: hidden;
    touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none;
    color: var(--df-on-navy);
}
.dfw-cc { grid-area: 1 / 1; padding: 28px 34px 30px; }
.dfw-cc-a { background: var(--dfw-teal); }
.dfw-cc-b { background: var(--dfw-grad); clip-path: inset(0 0 0 var(--x)); text-align: right; }
.dfw-cc-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dfw-cc-b .dfw-cc-top { flex-direction: row-reverse; }
body.public .dfw-cc-nm { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; letter-spacing: -.01em; line-height: 1.1; margin: 0; color: inherit; }
.dfw-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--df-on-navy) 16%, transparent); }
.dfw-pill .dfw-dot { background: var(--df-on-navy-now); }
/* each card mirrors the other: the completed cohort reads from the left,
   the running one from the right, so every row sets the same figure on
   either side of the line */
.dfw-cc-g { margin: 16px 0 0; padding: 0; }
.dfw-cc-g div { display: flex; align-items: baseline; gap: 14px; padding: 9px 0; border-top: 1px solid color-mix(in srgb, var(--df-on-navy) 22%, transparent); }
.dfw-cc-b .dfw-cc-g div { flex-direction: row-reverse; }
.dfw-cc-g dd { order: -1; margin: 0; min-width: 0; font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.dfw-cc-g dt { font-size: 14px; font-weight: 400; line-height: 1.3; opacity: .85; }
.dfw-wk { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; margin-top: 14px; }
.dfw-cc-b .dfw-wk { direction: rtl; }
.dfw-wk i { height: 10px; border-radius: 3px; background: var(--df-on-navy); opacity: .18; }
.dfw-wk i.on { opacity: 1; background: var(--df-on-navy-now); }
.dfw-wk i.now { opacity: 1; background: var(--df-on-navy-accent); animation: dfw-blink 1.6s infinite; }
.dfw-cmp-h { position: absolute; top: 0; bottom: 0; left: var(--x); width: 0; z-index: 3; pointer-events: none; }
.dfw-cmp-h::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: var(--df-on-navy); }
.dfw-cmp-h span {
    position: absolute; top: 50%; left: 0; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
    background: var(--df-on-navy); color: var(--df-navy); display: grid; place-items: center;
    font: 800 18px system-ui, sans-serif; transition: transform .15s var(--dfw-ease);
}
.dfw-cmp:hover .dfw-cmp-h span { transform: scale(1.08); }
.dfw-cmp.is-drag .dfw-cmp-h span { transform: scale(.9); }
.dfw-cmp:has(.dfw-cmp-r:focus-visible) .dfw-cmp-h span { box-shadow: 0 0 0 4px var(--df-on-navy-accent); }
.dfw-cmp-r { position: absolute; left: 0; bottom: 0; width: 100%; margin: 0; opacity: 0; pointer-events: none; }
.dfw-ben { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; color: var(--df-ink-2); }
.dfw-ben li { display: flex; gap: 8px; align-items: center; }
.dfw-ben li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--df-accent); flex: none; }

/* ── 4. Closing ───────────────────────────────────────────────────── */
.dfw-close { padding: 30px 48px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.dfw-marq { width: 100%; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, black 8%, black 92%, transparent); mask: linear-gradient(90deg, transparent, black 8%, black 92%, transparent); }
.dfw-tr { display: flex; gap: 8px; width: max-content; animation: dfw-slide 120s linear infinite; }
.dfw-tr img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--df-public-panel); opacity: .85; flex: none; }
@keyframes dfw-slide { to { transform: translateX(-50%); } }
.dfw-live { display: inline-flex; align-items: center; gap: 10px; margin: 16px 0 0; font-size: 15.5px; color: var(--df-ink-2); }
.dfw-close .dfw-marq + .dfw-live { margin-top: 16px; }
.dfw-close .dfw-live:first-child { margin-top: 0; }

/* ── phones and narrow windows ─────────────────────────────────────── */
@media (max-width: 900px) {
    .dfw { padding: 8px 8px 24px; gap: 8px; }
    /* two screens: the hero, then the form on its own navy panel */
    .dfw-hero { display: block; padding: 0; min-height: 0; border-radius: 0; overflow: visible; background: none; }
    .dfw-globe {
        left: 0; right: 0; top: 0; width: auto; height: calc(100svh - var(--df-nav-h) - 16px); aspect-ratio: auto; transform: none;
        overflow: hidden; border-radius: 24px; -webkit-mask: none; mask: none;
        background-color: var(--dfw-band);
        background-image: linear-gradient(var(--dfw-band-grid) 1px, transparent 1px), linear-gradient(90deg, var(--dfw-band-grid) 1px, transparent 1px);
        background-size: 48px 48px;
    }
    .dfw-gl { position: absolute; width: 170%; height: auto; aspect-ratio: 1; left: -20%; bottom: -38%; opacity: .6; }
    .dfw-globe::after { background: linear-gradient(color-mix(in srgb, var(--dfw-band) 10%, transparent), color-mix(in srgb, var(--dfw-band) 55%, transparent) 40%, color-mix(in srgb, var(--dfw-band) 20%, transparent)); }
    .dfw-call { display: none; }
    .dfw-hcopy { min-height: calc(100svh - var(--df-nav-h) - 16px); padding: 28px 22px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
    .dfw-eb { display: inline-block; font-size: 12.5px; line-height: 1.45; border-radius: 14px; }
    .dfw-eb .dfw-dot { margin-right: 8px; vertical-align: 1px; }
    body.public .dfw-h1 { max-width: none; }
    .dfw-jump { display: inline-flex; margin-top: 22px; background: var(--df-on-navy); color: var(--df-navy); }
    .dfw-side {
        margin-top: 8px; padding: 22px 14px; border-radius: 24px; min-height: calc(100svh - var(--df-nav-h) - 16px);
        display: flex; flex-direction: column; justify-content: center; scroll-margin-top: calc(var(--df-nav-h) + 8px);
        background-color: var(--dfw-band);
        background-image: linear-gradient(var(--dfw-band-grid) 1px, transparent 1px), linear-gradient(90deg, var(--dfw-band-grid) 1px, transparent 1px);
        background-size: 48px 48px;
    }
    .dfw-side-t { display: block; font-size: 20px; font-weight: 700; margin: 0 4px 12px; color: var(--dfw-band-ink); }
    .dfw-card { padding: 20px 18px; }
    .dfw-why, .dfw-close { padding: 30px 18px; min-height: 0; border-radius: 24px; }
    .dfw-close { padding: 22px 16px; }
    .dfw-cc { padding: 20px 18px 22px; }
    body.public .dfw-cc-nm { font-size: clamp(.95rem, 4.1vw, 1.15rem); white-space: nowrap; }
    .dfw-cc-top { flex-direction: column; align-items: flex-start; gap: 6px; }
    .dfw-cc-b .dfw-cc-top { flex-direction: column; align-items: flex-end; }
    .dfw-cc-g div, .dfw-cc-b .dfw-cc-g div { flex-direction: column; gap: 3px; padding: 8px 0; }
    .dfw-cc-b .dfw-cc-g div { align-items: flex-end; }
    .dfw-cc-g dd { font-size: 1.55rem; }
    .dfw-cc-g dt { font-size: 12.5px; }
    .dfw-wk { gap: 2px; }
    .dfw-ben { flex-direction: column; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    .dfw *, .dfw *::before, .dfw *::after { animation: none !important; transition: none !important; }
    .dfw-done-ic path { stroke-dashoffset: 0; }
}
