/*
 * Lingoblocks design tokens — shared across all consumer-facing pages.
 * Warm-paper canvas, persimmon accent (リンゴ / ripe-apple), Fraunces
 * display + Inter body + JetBrains Mono metadata. Load before any
 * page-specific <style> so component overrides can cascade on top.
 *
 * Fonts are NOT loaded here — each HTML page loads them directly via
 * <link rel="preconnect"> + <link rel="stylesheet"> in <head>. This
 * is faster than @import (which blocks until this stylesheet is
 * parsed) and lets browsers open the Google Fonts connection in
 * parallel with the tokens.css fetch.
 */

:root {
  /* ── Canvas (warm paper, no cool grays) ──────────────── */
  --bg-base:         #f4ede1;  /* aged paper */
  --bg-surface:      #fbf6ec;  /* cream card */
  --bg-surface-alt:  #ede4d0;  /* pressed paper */
  --cream:           #fbf6ec;
  --border-default:  #d8ccb3;
  --border-subtle:   #e7dcc4;

  /* ── Text (warm ink, not cool slate) ─────────────────── */
  --text-primary:    #241a12;
  --text-secondary:  #6b5d48;
  --text-tertiary:   #a08f72;

  /* ── Persimmon accent — ripe apple / リンゴ ──────────── */
  --accent:          #c95a3f;
  --accent-hover:    #a94528;
  --accent-light:    #fae4d7;
  --accent-border:   #eec3ac;
  --accent-ink:      #7a3321;

  /* ── Supporting warm palette ─────────────────────────── */
  --clay:            #a88265;
  --leaf:            #5a7d4a;
  --leaf-light:      #dee8d0;
  --sunset:          #e89468;

  /* ── Semantic (warm-tuned) ───────────────────────────── */
  --success:         #5a7d4a;
  --success-light:   #dee8d0;
  --error:           #b04529;
  --error-light:     #fae4d7;
  --warning:         #c07a2a;
  --warning-light:   #f5e3c7;
  --border-focus:    #c95a3f;  /* legacy alias → --accent */

  /* ── Shadows — brown-tinted, never blue ──────────────── */
  --shadow-xs: 0 1px 2px rgba(100,60,20,0.05);
  --shadow-sm: 0 1px 2px rgba(100,60,20,0.06), 0 1px 3px rgba(100,60,20,0.05);
  --shadow-md: 0 4px 14px rgba(100,60,20,0.10), 0 2px 4px rgba(100,60,20,0.05);
  --shadow-lg: 0 10px 30px rgba(100,60,20,0.14), 0 4px 10px rgba(100,60,20,0.06);
  --shadow-xl: 0 20px 50px rgba(100,60,20,0.18), 0 6px 14px rgba(100,60,20,0.07);
  --shadow-ring: 0 0 0 3px rgba(201,90,63,0.18);
  --shadow-up: 0 -6px 20px rgba(100,60,20,0.08), 0 -1px 3px rgba(100,60,20,0.05);
  --inset-top:    inset 0 1px 0 rgba(255,250,240,0.7);
  --inset-bottom: inset 0 -2px 0 rgba(120,70,30,0.08);

  /* ── Type system ─────────────────────────────────────── */
  --display: 'Fraunces', Georgia, serif;
  --body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Subtle paper grain — one SVG noise overlay reused everywhere */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.2  0 0 0 0 0.1  0 0 0 0.11 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");

  /* ── Re-tuned pastel palette for deck tiles ──────────── */
  /* Used by deck tile headers. Warmer hues to sit on paper. */
  --pastel-1:  #f7d9c5;  /* peach */
  --pastel-2:  #f3c9a0;  /* apricot */
  --pastel-3:  #e8bf8c;  /* amber */
  --pastel-4:  #d9c8a0;  /* oat */
  --pastel-5:  #c9d8aa;  /* sage */
  --pastel-6:  #b7d3b5;  /* mint */
  --pastel-7:  #c8d5e0;  /* mist */
  --pastel-8:  #d7c9df;  /* lilac */
  --pastel-9:  #edc3cb;  /* rose */
  --pastel-10: #f2b9a9;  /* coral */

  /* ── Motion curves ───────────────────────────────────── */
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-pop:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse 80% 60% at 30% 0%, rgba(255, 230, 200, 0.45) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(220, 180, 140, 0.20) 0%, transparent 55%);
  min-height: 100vh;
  overscroll-behavior: none;
}

/* Grain overlay — extremely subtle, sits on top of everything but
   doesn't catch pointer events. Applied via body::before so every
   page inherits it just by loading this stylesheet. */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: var(--grain);
  pointer-events: none;
  opacity: 0.32;
  z-index: 2000;
  mix-blend-mode: multiply;
}

/* Focus ring on all interactive elements — persimmon, not browser blue.
   Does NOT touch border-radius: the element keeps its own shape. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
