:root {
  --void: #0b1312;
  --shell: #0f1a18;
  --shell-2: #13211e;
  --hair: #1d2e2a;
  --hair-2: #2a403b;
  --bone: #e3eee9;
  --lichen: #93aba4;
  --moss: #62807a;
  --chloro: #00fe90;
  --lagoon: #01b8c8;

  --sans: "Archivo", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --nav-h: 68px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, dl, dd, figure, fieldset { margin: 0; }
ol { padding: 0; list-style: none; }
em { font-style: normal; }
::selection { background: var(--chloro); color: var(--void); }
:focus-visible { outline: 2px solid var(--chloro); outline-offset: 3px; border-radius: 4px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

#swarm {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
main, .footer { position: relative; z-index: 1; }

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 10px 14px; background: var(--chloro); color: var(--void);
  font-weight: 600; border-radius: 6px; transform: translateY(-150%);
}
.skip:focus { transform: none; }

/* ---------- shared type ---------- */

.eyebrow, .plate-no, .tags, .step-part, .specimen-bar, .traits dt,
.callout-label, .plate-cap, .browser-bar span, .needs legend, .contact-note, .footer {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.plate-no em, .step-part em, .plate-cap em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35em;
  letter-spacing: 0;
  text-transform: none;
  color: var(--chloro);
  margin-right: .5em;
}
.eyebrow, .plate-no { color: var(--lichen); }

h2 {
  font-stretch: 118%;
  font-weight: 760;
  font-size: clamp(2.1rem, 4.6vw, 4.1rem);
  line-height: .98;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h3 {
  font-stretch: 112%;
  font-weight: 680;
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  line-height: 1.12;
  letter-spacing: -.01em;
}
.lede { color: var(--lichen); font-size: clamp(1.02rem, 1.3vw, 1.18rem); max-width: 58ch; text-wrap: pretty; }

.section-head {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  gap: 18px;
}

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

.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: 15px 22px;
  border-radius: 8px;
  font: 600 15px/1 var(--sans);
  font-stretch: 108%;
  text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn span { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.btn:hover span { transform: translateX(4px); }
.btn--solid { background: var(--chloro); color: var(--void); }
.btn--solid:hover { background: #5dffb4; }
.btn--line { border: 1px solid var(--hair-2); color: var(--bone); }
.btn--line:hover { border-color: var(--chloro); color: var(--chloro); }
.btn--sm { padding: 11px 16px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions--center { justify-content: center; }

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

.nav {
  position: fixed; inset: 0 0 auto; z-index: 10;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  transition: background-color .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgb(11 19 18 / .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--hair);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 38px; height: 25px; }
.brand-name { font-stretch: 125%; font-weight: 800; font-size: 21px; letter-spacing: .01em; }
.nav-links { display: flex; gap: 32px; margin-left: auto; }
.nav-links a {
  text-decoration: none; color: var(--lichen); font-size: 15px;
  transition: color .2s;
}
.nav-links a:hover { color: var(--bone); }

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

.hero {
  min-height: 100svh;
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 12px) var(--gutter) clamp(28px, 5vh, 56px);
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  gap: clamp(16px, 3vh, 32px);
}
/* Registration marks: the beetle is drawn by the canvas inside this frame, like a specimen plate. */
.plate {
  position: relative;
  --m: var(--hair-2);
  background:
    linear-gradient(var(--m), var(--m)) top left / 18px 1px,
    linear-gradient(var(--m), var(--m)) top left / 1px 18px,
    linear-gradient(var(--m), var(--m)) top right / 18px 1px,
    linear-gradient(var(--m), var(--m)) top right / 1px 18px,
    linear-gradient(var(--m), var(--m)) bottom left / 18px 1px,
    linear-gradient(var(--m), var(--m)) bottom left / 1px 18px,
    linear-gradient(var(--m), var(--m)) bottom right / 18px 1px,
    linear-gradient(var(--m), var(--m)) bottom right / 1px 18px;
  background-repeat: no-repeat;
}
.plate-cap {
  position: absolute; bottom: 14px;
  color: var(--moss); font-size: 11px;
}
.plate-cap--l { left: 18px; }
.plate-cap--r { right: 18px; text-decoration: none; transition: color .2s; }
.plate-cap--r:hover { color: var(--chloro); }

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: end;
  column-gap: clamp(24px, 5vw, 80px);
  row-gap: 18px;
}
.hero-copy .eyebrow { grid-row: 1; grid-column: 1 / -1; }
/* Title spans both columns; the aside tucks in beside the shorter last lines. */
.hero-title {
  grid-row: 2;
  grid-column: 1 / -1;
  font-weight: 800;
  font-size: clamp(2.5rem, min(6.2vw, 10vh), 5.6rem);
  line-height: .9;
  letter-spacing: -.025em;
}
/* The headline opens like the elytra: condensed to expanded, in sync with the beetle. */
.hero-line {
  display: block;
  white-space: nowrap;
  font-stretch: 125%;
  animation: unfold 1.3s cubic-bezier(.16, 1, .3, 1) both;
}
.hero-line:nth-child(1) { animation-delay: .75s; }
.hero-line:nth-child(2) { animation-delay: .85s; }
.hero-line:nth-child(3) { animation-delay: .95s; color: var(--chloro); }
@keyframes unfold {
  from { font-stretch: 62%; opacity: 0; }
  30% { opacity: 1; }
  to { font-stretch: 125%; opacity: 1; }
}
.hero-aside { grid-row: 2; grid-column: 2; align-self: end; display: grid; gap: 24px; color: var(--lichen); max-width: 44ch; }
.hero-copy .eyebrow, .hero-aside { animation: rise .9s cubic-bezier(.2, .8, .2, 1) 1.2s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- anatomy (scrollytelling) ---------- */

.anatomy { padding-top: clamp(96px, 16vh, 200px); }
.anatomy-body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
}
.anatomy-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  align-self: start;
}
.anatomy-steps { padding: 20vh 0 30vh; }
.step {
  min-height: 78svh;
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  max-width: 46ch;
  opacity: .22;
  transition: opacity .5s;
}
.step.is-active { opacity: 1; }
.step-part { color: var(--lichen); }
.step > p:not([class]) { color: var(--lichen); }
.tags { color: var(--moss); font-size: 11px; line-height: 1.8; }

.callout {
  position: absolute; left: 0; top: 0;
  opacity: 0;
  transition: opacity .4s;
  will-change: transform;
}
.callout.is-on { opacity: 1; }
.callout-dot {
  position: absolute; left: -5px; top: -5px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid var(--bone);
  box-shadow: 0 0 0 4px rgb(0 254 144 / .15);
}
.callout-label {
  position: absolute; top: -9px;
  white-space: nowrap;
  color: var(--bone); font-size: 11px;
  display: flex; align-items: center; gap: 10px;
}
.callout-label::before {
  content: ""; width: 56px; height: 1px; background: var(--bone); opacity: .6;
}
.callout[data-dir="right"] .callout-label { left: 10px; }
.callout[data-dir="left"] .callout-label { right: 10px; flex-direction: row-reverse; }

/* ---------- collection ---------- */

.collection { padding-top: clamp(80px, 12vh, 160px); }
.specimens {
  max-width: var(--max);
  margin: clamp(40px, 7vh, 80px) auto 0;
  padding: 0 var(--gutter);
  display: grid;
  gap: clamp(24px, 10vh, 120px);
}
.specimen {
  --accent: var(--chloro);
  background: var(--shell);
  border: 1px solid var(--hair);
  border-radius: 18px;
  padding: clamp(18px, 2.4vw, 32px);
  box-shadow: 0 -24px 60px -30px rgb(0 0 0 / .8);
}
.specimen-bar {
  display: flex; justify-content: space-between; gap: 16px;
  color: var(--moss); font-size: 11px;
  padding-bottom: 14px; margin-bottom: clamp(20px, 3vw, 36px);
  border-bottom: 1px solid var(--hair);
}
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--lichen); }
.status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
}
.specimen-body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}
.specimen-media { position: relative; padding: 0 9% 9% 0; }
.browser {
  border: 1px solid var(--hair-2);
  border-radius: 10px;
  overflow: hidden;
  background: var(--void);
}
.browser-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--hair);
}
.browser-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--hair-2); }
.browser-bar span { margin-left: 10px; font-size: 10px; letter-spacing: .06em; text-transform: none; color: var(--moss); }
.phone {
  position: absolute; right: 0; bottom: 0;
  width: 26%;
  border: 5px solid #050908;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 50px -12px rgb(0 0 0 / .85), 0 0 0 1px var(--hair-2);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.specimen:hover .phone { transform: translateY(-10px) rotate(-1.5deg); }

.specimen-info { display: grid; gap: 16px; align-content: center; }
.specimen-info h3 { font-size: clamp(1.9rem, 3.2vw, 2.9rem); font-stretch: 120%; font-weight: 780; }
.specimen-tagline { font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.3; color: var(--bone); }
.specimen-info > p:not([class]) { color: var(--lichen); }
.traits { display: grid; border-top: 1px solid var(--hair); }
.traits div {
  display: grid; grid-template-columns: 11ch 1fr; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--hair);
}
.traits dt { color: var(--moss); font-size: 11px; padding-top: 3px; }
.traits dd { font-size: 15px; }
.specimen-link {
  justify-self: start;
  margin-top: 6px;
  color: var(--bone);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  transition: color .2s;
}
.specimen-link:hover { color: var(--accent); }

