/* ==========================================================================
   Abud Bakri MD — "The Instrument"
   Warm clinical-editorial system. One green accent, one shadow, surface-rhythm.
   Tri-voice type: Newsreader (display) · Geist (UI) · Geist Mono (data).
   ========================================================================== */

:root {
  color-scheme: light;

  /* Canvas — warm bone family */
  --bone: #f0efe5;
  --paper: #f7f4eb;
  --card: #fbfaf6;

  /* Obsidian — green-tinted dark instrument surfaces */
  --obsidian: #151b1a;
  --obsidian-raised: #1e2725;
  --obsidian-surface: #283231;
  --obsidian-deep: #0e1312;

  /* Ink — warm green-black, never pure black */
  --ink: #141a17;
  --ink-soft: #3a433d;
  --muted: #59635c;
  --on-dark: #efede2;
  --on-dark-muted: #aab2a9;
  --on-dark-soft: #c7cdc4;

  /* Accent — one botanical green does all interactive work */
  --accent: #2e5d43;
  --accent-strong: #357a4e;
  --accent-press: #224733; /* darken on hover/press — keeps AA with light label */
  --accent-live: #3e9a5f;

  /* Data states — only inside instruments */
  --data-optimal: #3e8e5c;
  --data-inrange: #7fa88a;
  --data-watch: #c2733a;
  --data-out: #be4632;

  /* Lines */
  --hairline: rgba(20, 26, 23, 0.12);
  --hairline-strong: rgba(20, 26, 23, 0.22);
  --hairline-dark: rgba(239, 237, 226, 0.14);
  --hairline-dark-strong: rgba(239, 237, 226, 0.26);

  /* Type */
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-ui: "Geist", "Hanken Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Radius — crisp clinical scale */
  --r-xs: 3px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* The one shadow — reserved for instrument cards */
  --device-shadow: 0 24px 50px -24px rgba(8, 12, 10, 0.55);

  /* Spacing rhythm */
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section: clamp(4.5rem, 9vw, 7rem);
  --maxw: 1200px;

  /* Motion */
  --ease-enter: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-press: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-micro: 180ms;
  --dur-reveal: 620ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Faint grain over light canvas — kills the flat "generated" feel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main {
  position: relative;
  z-index: 1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a,
button,
summary {
  touch-action: manipulation;
}

::selection {
  background: rgba(46, 93, 67, 0.18);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* Focus ring must stay visible on the dark editorial surfaces */
.hero-section :focus-visible,
.routes-section :focus-visible,
.site-footer :focus-visible,
.mobile-menu-panel :focus-visible {
  outline-color: var(--on-dark);
}

/* Lock body scroll while the mobile menu is open */
body.is-menu-open {
  overflow: hidden;
}

/* Color-change sections sit as rounded panels over the previous surface
   (the calibrate.day stacked-panel move). */
.section-round {
  position: relative;
  z-index: 2;
  margin-top: clamp(-48px, -3.2vw, -26px);
  border-top-left-radius: clamp(26px, 3.2vw, 46px);
  border-top-right-radius: clamp(26px, 3.2vw, 46px);
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 200;
  transform: translateY(-160%);
  background: var(--accent);
  color: var(--on-dark);
  padding: 0.7rem 1rem;
  border-radius: var(--r-sm);
  font: 500 0.9rem var(--font-ui);
  transition: transform var(--dur-micro) var(--ease-enter);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Shared type primitives ------------------------------------------------ */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: clamp(2.2rem, 4.8vw, 3.45rem);
  line-height: 1.06;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

.section-title em {
  font-style: italic;
}

/* ==========================================================================
   Header / navigation
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: clamp(0.7rem, 1.4vw, 1.05rem) var(--gutter);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0.5rem 0.6rem 0.5rem 1.1rem;
  border-radius: var(--r-pill);
  color: var(--on-dark);
  border: 1px solid transparent;
  transition: background 300ms var(--ease-enter),
    color 300ms var(--ease-enter),
    border-color 300ms var(--ease-enter),
    box-shadow 300ms var(--ease-enter);
}

.site-header.is-light .nav-inner {
  background: rgba(251, 250, 246, 0.78);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  color: var(--ink);
  border-color: var(--hairline);
  box-shadow: 0 14px 36px -18px rgba(8, 12, 10, 0.32);
}

@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .site-header.is-light .nav-inner {
    background: rgba(251, 250, 246, 0.98);
  }
}

.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.site-brand small {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--on-dark-soft);
}

.site-header.is-light .site-brand small {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: inherit;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0;
  padding: 0.4rem 0.85rem;
  border-radius: var(--r-pill);
  opacity: 0.78;
  transition: opacity var(--dur-micro) var(--ease-enter);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  opacity: 1;
}

.site-nav a[aria-current="page"] {
  opacity: 1;
}

.site-nav a[aria-current="page"]:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.28rem;
  height: 1.5px;
  background: currentColor;
  border-radius: var(--r-pill);
  opacity: 0.6;
}

/* Primary action in the nav */
.nav-cta {
  margin-left: 0.4rem;
  background: var(--accent);
  color: var(--on-dark) !important;
  opacity: 1 !important;
  padding: 0.5rem 1.05rem !important;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--accent-press);
}

.mobile-menu-trigger {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  color: inherit;
  border-radius: var(--r-sm);
}

.mobile-menu-trigger span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.6px;
  background: currentColor;
  transition: transform var(--dur-micro) var(--ease-enter),
    opacity var(--dur-micro) var(--ease-enter);
}

.mobile-menu-trigger span:nth-child(1) {
  top: 18px;
}
.mobile-menu-trigger span:nth-child(2) {
  bottom: 18px;
}

.mobile-menu-trigger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}
.mobile-menu-trigger[aria-expanded="true"] span:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(14, 19, 18, 0.5);
  opacity: 0;
  transition: opacity var(--dur-micro) var(--ease-enter);
}
.mobile-menu-backdrop[data-state="open"] {
  opacity: 1;
}

