/* =========================================================
   PLACEHOLDER STYLE LAYER
   Tasteful neutral defaults. Designed to be replaced wholesale
   when the Figma direction lands. All tunable values live as
   CSS variables in :root.
   ========================================================= */

:root {
  /* palette — black ground, warm cream ink */
  --bg:        #000000;
  --bg-deep:   #0a0907;
  --ink:       #f3ede2;
  --ink-soft:  #8c8278;
  --line:      #2a2520;
  --accent:    #f3ede2;

  /* type */
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;

  /* rhythm */
  --gap:    clamp(96px, 14vw, 220px);
  --pad:    clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow-x: hidden;
}

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

/* ===== HERO ============================================== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  width: 100%;
  overflow: hidden;
  background: #0a0907;
}

.hero__loop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* subtle film bleed */
  filter: saturate(0.92) contrast(1.02);
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.45) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}

.hero__content {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  align-items: center;
  padding: clamp(28px, 6vh, 64px) var(--pad);
  color: #f3ede2;
  text-align: center;
}

/* wordmark sits in the auto-sized middle row — true vertical center */
.hero__content .wordmark { grid-row: 2; }
/* play button rides in the lower half, snug under the wordmark */
.hero__content .play { grid-row: 3; align-self: start; margin-top: clamp(28px, 5vh, 56px); }

/* ----- Wordmark -----
   The SVG has an embedded raster mask, so CSS fill won't reach it.
   We invert it to white via `filter` instead. A soft shadow keeps it
   legible over varied frames of the loop.
*/
.wordmark {
  margin: 0;
  padding: 0;
  user-select: none;
  pointer-events: none;
  display: flex;
  justify-content: center;
  width: 100%;
  animation: wordmark-in 1.6s ease 0.2s both;
}
.wordmark img {
  width: clamp(280px, 52vw, 760px);
  height: auto;
  /* PNG is already white-on-transparent — no recolor needed */
}

