/*
 * TLexDR, base.css
 * SPEC-156: Public Site Redesign: Design Foundation
 *
 * ============================================================
 * DESIGN TOKENS, change these to retone the whole site.
 * ============================================================
 *
 * Palette
 * -------
 * --background          Near-black cool canvas for page body (was warm charcoal)
 * --surface             Elevated panels / header
 * --surface-elevated    Cards, raised content blocks
 * --border              Default border (faint cool tint)
 * --border-subtle       Very faint border (footer, dividers)
 * --text-primary        Near-white body text
 * --text-secondary      Subdued secondary text
 * --text-muted          Quiet labels, metadata
 *
 * Accent (one knob retones buttons, links, focus rings, constellation)
 * --------------------------------------------------------------------
 * --accent-rgb          Raw R,G,B triplet, change this one value to retune hue
 * --primary             Accent shorthand (maps to --accent for legacy templates)
 * --accent              Full rgb() value derived from --accent-rgb
 * --accent-2            Dimmed accent (72 % opacity)
 * --accent-ink          Dark ink for text placed on accent fills
 * --accent-soft         Very light tint (14 % opacity), used for backgrounds
 * --accent-line         Border-weight accent (40 % opacity)
 * --accent-glow         Glow shadow (55 % opacity)
 * --primary-dark        Darker accent shade, kept for legacy template compat
 *
 * Typography
 * ----------
 * --font-serif          Crimson Pro, editorial display face
 * --font-sans           Inter, UI face
 * --font-mono           JetBrains Mono, code + metadata
 *
 * Shape + Shadow
 * --------------
 * --radius              Default border radius (cards, panels)
 * --radius-sm           Smaller radius (chips, badges)
 * --radius-pill         Pill shape (buttons, pills)
 * --shadow              Card shadow
 * --shadow-lg           Elevated card shadow
 * --glow                Accent ambient glow (legacy compat)
 *
 * Motion
 * ------
 * --ease                Signature easing curve for transitions and reveal
 *
 * Spacing (layout scale)
 * ----------------------
 * --space-1 .. --space-8  T-shirt size scale (4px, 8px, 12px, 16px, 24px, 32px, 48px, 64px)
 * --maxw                Content max-width
 * ============================================================
 */

:root {
    /* ---- Accent: single RGB knob (cool blue #6ea8fe by default) ---- */
    --accent-rgb: 110,168,254;
    --accent: rgb(var(--accent-rgb));
    --accent-2: rgba(var(--accent-rgb), .72);
    --accent-ink: #06101f;               /* dark ink for text on accent fills */
    --accent-soft: rgba(var(--accent-rgb), .14);
    --accent-line: rgba(var(--accent-rgb), .40);
    --accent-glow: rgba(var(--accent-rgb), .55);

    /* ---- Legacy / compat token names (remapped to new cool system) ---- */
    /* These names are referenced by many existing templates. Keep them
       pointing at semantically equivalent new values so every public page
       retones without per-page edits. */
    --primary: rgb(var(--accent-rgb));        /* was warm bronze #d4a574 */
    --primary-dark: rgba(var(--accent-rgb), .85);  /* was #b8804a */
    --secondary: #6b7280;
    --success: #7fa383;

    /* ---- Canvas + surface palette (cool neutrals) ---- */
    --bg: #08090b;                        /* near-true-black, faintly cool */
    --background: #08090b;               /* legacy token name (same as --bg) */
    --bg-2: #0c0d10;
    --surface: #101216;                  /* elevated panels */
    --surface-elevated: #15171c;         /* cards, was #252932 warm */
    --surface-3: #1c1f26;                /* hover / inputs */

    /* ---- Borders ---- */
    --border: rgba(255, 255, 255, .07);         /* was warm-tinted rgba(212,165,116,.12) */
    --border-2: rgba(255, 255, 255, .12);
    --border-subtle: rgba(255, 255, 255, .05);  /* was rgba(255,255,255,.06) */

    /* ---- Text hierarchy ---- */
    --text: #f3f4f6;                     /* neutral near-white */
    --text-primary: #f3f4f6;             /* legacy token name */
    --text-2: #a6abb5;                   /* neutral gray */
    --text-secondary: #a6abb5;           /* legacy token name */
    --text-3: #6a6f7a;                   /* muted */
    --text-muted: #6a6f7a;               /* legacy token name */

    /* ---- Typography ---- */
    --font-serif: 'Crimson Pro', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    /* ---- Shape ---- */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;

    /* ---- Shadows ---- */
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -20px rgba(0, 0, 0, .7);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .4);
    --glow: 0 0 20px rgba(var(--accent-rgb), .12);  /* was warm bronze glow */

    /* ---- Motion ---- */
    --ease: cubic-bezier(.22, .61, .36, 1);

    /* ---- Spacing scale ---- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* ---- Layout ---- */
    --maxw: 1100px;
}


