:root {
  /* =========================================================
     ESCOLA DE HISTÓRIAS — MASTER DESIGN TOKENS · v1.2
     Cobalto orienta. Papel acolhe. Petróleo estrutura.
     Magenta assina. Lima marca progresso.
     ========================================================= */

  /* Core · colors extracted from the official logo */
  --eh-cobalt-950: #17164d;
  --eh-cobalt-900: #211f78;
  --eh-cobalt-800: #2e2baf;
  --eh-cobalt-700: #3a39dd;
  --eh-cobalt-600: #5554e8;
  --eh-cobalt-300: #a9a8f4;
  --eh-cobalt-100: #e8e8fe;
  --eh-magenta-900: #62045e;
  --eh-magenta-700: #91088b;
  --eh-magenta-500: #c128b5;
  --eh-magenta-300: #e385d9;
  --eh-magenta-100: #f6ddf2;

  /* Continuity colors inherited from the workshop */
  --eh-petrol-1000: #001820;
  --eh-petrol-950: #021f29;
  --eh-petrol-900: #032f3d;
  --eh-petrol-800: #064b5f;
  --eh-petrol-100: #dbe8ea;
  --eh-lime-500: #d9f65b;
  --eh-lime-200: #effbbd;

  /* Analog neutrals and material surfaces */
  --eh-paper: #fffdf8;
  --eh-paper-warm: #f7f1e6;
  --eh-paper-note: #fff6c7;
  --eh-paper-deep: #e9e0d3;
  --eh-white: #ffffff;
  --eh-ink: #163740;
  --eh-graphite: #41616a;
  --eh-pencil: #5e747a;
  --eh-rule: #d9d0c2;
  --eh-rule-cool: #cfd7da;
  --eh-blueprint-paper: #f1f2ff;
  --eh-blueprint-line: #c8c9fb;
  --eh-blueprint-ink: #2725a0;
  --eh-kraft: #d9bd91;
  --eh-tape: rgba(242, 226, 190, .72);
  --eh-photocopy: #25393f;
  --eh-matrix-paper: #f2eedf;
  --eh-matrix-rule: #c9c1aa;
  --eh-sticker-paper: #fffefa;
  --eh-acetate-surface: rgba(232, 232, 254, .68);
  --eh-acetate-edge: rgba(58, 57, 221, .38);
  --eh-scanline: rgba(2, 31, 41, .13);

  /* Semantic colors */
  --eh-bg-page: var(--eh-paper);
  --eh-bg-section: var(--eh-paper-warm);
  --eh-bg-card: var(--eh-white);
  --eh-bg-inverse: var(--eh-petrol-950);
  --eh-text-primary: var(--eh-petrol-900);
  --eh-text-secondary: var(--eh-graphite);
  --eh-text-tertiary: var(--eh-pencil);
  --eh-text-inverse: var(--eh-white);
  --eh-text-inverse-muted: #bad0d4;
  --eh-action-primary: var(--eh-cobalt-700);
  --eh-action-primary-hover: var(--eh-cobalt-800);
  --eh-accent-origin: var(--eh-magenta-700);
  --eh-accent-origin-bright: var(--eh-magenta-300);
  --eh-accent-progress: var(--eh-lime-500);
  --eh-border: var(--eh-rule);
  --eh-border-inverse: rgba(255, 255, 255, .18);
  --eh-focus: var(--eh-lime-500);
  --eh-success: #17694e;
  --eh-warning: #93520c;
  --eh-danger: #9b2940;
  --eh-info: var(--eh-cobalt-700);

  /* Typography — the logo lettering remains exclusive; hand is annotation only */
  --eh-font-display: "Fraunces", Georgia, serif;
  --eh-font-body: "Manrope", "Helvetica Neue", sans-serif;
  --eh-font-meta: "IBM Plex Mono", "Courier New", monospace;
  --eh-font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --eh-type-display-xl: clamp(3.1rem, 7vw, 6.7rem);
  --eh-type-display-lg: clamp(2.65rem, 5.8vw, 5rem);
  --eh-type-h1: clamp(2.35rem, 4.9vw, 4.5rem);
  --eh-type-h2: clamp(1.95rem, 3.7vw, 3.35rem);
  --eh-type-h3: clamp(1.35rem, 2.1vw, 1.9rem);
  --eh-type-lead: clamp(1.08rem, 1.45vw, 1.27rem);
  --eh-type-body-lg: 1.125rem;
  --eh-type-body: 1rem;
  --eh-type-small: .875rem;
  --eh-type-micro: .75rem;
  --eh-leading-display: .98;
  --eh-leading-heading: 1.08;
  --eh-leading-body: 1.68;
  --eh-tracking-display: -.035em;
  --eh-tracking-meta: .12em;

  /* Analog language */
  --eh-texture-opacity: .055;
  --eh-texture-opacity-strong: .09;
  --eh-collage-overlap: clamp(12px, 2vw, 28px);
  --eh-collage-rotation-a: -1.8deg;
  --eh-collage-rotation-b: 1.25deg;
  --eh-handnote-size: clamp(1.45rem, 2.6vw, 2.2rem);
  --eh-paper-edge: 1px solid rgba(3, 47, 61, .14);

  /* Eighties memory — a signal layer, never the whole composition */
  --eh-eighties-max-presence: .1;
  --eh-sticker-border: 4px solid var(--eh-sticker-paper);
  --eh-sticker-shadow: 5px 6px 0 rgba(3, 47, 61, .18);
  --eh-sticker-rotation-a: -3deg;
  --eh-sticker-rotation-b: 2deg;
  --eh-dymo-height: 30px;
  --eh-halftone-size: 7px;
  --eh-scanline-size: 4px;
  --eh-acetate-rotation: -1.25deg;

  /* Spacing — base 4, rhythm 8 */
  --eh-space-0: 0;
  --eh-space-1: 4px;
  --eh-space-2: 8px;
  --eh-space-3: 12px;
  --eh-space-4: 16px;
  --eh-space-5: 24px;
  --eh-space-6: 32px;
  --eh-space-7: 48px;
  --eh-space-8: 64px;
  --eh-space-9: 80px;
  --eh-space-10: 104px;
  --eh-space-11: 144px;
  --eh-space-section: clamp(72px, 9vw, 128px);

  /* Layout */
  --eh-container-wide: 1200px;
  --eh-container-reading: 760px;
  --eh-container-narrow: 620px;
  --eh-gutter: clamp(20px, 4vw, 52px);
  --eh-grid-gap: clamp(20px, 3vw, 40px);

  /* Shape — squarer than the workshop to feel editorial */
  --eh-radius-xs: 2px;
  --eh-radius-sm: 6px;
  --eh-radius-md: 10px;
  --eh-radius-lg: 16px;
  --eh-radius-pill: 999px;

  /* Depth — paper, not soft UI */
  --eh-shadow-paper: 7px 8px 0 rgba(3, 47, 61, .12);
  --eh-shadow-cobalt: 7px 8px 0 var(--eh-cobalt-100);
  --eh-shadow-magenta: 7px 8px 0 var(--eh-magenta-100);
  --eh-shadow-float: 0 20px 58px rgba(3, 47, 61, .11);

  /* Motion — calm, sequential, educational */
  --eh-duration-fast: 160ms;
  --eh-duration-medium: 280ms;
  --eh-duration-slow: 520ms;
  --eh-ease-standard: cubic-bezier(.22, .61, .36, 1);
  --eh-ease-emphasis: cubic-bezier(.16, 1, .3, 1);

  /* Layers */
  --eh-z-base: 0;
  --eh-z-content: 10;
  --eh-z-floating: 30;
  --eh-z-nav: 60;
  --eh-z-modal: 100;
}

