/* Resident Doc Office: one-page site.
   Palette "Arctic Ice": abyss, deep, ocean, sky, frost, ice.
   Without the .anim class on <html> (reduced motion, or the scripts failed) every element shows in its final state. */

:root {
  /* The six colours in OKLCH (exact conversions of #0B2A3D #104E6F #1E7EA0 #4DB6D6 #A9E4F7 #E6F8FF).
     Each keeps its channels in --*-c, so a tint is written oklch(var(--deep-c) / 0.16). */
  --abyss-c: 27.25% 0.0504 239.51;
  --deep-c: 40.32% 0.0813 237.93;
  --ocean-c: 55.56% 0.0987 227.38;
  --sky-c: 72.78% 0.106 221.28;
  --frost-c: 88.5% 0.0653 219.73;
  --ice-c: 96.79% 0.0212 223;
  --abyss: oklch(var(--abyss-c));
  --deep: oklch(var(--deep-c));
  --ocean: oklch(var(--ocean-c));
  --sky: oklch(var(--sky-c));
  --frost: oklch(var(--frost-c));
  --ice: oklch(var(--ice-c));
  /* The one warm accent: marigold, opposite the blues on the colour wheel. Used sparingly:
     the fourth readout, the scroll-progress lines, the data line into your Drive, selected text.
     The deeper shade is for thin lines on light backgrounds (3:1 against white). */
  --marigold: oklch(80% 0.14 70);
  --marigold-deep: oklch(66% 0.15 58);
  --white: #FFFFFF;

  --ink: var(--abyss);
  --ink-soft: oklch(45.24% 0.0435 235.67);
  --line: oklch(var(--deep-c) / 0.16);
  --line-dark: oklch(var(--frost-c) / 0.18);
  --on-dark: oklch(var(--ice-c) / 0.82);
  --on-dark-soft: oklch(var(--frost-c) / 0.82);
  /* Icon strokes match the text beside them: 1.5px by regular text, 2px by bold labels and headings */
  --stroke: 1.5px;
  --stroke-bold: 2px;
  /* On dark sections depth comes from lighter surfaces and a lit top edge, not from shadows */
  --raise-1: oklch(var(--ice-c) / 0.05);
  --raise-2: oklch(var(--ice-c) / 0.1);
  --rim: inset 0 1px 0 oklch(var(--ice-c) / 0.12);
  --lift: 0 30px 60px -32px oklch(var(--abyss-c) / 0.38), 0 0 0 1px var(--line);

  --display: "Newsreader", Georgia, serif;
  --body: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --header: 72px;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1200px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  interpolate-size: allow-keywords;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: clip; }
body { margin: 0; font: 400 1.0625rem/1.62 var(--body); color: var(--ink); background: var(--white); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 500; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }
img { display: block; }
::selection { background: var(--marigold); color: var(--abyss); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 100; padding: 10px 16px; border-radius: 8px; background: var(--white); color: var(--ink); }
.skip:focus { top: 12px; }

