/* ============================================================
   LAYOUT - chapters, sticky stages, editorial plates, interface.
   The visitor is the camera; these are the sets.
   ============================================================ */

/* --- Chapters --- */
.chapter {
  position: relative;
  background: var(--canvas);
  color: var(--ink);
  transition: background var(--dur-breath) var(--drift);
}

/* --- Sticky stage: a scene the camera moves through ---
   .stage sets the scroll length; .stage__pin is the viewport-locked
   frame the layers perform inside. */
.stage {
  position: relative;
  height: var(--stage, 300vh);
}
.stage__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: clip;
  display: grid;
}
.stage__pin > * {
  grid-area: 1 / 1;
}

/* --- Layers (foreground / midground / background depth) --- */
.layer {
  position: relative;
  will-change: transform, opacity, filter;
}
.layer--media {
  z-index: 1;
}
.layer--atmos {
  z-index: 2;
  pointer-events: none;
}
.layer--type {
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-inline: var(--margin-safe);
}

/* --- Media: every image is a graded architectural window ---
   (no overflow clip here: caption cards intentionally break the frame;
   sticky stages clip at .stage__pin instead) --- */
.media {
  position: relative;
  background: var(--canvas);
}
.media img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* One filmic grade unifies mixed photography into a single shoot */
  filter: saturate(0.8) sepia(0.08) contrast(0.97) brightness(1.02);
}
.media__video {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(0.8) sepia(0.08) contrast(0.97) brightness(1.02);
  transition: opacity 1.45s var(--drift);
  pointer-events: none;
}
.media.is-video-playing .media__video {
  opacity: 1;
}
/* Navy-champagne wash - the color of the hour, applied over every frame */
.media::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(20, 33, 46, 0.16), rgba(217, 199, 167, 0.1) 62%, rgba(20, 33, 46, 0.2));
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.media--full {
  position: absolute;
  inset: 0;
}
.media--full img {
  position: absolute;
  inset: 0;
}

/* Gallery caption card - overlaps the frame edge like a monograph plate */
.fig {
  position: relative;
}
.fig img,
.fig .media__video,
.fig::after {
  -webkit-mask-image: var(--fig-mask);
  mask-image: var(--fig-mask);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.fig figcaption {
  position: absolute;
  z-index: 4;
  bottom: clamp(1rem, 4vh, 2.5rem);
  left: calc(-1 * clamp(0.75rem, 3vw, 2rem));
  background: var(--ivory);
  color: var(--driftwood);
  padding: 0.625rem 1.25rem;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: var(--type-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  box-shadow: 0 24px 60px rgba(20, 33, 46, 0.08);
}
.fig--caption-right figcaption {
  left: auto;
  right: calc(-1 * clamp(0.75rem, 3vw, 2rem));
}

/* --- Editorial plate: the asymmetric 12-column composition --- */
.plate {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  align-items: center;
  padding-block: var(--beat);
  padding-inline: var(--margin-safe);
}
.plate > * {
  min-width: 0;
}

/* A viewport of near-silence - pacing is a layout property */
.rest {
  min-height: 55svh;
  display: grid;
  place-items: center;
  padding-inline: var(--margin-safe);
}
.rest--deep {
  min-height: 85svh;
}

/* Ghost numeral drifting behind a chapter's content */
.ghost-numeral {
  position: absolute;
  z-index: 0;
  top: 0;
  right: -0.08em;
  pointer-events: none;
}

/* --- Interface: wordmark + inquiry link --- */
.site-head {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(1.25rem, 3vh, 2rem) var(--margin-safe);
  pointer-events: none;
  transition: color var(--dur-breath) var(--drift);
}
.site-head a {
  pointer-events: auto;
  color: var(--navy);
  padding: 0.45rem 0.7rem;
  background: rgba(251, 249, 244, 0.22);
  border: 1px solid rgba(251, 249, 244, 0.16);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  backdrop-filter: blur(14px) saturate(1.08);
  box-shadow: 0 10px 34px rgba(20, 33, 46, 0.08);
  text-shadow: 0 1px 18px rgba(251, 249, 244, 0.62);
  transition:
    background var(--dur-whisper) var(--drift),
    border-color var(--dur-whisper) var(--drift),
    color var(--dur-breath) var(--drift);
}
.site-head > .t-label {
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  letter-spacing: 0.18em;
  color: var(--navy);
  padding-bottom: 0.25rem;
  border-bottom: 1px solid currentColor;
}
/* The interface adapts to the scene's light */
.is-dusk-scene .site-head a {
  color: var(--ivory);
  background: rgba(16, 28, 40, 0.34);
  border-color: rgba(243, 239, 230, 0.16);
  text-shadow: 0 1px 18px rgba(11, 21, 32, 0.6);
}

/* --- Footer coda --- */
.coda {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, max-content) minmax(0, max-content);
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: start;
  padding: 3rem var(--margin-safe) 3.5rem;
  border-top: 1px solid var(--hairline);
}
.coda__brand {
  display: grid;
  gap: 0.95rem;
  justify-items: start;
  text-align: left;
}
.coda > .t-label,
.coda__location {
  padding-top: 0.48rem;
}
.coda__location {
  display: grid;
  gap: 0.8rem;
  justify-items: start;
  text-align: left;
}
.legal-links {
  display: grid;
  gap: 0.55rem;
  justify-items: start;
}
.legal-links a {
  color: var(--ink-faint);
}
.legal-links a:hover,
.legal-links a:focus-visible {
  color: var(--ink);
}
.social-links {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}
.social-links a {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  color: var(--ink-faint);
  border: 1px solid var(--hairline);
  border-radius: 50%;
  transition:
    border-color var(--dur-whisper) var(--glide),
    color var(--dur-whisper) var(--glide),
    background var(--dur-whisper) var(--glide);
}
.social-links a:hover,
.social-links a:focus-visible {
  color: var(--ink);
  border-color: var(--gold-hour);
  background: rgba(217, 199, 167, 0.1);
}
.social-links svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* --- Responsive reflow: mobile keeps the cinema, loses the columns --- */
@media (max-width: 760px) {
  .site-head {
    gap: 0.5rem;
    padding: clamp(0.8rem, 2vh, 1.15rem) 0.75rem;
  }
  .site-head .wordmark {
    max-width: 58vw;
    overflow: hidden;
    font-size: clamp(0.78rem, 3.2vw, 1rem);
    letter-spacing: 0.12em;
    white-space: nowrap;
  }
  .site-head > .t-label {
    flex: 0 0 auto;
    font-size: clamp(0.72rem, 3vw, 0.86rem);
    letter-spacing: 0.16em;
  }
  .plate {
    grid-template-columns: repeat(6, 1fr);
    row-gap: 3rem;
  }
  .fig figcaption {
    left: 0.75rem;
  }
  .fig--caption-right figcaption {
    right: 0.75rem;
  }
  .coda {
    grid-template-columns: 1fr;
    justify-items: start;
    text-align: left;
  }
  .coda .wordmark {
    white-space: normal;
  }
  .coda > .t-label,
  .coda__location {
    padding-top: 0;
  }
}
