/* QRST website v2 — Apple-clarity layout, Lusion-style motion.
   Tokens first; every colour in components comes from these. */
:root {
  --white: #ffffff;
  --grey: #f5f5f7;
  --grey-2: #e8e8ed;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --black: #000000;
  --night: #05070c;
  --on-dark: #f5f5f7;
  --on-dark-muted: #a1a1a6;

  --teal: #0ba8b8;
  --sky: #009fe1;
  --royal: #1a5ca8;
  --link: #0a6fc2;          /* 4.9:1 on white */
  --link-dark: #4cb6ff;     /* 7.6:1 on black */
  --brand-grad: linear-gradient(100deg, #0ba8b8 0%, #009fe1 55%, #1a5ca8 100%);
  --focus: #009fe1;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --gutter: max(22px, env(safe-area-inset-left));
  --nav-h: 52px;
  --lnav-h: 52px;
  --z-nav: 40;
  --z-menu: 60;
  --z-modal: 80;
  --z-curtain: 90;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + var(--lnav-h) + 12px); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font: 400 17px/1.47 var(--font); letter-spacing: -.022em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; overflow-x: clip;
}
img, video, svg, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .18em; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul[role="list"], .plain { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; }
.skip:focus { top: 12px; }

/* ───────── Type ───────── */
.eyebrow { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--muted); margin-bottom: 10px; }
.eyebrow--brand { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.h-hero { font-size: clamp(48px, 8.4vw, 112px); line-height: 1.02; font-weight: 600; letter-spacing: -.035em; }
.h-1 { font-size: clamp(40px, 6vw, 80px); line-height: 1.05; font-weight: 600; letter-spacing: -.03em; }
.h-2 { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.07; font-weight: 600; letter-spacing: -.028em; }
.h-3 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.13; font-weight: 600; letter-spacing: -.02em; }
.h-4 { font-size: 21px; line-height: 1.2; font-weight: 600; letter-spacing: -.016em; }
.lead { font-size: clamp(19px, 1.9vw, 24px); line-height: 1.38; font-weight: 400; color: var(--muted); letter-spacing: -.016em; }
.lead strong, .lead b { color: var(--ink); font-weight: 600; }
.small { font-size: 14px; line-height: 1.43; color: var(--muted); letter-spacing: -.01em; }
.grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; margin-right: -.06em; }
.center { text-align: center; }
.balance { text-wrap: balance; }
.measure { max-width: 34ch; }
.measure-l { max-width: 52ch; }
.mx-auto { margin-inline: auto; }
.stack > * + * { margin-top: var(--stack, 18px); }