.group { margin: 0 0 14px; font-weight: 700; font-size: 0.98rem; color: var(--ocean); }
.section { position: relative; padding-block: clamp(88px, 12vw, 160px); }
.section h2, .thesis h2 { font-size: clamp(2.1rem, 4.2vw, 3.5rem); line-height: 1.06; }
.facts { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.facts li { position: relative; padding-left: 28px; color: var(--ink-soft); }
.facts li::before { content: ""; position: absolute; left: 2px; top: 0.42em; width: 12px; height: 7px; border-left: var(--stroke) solid var(--ocean); border-bottom: var(--stroke) solid var(--ocean); transform: rotate(-45deg); }
.fine { font-size: 0.92rem; color: var(--ink-soft); }
.link { font-weight: 700; color: var(--ocean); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.link:hover { color: var(--deep); }

/* ---- Buttons ---- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 999px; font: 700 1rem/1 var(--body); text-decoration: none; white-space: nowrap; transition: transform 0.25s var(--ease), background-color 0.25s, box-shadow 0.25s, color 0.25s; }
.btn:hover { transform: translateY(-1px); }
.btn-sky { background: var(--sky); color: var(--abyss); box-shadow: 0 10px 30px -12px oklch(var(--sky-c) / 0.75); }
.btn-sky:hover { background: var(--frost); }
.btn-ghost { color: var(--ice); box-shadow: inset 0 0 0 1.5px oklch(var(--frost-c) / 0.45); }
.btn-ghost:hover { background: oklch(var(--frost-c) / 0.08); box-shadow: inset 0 0 0 1.5px var(--frost); }
.btn-ocean { background: var(--deep); color: var(--white); }
.btn-ocean:hover { background: var(--ocean); }
.btn-line { color: var(--deep); box-shadow: inset 0 0 0 1.5px oklch(var(--deep-c) / 0.35); }
.btn-line:hover { background: oklch(var(--deep-c) / 0.05); box-shadow: inset 0 0 0 1.5px var(--deep); }

/* ---- Header ---- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header); color: var(--ice); transition: background-color 0.35s var(--ease), box-shadow 0.35s; }
.site-header.scrolled { background: oklch(31.5% 0.056 239.5 / 0.86); box-shadow: 0 1px 0 var(--line-dark); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.01em; text-decoration: none; }
.brand img { border-radius: 10px; background: var(--white); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { position: relative; font-weight: 500; font-size: 0.98rem; color: var(--on-dark); text-decoration: none; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1.5px; background: var(--sky); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.nav a:not(.btn):hover { color: var(--ice); }
.nav a:not(.btn):hover::after { transform: scaleX(1); }
.nav .btn { min-height: 42px; padding: 0 20px; }

/* ---- Hero: a patient monitor ---- */
.hero { position: relative; isolation: isolate; min-height: max(660px, 100svh); display: flex; flex-direction: column; padding-top: var(--header); overflow: hidden; background: var(--abyss); color: var(--ice); }
.hero::before { /* the monitor's screen grid, fading out at the edges */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(oklch(var(--frost-c) / 0.06) 1px, transparent 1px), linear-gradient(90deg, oklch(var(--frost-c) / 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 65%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 65%, #000 25%, transparent 80%);
}
.glow { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.glow-a { width: 52vw; height: 52vw; right: -14vw; top: -18vw; background: radial-gradient(circle in oklch, oklch(var(--sky-c) / 0.38), oklch(var(--ocean-c) / 0) 68%); }
.glow-b { width: 44vw; height: 44vw; left: -16vw; bottom: -12vw; background: radial-gradient(circle in oklch, oklch(var(--ocean-c) / 0.45), oklch(var(--deep-c) / 0) 68%); }
.hero-copy { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: 40px 24px; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 6.2rem); line-height: 0.98; letter-spacing: -0.025em; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.07em; }
.hero h1 .line > span { display: inline-block; }
.lede { max-width: 38ch; margin: 28px 0 34px; font-size: clamp(1.1rem, 1.5vw, 1.3rem); color: var(--on-dark); }

.monitor { position: relative; }
/* Masked edges: the trace fades in and out at the sides instead of stopping at a hard line */
.sweep { display: block; width: 100%; height: clamp(110px, 17svh, 170px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.readouts { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-dark); }
.readout { padding: 18px 0 30px 22px; border-left: 1px solid var(--line-dark); }
.readout:first-child { padding-left: 0; border-left: 0; }
.readout:nth-child(1) { --ch: var(--sky); }
.readout:nth-child(2) { --ch: var(--frost); }
.readout:nth-child(3) { --ch: var(--ice); }
.readout:nth-child(4) { --ch: var(--marigold); }
.readout dt { font-size: 0.92rem; color: var(--on-dark-soft); }
.readout dt::before { content: ""; display: inline-block; width: 14px; height: 2px; margin-right: 10px; vertical-align: middle; background: var(--ch); }
.readout dd { margin: 6px 0 0; font-family: var(--display); font-weight: 500; font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums lining-nums; color: var(--ch); }

/* ---- On the ward ---- */
.ward { background: var(--ice); }
.ward-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.ward-side { position: sticky; top: calc(var(--header) + 48px); }
.ward-side h2 { max-width: 14ch; }
.ward-progress { position: relative; width: 2px; height: 160px; margin-top: 40px; background: var(--line); }
.ward-progress span { position: absolute; inset: 0; background: var(--marigold-deep); transform-origin: top; }
.row { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 24px; padding-block: 40px; }
.row::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); transform-origin: left; transition: transform 1.1s var(--ease); }
.row:last-child { border-bottom: 1px solid var(--line); }
.row h3 { margin-bottom: 12px; font-size: clamp(1.5rem, 2.2vw, 1.9rem); line-height: 1.15; }
.row p { max-width: 60ch; color: var(--ink-soft); }
.row > * { transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.row > div { transition-delay: 0.12s; }
.icon { width: 52px; height: 52px; padding: 6px; border-radius: 14px; background: var(--white); box-shadow: 0 1px 0 var(--line), 0 12px 24px -16px oklch(var(--abyss-c) / 0.45); fill: none; stroke: var(--ocean); stroke-width: var(--stroke-bold); stroke-linecap: round; stroke-linejoin: round; }

/* ---- On your thesis ---- */
.thesis { padding-block: clamp(88px, 12vw, 140px) clamp(64px, 8vw, 100px); background: var(--white); }
.thesis-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 48px; }
.thesis-head h2 { max-width: 18ch; }
.thesis-progress { display: none; }
.track { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; display: grid; gap: 28px; }
.tpanel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; padding: clamp(28px, 4vw, 56px); border-radius: 28px; border: 1px solid var(--line); background: var(--ice); background-image: linear-gradient(160deg in oklch, var(--ice), var(--white) 72%); }
.tpanel h3 { margin-bottom: 14px; font-size: clamp(1.6rem, 2.4vw, 2.2rem); line-height: 1.1; }
.tpanel p { color: var(--ink-soft); }

/* Wide screens: the section pins and the panels scroll sideways (main.js adds .is-horizontal) */
.thesis.is-horizontal { padding: 0; }
.is-horizontal .thesis-pin { --fade: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent); height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: var(--header); overflow: hidden; -webkit-mask-image: var(--fade); mask-image: var(--fade); }
.is-horizontal .thesis-head { margin-bottom: 28px; }
.is-horizontal .thesis-head h2 { max-width: 24ch; font-size: clamp(2rem, 3.2vw, 2.9rem); }
.is-horizontal .thesis-progress { display: block; flex: none; width: 200px; height: 2px; margin-bottom: 14px; background: var(--line); }
.is-horizontal .thesis-progress span { display: block; height: 100%; background: var(--marigold-deep); transform-origin: left; transform: scaleX(0); }
.is-horizontal .track { width: max-content; margin: 0; display: flex; gap: 32px; padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2)); }
.is-horizontal .tpanel { flex: none; width: min(1000px, 78vw); padding: clamp(28px, 3vw, 44px); }

