/* ============ HERBARIUM · bright botanical garden ============ */
:root {
  --night: #ffffff;
  --night2: #f7f9ee;
  --night3: #edf3df;
  --bone: #1f3a2a;
  --soft: #51695a;
  --faible: #7e917f;
  --fern: #2e9e44;
  --brass: #f0b429;
  --rust: #e8603a;
  --ln: #cfdfbb;
  --ln-br: rgba(46, 158, 68, .35);
  --ink-line: rgba(31, 58, 42, .06);
  --shadow: 0 18px 46px rgba(60, 90, 40, .12);
  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans: "Karla", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "Space Mono", "SFMono-Regular", Consolas, monospace;
  --rail: 238px;
  --ink: var(--bone);
  --ink-soft: var(--soft);
  --parch: var(--bone);
  --parch2: var(--soft);
  --gold: var(--brass);
  --gold-deep: var(--rust);
  --line: var(--ln);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--bone);
  background-color: var(--night);
  background-image:
    linear-gradient(rgba(247, 249, 238, .74), rgba(247, 249, 238, .82)),
    repeating-linear-gradient(0deg, transparent 0, transparent 27px, var(--ink-line) 27px, var(--ink-line) 28px),
    url('images/background.jpg');
  background-size: auto, auto, cover;
  background-position: center;
  background-attachment: local, local, fixed;
  line-height: 1.9;
  font-size: 16px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: rgba(46, 158, 68, .28); color: #ffffff; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 34px; }

/* Reading progress — a root-thread above the sheet */
.progress {
  position: fixed; top: 0; left: var(--rail); z-index: 99; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--fern), var(--brass));
  opacity: .85;
}

/* ============ Left spine rail ============ */
.topbar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--rail); padding: 44px 24px 30px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(200px 120px at 20% 0%, rgba(46, 158, 68, .22), transparent 70%),
    linear-gradient(180deg, rgba(247, 249, 238, .82) 0%, rgba(255, 255, 255, .94) 70%);
  border-right: 3px double var(--ln);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.topbar::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 2px; width: 1px;
  background: rgba(232, 96, 58, .4);
}
.topbar .container {
  max-width: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; flex: 1;
}
.logo { display: block; color: var(--bone); }
.logo i { font-style: normal; color: var(--fern); font-family: var(--serif); font-size: 30px; line-height: 1; display: block; margin-bottom: 8px; }
.logo strong { display: block; font-family: var(--serif); font-weight: 600; font-size: 24px; letter-spacing: 4px; }
.logo small { display: block; margin-top: 8px; font-family: var(--mono); font-size: 9px; letter-spacing: 1.6px; color: var(--faible); line-height: 1.5; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 46px; counter-reset: key; }
.nav a {
  counter-increment: key;
  padding: 11px 12px 11px 14px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--soft);
  border-left: 1px solid var(--ln);
  transition: all .22s;
}
.nav a::before { content: "0" counter(key); font-size: 9px; letter-spacing: 1px; color: var(--faible); margin-right: 12px; }
.nav a:hover { color: var(--fern); border-left-color: var(--fern); padding-left: 18px; background: linear-gradient(90deg, rgba(46,158,68,.1), transparent); }
.nav a.on { color: var(--fern); border-left: 2px solid var(--fern); padding-left: 13px; background: linear-gradient(90deg, rgba(46,158,68,.16), transparent); }
.nav a.on::before { color: var(--fern); }

.rail-vert {
  margin-top: auto;
  font-family: var(--mono); font-size: 9px; letter-spacing: 2.4px; line-height: 2;
  color: var(--faible); border-top: 1px dashed var(--ln); padding-top: 14px;
}
.rail-vert b { color: var(--brass); font-weight: 400; }

#app, .footer { margin-left: var(--rail); }

