/*
 * home.css
 * SPEC-158: Public Site Redesign -- Homepage
 *
 * Page-specific styles for the homepage. Consumes SPEC-156 design tokens
 * (--accent-rgb, --bg, --surface, --font-serif, etc.) from base.css.
 * No build step, no bundler.
 */


/* ============================================================
   AMBIENT PAGE LIGHTING
   ============================================================ */

.home-ambient::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 500px at 78% -5%, rgba(var(--accent-rgb), .10), transparent 60%),
        radial-gradient(800px 600px at 10% 8%, rgba(127, 168, 255, .05), transparent 55%);
}

.home-ambient > * {
    position: relative;
    z-index: 1;
}


/* ============================================================
   HERO
   ============================================================ */

.hero {
    padding: 88px 0 64px;
    position: relative;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 40px;
    align-items: center;
}

.hero h1 {
    font-size: clamp(44px, 6vw, 82px);
    margin: 22px 0;
    line-height: 1.08;
    letter-spacing: -.01em;
}

.hero .lede {
    font-size: 18px;
    font-weight: 400;
    color: #bcc2cc;
    max-width: 33em;
    line-height: 1.72;
    letter-spacing: .002em;
}

.hero-cta {
    display: flex;
    gap: 14px;
    margin-top: 34px;
    flex-wrap: wrap;
}

.hero-meta {
    margin-top: 30px;
    display: flex;
    gap: 26px;
    color: var(--text-muted);
    font-size: 13.5px;
    flex-wrap: wrap;
}

.hero-meta b {
    color: var(--text-secondary);
    font-weight: 550;
}

/* Coverage pill */
.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border-2);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: border-color .2s var(--ease);
}

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

.hero-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    flex: none;
}

.hero-pill .chev {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    font-size: 12px;
    color: var(--text-primary);
    flex: none;
}


/* ============================================================
   CONSTELLATION STAGE
   ============================================================ */

.stage {
    position: relative;
    height: 460px;
}

.stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.stage .glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(closest-side, rgba(var(--accent-rgb), .10), transparent 70%);
    filter: blur(8px);
    pointer-events: none;
}


/* ============================================================
   USAGE BANNER (free-tier -- between hero and grid)
   ============================================================ */

.usage-banner-v2 {
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-elevated);
    padding: 16px 22px;
    margin: 28px 0 0;
}

.usage-banner-v2.warn {
    border-color: var(--accent-line);
    background: linear-gradient(90deg, rgba(var(--accent-rgb), .08), var(--surface-elevated));
}

.usage-big {
    font-family: var(--font-serif);
    font-size: 30px;
    color: var(--accent);
    line-height: 1;
    flex: none;
}

.usage-mid {
    flex: 1;
}

.usage-mid .t {
    font-size: 14px;
    color: var(--text-primary);
}

.usage-mid .s {
    font-size: 13px;
    color: var(--text-muted);
}

.usage-meter {
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    overflow: hidden;
    margin-top: 8px;
    max-width: 280px;
}

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


/* ============================================================
   SOCIAL PROOF: MARQUEE + STATS
   ============================================================ */

.proof {
    padding: 26px 0 8px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-top: 30px;
}

.proof .label {
    text-align: center;
    color: var(--text-muted);
    font-size: 12.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.marquee-track {
    display: flex;
    gap: 54px;
    align-items: center;
    width: max-content;
    animation: scrollx 42s linear infinite;
    opacity: .6;
}

.marquee:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-track span {
    font-family: var(--font-serif);
    font-size: 20px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

@keyframes scrollx {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin: 46px 0 0;
}

.stat {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface), transparent);
}

.stat .n {
    font-family: var(--font-serif);
    font-size: 34px;
    color: var(--text-primary);
    line-height: 1;
}

.stat .n em {
    font-style: normal;
    color: var(--accent);
}

.stat .k {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}


/* ============================================================
   SECTION HEADERS
   ============================================================ */

.section {
    padding: 96px 0;
}

.sec-head {
    max-width: 34em;
    margin-bottom: 44px;
}

