/* ==========================================================================
   Sad Song Queens — Design Tokens (v3)
   Source: SSQ Brand Guidelines V1 (colors, fonts) + site art direction.
   v3 = v1 layout + v2 type scale + Apple-ratio capsule buttons + v2 frosted nav.
   Two layers: primitives (raw values) → semantic (usage). Components consume
   ONLY semantic tokens so the theme can be retuned in one place. Every raw
   hex lives in the primitives block; semantic tokens reference primitives.
   Naming: --text-* = color roles, --fs-* = font sizes, --size-* = component
   dimensions, --measure-* = prose widths, --btn-* = button geometry,
   --grid-* / --ratio-* = the Apple-ratio layout grid (docs §13).
   See docs/v3-design-notes.md for what came from v1 vs v2.
   ========================================================================== */

/* ---- Primitives ---- */
:root {
  /* Brand color — from SSQ Brand Guidelines */
  --ssq-white:   #ffffff;
  --ssq-mango:   #ffc000; /* primary accent — crown gold */
  --ssq-neon:    #00e8e8; /* secondary — neon blue (tear highlight) */
  --ssq-royal:   #100daa; /* secondary — deep blue (hero glow shadow) */
  --ssq-magenta: #c53aaa; /* secondary — magenta */

  /* Tints of the brand colors (hover states) */
  --ssq-mango-300: #ffd147;
  --ssq-neon-300:  #6ff5f5;

  /* Ink scale — deep indigo neutrals drawn from the brand background texture */
  --ink-1000: #0a0715; /* footer floor */
  --ink-950: #0d0a1a;
  --ink-900: #151029;
  --ink-850: #1c1536;
  --ink-800: #241b45;
  --ink-600: #453873; /* decorative only — fails text contrast on dark inks */
  --ink-400: #857ab8; /* min. AA text ink on ink-850 and darker */
  --ink-300: #b3a9d6;
  --ink-100: #e9e5f5;

  /* Plum stops of the v1 promo-band gradient */
  --plum-800: #3b1660;
  --plum-600: #6e1f75;

  /* v1 footer social-network hues (the footer is kept from v1) */
  --hue-instagram: #d6559e;
  --hue-spotify:   #35d17a;
  --hue-rss:       #ff9a3c;
  --hue-youtube:   #ff0000; /* YouTube brand red: 4.3:1 on the social-icon card (icon-only; 3:1 needed) */

  /* Type families (self-hosted, see @font-face in main.css) */
  --family-display: "TrashHand", "Comic Sans MS", cursive;         /* brand hand-lettering */
  --family-heading: "Fonseca", "Avenir Next Condensed", sans-serif; /* bold structural headings */
  --family-body:    "Aptos", "Segoe UI", system-ui, sans-serif;

  /* Scales */
  --scale-unit: 0.25rem; /* 4px base — spacing tokens are multiples */
  /* Type steps (rem at the 16px root). Raw sizes the semantic --fs-* tokens are
     built from; components never use these directly. */
  --type-16: 1rem;      /* 16px */
  --type-17: 1.0625rem; /* 17px */
  --type-18: 1.125rem;  /* 18px */
  --type-20: 1.25rem;   /* 20px */
}