/* ============ Footer ============ */
.footer {
  background: linear-gradient(180deg, transparent, rgba(46,158,68,.12)), rgba(247, 249, 238, .86);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-top: 3px double var(--ln);
  margin-top: 96px; padding: 56px 0 30px;
  color: var(--soft); font-size: 14px;
}
.footer .grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 34px; }
.footer h4 { font-family: var(--serif); color: var(--bone); font-size: 16px; letter-spacing: 3px; margin-bottom: 12px; }
.footer h4::before { content: "▚ "; color: var(--fern); }
.footer ul { list-style: none; }
.footer li { padding: 4px 0; }
.footer li a:hover { color: var(--fern); }
.footer .copy { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--ln); text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: 1.4px; color: var(--faible); }

/* ============ Hero — the field table ============ */
.hero {
  position: relative; padding: 108px 0 84px; overflow: hidden;
  background:
    radial-gradient(820px 420px at 90% -8%, rgba(46, 158, 68, .18), transparent 62%),
    radial-gradient(680px 400px at 2% 112%, rgba(240, 180, 41, .16), transparent 62%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(180deg, rgba(31,58,42,.03) 0 1px, transparent 1px 3px);
}
.hero .container { position: relative; }
.hero .kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 5px;
  color: var(--brass); margin-bottom: 20px; text-transform: uppercase;
}
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 5.4vw, 64px); line-height: 1.12; color: var(--bone); }
.hero h1 .mark { position: relative; color: var(--fern); }
.hero h1 .mark::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 4px; height: 3px; background: linear-gradient(90deg, var(--fern), transparent); opacity: .5; }
.hero .lead { max-width: 660px; margin-top: 24px; color: var(--soft); font-size: 15.5px; }
.hero .corner { margin-top: 22px; }
.hero .cree {
  font-family: var(--mono); font-size: 10px; letter-spacing: 3px; color: var(--rust);
  border: 1px dashed rgba(232, 96, 58, .6); padding: 5px 12px; background: rgba(232,96,58,.08);
}
.hero .dimrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.hero .down { margin-top: 56px; color: var(--faible); font-family: var(--mono); font-size: 11px; letter-spacing: 3px; animation: bob 2.2s infinite; }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(6px)} }

/* ============ Sections ============ */
.sec { padding: 62px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.sec-head h2 { font-family: var(--serif); font-size: 30px; font-weight: 500; color: var(--bone); }
.sec-head h2 small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 4px; color: var(--faible); font-weight: 400; margin-top: 6px; text-transform: uppercase; }
.sec-head .more { color: var(--fern); font-size: 13px; border-bottom: 1px dashed rgba(46,158,68,.55); white-space: nowrap; }
.sec-head .more:hover { color: var(--brass); }
.divider { width: 100%; border: 0; border-top: 1px dashed var(--ln); margin: 0; }
.lead { color: var(--soft); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--ln);
  background: var(--night3); color: var(--soft);
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
}
.chip b { color: var(--fern); font-weight: 400; }
.hero-one { margin-top: 22px; font-family: var(--mono); font-size: 13px; letter-spacing: 3px; color: var(--fern); }
.hero-lenses { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-lenses span {
  font-family: var(--mono); font-size: 10px; letter-spacing: 3px; color: var(--soft);
  border: 1px dashed var(--ln-br); padding: 5px 12px; background: rgba(255, 255, 255, .5);
}
.hero-lenses span:nth-child(1) { color: var(--brass); border-color: rgba(240,180,41,.55); }
.hero-lenses span:nth-child(3) { color: var(--fern); border-color: rgba(46,158,68,.55); }
.hero-lenses span:nth-child(5) { color: var(--rust); border-color: rgba(232,96,58,.5); }

/* ============ Grids & taped specimen cards ============ */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 22px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 22px; }

