/* ============================================================
   v3/gallery.css — the room, the collection and the photographs.

   Rewritten 2026-09-07. The previous version drove a scroll-scrubbed
   <video> through `currentTime`, which forces the decoder to seek on
   every scroll frame and stutters on anything but a fast desktop.
   Nothing here scrubs: the reel plays, and the collection is ordinary
   scrolling with IntersectionObserver reveals.
   ============================================================ */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/cormorant-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122, U+2212;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/cormorant-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122, U+2212;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/hanken-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122, U+2212;
}

:root {
  --ink: #17140e;
  --ink-soft: #4a4335;
  --ink-faint: #8a8171;
  --paper: #f7f3ea;
  --paper-warm: #efe8da;
  --gold: #b3903f;
  --gold-pale: #e3d3a8;
  --line: rgba(23, 20, 14, 0.12);

  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --ui: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
video {
  display: block;
  max-width: 100%;
}

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

/* ============================================================
   shared primitives (atelier.css builds on these)
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--gold);
  color: var(--ink);
}
.btn-ghost {
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}
/* on a dark ground (the reel, a lightbox) */
.on-dark .btn-primary {
  background: var(--paper);
  color: var(--ink);
}
.on-dark .btn-primary:hover {
  background: var(--gold);
}
.on-dark .btn-ghost {
  border-color: rgba(247, 243, 234, 0.4);
  color: rgba(247, 243, 234, 0.92);
}
.on-dark .btn-ghost:hover {
  border-color: var(--paper);
  color: var(--paper);
}

.section {
  padding: clamp(84px, 11vw, 150px) clamp(20px, 5vw, 76px);
}
.section-inner {
  max-width: 940px;
  margin: 0 auto;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.section h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}
.section h2 em {
  font-style: italic;
  color: var(--gold);
}
.section p.lede {
  font-family: var(--display);
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-bottom: 30px;
}
.section-closing {
  background: var(--paper-warm);
  text-align: center;
}
.section-closing .section-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  justify-content: space-between;
  padding: 34px clamp(20px, 5vw, 76px);
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.site-foot a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.site-foot a:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* reveal-on-scroll, used by collection.js and photos.js.
   The class is only ever added, so nothing depends on rAF. */
.reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ============================================================
   the reel — a hero that PLAYS. No seeking, no scroll hijack.
   ============================================================ */

.reel {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #14110b;
  color: var(--paper);
}

.reel-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.reel-media video,
.reel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* the poster sits under the video until the first frame is decoded */
  position: absolute;
  inset: 0;
}
.reel-media video {
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.reel-media video.ready {
  opacity: 1;
}

/* legibility scrim — bottom-weighted so the room stays visible up top */
.reel-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(12, 10, 6, 0.86) 0%, rgba(12, 10, 6, 0.5) 34%,
      rgba(12, 10, 6, 0.12) 62%, rgba(12, 10, 6, 0.34) 100%),
    radial-gradient(120% 90% at 50% 55%, transparent 40%, rgba(12, 10, 6, 0.42) 100%);
}

.reel-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 76px) clamp(60px, 9vh, 104px);
}

.reel-kicker {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-pale);
  margin-bottom: 22px;
}
.reel-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(46px, 9vw, 122px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  text-wrap: balance;
}
.reel-title em {
  font-style: italic;
  color: var(--gold-pale);
}
.reel-sub {
  font-family: var(--display);
  font-size: clamp(18px, 2.1vw, 25px);
  line-height: 1.5;
  color: rgba(247, 243, 234, 0.88);
  max-width: 46ch;
  margin-bottom: 32px;
}
.reel-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}
.reel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.58);
}
.reel-meta span {
  position: relative;
  padding-left: 16px;
}
.reel-meta span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 1px;
  background: var(--gold);
}

/* transport — small, out of the way, keyboard reachable */
.reel-transport {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 4vw, 40px);
  bottom: clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  gap: 8px;
}
.reel-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(247, 243, 234, 0.32);
  background: rgba(12, 10, 6, 0.4);
  color: var(--paper);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.reel-btn:hover {
  border-color: var(--paper);
  background: rgba(12, 10, 6, 0.66);
}
.reel-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.reel-btn .ico-pause,
.reel-btn.paused .ico-play {
  display: block;
}
.reel-btn .ico-play,
.reel-btn.paused .ico-pause {
  display: none;
}

/* a hairline that shows how far through the reel is */
.reel-line {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(247, 243, 234, 0.16);
}
.reel-line-bar {
  height: 100%;
  width: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.reel-cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: clamp(16px, 4vw, 40px);
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.6);
  transition: opacity 0.4s var(--ease);
}

@media (max-width: 720px) {
  .reel-transport {
    bottom: auto;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
  }
  .reel-cue {
    display: none;
  }
}

/* ============================================================
   the collection — one section per piece, image + card
   ============================================================ */

.collection {
  padding: clamp(80px, 10vw, 130px) 0 clamp(40px, 6vw, 80px);
}
/* Shares the pieces' max-width and gutter so the heading's left edge sits
   on the same line as the first photograph's. */
