/* GR Health — v3 (2026-11-07). Pharma-corporate: white and mist grounds, deep navy, Golos Text. */

@font-face {
  font-family: "Golos";
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/golos-400.woff2") format("woff2");
}
@font-face {
  font-family: "Golos";
  font-weight: 500;
  font-display: swap;
  src: url("./assets/fonts/golos-500.woff2") format("woff2");
}
/* Metric-matched fallback so the swap does not shift layout (values from scripts/subset_fonts.py). */
@font-face {
  font-family: "Golos Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 107%;
  ascent-override: 91.5%;
  descent-override: 20.5%;
  line-gap-override: 0%;
}

:root {
  --paper: #ffffff;
  --mist: #f3f5f8;
  --mist-2: #e8ecf2;
  --rule: #d8dee7;
  --rule-strong: #aeb8c6;
  --ink: #1b2433;
  --ink-2: #536074;
  --navy: #13294b;
  --navy-hover: #1f3d6b;
  --navy-deep: #0d2342;
  --on-navy: #ffffff;
  --on-navy-2: #c3cede;
  --on-navy-rule: rgba(255, 255, 255, 0.16);
  --todo: #8a5a00;
  --todo-bg: #fff6e0;
  --error: #b42318;

  --font: "Golos", "Golos Fallback", sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);

  --gutter: clamp(20px, 3.4vw, 48px);
  --maxw: 1280px;
  --header: 76px;
  --section: clamp(72px, 8.5vw, 128px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 8px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

::selection { background: var(--navy); color: var(--on-navy); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 2px; }
input, textarea { caret-color: var(--navy); }

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

.skip-link {
  position: absolute; left: var(--gutter); top: -60px; z-index: 30;
  background: var(--navy); color: var(--on-navy); padding: 10px 14px; border-radius: 4px;
}
.skip-link:focus { top: 12px; }

/* ---------- type ---------- */

h1, h2, h3 { font-weight: 500; color: var(--navy); text-wrap: balance; }
h1 { font-size: clamp(40px, 4.7vw, 66px); line-height: 1.07; letter-spacing: -0.025em; }
h2 { font-size: clamp(30px, 2.9vw, 42px); line-height: 1.16; letter-spacing: -0.02em; }
h3 { font-size: 21px; line-height: 1.3; letter-spacing: -0.01em; }
.section-lead { color: var(--ink-2); font-size: clamp(17px, 1.25vw, 19px); line-height: 1.6; max-width: 34em; }

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

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 240ms var(--ease), box-shadow 240ms var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); box-shadow: 0 6px 20px -16px rgba(13, 35, 66, 0.35); }
.header-inner { display: flex; align-items: center; gap: 40px; height: var(--header); }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand-mark { width: 34px; height: 34px; color: var(--navy); flex: none; }
.brand-name { font-weight: 500; font-size: 20px; letter-spacing: -0.01em; white-space: nowrap; }

.nav { position: relative; display: flex; gap: 32px; margin-left: auto; }
.nav a {
  position: relative; display: block; padding: 26px 0; font-size: 15px; text-decoration: none; color: var(--ink);
  transition: color 160ms var(--ease);
}
.nav a:hover, .nav a.is-current { color: var(--navy); }
.nav-bar {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100px; background: var(--navy);
  transform-origin: left center; transform: translateX(var(--x, 0)) scaleX(var(--s, 0)); opacity: var(--o, 0);
  transition: transform 420ms var(--ease), opacity 200ms var(--ease);
}

.header-end { display: flex; align-items: center; gap: 16px; }

/* language: segmented control with a sliding thumb */
.lang {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  padding: 3px; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper);
}
.lang button {
  position: relative; z-index: 1; min-width: 38px; min-height: 30px; padding: 0 8px;
  border: 0; background: none; font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: var(--ink-2);
  transition: color 220ms var(--ease);
}
.lang button:hover { color: var(--navy); }
.lang button[aria-pressed="true"] { color: var(--on-navy); }
.lang-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 2px;
  background: var(--navy);
  transition: transform 380ms var(--ease);
}
html[lang="en"] .lang-thumb { transform: translateX(100%); }

