/* Hallmark · genre: atmospheric · macrostructure: Bento Grid · theme: Midnight (velocity-amber)
 * tone: technical · anchor hue: 50 (amber) · nav: N5 floating pill · footer: Ft5 statement
 * enrichment: H2 split-diptych hero · Tier-B hand-built SVG velocity gauge (animated 0→250 on view, reduced-motion safe)
 * F1 Bento knobs: tiles=10, spans=irregular (2×2 feature + 1×1), border=hairline
 * motion: load-stagger reveal · gauge counter+sweep (0→250) · hover-lift tiles/CTA (3 primitives)
 * contrast: pass (40–41) · honest: pass (46) · chrome: pass (47) · tokens: pass (48)
 * responsive: pass (49) · icons: pass (30) · mobile: pass (34, 49, 50–57)
 * Hallmark · pre-emit critique: P5 H4 E5 S5 R4 V5
 */
@import url("tokens.css");

/* ============================================================ Reset / base */
*,
*::before,
*::after {
    box-sizing: border-box;
}
* {
    margin: 0;
}

html {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}
body {
    overflow-x: clip; /* fallback for older Safari */
    min-height: 100dvh;
    background-color: var(--color-paper);
    /* Two fixed warm blooms — single hue family, ~25% footprint, no animation. */
    background-image:
        radial-gradient(
            46rem 38rem at 88% -6%,
            var(--color-accent-soft),
            transparent 60%
        ),
        radial-gradient(
            40rem 34rem at -8% 42%,
            color-mix(in oklch, var(--color-accent) 9%, transparent),
            transparent 62%
        );
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--color-ink);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    padding-inline: max(0px, env(safe-area-inset-left));
}

img,
svg {
    display: block;
    max-width: 100%;
}
a {
    color: inherit;
}

/* Shared display heading behaviour — roman only, safe wrapping. */
h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-style: normal;
    line-height: 1.06;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
    min-width: 0;
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
.muted {
    color: var(--color-muted);
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

:where(a, button, input, [tabindex]):focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.shell {
    width: min(76rem, 100%);
    margin-inline: auto;
    padding-inline: var(--page-gutter);
}

/* ============================================================ Load reveal */
.reveal {
    opacity: 0;
    transform: translateY(10px);
    animation: reveal var(--dur-long) var(--ease-out) forwards;
    animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes reveal {
    to {
        opacity: 1;
        transform: none;
    }
}

/* ============================================================ N5 floating pill nav */
.nav {
    position: fixed;
    inset: var(--space-md) auto auto 50%;
    transform: translateX(-50%);
    z-index: var(--z-sticky);
    display: inline-flex;
    align-items: center;
    gap: var(--space-lg);
    max-width: calc(100% - var(--space-lg) * 2);
    padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-md);
    background: color-mix(in oklch, var(--color-paper-2) 72%, transparent);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    border: var(--rule-hair) solid var(--color-rule);
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 30px -18px var(--color-shadow);
}
.nav__brand {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.05rem;
    text-decoration: none;
    white-space: nowrap;
}
.nav__brand b {
    color: var(--color-accent);
    font-weight: 700;
}
.nav__links {
    display: flex;
    gap: var(--space-md);
    list-style: none;
    padding: 0;
}
.nav__link {
    text-decoration: none;
    color: var(--color-muted);
    font-size: var(--text-sm);
    white-space: nowrap;
    transition: color var(--dur-micro) var(--ease-out);
}
.nav__link:hover {
    color: var(--color-ink);
}
.nav__cta {
    white-space: nowrap;
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    color: var(--color-accent-ink);
    background: var(--color-accent);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-pill);
    transition:
        transform var(--dur-short) var(--ease-out),
        background-color var(--dur-short) var(--ease-out);
}
.nav__cta:hover {
    transform: translateY(-1.5px);
    background: var(--color-accent-glow);
}
.nav__cta:active {
    transform: translateY(0);
}

