/* Here's Everything: design tokens (Warm Ledger & Deep Slate)
   Marketing site only (hereseverything.com). Installed in Etch Studio as the global "Tokens" stylesheet.

   Colour tokens are aliases onto the Automatic.css palette. acss-import.json builds the palette from the
   brand hex values, so every --color-* below resolves to the exact brand colour. The three text-safe
   shades are literal hex, because they are deliberately darker than the matching ACSS shades. */

:root {
  /* Colour */
  --color-primary: var(--primary);               /* #1E3A3A Deep Slate */
  --color-secondary: var(--secondary);           /* #C86D51 Terracotta (fills, rules, large display text) */
  --color-secondary-text: #88412b;               /* Terracotta for text under 24px on Alabaster or Linen */
  --color-accent: var(--accent);                 /* #5C7C70 Sage */
  --color-accent-text: #3b594e;                  /* Sage for small text */
  --color-base: var(--base);                     /* #FAF8F5 Alabaster */
  --color-surface: #f0ece4;                      /* Linen Sand. ACSS --base-light is a different, darker shade, so this is pinned. */
  --color-surface-elevated: #ffffff;
  --color-primary-deep: #112222;                 /* footer and pressed states */
  --color-primary-tint: #eef6f6;                 /* AI Guide bar, soft panels */
  --color-secondary-soft: #edcec5;               /* terracotta tint on dark backgrounds */
  --color-on-dark-muted: #cfd3d0;                /* secondary text on Deep Slate */
  --color-ink: var(--text-dark);                 /* #1C1F21 Charcoal Ink */
  --color-ink-muted: #52585d;
  --color-info: var(--info);                     /* #355C7D */
  --color-success: var(--success);               /* #2E6F40 */
  --color-alert: var(--danger);                  /* #A63A3A */

  --border-subtle: 1px solid rgb(30 58 58 / 0.12);
  --border-strong: 1px solid rgb(30 58 58 / 0.22);

  /* Type families. Fraunces display, Plus Jakarta Sans UI and body, JetBrains Mono for keys and labels. */
  --font-display: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Fluid type. Desktop headings follow Paper's editorial scale: H1 34px to 60px, H2 26px to 44px, body 16px to 17px.
     ACSS carries the same min and max (h1 34/60, h2 26/44, text 16/17), and --h1, --h2 and --text-m are pinned
     to these exact clamps below so the whole site reads from one formula. */
  --h1-size: clamp(2.125rem, 4vw + 1rem, 3.75rem);
  --h2-size: clamp(1.625rem, 2.5vw + 1rem, 2.75rem);
  --body-size: clamp(1rem, 0.25vw + 0.95rem, 1.0625rem);
  --fs-h1: var(--h1-size);
  --fs-h2: var(--h2-size);
  --fs-body: var(--body-size);
  --h1: var(--h1-size);
  --h2: var(--h2-size);
  --text-m: var(--body-size);

  /* Layout */
  --container-max: 1280px;
  --gutter-desktop: 48px;
  --gutter-mobile: 20px;
  --he-gutter: var(--gutter-mobile);

  /* Radii */
  --radius-card: 16px;
  --radius-input: 10px;
  --radius-pill: 9999px;

  /* Shell */
  --header-height: 80px;
  --header-height-mobile: 64px;
  --tap-target: 44px;

  /* Brief aliases kept for pages built against the Paper tokens */
  --dark: var(--color-ink);
  --secondary-text: var(--color-secondary-text);
  --accent-text: var(--color-accent-text);

  /* Pin the ACSS shade ladder to the Paper shades, so ACSS utilities (bg--light, bg--ultra-dark, text-light-muted)
     match the designs. ACSS 4 derives these from fixed lightness steps and has no per-shade settings. */
  --base-light: var(--color-surface);
  --primary-ultra-dark: var(--color-primary-deep);
  --primary-ultra-light: var(--color-primary-tint);
  --secondary-light: var(--color-secondary-soft);
  --text-light-muted: var(--color-on-dark-muted);
  --accent-light: #d3dfda;
  --success-light: #c9e8d2;
  --danger-light: #ebc6c6;
  --info-light: #cadae8;
}

@media (min-width: 48.0625rem) {
  :root {
    --he-gutter: var(--gutter-desktop);
  }
}

/* Base typography. ACSS owns heading sizes, weights and tracking; these set the families. */
:where(body) {
  font-family: var(--font-sans);
  color: var(--color-ink);
  background-color: var(--color-base);
}

:where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: 'SOFT' 50;
}

:where(code, kbd, samp, pre),
.data-text {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: 'zero' 1;
  letter-spacing: 0.02em;
}

/* Anchor jumps clear the sticky header. */
:where(html) {
  scroll-padding-block-start: calc(var(--header-height) + 1rem);
}

/* Never let a drawer leave the page scrollable behind it. */
html:has(dialog[open]) {
  overflow: hidden;
}

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