/* ostack landing page. Hand-written CSS: no preprocessor, no framework, no build. */

/* The page is white with one blue. A .band (the header, the hero, the
   self-hosting section and the footer) swaps in the blue palette. */
:root {
  --bg: #ffffff;
  --surface: #f3f6f9; /* tinted sections and panels */
  --surface-2: #e6ecf2;
  --edge: rgb(40 65 98 / 0.12);

  /* Cards: white, with a faint edge and a soft shadow. */
  --card: #ffffff;
  --well: #f3f6f9;
  --card-edge: rgb(40 65 98 / 0.1);
  --card-shadow: 0 1px 2px rgb(27 38 51 / 0.06), 0 16px 40px -20px rgb(27 38 51 / 0.28);

  --radius-lg: 10px; /* cards */
  --radius: 6px; /* panels inside cards, menus */
  --radius-sm: 4px; /* buttons, inputs, small cards */

  /* Text, all at least 4.5:1 on --bg, --surface and --surface-2 */
  --text: #1f2b38;
  --muted: #4b5866;
  --subtle: #5b6876;

  --accent: #284162; /* the blue: links, buttons, controls */
  --secondary: #9c7a1c; /* muted gold: markers only, never for something to click */
  --focus: #284162;

  --btn: #284162;
  --btn-hover: #1d3150;
  --on-btn: #ffffff;

  color-scheme: light;
}

/* A blue band. White and pale text hold 4.5:1 on all three surfaces. */
.band {
  --bg: #0b1220;
  --surface: #111a2b;
  --surface-2: #182338;
  --edge: rgb(255 255 255 / 0.14);

  --card: #111a2b;
  --card-edge: rgb(255 255 255 / 0.14);
  --card-shadow: 0 24px 64px -24px rgb(10 18 30 / 0.6);

  --text: #ffffff;
  --muted: #dbe4ee;
  --subtle: #c1cfdf;

  --accent: #ffffff;
  --secondary: #e0b84f;
  --focus: #e0b84f;

  --btn: #ffffff;
  --btn-hover: #e6ecf2;
  --on-btn: #0b1220;

  color-scheme: dark;
  background: var(--bg);
  color: var(--text);
}
.band ::selection {
  background: rgb(255 255 255 / 0.25);
}

/* Terminals and code are slate wherever they sit, so code always reads light
   on dark. Their syntax colours have no other values. */
.terminal,
.tile-code {
  --card: #1b2633;
  --well: #1b2633;
  --card-edge: rgb(255 255 255 / 0.08);
  --text: #f5f6f8;
  --muted: #c8cfd8;
  --subtle: #aab4c0;
  --accent: #b3c7e0;
  --focus: #e0b84f;

  --code-keyword: #c2cdf0;
  --code-string: #8fd3a8;
  --code-number: #f2cf85;

  color-scheme: dark;
  color: var(--text);
}

