/* ================================================================
   Shared styles for Catalogue detail pages + landing chrome.
   ================================================================ */

/* Departure Mono from cdnfonts — falls back to VT323 (Google Fonts)
   if the import fails so the site still loads cleanly. */
@import url('https://fonts.cdnfonts.com/css/departure-mono');

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #6f6f6f;
  --subtle: #bdbdbd;
  --line: #e5e5e5;
  --frame: #dcdcdc;
  --pad: clamp(20px, 3vw, 40px);
  --font-body: 'PT Sans', sans-serif;
  --font-display: 'Departure Mono', 'VT323', ui-monospace, monospace;
  --measure: 760px;
  --media-width: 900px;
  --media-narrow: 900px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; }

/* ========== TOP BAR ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px var(--pad);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar a {
  color: var(--muted);
  transition: color 160ms ease;
}
.topbar a:hover { color: var(--text); }
.topbar .crumb {
  color: var(--text);
  flex: 1;
  text-align: center;
}
.topbar .nav { display: flex; gap: 24px; }
.topbar .nav .disabled {
  color: var(--subtle);
  pointer-events: none;
}

/* ========== SECTION ========== */
.sec {
  padding: 72px var(--pad) 110px;
}
.sec-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

/* Frontispiece — the object silhouette from the landing, appearing as
   a small emblem above the title. Colors in on hover. */
.sec-object {
  display: block;
  width: auto;
  height: 140px;
  margin: 0 auto 28px;
  filter: brightness(0) saturate(100%);
  transition: filter 400ms ease, transform 400ms ease;
}
.sec-object:hover {
  filter: none;
  transform: scale(1.04);
}

/* Tiny hairline between the object and the kicker */
.sec-rule {
  display: block;
  width: 48px;
  height: 0;
  margin: 0 auto 24px;
  border: 0;
  border-top: 1px solid var(--text);
}

.sec-label {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.sec-title {
  margin: 0 0 24px 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 6vw, 104px);
  line-height: 0.88;
  text-transform: uppercase;
}
.premise {
  max-width: 34ch;
  margin: 0 auto 18px;
  font-size: 17px;
  line-height: 1.5;
  font-style: italic;
}
.description {
  max-width: 46ch;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 56px;
}

.sublabel {
  width: 100%;
  max-width: var(--media-width);
  margin: 12px auto 0;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-align: left;
}
.stack > .sublabel:first-child {
  padding-top: 0;
  border-top: 0;
  margin-top: 0;
}

.subnote {
  width: 100%;
  max-width: var(--media-width);
  margin: -18px auto 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  text-align: left;
}

/* Sublabel acting as column header inside a row */
.row .block > .sublabel:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.row .block > .sublabel + .subnote {
  margin-top: 6px;
  margin-bottom: 14px;
}

.block {
  width: 100%;
  max-width: var(--media-width);
  margin: 0 auto;
}
.block.narrow {
  max-width: var(--media-narrow);
}

