/* ============================================================
   Nervous System Mastery — Colors, Type, Tokens
   ============================================================
   The single source of truth for visual primitives.
   Variables are defined on :root; semantic classes are below.
   Drop-in: <link rel="stylesheet" href="../colors_and_type.css">
   ============================================================ */

/* ---------- FONTS ----------------------------------------------
   Primary:    GT Cinetype       (Grilli Type — bundled in fonts/)
   Editorial:  GT Alpina italic  (Grilli Type — bundled in fonts/)
   Mono:       GT Cinetype Mono  (Grilli Type — bundled in fonts/)

   The licensed files are bundled in /fonts. No external imports needed.
   --------------------------------------------------------------- */

/* GT Cinetype — primary sans (Light/Regular/Bold + italics + mono) */
@font-face { font-family: "GT Cinetype"; src: url("./fonts/GT-Cinetype-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "GT Cinetype"; src: url("./fonts/GT-Cinetype-Light-Italic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "GT Cinetype"; src: url("./fonts/GT-Cinetype-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "GT Cinetype"; src: url("./fonts/GT-Cinetype-Regular-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "GT Cinetype"; src: url("./fonts/GT-Cinetype-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "GT Cinetype"; src: url("./fonts/GT-Cinetype-Bold-Italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "GT Cinetype Mono"; src: url("./fonts/GT-Cinetype-Mono.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* GT Alpina — editorial italic (Thin/Light/Regular/Medium/Bold) */
@font-face { font-family: "GT Alpina"; src: url("./fonts/GT-Alpina-Thin-Italic.woff2") format("woff2"); font-weight: 200; font-style: italic; font-display: swap; }
@font-face { font-family: "GT Alpina"; src: url("./fonts/GT-Alpina-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "GT Alpina"; src: url("./fonts/GT-Alpina-Light-Italic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "GT Alpina"; src: url("./fonts/GT-Alpina-Regular-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "GT Alpina"; src: url("./fonts/GT-Alpina-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "GT Alpina"; src: url("./fonts/GT-Alpina-Medium-Italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "GT Alpina"; src: url("./fonts/GT-Alpina-Bold-Italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  /* ---------- COLOR (raw) ----------------------------------- */
  --ink:         #111111;   /* Ink Black */
  --cloud:       #F7F7F5;   /* Cloud White (warm off-white) */
  --mist:        #D9D9D6;   /* Mist Gray */
  --slate:       #8C8F94;   /* Slate Gray */
  --blue:        #2537DA;   /* Electric Blue — the only accent */

  /* Useful tonal extensions of the same palette */
  --ink-08:      rgba(17, 17, 17, 0.08);
  --ink-12:      rgba(17, 17, 17, 0.12);
  --ink-60:      rgba(17, 17, 17, 0.60);
  --blue-08:     rgba(37, 55, 218, 0.08);
  --blue-12:     rgba(37, 55, 218, 0.12);
  --blue-deep:   #1B2BB0;   /* hover/press for blue — darker than --blue */

  /* ---------- COLOR (semantic) ------------------------------ */
  --bg:          var(--cloud);
  --bg-alt:      #F1F1EE;       /* slightly deeper cloud, used for inset cards */
  --fg:          var(--ink);
  --fg-muted:    var(--slate);
  --fg-on-blue:  var(--cloud);
  --border:      var(--mist);
  --border-strong: var(--ink);
  --rule:        var(--mist);   /* alias used by preview cards */
  --accent:      var(--blue);
  --accent-deep: var(--blue-deep);
  --accent-soft: var(--blue-08);

  /* ---------- TYPE FAMILIES --------------------------------- */
  --font-sans: "GT Cinetype", "Space Grotesk", ui-sans-serif, system-ui,
               -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "GT Alpina", "Fraunces", "Times New Roman", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---------- TYPE SCALE ------------------------------------
     Generous, editorial — the brand wants air.
     Sizes target 1280–1920 viewports; mobile scales down at 0.78×.
     ----------------------------------------------------------- */
  --fs-display:  clamp(56px, 7.5vw, 128px);  /* hero ("Nervous System") */
  --fs-h1:       clamp(40px, 4.6vw, 72px);
  --fs-h2:       clamp(28px, 3.0vw, 48px);
  --fs-h3:       clamp(22px, 2.0vw, 32px);
  --fs-h4:       18px;
  --fs-body:     16px;
  --fs-body-lg:  18px;
  --fs-small:    14px;
  --fs-eyebrow:  12px;     /* uppercased + tracked */
  --fs-caption:  12px;

  --lh-tight:    1.02;
  --lh-snug:     1.15;
  --lh-normal:   1.4;
  --lh-relaxed:  1.55;

  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.04em;
  --tracking-eyebrow: 0.16em;   /* the brand's signature 16% tracked caps */

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-bold:     700;

  /* ---------- SPACING (8pt soft scale) ---------------------- */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   24px;
  --space-6:   32px;
  --space-7:   48px;
  --space-8:   64px;
  --space-9:   96px;
  --space-10:  128px;

  /* ---------- RADIUS ---------------------------------------- */
  --radius-xs:    4px;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --radius-xl:    28px;
  --radius-pill:  999px;

  /* ---------- BORDER ---------------------------------------- */
  --hairline: 1px solid var(--border);
  --hairline-dashed: 1px dashed var(--border);
  --rule-accent: 2px solid var(--accent);

  /* ---------- SHADOWS (sparingly) --------------------------- */
  --shadow-card:
      0 1px 2px rgba(17, 17, 17, 0.04),
      0 8px 32px rgba(17, 17, 17, 0.06);
  --shadow-pop:
      0 8px 24px rgba(17, 17, 17, 0.10),
      0 24px 80px rgba(17, 17, 17, 0.12);

  /* ---------- MOTION ---------------------------------------- */
  --ease-out:    cubic-bezier(.2, .7, .2, 1);
  --ease-in-out: cubic-bezier(.4, .0, .2, 1);
  --dur-fast:    160ms;
  --dur-base:    240ms;
  --dur-slow:    480ms;

  /* ---------- LAYOUT ---------------------------------------- */
  --page-max:     1280px;
  --gutter:       clamp(24px, 5vw, 96px);
}

/* =================================================================
   BASE — applied at the document level
   ================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--cloud); }

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* =================================================================
   SEMANTIC TYPE — utility classes
   Match the figma type ramp.
   ================================================================= */

.t-display {
  font-family: var(--font-sans);
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
.t-display em,
.t-display .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--fw-regular);
  letter-spacing: -0.01em;
}

.t-h1 {
  font-family: var(--font-sans);
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
}
.t-h1 em, .t-h1 .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--fw-regular);
}

.t-h2 {
  font-family: var(--font-sans);
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
}
.t-h2 em, .t-h2 .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--fw-regular);
}

.t-h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
}

.t-h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-h4);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
}

