/* Layout: dark-first, logo navy ground; one 76rem column; full-bleed bands for the hero lattice, the teal marquee and the footer wordmark.
   Geometry comes from the mark: pointy-top hexagons, 30 and 90 degree lines, round caps, one stroke weight. */
:root {
  --paper: #0e1a2b;     /* logo navy */
  --panel: #15263b;
  --raise: #1b2f47;
  --ink: #eaf1f6;
  --muted: #93a8ba;
  --line: #24384f;
  --brand: #19a7cc;     /* logo teal, lifted for the navy ground */
  --brand-ink: #19a7cc; /* teal for small text and fills behind text: AA on both grounds */
  --link: #3fc0df;
  --visited: #3fc0df;
  --on-brand: #0e1a2b;
  --mark: #0f4a5a;
  --legacy: #8e9ad0;
  --ok: #5fd39a;
  --bad: #ff8a72;
  --grain: 0.06;
  --display: "Lexend", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --body: "Figtree", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --stroke: 1.75px;
  --radius: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.45, .45, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --paper: #eef3f6; --panel: #e1eaf0; --raise: #ffffff; --ink: #0e1a2b; --muted: #4f6170; --line: #c6d4dd;
    --brand: #0a8fb0; --brand-ink: #08718c; --link: #08718c; --visited: #08718c; --on-brand: #ffffff; --mark: #cdeef6; --legacy: #717fb4;
    --ok: #1d7a4c; --bad: #b3361f; --grain: 0.035;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --paper: #eef3f6; --panel: #e1eaf0; --raise: #ffffff; --ink: #0e1a2b; --muted: #4f6170; --line: #c6d4dd;
  --brand: #0a8fb0; --brand-ink: #08718c; --link: #08718c; --visited: #08718c; --on-brand: #ffffff; --mark: #cdeef6; --legacy: #717fb4;
  --ok: #1d7a4c; --bad: #b3361f; --grain: 0.035;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--body);
  padding-inline: clamp(16px, 4vw, 56px);
  overflow-x: clip;
}
/* Film grain, so the flat navy reads as a surface rather than a void */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px;
}
::selection { background: var(--brand-ink); color: var(--on-brand); }
.wrap { max-width: 76rem; margin-inline: auto; }
.prose { max-width: 40rem; }
h1, h2, h3 { font-family: var(--display); line-height: 1.04; text-wrap: balance; margin: 0; letter-spacing: -0.03em; font-weight: 600; }
h1 { font-size: clamp(2.6rem, 6.6vw, 5.6rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3.2rem); }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
.mono, code { font-family: var(--mono); font-size: 0.86em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--ink); max-width: 38rem; }
.muted { color: var(--muted); }
.teal { color: var(--brand); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Display rules on .btn and friends must never beat the hidden attribute (data-live links wait for permission). */
[hidden] { display: none !important; }
.skip {
  position: absolute; left: 12px; top: 8px; z-index: 80; padding: 10px 16px; border-radius: 999px;
  background: var(--brand-ink); color: var(--on-brand); font: 600 0.95rem/1 var(--display); text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus, .skip:focus-visible { transform: none; }

/* Header: the mark's teal hexagon traces page progress. Its wrapper is the sticky box, so the header
   stays for the whole page and <main> can follow it */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; }
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
  margin-inline: calc(-1 * clamp(16px, 4vw, 56px)); padding: 14px clamp(16px, 4vw, 56px);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand .hex { width: 38px; height: 38px; flex: none; overflow: visible; }
.brand .word { height: 22px; width: auto; aspect-ratio: 1913 / 308; flex: none; }
.hexdot { width: 20px; height: 23px; flex: none; color: var(--muted); }
.hex .prog { stroke: var(--brand); stroke-dasharray: 1; stroke-dashoffset: 1; }
.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; font-size: 0.95rem; }
.top nav a { color: var(--ink); text-decoration: none; position: relative; }
.top nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.top nav a:hover::after { transform: scaleX(1); }
.mode-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.mode-btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.mode-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mode-btn .sun, .mode-btn[aria-pressed="true"] .moon { display: none; }
.mode-btn[aria-pressed="true"] .sun { display: block; }
@media (pointer: coarse) { .mode-btn { width: 44px; height: 44px; } }
.draft {
  font-family: var(--mono); font-size: 0.72rem; padding: 3px 9px; border: 1px dashed var(--muted); border-radius: 999px; color: var(--muted);
}
@media (max-width: 560px) {
  .top nav a.opt { display: none; }
  .brand .word { height: 18px; }
}

