/* Workbench website, always in Workbench's Northern Lights theme.
   The colors are its background, foreground, cursor, selection, and
   bright ANSI colors from BuiltInThemes.swift. */

:root {
  --bg: #111522;
  --fg: #D8E0F0;
  --accent: #7CF0C0;
  --sel: #283050;
  --muted: #5D6783;
  --red: #FF90A6;
  --green: #98F0BE;
  --yellow: #F4E098;
  --blue: #98BAFF;
  --magenta: #C8A6FF;
  --cyan: #8CE4F4;
  --on-accent: #08090c;

  --surface: color-mix(in oklab, var(--fg) 4%, var(--bg));
  --surface-2: color-mix(in oklab, var(--fg) 8%, var(--bg));
  --line: color-mix(in oklab, var(--fg) 13%, var(--bg));
  --line-strong: color-mix(in oklab, var(--fg) 22%, var(--bg));
  --text-2: color-mix(in oklab, var(--fg) 72%, var(--bg));
  --text-3: color-mix(in oklab, var(--fg) 52%, var(--bg));
  --glow: color-mix(in oklab, var(--accent) 22%, transparent);

  --font-display: "Martian Mono", ui-monospace, monospace;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-code: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --page: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --theme-ease: 420ms cubic-bezier(.2, .7, .2, 1);

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--theme-ease), color var(--theme-ease);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--sel); color: var(--fg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--page) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: 8px; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Mark ---------- */

.mark { display: inline-block; width: 1em; height: 1em; vertical-align: -0.12em; }
.mark .chev { stroke: var(--fg); }
.mark .star { fill: var(--accent); }

.spark { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; fill: var(--accent); flex: none; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms, background-color var(--theme-ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }

.site-header .wrap {
  display: flex; align-items: center; gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  font: 600 15px/1 var(--font-display);
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.01em;
}
.brand img { width: 30px; height: 30px; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--text-2);
  font-size: 15px; padding: 8px 12px; border-radius: 8px;
  transition: color 150ms, background-color 150ms;
}
.nav a:hover { color: var(--fg); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--fg); }
.nav a.btn-primary, .nav a.btn-primary:hover { color: var(--on-accent); background: var(--accent); margin-left: 6px; }

@media (max-width: 640px) {
  .nav .nav-hide { display: none; }
  .site-header .wrap { gap: 12px; }
  .brand span { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 16px/1 var(--font-body);
  text-decoration: none;
  padding: 15px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms, box-shadow 200ms, background-color var(--theme-ease), color var(--theme-ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 0 var(--glow), 0 10px 30px -10px var(--glow);
}
.btn-primary:hover { box-shadow: 0 0 0 6px var(--glow), 0 14px 40px -10px var(--glow); }

.btn-small { padding: 9px 14px; font-size: 14px; border-radius: 9px; }

.btn-ghost {
  background: transparent; color: var(--fg);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface-2); }

/* ---------- Type ---------- */

h1, h2, h3 { margin: 0; font-weight: 500; }

.display {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 112.5;
  letter-spacing: -0.045em;
  line-height: 1.02;
  font-weight: 500;
}

h2.display {
  font-size: clamp(28px, 3.6vw, 44px);
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.035em;
  line-height: 1.12;
}
h3 { font: 600 19px/1.35 var(--font-body); letter-spacing: -0.01em; }

p { margin: 0 0 1em; }
.lede { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--text-2); max-width: 36em; }

code, kbd, pre { font-family: var(--font-code); }
code { font-size: 0.9em; }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.9em; padding: 0.15em 0.5em;
  font-size: 0.82em; font-weight: 500; line-height: 1.4;
  color: var(--fg);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 120px;
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  color: var(--text-3);
  font-size: 14px;
}
.site-footer .wrap { display: grid; gap: 24px; grid-template-columns: 1fr auto; align-items: start; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--fg); }
.site-footer .legal { grid-column: 1 / -1; max-width: 64em; line-height: 1.55; }
.site-footer .brand { color: var(--fg); }
@media (max-width: 640px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ---------- Prose pages (privacy, support) ---------- */

.page-head { padding-top: 72px; padding-bottom: 40px; }
.page-head h1 { font-size: clamp(34px, 5vw, 58px); }
.page-head p { margin-top: 18px; color: var(--text-3); }

.prose { max-width: 42em; font-size: 17px; }
.prose h2 {
  font: 600 22px/1.3 var(--font-body);
  letter-spacing: -0.015em;
  margin: 2.2em 0 0.6em;
}
.prose h3 { margin: 1.6em 0 0.4em; font-size: 18px; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--text-3); }
.prose code {
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 0.08em 0.38em; border-radius: 5px; color: var(--fg);
}
.prose .short {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 0 0 1em;
}
.prose .short p:last-child { margin: 0; }

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