.t-body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  color: var(--fg);
}

.t-body-lg {
  font-family: var(--font-sans);
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
}

.t-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--fw-regular);
  font-size: clamp(22px, 2.4vw, 36px);
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.t-eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
}

.t-overline {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink);
}

.t-caption {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--fg-muted);
}

.t-stat {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--fw-regular);
  font-size: clamp(48px, 5vw, 80px);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.t-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* =================================================================
   UTILITY HELPERS — used across UI kits & slides
   ================================================================= */

.muted { color: var(--fg-muted); }
.accent { color: var(--accent); }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.sans { font-family: var(--font-sans); }

.rule-accent {
  display: block;
  width: 56px;
  height: 2px;
  background: var(--accent);
  border: 0;
}
.rule-hair {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--border);
  border: 0;
}

.eyebrow-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* The signature paper-texture surface */
.paper {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(17,17,17,0.018) 0 1px,
      transparent 1px 4px
    ),
    var(--bg);
}

/* Buttons & pills */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--cloud);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.btn:hover { background: #000; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--cloud);
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--cloud); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  background: var(--accent);
  color: var(--cloud);
  border: 1px solid var(--accent);
  transition: background var(--dur-fast) var(--ease-out);
}
.pill:hover { background: var(--accent-deep); }
.pill-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.pill-ghost:hover { background: var(--ink); color: var(--cloud); }

/* Eyebrow tag (used above sections) */
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--ink);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.4;
}
.tag-blue {
  border-color: var(--accent);
  color: var(--accent);
}
.tag-filled {
  background: var(--ink);
  color: var(--cloud);
  border-color: var(--ink);
}

/* Card */
.card {
  background: var(--bg);
  border: var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.card-elevated {
  box-shadow: var(--shadow-card);
  border-color: transparent;
}

/* Numbered step indicator (the "01 / LABEL" pattern) */
.step-num {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
}

/* Brand chrome — small starburst + divider + eyebrow */
.brand-chrome {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink);
}
.brand-chrome .divider {
  width: 1px;
  height: 32px;
  background: var(--ink);
  display: inline-block;
}

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