/* Drawn product details. Bars stand for text; nothing in them is data. */
.doc, .form, .refs li, .lookup, .cal { background: var(--white); box-shadow: var(--lift); }
.doc i, .refs i, .viz-mcq i { display: block; width: var(--w); height: 8px; margin-top: 8px; border-radius: 4px; background: oklch(var(--deep-c) / 0.14); }
.doc { padding: 22px; border-radius: 18px; }
.doc-title { margin-bottom: 12px; }
.doc-title i:first-child { height: 14px; background: oklch(var(--abyss-c) / 0.78); }
.doc-sec { position: relative; margin-top: 6px; padding: 8px 46px 10px 12px; border-radius: 12px; transition: background-color 0.6s var(--ease) var(--d, 0s); }
.doc-sec b { display: block; font-size: 0.9rem; line-height: 1.3; }
.doc-sec i { height: 7px; margin-top: 6px; }
.doc-sec.fill { background: oklch(var(--sky-c) / 0.13); }
.doc-sec.fill i { background: oklch(var(--ocean-c) / 0.38); transition: width 0.9s var(--ease) var(--d, 0s); }
.doc-sec:nth-of-type(3) { --d: 0.25s; }
.doc-sec:nth-of-type(4) { --d: 0.55s; }
.doc-sec:nth-of-type(5) { --d: 0.85s; }
.tick { position: absolute; right: 12px; top: 10px; width: 24px; height: 24px; fill: none; stroke: var(--ocean); stroke-width: var(--stroke-bold); stroke-linecap: round; stroke-linejoin: round; }
.tick path { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 0.45s var(--ease) calc(var(--d, 0s) + 0.6s); }
.doc-note { margin: 14px 0 0; font-size: 0.88rem; font-weight: 700; color: var(--ocean); }

