/* Agewalker site, the exhibits: features, the screenshot hall, the lightbox and the press room.
   One mount everywhere: a clay mat, a gold hairline, a soft shadow. Hard offsets only on things you press. */

.features, .screens, .press { padding: var(--section) var(--inline); }
.features { padding-bottom: calc(var(--section) * 0.85); }

.section-title { font-size: var(--text-h2); max-width: 18ch; margin-bottom: clamp(2rem, 1.4rem + 2vw, 3.5rem); }
/* Kicker: a single cuneiform wedge pressed before the caps. */
.kicker {
  display: flex; align-items: center; gap: 10px;
  font: 700 0.8rem/1 var(--font-body); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 0.9rem;
}
.kicker::before {
  content: ""; flex: none; width: 20px; height: 11px; background: var(--accent);
  clip-path: polygon(0 0, 42% 40%, 100% 44%, 100% 56%, 42% 60%, 0 100%);
}

/* ── Features ──────────────────────────────────────── */
.feature { display: grid; gap: clamp(1.75rem, 3vw, 4.5rem); align-items: center; margin-bottom: clamp(3.5rem, 2.5rem + 3vw, 6rem); }
.feature:last-child { margin-bottom: 0; }
@media (min-width: 960px) {
  .feature { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .feature.is-flipped { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .feature.is-flipped .feature-media { order: 2; }
}
.feature-media:not(.figures) {
  padding: clamp(6px, 0.8vw, 10px); border-radius: var(--r-md);
  background: var(--mat);
  box-shadow: inset 0 1px 0 var(--lip), 0 0 0 1px var(--hairline), var(--shadow);
}
.feature-media img { width: 100%; border-radius: var(--r-sm); box-shadow: 0 0 0 1px rgba(34, 25, 15, 0.35); }
.feature-text { position: relative; }

/* Numbers as clay tablets with the digits pressed in. */
.num {
  display: grid; place-items: center; width: 64px; height: 56px; margin-bottom: 1.25rem;
  border-radius: 10px 14px 12px 9px / 12px 9px 14px 10px;
  background: var(--clay-200);
  box-shadow: inset 0 2px 3px rgba(60, 35, 10, 0.28), inset 0 -1px 0 rgba(255, 255, 255, 0.55), 0 1px 0 rgba(255, 255, 255, 0.6);
  font: 700 1.7rem/1 var(--font-display); color: var(--brick-700);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55), 0 -1px 0 rgba(60, 25, 8, 0.25);
  transform: rotate(-2deg);
}
.feature.is-flipped .num { transform: rotate(1.5deg); }
@media (prefers-color-scheme: dark) {
  .num { background: #22305e; color: var(--gold-400); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.55), inset 0 -1px 0 rgba(255, 255, 255, 0.08); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.08); }
}
.feature h3 { font-size: var(--text-h3); margin-bottom: 1rem; }
.feature p { color: var(--text-soft); max-width: 36em; }
.note { font-size: 0.85rem; }


/* Epochs as a ziggurat: the Stone Age is the base course, every later epoch a narrower terrace on top of it,
   "…up to 15" the shrine still to be built. The gold courses are the demo, the foundation. */
.epochs {
  --course: var(--bg-raised); --course-shade: var(--clay-300);
  display: grid; justify-items: center; gap: 3px; max-width: 30rem; list-style: none; padding: 0; margin: 1.6rem 0 0.9rem; counter-reset: ep;
}
@media (prefers-color-scheme: dark) { .epochs { --course: #22305e; --course-shade: #101a40; } }
.epochs li {
  counter-increment: ep; width: calc(100% - (var(--n) - 1) * 9%);
  display: flex; justify-content: center; align-items: center; padding: 4px 10px 6px; border-radius: 2px;
  font-weight: 700; font-size: 0.85rem; line-height: 1.2; text-align: center;
  background: var(--course); color: var(--text-soft);
  box-shadow: inset 0 1px 0 var(--lip), inset 0 -2px 0 var(--course-shade), 0 0 0 1px var(--line);
}
.epochs li:nth-child(1) { --n: 1; grid-row: 7; } .epochs li:nth-child(2) { --n: 2; grid-row: 6; } .epochs li:nth-child(3) { --n: 3; grid-row: 5; }
.epochs li:nth-child(4) { --n: 4; grid-row: 4; } .epochs li:nth-child(5) { --n: 5; grid-row: 3; } .epochs li:nth-child(6) { --n: 6; grid-row: 2; }
.epochs li:nth-child(7) { --n: 7; grid-row: 1; }
.epochs li::before { content: counter(ep); flex: none; display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-right: 7px; border-radius: 2px; background: var(--line); font-size: 0.8em; color: var(--text); }
.epochs li.is-demo { background: linear-gradient(180deg, #ffd77d, var(--gold-400)); color: var(--ink-900); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 0 var(--gold-500), 0 0 0 1px var(--gold-700); }
.epochs li.is-demo::before { background: var(--ink-900); color: var(--gold-400); }
.epochs li.is-more { background: transparent; box-shadow: none; outline: 1.5px dashed var(--text-soft); outline-offset: -1.5px; opacity: 0.75; }
.epochs li.is-more::before { content: none; }
.epochs + .note { margin-top: 0; }

/* Portraits stand on a stepped plinth with their names on its face: a base course, a course above it,
   and a dais in the middle for the central figure. Subgrid keeps the names on one line. */
.figures {
  --plinth: var(--clay-300); --plinth-base: #cdb07f; --ring: 11px;
  position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto 14px;
  column-gap: clamp(14px, 2.4vw, 28px); padding-top: 14px;
}
@media (prefers-color-scheme: dark) { .figures { --plinth: #22305e; --plinth-base: #18244d; } }
@media (max-width: 599px) { .figures { --ring: 8px; } }
.figures figure { grid-row: 1 / span 2; display: grid; grid-template-rows: subgrid; margin: 0; padding-inline: var(--ring); text-align: center; }
.figures figure:nth-child(2) { grid-column: 2; } .figures figure:nth-child(3) { grid-column: 3; }
.figures figure:first-child { grid-column: 1; }
@supports not (grid-template-rows: subgrid) { .figures figure { grid-row: auto; display: block; } }
.figures img {
  width: 100%; aspect-ratio: 1; margin-bottom: var(--ring); border-radius: 50%; object-fit: cover;
  background: radial-gradient(circle at 50% 35%, #2c4590, var(--lapis-800) 70%);
  box-shadow: 0 0 0 3px var(--outline), 0 0 0 9px var(--gold-500), 0 0 0 11px var(--outline), var(--shadow);
  transition: transform 300ms var(--ease);
}
.figures figure:nth-child(2) img { transform: translateY(-8px); }
@media (hover: hover) {
  .figures figure:hover img { transform: translateY(-6px) rotate(-2deg); }
  .figures figure:nth-child(2):hover img { transform: translateY(-14px) rotate(2deg); }
}
.figures figcaption { align-self: center; margin-inline: calc(var(--ring) * -1); padding: 12px 0 8px; font: 700 clamp(0.8rem, 0.7rem + 0.5vw, 1.15rem)/1.2 var(--font-display); }
.figures::after {
  content: ""; grid-row: 2 / 4; grid-column: 1 / -1; z-index: -1; margin-top: -8px;
  background:
    linear-gradient(var(--lip) 0 1px, transparent 1px),
    linear-gradient(transparent 8px, var(--lip) 8px 9px, transparent 9px),
    linear-gradient(transparent calc(100% - 14px), var(--lip) calc(100% - 14px) calc(100% - 13px), var(--plinth-base) calc(100% - 13px)),
    var(--plinth);
  clip-path: polygon(36% 0, 64% 0, 64% 8px, 96% 8px, 96% calc(100% - 14px), 100% calc(100% - 14px), 100% 100%, 0 100%, 0 calc(100% - 14px), 4% calc(100% - 14px), 4% 8px, 36% 8px);
  box-shadow: inset 0 -2px 0 rgba(60, 35, 10, 0.15);
}
@media (max-width: 599px) {
  .figures img { box-shadow: 0 0 0 2px var(--outline), 0 0 0 6px var(--gold-500), 0 0 0 8px var(--outline), var(--shadow); }
}

/* ── The screenshot hall: a deeper ground, entered over ziggurat terraces ── */
.screens {
  --tread: rgba(255, 255, 255, 0.75);
  position: relative; isolation: isolate;
  padding-top: calc(var(--section) * 0.75 + var(--step) * 4);
  background: var(--tread);
  clip-path: var(--terraces);
}
/* The hall floor sits 2px lower than the outline, so every terrace shows a lit tread. */
.screens::before { content: ""; position: absolute; inset: 2px 0 0; z-index: -1; background: var(--grain), var(--grain), var(--bg-sunk); clip-path: var(--terraces); }
/* At night the hall is a step deeper, and lamplight falls into it from the terrace. */
@media (prefers-color-scheme: dark) {
  .screens { --tread: rgba(244, 196, 92, 0.55); }
  .screens::before { background: radial-gradient(70% 40% at 50% 0%, rgba(53, 85, 176, 0.22), transparent 70%), var(--grain), var(--grain), var(--bg-sunk); }
}
.screens {
  --terraces: polygon(0 calc(var(--step) * 4), 14% calc(var(--step) * 4), 14% calc(var(--step) * 3), 24% calc(var(--step) * 3), 24% calc(var(--step) * 2), 33% calc(var(--step) * 2), 33% var(--step), 41% var(--step), 41% 0, 59% 0, 59% var(--step), 67% var(--step), 67% calc(var(--step) * 2), 76% calc(var(--step) * 2), 76% calc(var(--step) * 3), 86% calc(var(--step) * 3), 86% calc(var(--step) * 4), 100% calc(var(--step) * 4), 100% 100%, 0 100%);
}
/* Every vitrine is two tracks of the hall grid, a picture and a label plate, shared with its row through subgrid:
   pictures in a row end on one line, plates start on one rule, and the 2×2 vitrines end with the row beside them. */
.gallery {
  --gap: clamp(12px, 1.4vw, 20px);
  list-style: none; padding: 0; margin: 0 0 calc(var(--gap) * -1); display: grid; column-gap: var(--gap); row-gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense;
}
.gallery li { display: grid; grid-row: span 2; grid-template-rows: subgrid; margin-bottom: var(--gap); }
.gallery li:nth-child(3n+1) { grid-column: 1 / -1; }
/* Tablet: three columns, one 2×2 vitrine, two wide ones. */
@media (min-width: 760px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery li:nth-child(3n+1) { grid-column: auto; }
  .gallery li:first-child { grid-column: span 2; grid-row: span 4; }
  .gallery li:nth-child(5), .gallery li:last-child { grid-column: span 2; }
}
@media (min-width: 1100px) {
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gallery li:nth-child(5) { grid-row: span 4; }
}
.gallery li:nth-child(4n+2) { transition-delay: 60ms; } .gallery li:nth-child(4n+3) { transition-delay: 120ms; } .gallery li:nth-child(4n) { transition-delay: 180ms; }

/* Each tile is a vitrine: mat, gold hairline, a label plate that is always there. */
.gallery a {
  position: relative; grid-row: 1 / -1; display: grid; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr);
  width: 100%; padding: 6px; cursor: zoom-in; text-align: left; text-decoration: none;
  border-radius: var(--r-md); background: var(--mat); color: var(--text);
  box-shadow: inset 0 1px 0 var(--lip), 0 0 0 1px var(--hairline), var(--shadow);
  transition: transform 300ms var(--ease);
}
@supports not (grid-template-rows: subgrid) { .gallery li, .gallery a { grid-template-rows: auto 1fr; } }
.gallery a::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 1px var(--gold-500), var(--shadow-lift); opacity: 0; transition: opacity 300ms var(--ease);
}
.gallery a:focus-visible { transform: translateY(-4px); }
.gallery a:focus-visible::after { opacity: 1; }
@media (hover: hover) {
  .gallery a:hover { transform: translateY(-4px); }
  .gallery a:hover::after { opacity: 1; }
}
.gallery a:active { transform: translateY(-1px); }
.gallery .shot { grid-row: 1 / -2; position: relative; display: block; overflow: hidden; border-radius: var(--r-sm); background: var(--lapis-800); min-height: 0; }
.gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; transition: transform 600ms var(--ease); }
/* Wide vitrines crop to a band; the 2×2 ones fill whatever their two rows give them. */
@media (min-width: 760px) {
  .gallery li:nth-child(5) img, .gallery li:last-child img { aspect-ratio: 32 / 9; }
  .gallery li:first-child img { position: absolute; inset: 0; aspect-ratio: auto; }
}
@media (min-width: 1100px) { .gallery li:nth-child(5) img { position: absolute; inset: 0; aspect-ratio: auto; } }
.gallery a:focus-visible img { transform: scale(1.035); }
@media (hover: hover) { .gallery a:hover img { transform: scale(1.035); } }
/* The label plate: a rule right under the picture, the caption at full width, the seal under it. */
.gallery .plate {
  grid-row: -2 / -1; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; justify-items: start; gap: 6px 14px;
  margin-top: 6px; padding: 8px 4px 3px; border-top: 1px solid var(--hairline);
}
.gallery .cap { font: 700 0.8rem/1.35 var(--font-body); color: var(--text); }
/* A phone vitrine that has its row to itself keeps the seal beside the caption. */
@media (max-width: 759px) { .gallery li:nth-child(3n+1) .plate { grid-template-columns: minmax(0, 1fr) auto; } }
.gallery .badge { margin-top: 1px; }

/* Badges: demo shots carry a little gold seal; the rest a quiet line. */
.badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font: 700 0.66rem/1.3 var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-soft);
}
.badge.is-demo {
  padding: 3px 9px 3px 7px; border-radius: var(--r-sm); color: var(--ink-900);
  background: linear-gradient(180deg, #ffd77d, var(--gold-400));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 0 1px var(--gold-700), 0 2px 0 var(--gold-700);
}
.badge.is-demo::before { content: ""; width: 9px; height: 6px; background: var(--brick-700); clip-path: polygon(0 0, 42% 40%, 100% 44%, 100% 56%, 42% 60%, 0 100%); }

/* ── Lightbox ──────────────────────────────────────── */
.lightbox { border: 0; padding: 0; overflow: visible; background: transparent; max-width: min(96vw, 1600px); width: 100%; color: #fbf1dc; }
@media (min-width: 900px) { .lightbox { max-width: min(calc(96vw - 136px), 1600px); } }
.lightbox::backdrop { background: rgba(8, 12, 28, 0.93); }
/* The page stays put under the open picture. */
html:has(dialog[open]) { overflow: hidden; }
.lightbox img {
  width: auto; max-width: 100%; max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); margin: 0 auto; border-radius: var(--r-sm);
  box-shadow: 0 0 0 2px var(--gold-500), 0 0 0 6px rgba(13, 22, 51, 0.9), 0 30px 60px -20px #000;
  touch-action: pan-y; transition: opacity 180ms ease;
}
.lightbox img.is-out { opacity: 0; }
.lightbox p { text-align: center; margin: 16px 56px 0; font-weight: 700; }
.lightbox .badge { margin-right: 10px; vertical-align: 0.1em; color: #c6b89c; }
.lightbox .badge.is-demo { color: var(--ink-900); }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: lb-in 280ms var(--ease); }
  .lightbox[open]::backdrop { animation: lb-fade 280ms ease; }
}
@keyframes lb-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes lb-fade { from { opacity: 0; } }
.lb-btn {
  position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--gold-400);
  display: grid; place-items: center; padding: 0 0 3px;
  background: rgba(13, 22, 51, 0.88); color: var(--gold-400); font: 700 1.6rem/1 var(--font-body); cursor: pointer;
  transition-property: background-color, color, transform; transition-duration: 150ms;
}
@media (hover: hover) { .lb-btn:hover { background: var(--gold-400); color: var(--ink-900); } }
.lb-btn:active { transform: scale(0.94); }
.lb-prev { left: 8px; top: calc(50% - 44px); }
.lb-next { right: 8px; top: calc(50% - 44px); }
.lb-close { right: 8px; top: 8px; }
@media (min-width: 900px) {
  .lb-prev { left: -64px; }
  .lb-next { right: -64px; }
  .lb-close { right: -64px; top: 0; }
}
/* A phone held upright has no room beside the picture: the buttons go above and below it, off the shot. */
@media (max-width: 899px) and (orientation: portrait) {
  .lightbox { padding: 56px 0 60px; }
  .lightbox p { margin: 12px 8px 0; }
  .lb-close { top: 0; right: 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 0; }
}

/* ── Press room ────────────────────────────────────── */
.press-grid { display: grid; gap: clamp(2rem, 4vw, 4.5rem); align-items: start; }
@media (min-width: 960px) { .press-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); } }
/* The factsheet is a ruled tablet: scribe lines between the entries. */
.factsheet {
  margin: 0; padding: clamp(1.1rem, 2.6vw, 2.25rem) clamp(1.25rem, 3vw, 2.5rem); border-radius: var(--r-md);
  background: var(--bg-raised);
  box-shadow: inset 0 1px 0 var(--lip), 0 0 0 1px var(--hairline), var(--shadow);
  display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: stretch;
}
.factsheet dt, .factsheet dd { padding: 12px 0; border-top: 1px solid var(--line); }
.factsheet dt:first-of-type, .factsheet dt:first-of-type + dd { border-top: 0; padding-top: 0; }
.factsheet dt:last-of-type, .factsheet dd:last-of-type { padding-bottom: 0; }
/* The label's line box is as tall as the value's first line: one rule per row, the caps on the value's line. */
.factsheet dt { padding-right: 28px; font: 700 0.78rem/calc(var(--text-base) * 1.6) var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.factsheet dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .factsheet { grid-template-columns: 1fr; }
  .factsheet dt { line-height: 1.3; }
  .factsheet dd { border-top: 0; padding-top: 4px; }
  .factsheet dd:first-of-type { padding-top: 4px; }
}

.press-side { display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 20px; align-content: start; }
.press-icon { grid-row: 1; width: 72px; height: 72px; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--hairline), var(--shadow); }
.press-side p { grid-column: 2; color: var(--text-soft); margin: 0; }
.downloads { grid-column: 1 / -1; list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: 0; }
@media (max-width: 480px) {
  .press-side { grid-template-columns: minmax(0, 1fr); }
  .press-icon { margin-bottom: 1rem; }
  .press-side p { grid-column: 1; }
}
.dl {
  display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap;
  padding: 14px 4px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--line);
  transition: transform 150ms var(--ease);
}
.dl b { font-family: var(--font-display); font-size: 1.1rem; }
.dl b::before { content: "↓ "; color: var(--accent); }
.dl span { font-size: 0.85rem; color: var(--text-soft); }
@media (hover: hover) {
  .dl:hover { transform: translateX(4px); }
  .dl:hover b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
}
/* The ZIP is the one people come for: it gets the gold. */
.downloads li:first-child { margin-bottom: 10px; }
.downloads li:first-child .dl {
  padding: 16px 20px; border: 0; border-radius: var(--r-md); color: var(--ink-900);
  background: linear-gradient(180deg, #ffd77d, var(--gold-500));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 0 2px var(--outline), 0 5px 0 2px var(--gold-700);
  transition-property: transform, box-shadow;
}
.downloads li:first-child .dl b { font-size: 1.25rem; }
.downloads li:first-child .dl b::before { color: var(--brick-700); }
.downloads li:first-child .dl span { color: var(--ink-700); }
@media (hover: hover) { .downloads li:first-child .dl:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 0 2px var(--outline), 0 7px 0 2px var(--gold-700); } }
.downloads li:first-child .dl:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 2px var(--outline), 0 2px 0 2px var(--gold-700); }
