/* 04 Gallery Walk
   A walk along gallery walls. Desktop: one long horizontal corridor of walls.
   Phone / short screens: the same walls stacked vertically.
   Effects live on the WALL (background gradients), never on the artwork images. */

:root {
  --wall: #d3d2ce;          /* gallery grey */
  --wall-lit: #f1f0ec;      /* centre of a spotlight pool */
  --wall-shade: #bdbcb7;    /* ceiling / corner falloff */
  --floor: #8a867f;         /* polished concrete */
  --floor-lit: #a29e96;
  --skirting: #5f5c57;
  --ink: #1c1c1b;           /* vinyl lettering, label titles */
  --ink-soft: #464543;      /* secondary text: 6:1 on the wall, 8:1 on a label */
  --label: #f8f7f4;         /* label plate */
  --rule: #b3b2ad;
  --tape: #cddff0;          /* blue painter's tape = draft notes */
  --tape-ink: #13263a;
  --placeholder: #c2c1bc;

  --gut: 16px;
  --sans: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Helvetica, sans-serif;
  --vinyl: "Jost", "Futura", "Century Gothic", "Avenir Next", sans-serif;
}

@media (min-width: 700px) {
  :root { --gut: 32px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

img { max-width: 100%; }

[hidden] { display: none !important; }

h1, h2, h3 { text-wrap: balance; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gut);
  top: -60px;
  z-index: 20;
  background: var(--label);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 600;
}
.skip:focus { top: 8px; }

/* ---------- header ---------- */

.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 16px var(--gut) 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--wall);
}