/* ============================================================ Hero · H2 split diptych */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: var(--space-2xl);
    /* top clears the floating nav; bottom is heavier so the hero sits into the page (gate 44) */
    padding-block: 6.5rem var(--space-4xl);
}
.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
}
.hero__eyebrow::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    background: var(--color-accent);
    border-radius: 2px;
}
.hero__title {
    font-size: var(--text-display);
    margin-block: var(--space-md) var(--space-lg);
    max-width: 14ch;
}
.hero__title em {
    font-style: normal;
    color: var(--color-accent);
}
.hero__lede {
    color: var(--color-muted);
    font-size: var(--text-md);
    line-height: 1.55;
    max-width: 46ch;
}
.hero__actions {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-top: var(--space-xl);
}
.btn-primary {
    white-space: nowrap;
    font-weight: 500;
    text-decoration: none;
    color: var(--color-accent-ink);
    background: var(--color-accent);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-pill);
    transition:
        transform var(--dur-short) var(--ease-out),
        background-color var(--dur-short) var(--ease-out);
}
.btn-primary:hover {
    transform: translateY(-1.5px);
    background: var(--color-accent-glow);
}
.btn-primary:active {
    transform: translateY(0);
}
.link-quiet {
    white-space: nowrap;
    color: var(--color-muted);
    font-size: var(--text-sm);
    text-decoration: none;
    border-bottom: var(--rule-hair) solid var(--color-rule);
    padding-bottom: 2px;
    transition:
        color var(--dur-micro) var(--ease-out),
        border-color var(--dur-micro) var(--ease-out);
}
.link-quiet:hover {
    color: var(--color-ink);
    border-color: var(--color-accent);
}

/* ---- Velocity gauge (Tier-B hand SVG): 0 → 250 acceleration sweep ---- */
.gauge {
    width: 100%;
    height: auto;
}
.gauge__track {
    stroke: var(--color-rule);
}
.gauge__sweep {
    stroke: var(--color-accent);
    filter: drop-shadow(0 0 10px var(--color-accent-soft));
}
.gauge__tick {
    stroke: var(--color-rule);
    transition: stroke var(--dur-micro) var(--ease-out);
}
.gauge__tick.is-lit {
    stroke: var(--color-accent);
}
.gauge__num {
    fill: var(--color-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
}
.gauge__big {
    fill: var(--color-ink);
    font-family: var(--font-mono);
    font-weight: 700;
}
.gauge__unit {
    fill: var(--color-neutral);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    opacity: 0;
    transition: opacity 2000ms ease-out;
}
.gauge__unit.is-revealed {
    opacity: 1;
} /* fades in once the readout reaches 250 */

/* ============================================================ About + Host */
.about {
    display: grid;
    grid-template-columns: 1fr 22rem;
    gap: var(--space-2xl);
    align-items: start;
    padding-block: var(--space-3xl);
    border-top: var(--rule-hair) solid var(--color-rule);
}
.about__title {
    font-size: var(--text-xl);
    max-width: 16ch;
}
.about__body {
    color: var(--color-muted);
    font-size: var(--text-md);
    line-height: 1.6;
    max-width: 52ch;
    margin-top: var(--space-lg);
}
.about__body strong {
    color: var(--color-ink);
    font-weight: 500;
}
.about__season {
    margin-top: var(--space-xl);
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-neutral);
}
.about__season b {
    color: var(--color-accent);
    font-weight: 700;
}