section { padding-block: clamp(44px, 6vw, 80px); border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); }

/* Buttons. The arrow is the R's bowl: a 60 degree chevron with round caps. */
.btn {
  --mx: 0px; --my: 0px;
  display: inline-flex; align-items: center; gap: 12px; padding: 13px 22px; border-radius: 999px;
  border: 1.5px solid var(--brand-ink); background: var(--brand-ink); color: var(--on-brand);
  font: 600 1rem/1 var(--display); letter-spacing: -0.01em; text-decoration: none; cursor: pointer;
  transform: translate(var(--mx), var(--my)); transition: transform .25s var(--ease), background .25s, color .25s, border-color .25s;
}
.btn .chev { width: 10px; height: 14px; transition: transform .35s var(--spring); }
.btn:hover .chev { transform: translateX(4px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); color: var(--ink); }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: default; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--panel); }
.seg button { border: 0; background: transparent; color: var(--muted); font: 600 0.88rem/1 var(--display); padding: 9px 15px; border-radius: 999px; cursor: pointer; transition: background .25s, color .25s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--brand-ink); color: var(--on-brand); }
/* On a phone the two project buttons share one row at full width; a long label wraps inside its button
   rather than pushing the other button onto a second row of the pill (larger system fonts did this). */
@media (max-width: 560px) {
  .proof-head .seg { display: flex; flex-wrap: nowrap; width: 100%; }
  .proof-head .seg button { flex: 1 1 0; min-width: 0; padding-inline: 10px; line-height: 1.2; text-align: center; }
}