.mobile-menu-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 120;
  width: min(82vw, 320px);
  background: var(--obsidian);
  color: var(--on-dark);
  padding: 5rem 2rem 2rem;
  transform: translateX(100%);
  transition: transform 230ms var(--ease-enter);
}
.mobile-menu-panel[data-state="open"] {
  transform: translateX(0);
}

.mobile-menu-panel nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-menu-panel a {
  color: var(--on-dark);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--hairline-dark);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero-section {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: clamp(7rem, 14vh, 11rem) var(--gutter) clamp(4rem, 6vw, 4.5rem);
  background: var(--obsidian-deep);
  color: var(--on-dark);
  overflow: hidden;
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-photo img {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: clamp(46%, 58vw, 64%);
  object-fit: cover;
  object-position: center 18%;
  filter: grayscale(1) contrast(1.04) brightness(0.92);
}

/* Wash that lets the portrait dissolve into the dark editorial left */
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
      90deg,
      var(--obsidian-deep) 30%,
      rgba(14, 19, 18, 0.72) 48%,
      rgba(14, 19, 18, 0.12) 72%,
      rgba(14, 19, 18, 0.45) 100%
    ),
    linear-gradient(0deg, rgba(14, 19, 18, 0.7), transparent 42%);
}

.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
}

.hero-copy {
  max-width: 38rem;
}

.hero-section .kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
  margin: 0 0 1.3rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: clamp(3.1rem, 8vw, 5.6rem);
  line-height: 0.96;
  letter-spacing: -0.022em;
  margin: 0;
  color: var(--on-dark);
}

.hero-title .accent {
  color: var(--accent-live);
}

.hero-subcopy {
  margin: 1.5rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
  line-height: 1.5;
  color: var(--on-dark);
}

/* Hero actions — one primary, one quiet ghost */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2.1rem;
}

/* Path index — editorial routing list, not cards */
.hero-paths {
  margin-top: 2.4rem;
  max-width: 33rem;
  border-top: 1px solid var(--hairline-dark);
}

.hero-path {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 0.2rem;
  border-bottom: 1px solid var(--hairline-dark);
  color: var(--on-dark);
  transition: padding-left var(--dur-micro) var(--ease-enter);
}

.hero-path:hover,
.hero-path:focus-visible {
  padding-left: 0.6rem;
}

.hero-path .idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent-live);
  width: 1.8rem;
  flex: none;
}

.hero-path .pl {
  flex: 1;
  min-width: 0;
}

.hero-path .pl b {
  display: block;
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: -0.005em;
}

.hero-path .pl span {
  display: block;
  font-size: 0.86rem;
  color: var(--on-dark-muted);
}

.hero-path .arrow {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--on-dark-muted);
  transition: transform var(--dur-micro) var(--ease-enter),
    color var(--dur-micro) var(--ease-enter);
}

