/* Fonts are served from this site (SIL Open Font License, see /fonts/). */
@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("/fonts/newsreader-300.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/fonts/newsreader-italic-400.woff2") format("woff2");
}
@font-face {
  font-family: "Familjen Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/familjen-grotesk.woff2") format("woff2");
}

:root {
  --primer: #F2A679;   /* the apricot ground of a primed canvas */
  --wall: #ECEEEA;     /* gallery wall */
  --paper: #FBFBF8;
  --ink: #12312B;      /* foliage shadow */
  --rain: #25364A;     /* the avenue at dusk */

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
}

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

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

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

img, video { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }

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

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem;
}
.skip:focus { top: 1rem; }

.text-button {
  font: inherit; color: inherit; background: none; border: 0;
  padding: 0.6rem 0; min-height: 2.75rem;
  text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px;
  cursor: pointer;
}

.pill {
  font: inherit; font-size: 0.9375rem; color: var(--ink);
  background: transparent; border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: 999px; padding: 0.4rem 1rem; min-height: 2.75rem; cursor: pointer;
}
.pill:hover { border-color: var(--ink); }
.pill:disabled, .pill.is-off { opacity: 0.4; cursor: default; pointer-events: none; }
a.pill, span.pill { display: inline-flex; align-items: center; text-decoration: none; }

.button {
  display: inline-flex; align-items: center; min-height: 3rem;
  padding: 0.5rem 1.5rem; border-radius: 999px;
  background: var(--ink); color: var(--paper); text-decoration: none;
}
.button:hover { background: #0B211D; }
.button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 999px; }

/* Moving between the wall and a piece: browsers that can animate between pages
   grow the picture from one page into its place on the next (see main.js). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* ---------- Hero: the primed canvas ---------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0 var(--gutter);
  background: var(--primer);
  overflow: hidden;
}

.masthead {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0 1.5rem; flex-wrap: wrap;
  padding: 0.75rem 0;
}
.masthead-name { font-weight: 600; text-decoration: none; }
.masthead a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.masthead nav { display: flex; gap: clamp(0.9rem, 3vw, 2.25rem); }
.masthead nav a { text-decoration: none; }
.masthead nav a:hover { text-decoration: underline; }
.bar { padding: 0.75rem var(--gutter); }   /* the top bar on pages without the painted hero */

/* The stage is the paintable area: full width, from under the top bar to the
   bottom of the hero. Sideways swipes paint; vertical ones still scroll. */
.hero-stage {
  position: relative; isolation: isolate;
  display: grid; grid-template-rows: 1fr auto;
  margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter);
  touch-action: pan-y;
}

/* Behind the words until the painting is ready; then on top of them, because
   the paint carries its own white copy of the words (see main.js). */
.hero-canvas {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  pointer-events: none;
}
.hero-stage.is-revealing .hero-canvas { z-index: 1; }

/* Dragging here paints, so it should not select the headline. */
.hero-body { align-self: end; padding: 2rem 0 0.25rem; -webkit-user-select: none; user-select: none; }

.hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.75rem, calc(0.6rem + (100vw - 2 * var(--gutter)) / 14.6), 8rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero-sub { margin-top: clamp(1rem, 2.4vw, 1.75rem); font-size: 1.1875rem; }

.hero-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.75rem 0; min-height: 4.5rem;
  font-size: 0.9375rem;
}
.hero-clear {
  position: relative; z-index: 2; flex: none; margin-left: auto;
  background: var(--paper); border-color: var(--paper);
}
.hero-clear:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; box-shadow: 0 0 0 2px var(--ink); }
.hero-clear.is-idle { visibility: hidden; } /* keeps its space, so the hint never reflows */

/* ---------- Works: the gallery wall ---------- */

.works { padding: clamp(4rem, 10vw, 9rem) var(--gutter) clamp(3rem, 8vw, 7rem); }

.works-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 1rem 2rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.25rem, 1.5rem + 2.6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filters button:focus-visible { outline-color: var(--ink); }
.filters .count { opacity: 0.75; font-variant-numeric: tabular-nums; }

.wall { columns: 3; column-gap: clamp(1.5rem, 4vw, 4rem); }
@media (max-width: 62rem) { .wall { columns: 2; } }
@media (max-width: 36rem) { .wall { columns: 1; } }

.piece { break-inside: avoid; margin-bottom: clamp(2rem, 5vw, 4.5rem); }
.piece[hidden] { display: none; }

.piece-open { display: block; text-decoration: none; }
.piece-open img {
  width: 100%; height: auto;
  box-shadow: 0 1px 0 rgba(18, 49, 43, 0.1), 0 22px 34px -24px rgba(18, 49, 43, 0.6);
}

.label { display: block; margin-top: 1rem; }
.label-title { display: block; font-family: var(--serif); font-style: italic; font-size: 1.3125rem; line-height: 1.25; }
.label-medium { display: block; font-size: 0.9375rem; opacity: 0.75; }

.works-note { max-width: 34em; margin-top: clamp(2.5rem, 5vw, 4.5rem); }

/* ---------- Studio films ---------- */

.studio {
  background: var(--ink); color: var(--paper);
  padding: clamp(4rem, 9vw, 8rem) var(--gutter);
}
.studio-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 0.75rem 2rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}
.studio-head p { max-width: 24em; opacity: 0.8; text-wrap: balance; }