.eh-theme-light {
  --eh-surface: var(--eh-paper);
  --eh-surface-raised: var(--eh-white);
  --eh-copy: var(--eh-text-primary);
  --eh-copy-muted: var(--eh-text-secondary);
  --eh-highlight: var(--eh-cobalt-700);
  --eh-signature: var(--eh-magenta-700);
  --eh-local-rule: var(--eh-border);
}

.eh-theme-warm {
  --eh-surface: var(--eh-paper-warm);
  --eh-surface-raised: var(--eh-paper);
  --eh-copy: var(--eh-text-primary);
  --eh-copy-muted: var(--eh-text-secondary);
  --eh-highlight: var(--eh-cobalt-700);
  --eh-signature: var(--eh-magenta-700);
  --eh-local-rule: var(--eh-border);
}

.eh-theme-dark {
  --eh-surface: var(--eh-petrol-950);
  --eh-surface-raised: var(--eh-petrol-900);
  --eh-copy: var(--eh-white);
  --eh-copy-muted: var(--eh-text-inverse-muted);
  --eh-highlight: var(--eh-cobalt-300);
  --eh-signature: var(--eh-magenta-300);
  --eh-local-rule: var(--eh-border-inverse);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --eh-duration-fast: 1ms;
    --eh-duration-medium: 1ms;
    --eh-duration-slow: 1ms;
  }
}
