@import url("https://fonts.googleapis.com/css2?family=Cactus+Classical+Serif&family=Inter:wght@400;500;600&family=Geist+Mono:wght@400;500&family=Onest:wght@300..600&display=swap");

:root {
  color-scheme: dark;
  --paper: #181818;
  --paper-raised: #31363f;
  --ink: #eeeeee;
  --ink-soft: #adb2ba;
  --rule: #434955;
  --stone: #c4c8ce;
  --stone-light: #e0e3e7;
  --teal: #76abae;
  --measured: #6fd19d;
  --measured-bg: #22362d;
  --estimated: #e0b45c;
  --estimated-bg: #38301c;
  --flagged: #e2705c;
  --flagged-bg: #3a251f;
  --lilac: #c8b6e6;
  --lilac-rgb: 200, 182, 230;
  --na: var(--stone);
  --na-bg: var(--rule);
  --max-width: 1080px;
  --radius: 2px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Onest", system-ui, sans-serif;

  font-size: 1rem;
  line-height: 1.55;
}

/* ---------- Responsive type: bump the root on phones ---------- */
@media (max-width: 600px) {
  html {
    font-size: 17.5px;
  }

  html .lifecycle-kicker,
  html .stage-panel-kicker,
  html .filter-field label,
  html .stamp {
    font-size: 0.72rem;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 12px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

a {
  color: var(--stone-light);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--teal);
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: "Cactus Classical Serif", Georgia, serif;
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 0.4em;
  color: var(--ink);
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;

  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.modal-panel .wrap {
  padding-inline: 0;
}

/* ---------- Site hero (identical on landing, About, Collection) ---------- */

.site-hero {
  border-bottom: 1px solid var(--rule);
  padding: 28px 0 30px;
  text-align: center;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
}

.site-nav-link {
  font-family: "Onest", system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--ink-soft);
}

.site-nav-link:hover {
  color: var(--teal);
}

.site-nav-link[aria-current="page"] {
  color: var(--stone-light);
  border-bottom: 1px solid var(--teal);
  padding-bottom: 2px;
}

.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-style: normal;
  font-weight: 400;
  letter-spacing: -0.035em;
  margin: 0 0 10px;
}

.hero-title a {
  color: inherit;
  text-decoration: none;
}

.hero-title a:hover {
  color: var(--teal);
}

.hero-subtitle {
  font-family: "Cactus Classical Serif", Georgia, serif;
  font-style: normal;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0;
  opacity: 0.5;
}

.hero-subtitle::before {
  content: "— ";
}
.hero-subtitle::after {
  content: " —";
}

/* ---------- Landing background video ---------- */

.landing-bg {
  display: none;
}

@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .landing-bg {
    display: block;
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: var(--paper);
  }

  .landing-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;

    filter: brightness(0.72) saturate(0.95);
  }

  .landing-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(
        ellipse 75% 55% at 50% 40%,
        rgba(18, 18, 18, 0.74),
        rgba(18, 18, 18, 0.42) 70%
      ),
      linear-gradient(rgba(18, 18, 18, 0.4), rgba(18, 18, 18, 0.54));
  }

  .landing .landing-actions {
    font-size: 1rem;
  }
  .landing .landing-blurb {
    color: var(--ink);
    font-size: 1rem;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
  }
  .landing .hero-subtitle {
    opacity: 0.72;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  }
  .landing .hero-title,
  .landing .footer-meta {
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
  }
}

/* ---------- Landing page ---------- */

.landing .site-hero {
  border-bottom: none;
}
.landing .site-footer {
  border-top: none;
}

.landing-main {
  text-align: center;
  padding-block: 40px 52px;
}

.landing-blurb {
  max-width: 62ch;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.landing-blurb p {
  margin: 0 0 1em;
}
.landing-blurb p:last-child {
  margin-bottom: 0;
}

.landing-actions {
  margin-top: 4em;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  /* Same measure as .landing-blurb (62ch at its font size) so the cards
   * line up with the text above. */
  font-size: 0.95rem;
  max-width: 62ch;
  margin-inline: auto;
}
@media (max-width: 600px) {
  .landing-actions {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.landing-card {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  text-align: left;
  padding: 20px 22px;
  border: 1px solid var(--ink-soft);
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}
.landing-card h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-family: "Onest", system-ui, sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.landing-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.5;
}
.landing-card-arrow {
  flex: none;
  display: flex;
  transition: transform 0.15s ease;
}
.landing-card-arrow svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.landing-card:hover,
.landing-card:focus-visible {
  border-color: var(--teal);
  color: var(--teal);
}
.landing-card:hover .landing-card-arrow,
.landing-card:focus-visible .landing-card-arrow {
  transform: translateX(4px);
}

.btn {
  text-align: center;
  border-radius: 6px;
  border-width: 2px;
}

.btn {
  font-family: "Onest", system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 13px 26px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--stone-light);
  border-color: var(--stone-light);
  color: var(--paper);
}

/* Cursor-following tooltip (desktop, hover-capable pointers only) */

.cursor-tip {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  transform: translate(0, 0);
  pointer-events: none;
  background: var(--ink);
  color: var(--paper-raised);
  font-family: "Geist Mono", monospace;
  font-size: 0.76rem;
  padding: 6px 11px;
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cursor-tip.visible {
  opacity: 1;
}

/* ---------- Page intro (About + Collection) ---------- */

.page-intro {
  max-width: 60rem;
  margin: 30px auto 0;

  text-align: center;
}

/* ---------- About / BTS page ---------- */

#about-what-is-h3 {
  color: var(--teal);
  font-size: 1.4em;
}

.about-main {
  padding-bottom: 60px;

  font-weight: 300;
}

.about-main strong {
  font-weight: 600;
}

.about-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 44px;
  margin-top: 40px;
}

.about-nav {
  position: sticky;
  top: 24px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--rule);
  padding-right: 20px;
}