.menu-button {
  display: none; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); font-size: 15px; color: var(--navy);
}
.menu-icon { position: relative; width: 16px; height: 10px; }
.menu-icon i { position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; border-radius: 1px; transition: transform 300ms var(--ease), top 300ms var(--ease); }
.menu-icon i:first-child { top: 1px; }
.menu-icon i:last-child { top: 7.5px; }
.menu-button[aria-expanded="true"] .menu-icon i:first-child { top: 4.25px; transform: rotate(45deg); }
.menu-button[aria-expanded="true"] .menu-icon i:last-child { top: 4.25px; transform: rotate(-45deg); }

/* ---------- buttons and links ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px; border: 1px solid var(--navy); border-radius: 4px;
  background: var(--navy); color: var(--on-navy); font-size: 16px; font-weight: 500; text-decoration: none;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease), color 200ms var(--ease), transform 160ms var(--ease);
}
.button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 260ms var(--ease); }
.button:hover { background: var(--navy-hover); border-color: var(--navy-hover); }
.button:hover svg { transform: translateX(3px); }
.button:active { transform: scale(0.97); }
.button-ghost { background: transparent; color: var(--navy); border-color: var(--rule-strong); }
.button-ghost:hover { background: var(--mist); border-color: var(--navy); }
.button-ghost:hover svg { transform: translateY(2px); }

.text-link {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--navy); text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; padding-bottom: 3px;
  transition: background-size 320ms var(--ease);
}
.text-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 260ms var(--ease); }
.text-link:hover { background-size: 100% 1px; }
.text-link:hover svg { transform: translateX(3px); }

.text-button {
  min-height: 44px; padding: 0; border: 0; background: none; color: var(--navy); font-size: 16px;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule-strong);
  transition: text-decoration-color 200ms var(--ease);
}
.text-button:hover { text-decoration-color: currentColor; }

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

.hero { background: var(--paper); padding-top: clamp(32px, 4vw, 56px); }
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px);
  align-items: center; min-height: min(680px, calc(100svh - var(--header) - 150px));
}
.hero-copy { display: grid; gap: 28px; align-content: center; padding-block: 24px; }
.hero h1 .hl { display: inline; }
.hero-lead { font-size: clamp(18px, 1.4vw, 20px); line-height: 1.6; color: var(--ink-2); max-width: 33em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 4px; }

.hero-figure {
  position: relative; align-self: stretch; min-height: 460px; max-height: 620px; overflow: clip;
  background: var(--mist); border: 1px solid var(--rule); border-radius: 2px;
}
.route-figure { position: absolute; inset: 0; width: 100%; height: 100%; }
.route-figure pattern path { fill: none; stroke: #c9d1dc; stroke-width: 1; }
.route-figure #grid-major path { stroke: #b4bfcd; }
.route-figure .grid.fine { opacity: 0.55; }
.route-figure .track { fill: none; stroke: var(--mist-2); stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; }
.route-figure .line { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.route-figure .gate .halo { fill: var(--mist); stroke: var(--rule-strong); stroke-width: 1; opacity: 0.9; }
.route-figure .gate .dot { fill: var(--navy); stroke: var(--navy); stroke-width: 2; }
.route-figure .runner { display: none; fill: var(--paper); stroke: var(--navy); stroke-width: 2.5; }
.route-figure .labels { font: 500 22px var(--font); fill: var(--navy); }
.route-figure .labels .n { fill: var(--ink-2); font-weight: 400; font-size: 18px; }
.route-figure text { paint-order: stroke; stroke: var(--mist); stroke-width: 10px; stroke-linejoin: round; }

.scope {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(40px, 5vw, 72px); border-top: 1px solid var(--rule);
}
.scope li { padding: 22px 24px 30px 0; font-size: 16px; color: var(--ink); display: flex; gap: 12px; align-items: baseline; }
.scope li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--navy); transform: translateY(-2px); }
.scope li + li { padding-left: 24px; border-left: 1px solid var(--rule); }

/* ---------- shared section layouts ---------- */

section { scroll-margin-top: calc(var(--header) + 8px); }
.services, .products, .approach, .about, .contact { padding-block: var(--section); }
.section-head { display: grid; gap: 16px; margin-bottom: clamp(36px, 4.5vw, 60px); max-width: 860px; }

.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.split-head { display: grid; gap: 18px; position: sticky; top: calc(var(--header) + 32px); }