.clips {
  display: grid; grid-template-columns: repeat(3, minmax(0, 21rem));
  justify-content: space-between;
  gap: clamp(1rem, 3vw, 3rem);
}
.clip-frame { position: relative; background: #000; }
.clip video { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.clip-controls { position: absolute; left: 0.75rem; bottom: 0.75rem; display: flex; gap: 0.5rem; }
.clip-controls[hidden] { display: none; }
.clip-controls button {
  font: inherit; font-size: 0.875rem; color: var(--ink);
  background: var(--paper); border: 0; border-radius: 999px;
  padding: 0.4rem 0.9rem; min-height: 2.75rem; cursor: pointer;
}
.clip-controls button:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; box-shadow: 0 0 0 2px var(--ink); }
.clip .label-title { margin-top: 1rem; }

@media (max-width: 44rem) {
  .clips {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 1rem;
  }
  .clip { flex: 0 0 78%; scroll-snap-align: center; }
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem clamp(2rem, 6vw, 6rem);
  align-items: start;
  padding: clamp(4rem, 9vw, 8rem) var(--gutter);
  background: var(--paper);
}
.about-text > * + * { margin-top: 1.25rem; }
.about-text p { max-width: 36em; }
.about-text .lead {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem);
  line-height: 1.3; max-width: 22em;
}

@media (max-width: 52rem) { .about { grid-template-columns: 1fr; } }

/* ---------- Contact: the avenue at dusk ---------- */

.contact {
  background: var(--rain); color: var(--paper);
  padding: clamp(4rem, 10vw, 9rem) var(--gutter) 1.5rem;
}
.contact h2 { max-width: 16em; text-wrap: balance; }
.contact-link {
  display: inline-block; margin-top: 2rem; padding: 0.4rem 0;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.5rem, 1rem + 1.8vw, 2.5rem);
  color: var(--primer);
}
.colophon {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.25rem 2rem;
  margin-top: clamp(4rem, 9vw, 8rem); font-size: 0.875rem;
}
.colophon p { opacity: 0.75; }
.colophon nav { display: flex; gap: 1.5rem; }
.colophon nav a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* ---------- Piece pages: one work on the wall, with its label ---------- */

.turn {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0 var(--gutter); font-size: 0.9375rem;
}
.turn p { opacity: 0.75; font-variant-numeric: tabular-nums; }
.turn-links { display: flex; gap: 0.5rem; }

/* The picture is as large as the screen allows without scrolling (--ratio is
   its width divided by its height); the label hangs at its foot, as in a gallery. */
.hang {
  --fit: max(20rem, calc(100vh - 12rem));
  display: grid;
  grid-template-columns: minmax(0, calc(var(--fit) * var(--ratio))) minmax(20rem, 1fr);
  align-items: end;
  gap: 1.5rem clamp(1.5rem, 4vw, 4rem);
  padding: clamp(0.75rem, 2vw, 1.5rem) var(--gutter) clamp(3.5rem, 8vw, 7rem);
}
@supports (height: 100svh) {
  .hang { --fit: max(20rem, calc(100svh - 12rem)); }
}

.hang-art img {
  width: 100%; height: auto;
  background-size: cover; background-position: center;   /* the small copy, until the large one arrives */
  box-shadow: 0 1px 0 rgba(18, 49, 43, 0.1), 0 30px 44px -30px rgba(18, 49, 43, 0.6);
  view-transition-name: piece;
}

.hang-label { max-width: 24rem; }
.hang-label h1 {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(2rem, 1.3rem + 1.9vw, 3.25rem);
  line-height: 1.06; letter-spacing: -0.01em; text-wrap: balance;
}
.facts { margin-top: 0.75rem; }
.hang-words {
  margin-top: 1.5rem;
  font-family: var(--serif); font-weight: 300; font-size: 1.25rem; line-height: 1.4;
}
.hang-words p + p { margin-top: 0.75em; }
.hang-audio { margin-top: 1.5rem; }
.hang-audio figcaption { margin-bottom: 0.5rem; font-size: 0.9375rem; }
.hang-audio audio { display: block; width: 100%; }
.hang-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-top: 1.75rem; }

@media (max-width: 60rem) {
  .hang { grid-template-columns: minmax(0, 1fr); }
  .hang-art { max-width: calc(var(--fit) * var(--ratio)); }
}

/* Close-ups, and the films of this piece: heading on the left, three columns on the right. */
.closer, .studio-piece {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  align-items: start;
  gap: 2rem clamp(1.5rem, 4vw, 4rem);
}
.closer { background: var(--paper); padding: clamp(4rem, 9vw, 8rem) var(--gutter); }
.closer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2.5rem); }
.closer-grid img { width: 100%; height: auto; }

.studio-piece .studio-head { display: block; margin-bottom: 0; }
.studio-piece .studio-head p { margin-top: 0.75rem; }
.studio-piece .clips { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2.5rem); }

@media (max-width: 62rem) {
  .closer, .studio-piece { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 44rem) {
  .closer-grid { grid-template-columns: minmax(0, 1fr); }   /* on a phone each close-up gets the full width */
}

.neighbours {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem;
  padding: clamp(3rem, 7vw, 6rem) var(--gutter);
}
.neighbour { display: flex; align-items: center; gap: 1.25rem; text-decoration: none; }
.neighbour img {
  flex: none; width: clamp(5rem, 10vw, 8rem); height: auto;
  box-shadow: 0 14px 22px -16px rgba(18, 49, 43, 0.6);
}
.neighbour-way { display: block; font-size: 0.9375rem; opacity: 0.75; }
.neighbour:hover .label-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.neighbour-next { grid-column: 2; flex-direction: row-reverse; text-align: right; }

@media (max-width: 36rem) {
  .neighbours { grid-template-columns: minmax(0, 1fr); }
  .neighbour-next { grid-column: 1; }
}

.contact-brief { padding-top: 1.5rem; }
.contact-brief .colophon { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