/* ============================================================
   RESET + BASE
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--surface);
    font-size: 16px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    transition: color .2s var(--ease);
}

a:hover {
    color: var(--text-primary);
}

p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 40px;
}


/* ============================================================
   TYPOGRAPHY, headings
   ============================================================ */

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 500;
    letter-spacing: .01em;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: 48px;
    margin-bottom: 24px;
    font-weight: 500;
}

h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--primary);
}

h3 {
    font-size: 24px;
    margin-bottom: 16px;
}

h4 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 600;
    font-family: var(--font-sans);
}


/* ============================================================
   ACCESSIBILITY: skip-to-content link
   ============================================================ */

/*
 * Visually hidden until keyboard-focused, then slides into view.
 * Must be the first focusable element in <body> so Tab lands here first.
 */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: 9999;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 14px;
    font-weight: 600;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: top .15s var(--ease);
}

.skip-to-content:focus {
    top: var(--space-4);
}


/* ============================================================
   HEADER / NAV  (SPEC-157)
   ============================================================ */

/*
 * Sticky blurred header. padding reduced vs. the old 32px so the wordmark
 * never crowds the nav items. The border-bottom provides the visual
 * separation from page content below.
 */
header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(8, 9, 11, .85);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
}

/* Row that holds brand + desktop nav + auth actions + hamburger. */
.site-header-inner {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    height: 64px;
}

/* ---- Brand mark ---- */

.site-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    flex-shrink: 0;
    color: var(--text-primary);
    transition: color .2s var(--ease);
}

.site-brand:hover {
    color: var(--accent);
}

.site-brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: linear-gradient(140deg, var(--accent), rgba(var(--accent-rgb), .7));
    color: var(--accent-ink);
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 15px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.site-brand-name {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: .01em;
    color: inherit;
}

/* Legacy .site-title compatibility (some older templates may still use it). */
.site-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: .01em;
    transition: color .2s var(--ease);
}

.site-title:hover {
    color: var(--text-primary);
}

/* ---- Desktop primary nav ---- */

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    margin-left: var(--space-2);
}

.site-nav a,
.site-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .01em;
    transition: color .2s var(--ease);
    position: relative;
    white-space: nowrap;
}

.site-nav a::after,
.site-nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width .25s var(--ease);
}

.site-nav a:hover,
.site-nav-link:hover {
    color: var(--text-primary);
}

.site-nav a:hover::after,
.site-nav-link:hover::after {
    width: 100%;
}

/* ---- Desktop right-hand auth actions ---- */

.site-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.site-signin-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color .2s var(--ease);
}

.site-signin-link:hover {
    color: var(--text-primary);
}

/* ---- Premium badge ---- */

.premium-badge {
    display: inline-block;
    padding: 3px 8px;
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-left: var(--space-2);
    vertical-align: middle;
    font-family: var(--font-sans);
}

/* ---- Hamburger button (mobile only) ---- */

.site-hamburger {
    display: none;         /* hidden on desktop; shown below breakpoint */
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .04);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    transition: background .15s var(--ease);
}

.site-hamburger:hover {
    background: rgba(255, 255, 255, .08);
}

/* Three stacked bars via box-shadow. Single element, no SVG required. */
.site-hamburger-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    box-shadow: 0 -6px 0 var(--text-primary), 0 6px 0 var(--text-primary);
    pointer-events: none;
}

/* ---- Mobile nav drawer (SPEC-157) ---- */

/*
 * Full-screen overlay drawer. Hidden by default (opacity + pointer-events
 * so it doesn't capture taps when closed). ui.js toggles .mobile-nav-open
 * on <body> which transitions it into view.
 *
 * JS-disabled fallback: see the @media block at bottom of this section.
 */
.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 190;
    background: rgba(8, 9, 11, .97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s var(--ease);
    /* Ensure the drawer is behind the sticky header when closed so it
       does not accidentally block top-of-page links. */
    visibility: hidden;
}

.mobile-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .mobile-nav {
        transition: none;
    }
}

.mobile-nav-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--space-5);
    overflow-y: auto;
}

.mobile-nav-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    margin-bottom: var(--space-5);
}

.mobile-nav-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .04);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .15s var(--ease);
    line-height: 1;
}

.mobile-nav-close:hover {
    background: rgba(255, 255, 255, .08);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
}

.mobile-nav-links a {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border);
    transition: color .15s var(--ease);
}

.mobile-nav-links a:first-child {
    color: var(--accent);
}

