/* ==========================================================================
   Bailey · Release notes (série S / EP)
   Feuille de style PARTAGÉE par tous les épisodes + la page d'index.
   Miroir des tokens de brand/tokens.css (source unique). Éditer ici change
   TOUS les épisodes d'un coup, et c'est voulu : le style de la série est un seul
   endroit. Ne pas inliner de style dans les épisodes.
   ========================================================================== */

/* ==== Brand tokens: mirror of brand/tokens.css ==== */
:root {
  --bl-magenta:      oklch(0.575 0.23 357);
  --bl-magenta-deep: oklch(0.48 0.205 359);
  --bl-magenta-soft: oklch(0.95 0.045 352);
  --bl-magenta-text: oklch(0.46 0.2 358);
  --bl-on-magenta:   oklch(0.99 0.006 350);
  --bl-sun:     oklch(0.88 0.17 96);
  --bl-sun-ink: oklch(0.3 0.07 80);
  --bl-pop:  oklch(0.62 0.19 248);
  --bl-plum: oklch(0.22 0.075 352);

  --bg: oklch(1 0 0);
  --canvas: oklch(0.977 0.008 95);
  --surface: oklch(0.976 0.006 350);
  --surface-2: oklch(0.955 0.012 350);
  --ink: oklch(0.17 0.02 350);
  --muted: oklch(0.448 0.027 350);
  --line: oklch(0.9 0.013 350);

  --primary: var(--bl-magenta);
  --primary-deep: var(--bl-magenta-deep);
  --primary-soft: var(--bl-magenta-soft);
  --primary-text: var(--bl-magenta-text);
  --on-primary: var(--bl-on-magenta);
  --accent: var(--bl-sun);
  --accent-ink: var(--bl-sun-ink);
  --pop: var(--bl-pop);
  --ok: oklch(0.52 0.17 150);
  --plum: var(--bl-plum);

  --font-display: 'Gabarito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body:    'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --wrap: 1140px;
  --pad-x: clamp(1.25rem, 5vw, 2rem);
  --section-y: clamp(3.5rem, 8vw, 6.5rem);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px oklch(0.17 0.02 350 / 0.04), 0 10px 30px oklch(0.17 0.02 350 / 0.05);
  --shadow-md: 0 2px 6px oklch(0.17 0.02 350 / 0.06), 0 18px 44px oklch(0.17 0.02 350 / 0.09);
  --shadow-pink: 0 14px 40px oklch(0.6 0.224 357 / 0.32);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

* { box-sizing: border-box; padding: 0; margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { max-width: 100vw; overflow-x: hidden; }
body {
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.88em; background: var(--surface-2); padding: 0.08em 0.36em; border-radius: 6px; }
::selection { background: var(--primary); color: var(--on-primary); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad-x); }
.section { padding-block: var(--section-y); }

.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; text-wrap: balance; }
h1.display { font-size: clamp(2.5rem, 1.7rem + 4vw, 4.5rem); letter-spacing: -0.014em; line-height: 0.98; word-spacing: 0.04em; }
h2.display { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem); line-height: 1.05; }
h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem); line-height: 1.2; }
.lead { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); line-height: 1.5; color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.prose { max-width: 62ch; text-wrap: pretty; }
.mark { color: var(--primary-text); }
.hl { background: linear-gradient(transparent 58%, var(--accent) 58%, var(--accent) 92%, transparent 92%); padding-inline: 0.05em; }

/* ==== Buttons / pills ==== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-family: var(--font-body); font-weight: 700; font-size: 1.02rem; line-height: 1; padding: 0.95rem 1.5rem; border: 0; border-radius: var(--radius-pill); transition: transform 0.18s var(--ease-quart), box-shadow 0.25s var(--ease-quart), background-color 0.18s ease; white-space: nowrap; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-pink); }
.btn-primary:hover { background: var(--primary-deep); transform: translateY(-2px); box-shadow: 0 18px 48px oklch(0.6 0.224 357 / 0.4); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); padding: 0.85rem 1.35rem; }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.pill { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.84rem; font-weight: 600; padding: 0.4rem 0.85rem; border-radius: var(--radius-pill); background: var(--primary-soft); color: var(--primary-text); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }

/* ==== Header ==== */
.site-header { position: sticky; top: 0; z-index: 200; background: oklch(1 0 0 / 0.78); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand__glyph { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-pink); }
.brand__mark { width: 64%; height: 64%; display: block; }
.header-nav { display: flex; align-items: center; gap: 1.5rem; }
.header-link { color: var(--muted); font-weight: 600; font-size: 0.95rem; transition: color 0.18s ease; }
.header-link:hover { color: var(--ink); }
@media (max-width: 720px) { .header-nav .header-link { display: none; } }

