/* Site-wide design system (2026-11 redesign): fonts, colour tokens, type, buttons,
   header, footer and the theme switch. Every redesigned page loads this file; page
   files (home.css and later ones) add only their own layouts.

   Colours: cobalt on white. --accent is the brand cobalt; --btn is a brighter blue kept
   for buttons only, so actions stand apart from the rest of the accent. Every text pair
   below was checked for WCAG AA in both themes.

   Theme: follows the visitor's OS; when the OS states no preference, the site is dark
   (owner, 2026-11-27). So the dark tokens are the default here and light applies only
   when the OS asks for light. js/theme.js sets data-theme on <html> only when the
   visitor picks the other theme with the header switch. */

/* Fonts: Latin subsets from Google Fonts, all SIL OFL 1.1 (see fonts/README.md). */
@font-face {
  font-family: "Gloock";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/gloock-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/geist-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/geist-mono-latin.woff2") format("woff2");
}

:root {
  --bg: #0B111A; --surface: #121A26; --surface-2: #1A2433;
  --fg: #E8EDF4; --fg-soft: #A3AFC0;
  --accent: #2F4BE8; --on-accent: #FFFFFF; --accent-text: #8FA3FF; --accent-soft: #1D2850;
  --btn: #8FB4FF; --on-btn: #0B111A; --error: #FF8A80;
  --rule: #233041; --line-strong: #5B6B82; --focus: #9DBBFF;
  --grid: rgba(143, 163, 255, .06); --glow: rgba(47, 91, 255, .22);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 30px 70px -30px rgba(0, 0, 0, .8);
  --font-display: "Gloock", Georgia, "Times New Roman", serif;
  --font-body: "Geist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", Consolas, ui-monospace, monospace;
  --radius: 6px; --radius-lg: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
/* The light tokens appear twice: once for the OS preference (unless the visitor chose
   dark) and once for an explicit light choice. Keep the two blocks identical. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #FFFFFF; --surface: #F4F6FA; --surface-2: #E8EDF4;
    --fg: #0E1726; --fg-soft: #4A5568;
    --accent: #2340E0; --on-accent: #FFFFFF; --accent-text: #2340E0; --accent-soft: #DCE3FF;
    --btn: #2F5BFF; --on-btn: #FFFFFF; --error: #B42318;
    --rule: #DFE4EB; --line-strong: #7A889B; --focus: #2340E0;
    --grid: rgba(35, 64, 224, .06); --glow: rgba(47, 91, 255, .18);
    --shadow: 0 1px 2px rgba(14, 23, 38, .06), 0 24px 60px -24px rgba(20, 40, 120, .28);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #FFFFFF; --surface: #F4F6FA; --surface-2: #E8EDF4;
  --fg: #0E1726; --fg-soft: #4A5568;
  --accent: #2340E0; --on-accent: #FFFFFF; --accent-text: #2340E0; --accent-soft: #DCE3FF;
  --btn: #2F5BFF; --on-btn: #FFFFFF; --error: #B42318;
  --rule: #DFE4EB; --line-strong: #7A889B; --focus: #2340E0;
  --grid: rgba(35, 64, 224, .06); --glow: rgba(47, 91, 255, .18);
  --shadow: 0 1px 2px rgba(14, 23, 38, .06), 0 24px 60px -24px rgba(20, 40, 120, .28);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 1.0625rem/1.6 var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, p, ol, ul, figure, blockquote { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; }
::selection { background: var(--accent-soft); color: var(--fg); }
/* Visible focus on everything (WCAG 2.4.7). */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
/* `hidden` must win over display rules such as .btn's inline-flex (scripts reveal
   progressive-enhancement controls by clearing it). */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: var(--radius); z-index: 50; font-weight: 500; }
.skip:focus { top: 12px; }

/* ---------- Type ---------- */
.label { font: 500 .75rem/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-soft); margin-bottom: 18px; }
h1, h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.015em; line-height: 1.02; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 1.4rem + 4.6vw, 5.25rem); }
h1 em { font-style: normal; color: var(--accent-text); text-decoration: underline; text-decoration-color: var(--btn); text-decoration-thickness: .06em; text-underline-offset: .1em; }
h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); max-width: 18ch; }
h3 { font: 600 1.1875rem/1.3 var(--font-body); letter-spacing: -0.01em; }
.lede { font-size: clamp(1.125rem, 1rem + .4vw, 1.3125rem); color: var(--fg-soft); max-width: 46ch; margin-top: 24px; }
.section-lede { color: var(--fg-soft); margin-top: 14px; max-width: 60ch; }
.fine { font-size: .875rem; color: var(--fg-soft); }
code { font: 500 .875em var(--font-mono); color: var(--accent-text); }