/* The wall — dense sheet mosaic on home */
.gwall { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.wtile {
  position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden;
  border: 1px solid var(--ln); background: var(--night2); transition: transform .25s, border-color .25s, box-shadow .25s;
}
.wtile img.ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.wtile .wtag {
  position: absolute; left: 6px; bottom: 6px; z-index: 2;
  font-family: var(--mono); font-size: 8px; letter-spacing: 2px; color: #ffffff;
  background: rgba(31, 58, 42, .62); padding: 2px 6px;
}
.wtile:hover { transform: translateY(-4px); border-color: var(--ln-br); box-shadow: var(--shadow); }
.wtile:hover img.ph { transform: scale(1.08); }

/* Home shelf card — photo, one line, one lens string */
.hcard {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--night2), var(--night3));
  border: 1px solid var(--ln);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.hcard::before, .hcard::after {
  content: ""; position: absolute; top: -8px; width: 64px; height: 24px; z-index: 7;
  background: rgba(240, 180, 41, .38);
  border-top: 1px dashed rgba(240,180,41,.8);
  border-bottom: 1px dashed rgba(240,180,41,.8);
  box-shadow: 0 3px 8px rgba(60,90,40,.2);
  pointer-events: none;
}
.hcard::before { left: 16px; transform: rotate(-2.5deg); }
.hcard::after { right: 16px; transform: rotate(2.5deg); }
.hcard:hover { transform: translateY(-6px); border-color: var(--ln-br); box-shadow: var(--shadow); }
.hcard .hbody { padding: 14px 16px 16px; }
.hcard h3 { font-family: var(--serif); font-size: 17px; font-weight: 500; line-height: 1.3; color: var(--bone); }
.hcard .hdims { display: block; margin-top: 8px; font-family: var(--mono); font-size: 9px; letter-spacing: 2px; color: var(--brass); }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--night2), var(--night3));
  border: 1px solid var(--ln);
  display: flex; flex-direction: column;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card::before, .card::after {
  content: ""; position: absolute; top: -8px; width: 64px; height: 24px; z-index: 7;
  background: rgba(240, 180, 41, .38);
  border-top: 1px dashed rgba(240,180,41,.8);
  border-bottom: 1px dashed rgba(240,180,41,.8);
  box-shadow: 0 3px 8px rgba(60,90,40,.2);
  pointer-events: none;
}
.card::before { left: 16px; transform: rotate(-2.5deg); }
.card::after { right: 16px; transform: rotate(2.5deg); }
.card:hover { transform: translateY(-6px); border-color: var(--ln-br); box-shadow: var(--shadow); }

/* Specimen plate — pressed photo behind a ruled mount */
.plate {
  position: relative; height: 168px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-bottom: 1px solid var(--ln);
}
.plate img.ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.plate .ring {
  position: absolute; width: 84px; height: 84px; border-radius: 50%; z-index: 2;
  border: 1px dashed rgba(31,58,42,.5);
}
.plate .ring::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; border: 1px solid rgba(31,58,42,.35); }
.plate.hero { height: 330px; border-bottom: 3px double var(--ln); }
.plate.hero .ring { width: 158px; height: 158px; }
.plate.hero .ring::after { inset: 24px; }