/* ───────── Layout ───────── */
.wrap { width: min(100% - var(--gutter) * 2, 1080px); margin-inline: auto; }
.wrap--wide { width: min(100% - var(--gutter) * 2, 1440px); }
.wrap--narrow { width: min(100% - var(--gutter) * 2, 760px); }
.sec { padding-block: clamp(84px, 11vw, 160px); position: relative; }
.sec--tight { padding-block: clamp(56px, 7vw, 96px); }
.sec--white { background: var(--white); }
.sec--grey { background: var(--grey); }
.sec--dark { background: var(--black); color: var(--on-dark); }
.sec--night { background: var(--night); color: var(--on-dark); }
.sec--dark .lead, .sec--night .lead, .sec--dark .small, .sec--night .small, .sec--dark .eyebrow, .sec--night .eyebrow { color: var(--on-dark-muted); }
.sec--dark .lead strong, .sec--night .lead strong { color: var(--on-dark); }
.sec--dark a:not(.btn), .sec--night a:not(.btn) { color: var(--link-dark); }
.sec__head { margin-bottom: clamp(40px, 6vw, 80px); }
.sec__head.center .lead { margin-inline: auto; }
.grid-2 { display: grid; gap: clamp(16px, 2vw, 24px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: clamp(16px, 2vw, 24px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: clamp(16px, 2vw, 20px); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.split--media-l > :first-child { order: 0; }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4, .split { grid-template-columns: 1fr; }
  .grid-4.center { grid-template-columns: 1fr 1fr; row-gap: 32px; } /* highlight numbers: 2×2 on phones */
  .split > .split__media { order: -1; }
}

/* ───────── Buttons + links ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font-size: 17px; font-weight: 500; letter-spacing: -.016em; text-decoration: none !important; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--link); color: #fff; }
.btn--primary:hover { background: #075fa6; }
.btn--ghost { border-color: var(--link); color: var(--link); background: transparent; }
.btn--ghost:hover { background: var(--link); color: #fff; }
.btn--light { background: var(--on-dark); color: var(--ink); }
.btn--light:hover { background: #fff; }
.sec--dark .btn--ghost, .sec--night .btn--ghost, .on-dark .btn--ghost { border-color: var(--link-dark); color: var(--link-dark); }
.sec--dark .btn--ghost:hover, .sec--night .btn--ghost:hover, .on-dark .btn--ghost:hover { background: var(--link-dark); color: #001224; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; }
.center .btn-row, .btn-row.center { justify-content: center; }
.more { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 19px; letter-spacing: -.016em; }
.more::after { content: "›"; font-size: 1.15em; line-height: 1; transform: translateY(-1px); transition: transform .25s var(--ease); }
.more:hover::after { transform: translate(3px, -1px); }

/* ───────── Global nav ───────── */
.gnav {
  position: sticky; top: 0; z-index: var(--z-nav); height: var(--nav-h);
  background: rgba(251, 251, 253, .8); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .08); transition: background-color .4s, border-color .4s, color .4s;
}
.gnav__inner { height: 100%; width: min(100% - var(--gutter) * 2, 1240px); margin-inline: auto; display: flex; align-items: center; gap: 20px; }
.gnav__logo { flex: none; display: flex; align-items: center; min-height: 44px; }
.gnav__logo img { height: 28px; width: auto; }
.gnav__links { display: flex; align-items: center; gap: clamp(10px, 1.5vw, 26px); margin: 0 auto; padding: 0; list-style: none; }
.gnav__link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; letter-spacing: -.01em; color: var(--ink); opacity: .82; white-space: nowrap; transition: opacity .2s; }
.gnav__link:hover { opacity: 1; text-decoration: none; }
.gnav__link[aria-current="page"] { opacity: 1; font-weight: 600; }
.gnav__cta { flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 999px; background: var(--link); color: #fff; font-size: 13px; font-weight: 500; letter-spacing: -.01em; }
.gnav__cta:hover { background: #075fa6; text-decoration: none; }
.gnav__burger { display: none; position: relative; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; cursor: pointer; }
.gnav__burger i { position: absolute; left: 14px; width: 16px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease), top .3s var(--ease); }
.gnav__burger i:first-of-type { top: 18px; } .gnav__burger i:last-of-type { top: 25px; }
.menu-open .gnav__burger i:first-of-type { top: 21.5px; transform: rotate(45deg); }
.menu-open .gnav__burger i:last-of-type { top: 21.5px; transform: rotate(-45deg); }
.gnav.is-dark { background: rgba(10, 10, 12, .72); border-color: rgba(255, 255, 255, .1); color: var(--on-dark); }
.gnav.is-dark .gnav__link { color: var(--on-dark); }
.gnav.is-dark .gnav__logo img { filter: brightness(0) invert(1); }
@media (max-width: 1080px) {
  .gnav__links { display: none; }
  .gnav__cta { margin-left: auto; }
  .gnav__burger { display: block; }
}

.menu {
  position: fixed; inset: var(--nav-h) 0 0; z-index: var(--z-menu); overflow-y: auto; overscroll-behavior: contain;
  padding: 24px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  background: rgba(251, 251, 253, .97); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  opacity: 0; transition: opacity .3s var(--ease);
}
.menu[hidden] { display: none; }
.menu.is-open { opacity: 1; }
.menu-open { overflow: hidden; }
.menu-open .gnav { z-index: calc(var(--z-menu) + 1); }
.menu__list { list-style: none; padding: 0; margin: 0 0 28px; }
.menu__link { display: flex; align-items: center; min-height: 52px; font-size: clamp(24px, 6vw, 32px); font-weight: 600; letter-spacing: -.02em; color: var(--ink); border-bottom: 1px solid var(--grey-2); }
.menu__link[aria-current="page"] { color: var(--link); }
.menu__link:hover { text-decoration: none; color: var(--link); }
.menu.is-open .menu__list li { animation: menuIn .5s var(--ease) both; }
.menu.is-open .menu__list li:nth-child(n) { animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-8px); } }