:root {
  --font: 'Source Sans 3', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: var(--font); /* headings: the text face, bold */
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --paper: #ffffff; /* the white under the hero's blue, whatever the tokens */

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --header: 64px;
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-sans-3-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-sans-3-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Source Serif 4, unused while headings are sans. Set --display to
   'Source Serif 4' to bring the serif back; browsers download it only then. */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-ext-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/geist-mono-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/geist-mono-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -------------------------------------------------------------------- base */

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

html {
  scroll-padding-top: calc(var(--header) + 24px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
ul,
figure,
pre {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

code,
pre {
  font-family: var(--mono);
  font-variant-ligatures: none;
}
code {
  font-size: 0.875em;
}
pre {
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 0.16) transparent;
}

::selection {
  background: rgb(40 65 98 / 0.18);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Holds the logo and icon definitions; masks need it rendered, not display: none. */
.sr-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm {
  width: 15px;
  height: 15px;
}
.icon-fill {
  fill: currentColor;
  stroke: none;
}

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

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
}
.btn-lg {
  height: 52px;
  padding: 0 26px;
  font-size: 16px;
}
.btn-primary {
  background: var(--btn);
  color: var(--on-btn);
}
.btn-primary:hover {
  background: var(--btn-hover);
}
.btn-secondary {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  color: var(--accent);
}
.btn-secondary:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --------------------------------------------------------------- standards */

.standards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}
.standards li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.standards .icon {
  color: var(--secondary);
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.08);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 40px;
  height: var(--header);
}

.brand {
  display: inline-flex;
  padding: 6px 0;
}
.brand-word {
  width: auto;
  height: 26px;
  fill: var(--text);
}

.site-nav {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 24px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
.nav-link:hover,
.nav-trigger[aria-expanded='true'] {
  color: var(--text);
}
.chevron {
  transition: transform 0.2s;
}
.nav-trigger[aria-expanded='true'] .chevron {
  transform: rotate(180deg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  background: none;
  cursor: pointer;
}

.products-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  display: grid;
  width: 340px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow:
    0 0 0 1px var(--card-edge),
    var(--card-shadow);
}
.products-panel[hidden] {
  display: none;
}

.panel-item {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color 0.15s;
}
.panel-item:hover {
  background: rgb(255 255 255 / 0.07);
}
.panel-item strong {
  font-size: 15px;
  font-weight: 500;
}
.panel-item span {
  color: var(--muted);
  font-size: 14px;
}

/* Without JavaScript, Products is a plain link to the section. */
.js .nav-products-link,
html:not(.js) .nav-trigger {
  display: none;
}

@media (max-width: 959px) {
  .js .nav-toggle {
    display: inline-flex;
  }
  .js .site-nav {
    display: none;
  }
  .js .site-nav[data-open] {
    display: flex;
  }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-height: calc(100dvh - var(--header));
    overflow-y: auto;
    padding: 8px var(--gutter) 24px;
    background: var(--bg);
  }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-link {
    width: 100%;
    height: 48px;
    padding: 0;
    font-size: 16px;
  }
  .nav-trigger .chevron {
    margin-left: auto;
  }
  .products-panel {
    position: static;
    width: auto;
    padding: 0 0 8px;
    background: none;
    box-shadow: none;
  }
  .panel-item {
    padding: 10px 16px;
  }
  .nav-actions {
    justify-content: space-between;
    margin: 8px 0 0;
  }
  .nav-github {
    width: auto;
  }

  /* Without JavaScript there is no menu button: the links sit in the page
     under the logo instead of covering it. */
  html:not(.js) .site-header {
    position: static;
  }
  html:not(.js) .header-inner {
    flex-wrap: wrap;
    align-content: start;
    gap: 4px 40px;
    height: auto;
    padding-top: 14px;
  }
  html:not(.js) .site-nav {
    position: static;
    flex-basis: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    max-height: none;
    padding: 0 0 12px;
    background: none;
  }
  html:not(.js) .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 20px;
  }
  html:not(.js) .nav-link {
    width: auto;
    height: 40px;
    font-size: 15px;
  }
  html:not(.js) .nav-actions {
    display: none;
  }
}

/* -------------------------------------------------------------------- hero */

/* Blue down to the middle of the board picture, which hangs over the white
   below it; the blue's lower edge curves down at the sides. */
.hero {
  /* The board recording is 1280x720, as wide as the wrap's content. */
  --shot-h: calc(min(var(--wrap), 100vw - 2 * var(--gutter)) * 0.5625);
  --below: calc(var(--shot-h) * 0.45);
  position: relative;
  isolation: isolate;
  padding-top: clamp(64px, 9vw, 120px);
  background:
    radial-gradient(ellipse 50% 100% at 50% 0, var(--bg) 99%, transparent 100%) left 0 bottom calc(var(--below) - 56px) / 100% 56px
      no-repeat,
    linear-gradient(var(--bg), var(--bg)) left 0 top / 100% calc(100% - var(--below)) no-repeat,
    var(--paper);
}