/* ---- Semantic: color ---- */
:root {
  --bg-page:      var(--ink-950);
  --bg-card:      var(--ink-850);
  --bg-card-hover:var(--ink-800);
  --bg-footer:    var(--ink-1000);

  --text-primary:   var(--ssq-white);
  --text-lead:      var(--ink-100);  /* intro / band paragraphs */
  --text-secondary: var(--ink-300);
  --text-muted:     var(--ink-400);
  --text-accent:    var(--ssq-mango);
  --text-on-accent: var(--ink-950);
  --text-nav:       var(--ink-100);  /* resting nav link — ≥4.5:1 even when light content blurs under the bar; white on hover */

  --accent:        var(--ssq-mango);
  --accent-hover:  var(--ssq-mango-300);
  --link:          var(--ssq-neon);
  --link-hover:    var(--ssq-neon-300);

  --border-subtle:   color-mix(in srgb, var(--ssq-white) 8%, transparent);
  --border-strong:   color-mix(in srgb, var(--ssq-white) 18%, transparent);
  --border-hairline: var(--border-subtle);
  --focus-ring:    var(--ssq-neon);
  --selection-bg:  var(--ssq-magenta);

  /* Brand art gradients (background texture uses assets/img/bg-texture.webp) */
  --grad-band: linear-gradient(120deg, var(--ink-800) 0%, var(--plum-800) 55%, var(--plum-600) 100%);
  --grad-fade-bottom: linear-gradient(transparent 40%, var(--bg-page) 100%);
  /* Band media tile (Apple equal-height media tile; "Semantic: band" below): a darker
     inset of the band surface that the art sits in, so the tile, not the art, matches the copy */
  --bg-media-tile: color-mix(in srgb, var(--ink-950) 38%, transparent);

  --footer-wordmark: color-mix(in srgb, var(--ssq-white) 20%, transparent); /* footer mini-wordmark tint */

  /* Footer social icons (v1 per-network hues) */
  --social-instagram: var(--hue-instagram);
  --social-tiktok:    var(--ssq-white);
  --social-spotify:   var(--hue-spotify);
  --social-podcast:   var(--ssq-mango);
  --social-youtube:   var(--hue-youtube); /* replaced the footer RSS icon (client 2026-11-20) */

  /* Frosted global nav (v2): translucent ink-950 + backdrop blur; solid fallback */
  --bg-nav:       color-mix(in srgb, var(--ink-950) 72%, transparent);
  --bg-nav-solid: var(--ink-950);
  --bg-nav-menu:  var(--ink-900); /* mobile dropdown — solid (nested backdrop-filter is unreliable) */
  --nav-blur:     saturate(180%) blur(20px);

  /* Buttons */
  --btn-ghost-hover: color-mix(in srgb, var(--ssq-white) 10%, transparent); /* ghost: lighter fill on hover */
}

/* ---- Semantic: typography (scale ported from v2) ----
   Minimum font size (client 2026-11-17): no visible text renders smaller than
   --fs-floor, which IS the home "Queens Behind the Tears" paragraph size
   (--split-fs-body: 20px, 17px at ≤30rem). Every role that used to be smaller
   resolves to the floor; larger roles keep their size (max()). The header /
   global nav is excluded and pinned to its own tokens (Semantic: header nav). */