.mobile-nav-links a:hover {
    color: var(--accent);
}

.mobile-nav-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-top: var(--space-6);
}

.mobile-nav-actions .btn {
    justify-content: center;
    padding: var(--space-3) var(--space-5);
    width: 100%;
}

/*
 * Responsive breakpoints for header chrome.
 */
@media (max-width: 768px) {
    .site-nav,
    .site-header-actions {
        display: none;      /* collapse desktop nav on mobile */
    }

    .site-hamburger {
        display: flex;      /* show hamburger on mobile */
    }
}

/*
 * JS-disabled fallback: when .mobile-nav would normally be driven by JS
 * but JS is absent, make the mobile nav links still reachable by revealing
 * the links inline below the header at small viewports.
 */
.no-js .mobile-nav {
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: var(--surface);
    border-top: 1px solid var(--border);
}


/* ============================================================
   Legacy nav overrides (kept for backward compat with pages
   that use bare <nav> inside their own templates).
   ============================================================ */

nav {
    display: flex;
    gap: var(--space-6);
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .01em;
    transition: color .2s var(--ease);
    position: relative;
}

nav a:after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width .25s var(--ease);
}

nav a:hover {
    color: var(--primary);
}

nav a:hover:after {
    width: 100%;
}


/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

main {
    padding: 80px 0;
    min-height: calc(100vh - 200px);
}


/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
    transition: all .4s var(--ease);
}

.card:hover {
    border-color: var(--border-2);
    box-shadow: var(--shadow-lg), var(--glow);
    transform: translateY(-2px);
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--primary);
    color: var(--accent-ink);
    text-decoration: none;
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-weight: 550;
    font-size: 14.5px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s var(--ease);
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}

.btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 8px 30px -8px var(--accent-glow);
    transform: translateY(-1px);
    color: var(--accent-ink);
}

.btn-secondary {
    background: rgba(255, 255, 255, .04);
    color: var(--text-primary);
    border: 1px solid var(--border-2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .2);
    color: var(--text-primary);
    filter: none;
    box-shadow: none;
}

.btn-small {
    padding: 8px 20px;
    font-size: 12px;
}

/* Legacy variant names used by existing templates */
.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-ghost {
    background: rgba(255, 255, 255, .04);
    color: var(--text-primary);
    border: 1px solid var(--border-2);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .2);
    color: var(--text-primary);
    filter: none;
}

.btn-lg {
    padding: 13px 26px;
    font-size: 15px;
}


/* ============================================================
   STATUS BADGES
   ============================================================ */

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    border: 1px solid;
}

.status-pending {
    background: rgba(251, 191, 36, .1);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, .2);
}

.status-downloaded {
    background: rgba(96, 165, 250, .1);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, .2);
}

.status-transcribed {
    background: rgba(96, 165, 250, .1);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, .2);
}

.status-summarized {
    background: rgba(127, 163, 131, .15);
    color: #7fa383;
    border-color: rgba(127, 163, 131, .3);
}

.status-emailed {
    background: rgba(127, 163, 131, .15);
    color: #7fa383;
    border-color: rgba(127, 163, 131, .3);
}

.status-error {
    background: rgba(248, 113, 113, .1);
    color: #f87171;
    border-color: rgba(248, 113, 113, .2);
}


/* ============================================================
   FLASH MESSAGES
   ============================================================ */

.flash-messages {
    margin-bottom: 32px;
}

.flash {
    padding: 20px 24px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 2px solid;
    background: var(--surface-elevated);
    backdrop-filter: blur(10px);
}

.flash.success {
    background: rgba(127, 163, 131, .12);
    color: var(--success);
    border-color: var(--success);
}

.flash.error {
    background: rgba(248, 113, 113, .12);
    color: #f87171;
    border-color: #f87171;
}


/* ============================================================
   FOOTER  (SPEC-157)
   ============================================================ */

/*
 * Four-column grid footer. No inline style= attributes; all presentation
 * lives here. Mobile stacks the columns via a responsive grid.
 */
footer {
    border-top: 1px solid var(--border);
    padding: var(--space-7) 0 var(--space-6);
    margin-top: var(--space-8);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 14px;
}

/* Four-column grid: brand blurb | Browse | Product | Company */
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-7);
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand-col {
        grid-column: span 2;
    }
}

@media (max-width: 560px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-brand-col {
        grid-column: span 1;
    }
}

/* Brand + blurb column */
.footer-brand {
    margin-bottom: var(--space-4);
}

.footer-blurb {
    color: var(--text-3);
    font-size: 14px;
    max-width: 30ch;
    line-height: 1.7;
    margin-top: var(--space-4);
    margin-bottom: 0;
    font-family: var(--font-sans);
}