.brand {
  font-family: var(--vinyl);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.site-head ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-head nav a {
  display: inline-block;
  padding: 4px 0;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-head nav a:hover { border-bottom-color: var(--ink-soft); }
.site-head nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ---------- footer ---------- */

.site-foot {
  padding: 14px var(--gut) 18px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.site-foot p { margin: 0; max-width: 110ch; }

/* ---------- draft notes ---------- */

.tape {
  display: inline-block;
  max-width: 44ch;
  margin: 12px 0 0;
  padding: 5px 10px 6px;
  background: var(--tape);
  color: var(--tape-ink);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  transform: rotate(-0.5deg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.tbc {
  display: inline-block;
  padding: 0 6px;
  background: var(--tape);
  color: var(--tape-ink);
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: 0.35em;
}

/* ---------- walls (base = phone: stacked vertically) ---------- */

.gallery { position: relative; }

.wall {
  position: relative;
  isolation: isolate;
  padding: 56px var(--gut) 88px;
  border-bottom: 1px solid var(--rule);
}

/* spotlight pool from a ceiling track light: on the wall, behind the work */
.wall::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 42% at 50% 22%, var(--wall-lit) 0%, rgba(241, 240, 236, 0.55) 45%, rgba(241, 240, 236, 0) 100%),
    linear-gradient(to bottom, var(--wall-shade) 0, var(--wall) 64px);
  transition: opacity 0.9s ease;
}

/* floor and skirting */
.wall::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 48px;
  z-index: -1;
  background:
    radial-gradient(ellipse 50% 90% at 50% 0%, var(--floor-lit), rgba(162, 158, 150, 0) 100%),
    linear-gradient(var(--skirting) 0 4px, var(--floor) 4px);
}

.hang { margin: 0 auto; max-width: 900px; }

.piece {
  position: relative;
  margin: 0;
}

.look {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
}
.look:focus-visible { outline-offset: 6px; }

.frame {
  display: block;
  aspect-ratio: var(--r);
  background: var(--placeholder);
  box-shadow: 0 22px 28px -22px rgba(0, 0, 0, 0.55), 0 2px 4px rgba(0, 0, 0, 0.12);
}

.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.piece figcaption {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-soft);
}

.prints {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 20px 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.salon-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 24px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.salon-row + .salon-row { margin-top: 24px; }

/* ---------- wall label ---------- */

.label {
  max-width: 34rem;
  margin: 40px auto 0;
  padding: 18px 20px 20px;
  background: var(--label);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16), 0 6px 14px -10px rgba(0, 0, 0, 0.3);
}

.label p { margin: 0; }

.l-artist {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.l-title {
  margin: 2px 0 8px;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 700;
}
.l-title i { font-style: italic; }
.l-title .l-year { font-weight: 400; font-style: normal; }

.l-facts { color: var(--ink-soft); }
.l-facts p + p { margin-top: 1px; }
.l-id {
  margin-top: 8px !important;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.l-statement {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  max-width: 65ch;
}
.l-statement p + p,
.l-statement details p { margin-top: 0.8em; }

.l-statement summary {
  margin-top: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  width: fit-content;
}

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

.l-inquiry {
  margin-top: 14px !important;
  font-style: italic;
}

.l-process {
  margin: 14px 0 0;
  padding-left: 1.3em;
  font-size: 13.5px;
}

.l-film { margin-top: 14px !important; font-weight: 600; }

/* ---------- entrance / text walls ---------- */

.vinyl-kicker {
  margin: 0 0 10px;
  font-family: var(--vinyl);
  font-size: 15px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.vinyl-name {
  margin: 0;
  font-family: var(--vinyl);
  font-weight: 500;
  font-size: clamp(64px, 19vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.vinyl-name span { display: block; }

.vinyl-sub {
  margin: 18px 0 0;
  font-family: var(--vinyl);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.wall-text {
  max-width: 30ch;
  font-family: var(--vinyl);
  font-size: 21px;
  line-height: 1.45;
}
.wall-text p { margin: 0 0 0.8em; }

.wall-quote { margin: 36px 0 0; max-width: 32ch; }
.wall-quote p {
  margin: 0;
  font-family: var(--vinyl);
  font-size: 22px;
  line-height: 1.4;
}
.wall-quote footer {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.wall-h2 {
  margin: 0 0 18px;
  font-family: var(--vinyl);
  font-weight: 500;
  font-size: clamp(36px, 9vw, 56px);
  line-height: 1;
  letter-spacing: 0.01em;
}

.wall-contact {
  margin: 18px 0 0;
  font-weight: 600;
}

.next-room {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--vinyl);
  font-size: 22px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
}

.walk-hint { display: none; }

/* phone: keep the entrance short so the first work shows on the first screen */
.wall--entrance { padding: 32px var(--gut) 44px; }
.wall--entrance::after { height: 28px; }
.wall--entrance .vinyl-sub { margin-top: 12px; font-size: 18px; }
.wall--entrance .wall-quote { margin-top: 22px; }
.wall--entrance .wall-quote p { font-size: 18px; }

/* ---------- controls (desktop only) ---------- */

.walk-bar { display: none; }

/* ---------- "look closer" dialog ---------- */

.closer {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  background: var(--wall);
  color: var(--ink);
}
.closer::backdrop { background: rgba(28, 28, 27, 0.7); }

.closer-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  height: 100%;
  padding: 12px var(--gut) 18px;
}

.closer-top { display: flex; justify-content: flex-end; }

.closer-close {
  padding: 8px 14px;
  border: 2px solid var(--ink);
  background: var(--label);
  color: var(--ink);
  font: 600 14px var(--sans);
  cursor: pointer;
}

.closer-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-height: 0;
}

.closer-cap { font-size: 14px; color: var(--ink-soft); max-width: 65ch; }
.closer-cap p { margin: 0; }
.closer-cap .c-title { color: var(--ink); font-weight: 700; font-size: 16px; }

/* =========================================================
   DESKTOP: the horizontal corridor
   ========================================================= */

@media (min-width: 821px) and (min-height: 600px) {

  body {
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }

  main { min-height: 0; }

  .gallery {
    height: 100%;
    container-type: size;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--skirting) var(--floor);
  }

  .wall {
    --pad: clamp(28px, 4.5cqw, 72px);
    --lw: clamp(250px, 21cqw, 330px);
    --aw: calc(100cqw - var(--lw) - 3 * var(--pad));
    flex: 0 0 auto;
    height: 100cqh;
    min-width: 72cqw;
    display: flex;
    align-items: center;
    align-items: safe center;
    justify-content: center;
    gap: var(--pad);
    padding: 0 var(--pad) 10cqh;
    border-bottom: 0;
    scroll-snap-align: center;
  }

  .wall::before {
    background:
      radial-gradient(ellipse 34% 58% at var(--spot-x, 40%) 30%, var(--wall-lit) 0%, rgba(241, 240, 236, 0.5) 50%, rgba(241, 240, 236, 0) 100%),
      linear-gradient(to bottom, var(--wall-shade) 0, var(--wall) 14cqh);
    opacity: 0.35;
  }
  .wall.is-lit::before { opacity: 1; }

  .wall::after,
  .wall--entrance::after {
    height: 10cqh;
    background:
      radial-gradient(ellipse 30% 100% at var(--spot-x, 40%) 0%, var(--floor-lit), rgba(162, 158, 150, 0) 100%),
      linear-gradient(var(--skirting) 0 5px, var(--floor) 5px);
  }

  .wall--entrance {
    padding: 0 var(--pad) 10cqh;
    min-width: 0;
    width: clamp(380px, 40cqw, 640px);
    justify-content: flex-start;
    scroll-snap-align: start;
    --spot-x: 45%;
  }
  .gallery > .wall:last-child { scroll-snap-align: end; }

  .wall--text { min-width: 0; width: clamp(380px, 42cqw, 640px); justify-content: flex-start; --spot-x: 45%; }

  .wall--entrance > div,
  .wall--text > div {
    max-height: 86cqh;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .hang { margin: 0; max-width: none; flex: 0 0 auto; }

  /* hero: as large as the wall allows, ratio kept, whole work shown */
  .piece--hero {
    --h: min(52cqh, calc(var(--aw) / var(--r)));
    width: calc(var(--h) * var(--r));
  }
  .piece--hero .frame { height: var(--h); aspect-ratio: auto; }

  .prints {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 4cqh;
  }
  .prints .piece {
    --h: min(13cqh, calc((var(--aw) - var(--gaps, 0px)) / var(--sum, 1)));
    flex: 0 0 auto;
    width: calc(var(--h) * var(--r));
  }
  .prints .frame,
  .salon-row .frame { height: var(--h); aspect-ratio: auto; }

  .piece .tape--img {
    position: absolute;
    left: 0;
    top: 100%;
    width: max-content;
    max-width: 260px;
    margin-top: 10px;
  }

  .salon-row {
    display: flex;
    align-items: flex-end;
    gap: 24px;
  }
  .salon-row + .salon-row { margin-top: 3.5cqh; }
  .salon-row .piece {
    --h: min(var(--rowmax, 26cqh), calc((var(--aw) - var(--gaps, 0px)) / var(--sum, 1)));
    flex: 0 0 auto;
    width: calc(var(--h) * var(--r));
  }
  .salon-row figcaption {
    height: 2.7em;
    overflow: hidden;
  }
  /* earlier paintings: title plus the facts line, never cut off */
  .wall--salon .salon-row figcaption {
    height: auto;
    min-height: 4.05em;
  }

  .wall--salon { --aw: calc(100cqw - 2 * var(--pad)); --rowmax: 29cqh; --spot-x: 50%; }
  .wall--series { --rowmax: 27cqh; }

  .label {
    flex: 0 0 var(--lw);
    width: var(--lw);
    max-height: 80cqh;
    overflow-y: auto;
    margin: 6cqh 0 0;
    font-size: 14px;
    scrollbar-width: thin;
  }

  .wall-text { font-size: clamp(18px, 1.5cqw, 22px); }
  .vinyl-name { font-size: clamp(60px, min(8cqw, 17cqh), 140px); }
  .wall--entrance .vinyl-sub { margin-top: 18px; font-size: 20px; }
  .wall-quote, .wall--entrance .wall-quote { margin-top: 4cqh; }
  .wall-quote p, .wall--entrance .wall-quote p { font-size: clamp(17px, 2.6cqh, 22px); }

  .walk-hint {
    display: block;
    margin: 4cqh 0 0;
    font-size: 14px;
    color: var(--ink-soft);
  }
  .walk-hint kbd {
    display: inline-block;
    min-width: 1.8em;
    padding: 1px 6px;
    border: 1px solid var(--ink-soft);
    font: 600 13px var(--sans);
    text-align: center;
  }

  /* bottom bar: previous / plan / next */
  .walk-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px var(--gut);
    border-top: 1px solid var(--rule);
    background: var(--wall);
  }

  .step {
    flex: 0 0 auto;
    padding: 8px 14px;
    border: 2px solid var(--ink);
    background: var(--label);
    color: var(--ink);
    font: 600 14px var(--sans);
    cursor: pointer;
  }
  .step:disabled { opacity: 0.45; cursor: default; }
  .step:not(:disabled):hover { background: #fff; }

  .plan {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .plan button {
    display: block;
    width: 22px;
    height: 12px;
    padding: 0;
    border: 2px solid var(--ink-soft);
    background: transparent;
    cursor: pointer;
  }
  .plan button.is-wide { width: 34px; }
  .plan button[aria-current="true"] { background: var(--ink); border-color: var(--ink); }

  .where {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 14px;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .where b { color: var(--ink); }

  .site-foot { padding: 10px var(--gut) 12px; font-size: 12.5px; }
}

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