:root {
  --fs-floor:      var(--split-fs-body);           /* follows the Emmy paragraph at every width */
  --fs-display-xl: clamp(2.75rem, 5.8vw, 5rem);    /* h1 on every page, TrashHand (44–80px) */
  --fs-section:    clamp(2.25rem, 4.6vw, 4rem);    /* section-level h2 (.headline), TrashHand (36–64px) */
  --fs-h2:         clamp(1.9rem, 3.5vw, 2.6rem);   /* band/card h2 (.h2), TrashHand (30–42px) */
  --fs-subhead:    max(clamp(1.1875rem, 1.05rem + 0.55vw, 1.5rem), var(--fs-floor)); /* 19–24px lead under a headline; never under the floor (20px from 481px) */
  --fs-card-title: var(--fs-subhead);              /* non-heading tile titles (listen platform names) */
  --fs-h3:         1.25rem;                        /* card titles, Fonseca */
  --fs-body-lg:    var(--type-20);                 /* 20px .lead (≥ the floor at every width) */
  --fs-body-md:    var(--fs-floor);                /* default body: was 17px; now the floor (20px, 17px ≤30rem) */
  --fs-body:       var(--fs-floor);                /* eyebrows, footer, controls: was 16px; now the floor */
  --fs-small:      var(--fs-floor);                /* chips, card meta/song/excerpt: was 14px; now the floor */
  --fs-btn-lg:     max(var(--type-18), var(--fs-floor)); /* large (hero) button: 20px; 18px ≤30rem */
  --fs-footer-wordmark: clamp(2.5rem, 12.35vw, 15rem); /* full-bleed footer wordmark (crops at edges) */
  --fs-h2-sans:    calc(clamp(1.9rem, 3.5vw, 2.75rem) + 2px); /* Aptos 700 h2 (footer question, Listen season bands): 32–46px. One step for every sans h2 (ui-ux-pro-max font-scale: no new size; heading-clarity: 2.3x the 20px body) */
  --fs-footer-credit: var(--type-16); /* footer "Design by" credit: the ONE text exception below --fs-floor (client 2026-11-20: subdued, smaller); 16px = ui-ux-pro-max readable-font-size minimum */
  --fs-footer-headline: var(--fs-h2-sans); /* footer h2, all pages: --fs-h2's floor + slope, 44px cap, +2px at every width (client 2026-11-17: 46px at 1440; was canvas 2026-11-16: 41.6 → 44px) */

  --leading-display: 1.05;   /* TrashHand h1/h2 */
  --leading-tight:   1.1;    /* h3, v1 footer headline */
  --leading-snug:    1.25;   /* short bold labels */
  --leading-relaxed: 1.5;    /* body (v2) */
  --leading-body:    1.6;    /* v1 footer copy (the footer is kept from v1) */

  --tracking-display: -0.01em;
  --tracking-wide:    0.14em; /* eyebrows */
  --tracking-caps:    0.06em; /* uppercase nav links */

  /* Stack rhythm, two tiers (ui-ux-pro-max audit 2026-11-16: same level = same spacing):
     eyebrow → heading → body is 24px in h1 stacks and 16px in every h2 stack */
  --stack-gap-h1: var(--space-4); /* 24px: page intros, hero */
  --stack-gap-h2: var(--space-3); /* 16px: bands, promo, feature, section heads, centred stacks, footer */

  /* Split sections — ONE type + spacing set for the home "Queens Behind the Tears"
     band, "Why we started" feature and promo banner (client 2026-11-17: synchronize).
     Matches the about/listen bands: section headline + 20px lead + large CTA. */
  --split-fs-eyebrow: var(--fs-body);        /* caps label (= the floor) */
  --split-fs-heading: var(--fs-section);     /* 36–64px TrashHand headline */
  --split-fs-body:    var(--fs-body-lg);     /* 20px paragraph — also defines --fs-floor */
  --split-lh-body:    var(--leading-relaxed);
  --split-measure:    var(--measure-lead);
  --split-stack-gap:  var(--stack-gap-h2);   /* 16px eyebrow → heading → paragraph */
  --split-cta-gap:    var(--btn-stack-gap);  /* paragraph → CTA */
  --split-pad-block:  var(--space-7);        /* 72px: copy inset from its surface's top/bottom edge (promo banner, band card) */
  /* Page intros (client 2026-11-18): intro body copy runs the full width of its column,
     like the band text; About intro paragraphs use the split paragraph set above. */
  --intro-measure:    none;

  --measure-headline: 28ch;  /* h1 wrap width */
  --measure-subhead:  44ch;  /* .subhead under a headline */
  /* Prose measures in em so they hold 65–75 characters per line at the text's own size
     (ui-ux-pro-max audit 2026-11-16; were 38rem / 40rem = 83–88 / 76–82 cpl). The body
     cap keeps 20–24px band leads and subheads no wider than before (608px at 16px root). */
  --measure-body:     min(31em, 38rem); /* band / section body copy: 527px at 17px */
  --measure-lead:     30em;             /* intro lead paragraphs: 600px at 20px */
  --measure-note:     26rem; /* footer tagline / short notes */
}

/* ---- Semantic: buttons (v3 — Apple capsule, em-based so they scale) ----
   Default 17px: 0.647em × 1.235em ≈ 11px × 21px (horizontal ≈ 1.9 × vertical)
   Large 18px:   0.778em × 1.556em ≈ 14px × 28px
   Compact 16px: 0.375em × 0.875em ≈  6px × 14px (nav bar)
   v3 intentionally overrides the brand kit's 4px .btn rule (client request);
   v1 keeps 4px. .filter-pill / .chip keep --radius-full. */