.card .body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.card .tags { margin-bottom: 12px; font-size: 12px; }
.tag {
  display: inline-block; padding: 2px 8px; font-size: 10px; margin-right: 6px;
  font-family: var(--mono); background: var(--night3); color: var(--soft);
  border: 1px solid var(--ln); letter-spacing: 1px;
}
.tag.cat { background: none; color: var(--fern); border: 1px dashed rgba(46,158,68,.55); }
.card h3 { font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.3; color: var(--bone); margin-bottom: 8px; }
.card p { font-size: 13.5px; color: var(--soft); flex: 1; }
.card .dims { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.card .dims span { font-size: 10px; font-family: var(--mono); color: var(--brass); }
.card .jump { margin-top: 16px; color: var(--fern); font-size: 12px; font-family: var(--mono); letter-spacing: 1px; }
.card .jump::after { content: "  →"; }

/* ============ Series cases ============ */
.seriesgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 22px; }
.series {
  display: block; position: relative;
  background: linear-gradient(180deg, var(--night2), var(--night3));
  border: 1px solid var(--ln);
  padding: 24px 26px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.series .shead { border-top: 2px solid var(--brass); padding-top: 14px; }
.series:nth-child(even) .shead { border-top-color: var(--fern); }
.series .sno { font-family: var(--mono); font-size: 10px; letter-spacing: 3px; color: var(--rust); text-transform: uppercase; }
.series h3 { font-family: var(--serif); font-size: 26px; font-weight: 500; color: var(--bone); margin-top: 4px; }
.series h3 small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--faible); margin-top: 4px; text-transform: uppercase; }
.series p { font-size: 13.5px; color: var(--soft); margin: 12px 0 16px; }
.series .slist { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.series .sitem { font-size: 13px; color: var(--bone); border-left: 1px solid var(--ln); padding-left: 12px; }
.series .sitem b { color: var(--brass); font-family: var(--mono); font-weight: 400; margin-right: 10px; }
.series .jump { color: var(--fern); font-size: 12px; font-family: var(--mono); letter-spacing: 1px; }
.series:hover { transform: translateY(-4px); border-color: var(--ln-br); box-shadow: var(--shadow); }

/* ============ Page heads & crumbs ============ */
.crumbs { font-size: 12px; font-family: var(--mono); color: var(--faible); }
.crumbs a { color: var(--soft); }
.crumbs a:hover { color: var(--fern); }
.crumbs .sp { margin: 0 8px; color: var(--ln); }
nav.crumbs { padding: 22px 0 18px; border-bottom: 1px dashed var(--ln); }

.pagehead { padding: 60px 0 44px; }
.pagehead h1 { font-family: var(--serif); font-size: clamp(32px, 4.6vw, 52px); font-weight: 500; color: var(--bone); line-height: 1.12; }
.pagehead h1 small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 4px; color: var(--brass); margin-top: 14px; text-transform: uppercase; }
.pagehead .lead { max-width: 780px; margin-top: 20px; font-size: 16px; color: var(--soft); }

.page-head { padding: 48px 0 24px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(28px, 4vw, 44px); font-weight: 500; color: var(--bone); line-height: 1.14; }
.page-head .lead { max-width: 780px; margin-top: 16px; font-size: 16.5px; color: var(--soft); }
.page-head .row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--faible); }
.meta span::before { content: "▓ "; color: var(--rust); }

/* ============ Essay body ============ */
.people p { font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.75; color: var(--bone); max-width: 800px; }
.people { margin: 30px 0 10px; }

.dimblock {
  display: grid; grid-template-columns: 148px 1fr; gap: 24px;
  padding: 24px 0 12px; border-top: 1px solid var(--ln); margin-top: 12px;
}
.dimblock .dn { font-family: var(--mono); font-size: 22px; color: var(--brass); }
.dimblock .dn i { display: block; font-style: normal; font-size: 9px; letter-spacing: 2.5px; color: var(--faible); margin-top: 6px; text-transform: uppercase; }
.dimblock .dc p { font-size: 16.5px; line-height: 1.85; color: var(--bone); }
.dimblock .dc p .hl { color: var(--fern); }
.dimblock .dc p .chip { margin: 0 4px; }

.pull {
  margin: 34px 0 12px; padding: 26px 32px; position: relative;
  background: linear-gradient(135deg, rgba(46,158,68,.08), transparent 60%), var(--night2);
  border: 1px solid var(--ln);
  box-shadow: 6px 6px 0 rgba(60,90,40,.14);
}
.pull::before { content: "“"; position: absolute; top: 2px; left: 12px; font-family: var(--serif); font-size: 60px; color: var(--fern); opacity: .35; }
.pull p { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.5; color: var(--bone); }