/* Link columns */
.footer-links-col a {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    margin-bottom: var(--space-2);
    transition: color .2s var(--ease);
}

.footer-links-col a:hover {
    color: var(--text-primary);
}

.footer-col-heading {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text-3);
    margin-bottom: var(--space-4);
    font-weight: 600;
    font-family: var(--font-sans);
}

/* Sponsors row */
.footer-sponsors {
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-6);
    margin-bottom: var(--space-6);
}

.footer-sponsors-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text-3);
    margin-bottom: var(--space-5);
    font-family: var(--font-sans);
    font-weight: 600;
}

.footer-sponsors-logos {
    display: flex;
    gap: var(--space-6);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.footer-sponsor-link {
    opacity: .55;
    transition: opacity .25s var(--ease);
    text-decoration: none;
}

.footer-sponsor-link:hover {
    opacity: 1;
}

.footer-sponsor-img {
    height: 32px;
    filter: grayscale(1) brightness(1.5);
}

.footer-sponsor-name {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Bottom legal bar */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-5);
    color: var(--text-3);
    font-size: 12.5px;
}

@media (max-width: 560px) {
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Legacy selector: some old template paragraphs live in <footer> directly */
footer > p {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-secondary);
}


/* ============================================================
   SIGNUP BANNER  (SPEC-157)
   ============================================================ */

/*
 * Persistent bottom-of-viewport CTA. Cookie-dismissed.
 * No inline style= in the template; all presentation here.
 */
.signup-cta-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(16, 18, 22, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-2);
    z-index: 80;
}

.signup-cta-inner {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-4) 0;
    flex-wrap: wrap;
}

.signup-cta-pitch {
    font-size: 14.5px;
    color: var(--text-primary);
    flex: 1 1 200px;
    min-width: 0;
}

.signup-cta-pitch strong {
    font-family: var(--font-serif);
    font-weight: 600;
}

.signup-cta-form {
    margin-left: auto;
    display: flex;
    gap: var(--space-2);
    flex: 0 1 auto;
    flex-wrap: nowrap;
    align-items: center;
}

.signup-cta-email {
    background: var(--bg);
    border: 1px solid var(--border-2);
    color: var(--text-primary);
    border-radius: var(--radius-pill);
    padding: 10px 16px;
    font-size: 14px;
    font-family: var(--font-sans);
    outline: none;
    width: 230px;
    transition: border-color .2s var(--ease);
}

.signup-cta-email:focus {
    border-color: var(--accent-line);
}

/* Off-screen honeypot; invisible in all contexts */
.signup-cta-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.signup-cta-dismiss {
    background: transparent;
    border: 0;
    color: var(--text-3);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    transition: color .15s var(--ease);
}

.signup-cta-dismiss:hover {
    color: var(--text-primary);
}

@media (max-width: 640px) {
    .signup-cta-inner {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
    }

    .signup-cta-form {
        margin-left: 0;
    }

    .signup-cta-email {
        flex: 1;
        width: auto;
    }
}


/* ============================================================
   PILLS (shared concept / guest pill component)  (SPEC-160)
   ============================================================ */

/*
 * .pill: shared component used on Discover, Topics index, Topic detail.
 * Hover is CSS :hover so inline onmouseover/onmouseout handlers are not needed.
 *
 * Variants:
 *   .pill.sm    -- smaller padding for the Guests row on Discover
 *
 * Count badge inside pill:
 *   <span class="n">42</span>
 */

.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-2);
    background: rgba(255, 255, 255, .03);
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: none;
    transition: border-color .2s var(--ease), color .2s var(--ease);
}

.pill:hover {
    border-color: var(--accent-line);
    color: var(--accent);
}

/* Count badge inside a pill (filled accent for primary pills) */
.pill .n {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-ink);
    background: var(--accent);
    border-radius: var(--radius-pill);
    padding: 1px 7px;
    flex-shrink: 0;
}

/* Small variant: guests row on Discover, related-concept row on topic detail */
.pill.sm {
    padding: 7px 12px;
    font-size: 13px;
}

/* Small variant badge: softer tint so it doesn't compete with the main pills */
.pill.sm .n {
    background: rgba(var(--accent-rgb), .16);
    color: var(--accent);
}

/* Dashed "see all" pill (rendered as a link that looks different from regular
   concept pills, used for "See all concepts" and "See all N guests"). */
.pill-see-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: var(--radius-pill);
    border: 1px dashed var(--accent-line);
    color: var(--accent);
    font-size: 13px;
    text-decoration: none;
    transition: border-color .2s var(--ease);
}

