/* ==========================================================================
   Sudoku University — Design Tokens
   Light = "Notebook" (parchment, walnut ink, reading-first)
   Dark  = "Chalkboard" (the game's own in-app palette, lit by lamp-brass)
   ========================================================================== */

:root,
[data-theme='light'] {
  /* Surfaces — parchment / aged paper */
  --color-bg: #f3ead4;
  --color-surface: #faf3e2;
  --color-surface-2: #fffbf1;
  --color-surface-offset: #ecdfbd;
  --color-surface-offset-2: #dfcd9c;
  --color-divider: #d8c69c;
  --color-border: #c1a771;

  /* Text — walnut ink (matches the game's given-digit color) */
  --color-text: #241a0f;
  --color-text-muted: #6b5738;
  --color-text-faint: #a3906a;
  --color-text-inverse: #f8f1de;

  /* Primary accent — brass / lamp gold */
  --color-primary: #9c6d10;
  --color-primary-hover: #7a540b;
  --color-primary-active: #5b3e08;
  --color-primary-highlight: #ecdca9;

  /* Solved-blue (matches the game's solved-digit / hint color) */
  --color-blue: #1d5f8a;
  --color-blue-hover: #164a6d;
  --color-blue-highlight: #cfe0e9;

  /* Error / conflict (matches the game's magenta-red error color) */
  --color-notification: #a13355;
  --color-notification-highlight: #ecd2da;

  /* Walnut frame — used for header/footer paneling regardless of theme */
  --color-walnut: #4a2f18;
  --color-walnut-dark: #34200e;
  --color-walnut-light: #6b4423;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

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

  --shadow-sm: 0 1px 2px oklch(0.2 0.03 60 / 0.1);
  --shadow-md: 0 6px 20px oklch(0.2 0.03 60 / 0.16);
  --shadow-lg: 0 20px 48px oklch(0.15 0.03 60 / 0.28);

  --content-narrow: 640px;
  --content-default: 880px;
  --content-wide: 1200px;

  --font-display: 'Boska', Georgia, serif;
  --font-body: 'Switzer', 'Work Sans', sans-serif;
}

[data-theme='dark'] {
  /* Surfaces — the chalkboard itself */
  --color-bg: #142520;
  --color-surface: #18291f;
  --color-surface-2: #1d3025;
  --color-surface-offset: #223a2d;
  --color-surface-offset-2: #294536;
  --color-divider: #2f4d3c;
  --color-border: #3d5f4a;

  /* Text — chalk */
  --color-text: #eae2cd;
  --color-text-muted: #a9b8ab;
  --color-text-faint: #708374;
  --color-text-inverse: #16241f;

  /* Primary accent — desk-lamp brass glow */
  --color-primary: #d9ab52;
  --color-primary-hover: #e8c06c;
  --color-primary-active: #f2d38c;
  --color-primary-highlight: #3c3320;

  /* Solved-blue chalk */
  --color-blue: #6fa8cc;
  --color-blue-hover: #8fbcda;
  --color-blue-highlight: #24333d;

  /* Error chalk */
  --color-notification: #d97a97;
  --color-notification-highlight: #4a3038;

  --color-walnut: #241609;
  --color-walnut-dark: #170d05;
  --color-walnut-light: #382110;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.35);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.55);
}

/* Type scale */
: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(2rem, 1.2rem + 2.5vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.25rem);

  --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;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
}

/* ==========================================================================
   Shared base look
   ========================================================================== */

.wrap {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.wrap-narrow {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.eyebrow::before {
  content: '';
  width: 1.5rem;
  height: 1px;
  background: var(--color-primary);
}

.section-head {
  max-width: 46rem;
  margin-bottom: var(--space-12);
}
.section-head h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-3);
}
.section-head p {
  margin-top: var(--space-4);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 56ch;
}
