/* Andreas Petrus — Deep Sky Images
   All visual styling for index.html. Colors are CSS custom properties on
   :root; config.js overrides them at load time from window.SITE_CONFIG.colors,
   so edit palette values there rather than here. */

:root {
  color-scheme: dark;
  --bg: #111317;
  --panel: #171a1f;
  --panel-2: #1d2127;
  --ink: #d4d7dc;
  --muted: #8c929c;
  --soft: #626974;
  --line: rgba(220, 226, 235, .1);
  --gold: #c0a06d;
  --teal: #8db6c5;
  --danger: #d98f7d;
  --shadow: 0 28px 90px rgba(0, 0, 0, .45);
  /* Set at runtime by renderMasthead() in js/gallery.js from the featured
     photo's thumb in data.js — never hardcode a filename here. */
  --hero-image: none;
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.live-preview-notice {
  padding: 12px 20px;
  background: #35352f;
  color: #e0dfd6;
  border-bottom: 1px solid #65655a;
  font: 500 14px/1.5 Arial, sans-serif;
  text-align: center;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

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

.shell {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 34px clamp(18px, 4vw, 64px) 42px;
}

.site-header {
  margin-bottom: clamp(28px, 5vw, 54px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(192, 160, 109, .38);
  border-radius: 50%;
  background:
    radial-gradient(circle at 58% 42%, rgba(192, 160, 109, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 34% 68%, rgba(141, 182, 197, .72) 0 1px, transparent 2px),
    rgba(23, 26, 31, .72);
  color: #cdd0d5;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .08em;
}

.identity-text {
  min-width: 0;
}

.identity strong {
  display: block;
  color: #cdd0d5;
  font-size: 15px;
  font-weight: 560;
  line-height: 1.1;
  letter-spacing: 0;
}

.identity-text span {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-link,
.admin-link,
.icon-btn,
.text-btn,
.chip {
  border: 1px solid var(--line);
  background: rgba(23, 26, 31, .68);
  color: var(--muted);
  min-height: 38px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease, transform .2s ease;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav-link.primary-nav {
  border-color: rgba(192, 160, 109, .72);
  color: var(--gold);
  background: rgba(192, 160, 109, .1);
}

.admin-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  color: var(--soft);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav-link:hover,
.admin-link:hover,
.icon-btn:hover,
.text-btn:hover,
.chip:hover {
  border-color: rgba(192, 160, 109, .55);
  color: var(--ink);
  background: rgba(29, 33, 39, .9);
}

.masthead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .65fr);
  gap: clamp(20px, 4vw, 58px);
  align-items: end;
  min-height: clamp(310px, 42vw, 520px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 46px);
  background:
    linear-gradient(90deg, rgba(17, 19, 23, .96) 0%, rgba(17, 19, 23, .76) 46%, rgba(17, 19, 23, .22) 100%),
    var(--hero-image),
    var(--panel);
  background-position: center;
  background-size: cover;
  box-shadow:
    inset 0 0 0 1px rgba(205, 205, 196, .08),
    0 14px 38px rgba(0, 0, 0, .24);
}

.masthead::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(192, 160, 109, .55), transparent);
}

.masthead-copy,
.masthead-aside {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.masthead h1 {
  max-width: 760px;
  margin: 0;
  color: #d6d9dd;
  font-size: clamp(40px, 7vw, 92px);
  font-weight: 430;
  line-height: .94;
  letter-spacing: 0;
}

.masthead-lead {
  max-width: 660px;
  margin: 20px 0 0;
  color: rgba(212, 215, 220, .8);
  font-size: clamp(15px, 1.8vw, 19px);
}

.masthead-aside {
  justify-self: end;
  width: min(100%, 360px);
}

.collection-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(220, 226, 235, .13);
  border-radius: 8px;
  background: rgba(14, 16, 20, .52);
  backdrop-filter: blur(16px);
}

.collection-meta.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.collection-meta div {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid rgba(220, 226, 235, .1);
}

.collection-meta div:last-child {
  border-right: 0;
}

.collection-meta b {
  display: block;
  color: #cdd0d5;
  font-size: 18px;
  font-weight: 560;
  line-height: 1;
}

.collection-meta span {
  display: block;
  margin-top: 7px;
  color: var(--soft);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .12em;
  line-height: 1.25;
  text-transform: uppercase;
}

.featured-note {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(220, 226, 235, .12);
  border-radius: 8px;
  background: rgba(14, 16, 20, .48);
  backdrop-filter: blur(16px);
  color: var(--muted);
  font-size: 13px;
}

.featured-note b {
  display: block;
  color: #cdd0d5;
  font-weight: 520;
}

.featured-note span {
  color: var(--gold);
  white-space: nowrap;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chip.active {
  border-color: rgba(192, 160, 109, .82);
  color: var(--gold);
  background: rgba(192, 160, 109, .08);
}

.count {
  color: var(--soft);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(12px, 2vw, 22px);
}

.card {
  position: relative;
  margin: 0;
  overflow: hidden;
  min-width: 0;
  min-height: 260px;
  aspect-ratio: 1.22 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: zoom-in;
}

.card.wide {
  grid-column: span 2;
  aspect-ratio: 1.85 / 1;
}

.card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform .7s ease, opacity .3s ease;
}

.card:hover img {
  transform: scale(1.035);
}

.card:focus {
  outline: none;
}

.card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 10, 13, .86), rgba(8, 10, 13, .06) 58%);
  opacity: .92;
}