/* ---------- Buttons and links ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 500 1rem var(--font-body); text-decoration: none; background: var(--btn); color: var(--on-btn); padding: 13px 22px; border-radius: var(--radius); border: 1px solid var(--btn); cursor: pointer; white-space: nowrap; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
/* Hover lifts the button with a neutral shadow; a blue glow read as a stock effect. */
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -12px rgba(5, 10, 25, .45); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .7; cursor: default; transform: none; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--fg); box-shadow: none; }
.btn-small { padding: 8px 14px; font-size: .9375rem; }
.arr { display: inline-block; transition: transform .2s var(--ease); }
.btn:hover .arr, .btn:focus-visible .arr, .text-link:hover .arr { transform: translateX(3px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
/* Underline that un-draws on hover: still underlined at rest, so links don't rely on colour. */
.text-link { font-weight: 500; text-decoration: none; background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 100% 1px; padding-bottom: 2px; transition: background-size .25s var(--ease); }
.text-link:hover { background-size: 0 1px; background-position: 100% 100%; }

/* ---------- Header ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.nav-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.nav-links { display: flex; gap: 24px; list-style: none; padding: 0; margin: 0; }
.nav-links a { position: relative; color: var(--fg-soft); text-decoration: none; font-size: .9375rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }

/* Wordmark: the J monogram (a J whose hook ends in a plug) beside the name in Gloock. */
.wordmark { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; font: 400 1.375rem var(--font-display); letter-spacing: -0.02em; color: var(--fg); text-decoration: none; white-space: nowrap; }
.wm-mark { width: 26px; height: 26px; flex: none; color: var(--accent-text); }
.wm-mark path { fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; }
.wm-mark circle { fill: currentColor; }

/* Theme switch: icon only, 40px target. Its name is .sr-only text and .tip shows the
   same words on hover and keyboard focus. Hidden until theme.js runs, since it does
   nothing without script. */
.theme-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; color: var(--fg-soft); background: transparent; border: 1px solid var(--line-strong); border-radius: 50%; cursor: pointer; }
.theme-btn[hidden] { display: none; }
.theme-btn:hover { color: var(--fg); border-color: var(--fg); }
.tip { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; font: 500 .8125rem var(--font-body); color: var(--bg); background: var(--fg); padding: 5px 9px; border-radius: var(--radius); opacity: 0; pointer-events: none; transition: opacity .15s; }
.theme-btn:hover .tip, .theme-btn:focus-visible .tip { opacity: 1; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Sun in dark mode (switch to light), moon in light mode (switch to dark). Dark is the
   default, matching the tokens above. */
.ico-moon { display: none; }
:root[data-theme="light"] .ico-moon { display: block; }
:root[data-theme="light"] .ico-sun { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .ico-moon { display: block; }
  :root:not([data-theme="dark"]) .ico-sun { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 136px) 0; border-top: 1px solid var(--rule); }
.section-alt { background: var(--surface); }

/* Scroll arrivals: js/arrive.js adds .js-arrive only when motion is allowed, so content
   is never hidden without script. Each block rises once and stays. */
.js-arrive [data-arrive] { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js-arrive [data-arrive].is-in { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--rule); padding: 48px 0 32px; font-size: .9375rem; color: var(--fg-soft); }
.foot-inner { display: grid; gap: 28px; }
@media (min-width: 860px) { .foot-inner { grid-template-columns: 1.4fr 1fr; } .foot-legal { grid-column: 1 / -1; } }
.foot-brand p { margin-top: 10px; max-width: 40ch; }
.foot-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.foot-links a { color: var(--fg); }
.foot-legal { border-top: 1px solid var(--rule); padding-top: 20px; font-size: .875rem; }
/* A footer with only the copyright line already has the footer's own top rule. */
.foot-legal:only-child { border-top: 0; padding-top: 0; }

/* ---------- Narrow screens ---------- */
/* Phones: the links drop to a second row under the name instead of disappearing, so
   Pricing and About stay one tap away. */
@media (max-width: 720px) {
  .nav-inner { flex-wrap: wrap; gap: 10px; padding-top: 10px; }
  .nav-inner > nav { order: 5; flex-basis: 100%; }
  .nav-links { gap: 20px; padding: 2px 0 10px; }
  /* The two-row header is taller, so in-page jumps stop lower. */
  html { scroll-padding-top: 112px; }
}
/* Keep the header on one line at 320px by dropping the mark (the name stays). */
@media (max-width: 400px) {
  .nav-inner { gap: 8px; }
  .btn-small { padding: 8px 10px; font-size: .875rem; }
  .wordmark { font-size: 1.1875rem; }
  .nav .wm-mark { display: none; }
  .theme-btn { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Print: show blocks that haven't scrolled in yet, and drop the sticky header. */
@media print {
  .js-arrive [data-arrive] { opacity: 1 !important; transform: none !important; }
  .nav { position: static; backdrop-filter: none; }
  .theme-btn, .skip { display: none !important; }
}
