:root {
  --ink: #121a1c;
  --ink-soft: #2c3a3d;
  --muted: #5c6a6d;
  --paper: #f3eee4;
  --paper-2: #e7e0d2;
  --cream: #faf7f1;
  --white: #fffcf7;
  --teal: #1f6f6c;
  --teal-deep: #143f3e;
  --teal-mid: #2a8a86;
  --gold: #c4a06a;
  --gold-deep: #9a7540;
  --copper: #b06a42;
  --sage: #7f9a8c;
  --danger: #8f3b32;
  --warn: #a5752c;
  --ok: #3d6b4f;
  --line: rgba(18, 26, 28, 0.12);
  --line-strong: rgba(18, 26, 28, 0.22);
  --shadow: 0 28px 70px rgba(18, 26, 28, 0.16);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Figtree", "Segoe UI", system-ui, sans-serif;
  --radius: 18px;
  --nav-h: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  min-height: 100%;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(31, 111, 108, 0.22); }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 80;
  background: var(--white);
  padding: 8px 12px;
  border-radius: 8px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { border-bottom-color: var(--line); }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.brand svg { width: 28px; height: 28px; }
.brand em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 560;
  color: var(--teal-deep);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.nav-links a:hover { color: var(--ink); }
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 42px;
  height: 42px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(31, 111, 108, 0.28);
}
.btn-primary:hover { background: var(--teal-mid); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-gold {
  background: var(--gold);
  color: var(--ink);
}
.btn-danger-ghost {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line));
  color: var(--danger);
}

.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  padding: 36px 48px 64px;
  align-items: end;
}
.hero-copy { max-width: 640px; padding-bottom: 28px; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
}
.kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--gold);
}
h1, h2, h3 { font-family: var(--serif); font-weight: 520; letter-spacing: -0.03em; line-height: 1.12; }
.hero h1 {
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  margin: 16px 0 18px;
  font-variation-settings: "SOFT" 40, "WONK" 1;
}
.hero h1 em { font-style: italic; color: var(--teal-deep); }
.lede {
  font-size: 1.18rem;
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-photo {
  position: relative;
  min-height: 520px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  background: color-mix(in srgb, var(--ink) 62%, transparent);
  color: var(--cream);
  padding: 14px 16px;
  border-radius: 14px;
  backdrop-filter: blur(10px);
  font-size: 0.92rem;
}

.band {
  padding: 88px 48px;
}
.band-tight { padding: 56px 48px; }
.band h2 { font-size: clamp(2rem, 4vw, 3.3rem); margin: 0 0 14px; }
.sub {
  color: var(--muted);
  max-width: 56ch;
  font-size: 1.05rem;
}
.ink {
  background: var(--teal-deep);
  color: var(--cream);
}
.ink .sub { color: color-mix(in srgb, var(--cream) 72%, transparent); }
.cream { background: var(--cream); }

.grid-3, .grid-2 {
  display: grid;
  gap: 22px;
  margin-top: 36px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1.1fr 0.9fr; align-items: center; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.step-num {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-deep);
  font-size: 1.4rem;
}
.card h3 { margin: 8px 0 8px; font-size: 1.45rem; }
.card p { margin: 0; color: var(--ink-soft); }

.photo-frame {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 360px;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.split-copy { padding-right: 24px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.sample {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  margin-top: 32px;
}
.term {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.term b { font-family: var(--serif); font-weight: 560; }
.term span { color: var(--ink-soft); }

.cta-band {
  text-align: center;
  padding: 96px 24px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--teal-deep) 55%, transparent), var(--teal-deep)),
    url("/images/film.jpg") center/cover;
  color: var(--cream);
}
.cta-band h2 { font-size: clamp(2.2rem, 5vw, 4rem); margin: 0 0 12px; }
.cta-band p { max-width: 46ch; margin: 0 auto 28px; color: color-mix(in srgb, var(--cream) 80%, transparent); }

footer {
  padding: 36px 48px 48px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}
footer nav { display: flex; gap: 18px; }
footer a { text-decoration: none; }

.page {
  display: none;
  min-height: calc(100svh - var(--nav-h));
}
.page.active { display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 36px 24px 80px; }
.legal { max-width: 740px; }
.legal h1 { font-size: 2.6rem; }
.legal p, .legal li { color: var(--ink-soft); }

/* Read / report */
.drop {
  border: 1.5px dashed color-mix(in srgb, var(--teal) 45%, var(--line-strong));
  background: var(--white);
  border-radius: 24px;
  padding: 42px 24px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drop.drag {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 8%, var(--white));
}
.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}
.thumb {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  font-size: 12px;
  line-height: 22px;
}
.notes {
  width: 100%;
  min-height: 90px;
  margin-top: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--cream);
  padding: 12px 14px;
  resize: vertical;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  margin: 18px auto 0;
  max-width: 560px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.form-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

.status {
  margin-top: 28px;
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  border: 1px solid var(--line);
}
.status-bar {
  height: 4px;
  background: var(--paper-2);
  border-radius: 99px;
  overflow: hidden;
  margin: 14px 0 8px;
}
.status-bar > span {
  display: block;
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  animation: slide 1.4s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(400%); }
}

.report-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  margin-top: 10px;
}
.player-shell {
  background: #0b1214;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow);
}
.player-shell canvas { width: 100%; height: 100%; display: block; }
.player-ui {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 14px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  color: #f6f1e8;
}
.player-caption {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.player-row { display: flex; align-items: center; gap: 10px; }
.player-row input[type="range"] { flex: 1; accent-color: var(--gold); }
.time { font-variant-numeric: tabular-nums; font-size: 0.8rem; opacity: 0.85; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-routine { background: color-mix(in srgb, var(--ok) 18%, white); color: var(--ok); }
.badge-soon { background: color-mix(in srgb, var(--gold) 28%, white); color: var(--gold-deep); }
.badge-prompt { background: color-mix(in srgb, var(--warn) 22%, white); color: var(--warn); }
.badge-emergency_discussion { background: color-mix(in srgb, var(--danger) 18%, white); color: var(--danger); }

.finding {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.finding h3 { margin: 0 0 6px; font-size: 1.25rem; }
.meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 8px; }
.plain { margin: 0 0 8px; }
.clinical {
  font-size: 0.92rem;
  color: var(--muted);
  background: var(--cream);
  border-radius: 12px;
  padding: 10px 12px;
}
.tabs { display: flex; gap: 8px; margin: 8px 0 16px; flex-wrap: wrap; }

.err {
  background: color-mix(in srgb, var(--danger) 10%, white);
  color: var(--danger);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 14px;
}

@media (max-width: 960px) {
  .hero, .band, footer { padding-left: 20px; padding-right: 20px; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-photo { min-height: 340px; }
  .grid-3, .grid-2, .sample, .report-grid { grid-template-columns: 1fr; }
  .term { grid-template-columns: 1fr; gap: 4px; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px 22px;
    border-bottom: 1px solid var(--line);
    gap: 14px;
  }
  .nav-links.open { display: flex; }
}

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