@keyframes wordmark-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.play {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: #f3ede2;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: opacity .25s ease, transform .25s ease;
  /* matches wordmark entrance */
  animation: wordmark-in 1.6s ease 0.6s both;
}
.play:hover { opacity: 0.85; transform: translateY(-2px); }
.play:focus-visible { outline: 1px solid #f3ede2; outline-offset: 8px; border-radius: 50%; }
.play svg { width: clamp(56px, 6vw, 80px); height: clamp(56px, 6vw, 80px); }
.play__label {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero__hint {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  opacity: 0.6;
  writing-mode: vertical-rl;
  position: absolute;
  right: var(--pad);
  bottom: 8vh;
  color: #f3ede2;
}

/* ===== SCROLL SECTIONS =================================== */
.scroll {
  padding: var(--gap) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
/* the final section sits flush to the bottom — cinema closes the page */
.scroll > .section:last-child { padding-bottom: 0; }

.section {
  width: 100%;
  padding: 0 var(--pad);
  display: flex;
  justify-content: center;
}

/* layouts */
.section--solo { }
.section--pair {
  gap: clamp(24px, 4vw, 80px);
  flex-wrap: wrap;
}
.section--bleed { padding: 0; }
.section--row {
  gap: clamp(14px, 1.5vw, 28px);
  flex-wrap: wrap;
}
.section--captioned { flex-direction: column; align-items: center; }
.section--fragment {
  padding: 0 var(--pad);
}
.section--stacks {
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

/* frames */
.frame {
  position: relative;
  margin: 0;
}
.frame img {
  width: 100%;
  height: auto;
  display: block;
}

.frame--small    { width: min(360px, 55vw); }
.frame--med      { width: min(440px, 38vw); }
.frame--row      { width: min(280px, 30vw); }
.frame--tall     { width: min(420px, 60vw); }
.frame--wide     { width: min(1100px, 80vw); }
.frame--portrait { width: min(360px, 42vw); }
.frame--strip    { width: min(1400px, 90vw); }
.frame--bleed    { width: 100%; }
.frame--offset   { transform: translateY(60px); }

.section--strip { padding: 0 var(--pad); }

/* ===== OVERLAY (photo with scribble in front) =========== */
.section--overlay {
  /* allow the scribble to extend visually past the section padding */
  padding: 0 var(--pad);
  overflow: visible;
}
.overlay {
  position: relative;
  width: min(1100px, 80vw);
}
.overlay__photo {
  width: 100%;
  height: auto;
  display: block;
}
.overlay__scribble {
  position: absolute;
  width: 138%;
  left: 50%;
  top: 8%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
  /* drop shadow on the scribble for the slight glow over the photo */
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
}

.frame figcaption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 18px;
  text-align: center;
  letter-spacing: 0.01em;
}

/* fragments */
.fragment {
  max-width: 640px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.45;
  text-align: center;
  color: var(--ink);
}
.fragment em { color: var(--ink-soft); }

/* ===== PHOTO STACKS ====================================== */
.section--stacks { padding: 0 var(--pad); flex-direction: column; align-items: stretch; gap: 0; }

.stacks {
  display: flex;
  flex-direction: column;
  gap: clamp(80px, 14vh, 180px);
  width: 100%;
}

/* each stack gets its own roughly-placed horizontal position */
.stacks .stack:nth-child(1) { margin-left: clamp(40px, 14vw, 220px); }
.stacks .stack:nth-child(2) { margin-left: clamp(120px, 38vw, 580px); }
.stacks .stack:nth-child(3) { margin-left: clamp(60px, 22vw, 340px); }

.stack {
  position: relative;
  cursor: pointer;
  user-select: none;
  outline: none;
}
.stack--landscape {
  width: min(560px, 64vw);
  aspect-ratio: 1240 / 870;
}
.stack--portrait {
  width: min(380px, 50vw);
  aspect-ratio: 860 / 1230;
}
.stack:focus-visible { outline: 1px dashed var(--ink-soft); outline-offset: 14px; }

.stack__card {
  position: absolute;
  inset: 0;
  will-change: transform;
  transform-origin: 50% 50%;
  transition: transform 0.55s cubic-bezier(.35,0,.25,1);
  /* subtle drop so cards have a faint sense of depth on black */
  box-shadow: 0 14px 28px -16px rgba(0,0,0,0.7);
}
.stack__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== FOOTER ============================================ */
.footer {
  padding: 80px var(--pad) 40px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.footer__mark { font-family: var(--serif); font-style: italic; font-size: 18px; letter-spacing: 0.02em; text-transform: none; }

/* ===== LIGHTBOX ========================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 6, 4, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 60px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__frame {
  position: relative;
  /* fit largest 16:9 frame inside the viewport with breathing room */
  width: min(95vw, calc(90vh * 16 / 9), 1600px);
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
}
.lightbox__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.lightbox__close {
  position: absolute;
  top: clamp(14px, 3vh, 28px);
  right: clamp(14px, 3vw, 28px);
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  color: #f3ede2;
  cursor: pointer;
  padding: 6px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.lightbox__close:hover { opacity: 1; }
.lightbox__close svg { width: 100%; height: 100%; }

/* lock body scroll when open */
body.lightbox-open { overflow: hidden; }

/* ===== FADE-IN ON SCROLL ================================ */
.will-fade {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.1s ease, transform 1.1s ease;
}
.will-fade.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE TWEAKS ================================= */
@media (max-width: 720px) {
  .section--pair .frame--med { width: 80vw; }
  .frame--offset { transform: none; }
  .section--row .frame--row { width: 80vw; }
  .frame--tall { width: 80vw; }
  /* stacks each take the full content width on mobile */
  .stacks .stack { margin-left: 0 !important; }
  .stack--landscape, .stack--portrait { width: 100%; }
  /* scribble pulls in slightly so it doesn't blow past the viewport on phones */
  .overlay__scribble { width: 118%; }
}

@media (prefers-reduced-motion: reduce) {
  .stack__card { transition: opacity 0.2s ease; }
  .stack__card.is-flipped { transform: none; }
  .play:hover { transform: none; }
  .will-fade { opacity: 1; transform: none; transition: none; }
}
