/* TeachMeMedical — base, components, animation */

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 .6em;
}
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-family: var(--font-body); font-weight: 650; letter-spacing: -0.01em; line-height: 1.35; }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.container { width: var(--container); margin-inline: auto; }

.section { padding-block: var(--section); }
.section--tint { background: var(--surface-2); }
.section--wash { background: var(--blue-wash); }

.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1rem;
}

.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 62ch; }

.measure { max-width: 78ch; }

/* ---------- skip link ---------- */

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--blue); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; color: #fff; }

/* ---------- nav ---------- */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-ui), box-shadow var(--t-ui);
}
.nav.is-stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 650; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand span strong { color: var(--blue); font-weight: 650; }

.nav__links { display: flex; align-items: center; gap: 1.75rem; }
.nav__links a {
  color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 550;
  position: relative; padding-block: .35rem; transition: color var(--t-ui);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active { color: var(--blue); }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--blue); border-radius: 2px;
}
.nav__links a.btn, .nav__links a.btn:hover { color: #fff; }
.nav__links a.btn::after { display: none; }

.nav__toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface); cursor: pointer;
  align-items: center; justify-content: center; color: var(--ink);
}

@media (max-width: 860px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--page); border-bottom: 1px solid var(--line);
    padding: .5rem 5% 1.25rem;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav__links a.is-active::after { display: none; }
  .nav__links a.btn { margin-top: 1rem; border-bottom: none; text-align: center; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.6rem; border-radius: var(--r-pill);
  background: var(--blue); color: #fff; font-size: var(--fs-sm); font-weight: 600;
  border: 1px solid var(--blue); cursor: pointer;
  transition: transform var(--t-ui), background var(--t-ui), box-shadow var(--t-ui);
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink-soft); }
.btn--sm { padding: .6rem 1.15rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

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

.hero {
  background: var(--blue-wash);
  padding-block: calc(var(--nav-h) + clamp(3.5rem, 7vw, 6.5rem)) clamp(3.5rem, 7vw, 6.5rem);
  border-bottom: 1px solid var(--line);
}
.hero h1 { max-width: 20ch; }
.hero .lede { margin-top: 1.25rem; }

.hero--split { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
@media (max-width: 1024px) { .hero--split { grid-template-columns: 1fr; } }

/* ---------- grids ---------- */

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---------- card ---------- */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: clamp(1.5rem, 2.4vw, 2rem);
  transition: transform var(--t-ui), box-shadow var(--t-ui), border-color var(--t-ui);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--ink-soft); font-size: var(--fs-sm); }

.card__icon {
  width: 42px; height: 42px; border-radius: var(--r);
  background: var(--blue-light); color: var(--blue);
  display: grid; place-items: center; margin-bottom: 1.1rem;
}
.card__icon svg { width: 22px; height: 22px; }

/* ---------- steps ---------- */

.step { display: flex; gap: 1.1rem; align-items: flex-start; }
.step__n {
  flex: none; width: 38px; height: 38px; border-radius: var(--r-pill);
  background: var(--blue); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm);
}
.step h3 { margin-bottom: .35rem; }
.step p { color: var(--ink-soft); font-size: var(--fs-sm); }

/* ---------- status list (security) ---------- */

.status { display: flex; gap: .9rem; align-items: flex-start; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.status:last-child { border-bottom: none; }
.status__mark { flex: none; width: 24px; height: 24px; border-radius: var(--r-pill); display: grid; place-items: center; margin-top: .18rem; }
.status__mark svg { width: 13px; height: 13px; }
.status--yes .status__mark { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.status--no  .status__mark { background: color-mix(in srgb, var(--amber) 20%, transparent); color: var(--amber); }
.status strong { display: block; font-weight: 650; }
.status span { color: var(--ink-soft); font-size: var(--fs-sm); }

/* ---------- quote ---------- */

.quote {
  border-left: 3px solid var(--blue); padding-left: clamp(1.25rem, 2.5vw, 2rem);
  font-family: var(--font-display); font-size: clamp(1.35rem, 2.3vw, 1.9rem);
  line-height: 1.38; letter-spacing: -.015em; color: var(--ink);
}
.quote cite { display: block; margin-top: 1rem; font-family: var(--font-body); font-size: var(--fs-sm); font-style: normal; color: var(--ink-soft); letter-spacing: 0; }

/* ---------- people ---------- */

.person { text-align: left; }
.person__avatar {
  width: 64px; height: 64px; border-radius: var(--r-pill);
  background: var(--blue-light); color: var(--blue-dark);
  display: grid; place-items: center; font-family: var(--font-display); font-size: 1.35rem; font-weight: 500;
  margin-bottom: 1rem;
}
.person h3 { margin-bottom: .15rem; }
.person .role { color: var(--blue); font-size: var(--fs-sm); font-weight: 600; margin-bottom: .75rem; }
.person p { color: var(--ink-soft); font-size: var(--fs-sm); }

/* ---------- badge ---------- */

.badge {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .85rem; border-radius: var(--r-pill);
  background: var(--blue-light); color: var(--blue-dark);
  font-size: var(--fs-xs); font-weight: 650; letter-spacing: .01em;
}
.badge svg { width: 14px; height: 14px; }

.badge-row { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- prose (privacy) ---------- */

.prose h2 { margin-top: 2.6rem; padding-top: 2.6rem; border-top: 1px solid var(--line); font-size: clamp(1.5rem, 2.2vw, 2rem); }
.prose h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.prose h3 { margin-top: 1.8rem; }
.prose ul { padding-left: 1.2rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: .55rem; }
.prose li::marker { color: var(--blue); }

.toc { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.toc li { margin-bottom: .4rem; font-size: var(--fs-sm); }
@media (max-width: 640px) { .toc ol { columns: 1; } }

/* ---------- form ---------- */

.field { display: block; margin-bottom: 1.25rem; }
.field span { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: .45rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: .8rem 1rem; font: inherit; font-size: var(--fs-sm);
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color var(--t-ui), box-shadow var(--t-ui);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}
.field textarea { min-height: 140px; resize: vertical; }

/* ---------- disclaimer bar ---------- */

.disclaimer {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%) translateY(140%);
  width: min(var(--container), 780px); z-index: 120;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 1.25rem 1.5rem;
  display: flex; gap: 1.25rem; align-items: flex-start;
  transition: transform 500ms var(--ease);
}
.disclaimer.is-shown { transform: translateX(-50%) translateY(0); }
.disclaimer p { font-size: var(--fs-sm); color: var(--ink-soft); }
.disclaimer strong { color: var(--ink); }
@media (max-width: 640px) { .disclaimer { flex-direction: column; gap: .9rem; } }

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

.footer { background: var(--surface-2); border-top: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 4.5rem) 0; }
.footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }
.footer h4 { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .6rem; }
.footer li a { color: var(--ink-soft); font-size: var(--fs-sm); }
.footer li a:hover { color: var(--blue); }
.footer__about p { color: var(--ink-soft); font-size: var(--fs-sm); max-width: 42ch; margin-top: 1rem; }

.footer__legal { margin-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--line); padding-block: 1.5rem 2rem; }
.footer__legal p { font-size: var(--fs-xs); color: var(--ink-soft); }
.footer__legal .rule { font-weight: 600; color: var(--ink); }

/* ---------- reveal ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--t-in), transform var(--t-in); transition-delay: var(--d, 0ms); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
