:root {
  --bg: #efe6d6;
  --bg-deep: #e4d8c4;
  --ink: #1b2430;
  --muted: #5e584e;
  --teal: #0e4f4a;
  --teal-soft: #d7ebe6;
  --gold: #8d6420;
  --gold-bright: #e4c27a;
  --coral: #c4543a;
  --card: rgba(255, 251, 245, 0.86);
  --line: rgba(27, 36, 48, 0.12);
  --shadow: 0 24px 60px rgba(40, 32, 18, 0.08);
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
  background:
    radial-gradient(circle at 12% 8%, rgba(228, 194, 122, 0.35), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(14, 79, 74, 0.16), transparent 32%),
    linear-gradient(180deg, #f6f1e6 0%, var(--bg) 40%, #e9dfcd 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(27, 36, 48, 0.05) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
}

a { color: var(--teal); }

a:hover { color: #083632; }

:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 10;
}

.skip:focus { top: 1rem; }

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 5;
  background: #f3ecdf;
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
}

.brand img { width: 2rem; height: 2rem; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  min-width: 0;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.nav a:hover { color: var(--teal); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 2rem;
  align-items: center;
  padding: 3.2rem 0 2rem;
}

.kicker {
  margin: 0 0 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 700;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; }

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  letter-spacing: -0.03em;
}

.lede {
  font-size: 1.35rem;
  color: var(--teal);
  margin: 0.8rem 0 1rem;
}

.byline { color: var(--muted); margin: 0; }

.micelle {
  margin: 0;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2rem;
  box-shadow: var(--shadow);
  padding: 1rem 1rem 1.2rem;
}

.micelle svg { width: 100%; height: auto; display: block; }

.arm { stroke: #0e4f4a; stroke-width: 8; stroke-linecap: round; }
.bead { fill: #7fbfb6; }
.tip { fill: #e4c27a; stroke: #8d6420; stroke-width: 2; }
.core { fill: #123f3b; }
.drug { fill: #e07a62; }
.halo { fill: #e7f3f0; }
.ring { fill: none; stroke: rgba(14, 79, 74, 0.18); stroke-width: 1.5; }

.drug { transform-origin: center; animation: float 7s ease-in-out infinite; }
.drug:nth-child(2) { animation-delay: -1.2s; }
.drug:nth-child(3) { animation-delay: -2.4s; }
.drug:nth-child(4) { animation-delay: -3.6s; }
.drug:nth-child(5) { animation-delay: -4.8s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.legend {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
  gap: 0.7rem 1.1rem;
  justify-content: center;
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.86rem;
}

.legend i {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  margin-right: 0.35rem;
}

.swatch-core { background: #123f3b; }
.swatch-peg { background: #7fbfb6; }
.swatch-epcam { background: #e4c27a; }
.swatch-drug { background: #e07a62; }

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.8rem;
  margin: 0.5rem 0 2.5rem;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: 1rem 0.9rem 0.85rem;
  box-shadow: var(--shadow);
}

.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 1.7rem;
  line-height: 1.2;
  color: var(--teal);
  letter-spacing: -0.03em;
}

.stat span { color: var(--muted); font-size: 0.86rem; }

main section { padding: 1.2rem 0 2rem; }

main h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin: 0 0 0.8rem;
}

.prose {
  max-width: none;
}

.prose p { margin: 0 0 1rem; }

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.step {
  background: var(--teal);
  color: #f6f3ea;
  border-radius: 1.2rem;
  padding: 1rem;
  min-height: 9.5rem;
}

.step em {
  display: block;
  font-style: normal;
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--gold-bright);
}

.step strong { display: block; margin: 0.35rem 0; }

.lead-block {
  display: block;
}

.paper-fig {
  margin: 0.2rem 0 2.6rem;
}

.paper-fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.4rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.note {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--gold-bright);
  background: rgba(255, 251, 245, 0.7);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.4rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
}

.error-page a {
  display: inline-block;
  margin-top: 0.6rem;
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
}

@media (max-width: 900px) {
  .hero, .stats, .steps { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-header .wrap { align-items: stretch; flex-direction: column; padding: 0.8rem 0; min-width: 0; }
  .nav { width: 100%; }
}

@media (max-width: 640px) {
  .hero, .stats, .steps { grid-template-columns: minmax(0, 1fr); }
  .nav { gap: 0.4rem 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drug { animation: none; }
}