/* ticks: short drawn dash, never a glyph */
.ticks { display: grid; gap: 10px; align-content: start; }
.ticks li { position: relative; padding-left: 22px; color: #36414f; font-size: 16px; line-height: 1.55; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 10px; height: 2px; background: var(--navy); }

/* collapsible lists: always open on desktop, toggled under 900px */
.row-toggle { display: none; }
.collapse { display: grid; grid-template-rows: 1fr; }
.collapse > * { min-height: 0; overflow: hidden; }

/* ---------- services ---------- */

.services { border-top: 1px solid var(--rule); }
.services-list { border-top: 1px solid var(--rule-strong); }
.service {
  display: grid; grid-template-columns: 104px minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: auto auto 1fr; gap: 12px 36px;
  padding: 32px 0 36px; border-bottom: 1px solid var(--rule);
}
.service-title { grid-column: 2 / -1; }
.service > p { grid-column: 2; color: var(--ink); }
.service .collapse { grid-column: 3; grid-row: 2 / span 2; }

/* ---------- route band ---------- */

.route-band { --panel: #122b50; background: var(--navy-deep); color: var(--on-navy); padding-block: var(--section); overflow-x: clip; }
.flow-rail { overflow: visible; }
.route-band h2 { color: var(--on-navy); }
.route-band .section-lead { color: var(--on-navy-2); }
.route-band :focus-visible { outline-color: var(--on-navy); }
.band-head { display: grid; gap: 16px; max-width: 860px; margin-bottom: clamp(44px, 5vw, 64px); }

.stages { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 4.5vw, 72px); align-items: start; }

/* stepper */
.stage-nav { display: grid; gap: 24px; justify-items: start; }
.stage-tabs { display: grid; width: 100%; border-top: 1px solid var(--on-navy-rule); }
.stage-tabs button {
  position: relative; display: grid; grid-template-columns: 19px auto 1fr; align-items: center; gap: 16px;
  width: 100%; padding: 22px 0; border: 0; border-bottom: 1px solid var(--on-navy-rule); background: none;
  text-align: left; color: var(--on-navy-2); transition: color 240ms var(--ease);
}
.stage-tabs button:hover, .stage-tabs [aria-selected="true"] { color: var(--on-navy); }
.stage-tabs .gate {
  position: relative; z-index: 1; width: 19px; height: 19px; border-radius: 50%;
  border: 1.5px solid var(--on-navy-2); background: var(--navy-deep);
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease), box-shadow 400ms var(--ease);
}
.stage-tabs button::after {
  content: ""; position: absolute; left: 9px; top: calc(50% + 10px); height: calc(100% - 20px); width: 1px; background: var(--on-navy-rule);
}
.stage-tabs button:last-child::after { display: none; }
.stage-tabs .is-passed .gate { border-color: var(--on-navy); background: var(--on-navy); }
.stage-tabs [aria-selected="true"] .gate { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12); }
.stage-num { font-size: 14px; font-variant-numeric: tabular-nums; }
.stage-name { font-size: clamp(18px, 1.5vw, 21px); font-weight: 500; }
.stage-timer {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--on-navy);
  transform-origin: left center; transform: scaleX(0);
}

.autoplay {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 10px;
  border: 1px solid var(--on-navy-rule); border-radius: 3px; background: none; color: var(--on-navy-2); font-size: 14px;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.autoplay:hover { color: var(--on-navy); border-color: rgba(255, 255, 255, 0.4); }
.autoplay svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.autoplay .i-play { display: none; fill: currentColor; stroke-width: 1; }
.autoplay.is-off .i-pause { display: none; }
.autoplay.is-off .i-play { display: block; }

/* detail panel */
.stage-panels { display: grid; }
.stage {
  display: grid; gap: 40px; padding: clamp(28px, 3.2vw, 48px);
  background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 4px;
}
.js .stage { grid-area: 1 / 1; visibility: hidden; opacity: 0; }
.js .stage.is-active { visibility: visible; opacity: 1; }
.stage-panels > .stage + .stage { margin-top: 16px; }
.js .stage-panels > .stage + .stage { margin-top: 0; }

.stage-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; }
.stage-heading { display: grid; gap: 6px; }
.stage-count {
  overflow: hidden; height: 1em; font-size: clamp(64px, 6.4vw, 96px); line-height: 1; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums; color: var(--on-navy-2);
}
.stage-count span { display: block; }
.stage-title { color: var(--on-navy); font-size: clamp(26px, 2.4vw, 34px); line-height: 1.15; letter-spacing: -0.02em; }
.stage-title .w { display: inline-block; }
.illo-stage { width: clamp(150px, 15vw, 210px); height: auto; }