.about-nav-toggle,
.about-nav-close,
.about-nav-backdrop,
.about-nav-fab,
.about-top-fab {
  display: none;
}
.about-nav-dialog {
  display: contents;
}

/* ---------- About sidebar: collapsed to a centred popup (≤900px) ---------- */

@media (max-width: 900px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 28px;
  }

  .about-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 0 0 16px;
  }

  .about-layout.nav-drawer .about-nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: start;
    justify-self: center;
    margin-bottom: 34px;
    padding: 9px 18px;
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: "Geist Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    cursor: pointer;
  }
  .about-layout.nav-drawer .about-nav-toggle:hover {
    border-color: var(--teal);
    color: var(--teal);
  }
  .about-layout.nav-drawer .about-nav-toggle::before {
    content: "";
    flex: none;
    width: 15px;
    height: 2px;
    background: currentColor;
    box-shadow:
      0 5px currentColor,
      0 -5px currentColor;
  }

  .about-layout.nav-drawer .about-nav-dialog {
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 60;
    width: min(88vw, 340px);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.96);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      visibility 0.2s;
  }
  .about-layout.nav-drawer.nav-open .about-nav-dialog {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
  }

  .about-layout.nav-drawer .about-nav-dialog .about-nav {
    position: static;
    width: 100%;
    max-height: min(78vh, 560px);
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0;
    padding: 22px 22px 24px;
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .about-layout.nav-drawer .about-nav-dialog .about-nav button {
    font-size: 1.06rem;
    padding: 10px 0 10px 14px;
  }
  .about-layout.nav-drawer .about-nav-dialog .about-nav-group {
    font-size: 0.92rem;
    font-weight: 600;
    opacity: 0.75;
  }

  .about-layout.nav-drawer.nav-open .about-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.55);
  }

  .about-layout.nav-drawer.nav-open .about-nav-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: -14px;
    right: -14px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--rule);
    border-radius: 50%;
    background: var(--paper-raised);
    color: var(--ink);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
  }
  .about-layout.nav-drawer.nav-open .about-nav-close:hover {
    border-color: var(--teal);
    color: var(--teal);
  }

  .about-nav-fab,
  .about-top-fab {
    display: grid;
    place-items: center;
    position: fixed;
    right: 18px;
    z-index: 55;
    width: 52px;
    height: 52px;
    border: 1px solid var(--rule);
    border-radius: 50%;
    background: var(--paper-raised);
    color: var(--ink);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      visibility 0.2s;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  }
  .about-nav-fab {
    bottom: 18px;
  }

  .about-top-fab {
    bottom: 80px;
  }
  .about-nav-fab.visible,
  .about-top-fab.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .about-nav-fab:hover,
  .about-top-fab:hover {
    border-color: var(--teal);
    color: var(--teal);
  }
  .about-nav-fab::before {
    content: "";
    width: 16px;
    height: 2px;
    background: currentColor;
    box-shadow:
      0 5px currentColor,
      0 -5px currentColor;
  }

  .about-top-fab::before {
    content: "";
    width: 13px;
    height: 13px;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform: translateY(3px) rotate(45deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-layout.nav-drawer .about-nav-dialog,
  .about-nav-fab,
  .about-top-fab {
    transition: none;
  }
}

.back-to-top {
  display: grid;
  place-items: center;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 55;
  width: 52px;
  height: 52px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper-raised);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.back-to-top::before {
  content: "";
  width: 13px;
  height: 13px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: translateY(3px) rotate(45deg);
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
}

.about-nav button {
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.94rem;
  color: var(--ink-soft);
  padding: 8px 0 8px 14px;
  cursor: pointer;
}

.about-nav button:hover {
  color: var(--ink);
}

.about-nav button.active {
  color: var(--stone-light);
  border-left-color: var(--stone-light);
  font-weight: 500;
}

.about-nav-group {
  margin: 20px 0 4px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--ink-soft);
  font-family: "Onest", system-ui, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 50%;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .about-nav-group {
    flex-basis: 100%;
    margin: 12px 0 2px;
    padding-left: 0;
  }

  .about-layout.nav-drawer .about-nav-group {
    margin: 20px 0 4px;
  }
}

.about-content {
  min-width: 0;
}

.about-content h2 {
  font-size: 1.6rem;
}
.about-content h3 {
  font-size: 1.15rem;
  margin-top: 1.6em;
}
.about-content p {
  max-width: 66ch;
  color: var(--ink);
  text-align: justify;
}

@media (max-width: 600px) {
  .about-content p {
    text-align: left;
  }
}

.about-content p,
.about-content li {
  letter-spacing: 0.01em;
}

.about-content .hl {
  color: var(--teal);
}

.about-content .about-section-ref {
  font-family: "Onest", system-ui, sans-serif;
  letter-spacing: 0.05em;
}

.partial-title {
  color: var(--teal);
}

#panel-lessons h3 {
  text-align: center;
}

#project-strands {
  display: flex;
  flex-direction: row;
  align-content: center;
  text-align: center;
  flex-grow: 1;
  gap: 2em;
  border-top: 1px dashed var(--rule);
}
#project-strands li {
  flex: 1 1 0;
  max-width: none;
}
#project-strands p {
  text-align: justify;
  text-align-last: center;
}
.about-content p.about-intro-lead {
  font-size: 1rem;
  max-width: 66ch;
}
.about-content p.about-intro-lead strong {
  color: var(--teal);
}

.about-content .about-page-quote {
  max-width: 66ch;
  margin: 3em 0;
  padding: 0.6em 0;
  font-size: 1rem;
  font-style: normal;
  color: var(--ink-soft);
}
.about-content .about-page-quote p {
  margin: 0;
  max-width: none;
  color: var(--ink-soft);
}

.about-content .about-page-quote p:first-child,
.about-content .about-page-quote p:first-child + p {
  text-align: center;
  font-style: italic;
  font-size: 0.875rem;
}