/* A dot grid at the hero's sides, kept clear of the text: the radial mask
   leaves the middle empty and the linear one fades it out before the product
   picture. Pure decoration, so it is a pseudo-element, it goes in
   forced-colours mode, and phones, where the text spans the width, skip it. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: min(820px, 100%);
  background-image: radial-gradient(circle at center, rgb(255 255 255 / 0.2) 1px, transparent 1.5px);
  background-position: center 12px;
  background-size: 24px 24px;
  -webkit-mask-image:
    radial-gradient(ellipse 42% 75% at 50% 40%, transparent 55%, #000 100%),
    linear-gradient(#000 50%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(ellipse 42% 75% at 50% 40%, transparent 55%, #000 100%),
    linear-gradient(#000 50%, transparent);
  mask-composite: intersect;
  pointer-events: none;
}
@media (max-width: 719px) {
  .hero::before {
    display: none;
  }
}

.hero-copy {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 28px;
  text-align: center;
}

h1 {
  max-width: 16ch;
  font-size: clamp(40px, 5.6vw, 68px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lead {
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  text-wrap: pretty;
}

.hero-copy .actions {
  justify-content: center;
  margin-top: 8px;
}
@media (max-width: 479px) {
  .hero-copy .actions {
    display: grid;
    width: 100%;
  }
}

/* ------------------------------------------------------------------ aurora */
/* Unused while the .sky markup in index.html is commented out; kept so the
   northern lights can come back by uncommenting it.
   Curtains of light: blurred once, then only transform and opacity move, which
   the browser composites without repainting. Still for reduced motion. */

.sky {
  position: absolute;
  inset: 0 0 auto;
  height: 900px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}

.aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* The outer layer blurs; the inner one carries the light and its rays, so the
   rays come out soft rather than striped. */