.flow { position: relative; }
.flow-rail { position: absolute; left: 0; top: 4px; width: 66.666%; height: 2px; background: rgba(255, 255, 255, 0.14); }
.flow-fill { position: absolute; inset: 0; background: var(--on-navy); transform-origin: left center; }
.flow-run { position: absolute; inset: 0; }
.flow-run i {
  position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--on-navy); box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.14); opacity: 0;
}
.flow dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flow dl > div { position: relative; display: grid; gap: 8px; align-content: start; padding: 28px 28px 0 0; }
.flow dl > div::before {
  content: ""; position: absolute; left: 0; top: 0; width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--on-navy); background: var(--on-navy); box-sizing: border-box;
}
.stage dt { font-size: 14px; color: var(--on-navy-2); }
.stage dd { font-size: clamp(17px, 1.3vw, 19px); line-height: 1.45; }

/* drawings on navy */
.route-band .illo { stroke: var(--on-navy); }
.route-band .illo .f1 { fill: var(--panel); }
.route-band .illo .f2 { fill: #1d3a66; }
.route-band .illo .fn { fill: var(--on-navy); }
.route-band .illo .thin { stroke: var(--on-navy-2); }
.route-band .illo .heavy { stroke-width: 4; }
.route-band .illo text { fill: var(--on-navy); }
.route-band .illo .inv-t { fill: var(--navy-deep); }
.route-band .illo .fn-s { stroke: var(--on-navy); }

/* ---------- products ---------- */

.products { background: var(--mist); }
.product-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto auto auto; border-top: 1px solid var(--rule-strong); }
.product { display: grid; grid-row: span 4; grid-template-rows: subgrid; gap: 14px; align-content: start; padding: 32px 32px 8px; border-left: 1px solid var(--rule); }
.product:first-child { padding-left: 0; border-left: 0; }
.product:last-child { padding-right: 0; }
.product-reg { color: var(--ink-2); font-size: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }

/* ---------- approach ---------- */

.approach { border-bottom: 1px solid var(--rule); }
.about { padding-bottom: calc(var(--section) * 0.6); }
.contact { padding-top: calc(var(--section) * 0.6); }
.contact-grid { padding-top: calc(var(--section) * 0.6); border-top: 1px solid var(--rule); }
.approach-body { display: grid; gap: 28px; justify-items: start; }
.approach-text { font-size: clamp(21px, 1.7vw, 24px); line-height: 1.5; color: var(--navy); letter-spacing: -0.01em; max-width: 30em; }

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

.facts { border-top: 1px solid var(--rule-strong); }
.facts > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-2); }

.todo {
  display: inline-block; padding: 1px 8px; border: 1px dashed var(--todo); border-radius: 3px;
  background: var(--todo-bg); color: var(--todo); font-size: 14px;
}

/* ---------- contact + brief ---------- */

.contact { background: var(--paper); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.contact-info { display: grid; gap: 36px; }
.contact-list > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* brief assistant: a scripted, local chat (nothing is sent) */
.chat {
  display: grid; grid-template-rows: auto auto 1fr auto; overflow: clip;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 28px 56px -36px rgba(13, 35, 66, 0.45), 0 2px 6px -2px rgba(13, 35, 66, 0.06);
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 14px; }
.chat-head .brand-mark { width: 36px; height: 36px; }
.chat-id { display: grid; gap: 2px; min-width: 0; }
.chat-id h3 { font-size: 17px; line-height: 1.3; }
.chat-sub { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.chat-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--navy); flex: none; }
.motion .chat-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--navy);
  animation: dot-ping 2.4s var(--ease) infinite;
}
@keyframes dot-ping { from { transform: scale(0.5); opacity: 0.7; } 70%, to { transform: scale(1.4); opacity: 0; } }
.chat-restart {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 18px; background: var(--paper); color: var(--navy); font-size: 14px;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}
.chat-restart:hover { border-color: var(--navy); background: var(--mist); }
.chat-restart svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 500ms var(--ease); }
.chat-restart:hover svg { transform: rotate(-200deg); }

.chat-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 20px 14px; border-bottom: 1px solid var(--rule); }
.chat-progress i { height: 3px; border-radius: 2px; background: var(--mist-2); position: relative; overflow: hidden; }
.chat-progress i::after {
  content: ""; position: absolute; inset: 0; background: var(--navy); transform-origin: left center; transform: scaleX(0);
  transition: transform 600ms var(--ease);
}
.chat-progress i.is-done::after { transform: scaleX(1); }

