/* =========================================================
   Caixinha Quântica — Foundations
   Colors, type, spacing, shadows, radii.
   Tavern + arcana tech. Dark, warm, cinematographic.
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Sora:wght@300;400;500;600;700;800&family=Manrope:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  /* ---------- Brand palette ---------- */
  --cq-ink:        #0A0A0B;   /* deepest black, page bg */
  --cq-charcoal:  #111111;   /* primary surface */
  --cq-graphite:  #1D1D1D;   /* elevated surface */
  --cq-slate:     #262626;   /* card surface */
  --cq-stone:     #3A3A3A;   /* borders, dividers */
  --cq-ash:       #5C5C5C;   /* muted text */
  --cq-fog:       #9A9A9A;   /* secondary text */
  --cq-parchment: #F5F5F5;   /* off-white text */
  --cq-bone:      #EDE6D8;   /* warm off-white accent */

  --cq-ember:     #F97316;   /* primary accent — warm orange */
  --cq-ember-hi:  #FB923C;   /* hover */
  --cq-ember-lo:  #C2410C;   /* pressed / deep glow */
  --cq-ember-08:  rgba(249,115,22,0.08);
  --cq-ember-16:  rgba(249,115,22,0.16);
  --cq-ember-24:  rgba(249,115,22,0.24);

  --cq-gold:      #D4A373;   /* aged gold — grimoires, dividers */
  --cq-gold-dim:  #8C6A47;
  --cq-arcane:    #6B5BFF;   /* rare arcana accent — sparingly */
  --cq-crit:      #E8483D;   /* nat 1 / errors */
  --cq-heal:      #4FB286;   /* success / healed */

  /* ---------- Semantic surfaces ---------- */
  --bg:           var(--cq-ink);
  --bg-elev-1:    var(--cq-charcoal);
  --bg-elev-2:    var(--cq-graphite);
  --bg-elev-3:    var(--cq-slate);
  --border:       rgba(245,245,245,0.08);
  --border-strong: rgba(245,245,245,0.16);
  --border-ember: rgba(249,115,22,0.32);

  --fg:           var(--cq-parchment);
  --fg-muted:     var(--cq-fog);
  --fg-dim:       var(--cq-ash);
  --fg-accent:    var(--cq-ember);
  --fg-gold:      var(--cq-gold);

  /* ---------- Typography ---------- */
  --font-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;       /* H1 / brand */
  --font-sans:    "Sora", "Manrope", system-ui, -apple-system, sans-serif; /* UI + headings */
  --font-body:    "Manrope", "Sora", system-ui, -apple-system, sans-serif; /* long-form reading */
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Scale — generous, cinematic. */
  --fs-12: 0.75rem;   /* 12 — micro / overline */
  --fs-13: 0.8125rem; /* 13 — meta */
  --fs-14: 0.875rem;  /* 14 — small */
  --fs-16: 1rem;      /* 16 — body */
  --fs-18: 1.125rem;  /* 18 — body-l */
  --fs-20: 1.25rem;   /* 20 — lead */
  --fs-24: 1.5rem;    /* 24 — h5 */
  --fs-30: 1.875rem;  /* 30 — h4 */
  --fs-36: 2.25rem;   /* 36 — h3 */
  --fs-48: 3rem;      /* 48 — h2 */
  --fs-64: 4rem;      /* 64 — h1 */
  --fs-80: 5rem;      /* 80 — hero */
  --fs-112: 7rem;     /* 112 — display */

  --lh-tight: 1.05;
  --lh-snug:  1.2;
  --lh-base:  1.55;
  --lh-loose: 1.75;

  --tr-tight: -0.03em;
  --tr-snug:  -0.015em;
  --tr-wide:  0.02em;
  --tr-display: 0.08em; /* Cinzel breathes */

  /* ---------- Spacing — 4pt base ---------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;
  --sp-32: 128px;

  /* ---------- Radii ---------- */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-pill: 999px;

  /* ---------- Shadows / glows ---------- */
  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 4px 14px rgba(0,0,0,0.45);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.05) inset, 0 12px 32px rgba(0,0,0,0.55);
  --shadow-3: 0 1px 0 rgba(255,255,255,0.06) inset, 0 24px 60px rgba(0,0,0,0.65);
  --shadow-ember: 0 0 0 1px rgba(249,115,22,0.35), 0 10px 40px -10px rgba(249,115,22,0.55);
  --glow-ember-soft: 0 0 80px -20px rgba(249,115,22,0.45);
  --glow-ember-strong: 0 0 120px -10px rgba(249,115,22,0.7);
  --inner-ring: inset 0 0 0 1px rgba(255,255,255,0.06);

  /* ---------- Motion ---------- */
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out-cubic: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 140ms;
  --dur-base: 240ms;
  --dur-slow: 480ms;
  --dur-cinema: 900ms;

  /* ---------- Layout ---------- */
  --container: 1240px;
  --container-narrow: 880px;
  --content: 720px;
}

/* =========================================================
   Base
   ========================================================= */
html { color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* =========================================================
   Type roles
   ========================================================= */
.cq-display, .cq-h1, .cq-h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tr-display);
  line-height: var(--lh-tight);
  color: var(--fg);
}
.cq-display { font-size: var(--fs-112); }
.cq-h1      { font-size: var(--fs-80); }
.cq-h2      { font-size: var(--fs-48); }

.cq-h3, .cq-h4, .cq-h5 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: var(--tr-snug);
  line-height: var(--lh-snug);
}
.cq-h3 { font-size: var(--fs-36); }
.cq-h4 { font-size: var(--fs-30); }
.cq-h5 { font-size: var(--fs-24); }

.cq-overline {
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cq-ember);
}

.cq-lead {
  font-family: var(--font-body);
  font-size: var(--fs-20);
  line-height: var(--lh-loose);
  color: var(--fg-muted);
}

.cq-body { font-size: var(--fs-16); line-height: var(--lh-loose); color: var(--fg); }
.cq-meta { font-size: var(--fs-13); color: var(--fg-muted); letter-spacing: 0.02em; }
.cq-mono { font-family: var(--font-mono); font-size: var(--fs-14); }

/* Decorative quill — used for pull-quotes in long-form */
.cq-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: var(--fs-30);
  line-height: 1.35;
  color: var(--cq-bone);
}