.curtain {
  position: absolute;
  width: 70%;
  height: 75%;
  filter: blur(22px);
  mix-blend-mode: screen;
  transform-origin: 50% 100%;
}
.curtain::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--light);
  -webkit-mask-image:
    repeating-linear-gradient(90deg, #000 0 6px, rgb(0 0 0 / 0.3) 6px 20px, #000 20px 26px, rgb(0 0 0 / 0.55) 26px 44px),
    radial-gradient(ellipse 50% 50% at 50% 50%, #000 40%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    repeating-linear-gradient(90deg, #000 0 6px, rgb(0 0 0 / 0.3) 6px 20px, #000 20px 26px, rgb(0 0 0 / 0.55) 26px 44px),
    radial-gradient(ellipse 50% 50% at 50% 50%, #000 40%, transparent 100%);
  mask-composite: intersect;
}

.curtain-a {
  --light: linear-gradient(180deg, transparent 0%, rgb(52 211 153 / 0.5) 40%, rgb(45 212 191 / 0.8) 68%, transparent 100%);
  top: -28%;
  left: -14%;
  opacity: 0.75;
  transform: rotate(-14deg) skewX(-18deg);
}
.curtain-b {
  --light: linear-gradient(180deg, transparent 0%, rgb(34 211 238 / 0.4) 40%, rgb(59 130 246 / 0.55) 72%, transparent 100%);
  top: -34%;
  left: 24%;
  opacity: 0.6;
  transform: rotate(6deg) skewX(12deg);
}
.curtain-c {
  --light: linear-gradient(180deg, transparent 0%, rgb(167 139 250 / 0.5) 42%, rgb(240 171 252 / 0.55) 70%, transparent 100%);
  top: -38%;
  right: -16%;
  opacity: 0.55;
  transform: rotate(18deg) skewX(20deg);
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgb(255 255 255 / 0.7), transparent 60%),
    radial-gradient(1px 1px at 28% 62%, rgb(255 255 255 / 0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 44% 12%, rgb(255 255 255 / 0.8), transparent 60%),
    radial-gradient(1px 1px at 58% 38%, rgb(255 255 255 / 0.5), transparent 60%),
    radial-gradient(1px 1px at 71% 9%, rgb(255 255 255 / 0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 83% 27%, rgb(255 255 255 / 0.7), transparent 60%),
    radial-gradient(1px 1px at 92% 66%, rgb(255 255 255 / 0.4), transparent 60%),
    radial-gradient(1px 1px at 6% 78%, rgb(255 255 255 / 0.35), transparent 60%),
    radial-gradient(1px 1px at 36% 32%, rgb(255 255 255 / 0.55), transparent 60%),
    radial-gradient(1px 1px at 64% 72%, rgb(255 255 255 / 0.35), transparent 60%);
  background-size: 640px 420px;
  opacity: 0.7;
}

.sky-low {
  inset: auto 0 0;
  height: 100%;
  -webkit-mask-image: linear-gradient(transparent, #000 55%, #000 70%, transparent);
  mask-image: linear-gradient(transparent, #000 55%, #000 70%, transparent);
}
.sky-low .curtain {
  top: auto;
  bottom: -45%;
  height: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .curtain-a {
    animation: sway-a 24s ease-in-out infinite alternate;
  }
  .curtain-b {
    animation: sway-b 31s ease-in-out infinite alternate;
  }
  .curtain-c {
    animation: sway-c 38s ease-in-out infinite alternate;
  }
}

@keyframes sway-a {
  to {
    transform: rotate(-8deg) skewX(-6deg) translateX(8%) scaleY(1.15);
    opacity: 0.9;
  }
}
@keyframes sway-b {
  to {
    transform: rotate(0deg) skewX(-4deg) translateX(-10%) scaleY(1.2);
    opacity: 0.75;
  }
}
@keyframes sway-c {
  to {
    transform: rotate(10deg) skewX(6deg) translateX(-8%) scaleY(1.1);
    opacity: 0.7;
  }
}

/* ------------------------------------------------------- product picture */
/* Recordings of the tracker (images/anim, made by tools/record): SVGs in the
   app's light theme. The figure's img carries the text alternative. */

.shot {
  position: relative;
  margin-top: clamp(48px, 7vw, 88px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 3px rgb(15 30 50 / 0.12),
    0 32px 80px -28px rgb(15 30 50 / 0.5);
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* The pause button of a recording (WCAG 2.2.2), added by main.js. */
.anim {
  position: relative;
}
.anim-toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgb(17 24 39 / 0.78);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s;
}
.anim-toggle:hover {
  background: rgb(17 24 39 / 0.92);
}
.anim-toggle .icon {
  width: 14px;
  height: 14px;
}
@media (max-width: 639px) {
  .anim-toggle {
    right: 6px;
    bottom: 6px;
    height: 24px;
    padding: 0 8px 0 6px;
    gap: 4px;
    font-size: 12px;
  }
  .anim-toggle .icon {
    width: 12px;
    height: 12px;
  }
}

/* ---------------------------------------------------------------- sections */

.section {
  padding-block: clamp(80px, 10vw, 136px);
}

h1,
h2,
.section-title {
  font-family: var(--display);
}
h2,
.section-title {
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
/* A section that opens with a title over the full width centres it. */
.section-title {
  max-width: 30ch;
  margin: 0 auto clamp(40px, 5vw, 64px);
  text-align: center;
}

.tint {
  background: var(--surface);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.prose {
  display: grid;
  gap: 20px;
}
.prose p {
  max-width: 32rem;
  color: var(--muted);
  font-size: 18px;
}
.prose code {
  color: var(--text);
}

.terminal {
  padding: clamp(24px, 3vw, 36px);
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px var(--card-edge),
    0 24px 56px -28px rgb(10 18 30 / 0.55);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.85;
}
.terminal code {
  font-size: inherit;
}

.t-prompt {
  color: var(--accent);
  user-select: none;
}
.t-dim {
  color: var(--subtle);
}
.t-accent {
  color: var(--accent);
}
.t-k {
  color: var(--code-keyword);
}
.t-s {
  color: var(--code-string);
}
.t-n {
  color: var(--code-number);
}

@media (max-width: 879px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------------ tiles */

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: clamp(10px, 1.2vw, 14px) clamp(10px, 1.2vw, 14px) clamp(28px, 3vw, 36px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px var(--card-edge),
    var(--card-shadow);
}
.tile > .tile-copy {
  padding-inline: clamp(18px, 2.4vw, 30px);
}


.tile-copy {
  display: grid;
  align-content: start;
  gap: 12px;
}
.tile h3 {
  font-size: 24px;
  font-weight: 700;
}
.tile h3::before {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  margin-bottom: 16px;
  background: var(--secondary);
}
.tile p {
  max-width: 30rem;
  color: var(--muted);
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  margin-top: 8px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.more .icon {
  transition: transform 0.15s;
}
.more:hover .icon {
  transform: translateX(3px);
}

.tile-code {
  padding: 24px;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--card-edge);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
}
.tile-code code {
  font-size: inherit;
}

.tile .tile-code,
.kit {
  min-height: 220px;
  flex: 1;
}

.kit {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  gap: 14px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--edge);
  font-size: 14px;
}
.kit-btn {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-weight: 500;
}
.kit-btn-primary {
  background: var(--btn);
  color: var(--on-btn);
}
.kit-switch {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 44px;
  height: 24px;
  padding: 3px;
  border-radius: 999px;
  background: var(--accent);
}
.kit-switch i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
}
.kit-input {
  display: inline-flex;
  align-items: center;
  flex: 1 1 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--subtle);
  color: var(--muted);
}
.kit-swatches {
  display: flex;
  gap: 6px;
}
.kit-swatches i {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
/* The kind of palette a city's theme would use. */
.kit-swatches i:nth-child(1) {
  background: #26374a;
}
.kit-swatches i:nth-child(2) {
  background: #284162;
}
.kit-swatches i:nth-child(3) {
  background: #6f8fb5;
}
.kit-swatches i:nth-child(4) {
  background: #b3c7e0;
}
.kit-swatches i:nth-child(5) {
  background: #e0b84f;
}

@media (max-width: 879px) {
  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------- features */
/* Rows of text beside a recording of the tracker, alternating sides. */

.features {
  display: grid;
  gap: clamp(64px, 9vw, 120px);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}
.feature:nth-child(even) {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
.feature:nth-child(even) .feature-copy {
  order: 2;
}

.feature-copy {
  display: grid;
  gap: 14px;
}
.feature h3 {
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}
.feature h3::before {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  margin-bottom: 18px;
  background: var(--secondary);
}
.feature p {
  max-width: 30rem;
  color: var(--muted);
  font-size: 18px;
}

.feature-shot {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgb(15 30 50 / 0.12),
    0 24px 56px -24px rgb(15 30 50 / 0.45);
}
.feature-shot img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 879px) {
  .feature,
  .feature:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
  }
  .feature:nth-child(even) .feature-copy {
    order: 0;
  }
}

/* ------------------------------------------------------------------ agents */
/* The layers diagram is inline SVG in the page's fonts. Its dots flow while
   main.js marks it data-playing; without JavaScript, or with reduced motion,
   it stays still. */

.agents {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
@media (max-width: 899px) {
  .agents {
    grid-template-columns: minmax(0, 1fr);
  }
}

.layers {
  display: grid;
  gap: 20px;
  margin: 8px 0 0;
}
.layers > div {
  padding-left: 18px;
  border-left: 3px solid var(--edge);
}
.layers .layer-core {
  border-left-color: var(--secondary);
}
.layers dt {
  font-weight: 700;
}
.layers dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.diagram {
  position: relative;
  margin: 0;
}
/* Below the drawing rather than over it, where it would cover a label. */
.diagram .anim-toggle {
  position: static;
  display: flex;
  margin: 12px 0 0 auto;
  border: 1px solid var(--edge);
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: inherit;
}
.diagram .flow path {
  animation: flow 1.2s linear infinite paused;
}
.diagram .flow .flow-slow {
  animation-duration: 2s;
}
.diagram[data-playing] .flow path {
  animation-play-state: running;
}
@keyframes flow {
  from {
    stroke-dashoffset: 16;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .diagram .flow path {
    animation: none;
  }
}

/* ---------------------------------------------------------------- npm cves */
/* One series, so one colour (the blue) and no legend: the title names it.
   main.js adds a tooltip on hover; the table holds every number. */

.cves-lead {
  max-width: 40rem;
  margin: calc(-1 * clamp(16px, 2vw, 32px)) auto clamp(32px, 4vw, 48px);
  color: var(--muted);
  font-size: 18px;
  text-align: center;
  text-wrap: pretty;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 32px);
  margin: 0 0 clamp(32px, 4vw, 48px);
}
.stats > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 4px;
  padding-top: 14px;
  border-top: 3px solid var(--secondary);
}
.stats dt {
  color: var(--muted);
}
.stats dd {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(36px, 4.4vw, 56px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 639px) {
  .stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

.chart {
  margin: 0;
  padding: clamp(16px, 2.4vw, 28px);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--card-shadow);
}
.chart-plot {
  position: relative;
}
.chart svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: inherit;
}
.chart .tick {
  fill: #5b6876;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.chart .val {
  fill: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* On a phone the drawing shrinks to about half: the text grows to stay
   about 12px on screen. */
@media (max-width: 639px) {
  .chart svg {
    overflow: visible;
  }
  .chart .tick {
    font-size: 22px;
  }
  .chart .tick-x {
    font-size: 20px;
  }
  .chart .val {
    font-size: 22px;
  }
}
.chart .bar.is-on path {
  fill: #1d3150;
}
.chart .bar.is-on .hit {
  fill: rgb(40 65 98 / 0.06);
}
.chart-tip {
  position: absolute;
  z-index: 1;
  padding: 6px 10px;
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--card-shadow);
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
}
.chart-tip strong {
  display: block;
}
.chart figcaption {
  margin-top: 16px;
  color: var(--subtle);
  font-size: 14px;
}
.chart-table {
  margin-top: 12px;
  font-size: 14px;
}
.chart-table summary {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.chart-table table {
  margin-top: 12px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.chart-table th,
.chart-table td {
  padding: 4px 24px 4px 0;
  border-bottom: 1px solid var(--edge);
  text-align: right;
}
.chart-table th:first-child {
  text-align: left;
}

/* The security section reads on from this one. */
.cves + #security {
  padding-top: 0;
}

/* ------------------------------------------------------------------ facts */

.facts {
  display: grid;
  margin: 0;
  padding: 8px clamp(20px, 3vw, 32px);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px var(--card-edge),
    var(--card-shadow);
}
.facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
}
.facts > div + div {
  border-top: 1px solid var(--edge);
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
}
.facts small {
  display: block;
  margin-top: 6px;
  color: var(--subtle);
  font-size: 13px;
  font-weight: 400;
}

/* ----------------------------------------------------------------- points */

.points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.point {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: clamp(24px, 2.6vw, 32px);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px var(--card-edge),
    var(--card-shadow);
}
.point h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
}
.point h3::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--secondary);
}
.point p {
  color: var(--muted);
  font-size: 17px;
}
@media (max-width: 879px) {
  .points {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* ---------------------------------------------------------------- snippet */

.snippet {
  position: relative;
}
.snippet .terminal {
  padding-right: 120px;
}

.copy {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.08);
  font-size: 14px;
  cursor: pointer;
}
.copy:hover {
  background: rgb(255 255 255 / 0.14);
}
.copy[data-done] {
  color: var(--accent);
}

/* ---------------------------------------------------------------- closing */

.closing {
  position: relative;
  padding-block: clamp(96px, 12vw, 160px);
  overflow: hidden;
}
.closing-inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 20px;
  text-align: center;
}
.closing .actions {
  margin-top: 12px;
}

/* ----------------------------------------------------------------- footer */

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 40px;
  padding-block: 32px 48px;
  color: var(--subtle);
  font-size: 14px;
}
.footer-logo {
  width: auto;
  height: 20px;
  fill: var(--muted);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--text);
}
.footer-note {
  margin-left: auto;
}

@media (max-width: 639px) {
  .footer-note {
    margin-left: 0;
  }
}

/* ------------------------------------------------------- forced colours */

@media (forced-colors: active) {
  .sky,
  .hero::before {
    display: none;
  }
  .hero {
    background: Canvas;
  }
  h1 {
    -webkit-text-fill-color: currentColor;
  }
  .btn,
  .copy,
  .anim-toggle,
  .terminal,
  .tile,
  .feature-shot,
  .facts,
  .point,
  .shot,
  .products-panel {
    border: 1px solid CanvasText;
  }
  .diagram text,
  .diagram tspan {
    fill: CanvasText;
  }
  .diagram circle,
  .diagram rect {
    fill: Canvas;
    stroke: CanvasText;
  }
  .diagram path,
  .diagram g[stroke] {
    stroke: CanvasText;
  }
  .chart .bar path {
    fill: CanvasText;
  }
  .chart .tick,
  .chart .val {
    fill: CanvasText;
  }
}