.sec-head h2 {
    font-size: clamp(32px, 4vw, 46px);
    margin: 14px 0;
    line-height: 1.1;
    color: var(--text-primary);
}

.sec-head p {
    color: var(--text-secondary);
    font-size: 17px;
    margin: 0;
}

.sec-head .more {
    margin-top: 16px;
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: var(--accent);
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity .2s;
}

.sec-head .more:hover {
    opacity: .8;
}

.eyebrow {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 550;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--text-muted);
}


/* ============================================================
   EPISODE GRID + TREATMENT-D CARDS
   ============================================================ */

.ep-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.ep {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-elevated);
    transition: all .3s var(--ease);
    display: flex;
    flex-direction: column;
}

.ep:hover {
    transform: translateY(-4px);
    border-color: var(--border-2);
    box-shadow: var(--shadow);
}

/* Poster: gradient base + gradient scrim overlay */
.poster {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 18px;
}

.poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 32%, rgba(8, 9, 11, .88));
}

/* Poster gradient color themes */
.t1 { background: radial-gradient(120% 120% at 70% 20%, #16202c, #0c0d10); }
.t2 { background: radial-gradient(120% 120% at 30% 10%, #142028, #0c0d10); }
.t3 { background: radial-gradient(120% 120% at 75% 15%, #1b2030, #0c0d10); }
.t4 { background: radial-gradient(120% 120% at 25% 20%, #11212a, #0c0d10); }
.t5 { background: radial-gradient(120% 120% at 70% 25%, #1a1f2e, #0c0d10); }
.t6 { background: radial-gradient(120% 120% at 30% 15%, #142433, #0c0d10); }

/* Guest name (large editorial serif on poster) */
.gname {
    position: absolute;
    top: 16px;
    left: 18px;
    right: 18px;
    z-index: 2;
    font-family: var(--font-serif);
    font-size: 29px;
    line-height: 1.04;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .55);
    pointer-events: none;
}

/* Episode number sub-label */
.gsub {
    position: absolute;
    bottom: 54px;
    left: 18px;
    z-index: 2;
    font-size: 12px;
    color: rgba(255, 255, 255, .72);
    font-family: var(--font-mono);
    letter-spacing: .04em;
    pointer-events: none;
}

/* Real thumbnail inset (bottom-right) */
.thumb {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 108px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .30);
    box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .75);
    z-index: 3;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Duration / read-time chips */
.pmeta {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 8px;
}

.chip {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 7px;
    background: rgba(8, 9, 11, .6);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    backdrop-filter: blur(3px);
}

/* "For you" badge */
.ep-foryou {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    padding: 3px 9px;
    border-radius: var(--radius-pill);
}

/* Admin status badge on card */
.ep-status-badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 4;
}

/* Card body */
.ep-body {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.ep-body .date {
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font-mono);
}

.ep-body h3 {
    font-size: 18.5px;
    line-height: 1.25;
    font-weight: 600;
    margin: 0;
}

.ep-title {
    color: var(--text-primary);
    text-decoration: none;
    transition: color .2s var(--ease);
}

.ep-title:hover {
    color: var(--accent);
}

.ep-title--unavailable {
    color: var(--text-muted);
    cursor: default;
}

.ep-body .take {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    flex: 1;
    margin: 0;
}

.ep-body .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.ep-body .read {
    color: var(--accent);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity .2s;
}

.ep-body .read:hover {
    opacity: .8;
}

.ep-body .read--unavailable {
    color: var(--text-muted);
    font-size: 13.5px;
}

.ep-body .rt {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Poster link wrapper (no decoration, full block) */
.ep-poster-link {
    display: block;
    text-decoration: none;
}


/* ============================================================
   EDITOR'S PICK (FEATURED CARD)
   ============================================================ */

.admin-preview-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(240, 180, 90, .14);
    border: 1px solid rgba(240, 180, 90, .35);
    color: #f0c168;
    border-radius: 10px;
    padding: 11px 16px;
    font-size: 13.5px;
    margin-bottom: 16px;
}

.featured-card {
    position: relative;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 28px;
    align-items: center;
    border: 1px solid var(--accent-line);
    border-radius: 18px;
    background: linear-gradient(120deg, rgba(var(--accent-rgb), .08), var(--surface-elevated));
    padding: 24px;
    overflow: hidden;
    margin-bottom: 48px;
}

.featured-card .poster {
    aspect-ratio: 16/10;
    border-radius: 12px;
    overflow: hidden;
}

.featured-card .poster .gname {
    font-size: 24px;
}

.featured-pick-label {
    font-family: var(--font-serif);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--accent);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-card h2 {
    font-size: 27px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.featured-card h2 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color .2s;
}

.featured-card h2 a:hover {
    color: var(--accent);
}

.featured-blurb {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 18px;
}


/* ============================================================
   BENTO: "More than a summary"
   ============================================================ */

.bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(220px, auto);
    gap: 22px;
}

.cell {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: border-color .3s var(--ease);
}

.cell:hover {
    border-color: var(--border-2);
}

.cell h3 {
    font-size: 23px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.cell p {
    color: var(--text-secondary);
    font-size: 14.5px;
    max-width: 32ch;
    margin: 0;
}

.cell.big { grid-column: span 4; }
.cell.sm  { grid-column: span 2; }

.cell .demo { margin-top: 20px; }

/* Depth toggle demo */
.seg-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

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

.seg button {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: color .2s;
}

.seg button:hover { color: var(--text-primary); }

.seg button.on {
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 550;
}

.seg-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.takelist {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    transition: opacity .15s ease;
}

.takelist .li {
    display: flex;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.takelist .li::before {
    content: "";
    margin-top: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    flex: none;
}

/* Chat demo */
.chat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.bubble {
    font-size: 13.5px;
    padding: 10px 13px;
    border-radius: 12px;
    max-width: 88%;
}

.bubble.q {
    align-self: flex-end;
    background: var(--accent);
    color: var(--accent-ink);
    border-bottom-right-radius: 4px;
}

.bubble.a {
    align-self: flex-start;
    background: var(--surface-3);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.bubble.a .src {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-mono);
}

/* Concept links demo */
.concepts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.concepts a {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-2);
    background: rgba(255, 255, 255, .03);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all .2s;
}

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

/* Mini index */
.mini-index {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.mini-index .ix {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--text-secondary);
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border);
}

.mini-index .ix b {
    color: var(--text-primary);
    font-weight: 500;
}

.mini-index .ix span {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
}


/* ============================================================
   CTA BAND
   ============================================================ */

.cta-band {
    padding: 110px 0;
    text-align: center;
}

.cta-band h2 {
    font-size: clamp(34px, 5vw, 58px);
    max-width: 16ch;
    margin: 0 auto 18px;
    color: var(--text-primary);
    line-height: 1.1;
}

.cta-band p {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 32px;
}

.subscribe-row {
    display: flex;
    gap: 10px;
    max-width: 480px;
    margin: 0 auto;
}

.subscribe-row input {
    flex: 1;
    background: var(--surface-elevated);
    border: 1px solid var(--border-2);
    color: var(--text-primary);
    border-radius: var(--radius-pill);
    padding: 13px 20px;
    font-size: 15px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.subscribe-row input:focus {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* reveal is handled by ui.js IntersectionObserver */


/* ============================================================
   RESPONSIVE
   ============================================================ */

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

    .stage {
        height: 340px;
        order: -1;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .ep-grid {
        grid-template-columns: 1fr 1fr;
    }

    .bento {
        grid-template-columns: repeat(2, 1fr);
    }

    .cell.big,
    .cell.sm {
        grid-column: span 2;
    }

    .featured-card {
        grid-template-columns: 1fr;
    }
}

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

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .subscribe-row {
        flex-direction: column;
    }
}

/* prefers-reduced-motion: disable marquee and constellation */
@media (prefers-reduced-motion: reduce) {
    .marquee-track {
        animation: none;
    }
}