.form { padding: 6px 22px; border-radius: 18px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.field:last-child { border-bottom: 0; }
.field em { padding: 4px 10px; border-radius: 999px; background: oklch(var(--sky-c) / 0.15); font-style: normal; font-weight: 700; font-size: 0.85rem; color: var(--deep); }
.field i { width: 96px; height: 30px; border-radius: 8px; box-shadow: inset 0 0 0 1.5px var(--line); }
.field svg { width: 26px; height: 26px; fill: none; stroke: var(--ocean); stroke-width: var(--stroke); stroke-linejoin: round; }
.toggle { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--ocean); transition: background-color 0.4s var(--ease) 0.7s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 21px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); transition: left 0.4s var(--ease) 0.7s; }
.quicklook { margin-top: 16px; padding: 16px 18px 14px; border-radius: 18px; background: var(--abyss); font-weight: 700; font-size: 0.85rem; color: var(--frost); }
.quicklook svg { display: block; width: 100%; height: 100px; margin-top: 8px; }
.quicklook .grid { fill: none; stroke: oklch(var(--frost-c) / 0.14); stroke-width: 1; }
.quicklook .curve { fill: none; stroke: var(--sky); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease) 0.3s; }

.lookup { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 14px 20px; border-radius: 999px; font-size: 0.95rem; color: var(--ink-soft); }
.caret { width: 2px; height: 20px; background: var(--ocean); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.refs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: ref; }
.refs li { counter-increment: ref; display: grid; grid-template-columns: 30px 1fr; padding: 12px 16px; border-radius: 14px; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.refs li::before { content: counter(ref) "."; grid-row: span 2; font-family: var(--display); font-weight: 600; color: var(--ocean); }
.refs li i:first-of-type { margin-top: 6px; }
.refs li:nth-child(2) { transition-delay: 0.15s; }
.refs li:nth-child(3) { transition-delay: 0.3s; }
.refs li:nth-child(4) { transition-delay: 0.45s; }

.viz-cal { width: min(100%, 380px); justify-self: center; }
.cal { --r: 18px; --pad: 12px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: var(--pad); border-radius: var(--r); }
.cal span { aspect-ratio: 1; border-radius: calc(var(--r) - var(--pad)); background: oklch(var(--deep-c) / 0.07); transition: transform 0.5s var(--ease) calc(var(--i) * 18ms), opacity 0.5s calc(var(--i) * 18ms); }
.cal .l1 { background: oklch(var(--sky-c) / 0.35); }
.cal .l2 { background: var(--sky); }
.cal .l3 { background: var(--ocean); }
.exports { display: flex; gap: 8px; margin-top: 14px; }
.exports span { padding: 6px 14px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px oklch(var(--deep-c) / 0.3); font-weight: 700; font-size: 0.85rem; color: var(--deep); }

/* ---- Learning ---- */
.learning { background: var(--ice); }
.learning h2 { max-width: 20ch; }
.learn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 48px); margin-top: 56px; }
/* Concentric corners: the drawing's radius is the card's radius minus the padding around it */
.learn { --r: 28px; --pad: 12px; padding: var(--pad) var(--pad) clamp(24px, 3vw, 36px); border-radius: var(--r); border: 1px solid var(--line); background: var(--white); }
.learn .viz { border-radius: calc(var(--r) - var(--pad)); }
.learn > :not(.viz) { margin-inline: clamp(12px, 2vw, 26px); }
.learn h3 { margin: 28px 0 12px; font-size: clamp(1.5rem, 2.2vw, 1.9rem); line-height: 1.15; }
.learn p { color: var(--ink-soft); }
.viz-mcq { padding: 22px; border-radius: 18px; background: var(--ice); background-image: linear-gradient(in oklch, var(--ice), var(--white)); box-shadow: 0 0 0 1px var(--line); }
.viz-mcq .q:first-child { height: 10px; margin-top: 0; background: oklch(var(--abyss-c) / 0.72); }
.viz-mcq ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.viz-mcq li { --pad: 10px; display: flex; align-items: center; gap: 12px; padding: var(--pad); border-radius: calc(13px + var(--pad)); box-shadow: inset 0 0 0 1.5px var(--line); transition: background-color 0.5s var(--ease) 0.5s, box-shadow 0.5s var(--ease) 0.5s; }
.viz-mcq li i { margin: 0; }
.viz-mcq li b { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: oklch(var(--deep-c) / 0.08); font-size: 0.8rem; color: var(--deep); transition: background-color 0.5s var(--ease) 0.5s, color 0.5s 0.5s; }
.viz-mcq li.right { background: oklch(var(--sky-c) / 0.16); box-shadow: inset 0 0 0 1.5px var(--ocean); }
.viz-mcq li.right b { background: var(--ocean); color: var(--white); }
.explain { margin: 14px 0 0; padding: 4px 14px 12px; border-radius: 12px; background: oklch(var(--ocean-c) / 0.08); transition: opacity 0.6s var(--ease) 1s, transform 0.6s var(--ease) 1s; }
.viz-ecg { padding: 18px; border-radius: 18px; background-color: var(--abyss); background-image: linear-gradient(oklch(var(--frost-c) / 0.07) 1px, transparent 1px), linear-gradient(90deg, oklch(var(--frost-c) / 0.07) 1px, transparent 1px); background-size: 20px 20px; }
.viz-ecg svg { display: block; width: 100%; height: auto; }
.viz-ecg path { fill: none; stroke: var(--sky); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; filter: drop-shadow(0 0 4px oklch(var(--sky-c) / 0.7)); transition: stroke-dashoffset 2.2s cubic-bezier(0.45, 0, 0.55, 1) 0.2s; }