.hero-path:hover .arrow,
.hero-path:focus-visible .arrow {
  transform: translateX(4px);
  color: var(--accent-live);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--r-pill);
  min-height: 48px;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--dur-micro) var(--ease-press),
    transform var(--dur-micro) var(--ease-press),
    border-color var(--dur-micro) var(--ease-press);
  touch-action: manipulation;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform var(--dur-micro) var(--ease-enter);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-dark);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-press);
}

.btn-primary:hover svg,
.btn-primary:focus-visible svg {
  transform: translateX(3px);
}

.btn:active {
  transform: scale(0.97);
}

.btn-ghost {
  background: transparent;
  color: var(--on-dark);
  border-color: var(--hairline-dark-strong);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--on-dark-soft);
}

/* ==========================================================================
   Bio
   ========================================================================== */

.bio-section {
  position: relative;
  background: var(--bone);
  padding: var(--section) var(--gutter);
}

.bio-shell {
  max-width: var(--maxw);
  margin-inline: auto;
}

.bio-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: stretch;
}

.bio-copy .eyebrow {
  margin-bottom: 1.4rem;
}

.bio-copy .section-title {
  max-width: 16ch;
}

.bio-rule {
  width: 56px;
  height: 2px;
  background: var(--accent);
  margin: 1.6rem 0;
}

.bio-copy p {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  max-width: 46ch;
}

.doctor-note {
  margin: 2.2rem 0 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--accent);
}

.doctor-note blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  line-height: 1.3;
  color: var(--ink);
}

.doctor-note figcaption {
  margin-top: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Affiliations — obsidian instrument card, vertically centered to the bio copy */
.bio-affil-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bio-affil {
  position: relative;
  width: 100%;
  background: var(--obsidian);
  color: var(--on-dark);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 2.5vw, 2.1rem);
  box-shadow: var(--device-shadow);
  overflow: hidden;
}

.bio-affil::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    70% 55% at 80% 0%,
    rgba(62, 154, 95, 0.12),
    transparent 70%
  );
  pointer-events: none;
}

.bio-affil-label {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  margin: 0 0 1.3rem;
}

.bio-affil dl {
  position: relative;
  margin: 0;
}

.bio-affil dl > div {
  padding: 0.95rem 0;
  border-top: 1px solid var(--hairline-dark);
}

.bio-affil dl > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.bio-affil dt {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 400;
  color: var(--on-dark);
}

.bio-affil dd {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: var(--on-dark-muted);
}

/* Credibility strip */
.cred-strip {
  max-width: var(--maxw);
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  padding-top: clamp(1.6rem, 3vw, 2.2rem);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem clamp(1.5rem, 4vw, 3rem);
}

.cred-strip .cred-lead {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  flex-basis: 100%;
  margin-bottom: 0.4rem;
}

.cred-strip span:not(.cred-lead) {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 400;
  color: var(--ink-soft);
  opacity: 0.82;
}

/* ==========================================================================
   Routes — obsidian band, honest instruments
   ========================================================================== */

.routes-section {
  position: relative;
  background: var(--obsidian);
  color: var(--on-dark);
  padding: var(--section) var(--gutter);
  overflow: hidden;
}

.routes-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    90% 60% at 50% -10%,
    rgba(62, 154, 95, 0.08),
    transparent 60%
  );
  pointer-events: none;
}

.routes-shell {
  position: relative;
  max-width: var(--maxw);
  margin-inline: auto;
}

.routes-head {
  max-width: 40rem;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.routes-head .eyebrow {
  color: var(--accent-live);
}

.routes-head .section-title {
  color: var(--on-dark);
  margin-top: 1.3rem;
}

.routes-head p {
  margin: 1.3rem 0 0;
  color: var(--on-dark-soft);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  max-width: 38rem;
}

.route {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(2.5rem, 5vw, 3.6rem) 0;
  border-top: 1px solid var(--hairline-dark);
}

.route:last-of-type {
  border-bottom: 1px solid var(--hairline-dark);
}

/* Alternate the instrument side so the three rows don't read as a stamped template */
@media (min-width: 1025px) {
  .route:nth-of-type(2) .route-instrument {
    order: -1;
  }
}

.route-text .route-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-live);
  margin: 0 0 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--hairline-dark-strong);
}

.route-text h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--on-dark);
}

.route-text > p {
  margin: 1rem 0 0;
  color: var(--on-dark-soft);
  max-width: 40ch;
}

.route-meta {
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.route-meta .meta-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--hairline-dark);
  font-size: 0.92rem;
}

.route-meta .meta-row span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  padding-top: 0.15rem;
}

