/* =========================================================
   Thiago Patriota Library — Colors & Type
   Single source of truth for tokens used across surfaces.
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Figtree:wght@300;400;500;600;700;800&family=Sora:wght@300;400;500;600;700&family=Caveat:wght@400;500;600;700&display=swap");

:root {
  /* ---------- COLOR — Library brand (premium-minimalist) ---------- */
  --bg: #fafafa; /* off-white page bg */
  --bg-2: #ffffff; /* card / surface elevated */
  --bg-warm: #fbf8f3; /* Orange Book editorial cream */
  --bg-warm-2: #f2ebe1; /* warm surface (Chapters / Testimonial) */
  --ink: #18181b; /* zinc-900 */
  --ink-2: #27272a; /* zinc-800 */
  --ink-3: #52525b; /* zinc-600 — secondary copy */
  --ink-4: #a1a1aa; /* zinc-400 — tertiary / captions */
  --line: #e4e4e7; /* zinc-200 — hairlines */
  --line-warm: #e5dcd0; /* warm border on cream */

  /* ---------- COLOR — Accents ---------- */
  --orange: #ea580c; /* primary accent — Library brand orange */
  --orange-soft: #f57a1f; /* Orange Book softer warm orange */
  --orange-deep: #d96b19; /* hover / press */
  --orange-glow: #ffb160; /* sun-dot highlight */
  --teal: #5bb8b5; /* editorial cool accent */
  --teal-deep: #3d8b88;
  --paper-cream: #fbf8f3; /* alias for --bg-warm */

  /* ---------- COLOR — Per-book palettes (homepage hero bands) ---------- */
  --book-orange-bg: #fff4e6;
  --book-orange-accent: #ea580c;
  --book-aurora-bg: #f4efe8;
  --book-aurora-accent: #b07a4a;
  --book-binary-bg: #ececef;
  --book-binary-accent: #2b2b33;
  --book-bailalua-bg: #eaf2f4;
  --book-bailalua-accent: #4a8aa0;

  /* ---------- COLOR — Semantic ---------- */
  --fg: var(--ink);
  --fg-2: var(--ink-3);
  --fg-3: var(--ink-4);
  --link: var(--orange);
  --selection: rgba(234, 88, 12, 0.2);

  /* ---------- TYPE — Families ---------- */
  --font-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --font-serif: "Cormorant Garamond", "Fraunces", Georgia, serif;
  --font-sans: "Sora", "Figtree", system-ui, -apple-system, sans-serif;
  --font-body: "Figtree", "Sora", system-ui, sans-serif;
  --font-script: "Caveat", cursive;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---------- TYPE — Scale (px) ---------- */
  --t-xs: 12px;
  --t-sm: 14px;
  --t-base: 16px;
  --t-lg: 18px;
  --t-xl: 20px;
  --t-2xl: 24px;
  --t-3xl: 30px;
  --t-4xl: 36px;
  --t-5xl: 48px;
  --t-6xl: 60px;
  --t-7xl: 72px;
  --t-8xl: 96px;

  /* ---------- TYPE — Tracking ---------- */
  --tr-tight: -0.02em;
  --tr-snug: -0.01em;
  --tr-normal: 0;
  --tr-wide: 0.18em;
  --tr-wider: 0.22em;
  --tr-widest: 0.28em;

  /* ---------- SPACING (4px base) ---------- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;
  --s-32: 128px;

  /* ---------- RADII ---------- */
  --r-0: 0px; /* editorial / Orange Book */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px; /* premium book-card rounding */
  --r-2xl: 32px; /* sidebar cards */
  --r-full: 9999px;

  /* ---------- SHADOWS / ELEVATION ---------- */
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-card: 0 18px 60px rgba(15, 23, 42, 0.08);
  --shadow-book: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 20px 50px -15px rgba(0, 0, 0, 0.3);
  --shadow-book-warm: 24px 28px 40px rgba(43, 43, 43, 0.22), 0 2px 6px rgba(43, 43, 43, 0.18);
  --shadow-press: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 80px -20px rgba(234, 88, 12, 0.5);

  /* ---------- MOTION ---------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 180ms;
  --dur-base: 320ms;
  --dur-slow: 700ms;
  --dur-reveal: 900ms;
  --dur-page: 1000ms;
}

/* =========================================================
   Semantic styles (h1, h2, body, eyebrow, etc.)
   Author-mode classes — not a CSS reset.
   ========================================================= */

.h-display {
  font-family: var(--font-display);
  font-size: clamp(56px, 8vw, 108px);
  line-height: 0.95;
  letter-spacing: var(--tr-tight);
  font-weight: 400;
  color: var(--fg);
}

.h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.05;
  letter-spacing: var(--tr-tight);
  font-weight: 500;
  color: var(--fg);
}

.h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.5vw, 48px);
  line-height: 1.1;
  letter-spacing: var(--tr-snug);
  font-weight: 500;
  color: var(--fg);
}

.h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.25;
  letter-spacing: var(--tr-snug);
  font-weight: 500;
  color: var(--fg);
}

.lead {
  font-family: var(--font-body);
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.5;
  color: var(--fg-2);
}

.body {
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--fg-2);
}

.body-sm {
  font-family: var(--font-body);
  font-size: var(--t-sm);
  line-height: 1.55;
  color: var(--fg-2);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--t-xs);
  letter-spacing: var(--tr-widest);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--fg-3);
}

.script {
  font-family: var(--font-script);
  font-size: var(--t-3xl);
  color: var(--orange-soft);
  line-height: 1;
}

.italic-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
}

.code {
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  background: var(--bg-warm-2);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
}

::selection {
  background: var(--selection);
  color: var(--ink);
}