/* ---- Host card · hover/focus reveals the bio ---- */
.host {
    position: relative;
    border: var(--rule-hair) solid var(--color-rule);
    border-radius: var(--radius-lg);
    background: var(--color-paper-2);
    padding: var(--space-lg);
    overflow: hidden;
    cursor: default;
}
.host__photo {
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: var(--rule-hair) solid var(--color-rule);
    background: var(--color-paper-3);
}
.host__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%; /* keep the face in frame on the portrait crop */
    filter: saturate(0.95) brightness(0.97);
}
.host__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-md);
    margin-top: var(--space-md);
}
.host__role {
    color: var(--color-muted);
    font-size: var(--text-sm);
}
.host__hint {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-top: var(--space-sm);
    transition: opacity var(--dur-short) var(--ease-out);
}
.host__bio {
    position: absolute;
    inset: 0;
    padding: var(--space-lg);
    background: color-mix(in oklch, var(--color-paper-2) 94%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: grid;
    align-content: center;
    gap: var(--space-sm);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity var(--dur-short) var(--ease-out),
        visibility var(--dur-short);
}
.host__bio h3 {
    font-size: var(--text-md);
}
.host__bio p {
    color: var(--color-muted);
    font-size: var(--text-sm);
    line-height: 1.55;
}
.host:hover .host__bio,
.host:focus-within .host__bio {
    opacity: 1;
    visibility: visible;
}
.host:hover .host__hint,
.host:focus-within .host__hint {
    opacity: 0;
}

/* ============================================================ Episodes · F1 Bento */
.episodes {
    padding-block: var(--space-3xl);
    border-top: var(--rule-hair) solid var(--color-rule);
}
.season + .season {
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: var(--rule-hair) solid var(--color-rule);
}
.season-head {
    display: flex;
    flex-direction: column; /* eyebrow stacked above heading — gate 54 */
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}
.season-head__label {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-accent);
    letter-spacing: 0.06em;
}
.season-head__title {
    font-size: var(--text-2xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}
.badge-wip {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--color-accent);
    background: var(--color-accent-soft);
    border: var(--rule-hair) solid
        color-mix(in oklch, var(--color-accent) 40%, transparent);
    padding: var(--space-2xs) var(--space-sm);
    border-radius: var(--radius-pill);
}
.season-head__blurb {
    color: var(--color-muted);
    font-size: var(--text-sm);
    max-width: 52ch;
}

.bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 11rem;
    grid-auto-flow: dense;
    gap: var(--space-md);
}
.ep {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-sm);
    border: var(--rule-hair) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper-2);
    padding: var(--space-md);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition:
        transform var(--dur-short) var(--ease-out),
        background-color var(--dur-short) var(--ease-out),
        border-color var(--dur-short) var(--ease-out);
}
.ep--feature {
    grid-column: span 2;
    grid-row: span 2;
}
.ep__num {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-accent);
    font-weight: 700;
}
.ep__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--text-md);
    line-height: 1.15;
}
.ep--feature .ep__title {
    font-size: var(--text-xl);
    max-width: 18ch;
}
.ep__summary {
    color: var(--color-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
    max-width: 48ch;
    /* hidden on compact tiles until hover/focus; always shown on the feature tile */
    opacity: 0;
    max-height: 0;
    transition: opacity var(--dur-short) var(--ease-out);
}
.ep--feature .ep__summary {
    opacity: 1;
    max-height: none;
}
.ep__media {
    flex: 1;
    min-height: 6rem;
    border-radius: var(--radius-sm);
    border: var(--rule-hair) solid var(--color-rule);
    background:
        repeating-linear-gradient(
            115deg,
            transparent 0 22px,
            var(--color-accent-soft) 22px 23px
        ),
        linear-gradient(160deg, var(--color-paper-3), var(--color-paper-2));
    display: grid;
    place-content: center;
    color: var(--color-neutral);
}
.ep__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ep__media .mono {
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.ep__status {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-neutral);
}
.ep__foot {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.ep__platforms {
    display: flex;
    gap: var(--space-sm);
    list-style: none;
    padding: 0;
}
.ep__platforms a,
.ep__platforms span {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-neutral);
    text-decoration: none;
}
.ep__platforms a:hover {
    color: var(--color-accent);
}

/* Hover-grow: scale + elevate + reveal info, raised so it overlaps without reflow. */
@media (hover: hover) and (pointer: fine) {
    .ep:hover {
        transform: scale(1.035);
        background: var(
            --color-paper-3
        ); /* elevation via lightness, not shadow/glow */
        z-index: var(--z-raised);
    }
    .ep:hover .ep__summary,
    .ep:focus-within .ep__summary {
        opacity: 1;
        max-height: 12rem;
    }
}
/* Coarse pointers can't hover — show the summary inline instead. */
@media (pointer: coarse) {
    .ep__summary {
        opacity: 1;
        max-height: none;
    }
}

/* ============================================================ Subscribe · C2 inline form */
.subscribe {
    padding-block: var(--space-3xl);
    border-top: var(--rule-hair) solid var(--color-rule);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}
.subscribe__title {
    font-size: var(--text-xl);
    max-width: 16ch;
}
.subscribe__copy {
    color: var(--color-muted);
    margin-top: var(--space-sm);
    max-width: 46ch;
}
.sub-form {
    display: grid;
    gap: var(--space-sm);
}
.sub-form__row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    border-bottom: 2px solid var(--color-rule);
    transition: border-color var(--dur-short) var(--ease-out);
}
.sub-form__row:focus-within {
    border-color: var(--color-accent);
}
.sub-form input {
    background: none;
    border: 0;
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: var(--text-md);
    padding: 0.8rem 0;
    min-height: 44px;
}
.sub-form input::placeholder {
    color: var(--color-neutral);
}
/* underline carries mouse focus; keyboard users keep the visible focus-visible ring */
.sub-form input:focus:not(:focus-visible) {
    outline: none;
}
.sub-form__submit {
    white-space: nowrap;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--color-accent);
    background: none;
    border: 0;
    cursor: pointer;
    padding: var(--space-xs) var(--space-2xs) var(--space-xs) var(--space-md);
    min-height: 44px;
    transition: transform var(--dur-short) var(--ease-out);
}
.sub-form__submit:hover {
    transform: translateX(3px);
}
.sub-form__submit:active {
    transform: translateX(0);
}
.sub-form__submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}
.sub-form__note {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-neutral);
    min-height: 1.2em;
}
.sub-form__note[data-state="ok"] {
    color: var(--color-accent);
}
.sub-form__note[data-state="error"] {
    color: var(--color-ink);
}

