/* Octant design tokens.

   Two tiers, so the marketing page and the guide can share one system:

   1. Colour roles. The values copy packages/theme/src/tokens.ts in Ogard-Labs/octant.
      Change them there first, then here. Never invent a role value on this side.
   2. System tokens. Glass, type, space, shape, elevation, motion and layers. These belong
      to the public sites and are built on the roles above.

   Components take every colour from a token. A colour literal in a component means a
   token is missing. */

/* ---------------------------------------------------------------------------
   1. Colour roles (mirrored from the app), with the glass tiers of each theme
   --------------------------------------------------------------------------- */
:root,
[data-theme="dark"] {
  --app-background: #151515;
  --sidebar: #101010;
  --workspace: #1a1a1a;
  --floating: #232323;
  --control: #2b2b2b;
  --control-hover: #333333;
  --control-pressed: #3b3b3b;
  --selection: #2c2c2c;
  --border: #303030;
  --border-soft: #282828;
  --border-strong: #4d4d4d;
  --divider-strong: #808080;
  --text-primary: #f5f5f7;
  --text-secondary: #bcbcc2;
  --text-muted: #949494;
  --accent: #5b9cf5;
  --accent-foreground: #141414;
  --accent-text: #5b9cf5;
  --focus-edge: rgba(245, 245, 247, 0.62);
  --focus-edge-on-accent: rgba(20, 20, 20, 0.62);
  --success-surface: #16281f;
  --success-text: #6bb299;
  --warning-surface: #33270b;
  --warning-border: #c99a2e;
  --warning-text: #f2c75c;
  --danger-text: #e17d96;
  --palette-red: #d95778;
  --palette-orange: #e09b52;
  --palette-yellow: #d9a441;
  --palette-green: #93cb58;
  --palette-teal: #45c8bc;
  --palette-blue: #74b0f3;
  --palette-purple: #ab98f2;
  --palette-pink: #f4809a;
  --addition-text: #6bb299;
  --deletion-text: #e17d96;
  --glass: rgba(21, 21, 21, 0.56);
  --border-glass-subtle: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.10);
  --border-glass-strong: rgba(255, 255, 255, 0.16);
  --shadow-ring: 0 0 0 1px #303030;
  --shadow-md: 0 0 0 1px #303030, 0 4px 6px -4px rgba(0, 0, 0, 0.36), 0 10px 18px -8px rgba(0, 0, 0, 0.6);
  --shadow-overlay: 0 0 0 1px #303030, 0 18px 48px -16px rgba(0, 0, 0, 0.72);

  /* Site-only: how much of the ground a surface lets through, and how it catches light. */
  --glass-thin: rgba(40, 40, 42, 0.34);
  --glass-thick: rgba(21, 21, 21, 0.78);
  --edge-light: rgba(255, 255, 255, 0.08);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.24), 0 16px 40px -24px rgba(0, 0, 0, 0.7);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.3), 0 28px 64px -28px rgba(0, 0, 0, 0.85);
  --tint: 13%;
  color-scheme: dark;
}

[data-theme="light"] {
  --app-background: #fafaf9;
  --sidebar: #fafaf9;
  --workspace: #ffffff;
  --floating: #fdfdfc;
  --control: #f0f0ef;
  --control-hover: #e8e8e6;
  --control-pressed: #dfdfdd;
  --selection: #ebebea;
  --border: #e0e0de;
  --border-soft: #ececeb;
  --border-strong: #bdbdbb;
  --divider-strong: #6f6f6d;
  --text-primary: #141414;
  --text-secondary: #45454a;
  --text-muted: #666666;
  --accent: #1f5fc7;
  --accent-foreground: #ffffff;
  --accent-text: #1f5fc7;
  --focus-edge: rgba(20, 20, 20, 0.62);
  --focus-edge-on-accent: rgba(255, 255, 255, 0.72);
  --success-surface: #bfd8cc;
  --success-text: #0f6144;
  --warning-surface: #fbe9bd;
  --warning-border: #8a6218;
  --warning-text: #5c3d00;
  --danger-text: #a8102f;
  --palette-red: #a8102f;
  --palette-orange: #9d5a12;
  --palette-yellow: #8a6218;
  --palette-green: #41761c;
  --palette-teal: #0f6f68;
  --palette-blue: #1e5fae;
  --palette-purple: #5b4bb0;
  --palette-pink: #b3356e;
  --addition-text: #0f6144;
  --deletion-text: #a8102f;
  --glass: rgba(250, 250, 249, 0.62);
  --border-glass-subtle: rgba(20, 20, 20, 0.06);
  --border-glass: rgba(20, 20, 20, 0.10);
  --border-glass-strong: rgba(20, 20, 20, 0.16);
  --shadow-ring: 0 0 0 1px #e0e0de;
  --shadow-md: 0 0 0 1px rgba(16, 24, 40, 0.08), 0 4px 6px -4px rgba(16, 24, 40, 0.1), 0 10px 15px -3px rgba(16, 24, 40, 0.1);
  --shadow-overlay: 0 0 0 1px #e0e0de, 0 20px 50px -14px rgba(16, 24, 40, 0.2);

  --glass-thin: rgba(255, 255, 255, 0.46);
  --glass-thick: rgba(255, 255, 255, 0.82);
  --edge-light: rgba(255, 255, 255, 0.9);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -24px rgba(16, 24, 40, 0.22);
  --shadow-lift: 0 2px 4px rgba(16, 24, 40, 0.06), 0 28px 64px -28px rgba(16, 24, 40, 0.3);
  --tint: 9%;
  color-scheme: light;
}