/* Local (product) nav — Apple's sticky sub-bar */
.lnav { position: sticky; top: var(--nav-h); z-index: calc(var(--z-nav) - 1); height: var(--lnav-h); background: rgba(251, 251, 253, .8); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(0, 0, 0, .08); }
.lnav__inner { height: 100%; width: min(100% - var(--gutter) * 2, 1240px); margin-inline: auto; display: flex; align-items: center; gap: 22px; }
.lnav__title { font-size: 21px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.lnav__links { display: flex; gap: 22px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.lnav__links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--ink); opacity: .78; }
.lnav__links a:hover, .lnav__links a.is-current { opacity: 1; text-decoration: none; }
.lnav__cta { display: inline-flex; align-items: center; min-height: 30px; padding: 0 14px; border-radius: 999px; background: var(--link); color: #fff !important; font-size: 13px; font-weight: 500; white-space: nowrap; }
.lnav__cta:hover { background: #075fa6; text-decoration: none; }
@media (max-width: 760px) { .lnav__links { display: none; } .lnav__cta { margin-left: auto; } .lnav__title { font-size: 19px; } }

/* Persistent Contact now (phones / when the nav CTA scrolls away) */
.fab {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: var(--z-nav);
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--link); color: #fff; font-weight: 500; font-size: 16px; box-shadow: 0 12px 30px -10px rgba(10, 111, 194, .6);
  transform: translateY(140%); opacity: 0; transition: transform .45s var(--ease), opacity .3s;
}
.fab:hover { text-decoration: none; background: #075fa6; }
.fab.is-shown { transform: none; opacity: 1; }
.menu-open .fab, [data-page="contact"] .fab { display: none; }

/* ───────── Hero (WebGL field) ───────── */
.hero { position: relative; min-height: calc(100vh - var(--nav-h)); min-height: calc(100svh - var(--nav-h)); display: grid; place-items: center; overflow: hidden; background: var(--night); color: var(--on-dark); isolation: isolate; }
.hero__canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero__fallback { position: absolute; inset: 0; z-index: -2; background: radial-gradient(60% 50% at 50% 60%, rgba(0, 159, 225, .25), transparent 70%), var(--night); }
.hero__inner { padding: 96px var(--gutter) 120px; text-align: center; }
.hero__kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 24px; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); font-size: 14px; font-weight: 500; letter-spacing: .02em; color: var(--on-dark); }
.hero__kicker b { color: var(--link-dark); font-weight: 600; }
.hero .lead { color: var(--on-dark-muted); margin: 26px auto 36px; max-width: 30ch; }
.hero__hint { position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .55); white-space: nowrap; }
.hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .hint-mouse { display: none; } .hint-touch { display: inline; } }

/* ───────── Media frames ───────── */
.media { position: relative; overflow: hidden; border-radius: var(--r-lg); background: #0b0f17; isolation: isolate; }
.media > img, .media > video { width: 100%; height: 100%; object-fit: cover; }
.media--wide { aspect-ratio: 16 / 9; }
.media--tall { aspect-ratio: 4 / 5; }
.media--square { aspect-ratio: 1; }
.media--cine { aspect-ratio: 21 / 9; }
.media--cine.media--full { aspect-ratio: 16 / 9; }
@media (max-width: 760px) { .media--cine, .media--cine.media--full { aspect-ratio: 4 / 5; } }
.media__tag { position: absolute; left: 16px; bottom: 16px; z-index: 1; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; font-weight: 500; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.bleed { width: 100%; }
/* product shot on its own white background, staged on grey with room around it */
.media--stage { background: var(--grey); }
.media--stage > img { object-fit: contain; padding: 12%; }

/* ───────── Product tiles (Apple homepage) ───────── */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; background: var(--white); }
.tile { position: relative; display: grid; grid-template-rows: auto 1fr; overflow: hidden; min-height: clamp(560px, 52vw, 720px); padding: clamp(44px, 5vw, 64px) 24px clamp(32px, 4vw, 56px); text-align: center; background: var(--grey); border-radius: 0; isolation: isolate; }
.tile--dark { background: #000; color: var(--on-dark); }
.tile--dark .lead { color: var(--on-dark-muted); }
.tile--dark a.more { color: var(--link-dark); }
.tile__name { font-size: clamp(36px, 4vw, 56px); font-weight: 600; letter-spacing: -.03em; line-height: 1.05; }
.tile .lead { margin-top: 8px; }
.tile__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 28px; margin-top: 12px; }
.tile__art { align-self: end; margin: 28px auto 0; width: min(100%, 620px); }
.tile__art img, .tile__art video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-lg); } /* whole image inside the tile — no clipped bottom edge */
/* wide room shot: show the whole bed and controller */
.tile__art--bleed { width: min(100%, 780px); }
.tile__art--bleed img, .tile__art--bleed video { aspect-ratio: 16 / 9; } /* same shape as the clip: nothing cropped off the sides */
/* product shot on white: drop the white so the device sits directly on the tile */
.tile__art--cutout img { aspect-ratio: auto; object-fit: contain; border-radius: 0; }
.cutout, .tile__art--cutout img { mix-blend-mode: multiply; }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr; padding: 0; gap: 12px; } .tile { min-height: 0; } }