.about-content .about-page-quote p:first-child + p + p {
  text-align: right;
  font-size: 0.75rem;
  padding: 0.9em 1.4ch 0 0;
  color: var(--ink-soft);
}

.about-intro-targets {
  max-width: 66ch;
  margin: 1.6em 0;
  padding: 1em 1.3em;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
}
.about-intro-targets > :first-child {
  margin-top: 0;
}
.about-intro-targets > :last-child {
  margin-bottom: 0;
}

.about-intro-method {
  max-width: 66ch;
  margin: 1.6em 0;
  padding: 1em 1.3em;
}
.about-intro-method > :first-child {
  margin-top: 0;
}
.about-intro-method > :last-child {
  margin-bottom: 0;
}

.about-intro-figure {
  margin: 2.4em 0 0.4em;
  max-width: 66ch;
  width: 100%;
}
.about-intro-figure img {
  display: block;
  width: 100%;
  max-width: 34rem;
  margin-inline: auto;
  aspect-ratio: 1.8 / 1.2;
  object-fit: cover;
  object-position: center 0%;
  border: 1px solid var(--rule);
}

.about-me-figure img {
  display: block;
  width: 100%;
  max-width: 34rem;
  margin-inline: auto;
  aspect-ratio: 3.5 / 1;
  object-fit: cover;
  object-position: center 35%;
  border: 1px solid var(--rule);
}

.about-content ul:not(.spec-list):not(.doc-list) {
  padding-left: 1.2em;
  max-width: 66ch;
  display: grid;
  gap: 0.85em;
}
.about-content ul:not(.spec-list):not(.doc-list) li {
  margin: 0.7em 2em;
  gap: 0;
}
.about-content ul:not(.spec-list):not(.doc-list) li p {
  margin: 0;
}

.about-content ol {
  padding-left: 1.4em;
  max-width: 66ch;
  display: grid;
  gap: 0.5em;
}
.about-content ol li {
  padding-left: 0.2em;
}

.about-content blockquote {
  margin: 1.2em 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--teal);
  max-width: 60ch;
  color: var(--ink-soft);
  font-style: italic;
  text-align: center;
}
.about-content blockquote p {
  margin: 0;
}

.about-content pre {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 1em auto;
  max-width: 66ch;
  overflow-x: auto;
  text-align: left;
}
.about-content pre code {
  font-family: "Geist Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink);
}

.spec-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: 0.94rem;
}
.spec-list li {
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--rule);
  max-width: 65ch;
}

.spec-list--center {
  margin-left: 20px;
}
.spec-list--center li {
  border-bottom: none;
  padding-bottom: 0;
}

.doc-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}
.doc-list li {
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  padding: 12px 14px;
  font-family: "Geist Mono", monospace;
  font-size: 0.76rem;
}

.doc-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
  margin: 20px;
}
.doc-report-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink-soft);
  text-decoration: none;
  text-align: center;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.doc-report-btn:hover,
.doc-report-btn:focus-visible {
  border-color: var(--teal);
  color: var(--ink);
}

.doc-report-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  color: var(--stone);
}

.doc-report-icon svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.doc-report-icon svg,
.doc-report-icon svg * {
  fill: currentColor !important;
  stroke: currentColor !important;
}

.doc-report-id {
  font-family: "Geist Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.doc-report-name {
  font-family: "Onest", system-ui, sans-serif;
  font-size: 0.72rem;
  line-height: 1.25;
}

.lab-journal-datestamp {
  color: var(--teal);
}

.lab-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 4px;
  max-width: 66ch;
}

.lab-gallery-figure {
  margin: 0;
  flex: 0 1 calc(50% - 3px);
  max-width: calc(50% - 3px);
  border: 1px solid var(--rule);
  background: var(--paper-raised);
}

.lab-gallery-figure img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

@media (max-width: 520px) {
  .lab-gallery-figure {
    flex-basis: 100%;
    max-width: 100%;
  }
}

.lab-gallery-note {
  font-family: "Geist Mono", monospace;
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin: 0 0 1.2em;
  max-width: 66ch;
}

.lab-video {
  display: block;
  width: 100%;
  max-width: 66ch;
  margin: 14px auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

/* ---------- Folder tabs (dated strip inside Lab notes) ---------- */

.folder-tabs {
  margin-top: 1em;
  margin-bottom: 2em;
}

.folder-tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
}

.folder-tab-panel .folder-tab-strip {
  margin-bottom: 2em;
  justify-content: center;
  top: 33px;
  z-index: 4;
}

.folder-tab-strip button {
  position: relative;
  bottom: -1px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 7px 13px;
  font-family: "Geist Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: center;
}

.folder-tab-strip button:hover {
  color: var(--ink);
}

.folder-tab-strip button.active {
  background: var(--paper);
  border-color: var(--rule);
  border-bottom: 1px solid var(--paper);
  color: var(--ink);
}

.folder-tab-panel {
  text-align: center;
}

.folder-tab-panel > h3 {
  margin-top: 1em;
  justify-content: center;
}

.folder-tab-panel li {
  text-align: left;
}

.folder-tab-panel:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}

/* ---------- Project lifecycle panel ---------- */

.lifecycle-lead {
  color: var(--ink-soft);
  margin-bottom: 1.5em;
}

.lifecycle-stage h3 {
  color: var(--stage-accent);
}

ol.lifecycle {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.lifecycle-stage {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 16px;
  align-items: start;
}

.lifecycle-stage::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 18px;
  height: calc(100% + 12px);
  width: 0;
  border-left: 2px dotted var(--teal);
  opacity: 0.5;
}

.lifecycle-stage:last-child::before {
  display: none;
}

.lifecycle-marker {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--stage-accent);
  color: var(--stage-accent);
  font-family: "Geist Mono", monospace;
  font-size: 0.82rem;
  font-weight: 500;
}

