/* Studio design system: base tokens, fonts and page background.
   Approved direction: modern, rounded, liquid glass (design/mockups, decision D12). */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/Geist.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 300 600; font-display: swap; src: url("../fonts/Newsreader.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 300 500; font-display: swap; src: url("../fonts/Newsreader-Italic.woff2") format("woff2"); }

:root {
  --font-ui: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Newsreader", ui-serif, Georgia, serif;

  /* accent comes from /theme.css; these are fallbacks */
  --accent: #b9502a; --accent-ink: #b9502a; --accent-rgb: 185, 80, 42;
  --accent-soft: rgba(var(--accent-rgb), 0.12);
  --accent-line: rgba(var(--accent-rgb), 0.28);

  --ink: #1c1a18; --ink-2: #4a4641; --ink-3: #6e6862; --ink-4: #9a938b;
  --line: rgba(28, 26, 24, 0.08); --line-2: rgba(28, 26, 24, 0.15);
  --sage: #3f6b4d; --sage-soft: rgba(63, 107, 77, 0.13);
  --amber: #855508; --amber-soft: rgba(196, 140, 30, 0.16);
  --rose: #a63d4c; --rose-soft: rgba(166, 61, 76, 0.12);
  --sky: #2f5f8f; --sky-soft: rgba(47, 95, 143, 0.12);

  --base: #f1ece6;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #fffdfb;
  --surface-sunk: rgba(28, 26, 24, 0.04);
  --on-ink: #fffdfb;
  --on-accent: #ffffff;
  --glassy-bg: rgba(255, 255, 255, 0.5);
  --current-bg: rgba(255, 255, 255, 0.75);
  --current-shadow: inset 0 1px 0 #fff, 0 4px 12px -8px rgba(60, 36, 20, 0.35);

  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.38));
  --glass-border: rgba(255, 255, 255, 0.68);
  --glass-hi: rgba(255, 255, 255, 0.92);
  --glass-lo: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 18px 40px -18px rgba(60, 36, 20, 0.32), 0 2px 6px rgba(60, 36, 20, 0.06);
  --card-shadow: 0 1px 1px rgba(60, 36, 20, 0.04), 0 8px 24px -14px rgba(60, 36, 20, 0.22);
  --sheen: linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0) 38%);
  --sheen-blend: soft-light;

  --aurora-1: #f4c4a1; --aurora-2: #c9d9ee; --aurora-3: #d3e3cf; --aurora-4: #f1d2d8;
  --grain-opacity: 0.05; --grain-blend: multiply;

  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 30px; --r-pill: 999px;
  --blur: 30px;

  --pad-card: 20px; --row-pad: 12px; --control-h: 38px; --gap: 18px;
  color-scheme: light;
}

/* Dark tokens: applied when the user picks Dark, or picks "Match device" on a dark device. */
[data-theme="dark"] {
  --ink: #f4efe9; --ink-2: #cfc8c0; --ink-3: #a59e96; --ink-4: #7b756e;
  --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.15);
  --sage: #8fc29d; --sage-soft: rgba(143, 194, 157, 0.15);
  --amber: #e8b44f; --amber-soft: rgba(232, 180, 79, 0.15);
  --rose: #f08a96; --rose-soft: rgba(240, 138, 150, 0.14);
  --sky: #8db6e3; --sky-soft: rgba(141, 182, 227, 0.14);
  --base: #121113; --surface: rgba(30, 29, 32, 0.8); --surface-solid: #1d1c1f; --surface-sunk: rgba(255, 255, 255, 0.045);
  --on-ink: #141315;
  --on-accent: #1a120e;
  --glassy-bg: rgba(255, 255, 255, 0.08);
  --current-bg: rgba(255, 255, 255, 0.1);
  --current-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --glass-bg: linear-gradient(180deg, rgba(58, 55, 60, 0.56), rgba(32, 30, 34, 0.44));
  --glass-border: rgba(255, 255, 255, 0.12); --glass-hi: rgba(255, 255, 255, 0.16); --glass-lo: rgba(255, 255, 255, 0.03);
  --glass-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
  --card-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 10px 26px -14px rgba(0, 0, 0, 0.7);
  --sheen: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 40%); --sheen-blend: normal;
  --aurora-1: #6b3420; --aurora-2: #233a5a; --aurora-3: #24402e; --aurora-4: #4d2433;
  --grain-opacity: 0.04; --grain-blend: screen;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f4efe9; --ink-2: #cfc8c0; --ink-3: #a59e96; --ink-4: #7b756e;
    --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.15);
    --sage: #8fc29d; --sage-soft: rgba(143, 194, 157, 0.15);
    --amber: #e8b44f; --amber-soft: rgba(232, 180, 79, 0.15);
    --rose: #f08a96; --rose-soft: rgba(240, 138, 150, 0.14);
    --sky: #8db6e3; --sky-soft: rgba(141, 182, 227, 0.14);
    --base: #121113; --surface: rgba(30, 29, 32, 0.8); --surface-solid: #1d1c1f; --surface-sunk: rgba(255, 255, 255, 0.045);
    --on-ink: #141315;
    --on-accent: #1a120e;
    --glassy-bg: rgba(255, 255, 255, 0.08);
    --current-bg: rgba(255, 255, 255, 0.1);
    --current-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    --glass-bg: linear-gradient(180deg, rgba(58, 55, 60, 0.56), rgba(32, 30, 34, 0.44));
    --glass-border: rgba(255, 255, 255, 0.12); --glass-hi: rgba(255, 255, 255, 0.16); --glass-lo: rgba(255, 255, 255, 0.03);
    --glass-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
    --card-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 10px 26px -14px rgba(0, 0, 0, 0.7);
    --sheen: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 40%); --sheen-blend: normal;
    --aurora-1: #6b3420; --aurora-2: #233a5a; --aurora-3: #24402e; --aurora-4: #4d2433;
    --grain-opacity: 0.04; --grain-blend: screen;
    color-scheme: dark;
  }
}

[data-density="compact"] { --pad-card: 16px; --row-pad: 8px; --control-h: 34px; --gap: 14px; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--base);
  -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
}
a { color: var(--accent-ink); }
img, svg { display: block; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 12px; background: var(--surface-solid); color: var(--ink); }
.skip:focus { top: 12px; }

svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; display: inline-block; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

.display { font-family: var(--font-display); font-weight: 350; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.faint { color: var(--ink-4); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.02em; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row-flex { display: flex; align-items: center; gap: 10px; }
.push { margin-left: auto; }
.hidden { display: none !important; }

/* Background: slow color fields behind the glass, plus fine grain */
.aurora {
  position: fixed; inset: -10%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38% 42% at 12% 18%, var(--aurora-1) 0%, transparent 70%),
    radial-gradient(32% 40% at 86% 12%, var(--aurora-2) 0%, transparent 70%),
    radial-gradient(40% 46% at 78% 86%, var(--aurora-3) 0%, transparent 70%),
    radial-gradient(34% 36% at 30% 92%, var(--aurora-4) 0%, transparent 72%),
    var(--base);
  filter: blur(44px) saturate(115%);
  animation: drift 40s ease-in-out infinite alternate;
}
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
  background-image: url("../img/grain.svg");
}
@keyframes drift { to { transform: translate3d(2%, -2%, 0) scale(1.04); } }

.rise { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.rise.d1 { animation-delay: .04s; } .rise.d2 { animation-delay: .08s; } .rise.d3 { animation-delay: .12s; } .rise.d4 { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .rise, .aurora { animation: none; } * { transition: none !important; } }

svg.i.flip { transform: scaleX(-1); }

[hidden] { display: none !important; }