.chat-log {
  display: flex; flex-direction: column; gap: 12px; padding: 24px 20px;
  min-height: 360px; max-height: 480px; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth;
  background: var(--mist); scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent;
}
.msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: end; max-width: min(92%, 560px); }
.msg .avatar { width: 30px; height: 30px; color: var(--navy); }
.msg .avatar .brand-mark { width: 30px; height: 30px; }
.msg-bot:has(+ .msg-bot) .avatar { visibility: hidden; }
.bubble {
  padding: 11px 15px; border-radius: 16px 16px 16px 4px; background: var(--paper); border: 1px solid var(--rule);
  font-size: 16px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere;
}
.msg-ref .bubble { background: #e6ebf3; border-color: transparent; }
.ref-label { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: var(--navy); }
.ref-label svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.msg-user { align-self: flex-end; grid-template-columns: minmax(0, 1fr); max-width: min(82%, 460px); }
.msg-user .bubble { background: var(--navy); border-color: var(--navy); color: var(--on-navy); border-radius: 16px 16px 4px 16px; white-space: pre-wrap; }
.msg-user.is-skip .bubble { background: transparent; color: var(--ink-2); border-color: var(--rule-strong); border-style: dashed; }

.typing { display: inline-flex; gap: 5px; padding: 15px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); opacity: 0.35; }
.motion .typing i { animation: typing 1.1s var(--ease) infinite; }
.motion .typing i:nth-child(2) { animation-delay: 140ms; }
.motion .typing i:nth-child(3) { animation-delay: 280ms; }
@keyframes typing { 30% { opacity: 1; transform: translateY(-3px); } 60% { opacity: 0.35; transform: none; } }

/* the finished brief, as a document inside the conversation */
.msg-brief { max-width: 100%; width: 100%; }
.brief-doc { padding: 0; overflow: hidden; border-radius: 16px 16px 16px 4px; }
.brief-doc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.brief-doc-head strong { font-weight: 500; color: var(--navy); }
.brief-doc-head span { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.brief-doc dl { display: grid; padding: 4px 18px; }
.brief-doc dl > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.brief-doc dl > div:last-child { border-bottom: 0; }
.brief-doc dt { font-size: 14px; color: var(--ink-2); }
.brief-doc dd { font-size: 15px; white-space: pre-wrap; }
.brief-doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 14px 18px; background: var(--mist); border-top: 1px solid var(--rule); }
.brief-doc-actions .button { min-height: 42px; padding: 0 18px; font-size: 15px; }
.brief-status { flex-basis: 100%; font-size: 14px; color: var(--ink-2); min-height: 1.4em; }
.brief-status:empty { display: none; }