.pill-see-all:hover {
    border-color: var(--accent);
    color: var(--accent);
}


/* ============================================================
   GUEST CARDS (.gcard)  (SPEC-160)
   ============================================================ */

/*
 * Used on the Guests index page. Each card shows guest name + appearance
 * count. Hover via CSS :hover only.
 */

.gcards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.gcard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px 18px;
    background: var(--surface-elevated);
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color .2s var(--ease);
}

.gcard:hover {
    border-color: var(--accent-line);
    color: var(--text-primary);
}

.gcard .nm {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 500;
}

/* Count badge inside guest card */
.gcard .n {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-ink);
    background: var(--accent);
    border-radius: var(--radius-pill);
    padding: 2px 9px;
    flex-shrink: 0;
}


/* ============================================================
   SCROLL REVEAL
   ============================================================ */

/*
 * .reveal starts transparent + shifted down. ui.js adds .in when
 * the element enters the viewport (IntersectionObserver).
 * IMPORTANT: without JS (or with prefers-reduced-motion), the
 * prefers-reduced-motion rule below resets these to visible so
 * content is never permanently hidden.
 */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.in {
    opacity: 1;
    transform: none;
}


/* ============================================================
   ACCESSIBILITY: :focus-visible + reduced-motion
   ============================================================ */

/*
 * Global focus ring in the accent colour. :focus-visible means the ring
 * only appears on keyboard navigation (not on mouse click), so it does
 * not interfere with the designed look while remaining fully accessible.
 */
:focus-visible {
    outline: 2px solid rgb(var(--accent-rgb));
    outline-offset: 3px;
    border-radius: 3px;
}

/*
 * Suppress the browser's default blue :focus outline so our custom ring
 * is the only one. Only suppress when :focus-visible is supported;
 * older browsers get the default fallback.
 */
:focus:not(:focus-visible) {
    outline: none;
}

/*
 * prefers-reduced-motion: disable all non-essential motion.
 * .reveal elements become visible immediately; transitions are near-instant.
 */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    * {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ============================================================
   FORM FIELD component  (SPEC-161)
   ============================================================ */

/*
 * Shared .field + label + input pattern used across all
 * conversion/auth pages. Replaces per-page .form-group blocks.
 */

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3, var(--text-muted));
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 7px;
}

.field-input,
.form-input,
.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
    width: 100%;
    background: var(--bg, var(--background));
    border: 1px solid var(--border-2);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    font-size: 15px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.field-input:focus,
.form-input:focus,
.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="password"]:focus {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-input::placeholder,
.form-input::placeholder {
    color: var(--text-muted);
}


/* ============================================================
   AUTH CARD component  (SPEC-161)
   ============================================================ */

/*
 * Centered card for login / signup / forgot / reset pages.
 * Max-width 420px; split into .auth-card-top (heading) and
 * .auth-card-body (form + links).
 */

.auth-card-wrap {
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    max-width: 440px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-elevated);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.auth-card-top {
    padding: 30px 32px 0;
}

.auth-card-top h1,
.auth-card-top h2 {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.auth-card-top p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 0;
}

.auth-card-body {
    padding: 24px 32px 30px;
}

.auth-card-alt {
    text-align: center;
    color: var(--text-muted);
    font-size: 13.5px;
    margin-top: 18px;
}

.auth-card-alt a {
    color: var(--accent);
    text-decoration: none;
    transition: color .2s var(--ease);
}

.auth-card-alt a:hover {
    color: var(--text-primary);
}


/* ============================================================
   PRICING CARD components  (SPEC-161)
   ============================================================ */

/*
 * Two-column pricing grid with a featured (premium) card variant.
 * .pricing-grid wraps .pricing-card elements.
 * Featured card uses .pricing-card--featured + shows a .pricing-badge.
 */

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    max-width: 860px;
    margin: 0 auto;
}

@media (max-width: 680px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

.pricing-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-elevated);
    padding: 32px;
    position: relative;
    transition: box-shadow .2s var(--ease);
}

.pricing-card--featured {
    border-color: var(--accent-line);
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface-elevated) 100%);
    box-shadow: 0 20px 50px -25px var(--accent-glow);
}