.lifecycle-card {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 84px 18px 22px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.lifecycle-card:hover,
.lifecycle-card:focus-visible {
  border-color: var(--stage-accent);
}

.lifecycle-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--stage-accent);
}

.lifecycle-kicker {
  font-family: "Geist Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 5px;
}

.about-content h3.lifecycle-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.about-content p.lifecycle-desc {
  margin: 0;
  max-width: 58ch;
  font-size: 0.88rem;
  color: var(--stone);
}

.lifecycle-icon {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 46px;
  height: 46px;
  color: var(--stage-accent);
  opacity: 0.5;
}

@media (max-width: 720px) {
  .lifecycle-stage {
    grid-template-columns: 30px 1fr;
    column-gap: 12px;
  }
  .lifecycle-stage::before {
    left: 14px;
    top: 15px;
  }
  .lifecycle-marker {
    width: 30px;
    height: 30px;
    font-size: 0.76rem;
  }
  .lifecycle-card {
    padding: 15px 16px 16px;
  }
  .lifecycle-icon {
    display: none;
  }
}

/* ---------- Stage-by-stage panel ---------- */

.stage-strip-wrap {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 1.6em 0 1.5em;
  padding: 14px 0 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 600px) {
  .stage-strip-wrap {
    position: static;
  }
}

.stage-strip {
  position: relative;
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 3px 0 4px;
}

.stage-panel h3 {
  color: var(--stage-accent);
  font-size: 1.3em;
}

.stage-panel h4 {
  color: var(--stage-accent);
  font-family: "Cactus Classical Serif", Georgia, serif;
  font-weight: 400;
  font-size: 1.12em;
  line-height: 1.2;
  margin: 1.9em 0 0.5em;
}

.stage-figure {
  margin: 1.8em 0;
  max-width: 66ch;
}
.stage-figure img {
  display: block;
  width: 100%;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px;
}

figcaption {
  margin-top: 0.6em;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-soft);
}

.rings-figure {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2em 2.2em;
  margin: 1.4em 0;
  max-width: 66ch;
}
.rings-figure .rings-list {
  flex: 1 1 13em;
  margin: 0;
}
.rings-figure .stage-figure {
  flex: 1.7 1 20em;
  margin: 0;
}
@media (max-width: 560px) {
  .rings-figure {
    display: block;
  }
  .rings-figure .rings-list {
    margin-bottom: 1.2em;
  }
}

.stage-afternote {
  max-width: 54ch;
  margin: 2em auto 2em;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 0.92em;
}
.about-content .stage-afternote p {
  max-width: none;
  text-align: center;
  color: var(--ink-soft);
}

.pipeline-svg {
  display: block;
  width: 100%;
  max-width: 34rem;
  height: auto;
  margin: 1.1em auto 1.5em;
}
.pipeline-svg .pipe-box {
  fill: var(--paper-raised);
  stroke: var(--rule);
  stroke-width: 1;
}
.pipeline-svg .pipe-label {
  fill: var(--ink);
  font:
    400 9px "Inter",
    system-ui,
    sans-serif;
}
.pipeline-svg .pipe-arrow {
  stroke: var(--teal);
  stroke-width: 1.4;
}
.pipeline-svg .pipe-arrow-head {
  fill: var(--teal);
}

.stage-collapse {
  margin: 1.3em 0 1.7em;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
}
.stage-collapse > summary {
  display: block;
  cursor: pointer;
  padding: 10px 14px;
  font-family: "Geist Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  list-style: none;
}
.stage-collapse > summary::-webkit-details-marker {
  display: none;
}
.stage-collapse > summary::before {
  content: "\25B8";
  display: inline-block;
  width: 1em;
  margin-right: 6px;
  color: var(--stage-accent);
  transition: transform 0.15s ease;
}
.stage-collapse[open] > summary::before {
  transform: rotate(90deg);
}
.stage-collapse[open] > summary {
  border-bottom: 1px solid var(--rule);
}
@media (prefers-reduced-motion: reduce) {
  .stage-collapse > summary::before {
    transition: none;
  }
}

.stage-table-wrap {
  margin: 1.2em 0 1.8em;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.stage-collapse .stage-table-wrap {
  margin: 0;
  border: none;
  border-radius: 0;
}
.stage-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 52rem;
  font-size: 0.84rem;
  line-height: 1.4;
}
.stage-table th,
.stage-table td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
.stage-table thead th {
  background: var(--paper-raised);
  color: var(--ink);
  font-family: "Geist Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.stage-table tbody th {
  min-width: 7rem;
  font-weight: 600;
  color: var(--stage-accent);
}
.stage-table tbody tr:last-child th,
.stage-table tbody tr:last-child td {
  border-bottom: none;
}

.stage-table thead th:first-child,
.stage-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--paper-raised);
  box-shadow: inset -1px 0 0 var(--rule);
}
.stage-table thead th:first-child {
  z-index: 2;
}

.results-table {
  min-width: 42rem;
  background: var(--paper);
}

.results-table--wide {
  min-width: 56rem;
}

/* Mobile shows a transposed version of the acquisition/derived-asset
 * tables (chunks/assets as columns, fields as rows) instead of the
 * desktop table, so the first column can freeze in full — see
 * transposedTableHTML() in build.js for why this is built rather than
 * reshaped with CSS. */
.stage-table-wrap--mobile {
  display: none;
}
.stage-table--transposed {
  min-width: 0;
}
.stage-table--transposed th[scope="col"],
.stage-table--transposed td {
  min-width: 7.5rem;
}
@media (max-width: 700px) {
  .stage-table-wrap--desktop {
    display: none;
  }
  .stage-table-wrap--mobile {
    display: block;
  }
}