/* Before/after frame */
.frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .55); }
.addr {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 14px;
  border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 0.8rem;
}
.addr::before { content: ""; flex: none; width: 46px; height: 10px; background: radial-gradient(circle, var(--line) 4px, transparent 4.5px) 0 0 / 16px 10px repeat-x; }
.addr .chip { flex: none; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 500; }
.addr .chip.insecure { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.addr .chip.secure { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.addr .url { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.compare {
  --pos: 50%;
  position: relative; aspect-ratio: 16 / 10; max-width: 100%; overflow: hidden;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize; background: var(--legacy);
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; pointer-events: none; }
.compare .after { clip-path: inset(0 0 0 var(--pos)); }
.compare .tag {
  position: absolute; top: 12px; z-index: 2; font-family: var(--mono); font-size: 0.74rem; padding: 4px 10px;
  border-radius: 999px; background: #0e1a2b; color: #eaf1f6;
}
.compare .tag.l { left: 12px; }
.compare .tag.r { right: 12px; background: #08718c; color: #fff; }
.handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 0; z-index: 3; }
.handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #19a7cc; box-shadow: 0 0 0 1px rgba(14, 26, 43, .5); }
.knob {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 54px; height: 62px; display: grid; place-items: center;
}
.knob svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); transition: transform .5s var(--spring); }
.compare:hover .knob svg, .compare[data-dragging] .knob svg, .handle:focus-visible .knob svg { transform: rotate(60deg) scale(1.06); }
.compare:hover .knob svg .arrows, .compare[data-dragging] .knob svg .arrows, .handle:focus-visible .knob svg .arrows { transform: rotate(-60deg); }
.knob svg .arrows { transition: transform .5s var(--spring); transform-origin: 0 0; }
.compare:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
/* The handle is the slider; it has no width, so the ring goes on the knob. Light ring, dark halo: visible on any screenshot. */
.handle:focus-visible { outline: none; }
.handle:focus-visible .knob { outline: 3px solid #eaf1f6; outline-offset: 2px; border-radius: 14px; box-shadow: 0 0 0 7px #0e1a2b; }
.caption { margin-top: 12px; font-size: 0.9rem; color: var(--muted); }

/* Measured facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 0; border-top: 1px solid var(--line); margin-top: 32px; }
.fact { padding: 20px 22px 20px 0; display: grid; gap: 6px; align-content: start; }
.fact .v { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.fact .v s { color: var(--muted); text-decoration-thickness: 2px; text-decoration-color: var(--bad); font-weight: 400; }
.fact p { font-size: 0.92rem; color: var(--muted); }

/* Tags and status */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-family: var(--mono); font-size: 0.72rem; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.status { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.status.live { color: var(--brand-ink); }

/* Tables */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
td.y, td.n { font-family: var(--mono); text-align: center; width: 7.5rem; }
td.y { color: var(--brand-ink); }
td.n { color: var(--muted); }
th.c { text-align: center; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Process steps */
.steps { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); counter-reset: step; }
.step { padding: 22px 22px 22px 0; border-top: 2px solid var(--line); display: grid; gap: 8px; align-content: start; position: relative; }
.step::after { content: ""; position: absolute; top: -2px; left: 0; width: 36px; height: 2px; background: var(--brand); }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: 0.8rem; color: var(--brand-ink); }
.step p { color: var(--muted); font-size: 0.95rem; }
.plain .step::before { display: none; }

footer.site { padding-block: 40px 56px; font-size: 0.88rem; color: var(--muted); display: grid; gap: 6px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
.foot-nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* Closing call to action on the case studies */
.next-steps { display: grid; gap: 16px; justify-items: start; }
.next-steps p { color: var(--muted); max-width: 38rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Touch: 44 px targets. Desktop keeps its tighter rhythm. */
@media (pointer: coarse) {
  .top nav a, .crumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .seg button, .chips button { min-height: 44px; }
}

/* Scroll reveal where the browser supports view timelines. Elements in view at load are already complete.
   A scroll-linked effect, allowed because it fails harmlessly: a frame that never scrolls leaves content at .45, never hidden. */
@supports (animation-timeline: view()) {
  .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  @keyframes rise { from { opacity: .45; } to { opacity: 1; } }
}

/* Cursor dot: the logo's separator, following a fine pointer */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 70; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--brand); pointer-events: none; opacity: 0; transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), opacity .3s, background .3s;
}
.cursor.on { opacity: 1; }
.cursor.big { width: 44px; height: 44px; margin: -22px 0 0 -22px; background: color-mix(in srgb, var(--brand) 28%, transparent); }

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

/* The page's own theme switch. Higher specificity than the viewer's data-theme and the device setting,
   and placed last, so the reader's choice always wins in both directions. */
html:root[data-mode="dark"] {
  --paper: #0e1a2b; --panel: #15263b; --raise: #1b2f47; --ink: #eaf1f6; --muted: #93a8ba; --line: #24384f;
  --brand: #19a7cc; --brand-ink: #19a7cc; --link: #3fc0df; --visited: #3fc0df; --on-brand: #0e1a2b; --mark: #0f4a5a; --legacy: #8e9ad0;
  --ok: #5fd39a; --bad: #ff8a72; --grain: 0.06;
  color-scheme: dark;
}
html:root[data-mode="light"] {
  --paper: #eef3f6; --panel: #e1eaf0; --raise: #ffffff; --ink: #0e1a2b; --muted: #4f6170; --line: #c6d4dd;
  --brand: #0a8fb0; --brand-ink: #08718c; --link: #08718c; --visited: #08718c; --on-brand: #ffffff; --mark: #cdeef6; --legacy: #717fb4;
  --ok: #1d7a4c; --bad: #b3361f; --grain: 0.035;
  color-scheme: light;
}