.block img,
.block video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border: 1px solid var(--frame);
  border-radius: 6px;
}
.block img  { background: #fafaf8; }
.block video { background: #000; }

/* In a row, lock media to a shared aspect ratio with contain so
   nothing is cropped and siblings line up at equal heights. */
.row .block img,
.row .block video {
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.row {
  width: 100%;
  max-width: var(--media-width);
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.row .block {
  margin: 0;
  flex: 1;
  max-width: none;
}

.caption {
  margin: 10px 0 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  text-align: left;
}

/* ========== PAGE FOOTER (detail pages) ========== */
.page-foot {
  padding: 52px var(--pad) 72px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px;
  align-items: center;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.foot-prev { text-align: left; }
.foot-home { text-align: center; }
.foot-next { text-align: right; }

.page-foot a,
.page-foot .disabled {
  color: var(--muted);
  display: inline-block;
  transition: color 160ms ease, transform 220ms ease;
}
.page-foot a:hover { color: var(--text); }
.foot-prev a:hover { transform: translateX(-6px); }
.foot-next a:hover { transform: translateX(6px); }

.page-foot .foot-tag {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--subtle);
  margin-bottom: 6px;
}
.page-foot .foot-label {
  display: block;
  font-size: 20px;
  line-height: 1;
  color: var(--text);
}
.foot-home .foot-label { color: var(--muted); }
.foot-home a:hover .foot-label { color: var(--text); }

.page-foot .disabled {
  color: var(--subtle);
  pointer-events: none;
  cursor: default;
}
.page-foot .disabled .foot-label { color: var(--subtle); }

@media (max-width: 700px) {
  .page-foot {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }
  .foot-prev, .foot-home, .foot-next { text-align: center; }
}

/* ========== BACK BAR (experiment pages) ==========
   Non-sticky, simple "back to catalogue" link.
   ================================================= */
.backbar {
  padding: 20px var(--pad);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.backbar a {
  color: var(--muted);
  transition: color 160ms ease;
}
.backbar a:hover { color: var(--text); }

/* ========== EDITORIAL LAYOUT (experiments) ==========
   Used by: sem1 / gesture / tap / pressure / rhythm
   — left-aligned title, content right below, big media.
   =================================================== */
.xp-sec {
  padding: 12px var(--pad) 40px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.xp-head {
  max-width: 1600px;
  padding-left: 40px;
}

.xp-kicker {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px 0;
}
.xp-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 0.94;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text);
  margin: 0;
  max-width: 14ch;
}

.xp-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  column-gap: 56px;
  row-gap: 0;
  align-items: start;
  max-width: 1600px;
  width: 100%;
}

/* Prototype layout variant: text and visual start at the same row,
   so longer descriptions extend downward without pushing the media
   further down the page. */
.xp-body.proto .xp-text {
  grid-row: 1;
}
.xp-body.proto .xp-visual {
  grid-row: 1;
}

.xp-text {
  grid-column: 1;
  grid-row: 1;
  max-width: 32ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  padding-left: 40px;
}
.xp-visual {
  grid-column: 2;
  grid-row: 2;
}
.xp-text p { margin: 0 0 1em 0; }
.xp-text p:last-child { margin-bottom: 0; }

.xp-visual { display: block; }

.xp-grid {
  display: grid;
  gap: 12px;
}
.xp-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.xp-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.xp-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Boxed: right-aligned compact grid, but every cell keeps its black
   frame (4:3 bordered box) so mixed-ratio media aligns to a uniform
   size with black letterboxing. Used for E1. */
.xp-grid.boxed {
  max-width: 820px;
  margin-left: auto;
  align-items: start;
}
.xp-grid.boxed .cell img,
.xp-grid.boxed .cell video {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border: 1px solid var(--frame);
  border-radius: 4px;
  background: #000;
  width: 100%;
}

/* Compact: right-aligned grid, media plain — no frames, no fills. */
.xp-grid.compact {
  max-width: 820px;
  margin-left: auto;
  align-items: start;
}
.xp-grid.compact .cell { border: none; }
.xp-grid.compact .cell img,
.xp-grid.compact .cell video {
  aspect-ratio: auto;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* Plain: removes the frame treatment — natural media, no bg or border */
.xp-grid.plain .cell img,
.xp-grid.plain .cell video {
  aspect-ratio: auto;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* Uniform: locks every cell to a shared aspect ratio and crops the
   image itself (object-fit: cover) — no added frame, the images
   themselves are trimmed to match. */
.xp-grid.uniform .cell img,
.xp-grid.uniform .cell video {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* Compact visual: shrinks the whole media column (grid + stack) */
.xp-visual.compact {
  max-width: 820px;
  margin-left: auto;
}
/* Wide visual: slightly bigger (used on prototype pages) */
.xp-visual.wide {
  max-width: 880px;
  margin-left: auto;
}

/* Tiny description placeholder — sits under each image/video */
.xp-mini-desc {
  margin: 8px 0 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  font-style: italic;
}

/* Stack: full-width media stacked vertically (under the grid) */
.xp-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.xp-stack img,
.xp-stack video {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  background: transparent;
}

.xp-grid .cell { display: flex; flex-direction: column; }

.xp-grid .cell img,
.xp-grid .cell video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #000;
  border: 1px solid var(--frame);
  border-radius: 4px;
}
.xp-grid .cell img { background: #fafaf8; }

/* 4-col rows get squarer cells → bigger videos in the row. */
.xp-grid.cols-4 .cell img,
.xp-grid.cols-4 .cell video {
  aspect-ratio: 1 / 1;
}

.xp-cell-desc {
  margin: 10px 0 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  font-style: italic;
  min-height: 3.5em;
}
.xp-cell-desc strong {
  font-style: normal;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.xp-cap {
  margin: 12px 0 0 0;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  text-align: right;
}

/* Arrow-only footer for experiment pages */
.xp-foot {
  padding: 16px var(--pad) 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
}
.xp-foot a,
.xp-foot .disabled {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  transition: color 160ms ease, border-color 160ms ease;
}
.xp-foot a:hover {
  color: var(--text);
  border-color: var(--text);
}
.xp-foot .disabled {
  color: var(--subtle);
  border-color: var(--line);
  pointer-events: none;
}

/* Scroll sections below initial hero (for tap / pressure / rhythm) */
.xp-scroll {
  padding: 72px var(--pad);
  max-width: 1600px;
  margin: 0 auto;
}
.xp-scroll-block + .xp-scroll-block { margin-top: 80px; }
.xp-scroll-block img,
.xp-scroll-block video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  background: #000;
  border: 1px solid var(--frame);
  border-radius: 4px;
}
.xp-scroll-block img { background: #fafaf8; }
.xp-scroll-block .xp-cap { margin-top: 12px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .row { flex-direction: column; }
  .sec { padding: 70px var(--pad) 80px; }
  .topbar .crumb { display: none; }
  .back-to-top { bottom: 16px; right: 16px; }

  .xp-sec { min-height: auto; gap: 32px; }
  .xp-body { grid-template-columns: 1fr; gap: 24px; }
  .xp-grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .xp-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .xp-title { font-size: clamp(48px, 12vw, 80px); }
  .xp-cell-desc { min-height: 0; }
}