.route-meta .meta-row p {
  margin: 0;
  color: var(--on-dark-soft);
}

.route-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.7rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--r-pill);
  min-height: 48px;
  padding: 0.8rem 1.45rem;
  background: var(--accent);
  color: var(--on-dark);
  border: 1px solid transparent;
  transition: background var(--dur-micro) var(--ease-press),
    transform var(--dur-micro) var(--ease-press);
}

.route-cta svg {
  width: 18px;
  height: 18px;
  transition: transform var(--dur-micro) var(--ease-enter);
}

.route-cta:hover,
.route-cta:focus-visible {
  background: var(--accent-press);
}
.route-cta:hover svg,
.route-cta:focus-visible svg {
  transform: translateX(3px);
}
.route-cta:active {
  transform: scale(0.97);
}

.route-note {
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--on-dark-muted);
}

/* Instrument shell */
.instrument {
  position: relative;
  background: var(--obsidian-raised);
  border: 1px solid var(--hairline-dark);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  box-shadow: var(--device-shadow);
  overflow: hidden;
}

.instrument::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    60% 50% at 75% 0%,
    rgba(62, 154, 95, 0.1),
    transparent 70%
  );
  pointer-events: none;
}

/* Light each instrument from a different point so they read as placed objects */
.route:nth-of-type(2) .instrument::before {
  background: radial-gradient(60% 50% at 22% 0%, rgba(62, 154, 95, 0.1), transparent 70%);
}
.route:nth-of-type(3) .instrument::before {
  background: radial-gradient(70% 55% at 50% 0%, rgba(62, 154, 95, 0.09), transparent 72%);
}

.instrument > * {
  position: relative;
}

/* --- Sleep: "the same day, two ways" (real Calibrate component) --- */
.tw-head,
.res-head,
.cov-head {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  margin-bottom: 1.3rem;
}

.tw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.tw-col {
  border-radius: var(--r-md);
  border: 1px solid var(--hairline-dark);
  background: rgba(239, 237, 226, 0.02);
  padding: 0.95rem 0.9rem;
}

.tw-col.tw-after {
  border-color: rgba(62, 154, 95, 0.32);
  background: rgba(62, 154, 95, 0.06);
}

.tw-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  margin-bottom: 0.8rem;
}

.tw-after .tw-label {
  color: var(--accent-live);
}

.tw-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.tw-col li {
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--on-dark-soft);
}

.tw-col .t {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  color: var(--on-dark-muted);
  font-variant-numeric: tabular-nums;
}

.tw-after .t {
  color: var(--accent-live);
}

/* --- Labs: results status (real Hundred component) --- */
.res-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.res-head span {
  color: var(--on-dark-soft);
  text-transform: none;
  letter-spacing: 0.02em;
}

.res-tiers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.res-tier {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1rem 0.95rem 1.15rem;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline-dark);
  overflow: hidden;
}

/* highlighted tier (the headline number), like hundred's active row */
.res-tier.is-active {
  background: rgba(62, 154, 95, 0.08);
  border-color: rgba(62, 154, 95, 0.34);
}

.res-tier::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--data-inrange);
  opacity: 0.5;
}
.res-tier.t-optimal::before {
  background: var(--data-optimal);
  opacity: 1;
}
.res-tier.t-out::before {
  background: var(--data-out);
}

.rt-label {
  font-family: var(--font-display);
  font-size: 1.12rem;
  color: var(--on-dark);
}

.rt-bubble {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--on-dark);
  background: var(--obsidian-surface);
  border: 1px solid var(--hairline-dark);
  border-radius: var(--r-pill);
  padding: 0.22rem 0.7rem;
  min-width: 2.6rem;
  text-align: center;
}

.t-optimal .rt-bubble {
  color: var(--obsidian-deep);
  background: var(--data-optimal);
  border-color: transparent;
}
.t-out .rt-bubble {
  color: var(--data-out);
}

/* --- Patient care: what your visit covers --- */
.cov-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.cov-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.92rem;
  color: var(--on-dark-soft);
}

.cov-list .ck {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(62, 154, 95, 0.16);
  color: var(--accent-live);
}

.cov-list .ck svg {
  width: 12px;
  height: 12px;
}

.cov-foot {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--hairline-dark);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--on-dark-muted);
}