.collection-head {
  max-width: 1480px;
  margin: 0 auto clamp(48px, 7vw, 92px);
  padding: 0 clamp(20px, 5vw, 76px);
}
.collection-head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}
.collection-head h2 em {
  font-style: italic;
  color: var(--gold);
}
.collection-head p {
  font-family: var(--display);
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 56ch;
}

.piece {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  max-width: 1480px;
  margin: 0 auto clamp(70px, 9vw, 130px);
  padding: 0 clamp(20px, 5vw, 76px);
}
.piece:nth-child(even) .piece-shot {
  order: 2;
}
.piece:nth-child(even) .piece-card {
  order: 1;
}

.piece-shot {
  position: relative;
  overflow: hidden;
  background: var(--paper-warm);
  aspect-ratio: 16 / 9;
}
.piece-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 1.2s var(--ease);
}
.piece.in .piece-shot img {
  transform: scale(1);
}
.piece-index {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  padding: 10px 14px;
  background: rgba(12, 10, 6, 0.62);
  color: var(--gold-pale);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.piece-card {
  max-width: 44ch;
}
.piece-room {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.piece-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}
.piece-tagline {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.piece-spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 14px 20px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.piece-spec dt {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.piece-spec dd {
  font-size: 14px;
  color: var(--ink);
}
.piece-price {
  font-family: var(--display);
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
  margin-bottom: 22px;
}
.piece-price small {
  display: block;
  margin-top: 6px;
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.piece-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 900px) {
  .piece {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .piece:nth-child(even) .piece-shot {
    order: 0;
  }
  .piece:nth-child(even) .piece-card {
    order: 0;
  }
  .piece-card {
    max-width: none;
  }
}

/* ============================================================
   the photographs — from the client's Drive folder
   ============================================================ */

.photos {
  background: var(--paper-warm);
  padding: clamp(80px, 10vw, 130px) clamp(20px, 5vw, 76px);
}
.photos-inner {
  max-width: 1480px;
  margin: 0 auto;
}
.photos-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: clamp(30px, 5vw, 54px);
}
.photos-head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.photos-head h2 em {
  font-style: italic;
  color: var(--gold);
}
.photos-head p {
  font-family: var(--display);
  font-size: clamp(17px, 2vw, 21px);
  color: var(--ink-soft);
  max-width: 48ch;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.photo-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(23, 20, 14, 0.07);
  border: 0;
  padding: 0;
  cursor: zoom-in;
}
.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), opacity 0.5s var(--ease);
  opacity: 0;
}
.photo-cell img.loaded {
  opacity: 1;
}
.photo-cell:hover img {
  transform: scale(1.05);
}
.photo-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 10, 6, 0.3), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.photo-cell:hover::after {
  opacity: 1;
}
/* the first cell earns more room on wide screens */
.photo-grid .photo-cell:first-child {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}
@media (max-width: 620px) {
  .photo-grid .photo-cell:first-child {
    grid-column: span 1;
    grid-row: span 1;
    aspect-ratio: 1 / 1;
  }
}

.photos-note {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}
.photos-status {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* skeleton while the folder is being read */
.photo-cell.skeleton {
  cursor: default;
  background: linear-gradient(100deg, rgba(23, 20, 14, 0.05) 30%,
    rgba(23, 20, 14, 0.11) 50%, rgba(23, 20, 14, 0.05) 70%);
  background-size: 300% 100%;
  animation: photo-shimmer 1.5s linear infinite;
}
@keyframes photo-shimmer {
  to {
    background-position: -300% 0;
  }
}

/* ---------------- lightbox ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(10, 8, 5, 0.94);
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}
.lightbox.open {
  opacity: 1;
}
.lightbox img {
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
}
.lightbox-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(14px, 3vw, 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(247, 243, 234, 0.7);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.lightbox-nav,
.lightbox-x {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(247, 243, 234, 0.3);
  background: transparent;
  color: var(--paper);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.lightbox-nav:hover,
.lightbox-x:hover {
  border-color: var(--paper);
  background: rgba(247, 243, 234, 0.1);
}
.lightbox-x {
  position: absolute;
  top: clamp(14px, 3vw, 30px);
  right: clamp(14px, 3vw, 30px);
}

/* ============================================================
   reduced motion — the reel stops moving, reveals stop sliding
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .piece-shot img {
    transform: none;
    transition: none;
  }
  .photo-cell img,
  .photo-cell::after {
    transition: none;
  }
  .photo-cell.skeleton {
    animation: none;
  }
}

/* ============================================================
   the header

   atelier.css declares .site-head sticky, which was right when the page
   opened on a paper-coloured landing. The reel is dark and full-bleed,
   so a sticky bar would both eat a strip above it and sit unreadable on
   top of it. Fixed + tucked while the reel is on screen; reel.js takes
   the class off on the way past.
   ============================================================ */
.site-head {
  transition: transform 0.4s var(--ease);
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
}
.site-head.tucked {
  transform: translateY(-101%);
}
