/* =========================================================================
   WITCHES & BITCHES — COLORS & TYPE
   The sacred tokens. Use these vars; do not hardcode.
   ========================================================================= */

/* Google Fonts now loaded via <link> in index.html (parallel, non-blocking)
   instead of a chained @import here. */

@font-face {
  font-family: "Pirata One Local";
  src: url("fonts/PirataOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ------------------------------------------------------------------
     COLOR — Parchment, ink, and the four sacred accents.
     Never pure white. Never pure black. Everything is aged.
     ------------------------------------------------------------------ */

  /* ------------------------------------------------------------------
     THE SIX — sacred palette
     Black · Violet · Gold · Green · Dark Green · Pink
     ------------------------------------------------------------------ */
  --black: #0a0a0a;              /* mystic black — primary dark ground */
  --violet: #4f1f9c;             /* deeper electric mystic violet */
  --gold: #d6a84a;               /* burnished gold — workhorse accent */
  --green: #3ddc84;              /* vivid grass green */
  --green-dark: #1a5a3e;         /* deep forest green — lifted */
  --pink: #ff1f7a;               /* hot witch pink — energetic */

  /* Tonal supporting steps */
  --black-soft: #1a1612;
  --violet-soft: #8f5ce0;
  --violet-deep: #3d1f4e;
  --gold-deep: #a37a2a;
  --gold-pale: #f0d488;
  --green-soft: #6df0a3;
  --green-deep: #082818;
  --pink-soft: #ff8fb8;
  --pink-deep: #b8275f;

  /* Surfaces */
  --parchment: #f5f0e6;          /* warm cream — light ground */
  --parchment-deep: #ede4d1;
  --parchment-shadow: #d9cdb3;
  --ink: var(--black);           /* alias — keep legacy names working */
  --ink-soft: var(--black-soft);
  --ink-velvet: #1a0e22;         /* black-violet for velvet panels */

  /* Foreground / type colors */
  --fg-on-parchment: #1a1410;
  --fg-on-parchment-muted: #5a4a38;
  --fg-on-ink: #f5f0e6;
  --fg-on-ink-muted: #b8a888;

  /* Legacy aliases — keep old code paths working */
  --forest: var(--green-dark);
  --forest-soft: var(--green);
  --rose: var(--pink);

  /* Semantic */
  --border-fine: rgba(26, 20, 16, 0.18);
  --border-gold: var(--gold-deep);
  --divider: rgba(26, 20, 16, 0.12);
  --shadow-soft: 0 1px 0 rgba(26, 20, 16, 0.06), 0 8px 24px -12px rgba(26, 20, 16, 0.25);
  --shadow-card: 0 2px 0 rgba(26, 20, 16, 0.04), 0 18px 40px -20px rgba(26, 20, 16, 0.35);
  --shadow-inset-gold: inset 0 0 0 1px var(--gold-deep);

  /* ------------------------------------------------------------------
     TYPE — One display, one small-caps, one body, one signature.
     ------------------------------------------------------------------ */
  --font-display: "Pirata One", "Pirata One Local", "UnifrakturMaguntia", serif;
  --font-smallcaps: "Pirata One", "Pirata One Local", "UnifrakturMaguntia", serif;
  --font-body: "Pirata One", "Pirata One Local", "UnifrakturMaguntia", serif;
  --font-script: "Pirata One", "Pirata One Local", "UnifrakturMaguntia", serif;

  /* Scale — built for a single-page manifesto site */
  --fs-hero:    clamp(72px, 12vw, 180px);
  --fs-h1:      clamp(48px, 7vw, 96px);
  --fs-h2:      clamp(36px, 5vw, 64px);
  --fs-h3:      clamp(24px, 3vw, 36px);
  --fs-eyebrow: 14px;            /* small caps Cinzel */
  --fs-body:    19px;
  --fs-body-lg: 22px;
  --fs-meta:    13px;
  --fs-roman:   16px;            /* tarot corner numerals */

  /* Tracking */
  --tr-display: 0.02em;
  --tr-smallcaps: 0.28em;
  --tr-body: 0.005em;

  /* Line heights */
  --lh-display: 0.95;
  --lh-h: 1.05;
  --lh-body: 1.55;

  /* ------------------------------------------------------------------
     SPACING — Asymmetric, scrapbook rhythm.
     ------------------------------------------------------------------ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --space-9: 112px;
  --space-10: 160px;

  /* ------------------------------------------------------------------
     RADII — Almost none. Vintage things have sharp corners.
     ------------------------------------------------------------------ */
  --radius-0: 0;
  --radius-sm: 2px;          /* the most we ever round */
  --radius-pill: 999px;       /* only for tags / sigil buttons */

  /* ------------------------------------------------------------------
     TEXTURES — overlay images, used as background-image layers.
     ------------------------------------------------------------------ */
  --grain-opacity: 0.06;
  --vignette: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(10, 10, 10, 0.18) 100%
  );
}

/* =========================================================================
   SEMANTIC ELEMENT DEFAULTS
   Drop colors_and_type.css on any page and headings work out of the box.
   ========================================================================= */

html, body {
  background: var(--parchment);
  color: var(--fg-on-parchment);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-h);
  letter-spacing: var(--tr-display);
  text-transform: uppercase;
  margin: 0 0 var(--space-5) 0;
  color: var(--fg-on-parchment);
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

.eyebrow,
.smallcaps {
  font-family: var(--font-smallcaps);
  font-size: var(--fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: var(--tr-smallcaps);
  font-weight: 500;
  color: var(--gold-deep);
}

.script {
  font-family: var(--font-script);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tr-display);
}

p, li { font-family: var(--font-body); font-size: var(--fs-body); line-height: var(--lh-body); }

a { color: var(--violet); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rose); }

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

/* Inverted surface helper */
.on-ink {
  background: var(--ink);
  color: var(--fg-on-ink);
}
.on-ink h1, .on-ink h2, .on-ink h3 { color: var(--fg-on-ink); }
.on-ink .eyebrow { color: var(--gold); }

/* Paper-grain helper — apply to any surface */
.paper-grain {
  position: relative;
}
.paper-grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: 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.1  0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}
.on-ink.paper-grain::before { mix-blend-mode: screen; opacity: 0.08; }
