:root {
  color-scheme: dark;
  background: #080d14;
  color: #f3f4ef;
  font: 1rem/1.5 system-ui, sans-serif;
  --muted: #a8b5c5;
  --edge: #2c3b4a;
  --accent: #ffad76;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #c4e7e7; text-underline-offset: .25em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

.shell { max-width: 60rem; margin: auto; padding: clamp(1rem, 4vw, 3.5rem); }
.masthead { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem 1.5rem; }
.masthead nav { display: flex; gap: 1rem; }
h1, h2, .number { font-family: ui-monospace, "Courier New", monospace; }
h1 { margin: 0; font-size: clamp(2rem, 6vw, 4rem); font-weight: 650; line-height: 1.15; }
h2 { margin: 0; font-size: clamp(1.05rem, 2.5vw, 1.45rem); line-height: 1.25; }
.intro { margin: 1rem 0 1.75rem; color: var(--muted); }
.gallery-page h1 { font-size: clamp(1.875rem, 4vw, 2.75rem); }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.75rem, 2vw, 1.25rem); }
@media (min-width: 36rem) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 52rem) { .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: block; height: 100%; border: 1px solid var(--edge); background: #101923; color: inherit; text-decoration: none; }
.tile:hover { border-color: var(--accent); }
img { display: block; height: auto; width: 100%; }
.tile img { aspect-ratio: 1; object-fit: cover; object-position: center 22%; border-bottom: 1px solid var(--edge); }
.caption { padding: .65rem .75rem; }
.caption h2 { font-size: clamp(.95rem, 1.8vw, 1.1rem); }
.caption p { margin: .35rem 0 0; color: var(--muted); font-size: .875rem; }
.number { display: block; margin-bottom: .35rem; color: var(--accent); font-size: .875rem; }

.back { display: inline-block; margin-bottom: 1.5rem; }
.scene { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(1rem, 4vw, 3rem); }
.scene > img { border: 1px solid var(--edge); }
.scene-copy { align-self: center; }
.scene--source .scene-copy { align-self: start; min-width: 0; }
.scene-copy h1 { font-size: clamp(1.75rem, 5vw, 3rem); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; margin: 1.25rem 0; }
.scene-cards { display: grid; grid-auto-rows: 1fr; gap: 1rem; }
.scene-card { display: block; color: inherit; border: 1px solid var(--edge); background: #101923; text-decoration: none; }
.scene-card--model { display: flex; flex-direction: column; }
.model-preview { position: relative; flex: 1 0 3rem; overflow: hidden; }
.model-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 95%; }
.scene-card:hover { color: inherit; border-color: var(--accent); }
.scene-card-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .35rem 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--edge); font-size: .95rem; }
.scene-card-header strong { color: var(--accent); text-decoration: underline; text-underline-offset: .25em; }
.filename, .scene-card pre { font-family: ui-monospace, "Courier New", monospace; }
.scene-card pre { margin: 0; padding: .75rem 1rem; font-size: .875rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.model-caption { display: block; padding: .65rem 1rem; color: var(--muted); font-size: .875rem; }
@media (max-width: 40rem) {
  .scene { grid-template-columns: 1fr; }
  .scene > img { max-width: 18rem; }
  .scene-copy { grid-row: 1; }
}