/* dock: quick replies and composer */
.chat-dock { display: grid; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--rule); background: var(--paper); }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-chips:empty { display: none; }
.chip {
  min-height: 40px; padding: 0 16px; border: 1px solid var(--rule-strong); border-radius: 20px; background: var(--paper);
  color: var(--navy); font-size: 15px; text-align: left;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 160ms var(--ease);
}
.chip:hover { border-color: var(--navy); background: var(--mist); }
.chip:active { transform: scale(0.97); }
.chip-ghost { border-style: dashed; color: var(--ink-2); }
.chat-form { display: flex; align-items: flex-end; gap: 8px; }
.chat-input {
  flex: 1; min-height: 48px; max-height: 140px; padding: 12px 18px; resize: none; overflow-y: auto;
  border: 1px solid var(--rule-strong); border-radius: 24px; background: var(--paper);
  font-size: 16px; line-height: 1.45; color: var(--ink);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.chat-input::placeholder { color: #6b7688; }
.chat-input:hover { border-color: var(--ink-2); }
.chat-input:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(19, 41, 75, 0.14); }
.chat-input[aria-invalid="true"] { border-color: var(--error); }
.chat-send {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: var(--navy); color: var(--on-navy); transition: background-color 180ms var(--ease), transform 160ms var(--ease), opacity 180ms var(--ease);
}
.chat-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-send:hover { background: var(--navy-hover); }
.chat-send:active { transform: scale(0.94); }
.chat-send.is-empty { opacity: 0.35; }
.chat-error { font-size: 14px; color: var(--error); }
.chat-error:empty { display: none; }

.chat-nojs { padding: 24px 20px; color: var(--ink-2); }
.js .chat-nojs { display: none; }
html:not(.js) .chat-log { display: none; }

/* entrances (motion only) */
.motion .msg.is-new { animation: msg-in 460ms var(--ease) both; }
.motion .msg-user.is-new { transform-origin: right bottom; animation-name: msg-in-user; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }
@keyframes msg-in-user { from { opacity: 0; transform: translateY(6px) scale(0.96); } }
.motion .stream .sw { animation: sw-in 360ms var(--ease) calc(var(--i) * 26ms) both; }
@keyframes sw-in { from { opacity: 0; filter: blur(3px); } }
.motion .chip.is-new { animation: chip-in 420ms var(--ease) calc(var(--i) * 55ms) both; }
@keyframes chip-in { from { opacity: 0; transform: translateY(6px); } }

/* copy button: icon morphs copy → check */
.copy-icons { position: relative; width: 16px; height: 16px; }
.copy-icons svg { position: absolute; inset: 0; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: opacity 200ms var(--ease), transform 300ms var(--ease); }
.copy-icons .i-check { opacity: 0; transform: scale(0.6); }
.copy-button.is-copied .i-copy { opacity: 0; transform: scale(0.6); }
.copy-button.is-copied .i-check { opacity: 1; transform: none; }
.button.copy-button:hover svg { transform: none; }

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

.site-footer { background: var(--navy-deep); color: var(--on-navy-2); font-size: 15px; }
.footer-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 3fr); gap: 40px;
  padding-top: clamp(56px, 6vw, 80px);
}
.footer-brand { display: grid; gap: 20px; align-content: start; }
.site-footer .brand, .site-footer .brand-mark { color: var(--on-navy); }
.footer-nav { display: grid; gap: 10px; align-content: start; }
.footer-nav a, .footer-contact p { color: var(--on-navy); text-decoration: none; width: fit-content; }
.footer-nav a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 320ms var(--ease); }
.footer-nav a:hover { background-size: 100% 1px; }
.footer-contact { display: grid; gap: 10px; align-content: start; }
.footer-base {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  margin-top: 24px; padding: 24px 0 32px; border-top: 1px solid var(--on-navy-rule);
}
.todo-dark { background: transparent; border-color: #d9a441; color: #f0c674; }

/* ---------- illustrations: navy hairline technical drawings ---------- */

.illo { display: block; overflow: visible; fill: none; stroke: var(--navy); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.illo .f1 { fill: var(--paper); }
.illo .f2 { fill: var(--mist-2); }
.illo .fn { fill: var(--navy); }
.illo .nos { stroke: none; }
.illo .thin { stroke: var(--ink-2); stroke-width: 1; }
.illo .inv { stroke: var(--paper); stroke-width: 1.75; }
.illo .fn-s { stroke-width: 2.5; }
.illo text { stroke: none; fill: var(--navy); font: 500 11px var(--font); text-anchor: middle; }
.illo .inv-t { fill: var(--paper); }
.illo .grid-fill { opacity: 0.6; }
.illo pattern path { fill: none; stroke: var(--mist-2); stroke-width: 1; }
.illo .halo-m { fill: none; stroke: var(--rule-strong); stroke-width: 1; }
.illo .map-lbl { font: 400 14px var(--font); fill: var(--ink); }

.illo-svc { width: 104px; height: auto; grid-row: 1 / span 3; margin-top: 4px; }
.illo-prod { width: 100%; max-width: 320px; height: auto; margin-bottom: 8px; }
.illo-side { width: 100%; max-width: 300px; height: auto; margin-top: 28px; }
.illo-map { max-width: 360px; }

/* draw-on: set up by core.js only for drawings still below the fold */
.illo.to-draw .ln { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.illo.to-draw .f1, .illo.to-draw .f2, .illo.to-draw .fn, .illo.to-draw .grid-fill { fill-opacity: 0; }
.illo.to-draw text { opacity: 0; }
.illo.drawing .grid-fill, .illo.drawing .nos { transition: fill-opacity 700ms var(--ease) 650ms; }
.illo.drawing .ln {
  transition: stroke-dashoffset 1300ms cubic-bezier(0.45, 0, 0.25, 1) calc(var(--k, 0) * 45ms),
              fill-opacity 700ms var(--ease) calc(650ms + var(--k, 0) * 45ms);
}
.illo.drawing text { transition: opacity 600ms var(--ease) 900ms; }

/* ---------- motion (only with prefers-reduced-motion: no-preference) ---------- */

/* hero: one orchestrated entrance, then the route draws itself once */
.motion .enter { animation: enter 900ms var(--ease) both; }
.motion .hero-lead.enter { animation-delay: 90ms; }
.motion .hero-actions.enter { animation-delay: 180ms; }
.motion .scope.enter { animation-delay: 320ms; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } }

.motion .route-figure { --lead: 0.5s; --draw: 2.6s; }
.motion .route-figure .line { stroke-dasharray: 1 1; animation: draw var(--draw) var(--lead) cubic-bezier(0.45, 0, 0.25, 1) both; }
.motion .route-figure .gate .dot { animation: gate-on 480ms calc(var(--lead) + var(--at) * var(--draw)) var(--ease) both; }
.motion .route-figure .gate .halo { transform-box: fill-box; transform-origin: center; animation: halo 900ms calc(var(--lead) + var(--at) * var(--draw)) var(--ease) both; }
.motion .route-figure .labels text { animation: label-in 600ms calc(var(--lead) + var(--at) * var(--draw) + 80ms) var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes gate-on { from { fill: var(--mist); } }
@keyframes halo { from { transform: scale(0.4); opacity: 0; } }
@keyframes label-in { from { opacity: 0; } }
.motion .route-figure.has-runner .runner { display: block; }

/* section reveals: content is visible by default; .pending is set by JS only for off-screen blocks */
.reveal.pending { opacity: 0; transform: translateY(16px); }
.reveal { transition: opacity 800ms var(--ease) var(--d, 0ms), transform 800ms var(--ease) var(--d, 0ms); }

/* route panel cross-fade */
.motion .stage { transition: opacity 260ms var(--ease), visibility 0s linear 260ms; }
.motion .stage.is-active { transition: opacity 420ms var(--ease) 60ms, visibility 0s; }

/* route band: autoplay timer under the active step */
.motion .stages.autoplaying .stage-tabs [aria-selected="true"] .stage-timer { animation: timer var(--dwell, 7s) linear both; }
.motion .stages.autoplaying.is-held .stage-timer { animation-play-state: paused; }
@keyframes timer { to { transform: scaleX(1); } }

/* route band: panel choreography, replayed every time a stage becomes active */
.motion .stage.is-active .stage-count span { animation: count-in 760ms var(--ease) both; }
.motion .stage-panels[data-dir="back"] .stage.is-active .stage-count span { animation-name: count-in-back; }
@keyframes count-in { from { transform: translateY(100%); } }
@keyframes count-in-back { from { transform: translateY(-100%); } }
.motion .stage.is-active .stage-title .w { animation: word-in 640ms var(--ease) calc(120ms + var(--w, 0) * 70ms) both; }
@keyframes word-in { from { opacity: 0; transform: translateY(12px); filter: blur(8px); } }
.motion .stage.is-active .flow-fill { animation: flow-fill 1100ms cubic-bezier(0.45, 0, 0.25, 1) 320ms both; }
@keyframes flow-fill { from { transform: scaleX(0); } }
.motion .stage.is-active .flow-run { animation: flow-run 1100ms cubic-bezier(0.45, 0, 0.25, 1) 320ms both; }
.motion .stage.is-active .flow-run i { animation: flow-dot 1300ms linear 320ms both; }
@keyframes flow-run { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes flow-dot { 0% { opacity: 0; } 8%, 85% { opacity: 1; } 100% { opacity: 0; } }
.motion .stage.is-active .flow dl > div { animation: step-in 560ms var(--ease) both; }
.motion .stage.is-active .flow dl > div::before { animation: node-on 400ms var(--ease) both; }
.motion .stage.is-active .flow dl > div:nth-child(1), .motion .stage.is-active .flow dl > div:nth-child(1)::before { animation-delay: 300ms; }
.motion .stage.is-active .flow dl > div:nth-child(2), .motion .stage.is-active .flow dl > div:nth-child(2)::before { animation-delay: 870ms; }
.motion .stage.is-active .flow dl > div:nth-child(3), .motion .stage.is-active .flow dl > div:nth-child(3)::before { animation-delay: 1420ms; }
@keyframes step-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes node-on { from { background: var(--panel); transform: scale(0.6); } }

/* collapses animate height */
.motion .collapse { transition: grid-template-rows 420ms var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-delay: 0ms !important; }
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .nav { gap: 22px; }
  .header-inner { gap: 24px; }
}

@media (max-width: 900px) {
  :root { --header: 64px; }

  .menu-button { display: inline-flex; }
  .header-inner { gap: 12px; }
  .brand { margin-right: auto; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%; display: grid; gap: 0; margin: 0;
    padding: 8px var(--gutter) 20px; background: var(--paper); border-bottom: 1px solid var(--rule);
    box-shadow: 0 16px 24px -20px rgba(13, 35, 66, 0.4);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 240ms var(--ease), transform 300ms var(--ease), visibility 0s linear 300ms;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity 240ms var(--ease), transform 300ms var(--ease), visibility 0s; }
  .nav a { padding: 14px 0; font-size: 18px; border-bottom: 1px solid var(--rule); }
  .nav a:last-of-type { border-bottom: 0; }
  .nav-bar { display: none; }

  .hero { padding-top: 24px; }
  .hero-inner { grid-template-columns: 1fr; min-height: 0; gap: 28px; }
  .hero-copy { padding-block: 8px 0; gap: 22px; }
  h1 { font-size: clamp(34px, 9.4vw, 44px); }
  .hero-figure { min-height: 0; height: 52svh; max-height: 440px; }
  .hero-actions { gap: 10px; }
  .route-figure .labels { font-size: 24px; }
  .route-figure .labels .n { font-size: 20px; }
  .scope { grid-template-columns: 1fr; margin-top: 32px; }
  .scope li { padding: 16px 0; }
  .scope li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }

  .split, .contact-grid { grid-template-columns: 1fr; }
  .split-head { position: static; }

  .service { grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: none; gap: 10px 18px; padding: 26px 0 22px; }
  .illo-svc { width: 64px; grid-row: 1 / span 2; margin-top: 2px; }
  .service-title, .service > p, .service .row-toggle, .service .collapse { grid-column: 2; grid-row: auto; }
  .illo-side { max-width: 260px; margin-top: 8px; }
  .illo-prod { max-width: 280px; }

  .row-toggle {
    display: inline-flex; align-items: center; gap: 8px; justify-self: start; min-height: 40px; padding: 0;
    border: 0; background: none; color: var(--navy); font-size: 15px; font-weight: 500;
  }
  .row-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 320ms var(--ease); }
  .row-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .js [data-toggle-row] .collapse { grid-template-rows: 0fr; }
  .js [data-toggle-row] .row-toggle[aria-expanded="true"] + .collapse { grid-template-rows: 1fr; }
  .collapse .ticks { padding-top: 4px; }

  .stages { grid-template-columns: 1fr; gap: 28px; }
  .stage-tabs button { padding: 16px 0; }
  .stage-top { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .illo-stage { width: 112px; }
  .stage-count { font-size: 56px; }
  .flow-rail { display: none; }
  .flow dl { grid-template-columns: 1fr; gap: 22px; }
  .flow dl > div { padding: 0 0 0 26px; }
  .flow dl > div::before { top: 5px; }
  .flow dl > div:not(:last-child)::after { content: ""; position: absolute; left: 4.5px; top: 19px; bottom: -18px; width: 1px; background: rgba(255, 255, 255, 0.2); }
  .contact-grid { gap: 48px; }

  .product-cols { grid-template-columns: 1fr; grid-template-rows: none; }
  .product { grid-row: auto; grid-template-rows: none; padding: 28px 0 20px; border-left: 0; }
  .product + .product { border-top: 1px solid var(--rule); }
  .product-reg { padding-bottom: 0; border-bottom: 0; }

  .facts > div { grid-template-columns: 1fr; gap: 4px; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .hero-actions .button { flex: 1 1 100%; }
  .chat { margin-inline: calc(var(--gutter) * -0.5); border-radius: 6px; }
  .chat-head { padding: 14px 14px 12px; }
  .chat-progress { padding: 0 14px 12px; }
  .chat-restart span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .chat-restart { padding: 0; width: 36px; justify-content: center; }
  .chat-log { padding: 18px 12px; min-height: 340px; max-height: none; }
  .chat-dock { padding: 12px; position: sticky; bottom: 0; }
  .msg { max-width: 100%; }
  .msg-user { max-width: 86%; }
  .brief-doc dl > div { grid-template-columns: 1fr; gap: 2px; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .brand-name { font-size: 18px; }
  .brand-mark { width: 30px; height: 30px; }
  .menu-button { padding: 0 12px; }
  .menu-button [data-i18n] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
