/* insigz — design tokens
   Two-mode system: light (working surface) and dark (Arena/play, projector).
   All values in OKLCH-equivalent hex; see uploads/06-ui-ux.md Part 2 for the spec.
*/

:root {
  /* Type */
  --font-display: "Fraunces", "PP Editorial New", Georgia, serif;
  --font-body: "Inter Tight", "PP Neue Montreal", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "PP Neue Montreal Mono", ui-monospace, SFMono-Regular, monospace;

  --text-display-xl: clamp(3rem, 7vw, 6.5rem);
  --text-display-l: clamp(2rem, 3.5vw, 3.2rem);
  --text-display-m: clamp(1.5rem, 2.2vw, 2rem);
  --text-body-l: 1.125rem;
  --text-body: 1rem;
  --text-body-s: 0.875rem;
  --text-mono: 0.8125rem;
  --text-mono-s: 0.6875rem;

  /* Spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;
  --s-11: 12rem;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-tap: 100ms;
  --dur-reveal: 240ms;
  --dur-surface: 460ms;
  --dur-phase: 1100ms;
  --dur-brand: 2200ms;

  /* Team identity colors — invariant across themes */
  --team-nato: #5B8FF5;
  --team-hybrid: #E59A50;
  --team-civil: #7DD6A1;
  --team-faculty: #D6D8DD;
}

/* ---- DARK MODE (default for the Arena, brand hero, demo route) ---- */
:root, .theme-dark {
  --surface-void: #06080C;
  --surface-base: #0B1018;
  --surface-raised: #141A24;
  --surface-overlay: #1A2230;
  --surface-line: #1F2733;
  --surface-line-strong: #2A3445;

  --text-primary: #F2F4F7;
  --text-muted: #8B95A7;
  --text-faint: #5A6271;

  --accent-signal: #62E1B6;
  --accent-warn: #F5B764;
  --accent-alert: #F26B6B;
  --accent-cool: #7AA8FF;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.4);
}

/* ---- LIGHT MODE (Faculty Overlay, Workshop, daytime authoring) ---- */
.theme-light {
  --surface-void: #FAFAF8;
  --surface-base: #F3F4F1;
  --surface-raised: #FFFFFF;
  --surface-overlay: #FFFFFF;
  --surface-line: #E5E5E0;
  --surface-line-strong: #C9C9C2;

  --text-primary: #0A0E14;
  --text-muted: #5A6271;
  --text-faint: #9098A6;

  --accent-signal: #1F9D74;
  --accent-warn: #C77B14;
  --accent-alert: #C84545;
  --accent-cool: #3A6FD8;

  --shadow-card: none;
}

/* ---- Resets and base ---- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--surface-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { margin: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.022em;
  margin: 0;
  line-height: 1.05;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a { color: inherit; text-decoration: none; }

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection { background: var(--accent-signal); color: var(--surface-void); }

/* Utility classes used across both surfaces */
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1, "ss01" 1; }
.mono-xs { font-family: var(--font-mono); font-size: var(--text-mono-s); letter-spacing: 0.02em; }
.mono-s { font-family: var(--font-mono); font-size: var(--text-mono); letter-spacing: 0.01em; }
.smallcaps { font-family: var(--font-mono); font-size: var(--text-mono-s); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.hairline { border: 0; border-top: 1px solid var(--surface-line); margin: 0; }

/* Faint film-grain overlay — only on theatre/brand surfaces */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
