@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --sea: #f6f2ea;          /* page background */
  --sea-2: #ffffff;        /* dialogs, raised surfaces */
  --panel: #ffffff;        /* cards */
  --line: #e3dccf;         /* hairlines */
  --ink: #14212d;          /* text */
  --muted: #66707a;        /* secondary text */
  --rope: #b07a24;         /* brass accent */
  --rope-ink: #ffffff;
  --foam: #0f3554;         /* navy, headings and player */
  --live: #d33f2c;
  --ok: #2e7d4f;
  --player-bg: #0f3554;    /* live card and bottom bar */
  --player-fg: #ffffff;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-family: var(--sans);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sea: #0f1720; --sea-2: #172230; --panel: #172230; --line: #263443;
    --ink: #eef2f6; --muted: #98a4b1; --rope: #d9a64a; --rope-ink: #14212d; --foam: #dfe8f2;
    --player-bg: #1b2a3a; --player-fg: #eef2f6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sea: #0f1720; --sea-2: #172230; --panel: #172230; --line: #263443;
  --ink: #eef2f6; --muted: #98a4b1; --rope: #d9a64a; --rope-ink: #14212d; --foam: #dfe8f2;
  --player-bg: #1b2a3a; --player-fg: #eef2f6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sea); color: var(--ink); line-height: 1.55; font-size: 16px; padding-bottom: 92px; }
a { color: var(--foam); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--rope); }
main { max-width: 1120px; margin: 0 auto; padding: 0 20px 48px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--foam); letter-spacing: 0; }
h2 { font-size: 1.55rem; margin: 40px 0 14px; line-height: 1.2; }
h3 { font-size: 1.1rem; margin: 22px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
button { font: inherit; }

/* ---------- construction strip ---------- */
.construction { background: var(--rope); color: var(--rope-ink); font-size: 0.86rem; padding: 7px 44px 7px 16px; text-align: center; position: relative; }
.construction a { color: inherit; font-weight: 600; }
.construction button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 2px 6px; }

/* ---------- site header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--sea) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .bar { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--foam); }
.brand .logo { width: 28px; height: 38px; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.01em; line-height: 1; }
.wordmark.small { font-size: 1.2rem; }
.site-nav { display: flex; gap: 4px; margin-left: 6px; }
.site-nav a { text-decoration: none; color: var(--ink); padding: 6px 10px; border-radius: 8px; font-size: 0.92rem; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: color-mix(in srgb, var(--foam) 8%, transparent); color: var(--foam); }
.account-slot { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.account-link { background: var(--foam); color: var(--sea); border: 1px solid var(--foam); border-radius: 999px; padding: 7px 14px; font-size: 0.86rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.account-link:hover { color: var(--sea); opacity: 0.92; }
.account-link.ghost, .send.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.account-link.ghost:hover { border-color: var(--ink); color: var(--ink); }
@media (max-width: 720px) {
  .site-nav { display: none; }
  .account-link.ghost { display: none; }
}

/* page title strip for secondary pages */
.masthead { max-width: 1120px; margin: 0 auto; padding: 30px 20px 6px; }
.masthead .tagline { font-family: var(--serif); font-size: 2rem; color: var(--foam); margin: 0; line-height: 1.15; }
.masthead .brand, .masthead .account-slot { display: none; }

