/* ─────────────────────────────────────────────────────────────────────────
   Lion and Lamp — Shared design tokens & base styles
   Used by /index.html (library) and every /stories/*/index.html player
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2.25rem, 1.5rem + 2.5vw, 3.5rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Boska', Georgia, 'Times New Roman', serif;
  --font-body: 'General Sans', 'Helvetica Neue', system-ui, sans-serif;

  /* Series palette — night/lamp gold/deep navy */
  --color-bg: #0a1224;
  --color-surface: #11192b;
  --color-surface-2: #1a2238;
  --color-border: #1f2a44;
  --color-text: #ede8d8;
  --color-text-muted: #8e95a8;
  --color-text-faint: #4d5468;
  --color-primary: #e8b84a;
  --color-primary-hover: #f3c963;
  --color-accent: #c9961a;
  --color-rainbow: linear-gradient(90deg,#ef5b5b,#f1a23b,#e8c64a,#5fb273,#4f8fc0,#7b62b7);

  --shadow-md: 0 4px 20px rgba(0,0,0,0.55);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.7);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
p, li { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; font-family: var(--font-display); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 var(--space-6); }
.container--narrow { max-width: 760px; }

.btn-primary {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  background: var(--color-primary); color: #0a0c14;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 700;
  transition: all var(--transition); border: none;
}
.btn-primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border); color: var(--color-text);
  font-size: var(--text-sm); font-weight: 600;
  transition: all var(--transition);
}
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Token fallback repeated at the end so story pages keep their full design even
   if a browser or preview sandbox drops the first custom-property block. */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2.25rem, 1.5rem + 2.5vw, 3.5rem);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Boska', Georgia, 'Times New Roman', serif;
  --font-body: 'General Sans', 'Helvetica Neue', system-ui, sans-serif;
  --color-bg: #0a1224;
  --color-surface: #11192b;
  --color-surface-2: #1a2238;
  --color-border: #1f2a44;
  --color-text: #ede8d8;
  --color-text-muted: #8e95a8;
  --color-text-faint: #4d5468;
  --color-primary: #e8b84a;
  --color-primary-hover: #f3c963;
  --color-accent: #c9961a;
  --color-rainbow: linear-gradient(90deg,#ef5b5b,#f1a23b,#e8c64a,#5fb273,#4f8fc0,#7b62b7);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.55);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.7);
}
