/* ==========================================================================
   Insect Diversity Archive
   A specimen drawer under lamplight: deep moss-black ground, bone paper,
   and a three-stop chromatic ramp that encodes the disturbance gradient.
   ========================================================================== */

:root {
  /* ground */
  --ink:        #0C1512;
  --ink-2:      #131F1A;
  --ink-3:      #1A2A23;
  --ink-glass:  rgba(12, 21, 18, .82);

  /* paper */
  --bone:       #EDE7DA;
  --bone-dim:   #C6CFC8;
  --muted:      #8E9C94;
  --line:       rgba(237, 231, 218, .13);
  --line-strong:rgba(237, 231, 218, .28);

  /* the gradient — canopy green to laterite red */
  --lvl-1:      #4E7C59;
  --lvl-2:      #C9A227;
  --lvl-3:      #B4552D;
  --brass:      #C9A227;
  --brass-dim:  #8C7220;

  /* type */
  --display: 'Bodoni Moda', 'Times New Roman', serif;
  --body:    'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:    'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* measure */
  --gutter: clamp(20px, 5vw, 64px);
  --wide: 1360px;
  --text: 68ch;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

::selection { background: var(--brass); color: #14100A; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 999;
  background: var(--brass); color: #14100A; padding: 10px 16px; border-radius: 2px;
}
.skip-link:focus { left: 12px; }

/* --------------------------------------------------------------------------
   Type scale
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}

.display-xl { font-size: clamp(38px, 8.4vw, 104px); }
.display-l  { font-size: clamp(30px, 5.4vw, 60px); }
.display-m  { font-size: clamp(24px, 3.4vw, 38px); }
.display-s  { font-size: clamp(20px, 2.4vw, 27px); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--brass);
  display: block;
}

.eyebrow-quiet { color: var(--muted); }

.lede {
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.6;
  color: var(--bone-dim);
  max-width: 56ch;
}

.prose { max-width: var(--text); color: var(--bone-dim); }
.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--bone); font-weight: 600; }
.prose em { font-style: italic; }

.mono { font-family: var(--mono); }

.sci {
  font-family: var(--display);
  font-style: italic;
}

.muted { color: var(--muted); }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.shell { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.shell-narrow { max-width: 880px; }

.section { padding: clamp(56px, 9vw, 120px) 0; }
.section-tight { padding: clamp(36px, 6vw, 72px) 0; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.section-head .eyebrow { margin-bottom: 10px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ink-glass);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.wordmark { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wordmark svg { flex: none; }
.wordmark-text { min-width: 0; }
.wordmark-title {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: .01em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wordmark-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav a {
  font-size: 14px;
  letter-spacing: .02em;
  color: var(--bone-dim);
  padding: 6px 0;
  position: relative;
  transition: color .25s var(--ease);
}
.nav a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--brass);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease-out);
}
.nav a:hover { color: var(--bone); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--bone); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line-strong);
  color: var(--bone); width: 42px; height: 38px; border-radius: 2px;
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle span { display: block; width: 17px; height: 1px; background: currentColor; position: relative; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ''; position: absolute; left: 0; width: 17px; height: 1px; background: currentColor;
  transition: transform .3s var(--ease);
}
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after  { top: 5px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(5px) rotate(45deg); }
.nav-open .nav-toggle span::after  { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 22px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s var(--ease), transform .28s var(--ease);
  }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .nav a::after { display: none; }
  .nav-open .nav { opacity: 1; transform: none; pointer-events: auto; }
}

/* --------------------------------------------------------------------------
   The gradient rail — the study's structural device
   -------------------------------------------------------------------------- */

.gradient-rail {
  height: 2px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.gradient-rail span { display: block; }
.gradient-rail span:nth-child(1) { background: linear-gradient(90deg, var(--lvl-1), var(--lvl-1)); }
.gradient-rail span:nth-child(2) { background: linear-gradient(90deg, var(--lvl-1), var(--lvl-2)); }
.gradient-rail span:nth-child(3) { background: linear-gradient(90deg, var(--lvl-2), var(--lvl-3)); }

/* --------------------------------------------------------------------------
   Hero — the 3D specimen field
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: min(88vh, 780px);
  display: flex;
  align-items: flex-end;
  padding: clamp(90px, 16vh, 170px) 0 clamp(44px, 7vw, 80px);
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-canvas canvas { display: block; width: 100%; height: 100%; }

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 78% 18%, rgba(201,162,39,.09), transparent 62%),
    linear-gradient(180deg, rgba(12,21,18,.55) 0%, rgba(12,21,18,.1) 38%, rgba(12,21,18,.92) 100%);
}

.hero-body { position: relative; z-index: 2; width: 100%; }

.hero-title {
  max-width: 15ch;
  text-wrap: balance;
}
.hero-title .fig {
  font-style: italic;
  color: var(--brass);
}

.hero-lede { margin-top: clamp(20px, 3vw, 30px); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 34px;
  margin-top: clamp(30px, 5vw, 48px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-meta b { color: var(--bone); font-weight: 500; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.scroll-cue {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(44px, 7vw, 80px);
  z-index: 2;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.scroll-cue::after {
  content: '';
  width: 46px; height: 1px; background: var(--line-strong);
  transform-origin: right;
  animation: cue 2.6s var(--ease) infinite;
}
@keyframes cue { 0%,100% { transform: scaleX(.35); opacity: .5 } 50% { transform: scaleX(1); opacity: 1 } }

@media (max-width: 700px) { .scroll-cue { display: none; } }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--bone);
  background: transparent;
  cursor: pointer;
  transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.btn:hover { border-color: var(--brass); color: var(--brass); }
.btn-solid { background: var(--brass); border-color: var(--brass); color: #14100A; font-weight: 500; }
.btn-solid:hover { background: #DBB232; border-color: #DBB232; color: #14100A; }
.btn-sm { padding: 9px 16px; font-size: 12px; }

/* --------------------------------------------------------------------------
   Gallery plates
   -------------------------------------------------------------------------- */

.plate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: clamp(18px, 2.4vw, 34px);
}

.plate {
  position: relative;
  display: block;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform .5s var(--ease-out), border-color .4s var(--ease), box-shadow .5s var(--ease-out);
  will-change: transform;
}
.plate:hover {
  border-color: var(--line-strong);
  box-shadow: 0 26px 60px -30px rgba(0,0,0,.9);
}

.plate-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0A100E;
}
.plate-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease-out), filter .6s var(--ease);
  filter: saturate(.92) contrast(1.02);
}
.plate:hover .plate-frame img { transform: scale(1.055); filter: saturate(1.05) contrast(1.04); }

