/* ================================================
   base.css · Reset, Design Tokens, Typography
   ================================================ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* --- Design Tokens --- */
:root {
  /* Palette */
  --maroon: #4a0e18;
  --maroon-deep: #2a070d;
  --gold: #c9a24b;
  --gold-light: #e8c97a;
  --cream: #f7efe2;
  --paper: #fdf8ee;
  --ink: #2e2119;

  /* Chapter palettes */
  --haldi: #e8a820;
  --haldi-bg: #fdf3d8;
  --night: #1c2a52;
  --fire: #5e0d18;
  --serene: #f6f4ef;
  --saffron: #e07b1f;
  --blue: #274b8f;
  --champagne: #f4e8d4;

  /* Semantic */
  --bg: var(--cream);
  --bg-r: 247; --bg-g: 239; --bg-b: 226;
  --text: var(--ink);
  --accent: var(--gold);

  /* Spacing scale */
  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 1rem;
  --sp-lg: 2rem;
  --sp-xl: 4rem;
  --sp-2xl: 6rem;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-card: 0 8px 32px rgba(42, 7, 13, 0.18);
  --shadow-card-hover: 0 16px 48px rgba(42, 7, 13, 0.25);
  --shadow-glow-gold: 0 0 24px rgba(201, 162, 75, 0.35);

  /* Z-layers */
  --z-particles: 1;
  --z-content: 10;
  --z-envelope: 100;
  --z-vellum: 200;
  --z-progress: 300;
}

/* --- Typography --- */
body {
  font-family: 'Mulish', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: rgb(var(--bg-r), var(--bg-g), var(--bg-b));
}

/* Display heading - Cormorant Garamond */
.heading, h1, h2, h3 {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-weight: 600;
  line-height: 1.15;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.8rem); }

/* Foil gradient for names */
.foil {
  background: linear-gradient(
    105deg,
    var(--gold) 0%,
    var(--gold-light) 25%,
    #fff5d4 50%,
    var(--gold-light) 75%,
    var(--gold) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: none; /* driven by anime.js, see motion.css for reduced-motion fallback */
}

/* Eyebrow text */
.eyebrow {
  font-family: 'Mulish', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Body text */
.body-text {
  font-family: 'Mulish', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
}

/* Devanagari */
.devanagari {
  font-family: 'Tiro Devanagari Hindi', serif;
}

/* Gurmukhi */
.gurmukhi {
  font-family: 'Mukta Mahee', sans-serif;
}

/* Character split spans */
.char {
  display: inline-block;
}

/* Foil gradient must be applied to char spans (inline-block breaks parent background-clip) */
.foil .char {
  background: linear-gradient(
    105deg,
    var(--gold) 0%,
    var(--gold-light) 25%,
    #fff5d4 50%,
    var(--gold-light) 75%,
    var(--gold) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Line spans */
.line {
  display: block;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* --- Body lock state --- */
body.locked {
  overflow: hidden;
  height: 100vh;
}

/* --- Selection --- */
::selection {
  background: var(--gold);
  color: var(--cream);
}
