/* Aangan Studio — design tokens. One lens: an evening at the haveli.
   Indigo night, ivory, and lamplight. Nothing else gets a colour of its own.
   Components read the semantic tokens (--bg, --ink, --lamp ...), never the raw brand values. */

:root {
  /* Brand */
  --brand-indigo: #0E2A5E;
  --brand-night: #0A1124;
  --brand-ivory: #F2EADB;
  --brand-paper: #F5EFE3;
  --brand-sand: #EAE1CE;
  --brand-lamp: #D9A54A;

  /* Type */
  --font-display: "Libre Caslon Display", "Bodoni MT", Didot, Georgia, serif;
  --font-body: "Anek Bangla", "Segoe UI", Calibri, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  --step-2: clamp(1.5rem, 1.25rem + 1vw, 2.1rem);
  --step-3: clamp(2rem, 1.5rem + 2.2vw, 3.4rem);
  --step-4: clamp(2.6rem, 1.7rem + 4vw, 5.4rem);
  --step-5: clamp(3.2rem, 1.6rem + 6.4vw, 8rem);

  /* Space: generous, the way a quiet room is */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: clamp(4rem, 3rem + 4vw, 7rem);
  --space-9: clamp(6rem, 4rem + 9vw, 12rem);

  --gutter: clamp(1.25rem, 0.5rem + 3vw, 3.5rem);
  --max: 84rem;
  --measure: 60ch;

  /* Shape: frames are arches or square; only what a hand touches is soft. */
  --radius-touch: 999px;
  --radius-field: 0.5rem;
  --arch: url("../img/arch.svg");
  /* The wordmark's width to height (written by tools/logo.py; plan.js reads it too). */
  --logo-ratio: 3902.87 / 883.5;

  /* Motion: slow out, never bouncy */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 200ms;
  --dur-2: 400ms;
  --dur-3: 900ms;
  --dur-4: 1600ms;

  /* Themes: light-dark(light value, dark value). The device decides unless the visitor picked one. */
  color-scheme: light dark;
  --bg: light-dark(var(--brand-paper), var(--brand-night));
  --bg-alt: light-dark(var(--brand-sand), #0E1835);
  --surface: light-dark(#FBF7EF, #121F42);
  --ink: light-dark(var(--brand-indigo), var(--brand-ivory));
  --ink-soft: light-dark(#5F5848, #B7AE9C);
  --line: light-dark(rgb(14 42 94 / 0.14), rgb(242 234 219 / 0.12));
  --line-strong: light-dark(rgb(14 42 94 / 0.32), rgb(242 234 219 / 0.3));
  --lamp: light-dark(#B98426, var(--brand-lamp));
  --lamp-ink: light-dark(#8A5F14, #E2B866);
  --lamp-line: light-dark(rgb(185 132 38 / 0.55), rgb(217 165 74 / 0.5));
  --on-lamp: light-dark(#FBF7EF, #1A1206);
  --link: light-dark(var(--brand-indigo), var(--brand-ivory));
  --danger: light-dark(#A3321F, #F08A73);
  --focus: light-dark(#0047B3, #E2B866);
  --glow: light-dark(rgb(217 165 74 / 0.16), rgb(217 165 74 / 0.12));

  /* The indigo scene: hero, footer, menu. Indigo in both themes. */
  --scene-bg: var(--brand-indigo);
  --scene-ink: var(--brand-ivory);
  --scene-ink-soft: #C9C0AE;
  --scene-line: rgb(242 234 219 / 0.18);
  --scene-lamp: #E2B05A;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Inside an indigo scene every component reads scene values. */
.scene {
  --bg: var(--scene-bg);
  --bg-alt: rgb(255 255 255 / 0.04);
  --surface: rgb(255 255 255 / 0.05);
  --ink: var(--scene-ink);
  --ink-soft: var(--scene-ink-soft);
  --line: var(--scene-line);
  --line-strong: rgb(242 234 219 / 0.4);
  --lamp: var(--scene-lamp);
  --lamp-ink: var(--scene-lamp);
  --lamp-line: rgb(226 176 90 / 0.55);
  --on-lamp: #1A1206;
  --link: var(--scene-ink);
  --focus: var(--scene-lamp);
  --danger: #F5A08C;
  color-scheme: dark;
  background-color: var(--bg);
  color: var(--ink);
}

/* The second ground, for rhythm between chapters. */
.ground-alt { background-color: var(--bg-alt); }

/* Ivory paper: letters and plates stay paper in both themes, like paper under a lamp. */
.paper {
  --bg: #F7F1E5;
  --surface: #FFFBF3;
  --ink: var(--brand-indigo);
  --ink-soft: #5F5848;
  --line: rgb(14 42 94 / 0.14);
  --line-strong: rgb(14 42 94 / 0.34);
  --lamp: #B98426;
  --lamp-ink: #8A5F14;
  --on-lamp: #FBF7EF;
  --link: var(--brand-indigo);
  --focus: #0047B3;
  --danger: #A3321F;
  color-scheme: light;
  background-color: var(--bg);
  color: var(--ink);
}