.pricing-badge {
    position: absolute;
    top: -11px;
    left: 32px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.pricing-tier-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pricing-price-display {
    font-family: var(--font-serif);
    font-size: 46px;
    font-weight: 500;
    line-height: 1;
}

.pricing-price-display small {
    font-size: 15px;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.pricing-sub {
    color: var(--text-muted);
    font-size: 13px;
    margin: 6px 0 22px;
}

.pricing-features-list {
    list-style: none;
    margin: 0 0 24px;
}

.pricing-features-list li {
    display: flex;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 11px;
}

.pricing-features-list li::before {
    content: "\2713";
    color: var(--accent);
    font-weight: 700;
    flex: none;
}

/* Monthly/annual billing toggle */
.billing-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.billing-toggle .seg {
    display: inline-flex;
    background: var(--surface-3, var(--surface-elevated));
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px;
}

.billing-toggle button {
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background .15s var(--ease), color .15s var(--ease);
}

.billing-toggle button.on {
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}


/* ============================================================
   ACCOUNT SECTION / CARD components  (SPEC-161)
   ============================================================ */

/*
 * Account page uses .account-grid for a two-column layout,
 * with .account-section cards inside. The usage meter and
 * feature list live inside .account-section.
 */

.account-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 22px;
}

@media (max-width: 768px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
}

.account-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-elevated);
    padding: 26px 28px;
}

.account-section h2,
.account-section h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Plan badge (subscriber tier display) */
.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
}

.plan-badge.free {
    background: rgba(255, 255, 255, .04);
    border-color: var(--border-2);
    color: var(--text-secondary);
}

/* Usage meter (free tier episodes-this-month bar) */
.usage-meter {
    margin: 14px 0 18px;
}

.usage-meter-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 7px;
}

.usage-bar {
    height: 7px;
    border-radius: var(--radius-pill);
    background: var(--surface-3, var(--surface));
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-pill);
    transition: width .3s var(--ease);
}

/* Key-value row (account detail rows) */
.kv-row {
    display: flex;
    justify-content: space-between;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.kv-row:last-child {
    border-bottom: none;
}

.kv-row .kv-key {
    color: var(--text-muted);
}

.kv-row .kv-val {
    color: var(--text-primary);
}

/* Feature access list (free-vs-premium matrix) */
.feature-access-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-access-item {
    display: flex;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.feature-access-item::before {
    content: "\2713";
    color: var(--accent);
    flex: none;
    font-weight: 700;
}

.feature-access-item.locked {
    color: var(--text-muted);
    opacity: .7;
}

.feature-access-item.locked::before {
    content: "\1F512";
}

/* Account action button stack */
.account-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

/* GDPR / data section within account card */
.data-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.data-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
}

.btn-danger {
    background: rgba(248, 113, 113, .08);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, .3);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, .14);
    border-color: rgba(248, 113, 113, .5);
    color: #f87171;
    filter: none;
    box-shadow: none;
}


/* ============================================================
   LIBRARY page components  (SPEC-161)
   ============================================================ */

/* Tab bar */
.lib-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.lib-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: .08em;
    transition: color .15s var(--ease), border-color .15s var(--ease);
}

.lib-tab.active,
.lib-tab[aria-selected="true"] {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

/* Bookmark card */
.bookmark-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 24px 28px;
    margin-bottom: 20px;
}

.bookmark-card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.bookmark-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    flex: 1;
}

.bookmark-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    transition: color .15s var(--ease);
}

.bookmark-remove:hover {
    color: var(--text-primary);
}

.bookmark-meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

/* Reading history grid */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.history-card {
    display: block;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color .2s var(--ease);
}

.history-card:hover {
    border-color: var(--accent-line);
    color: var(--text-primary);
}

.history-card h3 {
    margin: 0 0 8px;
    font-family: var(--font-serif);
    font-size: 18px;
    color: var(--text-primary);
    line-height: 1.4;
}

.history-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Empty state (library + history) */
.empty-state {
    text-align: center;
    padding: 80px 32px;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 8px;
}

.empty-state .empty-cta {
    margin-top: 24px;
}


/* ============================================================
   PREFERENCES page components  (SPEC-161)
   ============================================================ */

/* Topic pill checkboxes */
.topic-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.topic-pill-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 14px;
    transition: border-color .2s var(--ease);
}

.topic-pill-label:hover {
    border-color: var(--accent-line);
}

.topic-pill-label input[type="checkbox"]:checked ~ * {
    color: var(--accent);
}

.topic-pill-label:has(input:checked) {
    border-color: var(--accent-line);
    background: var(--accent-soft);
}

.topic-pill-count {
    color: var(--text-muted);
    font-size: 12px;
}


/* ============================================================
   PROSE layout  (SPEC-162)
   ============================================================ */

/*
 * .prose: shared long-form content column used by About, Methodology,
 * Privacy, Terms, and any other editorial/legal page.
 *
 * Readable measure (65ch max), comfortable leading, typographic rhythm.
 * Headings receive accent underlines via border-bottom so each section
 * visually separates without needing card borders on every block.
 *
 * Usage:
 *   <div class="prose">
 *     <h1>Title</h1>
 *     <p>...</p>
 *     <h2 id="section-anchor">Section</h2>
 *     ...
 *   </div>
 */