/* ───────── Cards ───────── */
.card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: clamp(28px, 3vw, 40px); border-radius: var(--r-lg); background: var(--grey); color: var(--ink); overflow: hidden; isolation: isolate; }
.sec--grey .card { background: var(--white); }
.sec--dark .card, .sec--night .card { background: #141418; color: var(--on-dark); }
.sec--dark .card .small, .sec--night .card .small { color: var(--on-dark-muted); }
.card__num { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.card__icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-grad); color: #fff; }
.card__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card p { color: var(--muted); }
.sec--dark .card p, .sec--night .card p { color: var(--on-dark-muted); }
.card__foot { margin-top: auto; padding-top: 8px; }
a.card { text-decoration: none; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
a.card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .28); }
a.card .more { color: var(--link); }
.sec--dark a.card .more, .sec--night a.card .more { color: var(--link-dark); }
.card--media { padding: 0; }
.card--media .card__body { padding: 24px 28px 30px; display: flex; flex-direction: column; gap: 8px; }
.card--media .media { border-radius: 0; }

/* Status tags (planned vs available, pending verification) */
.tag { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .01em; background: var(--grey-2); color: var(--ink-2); }
.tag--live { background: #e3f6ec; color: #0c6b3a; }
.tag--dev { background: #fff2d6; color: #8a5300; }
.tag--plan { background: #eaf2ff; color: #1a4f94; }
.tag--pending { background: var(--grey-2); color: var(--ink-2); }
.tag--pending::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #c48a00; }
.sec--dark .tag, .sec--night .tag { background: rgba(255, 255, 255, .1); color: var(--on-dark); }

/* ───────── Journey steps (blueprint 01–06) ───────── */
.journey { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.journey li { position: relative; padding: 18px 16px 20px; border-radius: var(--r-md); background: var(--grey); }
.sec--grey .journey li { background: var(--white); }
.journey a { position: absolute; inset: 0; border-radius: inherit; }
.journey b { display: block; font-size: 17px; letter-spacing: -.016em; }
.journey span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); line-height: 1.35; }
.journey li::before { counter-increment: step; content: counter(step, decimal-leading-zero); display: block; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--link); font-variant-numeric: tabular-nums; }
.journey li:last-child { background: var(--link); color: #fff; }
.journey li:last-child span, .journey li:last-child::before { color: rgba(255, 255, 255, .85); }
@media (max-width: 1000px) { .journey { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .journey { grid-template-columns: 1fr 1fr; } }

/* ───────── Sticky story (pinned stage) ───────── */
.story { position: relative; height: calc(var(--steps, 4) * 100vh); height: calc(var(--steps, 4) * 100svh); background: var(--night); color: var(--on-dark); }
.story__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-items: center; isolation: isolate; }
.story__bg { position: absolute; inset: 0; z-index: -1; }
.story__bg video, .story__bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.08 - var(--p, 0) * .08)); opacity: .62; }
.story__bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 70% at 50% 50%, transparent, rgba(5, 7, 12, .85)); }
.story__steps { position: relative; width: min(100% - var(--gutter) * 2, 900px); text-align: center; min-height: 14em; display: grid; place-items: center; }
.story__step { grid-area: 1 / 1; opacity: 0; transform: translateY(24px); filter: blur(8px); transition: opacity .7s var(--ease), transform .7s var(--ease), filter .7s var(--ease); pointer-events: none; }
.story__step.is-on { opacity: 1; transform: none; filter: none; pointer-events: auto; }
.story__step .lead { color: rgba(245, 245, 247, .78); margin: 18px auto 0; max-width: 34ch; }
.story__dots { position: absolute; right: max(18px, 3vw); top: 50%; transform: translateY(-50%); display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.story__dots li { width: 6px; height: 22px; border-radius: 4px; background: rgba(255, 255, 255, .25); transition: background-color .4s, height .4s var(--ease); }
.story__dots li.is-on { background: #fff; height: 40px; }
.story__progress { position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--brand-grad); }

/* ───────── Stats / counters ───────── */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); container-type: inline-size; }
.stat { min-width: 0; padding: clamp(24px, 6cqi, 52px); border-radius: var(--r-lg); background: var(--grey); }
.sec--grey .stat { background: var(--white); }
.sec--dark .stat, .sec--night .stat { background: #111216; }
.stat__value { font-size: min(clamp(40px, 7vw, 96px), 10.5cqi); font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat__value.is-pending { color: var(--muted); opacity: .5; }
.stat .tag { margin-top: 14px; }
.stat__label { margin-top: 12px; font-size: 21px; font-weight: 600; letter-spacing: -.016em; }
.stat__scope { margin-top: 6px; font-size: 14px; color: var(--muted); }
.stats__meta { margin-top: 18px; font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } .stat__value { font-size: min(clamp(48px, 14vw, 96px), 22cqi); } }

/* ───────── Tables ───────── */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-md); background: var(--white); box-shadow: inset 0 0 0 1px var(--grey-2); -webkit-overflow-scrolling: touch; }
.sec--white .tbl-wrap { background: var(--grey); box-shadow: none; }
.sec--white .tbl-wrap--card { background: var(--white); box-shadow: inset 0 0 0 1px var(--grey-2), 0 18px 40px -28px rgba(0, 0, 0, .25); }
.tbl { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--grey-2); vertical-align: top; }
.tbl thead th { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.tbl tbody th { font-weight: 600; }
.tbl tr:last-child > * { border-bottom: 0; }
.tick { color: #0c6b3a; font-weight: 600; }
.tick__i { display: inline-block; width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tbl__sub { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--muted); }
.tbl__how td, .tbl__how th { color: var(--muted); font-size: 14px; font-weight: 400; }
.dash { color: var(--muted); }

/* ───────── Chips / filters ───────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--grey-2); background: var(--white); color: var(--ink); font-size: 15px; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.sec--dark .chip, .sec--night .chip { background: transparent; color: var(--on-dark); border-color: rgba(255, 255, 255, .25); }
.sec--dark .chip[aria-pressed="true"], .sec--night .chip[aria-pressed="true"] { background: var(--on-dark); color: var(--ink); }
.filters { display: grid; gap: 14px; margin-bottom: 32px; }
.filters__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.filters__label { font-size: 13px; font-weight: 600; color: var(--muted); min-width: 92px; }
.empty { padding: 40px 28px; border-radius: var(--r-lg); background: var(--grey); text-align: center; color: var(--muted); }
.sec--grey .empty { background: var(--white); }

/* ───────── Forms ───────── */
.form { display: grid; gap: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form__row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 14px 16px; border-radius: var(--r-sm); border: 1px solid #d2d2d7; background: var(--white);
  font: 400 17px/1.3 var(--font); letter-spacing: -.016em; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 132px; resize: vertical; }
.field .phone { display: grid; grid-template-columns: minmax(132px, 38%) minmax(0, 1fr); gap: 8px; }
.field .phone select { min-width: 0; padding-left: 12px; padding-right: 8px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 4px rgba(10, 111, 194, .18); }
.field[data-invalid] input, .field[data-invalid] select, .field[data-invalid] textarea { border-color: #d70015; }
.field__err { display: none; font-size: 13px; color: #b00012; }
.field[data-invalid] .field__err { display: block; }
.field__help { font-size: 13px; color: var(--muted); }
.form__status { min-height: 24px; font-size: 15px; }
.form__status.is-ok { color: #0c6b3a; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--grey-2); }
.seg button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-size: 15px; font-weight: 500; cursor: pointer; transition: background-color .25s, color .25s; }
.seg button[aria-selected="true"] { background: var(--white); box-shadow: 0 2px 10px -4px rgba(0, 0, 0, .25); }

/* ───────── Video library + modal ───────── */
.vgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .vgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .vgrid { grid-template-columns: 1fr; } }
.vcard { display: grid; gap: 12px; text-align: left; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; }
.vcard__thumb { position: relative; overflow: hidden; border-radius: var(--r-md); aspect-ratio: 4 / 5; background: #0b0f17; }
.vcard__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.vcard:hover .vcard__thumb img { transform: scale(1.04); }
.vcard__play { position: absolute; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 14px; font-weight: 600; }
.vcard__play svg { width: 16px; height: 16px; fill: currentColor; }
.vcard__title { font-size: 19px; font-weight: 600; letter-spacing: -.016em; }
.vcard__meta { font-size: 14px; color: var(--muted); }
.sec--dark .vcard__meta { color: var(--on-dark-muted); }
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); opacity: 0; transition: opacity .3s var(--ease); }
.modal[hidden] { display: none; }
.modal.is-open { opacity: 1; }
.modal video { max-height: calc(100vh - 120px); max-height: calc(100svh - 120px); width: auto; max-width: 100%; aspect-ratio: 9 / 16; border-radius: var(--r-md); background: #000; }
.modal__close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; cursor: pointer; }
.modal__cap { margin-top: 12px; color: var(--on-dark-muted); font-size: 14px; text-align: center; }
.modal__box { display: grid; justify-items: center; }

/* ───────── Ailment rail ───────── */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 1100px) { .rail { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; } }

/* ───────── Map / directory ───────── */
.dir { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 900px) { .dir { grid-template-columns: 1fr; } }
.states { display: flex; flex-wrap: wrap; gap: 8px; }

/* ───────── Footer ───────── */
.foot { background: var(--grey); color: var(--muted); font-size: 12px; line-height: 1.5; padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); }
.foot__inner { width: min(100% - var(--gutter) * 2, 1080px); margin-inline: auto; }
.foot__note { padding-bottom: 16px; border-bottom: 1px solid #d2d2d7; }
.foot__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; padding: 22px 0; border-bottom: 1px solid #d2d2d7; }
.foot__grid ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 2px; }
.foot__grid a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink-2); font-size: 13px; }
.foot__h { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.foot__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 16px; font-size: 13px; }
.foot__base a { color: var(--ink-2); }
@media (max-width: 860px) { .foot__grid { grid-template-columns: 1fr 1fr; } }
@media (pointer: coarse) { .foot__grid a, .foot__base a { min-height: 44px; padding-right: 8px; } .foot__base a { display: inline-flex; align-items: center; } }