.results-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}
.results-table tbody th {
  min-width: 9.5rem;
  white-space: normal;
}
.results-table .res-id {
  display: block;
  color: var(--stage-accent);
}
.results-table .res-name {
  display: block;
  margin-top: 2px;
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--ink-soft);
}
.results-table tbody th .res-chip {
  margin-top: 5px;
}
.results-table .res-note {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.res-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: "Geist Mono", monospace;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.res-chip.is-ok {
  background: var(--measured-bg);
  color: var(--measured);
}
.res-chip.is-part {
  background: var(--estimated-bg);
  color: var(--estimated);
}
.res-chip.is-fail {
  background: var(--flagged-bg);
  color: var(--flagged);
}
.res-chip.is-none,
.res-chip.is-skip {
  background: var(--na-bg);
  color: var(--na);
}
.res-chip.is-exp {
  background: rgba(var(--lilac-rgb), 0.16);
  color: var(--lilac);
}

.stage-strip::before {
  content: "";
  position: absolute;
  left: 8.33%;
  right: 8.33%;
  top: 20px;
  border-top: 2px dotted var(--teal);
  opacity: 0.5;
}

.stage-strip button {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 84px;
  max-width: 130px;
  padding: 0 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: "Inter", system-ui, sans-serif;
}

.stage-strip-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--stage-accent);
  color: var(--stage-accent);
  font-family: "Geist Mono", monospace;
  font-size: 0.8rem;
  font-weight: 500;
}

.stage-strip-label {
  font-size: 0.7rem;
  line-height: 1.25;
  color: var(--ink-soft);
  text-align: center;
}

.stage-strip button:hover .stage-strip-label {
  color: var(--ink);
}

.stage-strip button.active .stage-strip-num {
  background: var(--stage-accent);
  color: var(--paper);
}

.stage-strip button.active .stage-strip-label {
  color: var(--ink);
  font-weight: 600;
}

.stage-strip button:focus-visible {
  outline: none;
}

.stage-strip button:focus-visible .stage-strip-num {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.stage-panel {
  padding-top: 0.2em;
}

.stage-panel:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}

.stage-panel-kicker {
  font-family: "Geist Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stage-accent);
  margin: 0 0 6px;
}

.stage-panel-head {
  position: relative;
  overflow: hidden;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 22px 10px;
  margin-bottom: 1.5em;
}

.stage-panel-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--stage-accent);
}

.stage-panel-head .stage-panel-kicker {
  margin: 0 0 5px;
}

.about-content .stage-panel-head h3 {
  margin: 0;
}

@media (max-width: 720px) {
  .stage-panel-head {
    padding: 13px 16px 14px;
  }
}

@media (max-width: 720px) {
  .stage-strip::before {
    display: none;
  }
  .stage-strip button {
    min-width: 76px;
  }
}

/* ---------- About me panel ---------- */

#panel-about-me {
  position: relative;
}
#panel-about-me > *:not(.about-me-portrait) {
  position: relative;
  z-index: 1;
}
.about-me-portrait {
  position: absolute;
  top: 3rem;
  left: 0;
  right: auto;
  z-index: 0;
  width: min(100%, 66ch);
  height: 250px;
  opacity: 0.6;
  background-image: url("img/about/eva-portrait.jpg");
  background-repeat: no-repeat;

  background-position: 100% 35%;

  background-size: auto 115%;
}

@media (max-width: 900px) {
  .about-me-portrait {
    opacity: 0.3;
  }
}

#about-me-quote {
  border: 1px solid var(--rule);
}

.about-me-myheader {
  margin: 95px 0 50px;
  max-width: 42ch;
  padding-left: 2ch;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (max-width: 600px) {
  .about-me-myheader {
    max-width: none;
    padding-left: 0;
    text-align: center;
  }
  #panel-about-me .about-me-links {
    justify-content: center;
  }
}

#panel-about-me .mytag {
  font-family: "Cactus Classical Serif", Georgia, serif;
  font-weight: lighter;
  color: rgba(245, 245, 245, 0.826);
  margin: 0 0;
}

#panel-about-me .about-me-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 1.8em;
  font-family: "Geist Mono", monospace;
  font-size: 0.82rem;
}
#panel-about-me .about-me-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
#panel-about-me .about-me-links a:hover {
  text-decoration: underline;
}
#panel-about-me .about-me-links svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex: none;
}

#panel-about-me sup a,
#panel-about-me a sup {
  text-decoration: none;
}
#panel-about-me li[id] {
  scroll-margin-top: 20px;
}

.about-extras {
  color: var(--ink-soft);
  margin-top: 2.2em;
}

.about-extras li.about-ref-flash {
  animation: about-ref-flash 2.6s ease;
}
@keyframes about-ref-flash {
  0% {
    color: var(--ink-soft);
    background-color: transparent;
  }
  8% {
    color: var(--ink);
    background-color: rgba(118, 171, 174, 0.16);
  }
  77% {
    color: var(--ink);
    background-color: rgba(118, 171, 174, 0.16);
  }
  100% {
    color: var(--ink-soft);
    background-color: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .about-extras li.about-ref-flash {
    animation: none;
    color: var(--ink);
  }
}
.about-extras li {
  font-size: 0.83rem;
}
.about-extras .about-extras-heading {
  margin-bottom: 0.4em;
}
.about-extras .about-extra-note {
  display: block;
  margin-top: 0.25em;
  font-size: 0.85em;
}

.about-me-carousel {
  max-width: 66ch;
  margin: 1.8em 0 2em;
  text-align: center;
}
.about-me-carousel .carousel-viewport {
  position: relative;
  overflow: hidden;
}
.about-me-carousel .carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}
@media (prefers-reduced-motion: reduce) {
  .about-me-carousel .carousel-track {
    transition: none;
  }
}
.about-me-carousel .carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
}
.about-me-carousel .carousel-slide img {
  display: block;
  width: 100%;
  height: clamp(240px, 44vh, 430px);
  object-fit: contain;
  background: #0f0f0f;
}
.about-me-carousel .carousel-prev,
.about-me-carousel .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(24, 24, 24, 0.78);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.about-me-carousel .carousel-prev:hover,
.about-me-carousel .carousel-next:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.about-me-carousel .carousel-prev {
  left: 8px;
}
.about-me-carousel .carousel-next {
  right: 8px;
}
.about-me-carousel .carousel-caption {
  font-family: "Geist Mono", monospace;
  font-size: 0.76rem;
  color: var(--teal);
  margin: 0;
  padding: 8px 12px 6px;
  max-width: none;
}
.about-me-carousel .carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 4px 0 12px;
}
.about-me-carousel .carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid var(--ink-soft);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.about-me-carousel .carousel-dot[aria-current="true"] {
  background: var(--ink-soft);
}