.prose {
    max-width: 720px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-family: var(--font-serif);
    font-size: 17px;
    line-height: 1.8;
}

.prose h1 {
    font-family: var(--font-serif);
    font-size: 42px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.2;
}

.prose h2 {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.prose h3 {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 28px;
    margin-bottom: 10px;
}

.prose p {
    margin-bottom: 18px;
    line-height: 1.85;
}

.prose ul,
.prose ol {
    margin: 12px 0 18px 24px;
    line-height: 1.8;
}

.prose li {
    margin-bottom: 8px;
}

.prose a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-line);
    transition: border-color .2s var(--ease), color .2s var(--ease);
}

.prose a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.prose strong {
    color: var(--text-primary);
    font-weight: 600;
}

.prose em {
    font-style: italic;
}

/* Metadata line (e.g. "Last updated: 2026-05-22") */
.prose-meta {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* Draft / review callout box */
.prose-callout {
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 24px 0;
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Related-links section at the bottom of prose pages */
.prose-related {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-secondary);
}

.prose-related a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: none;
    transition: color .2s var(--ease);
}

.prose-related a:hover {
    color: var(--text-primary);
}

/* "Who it's for" / audience card grid inside prose */
.prose-cards {
    display: grid;
    gap: 20px;
    margin: 24px 0;
}

.prose-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 22px 24px;
}

.prose-card-title {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.prose-card p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 0;
    font-family: var(--font-sans);
}


/* ============================================================
   COVERAGE page components  (SPEC-162)
   ============================================================ */

/*
 * Stat tiles grid for the coverage/catalog-progress view.
 * Reuses .card for the big percentage display; introduces
 * .coverage-stat for the four-up breakdown tiles.
 */

.coverage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin: 28px 0;
}

.coverage-stat {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 22px 24px;
    text-align: center;
}

.coverage-stat-number {
    font-family: var(--font-serif);
    font-size: 40px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 6px;
}

.coverage-stat-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
}

.coverage-big-pct {
    font-family: var(--font-serif);
    font-size: 88px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

.coverage-bar {
    height: 10px;
    background: var(--surface-3, var(--surface));
    border-radius: var(--radius-pill);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    margin: 20px 0 6px;
}

.coverage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: var(--radius-pill);
    transition: width .4s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
    .coverage-bar-fill {
        transition: none;
    }
}

.coverage-freshness {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    margin-top: 14px;
}

.coverage-freshness.green {
    background: rgba(127, 163, 131, .15);
    color: #9ecf9b;
    border: 1px solid rgba(127, 163, 131, .35);
}

.coverage-freshness.yellow {
    background: rgba(var(--accent-rgb), .10);
    color: var(--accent);
    border: 1px solid var(--accent-line);
}

.coverage-freshness.red {
    background: rgba(248, 113, 113, .10);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, .25);
}

.coverage-freshness-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}


/* ============================================================
   SPONSORS page components  (SPEC-162)
   ============================================================ */

/*
 * Audience-stat row, placement options, and inquiry form on the public
 * sponsor page. Form uses the shared .field component from SPEC-161.
 */

.sponsors-hero {
    text-align: center;
    padding: var(--space-8) 0 var(--space-7);
}

.sponsors-hero h1 {
    font-family: var(--font-serif);
    font-size: 52px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.15;
}

.sponsors-hero-sub {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Three-up audience stat tiles */
.sponsors-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: var(--space-8);
}

.sponsors-stat {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 28px;
    text-align: center;
}

.sponsors-stat-headline {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 8px;
    line-height: 1.1;
}

.sponsors-stat-copy {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Placements card */
.sponsors-placements {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-7) var(--space-7);
    margin-bottom: var(--space-8);
}

.sponsors-placements h2 {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 22px;
}

.sponsors-placements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
}

.sponsors-placement h3 {
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.sponsors-placement p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 10px;
}

.sponsors-placement-price {
    font-size: 13px;
    color: var(--text-muted);
}

.sponsors-placement-price strong {
    color: var(--accent);
}

/* Inquiry form card */
.sponsors-inquiry {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-7);
    margin-bottom: var(--space-8);
}

.sponsors-inquiry h2 {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.sponsors-inquiry-sub {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 15px;
}

.sponsors-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 560px) {
    .sponsors-form-grid {
        grid-template-columns: 1fr;
    }
}

.sponsors-form-grid .field-full {
    grid-column: 1 / -1;
}