/* ============================================================ Ft5 statement footer */
.foot {
    padding-block: var(--space-2xl) var(--space-xl);
    padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
    border-top: var(--rule-hair) solid var(--color-rule);
    display: grid;
    gap: var(--space-xl);
}
.foot__line {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.75rem, 5vw, 3rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
    max-width: 22ch;
    overflow-wrap: anywhere;
    min-width: 0;
}
.foot__line em {
    font-style: normal;
    color: var(--color-accent);
}
.foot__meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-lg);
    flex-wrap: wrap;
    padding-top: var(--space-md);
    border-top: var(--rule-hair) solid var(--color-rule);
}
.foot__brand {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.foot__links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
    padding: 0;
    flex-wrap: wrap;
}
.foot__link {
    white-space: nowrap;
    text-decoration: none;
    color: var(--color-muted);
    font-size: var(--text-sm);
    transition: color var(--dur-micro) var(--ease-out);
}
.foot__link:hover {
    color: var(--color-accent);
}
.foot__copy {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-neutral);
}

/* ============================================================ Responsive */
@media (max-width: 60rem) {
    /* Sections stack and centre; the decorative gauge drops out entirely. */
    .hero {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
        padding-block: 7.5rem var(--space-2xl);
        text-align: center;
    }
    .hero__gauge {
        display: none;
    }
    .hero__eyebrow {
        justify-content: center;
    }
    .hero__title,
    .hero__lede {
        margin-inline: auto;
    }
    .hero__actions {
        justify-content: center;
    }

    .about {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
        text-align: center;
    }
    .about__title,
    .about__body {
        margin-inline: auto;
    }
    .about__season {
        justify-content: center;
    }
    .host {
        max-width: 26rem;
        margin-inline: auto;
        text-align: center;
    }

    .subscribe {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        text-align: center;
    }
    .subscribe__title,
    .subscribe__copy {
        margin-inline: auto;
    }
    .sub-form {
        max-width: 26rem;
        width: 100%;
        margin-inline: auto;
    }
    .sub-form input {
        text-align: left;
    } /* keep the typed email naturally aligned */

    .season-head {
        align-items: center;
        text-align: center;
    }
    .season-head__blurb {
        margin-inline: auto;
    }

    .foot {
        text-align: center;
    }
    .foot__line {
        margin-inline: auto;
    }
    .foot__meta {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--space-md);
    }
    .foot__links {
        justify-content: center;
    }

    .bento {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ep--feature {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media (max-width: 40rem) {
    .nav {
        gap: var(--space-sm);
        padding-left: 0.9rem;
    }
    .nav__links {
        display: none;
    } /* collapse row — keep brand + CTA, both single-line */
    .bento {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    .ep {
        min-height: 8.5rem;
    }
    .ep--feature {
        grid-column: span 1;
        grid-row: span 1;
    }
    .ep__media {
        min-height: 8rem;
    }
}

/* ============================================================ Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 150ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
        animation: none;
    }
    .ep:hover {
        transform: none;
    }
    .nav__cta:hover,
    .btn-primary:hover {
        transform: none;
    }
}