.about-me-carousel .carousel-slide img {
  cursor: zoom-in;
}
.about-me-carousel .carousel-expand {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(24, 24, 24, 0.78);
  color: var(--ink);
  cursor: pointer;
}
.about-me-carousel .carousel-expand:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.about-me-carousel .carousel-expand svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

figure[data-expandable] img {
  cursor: zoom-in;
}
.figure-expand-frame {
  position: relative;
  display: block;
  line-height: 0;
}
.figure-expand {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(24, 24, 24, 0.78);
  color: var(--ink);
  cursor: pointer;
}
.figure-expand:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.figure-expand svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.carousel-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(10, 12, 15, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 56px);
}
.carousel-lightbox[hidden] {
  display: none;
}
.carousel-lightbox .lightbox-dialog {
  position: relative;
  max-width: min(1100px, 100%);
  max-height: 100%;
  outline: none;
}
.carousel-lightbox .lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.carousel-lightbox .lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - clamp(110px, 18vw, 170px));
  object-fit: contain;
  border: 1px solid var(--rule);
  background: #0f0f0f;
}
.carousel-lightbox .lightbox-caption {
  font-family: "Geist Mono", monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: center;
  max-width: 70ch;
  margin: 0;
}
.carousel-lightbox .lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.carousel-lightbox .lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(24, 24, 24, 0.72);
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.carousel-lightbox .lightbox-nav:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.carousel-lightbox .lightbox-prev {
  left: -60px;
}
.carousel-lightbox .lightbox-next {
  right: -60px;
}
.carousel-lightbox .lightbox-close:hover {
  border-color: var(--teal);
  color: var(--teal);
}
@media (max-width: 900px) {
  .carousel-lightbox .lightbox-prev {
    left: 4px;
  }
  .carousel-lightbox .lightbox-next {
    right: 4px;
  }
  .carousel-lightbox .lightbox-close {
    right: 0;
  }
}

/* ---------- Collection page ---------- */

.collection-main {
  padding-bottom: 60px;
}

.filter-bar {
  margin: 36px 0 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 18px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 22px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 190px;
}

.filter-field label {
  font-family: "Onest", system-ui, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.filter-field select {
  font-family: "Onest", system-ui, sans-serif;
  font-size: 0.88rem;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  color: var(--ink);
  border-radius: var(--radius);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-field select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.filter-reset {
  font-family: "Geist Mono", monospace;
  font-size: 0.76rem;
  background: none;
  border: none;
  color: var(--stone-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 8px 0;
  flex: none;
}

.no-results {
  padding: 30px 0;
  color: var(--ink-soft);
  text-align: center;
}

@media (max-width: 600px) {
  .filter-bar {
    gap: 14px;
  }
  .filter-field {
    flex: 1 1 100%;
    max-width: none;
  }
  .filter-reset {
    flex: 1 1 100%;
    text-align: left;
    padding: 0;
  }
  .filter-field select {
    width: 100%;
  }
}

/* ---------- Index grid ---------- */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 760px;
  margin: 40px auto 64px;
}

@media (min-width: 901px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }
  .card-link {
    gap: 16px;
    padding: 18px 20px;
  }
}

.card {
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper-raised);
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: var(--stone-light);
}

.card-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 0.5fr);
  align-items: center;
  gap: 24px;
  padding: 18px 24px;
  color: inherit;
  text-decoration: none;
}

.card-thumb {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.card-thumb svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}
.card-thumb svg,
.card-thumb svg * {
  fill: currentColor !important;
  stroke: currentColor !important;
}

.card-thumb:empty {
  align-self: stretch;
  border: 1px dashed var(--rule);
  border-radius: 10px;
}

.card-info {
  min-width: 0;
}

.card-info .card-id {
  font-family: "Geist Mono", monospace;
  font-size: 0.77rem;
  color: var(--teal);
  letter-spacing: 0.06em;
}

.card-info h2 {
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 4px 0 10px;
}

.card-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  font-family: "Onest", system-ui, sans-serif;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}

.card-icon svg,
.modal-nav svg,
.about-pager button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card:hover .card-icon {
  color: var(--teal);
}

@media (max-width: 600px) {
  .card-link {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
  .card-icon {
    display: none;
  }
}

/* ---------- Object page ---------- */

.object-intro {
  padding: 20px 0 22px;
}

.back-link {
  font-family: "Geist Mono", monospace;
  font-size: 0.78rem;
  text-decoration: none;
  display: inline-block;
  margin-top: 4px;
}

.object-title {
  font-size: clamp(1.8rem, 3.4vw, 2rem);
  margin-top: 10px;
}

.tag-row {
  margin-top: 10px;
  font-family: "Geist Mono", monospace;
  font-size: 0.82rem;
  color: var(--teal);
}
.tag-row span:not(:last-child)::after {
  content: " · ";
  color: var(--rule);
}

.object-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  padding: 40px 0 30px;
  align-items: start;
}

@media (max-width: 900px) {
  .object-body {
    grid-template-columns: 1fr;
  }
}

.object-body .viewer-wrap {
  position: sticky;
  top: 24px;
}

@media (max-width: 600px) {
  .object-body .viewer-wrap {
    position: static;
  }
}

.viewer-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
}