.endnote { margin: 26px 0 10px; padding: 16px 20px; background: var(--night3); border: 1px dashed rgba(232,105,50,.45); font-size: 13.5px; color: var(--soft); }
.endnote a { color: var(--fern); border-bottom: 1px dashed rgba(46,158,68,.55); }

/* Series sequence nav */
.seq { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 30px 0 8px; padding: 18px 0; border-top: 1px dashed var(--ln); border-bottom: 1px dashed var(--ln); }
.seq a { color: var(--fern); font-size: 13.5px; max-width: 320px; font-family: var(--mono); letter-spacing: .5px; }
.seq a:hover { color: var(--brass); }
.seq .mid { font-family: var(--mono); font-size: 10px; letter-spacing: 3px; color: var(--faible); }
.seq .void { font-family: var(--mono); font-size: 10px; color: var(--faible); opacity: .6; }

/* ============ Related ============ */
.related { margin-top: 56px; padding: 40px 0 56px; background: linear-gradient(180deg, rgba(46,158,68,.1), transparent 40%), rgba(247, 249, 238, .86); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); border-top: 3px double var(--ln); }
.related h4 { font-family: var(--serif); font-size: 20px; color: var(--bone); margin-bottom: 16px; letter-spacing: 2px; }
.related h4::before { content: "✦ "; color: var(--rust); }
.related a { display: block; padding: 10px 0; border-top: 1px solid var(--ln); color: var(--soft); font-size: 15px; }
.related a:hover { color: var(--fern); padding-left: 10px; }
.related a::before { content: "↪ "; color: var(--brass); }

/* ============ Ladder — the four storeys as a descent ============ */
.ladder { position: relative; margin-top: 42px; padding-left: 30px; }
.ladder::before {
  content: ""; position: absolute; top: 10px; bottom: 10px; left: 13px; width: 2px;
  background: repeating-linear-gradient(180deg, var(--ln) 0 6px, transparent 6px 12px);
}
.rung {
  --lv: 0; --tone: #d9b26a;
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-areas: "no card" ". count";
  column-gap: 18px; row-gap: 6px;
  margin-left: calc(var(--lv) * 34px);
  margin-bottom: 26px;
}
.rung::before {
  content: ""; position: absolute; top: 24px;
  left: calc(-18px - var(--lv) * 34px);
  width: calc(var(--lv) * 34px + 18px); height: 1px;
  background: var(--tone); opacity: .5;
}
.rung-no {
  grid-area: no; position: relative; z-index: 2;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 9px; letter-spacing: .5px; text-align: center;
  color: var(--tone); border: 1px dashed var(--tone);
  background: rgba(255, 255, 255, .85); box-shadow: 0 0 0 5px rgba(247,249,238,.8);
}
.rung-no::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  border: 1px solid rgba(31, 58, 42, .25); pointer-events: none;
}
.rung-card {
  grid-area: card; position: relative;
  background: linear-gradient(90deg, var(--night3), var(--night2));
  border: 1px solid var(--ln); border-left: 3px solid var(--tone);
  padding: 13px 18px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.rung:hover .rung-card { transform: translateX(5px); border-color: var(--ln-br); box-shadow: var(--shadow); }
.rung-tag { font-family: var(--mono); font-size: 9px; letter-spacing: 2px; color: var(--tone); text-transform: uppercase; }
.rung-card h3 { font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--bone); margin: 2px 0 4px; }
.rung-card p { font-size: 12.5px; color: var(--soft); }
.rung-count {
  grid-area: count; justify-self: end;
  font-family: var(--mono); font-size: 20px; letter-spacing: 1px;
  color: var(--tone); opacity: .8; border-bottom: 1px dashed var(--ln); padding: 0 4px;
}
.ladder-note { margin-top: 30px; max-width: 780px; }
.ladder-note b { color: var(--fern); font-weight: 400; }