/* ==== Hero ==== */
.hero { position: relative; padding-top: clamp(2.5rem, 6vw, 4rem); padding-bottom: var(--section-y); overflow: clip; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; z-index: -1; pointer-events: none; }
.hero::before { width: 40vw; height: 40vw; background: var(--primary-soft); top: -10vw; right: -8vw; }
.hero::after { width: 30vw; height: 30vw; background: oklch(0.92 0.09 96); top: 30vw; left: -10vw; }
.hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.hero__date { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.hero__ep { font-family: var(--font-display); font-weight: 700; font-size: 0.84rem; letter-spacing: 0.04em; color: var(--primary-text); background: var(--primary-soft); padding: 0.4rem 0.75rem; border-radius: var(--radius-pill); }
.hero__kicker { display: block; font-family: var(--font-display); font-weight: 600; color: var(--primary-text); font-size: clamp(1rem, 0.9rem + 0.4vw, 1.2rem); letter-spacing: -0.01em; margin-bottom: 1rem; }
.hero h1 { max-width: 18ch; }
.hero__lead { margin-top: 1.5rem; }
.hero__stats { display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 3.5rem); margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.stat__num { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 1.4rem + 2vw, 3rem); line-height: 1; letter-spacing: -0.03em; }
.stat__num .mark { color: var(--primary-text); }
.stat__label { display: block; margin-top: 0.4rem; color: var(--muted); font-size: 0.92rem; font-weight: 500; max-width: 22ch; }

/* ==== Table of contents / sommaire ==== */
.toc { margin-top: 2.5rem; padding: 1.5rem 1.75rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.toc__label { font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.toc__list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.15rem 1.75rem; align-items: stretch; }
/* height:100% makes every item fill its grid-row track → all items in a row share
   the tallest one's height, so the underlines always align even if a label wraps.
   This is the guarantee: ragged borders can't happen whatever the meta text length. */
.toc__list a { display: flex; align-items: center; gap: 0.7rem; height: 100%; min-height: 3rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line); font-weight: 600; transition: color 0.15s ease; }
.toc__list a:hover { color: var(--primary-text); }
.toc__num { font-family: var(--font-display); font-weight: 800; color: var(--primary-text); font-size: 0.85rem; flex: none; min-width: 1.6em; }
.toc__meta { color: var(--muted); font-weight: 500; font-size: 0.85rem; margin-left: auto; text-align: right; }

/* ==== Throughline band ==== */
.band { background: var(--plum); color: oklch(0.97 0.01 350); }
.band .display { color: oklch(0.99 0.01 350); }
.band .band__lead { color: oklch(0.86 0.03 350); font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); max-width: 60ch; margin-top: 1.25rem; line-height: 1.5; }
.band .mark { color: oklch(0.82 0.14 92); }

/* ==== Release sections ==== */
.rel { position: relative; }
.rel + .rel { border-top: 1px solid var(--line); }
.rel__head { display: grid; grid-template-columns: 1fr; gap: 1rem; max-width: 62ch; }
.rel__tag { display: inline-flex; align-items: center; gap: 0.5rem; align-self: start; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--primary-text); background: var(--primary-soft); padding: 0.35rem 0.75rem; border-radius: var(--radius-pill); }
.rel__vision { color: var(--muted); font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); line-height: 1.55; text-wrap: pretty; }
.rel__vision strong { color: var(--ink); font-weight: 700; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; margin-top: 2.5rem; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease-quart), box-shadow 0.2s var(--ease-quart), border-color 0.2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: oklch(0.85 0.02 350); }
.card__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-text); font-weight: 800; font-family: var(--font-display); margin-bottom: 0.9rem; }
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.97rem; line-height: 1.5; }
.card__ship { display: block; margin-top: 0.9rem; font-size: 0.82rem; font-weight: 600; color: var(--primary-text); }