/* Specimens stack like drawers in a collection cabinet. */
@media (min-width: 900px) and (min-height: 700px) {
  .specimens { gap: 26vh; }
  .specimen { position: sticky; top: calc(var(--nav-h) + 16px + var(--i) * 14px); }
}

/* ---------- method ---------- */

.method { padding-top: clamp(120px, 18vh, 220px); }
.stages {
  max-width: var(--max);
  margin: clamp(48px, 8vh, 88px) auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 44px);
  position: relative;
}
.stages::before, .stages::after {
  content: "";
  position: absolute; top: 32px; height: 1px;
  left: calc(var(--gutter) + 72px); right: var(--gutter);
}
.stages::before { background: var(--hair-2); }
.stages::after {
  background: linear-gradient(90deg, var(--chloro), var(--lagoon));
  transform: scaleX(0); transform-origin: left;
  transition: transform 2.2s cubic-bezier(.6, 0, .2, 1);
}
.stages.is-in::after { transform: scaleX(1); }
.stage { display: grid; gap: 12px; align-content: start; position: relative; }
.stage-icon {
  width: 64px; height: 64px;
  fill: none; stroke: url(#icon-grad); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  background: var(--void);
  margin-bottom: 8px;
  position: relative; z-index: 1;
}
.stage-icon--imago { stroke: none; }
.stage-name { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--chloro); line-height: 1; }
.stage > p:not([class]) { color: var(--lichen); font-size: 16px; }