/* ---- Your data ---- */
.data { isolation: isolate; overflow: hidden; background: var(--abyss); background-image: linear-gradient(180deg in oklch, var(--abyss), var(--deep)); color: var(--ice); }
.data .group { color: var(--sky); }
.data p, .data .facts li { color: var(--on-dark); }
.data .facts li::before { border-color: var(--sky); }
.data .link { color: var(--frost); }
.data .link:hover { color: var(--ice); }
.data h2 { margin-bottom: 20px; }
.glow-c { width: 50vw; height: 50vw; right: -12vw; top: -10vw; background: radial-gradient(circle in oklch, oklch(var(--sky-c) / 0.26), oklch(var(--sky-c) / 0) 68%); }
.data-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.flow { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; grid-template-rows: auto auto; gap: 28px 0; align-items: center; }
.node { max-width: 230px; padding: 18px 20px; border-radius: 18px; background: var(--raise-1); box-shadow: var(--rim), inset 0 0 0 1px oklch(var(--frost-c) / 0.22); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.node b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--ice); }
.node span { display: block; margin-top: 4px; font-size: 0.9rem; line-height: 1.45; color: var(--on-dark-soft); }
.node-app { grid-row: 1 / 3; grid-column: 1; }
.node-drive { grid-row: 1; grid-column: 3; background: var(--raise-2); box-shadow: var(--rim), inset 0 0 0 1.5px var(--sky), 0 0 48px -12px oklch(var(--sky-c) / 0.65); transition-delay: 0.5s; }
.node-server { grid-row: 2; grid-column: 3; transition-delay: 0.7s; }
.pipe { position: relative; height: 2px; margin: 0 14px; transform-origin: left; transition: transform 0.8s var(--ease) 0.25s; }
.pipe-drive { grid-row: 1; grid-column: 2; background: repeating-linear-gradient(90deg, var(--marigold) 0 10px, transparent 10px 18px); animation: flow 0.9s linear infinite; }
.pipe-server { grid-row: 2; grid-column: 2; background: repeating-linear-gradient(90deg, oklch(var(--frost-c) / 0.4) 0 4px, transparent 4px 10px); }
.pipe::after { content: ""; position: absolute; right: 0; top: 50%; width: 8px; height: 8px; border-top: 2px solid var(--sky); border-right: 2px solid var(--sky); transform: translateY(-50%) rotate(45deg); }
.pipe-drive::after { border-color: var(--marigold); }
.pipe-server::after { border-color: oklch(var(--frost-c) / 0.5); }
@keyframes flow { to { background-position: 18px 0; } }