/* ---------- hero: live ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 32px; align-items: start; padding-top: 30px; }
.kicker { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(211,63,44,.5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(211,63,44,.45); } 70% { box-shadow: 0 0 0 9px rgba(211,63,44,0); } 100% { box-shadow: 0 0 0 0 rgba(211,63,44,0); } }
.hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.12; margin: 0 0 12px; font-weight: 600; }
.lede { font-size: 1.05rem; color: var(--muted); margin: 0 0 20px; max-width: 46ch; }
.live-card { background: var(--player-bg); color: var(--player-fg); border: 1px solid color-mix(in srgb, var(--player-fg) 12%, transparent); border-radius: 16px; padding: 20px 22px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.play { width: 64px; height: 64px; border-radius: 50%; border: none; background: var(--rope); color: var(--rope-ink); display: grid; place-items: center; cursor: pointer; transition: transform .15s; }
.play:hover { transform: scale(1.04); }
.now-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; }
.now-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin: 3px 0 4px; line-height: 1.25; }
.now-hint { font-size: 0.82rem; opacity: 0.75; }
.listeners { font-size: 0.8rem; opacity: 0.8; margin-top: 6px; display: block; }
.upcoming { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; font-size: 0.92rem; }
.upcoming li { display: grid; grid-template-columns: 62px 1fr; gap: 8px; align-items: baseline; }
.upcoming li span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.82rem; font-weight: 600; }
.aside-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.aside-card h2 { margin: 0 0 10px; font-size: 1.15rem; }
.schedule { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.schedule li { display: grid; grid-template-columns: 1fr; gap: 1px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.schedule li:last-child { border-bottom: none; padding-bottom: 0; }
.schedule b { font-weight: 600; }
.schedule span { color: var(--muted); font-size: 0.86rem; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

/* ---------- la une ---------- */
.une { margin-top: 40px; }
.une-card { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--live); border-radius: 14px; padding: 20px 24px; }
.une-card h2 { margin: 4px 0 8px; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.une-summary { font-size: 1.05rem; margin: 0 0 14px; max-width: 70ch; }
.une-actions { margin: 0; display: flex; gap: 14px; align-items: center; }
.search { margin: 14px 0 0; }
.search input { width: 100%; max-width: 520px; background: var(--sea-2); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font: inherit; }
.search input:focus { outline: 2px solid var(--rope); outline-offset: 1px; }
mark { background: color-mix(in srgb, var(--rope) 30%, transparent); color: inherit; border-radius: 3px; }

/* ---------- replays ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--foam); padding-bottom: 8px; margin-top: 44px; }
.section-head h2 { margin: 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 0.8rem; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--foam); color: var(--sea); border-color: var(--foam); font-weight: 600; }
.episodes { list-style: none; margin: 0; padding: 0; }
.episodes .day { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 22px 0 6px; }
.episodes li.ep { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.episodes li.ep:hover { background: color-mix(in srgb, var(--foam) 5%, transparent); }
.episodes .mini { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--foam); color: var(--foam); display: grid; place-items: center; }
.episodes li.ep:hover .mini { background: var(--foam); color: var(--sea); }
.episodes .title { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; line-height: 1.25; }
.episodes .meta { color: var(--muted); font-size: 0.82rem; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rope); }
.chip.fmt-journal { color: var(--live); }
.chip.fmt-debrief { color: #2f6db3; }
@media (max-width: 600px) { .episodes li.ep { grid-template-columns: 40px 1fr; } .episodes .meta { grid-column: 2; text-align: left; white-space: normal; } }

/* ---------- episode view (transcript + sources) ---------- */
.transcript { margin-top: 36px; border-top: 2px solid var(--foam); padding-top: 18px; position: relative; }
.transcript .back { background: transparent; border: none; color: var(--foam); font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 8px; font-size: 0.9rem; }
.transcript h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 6px 0 4px; }
.transcript audio { width: 100%; margin: 14px 0 6px; }
.report { font-size: 0.85rem; margin: 6px 0 20px; }
.lines { max-width: 72ch; font-size: 1.05rem; }
.line { margin: 0 0 14px; }
.line .who { font-weight: 700; color: var(--rope); margin-right: 8px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.line sup a { color: var(--muted); text-decoration: none; margin-left: 2px; font-size: 0.7rem; }
#sources { padding-left: 20px; font-size: 0.9rem; max-width: 80ch; }
#sources li { margin-bottom: 6px; }
#sources li:target { background: color-mix(in srgb, var(--rope) 15%, transparent); border-radius: 6px; }
.gate { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--rope); border-radius: 12px; padding: 14px 16px; margin: 14px 0 18px; }
.gate p { margin: 0 0 10px; }
.gate p:last-child { margin: 0; }