:root {
  --radius-btn: 980px;

  --fs-btn:       var(--fs-body-md);
  --btn-pad-y:    0.647em;
  --btn-pad-x:    1.235em;
  --btn-pad-y-lg: 0.778em;
  --btn-pad-x-lg: 1.556em;
  --btn-pad-y-sm: 0.375em;
  --btn-pad-x-sm: 0.875em;
  --leading-btn:  1.1765;    /* 20px line box at 17px */
  --tracking-btn: -0.01em;
  --weight-btn:   400;       /* regular buttons */
  --weight-btn-strong: 700;  /* every gold .btn--solid (incl. nav "Support the Podcast") */

  --btn-gap:       1.25em;                        /* between adjacent buttons in a row (≈21px at 17px) */
  --btn-stack-gap: calc(var(--type-17) * 1.5);    /* paragraph → CTA (≈25.5px): 1.5 × the pre-floor 17px body, so the 2026-11-17 floor changed type, not spacing */
}

/* ---- Semantic: header nav type — pinned, NOT on --fs-floor ----
   Client 2026-11-17: "you can revert the navigation menu font sizes". Everything
   inside .site-header keeps its pre-floor sizes, independent of --fs-body/--fs-btn. */
:root {
  --fs-nav-base:     var(--type-17); /* what .site-header inherited from body before the floor */
  --fs-nav:          var(--type-16); /* bar links (caps), bar "Support the Podcast" pill, no-JS links */
  --fs-nav-menu:     var(--type-20); /* ≤52rem dropdown links */
  --fs-nav-menu-btn: var(--type-18); /* ≤52rem dropdown pill (the large capsule ratios) */
}

/* ---- Semantic: layout grid (Apple ratios; docs/v3-design-notes.md §13) ----
   12 / 8 / 4 columns at apple.com's breakpoints (≥1069 / 735–1068 / ≤734).
   Gutters are multiples of 4 on the 8pt system. Every structural section is a
   .grid (main.css §3b); blocks are placed with --col / --span / --row /
   --row-span (+ -md / -sm variants), which is also what the archived grid editor wrote.
   ONE set of column lines: every .grid uses --grid-gutter. Extra breathing room
   in a copy ↔ media split is padding inside the copy item (--grid-split-pad),
   never a wider gutter, so blocks snapped to column N line up across sections.
   Breakpoints can't read custom properties, so 1068px / 734px are repeated
   literally in the two media blocks below and in main.css §3b / §10. */
:root {
  --grid-columns: 12;
  --grid-gutter:    24px;                 /* Apple card/tile gutter tier: 24 / 20 / 16 */
  --grid-row: 8px;                        /* 8pt baseline: vertical sizes snap to ×8 (×4 for type) */
  --grid-split-gap: var(--space-6);       /* 48px visual copy ↔ media gap in splits (feature, about intro) */
  --grid-split-pad: calc(var(--grid-split-gap) - var(--grid-gutter)); /* copy-side padding that makes the gutter read as 48px */
  --grid-margin-min: 22px;                /* apple.com side margin (global nav / footer) */
  --grid-max:      61.25rem;              /* 980px narrow/reading well = apple.com content width (1024 box − 2 × 22) */
  --grid-max-wide: 78rem;                 /* 1248px wide well (v1 --container-wide) */
  /* Outer page margins, consumed by .container / .container--wide as margin-inline.
     100% resolves against the container's parent (no 100vw, so a classic
     scrollbar is never counted). Content width = parent − 2 × margin. */
  --grid-margin:        max(var(--grid-margin-min), (100% - var(--grid-max-wide)) / 2); /* wide well */
  --grid-margin-narrow: max(var(--grid-margin-min), (100% - var(--grid-max)) / 2);      /* narrow well */

  /* Apple aspect ratios (media tiles, photos, cinematic inserts) */
  --ratio-square:   1 / 1;
  --ratio-portrait: 4 / 5;
  --ratio-classic:  4 / 3;
  --ratio-photo:    3 / 2;
  --ratio-wide:     16 / 10;
  --ratio-cinema:   16 / 9;
}
@media (max-width: 1068px) { :root { --grid-columns: 8; --grid-gutter: 20px; } }
@media (max-width: 734px)  { :root { --grid-columns: 4; --grid-gutter: 16px; } }