/* ---------------------------------------------------------------------------
   2. System tokens
   --------------------------------------------------------------------------- */

/* Built from the roles, so they follow whichever theme the element is in. */
:root,
[data-theme] {
  /* One blur recipe for every translucent surface. */
  --glass-filter: blur(22px) saturate(165%);
  /* The one gradient: accent into palette-purple, the pair the dither field prints. */
  --gradient-accent: linear-gradient(96deg, var(--accent-text) 8%, var(--palette-purple) 92%);
  --glow-accent: 0 24px 80px -32px color-mix(in oklab, var(--accent) 55%, transparent);
}

:root {
  /* Type families */
  --font-sans: Geist, "Geist Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "Geist Mono Variable", "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Type scale. Display and heading steps are fluid; reading steps are fixed. */
  --text-display-xl: clamp(44px, 5.4vw, 80px);
  --text-display-l: clamp(38px, 5.2vw, 64px);
  --text-heading: clamp(30px, 3.7vw, 46px);
  --text-title-l: 24px;
  --text-title: 20px;
  --text-subtitle: 17px;
  --text-lead: clamp(17px, 1.45vw, 20px);
  --text-body: 15px;
  --text-label: 14px;
  --text-meta: 13px;
  --text-code: 14px;
  --text-eyebrow: 12px;

  --leading-display: 0.98;
  --leading-heading: 1.08;
  --leading-title: 1.3;
  --leading-body: 1.55;

  --tracking-display: -0.04em;
  --tracking-heading: -0.028em;
  --tracking-title: -0.012em;
  --tracking-mono: 0.06em;

  /* Space: a 4px ladder */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --section-y: clamp(72px, 9vw, 128px);
  --container: 1200px;
  --measure: 60ch;
  --control-h: 44px;
  --control-h-sm: 34px;

  /* Shape */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 150ms;
  --dur-base: 240ms;
  --dur-slow: 480ms;

  /* Layers */
  --z-ground: -1;
  --z-nav: 5;
  --z-skip: 10;
}

/* ---------------------------------------------------------------------------
   3. Type utilities: the scale as classes, for prose and one-off pages
   --------------------------------------------------------------------------- */
.display-xl { font-family: var(--font-sans); font-size: var(--text-display-xl); line-height: var(--leading-display); font-weight: 500; letter-spacing: var(--tracking-display); }
.display-l { font-family: var(--font-sans); font-size: var(--text-display-l); line-height: 1.02; font-weight: 500; letter-spacing: var(--tracking-display); }
.heading { font-family: var(--font-sans); font-size: var(--text-heading); line-height: var(--leading-heading); font-weight: 500; letter-spacing: var(--tracking-heading); }
.title { font-family: var(--font-sans); font-size: var(--text-title); line-height: var(--leading-title); font-weight: 600; letter-spacing: var(--tracking-title); }
.lead { font-family: var(--font-sans); font-size: var(--text-lead); line-height: 1.5; font-weight: 400; }
.body { font-family: var(--font-sans); font-size: var(--text-body); line-height: var(--leading-body); font-weight: 400; }
.label { font-family: var(--font-sans); font-size: var(--text-label); line-height: 1.35; font-weight: 500; }
.meta { font-family: var(--font-sans); font-size: var(--text-meta); line-height: 1.45; font-weight: 400; }
.stat { font-family: var(--font-sans); font-size: var(--text-title); line-height: 1; font-weight: 600; letter-spacing: var(--tracking-heading); }
.code { font-family: var(--font-mono); font-size: var(--text-code); line-height: 1.7; font-weight: 400; }
.eyebrow { font-family: var(--font-mono); font-size: var(--text-eyebrow); line-height: 1.4; font-weight: 400; letter-spacing: var(--tracking-mono); }

/* ---------------------------------------------------------------------------
   4. Faces
   --------------------------------------------------------------------------- */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