.card figcaption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 20px;
}

.kicker {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.card h2 {
  margin: 5px 0 4px;
  max-width: 680px;
  color: #cdd0d5;
  font-size: clamp(19px, 2vw, 28px);
  font-weight: 460;
  line-height: 1.08;
  letter-spacing: 0;
}

.card p {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 13px;
}

.versions-badge {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 9px;
  border: 1px solid rgba(220, 226, 235, .2);
  border-radius: 99px;
  background: rgba(14, 16, 20, .55);
  backdrop-filter: blur(6px);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.print-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  padding: 4px 10px;
  border: 1px solid rgba(141, 182, 197, .45);
  border-radius: 99px;
  background: rgba(14, 16, 20, .6);
  backdrop-filter: blur(6px);
  color: var(--teal);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  pointer-events: none;
}

.card.hidden {
  display: none;
}

.missing {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  background: var(--panel-2);
}

.card.no-img .missing {
  display: grid;
}

.about {
  margin-top: clamp(62px, 9vw, 120px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 86px);
  align-items: start;
}

.about p {
  margin: 0 0 26px;
  max-width: 680px;
  color: var(--muted);
}

.about-intro h2 {
  margin: 0 0 24px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
}

.disclaimer {
  margin: 0 0 26px;
  padding: 16px 18px;
  max-width: 680px;
  border: 1px solid var(--line);
  border-left: 2px solid rgba(192, 160, 109, .65);
  border-radius: 8px;
  background: rgba(23, 26, 31, .5);
}

.disclaimer p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
}

.disclaimer .text-btn {
  display: inline-flex;
  min-width: 0;
}

.rig {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.rig div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 13px 15px;
  background: rgba(23, 26, 31, .76);
}

.rig b {
  color: var(--soft);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.rig span {
  color: var(--ink);
}

footer {
  padding-top: 42px;
  color: var(--soft);
  font-size: 12px;
}

.lightbox,
.print-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  background: rgba(9, 11, 14, .94);
}

.lightbox.open,
.print-modal.open {
  display: grid;
}