main.wrap > .viewer-wrap .viewer-frame,
main.wrap > .viewer-wrap .viewer-caption {
  max-width: 640px;
  margin-inline: auto;
}
.viewer-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.viewer-loading {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    var(--paper-raised) 30%,
    var(--paper) 45%,
    var(--paper-raised) 60%
  );
  background-size: 200% 100%;
  animation: viewer-sweep 1.6s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.viewer-frame.loaded .viewer-loading {
  opacity: 0;
}

@keyframes viewer-sweep {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.viewer-caption {
  font-family: "Geist Mono", monospace;
  font-size: 0.74rem;
  color: var(--stone-light);
  opacity: 0.5;
  margin-top: 8px;
}

.story p {
  margin: 0 0 1em;
  max-width: 62ch;
}

.story {
  padding: 1em 0;
  text-align: justify;
  border-top: 1px dashed var(--rule);
}

main.wrap > .viewer-wrap .story {
  max-width: 640px;
  margin-inline: auto;
}

main.wrap > .viewer-wrap .story p {
  max-width: none;
}

/* Field Record docket — the signature element */

.field-record {
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  padding: 22px 22px 20px;
}

.field-record .record-title {
  font-family: "Geist Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.record-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px;
  font-size: 0.88rem;
  padding: 6px 0;
  border-bottom: 1px dashed var(--rule);
}
.record-row:last-of-type {
  border-bottom: none;
}

.record-row dt {
  font-family: "Geist Mono", monospace;
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.record-row dd {
  margin: 0;
}
.record-row .materials-note {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.record-subrow {
  text-align: right;
}
.record-subrow dd {
  text-align: left;
  color: var(--ink-soft);
}
.record-row.record-row-nest {
  border-bottom: none;
}

.record-section-label {
  font-family: "Geist Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 22px 0 12px;
}

.stamp {
  display: inline-block;
  font-family: "Geist Mono", monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.stamp.measured {
  background: var(--measured-bg);
  color: var(--measured);
}
.stamp.estimated {
  background: var(--estimated-bg);
  color: var(--estimated);
}
.stamp.flagged {
  background: var(--flagged-bg);
  color: var(--flagged);
}
.stamp.na {
  background: var(--na-bg);
  color: var(--na);
}

.methodology-link {
  display: block;
  margin-top: 20px;
  font-size: 0.86rem;
}

.record-full-page {
  --stage-accent: var(--teal);
  margin: 10px 0 40px;
  padding: 16px 20px 20px;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  font-size: 0.78rem;
}
.record-full-title {
  font-family: "Geist Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 8px;
  margin: 0 0 10px;
}
.record-full-page .record-section-label {
  margin: 14px 0 6px;
  font-size: 0.72rem;
}
.record-full-page .record-section-label:first-of-type {
  margin-top: 0;
}
.record-full-page dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 24px;
}
.record-full-page .record-row {
  grid-template-columns: 170px 1fr;
  font-size: 0.78rem;
  padding: 3px 0;
}

/* Photogrammetry block: left column Captured/Software/Geometric data, right
 * column Complexity then Surface/Material, whose labels are right-aligned. */
.record-full-page .record-photogrammetry {
  grid-auto-flow: column;
  grid-template-rows: repeat(3, auto);
}
@media (max-width: 700px) {
  .record-full-page .record-photogrammetry {
    grid-auto-flow: row;
    grid-template-rows: none;
  }
}

.texture-maps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.texture-map-cell {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.texture-map-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.texture-map-cell .prop {
  font-weight: 600;
  font-size: 0.9rem;
}
.texture-map-detail {
  margin-top: 6px;
}
.texture-map-cell .note {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8rem;
}
@media (max-width: 700px) {
  .texture-maps-grid {
    grid-template-columns: 1fr;
  }
}
.record-full-page .methodology-link {
  font-size: 0.78rem;
  margin-top: 12px;
}
.record-full-page .stage-table {
  font-size: 0.76rem;
}
.record-full-page .stage-table th,
.record-full-page .stage-table td {
  padding: 6px 10px;
}
@media (max-width: 700px) {
  .record-full-page dl {
    grid-template-columns: 1fr;
  }
  .record-full-page {
    padding: 16px 16px 18px;
  }
}

/* ---------- Object detail modal (Collection page) ---------- */

body.modal-open {
  overflow: hidden;
  padding: 0 24px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12, 14, 18, 0.72);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(16px, 3vw, 40px) clamp(20px, 5vw, 64px);
  overflow-y: auto;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-panel {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--ink);
  width: 100%;
  max-width: var(--max-width);
  max-height: calc(100vh - 2 * clamp(16px, 3vw, 40px));
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
}

.modal-topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 0;
}

.modal-panel > .tag-row {
  flex: none;
  color: var(--teal);
  opacity: 0.5;
  margin: 4px 0 14px;
}

.modal-panel .wrap {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 10px;
}

.modal-panel #modal-title {
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  margin: 0;
  min-width: 0;
}

.modal-panel .object-body {
  padding: 4px 0 0;
  grid-template-columns: 1.5fr 1fr;
}

.modal-panel .viewer-wrap {
  position: static;
}

.modal-panel .viewer-frame {
  aspect-ratio: 16 / 9;
}

.modal-panel .field-record {
  position: relative;
  max-height: 400px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 12px;
}

/* Placed after the unconditional rules above so these mobile-only
 * overrides win on shared properties (aspect-ratio, max-height) despite
 * equal selector specificity. .object-body's grid box disappears so its
 * two children (viewer-wrap, field-record) become flex items of .wrap
 * alongside .story, letting all three be reordered with `order` —
 * description before the field record, on mobile only. flex: none stops
 * field-record (which sets min-height: 0 for its own desktop scrolling)
 * from flex-shrinking down to near-nothing to fit .wrap's cross size. */
@media (max-width: 600px) {
  .modal-panel .wrap {
    display: flex;
    flex-direction: column;
  }
  .modal-panel .object-body {
    display: contents;
  }
  .modal-panel .viewer-wrap {
    order: 1;
    flex: none;
  }
  .modal-panel .story {
    order: 2;
    flex: none;
  }
  .modal-panel .field-record {
    order: 3;
    flex: none;
    max-height: none !important;
  }
  .modal-panel .viewer-frame {
    aspect-ratio: 3 / 4;
    max-height: 70vh;
  }
}

.modal-panel .field-record .record-title {
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.modal-panel .field-record .record-row {
  font-size: 0.78rem;
  padding: 3px 0;
}

.modal-panel .field-record .record-section-label {
  margin: 10px 0 5px;
}

.modal-panel .field-record .texture-maps-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.modal-panel .field-record .texture-map-cell {
  padding: 8px;
}
@media (max-width: 420px) {
  .modal-panel .field-record .texture-maps-grid {
    grid-template-columns: 1fr;
  }
}

.modal-panel .field-record .methodology-link {
  margin-top: 10px;
}

.modal-panel .story {
  max-width: 100%;
  margin-top: 10px;
  padding-top: 20px;
  padding-bottom: 20px;
  border-top: 1px dashed var(--rule);
}

.modal-panel .story p {
  max-width: 100%;
  overflow-wrap: break-word;
  font-size: clamp(0.88rem, 0.82rem + 0.3vw, 0.95rem);
  line-height: 1.45;
  margin: 0 0 0.5em;
}

.modal-controls {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-nav {
  flex: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  cursor: pointer;
}
.modal-nav svg {
  width: 18px;
  height: 18px;
}
.modal-nav-prev svg,
.about-pager .pager-prev svg {
  transform: scaleX(-1);
}
.modal-nav:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal);
}
.modal-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

/* Desktop: prev/next float outside the panel, vertically centred.
 * Mobile: they live in the top bar and centred at the end of the content. */
.modal-nav-side {
  position: fixed;
  top: 50%;
  margin-top: -20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  z-index: 101;
}
.modal-nav-side-prev {
  left: max(
    4px,
    calc(50% - min(var(--max-width) / 2, 50% - clamp(20px, 5vw, 64px)) - 48px)
  );
}
.modal-nav-side-next {
  right: max(
    4px,
    calc(50% - min(var(--max-width) / 2, 50% - clamp(20px, 5vw, 64px)) - 48px)
  );
}
.modal-nav-top,
.modal-bottom-nav,
.modal-scroll-hint {
  display: none;
}

.modal-close {
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--teal);
  color: var(--teal);
}