/* ---- Expert help ---- */
.experts { background: var(--white); }
.experts h2 { max-width: 16ch; }
.intro-p { max-width: 52ch; margin-top: 18px; font-size: 1.2rem; color: var(--ink-soft); }
.steps { --p: 1; position: relative; list-style: none; margin: 56px 0 44px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
/* from the first circle's centre to the last one's: three columns, two 32px gaps */
.steps::before, .steps::after { content: ""; position: absolute; left: 23px; right: calc((100% - 64px) / 3 - 23px); top: 22px; height: 2px; background: var(--line); }
.steps::after { background: var(--ocean); transform-origin: left; transform: scaleX(var(--p)); }
.num { position: relative; z-index: 1; display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 18px; border-radius: 50%; background: var(--ocean); box-shadow: inset 0 0 0 2px var(--ocean); font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: var(--white); transition: background-color 0.4s var(--ease), color 0.4s; }
.steps p { max-width: 30ch; color: var(--ink-soft); }
.chips { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { padding: 9px 16px; border-radius: 999px; background: var(--ice); box-shadow: inset 0 0 0 1px oklch(var(--deep-c) / 0.12); font-weight: 500; font-size: 0.95rem; color: var(--deep); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.chips li:nth-child(2) { transition-delay: 0.06s; }
.chips li:nth-child(3) { transition-delay: 0.12s; }
.chips li:nth-child(4) { transition-delay: 0.18s; }
.chips li:nth-child(5) { transition-delay: 0.24s; }
.chips li:nth-child(6) { transition-delay: 0.3s; }
.experts .fine { margin-bottom: 28px; }

/* ---- Questions ---- */
.faq { background: var(--ice); }
.faq-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.faq-side { position: sticky; top: calc(var(--header) + 48px); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0; list-style: none; cursor: pointer; font-family: var(--display); font-weight: 500; font-size: clamp(1.2rem, 1.8vw, 1.45rem); line-height: 1.3; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary { position: relative; }
.faq-list summary::after { /* the ring */
  content: ""; flex: none; width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 var(--stroke) oklch(var(--deep-c) / 0.3);
  transition: background-color 0.3s;
}
.faq-list summary::before { /* the plus; it swaps to a minus through a short blur */
  content: ""; position: absolute; right: 0; top: 50%; width: 34px; height: 34px; margin-top: -17px;
  background: linear-gradient(var(--deep), var(--deep)) center / 12px var(--stroke-bold) no-repeat, linear-gradient(var(--deep), var(--deep)) center / var(--stroke-bold) 12px no-repeat;
  transition: background-size 0.3s var(--ease); animation: swap-closed 0.36s var(--ease);
}
.faq-list details[open] summary::after { background-color: var(--white); }
.faq-list details[open] summary::before { background-size: 12px var(--stroke-bold), var(--stroke-bold) 0; animation-name: swap-open; }
@keyframes swap-open { 45% { filter: blur(3px); opacity: 0.3; scale: 0.8; } }
@keyframes swap-closed { 45% { filter: blur(3px); opacity: 0.3; scale: 0.8; } }
.faq-list details p { max-width: 60ch; margin: 0; padding-bottom: 24px; color: var(--ink-soft); }
.faq-list details::details-content { block-size: 0; overflow: hidden; transition: block-size 0.45s var(--ease), content-visibility 0.45s allow-discrete; }
.faq-list details[open]::details-content { block-size: auto; }

/* ---- Closing ---- */
.closing { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(100px, 14vw, 180px); background: var(--abyss); color: var(--ice); text-align: center; }
.sweep-quiet { position: absolute; left: 0; right: 0; top: 50%; z-index: -1; height: 220px; transform: translateY(-50%); opacity: 0.3; }
.closing h2 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1; }
.closing p { margin: 18px 0 32px; font-size: 1.15rem; color: var(--on-dark); }
.closing .actions { justify-content: center; }

/* ---- Footer ---- */
footer { background: var(--abyss); border-top: 1px solid var(--line-dark); color: var(--on-dark); }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-block: 64px 32px; }
.footer-brand { display: flex; align-items: flex-start; gap: 14px; }
.footer-brand img { border-radius: 12px; background: var(--white); }
footer h2 { font-size: 1.3rem; color: var(--ice); }
footer h3 { margin-bottom: 14px; font-family: var(--body); font-weight: 700; font-size: 0.95rem; letter-spacing: 0; color: var(--sky); }
footer address { margin-top: 4px; font-style: normal; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
footer a { color: var(--on-dark); text-decoration: none; }
footer a:hover { color: var(--frost); text-decoration: underline; text-underline-offset: 4px; }
.legal { grid-column: 1 / -1; margin: 16px 0 0; padding-top: 24px; border-top: 1px solid var(--line-dark); font-size: 0.88rem; color: var(--on-dark-soft); }

/* ---- Motion: starting states, only while .anim is on <html> ---- */
.anim .hero h1 .line > span, .anim .lede, .anim .hero .actions, .anim .readout { opacity: 0; }
.anim [data-reveal] { transition: opacity 1s var(--ease), transform 1s var(--ease); }
.anim [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(28px); }
.anim .row:not(.is-in)::before { transform: scaleX(0); }
.anim .row:not(.is-in) > * { opacity: 0; transform: translateY(18px); }
.anim .tpanel:not(.is-in) .doc-sec.fill { background-color: transparent; }
.anim .tpanel:not(.is-in) .doc-sec.fill i { width: 0; }
.anim .tpanel:not(.is-in) .tick path { stroke-dashoffset: 1; }
.anim .tpanel:not(.is-in) .toggle { background-color: oklch(var(--deep-c) / 0.2); }
.anim .tpanel:not(.is-in) .toggle::after { left: 3px; }
.anim .tpanel:not(.is-in) .curve { stroke-dashoffset: 1; }
.anim .tpanel:not(.is-in) .refs li { opacity: 0; transform: translateY(14px); }
.anim .tpanel:not(.is-in) .cal span { opacity: 0; transform: scale(0.4); }
.anim .learn:not(.is-in) .right { background-color: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.anim .learn:not(.is-in) .right b { background-color: oklch(var(--deep-c) / 0.08); color: var(--deep); }
.anim .learn:not(.is-in) .explain { opacity: 0; transform: translateY(10px); }
.anim .learn:not(.is-in) .viz-ecg path { stroke-dashoffset: 1; }
.anim .flow:not(.is-in) .node { opacity: 0; transform: translateY(16px); }
.anim .flow:not(.is-in) .pipe { transform: scaleX(0); }
.anim .steps { --p: 0; }
.anim .steps li:not(.on) .num { background-color: var(--white); color: var(--deep); }
.anim .chips:not(.is-in) li { opacity: 0; transform: translateY(10px); }

/* ---- Smaller screens ---- */
@media (max-width: 899.98px) {
  .nav a:not(.btn) { display: none; }
  .readouts { grid-template-columns: repeat(2, 1fr); }
  .readout:nth-child(3) { padding-left: 0; border-left: 0; }
  .readout:nth-child(n + 3) { border-top: 1px solid var(--line-dark); }
  .ward-grid, .faq-grid, .data-grid, .learn-grid, .tpanel { grid-template-columns: minmax(0, 1fr); }
  .ward-side, .faq-side { position: static; }
  .ward-progress { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 759.98px) {
  .row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .flow { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; justify-items: start; gap: 0; }
  .node { max-width: none; width: 100%; }
  .node-app, .node-drive, .node-server, .pipe-drive, .pipe-server { grid-row: auto; grid-column: 1; }
  .node-server { margin-top: 0; }
  .pipe { width: 2px; height: 36px; margin: 6px 0 6px 28px; transform-origin: top; }
  .pipe-drive { background: repeating-linear-gradient(180deg, var(--marigold) 0 8px, transparent 8px 14px); animation-name: flow-down; }
  .pipe-server { order: 4; background: repeating-linear-gradient(180deg, oklch(var(--frost-c) / 0.4) 0 4px, transparent 4px 9px); }
  .node-server { order: 5; }
  .pipe::after { left: 50%; right: auto; top: auto; bottom: 0; transform: translateX(-50%) rotate(135deg); }
  .anim .flow:not(.is-in) .pipe { transform: scaleY(0); }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .steps li { display: grid; grid-template-columns: 46px 1fr; gap: 18px; align-items: center; }
  .num { margin: 0; }
  .steps::before, .steps::after { left: 22px; right: auto; top: 23px; bottom: 23px; width: 2px; height: auto; }
  .steps::after { transform-origin: top; transform: scaleY(var(--p)); }
}
@keyframes flow-down { to { background-position: 0 14px; } }
@media (max-width: 559.98px) {
  .header-inner { gap: 12px; }
  .brand { gap: 10px; white-space: nowrap; }
  .brand span { font-size: 0.98rem; }
  .brand img { width: 34px; height: 34px; }
  .nav .btn { padding: 0 16px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .caret, .pipe-drive { animation: none; }
  .btn, .nav a::after, .faq-list summary::after, .faq-list summary::before { transition: none; animation: none; }
}
