/* =============================================================
   TOKENS.CSS — Shared design tokens for Cards Against Artemis
   Colors, typography, motion, spacing
   ============================================================= */

:root {
  /* --- Color Tokens --- */
  --parchment: #ffffff;
  --parchment-dark: #f8f8f8;
  --ink: #111111;
  --ink-light: #1c1c1c;
  --red: #c41e1e;
  --gold: #0B3D91;
  --classified-bg: #c41e1e;
  --muted: #616161;
  --dark-bg: #0a0a0a;

  /* --- Motion Tokens --- */
  --ease-out-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-out-quart: cubic-bezier(.25, 1, .5, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-entrance: 600ms;

  /* --- Spacing Scale (8px base) --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 56px;
  --space-12: 64px;
  --space-14: 80px;
  --space-16: 100px;
  --space-20: 120px;

  /* --- Radius Scale --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-3xl: 24px;
  --radius-full: 100px;
}

/* --- Base Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Space Mono', monospace;
  background: var(--parchment);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.6;
  /* Global OpenType: enable everything at the body level */
  font-kerning: normal;
  font-variant-ligatures: common-ligatures contextual;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1, 'case' 1, 'cpsp' 1;
  text-rendering: optimizeLegibility;
}

/* --- Typography Utilities --- */
.ds {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  letter-spacing: -.03em;
  /* DM Sans: full OpenType feature set */
  font-variant-ligatures: common-ligatures discretionary-ligatures contextual;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-feature-settings: 'kern' 1, 'liga' 1, 'dlig' 1, 'calt' 1, 'ss01' 1, 'ss02' 1, 'ss03' 1, 'ss04' 1;
}

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; hanging-punctuation: first allow-end last; }
img { max-width: 100%; height: auto; }

/* --- Shared Prose --- */
.prose {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-light);
  max-width: 680px;
  /* Space Grotesk: full OpenType feature set */
  font-variant-ligatures: common-ligatures discretionary-ligatures contextual;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-feature-settings: 'kern' 1, 'liga' 1, 'dlig' 1, 'calt' 1, 'case' 0, 'cpsp' 0, 'ss01' 1, 'onum' 1, 'pnum' 1;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-style: italic; }

/* --- Shared Labels --- */
.sh {
  font-size: 12px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  font-weight: 700;
  /* Space Mono: OpenType for monospaced labels */
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1, 'case' 1, 'cpsp' 1;
  font-variant-ligatures: common-ligatures contextual;
  font-family: 'Space Mono', monospace;
}

/* --- Footnotes --- */
.fref {
  font-size: .65em;
  vertical-align: super;
  color: var(--gold);
  font-weight: 700;
  cursor: help;
  font-family: 'Space Mono', monospace;
  text-decoration: none;
  line-height: 0;
}
.fb { margin-top: 36px; padding-top: 24px; border-top: 1px solid rgba(0,0,0,.1); }
.fi {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 6px;
  padding-left: 20px;
  position: relative;
}
.fi::before {
  content: attr(data-n);
  position: absolute;
  left: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Space Mono', monospace;
}

/* --- Focus --- */
*:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
*:focus:not(:focus-visible) { outline: none; }

/* --- View Transitions --- */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: 200ms ease-out both fade-out;
}
::view-transition-new(root) {
  animation: 300ms ease-out 100ms both fade-in;
}

@keyframes fade-out {
  to { opacity: 0; }
}
@keyframes fade-in {
  from { opacity: 0; }
}