@media (max-width: 600px) {
  .modal-nav-side {
    display: none;
  }
  .modal-nav-top {
    display: flex;
  }
  .modal-bottom-nav {
    order: 4;
    flex: none;
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 15px 0;
  }
  .modal-scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 12px;
    margin-left: -18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--rule);
    border-radius: 50%;
    background: var(--paper-raised);
    color: var(--teal);
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.25s ease;
    z-index: 2;
  }
  .modal-scroll-hint svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: rotate(90deg);
  }
  .modal-scroll-hint.gone {
    opacity: 0;
    pointer-events: none;
  }
  .modal-scroll-hint.bounce {
    animation: scroll-hint-bounce 1.4s ease-in-out 2;
  }
}
@keyframes scroll-hint-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .modal-scroll-hint.bounce {
    animation: none;
  }
}

/* ---------- About page: previous / next section pager ---------- */

.about-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px dashed var(--rule);
}
.about-pager .pager-next {
  margin-left: auto;
}
.about-pager button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Onest", system-ui, sans-serif;
  font-size: 0.88rem;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  cursor: pointer;
}
.about-pager button svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.about-pager button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 26px 0 50px;
  font-family: "Onest", system-ui, sans-serif;
  font-size: 0.76rem;
  color: var(--ink-soft);
  text-align: center;
}
.footer-meta {
  opacity: 0.5;
}

/* ---------- Mobile polish (max-width: 600px only) ---------- */

@media (max-width: 600px) {
  /* Card thumbnails: the thumb column stretches to the full card height
   * (set by the text) and the SVG is absolutely fitted inside it, so it
   * scales with the card instead of its own intrinsic size. */
  .card-info {
    align-self: center;
  }
  .card-link {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 12px;
    padding: 16px 20px;
  }
  .card-thumb {
    position: relative;
    height: auto;
    min-height: 170px;
    max-height: 210px;
    align-self: center;
    padding: 0;
    overflow: hidden;
  }
  .card-thumb svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }

  /* Object description: smaller type, comfortable margins (modal + full record) */
  .story,
  .modal-panel .story {
    margin: 1.25em 0 0;
    padding-left: 0;
    padding-right: 0;
    text-align: left;
    hyphens: auto;
  }
  .story p,
  main.wrap > .viewer-wrap .story p,
  .modal-panel .story p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1em;
    max-width: none;
  }

  /* Full-record page viewer: vertical, as in the modal */
  main.wrap > .viewer-wrap .viewer-frame {
    aspect-ratio: 3 / 4;
    max-height: 70vh;
  }

  /* About me: portrait free of text, name/tagline/links sit below it */
  .about-me-portrait {
    position: relative;
    top: auto;
    width: 100%;
    height: 250px;
    opacity: 1;
    margin-top: 1rem;
    background-position: 100% 35%;
    background-size: auto 115%;
  }
  .about-me-myheader {
    margin: 24px 0 32px;
    padding: 0 20px;
    max-width: none;
  }
  #panel-about-me .mytag {
    text-align: center;
  }

  /* Modal must never exceed the visible viewport (dvh excludes mobile
   * browser toolbars, which 100vh does not) */
  body.modal-open {
    padding: 0;
  }
  .modal-overlay {
    padding: 12px;
    height: 100vh;
    height: 100dvh;
    box-sizing: border-box;
    overflow: hidden;
  }
  .modal-panel {
    padding: 0 16px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
}