/* ---- Semantic: space, size, shape, motion ---- */
:root {
  --space-1: calc(var(--scale-unit) * 1);  /*  4px */
  --space-2: calc(var(--scale-unit) * 2);  /*  8px */
  --space-3: calc(var(--scale-unit) * 4);  /* 16px */
  --space-4: calc(var(--scale-unit) * 6);  /* 24px */
  --space-5: calc(var(--scale-unit) * 8);  /* 32px */
  --space-6: calc(var(--scale-unit) * 12); /* 48px */
  --space-7: calc(var(--scale-unit) * 18); /* 72px */
  --space-8: calc(var(--scale-unit) * 26); /* 104px */
  --space-card: clamp(1.5rem, 3.2vw, 3rem); /* inner padding of bands (v2 ratio): 24 → 48px */


  /* Component dimensions */
  --size-nav: 56px;           /* sticky frosted nav bar height (v2) */
  --size-touch-min: 44px;     /* minimum hit area (Apple HIG 44pt; ui-ux-pro-max touch-target-size) */
  --size-nav-glyph: 24px;     /* hamburger glyph (matches the svg width/height attributes) */
  --control-pad-y: calc(var(--scale-unit) * 3); /* 12px: filter pills + search field share one toolbar height (47px ≤480, 51px above at the floor size) */
  --scroll-offset: calc(var(--size-nav) + var(--space-3)); /* scroll-padding under the sticky bar: clears its hairline + the focus ring */
  --size-logo: 22px;          /* header full-color queen bust (50% of v1's 44px mark) */
  --size-wordmark: 34px;      /* header title art (unchanged from v1) */
  /* band media / art sizes: "Semantic: band" at the end of this file */
  /* listen.html Spotify playlist player, sized to show N tracks with no inner scroll (client 2026-11-18:
     25 songs). Spotify's embed layout is fixed at every width: 200px header + 8px list padding,
     50px per track row, 8px list padding below (measured 342–980px wide). */
  --playlist-embed-rows: 25;
  --size-playlist-embed: calc(208px + var(--playlist-embed-rows) * 50px + 8px); /* 1466px */
  --size-platform-logo: 40px; /* listen.html platform-tile glyphs (css/pages/listen.css) */
  /* Home "Listen On" row (canvas 2026-11-16: badges 50% larger, spread evenly
     across a 900px block, gaps shrink with the window but never below the min) */
  --size-platform-badge: 60px;     /* badge height, all four (40px × 1.5; sources are 240px tall = 4× / 2× retina-safe) */
  /* Row width and min gap are px like the badge height and the 810px container
     query (review fix 2026-11-16: rem values grew with the reader's default
     text size, squashing the badges at 854–898px and widening the row to 1350px) */
  --size-platforms-row:  100%;     /* badges spread across the full wide content well (1248px at ≥1292px), first logo on its left edge, last on its right (client 2026-11-17; was 900px) */
  --platforms-gap-min:   32px;     /* px: must match the 810px container query (714 + 3×32); below it the row becomes the 2×2 grid */
  --platforms-grid-aspect: 6.2375; /* 2×2 grid width ÷ badge height = (Apple 885 + RSS 612) / 240 source px; shrinks the badges only when even the 2×2 can't fit */
  --size-social-icon: 88px;   /* footer circular social icons */
  --size-social-glyph: 40px;  /* glyph inside a footer social circle */
  --size-video-play: 68px;    /* episode page: YouTube play badge on a non-embeddable video's thumbnail (YouTube's own 68×48 button) */

  --radius-sm: 4px;           /* skip link, search field (canvas 50px edit reverted 2026-11-16) */
  --radius-focus: 4px;        /* focus ring corner, kept small so focused cards/images keep their shape */
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-full: 999px;

  --focus-offset: 3px;

  --shadow-card: 0 10px 30px rgb(0 0 0 / 0.35);
  --shadow-soft: 0 10px 22px rgb(0 0 0 / 0.32); /* faded shadow: platform logos */

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-cm: cubic-bezier(0.22, 1, 0.36, 1); /* Cinematic Motion Kit ease */
  --dur-quick: 160ms;
  --dur-hover: 220ms;
}