/* ---------- contact ---------- */

.contact {
  padding: clamp(100px, 14vh, 180px) var(--gutter) clamp(80px, 12vh, 140px);
  text-align: center;
}
.contact-stage { height: clamp(200px, 34vh, 360px); max-width: 760px; margin: 0 auto 12px; }
.contact-body { max-width: 760px; margin: 0 auto; display: grid; gap: 22px; justify-items: center; }
.contact .lede { margin: 0 auto; }

.needs { border: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.needs legend { width: 100%; color: var(--moss); font-size: 11px; margin-bottom: 14px; }
.needs label { position: relative; cursor: pointer; }
.needs input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.needs span {
  display: block; padding: 9px 16px;
  border: 1px solid var(--hair-2); border-radius: 999px;
  font-size: 15px; color: var(--lichen);
  transition: all .2s;
}
.needs label:hover span { border-color: var(--moss); color: var(--bone); }
.needs input:checked + span { border-color: var(--chloro); color: var(--chloro); background: rgb(0 254 144 / .07); }
.needs input:focus-visible + span { outline: 2px solid var(--chloro); outline-offset: 3px; }
.contact-note { color: var(--moss); font-size: 11px; text-transform: none; letter-spacing: .04em; }
.contact-note a { color: var(--lichen); }

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

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px var(--gutter) 48px;
  border-top: 1px solid var(--hair);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px;
  color: var(--moss); font-size: 11px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--bone); margin-right: auto; }
.footer-brand .brand-name { font-family: var(--sans); text-transform: none; letter-spacing: .01em; font-size: 18px; }
.footer a { color: var(--lichen); }
.footer a:hover { color: var(--chloro); }

/* ---------- responsive ---------- */

/* Between phone and wide desktop the first headline line would collide with the aside. */
@media (min-width: 900px) and (max-width: 1279px) {
  .hero-aside {
    grid-row: 3; grid-column: 1 / -1;
    max-width: none;
    display: flex; justify-content: space-between; align-items: end; gap: 32px;
  }
  .hero-aside p { max-width: 40ch; }
}

@media (max-width: 899px) {
  .nav-links { display: none; }
  .hero-copy { grid-template-columns: minmax(0, 1fr); }
  .hero-title { font-size: min(4.4rem, calc((100vw - 2 * var(--gutter)) / 10)); }
  .hero-aside { grid-row: 3; grid-column: 1; max-width: none; }
  .plate-cap--l { display: none; }

  .anatomy-body { grid-template-columns: 1fr; }
  .anatomy-stage { top: var(--nav-h); height: 40svh; z-index: 1; }
  /* On phones the steps scroll under the pinned beetle: main.js lifts the canvas above the page
     while this stage owns it, and the stage masks the text passing beneath. */
  .swarm-front #swarm { z-index: 2; }
  .swarm-front .anatomy-stage { background: linear-gradient(var(--void) 88%, transparent); }
  .anatomy-steps { padding: 4svh 0 24svh; }
  .step { min-height: 60svh; justify-content: flex-start; padding-top: 4svh; opacity: .12; }

  .specimen-body { grid-template-columns: 1fr; }

  .stages { grid-template-columns: 1fr; gap: 40px; }
  .stages::before, .stages::after {
    top: 32px; bottom: 0; left: calc(var(--gutter) + 32px); right: auto;
    width: 1px; height: auto;
  }
  .stages::after { background: linear-gradient(var(--chloro), var(--lagoon)); transform: scaleY(0); transform-origin: top; }
  .stages.is-in::after { transform: scaleY(1); }
  .stage { grid-template-columns: 64px 1fr; column-gap: 20px; }
  .stage > :not(.stage-icon) { grid-column: 2; }
  .stage-icon { grid-row: 1 / span 3; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .nav .btn--sm { padding: 10px 13px; font-size: 13px; }
  .brand-name { font-size: 19px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .traits div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
