/* Mobile first: base rules are the phone layout, min-width queries add to it.
   One vertical line runs down the page; every section is a station on it. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ground: #0b0d10;
  --ground-2: #14181d;
  --ink: #eef1f4;
  --ink-dim: #aab3bc;
  --ink-faint: #8b959f;
  --line: #f4f6f8;
  --line-ghost: #2a3038;
  --signal: #7fb2ff;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 18px;
  --rail-x: 20px;
  --content-x: 44px;
  --station-y: 3.5rem;
  --header-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: calc(var(--header-h) - 1px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; }
p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 4.25rem); line-height: 1.08; font-weight: 650; letter-spacing: -.03em; max-width: 17ch; }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.6vw, 2.6rem); line-height: 1.15; font-weight: 600; letter-spacing: -.022em; }
h3 { font-size: 1.125rem; line-height: 1.35; font-weight: 600; }

/* Smooth only while following a link (set in main.js). Always on, it can get in the way of
   the iPhone status bar tap that scrolls to the top. */
html.glide { scroll-behavior: smooth; }

.skip { position: absolute; left: -999px; top: 0; z-index: 20; background: var(--line); color: var(--ground); padding: .75rem 1rem; }
.skip:focus { left: 0; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: .5rem;
  min-height: var(--header-h);
  padding: 0 8px 0 var(--gutter);
  background: var(--ground);
  border-bottom: 1px solid var(--line-ghost);
}
.brand { display: flex; align-items: center; gap: .6rem; margin-right: auto; min-height: 44px; font-weight: 600; font-size: 1rem; letter-spacing: -.01em; line-height: 1.2; text-decoration: none; }
.brand-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--line); }
.nav-wide { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .6rem 1.3rem;
  font: 550 1rem/1.2 var(--font);
  color: var(--ground); background: var(--line);
  border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s;
}
.btn.ghost { background: transparent; color: var(--line); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-small { min-height: 44px; padding: .5rem .95rem; font-size: .9rem; white-space: nowrap; }
@media (hover: hover) {
  .btn:hover { background: transparent; color: var(--line); }
  .btn.ghost:hover { background: var(--line); color: var(--ground); }
}

.menu summary { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-icon, .menu-icon::before { display: block; width: 20px; height: 2px; background: var(--ink); transition: transform .2s; }
.menu-icon { position: relative; transform: translateY(-3px); }
.menu-icon::before { content: ""; position: absolute; top: 7px; }
.menu[open] .menu-icon { transform: rotate(45deg); }
.menu[open] .menu-icon::before { transform: translateY(-7px) rotate(-90deg); }
.menu nav {
  position: absolute; left: 0; right: 0; top: 100%;
  max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  padding: .5rem var(--gutter) 1.25rem;
  background: var(--ground); border-bottom: 1px solid var(--line-ghost);
}
.menu nav a { display: flex; align-items: center; min-height: 48px; font-size: 1.05rem; text-decoration: none; border-bottom: 1px solid var(--line-ghost); }
.menu nav a:last-child { border-bottom: 0; }

/* The line */
.track { position: relative; }
.rail { position: absolute; left: calc(var(--rail-x) - 1px); top: 0; bottom: 0; width: 2px; background: var(--line-ghost); }
/* The white part stays put on screen while the page moves, so it fills exactly with
   the scroll. svh, not vh: it does not change when a phone's toolbar collapses. */
.progress { position: sticky; top: var(--header-h); height: calc(45vh - var(--header-h)); height: calc(45svh - var(--header-h)); background: var(--line); }
.station { position: relative; padding: var(--station-y) var(--gutter) var(--station-y) var(--content-x); }
.node {
  position: absolute; left: var(--rail-x); top: calc(var(--station-y) + .3rem);
  width: 14px; height: 14px; transform: translateX(-50%);
  border-radius: 50%; background: var(--ground); border: 2px solid var(--ink-faint);
  box-shadow: 0 0 0 4px var(--ground);
  transition: border-color .3s, background .3s;
}
.node.interchange { width: 20px; height: 20px; top: calc(var(--station-y) + .1rem); }
.station.passed .node { border-color: var(--line); background: var(--line); }
.station.current .node { border-color: var(--signal); background: var(--ground); }

.inner { max-width: 1080px; }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.stop-label { display: flex; gap: .6rem; font-size: .9rem; font-weight: 500; line-height: 1.5; color: var(--ink-dim); }
.stop-label .code { color: var(--ink); font-weight: 600; }
.station.current .stop-label .code { color: var(--signal); }
.lede { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--ink-dim); max-width: 60ch; }
.prose { color: var(--ink-dim); max-width: 62ch; }
.split, .pair { display: grid; gap: 1.75rem; }

/* Hero */
.hero { --station-y: 2.5rem; }
.hero-actions { display: grid; gap: .75rem; }
.focus { margin-top: 1rem; border-top: 1px solid var(--line-ghost); }
.focus a { display: block; height: 100%; padding: 1rem 0; text-decoration: none; border-bottom: 1px solid var(--line-ghost); }
.focus strong { display: block; font-weight: 600; font-size: 1.05rem; }
.focus span { color: var(--ink-dim); font-size: .95rem; }

/* Services */
.services { display: grid; border: 1px solid var(--line-ghost); border-width: 1px 0 0 1px; }
.services a { display: flex; flex-direction: column; gap: .4rem; height: 100%; padding: 1.25rem 1.1rem; text-decoration: none; border: 1px solid var(--line-ghost); border-width: 0 1px 1px 0; transition: background .2s; }
.services strong { font-size: 1.2rem; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
.services span { color: var(--ink-dim); }
.services .svc-code, .services .go { font-size: .85rem; font-weight: 500; color: var(--ink-faint); }
.services .go { margin-top: auto; padding-top: .4rem; }
@media (hover: hover) {
  .services a:hover { background: var(--ground-2); }
  .services a:hover .go, .focus a:hover strong { color: var(--signal); }
}

.deliverables { border-top: 1px solid var(--line-ghost); }
.deliverables li { padding: .9rem 0; border-bottom: 1px solid var(--line-ghost); }
.deliverables strong { display: block; font-weight: 550; }
.deliverables span { color: var(--ink-dim); font-size: .95rem; }
.pair h3 { margin-bottom: .9rem; }

/* Chat example */
.chat { display: flex; flex-direction: column; gap: .75rem; padding: 1.1rem; background: var(--ground-2); border: 1px solid var(--line-ghost); border-radius: 12px; align-self: start; }
.chat figcaption { font-size: .85rem; color: var(--ink-faint); padding-bottom: .25rem; }
.msg { max-width: 92%; padding: .7rem .9rem; border-radius: 12px; font-size: .95rem; line-height: 1.5; }
.msg b { display: block; font-size: .8rem; font-weight: 550; color: var(--ink-dim); }
.ask { align-self: flex-end; background: #29313b; }
.answer { align-self: flex-start; background: var(--ground); border: 1px solid var(--line-ghost); }
.answer b { color: var(--signal); }
.msg small { display: block; margin-top: .5rem; font-size: .82rem; color: var(--ink-dim); }

/* ISO */
.quick { border-top: 1px solid var(--line-ghost); }
.quick li { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--line-ghost); }
.quick span { color: var(--ink-faint); }
.domains { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line-ghost); border-width: 1px 0 0 1px; }
.domains li { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; border: 1px solid var(--line-ghost); border-width: 0 1px 1px 0; }
.domains .clause { font-size: .85rem; color: var(--ink-faint); }
.domains .count { font-size: 2.1rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.domains .name { font-size: .92rem; line-height: 1.4; color: var(--ink-dim); }

/* Approach */
.route { position: relative; display: grid; gap: 1.6rem; margin-top: .5rem; }
.route::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.route li { position: relative; padding-left: 2.1rem; }
.route li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--ground); border: 2px solid var(--line); }
.route li:last-child::before { background: var(--line); }
.route .when { font-size: .9rem; color: var(--ink-faint); }
.route p { margin-top: .25rem; color: var(--ink-dim); }