/* compact "also shipped" list */
.also { margin-top: 2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.5rem 2rem; }
.also li { list-style: none; display: flex; gap: 0.6rem; padding: 0.5rem 0; color: var(--muted); font-size: 0.95rem; border-bottom: 1px solid var(--line); }
.also li b { color: var(--ink); font-weight: 700; }
.also .chk { color: var(--ok); font-weight: 800; flex: none; }
.also__intro { margin-top: 1.75rem; color: var(--muted); font-weight: 600; font-size: 0.95rem; }

/* ==== Narrative example / "here's how you use it" callouts ==== */
.example { margin-top: 1.75rem; padding: 1.35rem 1.6rem; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; max-width: 60ch; }
.example__label { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-display); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 0.22rem 0.6rem; border-radius: var(--radius-pill); margin-bottom: 0.85rem; }
.example p { color: var(--ink); font-size: 1rem; line-height: 1.6; }
.example p + p { margin-top: 0.7rem; }
.example em { color: var(--primary-text); font-style: italic; }

/* a little "ask your AI" exchange, chat-styled (echoes the landing) */
.ask { display: grid; gap: 0.55rem; margin: 1rem 0 0.25rem; }
.ask__line { display: flex; gap: 0.6rem; align-items: flex-start; }
.ask__who { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: 0.72rem; font-weight: 800; font-family: var(--font-display); }
.ask__line--you .ask__who { background: var(--surface-2); color: var(--ink); }
.ask__line--ai .ask__who { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-pink); }
.ask__bubble { background: var(--bg); border: 1px solid var(--line); border-radius: 4px 13px 13px 13px; padding: 0.55rem 0.85rem; font-weight: 600; box-shadow: var(--shadow-sm); }
.ask__line--ai .ask__bubble { border-radius: 4px 13px 13px 13px; }
.ask__bubble b { color: var(--primary-text); }

/* ==== Proof card ==== */
.proof-card { max-width: 420px; margin-top: 2.5rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; }
.proof-card__bar { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.proof-card__title { font-weight: 700; font-family: var(--font-display); }
.proof-card__state { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 700; color: var(--ok); }
.proof-card__state i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.proof-card__rows { padding: 0.4rem 1.2rem; }
.proof-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.proof-row:last-child { border-bottom: 0; }
.proof-row dt { color: var(--muted); font-size: 0.9rem; }
.proof-row dd { font-weight: 600; text-align: right; font-size: 0.9rem; }

/* ==== Next / roadmap ==== */
.next__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 2rem; }
.next__item { padding: 1.2rem 1.4rem; border-left: 3px solid var(--primary); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.next__item h4 { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin-bottom: 0.35rem; }
.next__item p { color: var(--muted); font-size: 0.93rem; }

/* ==== Finale ==== */
.finale { text-align: center; }
.finale p { color: var(--muted); max-width: 46ch; margin: 1rem auto 0; }
.finale__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 2rem; }

/* ==== Footer ==== */
.site-footer { border-top: 1px solid var(--line); padding-block: 3rem; background: var(--bg); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 2rem; }
.footer-tag { color: var(--muted); margin-top: 0.6rem; max-width: 34ch; font-size: 0.95rem; }
.footer-badges { display: flex; flex-direction: column; gap: 0.5rem; align-items: end; }
.built-with { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.built-with .spark { color: var(--primary-text); }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }

/* ==========================================================================
   Page d'index de la série (index.html), généré par next-episode.sh
   ========================================================================== */
.index-hero { padding-top: clamp(3rem, 7vw, 5rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.index-hero h1 { max-width: 16ch; }
.index-hero .lead { margin-top: 1.25rem; }
.ep-list { display: grid; gap: 1rem; margin-top: 1rem; }
.ep-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem 1rem; padding: 1.4rem 1.6rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform 0.18s var(--ease-quart), box-shadow 0.18s var(--ease-quart), border-color 0.18s ease; }
.ep-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: oklch(0.85 0.02 350); }
.ep-item__id { font-family: var(--font-display); font-weight: 800; font-size: 0.9rem; letter-spacing: 0.04em; color: var(--primary-text); background: var(--primary-soft); padding: 0.3rem 0.7rem; border-radius: var(--radius-pill); flex: none; }
.ep-item__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); letter-spacing: -0.02em; flex: 1 1 16ch; }
.ep-item__date { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.ep-item__arrow { color: var(--primary-text); font-weight: 800; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto; } }