/* ============ Reveal animation ============ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Accessible focus ring */
a:focus-visible, button:focus-visible, .nav a:focus-visible {
  outline: 3px solid var(--fern);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============ Back to top ============ */
.backtop {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 44px; height: 44px; border-radius: 2px;
  border: 1px solid var(--fern); background: var(--fern); color: #ffffff;
  font-family: var(--mono); font-size: 13px; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
.backtop.show { opacity: 1; pointer-events: auto; }
.backtop:hover { transform: translateY(-3px); background: var(--brass); border-color: var(--brass); }

.still { padding-bottom: 20px; }

/* ============ Responsive — the spine folds into a top bar ============ */
@media (max-width: 900px) {
  .topbar {
    position: static; width: auto; height: auto;
    border-right: 0; border-bottom: 3px double var(--ln);
    padding: 18px 20px 12px;
    flex-direction: row; align-items: flex-start; gap: 18px; flex-wrap: wrap;
  }
  .topbar::after { display: none; }
  .topbar .container { display: contents; }
  .logo, .nav { margin-top: 0; }
  .logo { flex: 1 1 200px; }
  .logo i { display: inline-block; margin: 0 8px 0 0; font-size: 22px; }
  .logo strong { display: inline-block; font-size: 18px; }
  .logo small { margin: 2px 0 0; flex-basis: 100%; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; flex: 1 1 100%; }
  .nav a { border-left: 0; border-bottom: 1px solid var(--ln); padding: 7px 10px; }
  .nav a:hover { padding-left: 10px; }
  .nav a.on { border-left: 0; border-bottom: 2px solid var(--fern); padding-left: 10px; }
  .rail-vert { display: none; }
  #app, .footer { margin-left: 0; }
  .progress { left: 0; }
  .hero { padding: 70px 0 60px; }
  .gwall { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

@media (max-width: 660px) {
  body { background-attachment: local, local, scroll; }
  .grid3, .grid2, .seriesgrid { grid-template-columns: 1fr; }
  .gwall { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .hero-lenses { gap: 6px; }
  .hero-lenses span { padding: 4px 8px; font-size: 9px; }
  .dimblock { grid-template-columns: 1fr; gap: 6px; }
  .footer .grid { grid-template-columns: 1fr; gap: 24px; }
  .plate.hero { height: 230px; }
  .plate.hero .ring { width: 120px; height: 120px; }
  .container { padding: 0 20px; }
  .sec { padding: 40px 0; }
  .ladder { padding-left: 24px; margin-top: 32px; }
  .ladder::before { left: 11px; }
  .rung { margin-left: calc(var(--lv) * 14px); grid-template-columns: 38px 1fr; column-gap: 12px; margin-bottom: 20px; }
  .rung::before { left: calc(-12px - var(--lv) * 14px); width: calc(var(--lv) * 14px + 12px); top: 20px; }
  .rung-no { width: 38px; height: 38px; font-size: 8px; }
  .rung-card h3 { font-size: 17px; }
  .rung-count { font-size: 16px; }
}
/* ===== Folded nav (burger) - green cross ===== */
.nav-burger {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 4px; width: 46px; height: 46px; margin-top: 30px; padding: 0; flex: none;
  background: transparent; border: 1px dashed var(--ln); border-radius: 10px;
  cursor: pointer; transition: background .3s ease, border-color .3s ease, border-style .3s ease;
}
.nav-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--fern); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease, background .3s ease; }
.nav-burger:hover { border-color: var(--fern); border-style: solid; background: rgba(46, 158, 68, .06); }
.nav-burger.is-open { border-style: solid; border-color: var(--fern); background: rgba(46, 158, 68, .1); }
.nav-burger.is-open span { background: var(--fern); }
.nav-burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav {
  max-height: 0; overflow: hidden; opacity: 0; margin-top: 0;
  transition: max-height .3s ease, opacity .25s ease, margin-top .3s ease;
}
.nav.is-open { max-height: 420px; opacity: 1; margin-top: 24px; }