.plate-frame::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10,16,14,.78) 100%);
  opacity: .9;
  pointer-events: none;
}

.plate-count {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  padding: 4px 8px;
  background: rgba(12,21,18,.78);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--bone-dim);
}

.plate-body { padding: 16px 18px 18px; }

.plate-taxon {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
}
.plate-taxon .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); flex: none; }

.plate-name {
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.2;
  margin-bottom: 5px;
}
.plate-genus {
  font-family: var(--display);
  font-style: italic;
  font-size: 14.5px;
  color: var(--brass);
}

.plate-sites {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

/* Site chips carry the gradient colour — the same ramp everywhere */
.site-chip {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: .95;
}
.site-chip.lvl-1 { color: var(--lvl-1); }
.site-chip.lvl-2 { color: var(--lvl-2); }
.site-chip.lvl-3 { color: var(--lvl-3); }
.site-chip.solid.lvl-1 { background: var(--lvl-1); color: #071009; border-color: var(--lvl-1); }
.site-chip.solid.lvl-2 { background: var(--lvl-2); color: #16100A; border-color: var(--lvl-2); }
.site-chip.solid.lvl-3 { background: var(--lvl-3); color: #170A05; border-color: var(--lvl-3); }

/* --------------------------------------------------------------------------
   Filters
   -------------------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(28px, 4vw, 44px);
}

.field {
  position: relative;
  display: flex;
  align-items: center;
}
.field select, .field input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 10px 34px 10px 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color .3s var(--ease);
}
.field input[type="search"] {
  text-transform: none;
  letter-spacing: .02em;
  padding-right: 14px;
  min-width: 190px;
  cursor: text;
  font-size: 16px; /* stops iOS zooming on focus */
}
.field select:hover, .field input:hover { border-color: var(--line-strong); }
.field::after {
  content: '';
  position: absolute; right: 14px; top: 50%;
  width: 6px; height: 6px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.field.no-caret::after { display: none; }

.filter-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Species page
   -------------------------------------------------------------------------- */

.record { padding-top: clamp(28px, 5vw, 56px); }

.record-layout {
  display: grid;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
@media (min-width: 960px) {
  .record-layout { grid-template-columns: minmax(0, 1.32fr) minmax(300px, .68fr); }
  .record-aside { position: sticky; top: 96px; }
}

/* slideshow */
.stage {
  position: relative;
  background: #080D0B;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  aspect-ratio: 3 / 2;
}
.stage-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s var(--ease), transform 7s linear;
  transform: scale(1.045);
}
.stage-slide.is-active { opacity: 1; transform: scale(1); z-index: 1; }
.stage-slide img { width: 100%; height: 100%; object-fit: cover; }

.stage-nav {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.stage-nav button {
  pointer-events: auto;
  width: 52px; height: 100%;
  background: transparent;
  border: 0;
  color: var(--bone);
  cursor: pointer;
  opacity: 0;
  transition: opacity .3s var(--ease), background .3s var(--ease);
}
.stage:hover .stage-nav button, .stage-nav button:focus-visible { opacity: 1; }
.stage-nav button:hover { background: linear-gradient(90deg, rgba(8,13,11,.6), transparent); }
.stage-nav button:last-child:hover { background: linear-gradient(270deg, rgba(8,13,11,.6), transparent); }

.stage-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  padding: 46px 20px 16px;
  background: linear-gradient(180deg, transparent, rgba(8,13,11,.9));
  font-size: 13.5px;
  color: var(--bone-dim);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  pointer-events: none;
}
.stage-index { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--muted); flex: none; }

.zoom-hint {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 4;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  background: rgba(12,21,18,.72);
  border: 1px solid var(--line);
  padding: 5px 9px;
  border-radius: 2px;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.stage:hover .zoom-hint { opacity: 1; }

.thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.thumbs button {
  flex: none;
  width: 82px; height: 60px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: none;
  overflow: hidden;
  cursor: pointer;
  opacity: .5;
  transition: opacity .3s var(--ease), border-color .3s var(--ease);
}
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button.is-active { opacity: 1; border-color: var(--brass); }
.thumbs button:hover { opacity: .85; }

.record-title { margin-bottom: 6px; }
.record-binomial {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(19px, 2.4vw, 25px);
  color: var(--brass);
}

.spec-list {
  margin: clamp(26px, 4vw, 38px) 0 0;
  border-top: 1px solid var(--line);
}
.spec-row {
  display: grid;
  grid-template-columns: minmax(96px, 130px) 1fr;
  gap: 14px 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.spec-key {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec-val { font-size: 15.5px; color: var(--bone); }
.spec-val .sci { color: var(--brass); }

.record-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  margin-top: clamp(40px, 6vw, 72px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.record-nav a { color: var(--bone-dim); transition: color .3s var(--ease); }
.record-nav a:hover { color: var(--brass); }
.record-nav .dir { display: block; color: var(--muted); margin-bottom: 5px; font-size: 10px; }

/* specimen turntable */
.turntable {
  aspect-ratio: 1 / 1;
  max-height: 300px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: radial-gradient(70% 70% at 50% 38%, var(--ink-3), var(--ink-2) 70%);
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
}
.turntable canvas { width: 100%; height: 100%; display: block; }
.turntable-label {
  position: absolute; left: 12px; bottom: 10px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 10, 9, .96);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.lightbox.is-open { display: flex; }
.lightbox.is-visible { opacity: 1; }
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  border: 1px solid var(--line);
  transform: scale(.97);
  transition: transform .4s var(--ease-out);
}
.lightbox.is-visible img { transform: scale(1); }
.lightbox-caption {
  position: absolute;
  left: 0; right: 0; bottom: 22px;
  text-align: center;
  font-size: 13.5px;
  color: var(--bone-dim);
  padding: 0 20px;
}
.lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--bone);
  border-radius: 2px;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.lightbox-step {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 46px; height: 76px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--bone);
  cursor: pointer;
  border-radius: 2px;
}
.lightbox-step.prev { left: 14px; }
.lightbox-step.next { right: 14px; }

/* --------------------------------------------------------------------------
   Site cards & gradient chart
   -------------------------------------------------------------------------- */

.site-cards {
  display: grid;
  gap: clamp(16px, 2.4vw, 28px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.site-card {
  position: relative;
  padding: clamp(24px, 3vw, 34px);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  transition: transform .45s var(--ease-out), border-color .35s var(--ease);
}
.site-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.site-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.site-card.lvl-1::before { background: var(--lvl-1); }
.site-card.lvl-2::before { background: var(--lvl-2); }
.site-card.lvl-3::before { background: var(--lvl-3); }

.site-card-figure {
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 62px);
  line-height: 1;
  margin: 18px 0 4px;
}
.site-card.lvl-1 .site-card-figure { color: var(--lvl-1); }
.site-card.lvl-2 .site-card-figure { color: var(--lvl-2); }
.site-card.lvl-3 .site-card-figure { color: var(--lvl-3); }

.site-card-unit {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* richness chart */
.richness { display: grid; gap: 18px; margin-top: 8px; }
.richness-row { display: grid; grid-template-columns: minmax(72px, 108px) 1fr auto; gap: 16px; align-items: center; }
.richness-label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--bone-dim); }
.richness-track { height: 10px; background: var(--ink-3); border-radius: 999px; overflow: hidden; }
.richness-bar {
  height: 100%;
  border-radius: 999px;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.2s var(--ease-out);
}
.richness-row.is-in .richness-bar { transform: scaleX(1); }
.richness-bar.lvl-1 { background: var(--lvl-1); }
.richness-bar.lvl-2 { background: var(--lvl-2); }
.richness-bar.lvl-3 { background: var(--lvl-3); }
.richness-value { font-family: var(--mono); font-size: 13px; color: var(--bone); min-width: 3ch; text-align: right; }

/* order breakdown */
.order-bars { display: grid; gap: 12px; }
.order-row { display: grid; grid-template-columns: minmax(88px, 132px) 1fr auto; gap: 14px; align-items: center; font-size: 14px; }
.order-track { height: 6px; background: var(--ink-3); border-radius: 999px; overflow: hidden; }
.order-fill { height: 100%; background: linear-gradient(90deg, var(--brass-dim), var(--brass)); transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease-out); }
.order-row.is-in .order-fill { transform: scaleX(1); }
.order-name { font-family: var(--display); font-style: italic; font-size: 16px; }
.order-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.colophon {
  border-top: 1px solid var(--line);
  padding: clamp(44px, 6vw, 72px) 0 40px;
  margin-top: clamp(48px, 8vw, 100px);
}
.colophon-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.colophon h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 400;
}
.colophon a { color: var(--bone-dim); transition: color .25s var(--ease); }
.colophon a:hover { color: var(--brass); }
.colophon ul { list-style: none; margin: 0; padding: 0; }
.colophon li { margin-bottom: 8px; font-size: 14.5px; }
.colophon-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Empty state & notices
   -------------------------------------------------------------------------- */

.empty {
  padding: clamp(48px, 8vw, 90px) 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 2px;
}
.empty h3 { margin-bottom: 10px; }
.empty p { color: var(--muted); max-width: 44ch; margin: 0 auto 22px; }

/* --------------------------------------------------------------------------
   Page transition
   -------------------------------------------------------------------------- */

.page-veil {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s var(--ease);
}
.is-leaving .page-veil { opacity: 1; }

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .richness-bar, .order-fill { transform: scaleX(1); }
  .stage-slide { transform: none; }
}

@media print {
  .masthead, .hero-canvas, .turntable, .stage-nav, .thumbs, .colophon { display: none !important; }
  body { background: #fff; color: #000; }
}