/* Contact */
.mail { display: inline-flex; align-items: center; min-height: 44px; font-size: 1.15rem; font-weight: 550; overflow-wrap: anywhere; text-underline-offset: 4px; }
form { display: grid; gap: 1.1rem; }
label { display: grid; gap: .4rem; font-size: .92rem; font-weight: 500; color: var(--ink-dim); }
input, select, textarea { width: 100%; min-height: 48px; padding: .7rem .85rem; font: 400 1rem/1.5 var(--font); color: var(--ink); background: var(--ground-2); border: 1px solid #5d6670; border-radius: 8px; }
textarea { resize: vertical; }
::placeholder { color: var(--ink-faint); opacity: 1; }
.hp { position: absolute; left: -9999px; }
.note:empty { display: none; }
.note { color: var(--ink); }
.fine { font-size: .88rem; color: var(--ink-faint); }

footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 2rem; padding: 1rem var(--gutter) 1.5rem var(--content-x); font-size: .92rem; color: var(--ink-dim); border-top: 1px solid var(--line-ghost); }
footer nav { display: flex; gap: 1.5rem; }
footer nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* Text pages: imprint, privacy, 404 */
.page { max-width: 720px; margin-inline: auto; padding: 2.5rem var(--gutter) 4rem; }
.page h1 { font-size: clamp(1.9rem, 1.5rem + 2vw, 2.75rem); }
.page h2 { font-size: 1.2rem; margin-top: 1rem; letter-spacing: -.01em; }
.page p { color: var(--ink-dim); overflow-wrap: anywhere; }
.page + footer { padding-left: var(--gutter); }

@media (min-width: 480px) {
  .hero-actions { display: flex; flex-wrap: wrap; }
  form .btn { justify-self: start; }
}

@media (min-width: 720px) {
  :root { --gutter: 28px; --rail-x: 40px; --content-x: 88px; --station-y: 5rem; }
  .hero { --station-y: 4.5rem; }
  .top { padding-right: var(--gutter); gap: 1rem; }
  .node { width: 18px; height: 18px; }
  .node.interchange { width: 24px; height: 24px; }
  .services, .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services a { padding: 1.5rem 1.4rem; }
  .focus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 1.5rem; }
  .domains { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  :root { --rail-x: 56px; --content-x: 140px; --station-y: 6rem; }
  .menu { display: none; }
  .nav-wide { display: flex; gap: 1.5rem; margin-right: .5rem; }
  .nav-wide a { display: inline-flex; align-items: center; min-height: 44px; font-size: .94rem; color: var(--ink-dim); text-decoration: none; }
  .nav-wide a:hover { color: var(--ink); }
  .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
  .route { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
  .route::before { left: 0; right: 0; top: 7px; bottom: auto; width: auto; height: 2px; }
  .route li { padding: 2rem 1.4rem 0 0; }
  .route li::before { top: 0; }
}

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