/* Design tokens: fonts, colour themes, spacing, radii and motion.
   Dark is the reference palette; the light theme defines its own accessible
   values instead of inverting. System preference applies until the visitor
   picks a theme, which the inline initializer writes to data-theme. */

@font-face {
  font-family: 'Newsreader';
  src: url('../assets/fonts/newsreader-latin-var.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../assets/fonts/dm-sans-latin-var.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Metric-matched fallbacks (measured from the font files) keep text from
   shifting when the web fonts arrive. */
@font-face {
  font-family: 'Newsreader Fallback';
  src: local('Georgia');
  size-adjust: 95%;
  ascent-override: 77.4%;
  descent-override: 27.9%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'DM Sans Fallback';
  src: local('Arial'), local('Helvetica');
  size-adjust: 106.9%;
  ascent-override: 92.8%;
  descent-override: 29%;
  line-gap-override: 0%;
}

:root {
  color-scheme: dark;

  /* Colour: dark reference palette (neutral graphite, copper accent) */
  --bg: #0b0c0e;
  --bg-raise: #131417;
  --surface: rgb(23 24 28 / 0.74);
  --surface-solid: #17181c;
  --ink: #f2f1ee;
  --ink-soft: #d2d1cd;
  --muted: #9d9ea4;
  --border: rgb(255 255 255 / 0.12);
  --border-strong: rgb(255 255 255 / 0.3);
  --copper: #c98a4b;
  --copper-strong: #dc9d5d;
  --gold: #cfb27a;
  --on-copper: #0b0c0e;
  --header-glass: rgb(11 12 14 / 0.72);
  --focus-inner: #e3a868;
  --focus-outer: #0b0c0e;
  --shadow: 0 24px 60px rgb(0 0 0 / 0.4);
  --led: #ffb63a; /* the card's LED is yellow (KT-0805Y) */

  /* Hero studio: a soft key light behind the card and a faint grid */
  --studio-key: rgb(255 246 232 / 0.2);
  --studio-fill: rgb(201 138 75 / 0.09);
  --studio-grid: rgb(255 255 255 / 0.05);
  --studio-shadow: rgb(0 0 0 / 0.75);

  /* Hero panels: code window and market chart */
  --panel-bg: rgb(21 22 26 / 0.9);
  --panel-bar: rgb(255 255 255 / 0.035);
  --panel-border: rgb(255 255 255 / 0.11);
  --panel-shadow: 0 34px 70px -24px rgb(0 0 0 / 0.75);
  --code-ink: #e4e3df;
  --code-kw: #d99a5c;
  --code-str: #a6cc9f;
  --code-num: #dcbf7f;
  --code-fn: #93b7dd;
  --code-com: #8d8f96;
  --code-pun: #a9aab0;
  --chart-up: #4fb08b;
  --chart-down: #e46d5e;
  --chart-ema-1: #d99a5c;
  --chart-ema-2: #a9aab0;
  --chart-rsi: #93b7dd;
  --chart-grid: rgb(255 255 255 / 0.07);

  /* Line art */
  --line-frame: rgb(157 158 164 / 0.45);
  --line-arch: var(--copper);
  --line-wave: rgb(207 178 122 / 0.78);
  --line-ornament: var(--gold);
  --line-silk: rgb(242 241 238 / 0.72);
  --line-board: rgb(157 158 164 / 0.6);
  --board-fill: #0d0f0e; /* the real card's black solder mask */

  /* Type */
  --font-display: 'Newsreader', 'Newsreader Fallback', Georgia, serif;
  --font-body: 'DM Sans', 'DM Sans Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text-body: 1.0625rem;
  --text-small: 0.9375rem;
  --text-kicker: 0.75rem;
  --leading: 1.6;
  --measure: 66ch;
  /* Capped so "Vankeswaram" (≈5.63 em wide) fits the 592 px copy column (PF-5). */
  --name-size: clamp(46px, 6.1vw, 100px);

  /* Space: an 8px grid with fluid section rhythm */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;
  --s7: 96px;
  --gutter: clamp(16px, 4vw, 56px);
  --content-max: 1280px;
  --section-pad: clamp(80px, 12vh, 152px);
  --header-h: 64px;

  /* Shape */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --stroke: 1.25px;

  /* Motion (mirrors data/site-config.json → motion) */
  --dur-hover: 180ms;
  --dur-state: 320ms;
  --dur-reveal: 560ms;
  --ease-ui: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-scene: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Light theme values (applied for system-light visitors and explicit choice). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --bg: #f4f3f0;
    --bg-raise: #eae9e5;
    --surface: rgb(255 255 255 / 0.8);
    --surface-solid: #ffffff;
    --ink: #141518;
    --ink-soft: #33353a;
    --muted: #5c5e65;
    --border: rgb(20 21 24 / 0.13);
    --border-strong: rgb(20 21 24 / 0.32);
    --copper: #8f4d17;
    --copper-strong: #7a3f10;
    --gold: #765a17;
    --on-copper: #ffffff;
    --header-glass: rgb(244 243 240 / 0.8);
    --focus-inner: #8f4d17;
    --focus-outer: #ffffff;
    --shadow: 0 24px 60px rgb(20 21 24 / 0.12);
    --led: #d98a00;
    --studio-key: rgb(255 255 255 / 0.95);
    --studio-fill: rgb(201 138 75 / 0.08);
    --studio-grid: rgb(20 21 24 / 0.06);
  --studio-shadow: rgb(20 21 24 / 0.38);
  --panel-bg: rgb(255 255 255 / 0.92);
  --panel-bar: rgb(20 21 24 / 0.03);
  --panel-border: rgb(20 21 24 / 0.1);
  --panel-shadow: 0 30px 60px -24px rgb(20 21 24 / 0.28);
  --code-ink: #24262b;
  --code-kw: #8f4d17;
  --code-str: #3b7348;
  --code-num: #765a17;
  --code-fn: #2d5c8c;
  --code-com: #6c6e75;
  --code-pun: #55575e;
  --chart-up: #23805d;
  --chart-down: #c2402f;
  --chart-ema-1: #a85d1f;
  --chart-ema-2: #6c6e75;
  --chart-rsi: #2d5c8c;
  --chart-grid: rgb(20 21 24 / 0.08);
    --line-frame: rgb(20 21 24 / 0.3);
    --line-wave: rgb(118 90 23 / 0.75);
    --line-silk: rgb(20 21 24 / 0.6);
    --line-board: rgb(20 21 24 / 0.45);
    --board-fill: #0d0f0e;
  }
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f3f0;
  --bg-raise: #eae9e5;
  --surface: rgb(255 255 255 / 0.8);
  --surface-solid: #ffffff;
  --ink: #141518;
  --ink-soft: #33353a;
  --muted: #5c5e65;
  --border: rgb(20 21 24 / 0.13);
  --border-strong: rgb(20 21 24 / 0.32);
  --copper: #8f4d17;
  --copper-strong: #7a3f10;
  --gold: #765a17;
  --on-copper: #ffffff;
  --header-glass: rgb(244 243 240 / 0.8);
  --focus-inner: #8f4d17;
  --focus-outer: #ffffff;
  --shadow: 0 24px 60px rgb(20 21 24 / 0.12);
  --led: #d98a00;
  --studio-key: rgb(255 255 255 / 0.95);
  --studio-fill: rgb(201 138 75 / 0.08);
  --studio-grid: rgb(20 21 24 / 0.06);
  --studio-shadow: rgb(20 21 24 / 0.38);
  --panel-bg: rgb(255 255 255 / 0.92);
  --panel-bar: rgb(20 21 24 / 0.03);
  --panel-border: rgb(20 21 24 / 0.1);
  --panel-shadow: 0 30px 60px -24px rgb(20 21 24 / 0.28);
  --code-ink: #24262b;
  --code-kw: #8f4d17;
  --code-str: #3b7348;
  --code-num: #765a17;
  --code-fn: #2d5c8c;
  --code-com: #6c6e75;
  --code-pun: #55575e;
  --chart-up: #23805d;
  --chart-down: #c2402f;
  --chart-ema-1: #a85d1f;
  --chart-ema-2: #6c6e75;
  --chart-rsi: #2d5c8c;
  --chart-grid: rgb(20 21 24 / 0.08);
  --line-frame: rgb(20 21 24 / 0.3);
  --line-wave: rgb(118 90 23 / 0.75);
  --line-silk: rgb(20 21 24 / 0.6);
  --line-board: rgb(20 21 24 / 0.45);
  --board-fill: #0d0f0e;
}

@media (max-width: 599px) {
  :root {
    --header-h: 56px;
    --text-body: 1rem;
  }
}