/* ───────── Motion: reveals, curtain, cursor ───────── */
[data-words] i { font-style: normal; }
.js [data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal="scale"].is-in { transform: none; }
.js [data-words] .w { display: inline-block; overflow: hidden; vertical-align: top; padding: .02em .02em .2em; margin: -.02em -.02em -.2em; } /* room for descenders (g, y) inside the mask */
.js [data-words] .w > i { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); transition-delay: calc(var(--wi) * 55ms + var(--d, 0s)); }
.js [data-words].is-in .w > i { transform: none; }
.js [data-words] .grad { padding-bottom: .08em; }

.curtain { position: fixed; inset: 0; z-index: var(--z-curtain); background: var(--night); transform: scaleY(0); transform-origin: bottom; pointer-events: none; }
.curtain.is-leaving { transform: scaleY(1); transition: transform .5s var(--ease-io); }
.curtain.is-entering { transform: scaleY(1); transform-origin: top; animation: curtainOut .7s var(--ease-io) .05s forwards; }
@keyframes curtainOut { to { transform: scaleY(0); } }

.cursor { position: fixed; left: 0; top: 0; z-index: calc(var(--z-curtain) - 1); width: 0; height: 0; pointer-events: none; display: none; mix-blend-mode: difference; }
.cursor span { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .35s var(--ease), opacity .3s; }
.cursor.is-link span { transform: scale(3.4); opacity: .9; }
@media (hover: hover) and (pointer: fine) { .has-cursor .cursor { display: block; } }

/* Parallax + magnetic helpers */
[data-parallax] { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js [data-reveal], .js [data-words] .w > i { opacity: 1; transform: none; }
  .story { height: auto; }
  .story__stage { position: relative; height: auto; padding: 96px 0; }
  .story__steps { display: grid; gap: 64px; min-height: 0; }
  .story__step { grid-area: auto; opacity: 1; transform: none; filter: none; }
  .cursor, .curtain { display: none !important; }
}