/* ---------- persistent player bar ---------- */
.player-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--player-bg); color: var(--player-fg); border-top: 1px solid color-mix(in srgb, var(--player-fg) 12%, transparent); box-shadow: 0 -8px 24px rgba(0,0,0,.18); }
.player-bar .bar { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.player-bar .play { width: 46px; height: 46px; }
.player-bar .now-title { font-size: 1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar .now-label { font-size: 0.7rem; }
.player-bar .listeners { margin: 0; white-space: nowrap; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; color: var(--muted); font-size: 0.875rem; }
.site-footer .cols { max-width: 1120px; margin: 0 auto; padding: 30px 20px 26px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-footer h3 { margin: 0 0 8px; font-size: 0.95rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--rope); }
.site-footer .legal { max-width: 1120px; margin: 0 auto; padding: 0 20px 24px; font-size: 0.8rem; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; gap: 18px; } }
.cost { max-width: 360px; margin: 12px 0 0; }
.cost-bar { height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.cost-bar-fill { height: 100%; width: 0; background: var(--rope); border-radius: 999px; transition: width .4s ease; }
.cost-line, .audience-line { margin: 6px 0 0; font-size: 0.8rem; }

/* ---------- generic content blocks ---------- */
.prose { max-width: 72ch; font-size: 1.02rem; }
.prose-block p { margin: 0 0 8px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 16px 0; }
.panel h2 { margin-top: 0; font-size: 1.2rem; }
.panel.danger { border-color: #d9a0a0; }
.stack { display: grid; gap: 12px; max-width: 520px; }
.stack label, .auth-form label { display: grid; gap: 5px; font-weight: 600; font-size: 0.9rem; }
.stack input, .stack textarea, .auth-form input, .feedback textarea, .feedback input[type="text"], .inline input, .inline select {
  background: var(--sea-2); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; width: 100%;
}
.stack input:focus, .stack textarea:focus, .auth-form input:focus, .feedback textarea:focus, .feedback input:focus { outline: 2px solid var(--rope); outline-offset: 1px; }
.send { background: var(--foam); color: var(--sea); border: 1px solid var(--foam); border-radius: 999px; padding: 10px 20px; font-weight: 600; font-size: 0.95rem; cursor: pointer; justify-self: start; }
.send:disabled { opacity: 0.6; cursor: default; }
.send.ghost { color: var(--ink); }
.status { min-height: 1.4em; margin: 0; }
.feed code { word-break: break-all; font-size: 0.85rem; background: color-mix(in srgb, var(--ink) 6%, transparent); padding: 3px 6px; border-radius: 6px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; }
.placeholder { background: color-mix(in srgb, var(--rope) 22%, transparent); padding: 0 4px; border-radius: 4px; }

/* feedback form */
.feedback { display: grid; gap: 12px; max-width: 640px; margin: 10px 0 0; }
.feedback fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0; }
.feedback legend { color: var(--muted); font-size: 0.85rem; padding: 0 6px; }
.kinds { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.kinds label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.feedback > label { font-weight: 600; }
.episode-note { background: var(--panel); border-left: 3px solid var(--rope); border-radius: 6px; padding: 8px 12px; margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* events */
.events { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.events li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; }
.ev-name { font-weight: 600; font-family: var(--serif); font-size: 1.05rem; }
.vote { background: transparent; color: var(--foam); border: 1px solid var(--foam); border-radius: 999px; padding: 6px 12px; font-size: 0.82rem; cursor: pointer; white-space: nowrap; }
.vote.on { background: var(--foam); color: var(--sea); font-weight: 600; }
@media (max-width: 600px) { .events li { grid-template-columns: 1fr; } }

/* audience page */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 2px; }
.kpi-value { font-family: var(--serif); font-size: 2rem; font-weight: 600; color: var(--foam); font-variant-numeric: tabular-nums; }
.kpi-label { color: var(--muted); font-size: 0.82rem; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; align-items: end; height: 110px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.bar { height: 100%; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; min-height: 2px; background: var(--rope); border-radius: 3px 3px 0 0; }
.top { padding-left: 22px; }
.top li { margin-bottom: 4px; }
.table-wrap { overflow-x: auto; }
.days { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.days th, .days td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.days th:first-child, .days td:first-child { text-align: left; }
.days th { color: var(--muted); font-weight: 600; }

/* auth dialog */
.auth-dialog { background: var(--sea-2); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; width: min(420px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-dialog::backdrop { background: rgba(10,20,30,.5); }
.auth-form { display: grid; gap: 12px; position: relative; }
.auth-form h2 { margin: 0; font-size: 1.4rem; }
.auth-form .close { position: absolute; top: -8px; right: -6px; background: transparent; border: none; color: var(--muted); font-size: 1.6rem; cursor: pointer; }
.auth-status { min-height: 1.2em; margin: 0; color: var(--live); font-size: 0.9rem; }
.close { background: transparent; border: none; color: var(--muted); font-size: 1.6rem; cursor: pointer; }