.field textarea {
    width: 100%;
    background: var(--bg, var(--background));
    border: 1px solid var(--border-2);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    font-size: 15px;
    font-family: var(--font-sans);
    outline: none;
    resize: vertical;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.field textarea:focus {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.field select {
    width: 100%;
    background: var(--bg, var(--background));
    border: 1px solid var(--border-2);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    font-size: 15px;
    font-family: var(--font-sans);
    outline: none;
    cursor: pointer;
    transition: border-color .2s var(--ease);
}

.field select:focus {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
}


/* ============================================================
   TRANSACTIONAL page components  (SPEC-162)
   ============================================================ */

/*
 * Centered-card layout for one-action transactional pages:
 * unsubscribed, data-deletion request, deletion confirmed.
 */

.transact-wrap {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

.transact-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto var(--space-5);
    font-size: 28px;
}

.transact-icon.success {
    background: rgba(127, 163, 131, .15);
    border: 1px solid rgba(127, 163, 131, .35);
}

.transact-icon.error {
    background: rgba(248, 113, 113, .10);
    border: 1px solid rgba(248, 113, 113, .25);
}

.transact-icon.warning {
    background: rgba(var(--accent-rgb), .10);
    border: 1px solid var(--accent-line);
}

.transact-title {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.25;
}

.transact-body {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 10px;
}

.transact-note {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 28px;
}

.transact-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 28px;
}

/* Inline error/alert box used on transactional pages */
.transact-alert {
    background: rgba(248, 113, 113, .08);
    border: 1px solid rgba(248, 113, 113, .25);
    color: #f87171;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin: 20px 0;
    font-size: 14px;
    text-align: left;
}

/* Left-aligned deletion-request variant (form page) */
.transact-wrap-left {
    max-width: 520px;
    margin: 0 auto;
}

.transact-wrap-left h1 {
    font-family: var(--font-serif);
    font-size: 34px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.transact-wrap-left p {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 12px;
    font-size: 15px;
}

.transact-wrap-left ul {
    color: var(--text-secondary);
    line-height: 1.75;
    margin: 0 0 16px 22px;
    font-size: 15px;
}

.transact-wrap-left li {
    margin-bottom: 6px;
}

.transact-wrap-left .transact-note {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}


/* ============================================================
   ERROR PAGES  (SPEC-162)
   ============================================================ */

/*
 * CSS-only classes used by 404.html.
 * 500.html uses inline critical CSS so it renders even when base.css
 * fails to load; the classes below are kept here for 404 only.
 */

.error-page {
    max-width: 520px;
    margin: 96px auto;
    padding: 0 16px;
    text-align: center;
}

.error-code {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.error-title {
    font-family: var(--font-serif);
    font-size: 38px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.error-body {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.75;
    margin-bottom: 32px;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}


/* ============================================================
   EPISODE IMAGERY TREATMENT STANDARD  (SPEC-163)
   ============================================================

   This section documents the canonical scrim/crop standard for
   all episode thumbnail display. The concrete CSS rules live in
   home.css (.poster, .thumb, .poster::after) where the episode
   card is authored; these tokens and notes make the contract
   explicit so future surfaces can reuse the same system.

   Scrim: .poster::after
     A linear-gradient overlay (bottom scrim) sits above the
     thumbnail inset and below editorial text:
       linear-gradient(180deg, transparent 32%, rgba(8,9,11,.88))
     This keeps text legible over any thumbnail colour.

   Crop / inset frame: .thumb
     The real thumbnail is inset at the bottom-right of the poster.
     It is constrained to 108px wide, 16:9 aspect-ratio, with:
       border-radius: 8px
       overflow: hidden
       border: 1px solid rgba(255,255,255,.30)
     The thumbnail renders small enough that baked-in text (guest
     name, episode number) reads as a source cue, not as noise.

   Poster aspect ratio: 16/10
     Each .poster container uses aspect-ratio: 16/10 so cards are
     consistent in height across the grid regardless of content.

   Fallback when no thumbnail:
     The .poster gradient background (.t1 .. .t6) is always rendered,
     so a card without any imagery is still on-brand.

   Inset image alt text (a11y):
     The inset img alt attribute is the episode title, giving screen
     reader users a meaningful description of the source image.

   Inset image lazy loading:
     All inset images use loading="lazy" except the first card in a
     grid, which uses loading="eager" fetchpriority="high" to act as
     the LCP image on the homepage.

   poster_url vs thumbnail_url (forward compat):
     _episode_card.html consumes `ep.poster_url or ep.thumbnail_url`.
     When a future clean-poster pipeline (SPEC-163 nice-to-have) adds
     a poster_url column, cards automatically upgrade to the branded
     poster without a template change. Until then, thumbnail_url is
     the inset source and the branded gradient is the poster.
   ============================================================ */