.lightbox {
  /* The stage keeps a solid minimum height so the image never has to
     shrink to make room for the info panel below (e.g. opening the sky
     map) — instead the whole lightbox scrolls, via overflow-y below. */
  grid-template-rows: minmax(min(62vh, 800px), 1fr) auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lightbox.has-story {
  grid-template-rows: minmax(80vh, 1fr) auto;
  grid-template-rows: minmax(80svh, 1fr) auto;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  padding: 62px clamp(12px, 5vw, 82px) 18px;
}

.stage canvas {
  display: block;
  max-width: none;
  max-height: none;
  border-radius: 4px;
  box-shadow: var(--shadow);
  /* Zoom/pan (js/lightbox.js) drives its own transform and reads pointer
     gestures directly — don't let the browser's native pinch-zoom/scroll
     intercept them first. */
  touch-action: none;
}

.stage canvas.low {
  filter: blur(9px);
}

.loading {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: none;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(17, 19, 23, .86);
  color: var(--muted);
  font-size: 11px;
}

.lb-details {
  position: relative;
  z-index: 21;
  display: grid;
  grid-template-columns: minmax(220px, .85fr) minmax(0, 1.35fr) auto;
  gap: 22px;
  align-items: start;
  padding: 18px clamp(18px, 4vw, 64px) 22px;
  border-top: 1px solid var(--line);
  background: rgba(17, 19, 23, .95);
}

.lb-details h2 {
  margin: 3px 0 0;
  color: #cdd0d5;
  font-size: 24px;
  font-weight: 460;
  line-height: 1.12;
}

.version-switch {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.version-switch.open {
  display: flex;
}

.version-switch .chip {
  padding: 6px 12px;
  font-size: 10.5px;
}

.lb-desc {
  margin: 0;
  color: var(--muted);
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px 20px;
  margin-top: 14px;
}

.meta div {
  color: var(--ink);
  font-size: 13px;
}

.meta b {
  display: block;
  margin-bottom: 2px;
  color: var(--soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.icon-btn {
  position: fixed;
  z-index: 22;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.close { top: 16px; right: 16px; }
.prev { top: 50%; left: 16px; transform: translateY(-50%); }
.next { top: 50%; right: 16px; transform: translateY(-50%); }

.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 128px;
  padding: 10px 14px;
}

.primary {
  border-color: rgba(192, 160, 109, .8);
  background: rgba(192, 160, 109, .12);
  color: var(--gold);
}

.text-btn:disabled {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}

.order-toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(480px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

.order-toast.open {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.order-toast.success { border-color: rgba(141, 182, 197, .5); }
.order-toast.cancelled { border-color: rgba(217, 143, 125, .5); }

.order-toast .icon-btn {
  width: 26px;
  height: 26px;
  font-size: 18px;
  flex: none;
}

.lb-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sky-panel {
  display: none;
  grid-column: 1 / -1;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sky-panel.open {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sky-map {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  background: var(--panel-2);
  overflow: hidden;
}

.sky-map .sky-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--soft);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--panel-2);
  pointer-events: none;
  transition: opacity .3s ease;
}

.sky-map.ready .sky-loading {
  opacity: 0;
}

.sky-note {
  color: var(--muted);
  font-size: 13px;
}

.sky-note b {
  display: block;
  margin-bottom: 4px;
  color: var(--soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sky-coords {
  margin-top: 10px;
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .sky-panel.open {
    grid-template-columns: 1fr;
  }
}

.print-modal {
  place-items: center;
  padding: 18px;
}

.print-panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.print-preview-link {
  display: block;
  flex: none;
  line-height: 0;
}

.print-preview-link:not([href]) {
  pointer-events: none;
  cursor: default;
}

.print-preview-link[href] .print-preview {
  cursor: zoom-in;
  transition: opacity .2s ease;
}

.print-preview-link[href]:hover .print-preview {
  opacity: .85;
}

.print-preview {
  display: block;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: #101216;
}

.print-head-text {
  flex: 1;
  min-width: 0;
}

.print-head,
.print-form {
  padding: 20px;
}

.print-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.print-head h2 {
  margin: 0;
  color: #cdd0d5;
  font-size: 22px;
  font-weight: 460;
}

.print-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.print-form {
  display: grid;
  gap: 22px;
}

.print-price {
  margin: 0;
  min-height: 1.2em;
  color: var(--soft);
  font-size: 14px;
}

.print-price.error {
  color: #d98a8a;
}

.material-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.material-tab {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101216;
  color: var(--muted);
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.material-tab:hover {
  border-color: rgba(192, 160, 109, .55);
}

.material-tab.active {
  border-color: var(--teal);
  background: rgba(141, 182, 197, .14);
  color: var(--ink);
}

.size-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.size-card {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.size-shape {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 76px;
  min-width: 76px;
  max-width: 160px;
  padding: 4px 8px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #101216;
  transition: border-color .2s ease, background .2s ease;
}

.size-shape-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
  pointer-events: none;
}

.size-card:hover .size-shape {
  border-color: rgba(192, 160, 109, .55);
}

.size-card.active .size-shape {
  border-color: var(--teal);
  background: rgba(141, 182, 197, .14);
}

.size-card.active .size-shape-label {
  color: var(--ink);
}

.print-material {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.print-material:empty {
  display: none;
}

.print-crop-note a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

label,
.field {
  display: grid;
  gap: 6px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101216;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(141, 182, 197, .65);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .toolbar,
  .about-grid,
  .lb-details {
    grid-template-columns: 1fr;
  }

  .topbar,
  .masthead {
    grid-template-columns: 1fr;
  }

  nav,
  .toolbar {
    justify-content: flex-start;
  }

  .card.wide {
    grid-column: 1 / -1;
    width: 100%;
  }

  .lb-details {
    gap: 14px;
  }

  .lb-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .shell {
    padding-inline: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .masthead {
    min-height: 360px;
    padding: 20px;
    background:
      linear-gradient(180deg, rgba(17, 19, 23, .92) 0%, rgba(17, 19, 23, .68) 56%, rgba(17, 19, 23, .9) 100%),
      var(--hero-image),
      var(--panel);
    background-position: center;
    background-size: cover;
  }

  .masthead h1 {
    font-size: clamp(38px, 13vw, 56px);
  }

  .masthead-aside {
    justify-self: stretch;
  }

  .collection-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .collection-meta.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-meta div {
    padding: 12px 10px;
    border-right: 1px solid rgba(220, 226, 235, .1);
    border-bottom: 0;
  }

  .collection-meta div:last-child {
    border-right: 0;
  }

  .collection-meta b {
    font-size: 16px;
  }

  .collection-meta span {
    font-size: 9px;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .card {
    width: 100%;
    min-height: 230px;
  }

  .card h2,
  .card p {
    max-width: 100%;
  }

  .rig div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .prev,
  .next {
    top: 58px;
    transform: none;
  }

  .stage {
    padding-inline: 10px;
  }
}

/* Archive dialogs -------------------------------------------------------- */
.lightbox,
.print-modal {
  background: rgba(18, 19, 18, .98);
}

.stage {
  background: #121312;
}

.stage canvas {
  border-radius: 0;
  box-shadow: none;
}

.loading {
  padding: 5px 8px;
  border-radius: 0;
  background: rgba(23, 24, 23, .9);
  color: var(--soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
}

.lb-details {
  grid-template-columns: minmax(210px, .75fr) minmax(320px, 1.4fr) auto;
  padding-top: 20px;
  background: var(--bg);
}

.lb-details h2 {
  color: var(--ink);
  font-size: 21px;
  font-weight: 400;
}

.kicker {
  color: var(--soft);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .02em;
  text-transform: none;
}

.lb-desc {
  max-width: 660px;
  font-size: 13px;
}

.lb-story {
  max-width: 660px;
  margin-top: 20px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.lb-story[hidden] {
  display: none;
}

.lb-story p {
  margin: 0 0 14px;
  white-space: pre-line;
}

.lb-story p:last-child {
  margin-bottom: 0;
}

.meta {
  gap: 12px 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.meta div {
  color: var(--muted);
  font-size: 12px;
}

.meta b {
  color: var(--soft);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .02em;
  text-transform: none;
}

.icon-btn,
.text-btn {
  border-radius: 0;
  background: rgba(23, 24, 23, .76);
}

.icon-btn {
  width: 38px;
  height: 38px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 20px;
  font-weight: 300;
}

.text-btn {
  min-width: 0;
  padding: 8px 12px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

.primary {
  border-color: rgba(158, 171, 174, .42);
  background: rgba(158, 171, 174, .08);
  color: var(--teal);
}

.version-switch {
  gap: 12px;
}

.version-switch {
  align-items: center;
}

.version-switch-label {
  margin-right: 4px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

/* Real, bordered buttons (not bare underlined text) so it's obvious the
   other version is one click away. */
.version-switch .chip {
  min-height: 32px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11.5px;
}

/* The generic `.chip:hover { border: 0; background: none }` (filter row)
   would otherwise strip the border from these buttons on hover. */
.version-switch .chip:hover {
  border: 1px solid rgba(192, 160, 109, .55);
  background: rgba(29, 33, 39, .9);
  color: var(--ink);
}

.version-switch .chip.active,
.version-switch .chip.active:hover {
  border: 1px solid var(--teal);
  background: rgba(141, 182, 197, .14);
  color: var(--ink);
}

.versions-badge-photo {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 3px 7px;
  border: 1px solid rgba(205, 205, 196, .3);
  background: rgba(18, 19, 18, .7);
  color: rgba(215, 215, 207, .85);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  pointer-events: none;
}

.sky-panel {
  border-top-color: var(--line);
}

.sky-map {
  background: #121312;
}

.print-panel {
  width: min(620px, 100%);
  border-radius: 0;
  background: var(--bg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.print-head,
.print-form {
  padding: 22px;
}

.print-head h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 400;
}

.print-head p,
.print-material,
.print-price {
  color: var(--muted);
  font-size: 12px;
}

.print-preview {
  width: 58px;
  height: 58px;
  border-radius: 0;
  filter: saturate(.86);
}

.print-form {
  gap: 24px;
}

label,
.field {
  color: var(--soft);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .02em;
  text-transform: none;
}

input,
select,
textarea,
.material-tab,
.size-shape {
  border-radius: 0;
  background: #141514;
}

input,
select,
textarea {
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.material-tabs {
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.material-tab {
  padding: 8px 12px;
  border-width: 0 0 1px;
  border-color: transparent;
  background: none;
  color: var(--soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

.material-tab:hover {
  border-color: var(--muted);
}

.material-tab.active {
  border-color: var(--teal);
  background: none;
  color: var(--ink);
}

.size-cards {
  gap: 18px;
}

.size-shape {
  border-color: var(--line);
}

.size-card:hover .size-shape,
.size-card.active .size-shape {
  border-color: var(--teal);
  background: #191b1a;
}

.size-shape-label {
  color: var(--soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
}

.order-toast {
  border-radius: 0;
  background: var(--bg);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

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

/* Archive layout --------------------------------------------------------- */
.shell {
  width: min(1680px, 100%);
  padding: 28px clamp(18px, 3.5vw, 58px) 42px;
}

.site-header {
  margin-bottom: clamp(34px, 5vw, 72px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin-top: -18px;
  margin-bottom: 28px;
  padding-top: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

#gallery,
#about {
  scroll-margin-top: var(--navigation-offset, 100px);
}

.mark {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.identity strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.identity-text span {
  margin-top: 1px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: .06em;
}

.nav-link,
.admin-link {
  min-height: 0;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.nav-link.primary-nav {
  border: 0;
  background: none;
  color: var(--muted);
}

nav {
  gap: 24px;
}

.nav-link:hover,
.admin-link:hover {
  border-color: transparent;
  background: none;
  color: var(--ink);
}

.masthead {
  display: flex;
  min-height: clamp(240px, 34.667vh, 387px);
  padding: clamp(16px, 2.667vw, 36px) clamp(24px, 4vw, 54px);
  border: 0;
  border-radius: 0;
  align-items: flex-end;
  justify-content: space-between;
  background: var(--panel);
}

.masthead::after {
  display: none;
}

.masthead-photo {
  position: absolute;
  inset: 0 0 0 auto;
  width: 66.666667%;
  overflow: hidden;
  cursor: zoom-in;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 45%);
  mask-image: linear-gradient(to right, transparent, #000 45%);
}

.masthead-photo[hidden],
.masthead-caption[hidden] {
  display: none;
}

.masthead-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}

.masthead-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(12, 13, 12, .7));
  pointer-events: none;
}

.masthead-photo:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -4px;
}

.masthead-caption:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 6px;
}

.masthead-label {
  position: relative;
  z-index: 1;
}

.eyebrow,
.card-record,
.count,
.kicker,
.meta b,
.rig b,
.sky-note b,
.sky-map .sky-loading,
label,
.field {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: .02em;
}

.eyebrow {
  margin-bottom: 8px;
  color: rgba(215, 215, 207, .66);
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
}

.masthead h1 {
  max-width: none;
  color: #d1d1cb;
  font-size: clamp(34px, 5vw, 72px);
  font-weight: 300;
  line-height: 1;
}

.masthead-lead {
  margin-top: 15px;
  color: rgba(215, 215, 207, .7);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  line-height: 1.7;
}

.masthead-caption {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(180px, 280px);
  align-items: start;
  padding-left: 20px;
  border-left: 1px solid rgba(215, 215, 207, .35);
}

.masthead-caption b,
.masthead-caption div span {
  display: block;
}

.masthead-caption b {
  color: #d1d1cb;
  font-size: 14px;
  font-weight: 400;
}

.masthead-caption span {
  margin-top: 4px;
  color: rgba(215, 215, 207, .62);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

.toolbar {
  align-items: baseline;
  margin-bottom: 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.filters {
  gap: 0;
}

.chip {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.filters .chip:not(:last-child)::after {
  content: "/";
  margin: 0 10px;
  color: #3e3e3b;
}

.chip.active,
.chip:hover {
  border: 0;
  background: none;
  color: var(--ink);
}

.count {
  font-size: 10px;
  letter-spacing: .02em;
  text-transform: none;
}

.gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 8px;
  column-gap: clamp(18px, 2.6vw, 42px);
  row-gap: 8px;
  align-items: start;
}

.card,
.card.wide {
  display: block;
  width: 100%;
  min-height: 0;
  aspect-ratio: auto;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  padding-bottom: clamp(32px, 3vw, 44px);
}

.card-image {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  box-shadow:
    inset 0 0 0 1px rgba(205, 205, 196, .08),
    0 10px 28px rgba(0, 0, 0, .2);
  transition: transform .35s ease, box-shadow .35s ease;
}

.card:hover .card-image {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(205, 205, 196, .12),
    0 16px 38px rgba(0, 0, 0, .28);
}

@media (prefers-reduced-motion: reduce) {
  .card-image {
    transition: none;
  }

  .card:hover .card-image {
    transform: none;
  }
}

.card img {
  height: auto;
  object-fit: cover;
  transition: opacity .35s ease;
}

.card:hover img {
  transform: none;
  opacity: .88;
}

.card::after {
  display: none;
}

.card figcaption {
  position: static;
  padding: 13px 0 0;
  border-top: 0;
}

.card-heading {
  display: block;
}

.card h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(16px, 1.5vw, 21px);
  font-weight: 400;
  line-height: 1.2;
}

.card-record {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  color: var(--soft);
  font-size: 9px;
  white-space: nowrap;
}

.card-record span:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: #3e3e3b;
}

.print-badge {
  top: auto;
  right: 12px;
  bottom: 12px;
  padding: 3px 6px;
  border-color: rgba(205, 205, 196, .24);
  border-radius: 0;
  background: rgba(18, 19, 18, .7);
  color: rgba(215, 215, 207, .7);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.about {
  margin-top: clamp(88px, 12vw, 170px);
  padding-top: 20px;
}

.disclaimer,
.rig,
.rig div {
  border-radius: 0;
  background: transparent;
}

.disclaimer {
  padding: 0 0 0 18px;
  border: 0;
  border-left: 1px solid var(--line);
}

.rig {
  border-width: 1px 0 0;
}

.rig div {
  grid-template-columns: 130px 1fr;
  border-bottom: 1px solid var(--line);
}

/* Hero scales with the screen width instead of a fixed height: below the
   desktop breakpoint its height follows an aspect ratio (it still grows if
   the text needs more room), so it shrinks proportionally on tablets/phones. */
@media (max-width: 1100px) {
  .masthead {
    min-height: 0;
    aspect-ratio: 12 / 5;
  }
}

@media (max-width: 760px) {
  .masthead {
    min-height: 0;
    aspect-ratio: 2 / 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 12px;
    background: var(--panel);
  }

  .masthead-photo {
    width: 100%;
  }

  .masthead-caption {
    display: none;
  }

  .gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    row-gap: 44px;
  }

  .card,
  .card.wide {
    padding-bottom: 0;
  }

}

@media (min-width: 761px) and (max-width: 1100px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .shell {
    padding-inline: 14px;
  }

  .topbar {
    gap: 16px;
  }

  nav {
    gap: 20px;
  }

  .masthead {
    min-height: 0;
    aspect-ratio: 3 / 2;
    padding: 14px 22px;
    gap: 10px;
  }

  .masthead h1 {
    font-size: 38px;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .filters .chip:not(:last-child)::after {
    margin-inline: 7px;
  }

  .card-record {
    flex-wrap: wrap;
    white-space: normal;
  }
}
