/* Design tokens. Obsidian is the default appearance; Soft White follows the device setting or the switch.
   Layout: a quiet observatory. Wide dark space, one luminous object, text in narrow precise columns, mono labels as coordinates. */

:root {
  /* brand palette (fixed in both appearances) */
  --obsidian: #090B10;
  --graphite: #171C26;
  --pearl: #DCE3EC;
  --soft-white: #F6F7FB;
  --icy: #9CCBFF;
  --violet: #B8A7F8;
  --nacre: #E8D5E3;
  --ink: #1E2230;

  /* semantic colours: obsidian appearance */
  --bg: var(--obsidian);
  --bg-raised: #0E1118;
  --surface: var(--graphite);
  --surface-2: #1F2533;
  --text: var(--soft-white);
  --text-2: #C9D0DB;
  --muted: #949BAE;
  --line: rgba(220, 227, 236, 0.12);
  --line-strong: rgba(220, 227, 236, 0.28);
  --accent: var(--icy);
  --accent-2: var(--violet);
  --btn-bg: var(--pearl);
  --btn-text: var(--obsidian);
  --btn-hover: var(--soft-white);
  --nav-bg: rgba(9, 11, 16, 0.78);
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
  /* code, in the spirit of Xcode's dark theme, tuned to the palette */
  --code-bg: #0C0F15;
  --code-bar: #141822;
  --code-line: #4E566A;
  --syn-text: #DCE3EC;
  --syn-kw: #F2A7D3;
  --syn-type: #9CCBFF;
  --syn-fn: #B8A7F8;
  --syn-str: #F5B7A0;
  --syn-num: #E5D18A;
  --syn-com: #7D869E;
  --syn-attr: #D9A6F2;
  --syn-mem: #A5D8CF;
  color-scheme: dark;

  /* type */
  --f-wordmark: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-body: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-display: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --fs-label: 12px;
  --fs-small: 14px;
  --fs-body: 17px;
  --fs-lead: clamp(18px, 1.6vw, 20px);
  --fs-h3: clamp(24px, 2.4vw, 30px);
  --fs-h2: clamp(36px, 5vw, 60px);
  --fs-hero: clamp(72px, 13vw, 176px);

  /* space and shape */
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --section: clamp(72px, 10vw, 140px);
  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 220ms;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: var(--soft-white);
    --bg-raised: #EEF0F6;
    --surface: #FFFFFF;
    --surface-2: #E8EBF2;
    --text: var(--ink);
    --text-2: #384054;
    --muted: #5B6683;
    --line: rgba(30, 34, 48, 0.12);
    --line-strong: rgba(30, 34, 48, 0.3);
    --accent: #3F69A3;
    --accent-2: #6553C2;
    --btn-bg: var(--ink);
    --btn-text: var(--soft-white);
    --btn-hover: #2E3446;
    --nav-bg: rgba(246, 247, 251, 0.8);
    --shadow: 0 24px 60px -34px rgba(30, 34, 48, 0.45);
    --code-bg: #FFFFFF;
    --code-bar: #EEF0F6;
    --code-line: #A3AABB;
    --syn-text: #1E2230;
    --syn-kw: #A3317E;
    --syn-type: #2B5E9C;
    --syn-fn: #5B47B8;
    --syn-str: #B4462E;
    --syn-num: #7A5C00;
    --syn-com: #6B7489;
    --syn-attr: #8A3FAE;
    --syn-mem: #2F6F66;
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: var(--soft-white);
  --bg-raised: #EEF0F6;
  --surface: #FFFFFF;
  --surface-2: #E8EBF2;
  --text: var(--ink);
  --text-2: #384054;
  --muted: #5B6683;
  --line: rgba(30, 34, 48, 0.12);
  --line-strong: rgba(30, 34, 48, 0.3);
  --accent: #3F69A3;
  --accent-2: #6553C2;
  --btn-bg: var(--ink);
  --btn-text: var(--soft-white);
  --btn-hover: #2E3446;
  --nav-bg: rgba(246, 247, 251, 0.8);
  --shadow: 0 24px 60px -34px rgba(30, 34, 48, 0.45);
  --code-bg: #FFFFFF;
  --code-bar: #EEF0F6;
  --code-line: #A3AABB;
  --syn-text: #1E2230;
  --syn-kw: #A3317E;
  --syn-type: #2B5E9C;
  --syn-fn: #5B47B8;
  --syn-str: #B4462E;
  --syn-num: #7A5C00;
  --syn-com: #6B7489;
  --syn-attr: #8A3FAE;
  --syn-mem: #2F6F66;
  color-scheme: light;
}