/* ---- Semantic: band — ONE image + copy band format (main.css §6 "Bands") ----
   Every image band is .band.band--split.grid (+ .band--align-left / -right) with
   two items: .band__media, an equal-height media TILE holding one .band__art, and
   .band__copy. Side by side, the copy sets the row height and the tile stretches
   to it (Apple HIG Layout: related items share one height; artwork keeps its
   aspect ratio). Stacked (≤56rem on the tablet tier, and every phone) the tile is
   full width at --band-stack-ratio, capped at --band-stack-media-max, then the copy.
   Art variants (class on the <img>):
     .band__art          logo art: shown whole, resting on the tile floor
     .band__art--cover   square cover: shown whole, centred, cover radius
     .band__art--photo   photo of people: fills the tile side by side (cropped at
                         the sides only, around a face-safe focus); stacked, a
                         square of the tile height, centred
   Copy-only bands (.band--center) have no tile. The 1068px / 80.75rem
   breakpoint is repeated literally (custom properties can't drive @media). */
:root {
  /* Placement: media columns of the band's own grid; the copy takes the rest */
  --band-media-span:    3;    /* desktop ≥80.75rem: media 3 | copy 9 of 12 */
  --band-media-span-md: 3;    /* tablet side by side (897–1068px): media 3 | copy 5 of 8 */
  --band-split-pad:     var(--grid-gutter); /* extra copy-side inset: tile ↔ copy gap = 2 × gutter (48 desktop / 40 tablet; client 2026-11-17: doubled) */
  --band-copy-measure:  none; /* band text runs to the band's inner padding on the far side (client 2026-11-17), so left and right insets match */
  --band-stack-gap:     calc(var(--grid-row) * 3); /* stacked tile → copy: 24px */

  /* Media tile */
  --band-media-bg:        var(--bg-media-tile);
  --band-media-radius:    var(--radius-md);
  --band-media-pad:       0px;   /* inset of the art inside the tile */
  --band-stack-ratio:     var(--ratio-square);
  --band-stack-media-max: 24rem; /* stacked tile height cap (apple.com small-tier width) */

  /* Art inside the tile */
  --band-art-box:      min(100cqw, 100cqh); /* logo / cover / stacked photo: square of the tile's shorter side */
  --band-art-fit:      contain;    /* logo + cover: never cropped (crown, cover lettering) */
  --band-art-place:    end center; /* queen bust rests on the tile floor (flat cut edge) */
  --band-cover-place:  center;
  --band-cover-radius: var(--radius-md);
  --band-photo-fit:    cover;      /* host photos fill the tile (Apple HIG: photos fill, art fits) */
  --band-photo-radius: var(--band-media-radius);
  --band-photo-focus:  50% 20%;    /* default object-position: the face sits in the upper half */
  /* Per-photo focal points (object-position) — keep each face inside every crop */
  --focus-host-laura:   50% 20%;   /* square photo, face centred */
  --focus-host-lindsay: 57% 10%;   /* 3:2 photo, face right of centre, head near the top */
  --focus-hosts-studio: 52% 18%;   /* 16:10 studio photo, both hosts centre, heads in the top fifth */
}
/* Fluid wide well (1069px – 80.75rem): media 4 | copy 8, so the tile stays at
   least as wide as the copy is tall (rem-based: larger text keeps it longer) */
@media (1068px < width < 80.75rem) { :root { --band-media-span: 4; } }

/* Split sections on narrow phones (≤30rem): paragraph at 17px (the old body size) so the band's
   228–298px copy column keeps a readable measure; all three blocks stay in sync. */
@media (max-width: 30rem) { :root { --split-fs-body: var(--type-17); } } /* 17px; the raw step, since --fs-body-md now derives from this (via --fs-floor) */