/* Instrument internal reveal animations */
@media (prefers-reduced-motion: no-preference) {
  .tw-col,
  .cov-list li,
  .res-tier {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease-enter), transform 0.5s var(--ease-enter);
  }

  .instrument.is-visible .tw-col,
  .instrument.is-visible .cov-list li,
  .instrument.is-visible .res-tier {
    opacity: 1;
    transform: translateY(0);
  }

  .instrument.is-visible .tw-col:nth-child(2),
  .instrument.is-visible .cov-list li:nth-child(2),
  .instrument.is-visible .res-tier:nth-child(2) {
    transition-delay: 0.09s;
  }
  .instrument.is-visible .cov-list li:nth-child(3),
  .instrument.is-visible .res-tier:nth-child(3) {
    transition-delay: 0.18s;
  }
  .instrument.is-visible .cov-list li:nth-child(4) {
    transition-delay: 0.27s;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  position: relative;
  z-index: 1;
  background: var(--obsidian-deep);
  color: var(--on-dark-muted);
  padding: clamp(3.5rem, 7vw, 5.5rem) var(--gutter) 2.5rem;
}

.footer-shell {
  max-width: var(--maxw);
  margin-inline: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--hairline-dark);
}

.footer-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  color: var(--on-dark);
}

.footer-brand small {
  font-size: 0.62rem;
  color: var(--accent-live);
}

.footer-identity p {
  margin: 1.1rem 0 0;
  max-width: 34ch;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--on-dark-muted);
}

.footer-col h2 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
  margin: 0 0 1.1rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  width: fit-content;
  color: var(--on-dark-muted);
  font-size: 0.92rem;
  transition: color var(--dur-micro) var(--ease-enter);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--on-dark);
}

/* Legal — collapsed into one disclosure */
.footer-legal {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.footer-legal > summary,
.legal-detail > summary {
  cursor: pointer;
  list-style: none;
}

.footer-legal > summary::-webkit-details-marker,
.legal-detail > summary::-webkit-details-marker {
  display: none;
}

.footer-legal > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
  padding: 0.6rem 0;
}

.footer-legal > summary::before {
  content: "+";
  font-size: 1rem;
  color: var(--accent-live);
}

.footer-legal[open] > summary::before {
  content: "–";
}

.footer-legal-body {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem 2.5rem;
}

.footer-legal-body section {
  scroll-margin-top: 6rem;
}

.footer-legal-body h2 {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--on-dark);
  margin: 0 0 0.6rem;
}

.footer-legal-body > section > p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--on-dark-muted);
}

.legal-detail {
  margin-top: 0.6rem;
}

.legal-detail > summary {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-live);
  padding: 0.3rem 0;
}

.legal-detail[open] > summary {
  color: var(--on-dark-soft);
}

.legal-detail p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--on-dark-muted);
  margin: 0.7rem 0 0;
}

.footer-meta {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline-dark);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--on-dark-muted);
}

.footer-links-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.footer-links-inline a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--on-dark-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-links-inline a:hover,
.footer-links-inline a:focus-visible {
  color: var(--on-dark);
}

/* ==========================================================================
   Motion reveal
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .motion-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--dur-reveal) var(--ease-enter),
      transform var(--dur-reveal) var(--ease-enter);
    transition-delay: calc(var(--motion-order, 0) * 80ms);
  }

  .motion-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* Hero loads with a staggered entrance */
  .hero-load > * {
    opacity: 0;
    transform: translateY(20px);
    animation: hero-in 0.8s var(--ease-enter) forwards;
    animation-delay: calc(0.1s + var(--i, 0) * 0.09s);
  }
  .hero-load > *:nth-child(1) { --i: 0; }
  .hero-load > *:nth-child(2) { --i: 1; }
  .hero-load > *:nth-child(3) { --i: 2; }
  .hero-load > *:nth-child(4) { --i: 3; }
  .hero-load > *:nth-child(5) { --i: 4; }
}

@keyframes hero-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .bio-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .route {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .route-instrument {
    order: 2;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-identity {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .site-nav {
    display: none;
  }

  .mobile-menu-trigger {
    display: block;
  }

  .hero-section {
    align-items: flex-end;
  }

  .hero-photo img {
    width: 100%;
    object-position: center 12%;
    filter: grayscale(1) contrast(1.05) brightness(0.78);
  }

  .hero-photo::after {
    background: linear-gradient(
      0deg,
      var(--obsidian-deep) 18%,
      rgba(14, 19, 18, 0.55) 55%,
      rgba(14, 19, 18, 0.25) 100%
    );
  }
}

@media (max-width: 560px) {
  .hero-title {
    font-size: clamp(2.7rem, 13vw, 3.6rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    justify-content: center;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .route-meta .meta-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}
