/* Meltem Photography — V9 “The passing archive”
   One quiet promise. One brief, reversible rush of memory. */

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-semibold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --v9-font: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --v9-paper: #f4f0e8;
  --v9-sheet: #fbfaf6;
  --v9-ink: #171714;
  --v9-line: rgba(23, 23, 20, .2);
  --v9-ease: cubic-bezier(.2, .72, .18, 1);
}

body,
button,
input,
textarea,
select {
  font-family: var(--v9-font);
}

body {
  font-weight: 400;
  font-synthesis: none;
}

.wordmark {
  font-weight: 600;
  letter-spacing: .066em;
}

.wordmark span:last-child {
  font-weight: 400;
}

.site-header nav,
.eyebrow,
.section-number,
.stage-caption span,
.stage-control,
.hero-primary,
.nav-cta,
.cinema-control,
.reel-controls button,
.footer-kicker,
.footer-cta {
  font-weight: 600;
}

:is(
  .hero-copy h1,
  .thesis h2,
  .cinema-intro h2,
  .look-header h2,
  .discoveries-header h2,
  .method--compact h2,
  .contact h2,
  .footer-finale h2,
  .moment-dialog__copy h2,
  .moment-dialog__copy h3
) {
  font-weight: 400;
  letter-spacing: -.047em;
}

.footer-finale h2 {
  letter-spacing: -.052em;
}

/* The placeholder leaf mark is intentionally retired. The real vector
   signature will be drawn as its own identity asset in the next pass. */
.signature-cue {
  display: none !important;
}

/* ------------------------------------------------------------------
   Hero — two calm photographs, then a deterministic archive burst.
   ------------------------------------------------------------------ */

.hero.hero--archive {
  --archive-presence: 0;
  --archive-release: 0;
  --hero-copy-opacity: 1;
  position: relative;
  height: 158svh;
  padding: 0;
  background: var(--v9-paper);
  isolation: isolate;
}

.archive-stage {
  position: sticky;
  z-index: 2;
  top: 0;
  width: calc(100% - clamp(16px, 2.5vw, 40px));
  height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 78px;
  overflow: hidden;
  background: var(--v9-sheet);
  border: 1px solid var(--v9-line);
}

.archive-stage::after {
  content: "";
  position: absolute;
  z-index: 20;
  inset: 0;
  background: var(--v9-paper);
  opacity: calc(var(--archive-release) * .78);
  pointer-events: none;
}

.archive-stage .stage-media {
  position: relative;
  grid-row: 1;
  min-height: 0;
  aspect-ratio: auto;
  background: #d8d1c5;
}

.hero-rest-frames,
.rest-curtain,
.archive-burst,
.archive-grain,
.archive-release {
  position: absolute;
  inset: 0;
}

.hero-rest-frames {
  z-index: 1;
}

.archive-stage .stage-scene,
.archive-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center center;
  user-select: none;
}

.hero-rest-frame {
  z-index: 1;
  opacity: 0;
  transform: scale(1.002);
  transition: transform 6200ms ease-out;
}

.rest-curtain {
  z-index: 2;
  background: rgba(244, 240, 232, .94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms var(--v9-ease);
}

.archive-stage.is-rest-changing .rest-curtain {
  opacity: 1;
}

.hero-rest-frame.is-current {
  z-index: 2;
  opacity: 1;
  transform: scale(1.018);
}

.archive-burst {
  z-index: 3;
  overflow: hidden;
  background: #d8d1c5;
  opacity: var(--archive-presence);
  pointer-events: none;
}

.archive-frame {
  z-index: 1;
  opacity: 0;
  filter: saturate(.93) contrast(1.025) brightness(1.012);
  transform: scale(1.018);
  transform-origin: center;
  will-change: opacity;
}

.archive-frame.is-current {
  z-index: 2;
  opacity: 1;
}

.archive-frame:nth-child(4) {
  object-position: 50% 34%;
}

.archive-frame:nth-child(5) {
  object-position: 48% 35%;
}

.archive-frame:nth-child(7) {
  object-position: 55% 42%;
}

.archive-frame:nth-child(8) {
  object-position: 51% 55%;
}

.archive-frame:nth-child(12) {
  object-position: 50% 31%;
}

.archive-frame:nth-child(13) {
  object-position: 50% 57%;
}

.archive-grain {
  z-index: 5;
  opacity: calc(var(--archive-presence) * .17);
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  background-size: 190px 190px;
  mix-blend-mode: soft-light;
}

.archive-release {
  z-index: 6;
  background: linear-gradient(90deg, rgba(244, 240, 232, .7), rgba(244, 240, 232, .22) 54%, rgba(244, 240, 232, .72));
  opacity: var(--archive-release);
  pointer-events: none;
}

.archive-stage .stage-tone {
  z-index: 7;
  inset: clamp(104px, 13vh, 148px) auto clamp(34px, 5vh, 62px) clamp(24px, 4.4vw, 76px);
  width: min(660px, 41%);
  border: 1px solid rgba(23, 23, 20, .15);
  background: rgba(248, 245, 238, .925);
  box-shadow: 0 28px 80px rgba(42, 36, 28, .11);
  opacity: var(--hero-copy-opacity);
  -webkit-backdrop-filter: blur(10px) saturate(.86);
  backdrop-filter: blur(10px) saturate(.86);
  transform: translateX(calc((1 - var(--hero-copy-opacity)) * -28px));
  transition: none;
}

.archive-stage .hero-copy {
  z-index: 8;
  top: 50%;
  left: clamp(52px, 7vw, 122px);
  width: min(540px, 32.5%);
  color: var(--v9-ink);
  opacity: var(--hero-copy-opacity);
  transform: translateY(-50%) translateX(calc((1 - var(--hero-copy-opacity)) * -22px));
  transition: none;
}

.archive-stage .hero-copy h1 {
  max-width: 8.6ch;
  margin: .26em 0 .3em;
  font-size: clamp(3.45rem, 5.25vw, 6.55rem);
  line-height: .89;
  text-wrap: balance;
}

.archive-stage .hero-copy > p:not(.eyebrow) {
  max-width: 39ch;
  margin-bottom: 1.5em;
  color: rgba(23, 23, 20, .83);
  font-size: clamp(.92rem, .84rem + .25vw, 1.12rem);
  line-height: 1.48;
  text-wrap: pretty;
}

.archive-stage.is-archive-active .hero-copy,
.archive-stage.is-archive-active .stage-tone {
  pointer-events: none;
}

.archive-stage .stage-caption {
  position: relative;
  z-index: 9;
  grid-row: 2;
  min-height: 0;
  padding: 14px clamp(18px, 2.35vw, 38px);
  grid-template-columns: minmax(205px, .78fr) minmax(260px, 1fr) auto;
  background: rgba(251, 250, 246, .98);
}

.archive-stage .stage-caption strong {
  font-weight: 500;
}

.archive-stage .stage-control {
  min-width: 150px;
  justify-content: space-between;
  opacity: calc(1 - var(--archive-presence));
  transition: background-color 180ms ease, color 180ms ease;
}

.archive-stage.is-archive-active .stage-control {
  pointer-events: none;
}

.archive-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  overflow: hidden;
  background: rgba(23, 23, 20, .1);
  opacity: var(--archive-presence);
}

.archive-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--v9-ink);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* Let the long hero release naturally. A permanent root snap is useful
   for chapters, but it must not fight a scrubbed opening sequence. */
html.v8-snap .hero.hero--archive {
  scroll-snap-align: none;
  scroll-snap-stop: normal;
}

.hero.hero--archive + .thesis {
  position: relative;
  z-index: 4;
  margin-top: -16svh;
  padding-top: clamp(86px, 10svh, 124px);
  background: var(--v9-paper);
  border-top: 1px solid var(--v9-line);
}

html.v8-snap :is(
  .thesis,
  .cinema-intro,
  .second-look,
  .method,
  .contact,
  .site-footer--garden
) {
  scroll-snap-stop: normal;
}

@media (max-width: 1100px) {
  .archive-stage .stage-tone {
    width: min(560px, 47%);
  }

  .archive-stage .hero-copy {
    width: min(465px, 37%);
  }

  .archive-stage .hero-copy h1 {
    font-size: clamp(3.25rem, 5.8vw, 5.7rem);
  }
}

@media (max-width: 820px) {
  .hero.hero--archive {
    height: 148svh;
  }

  .hero.hero--archive + .thesis {
    margin-top: -10svh;
    padding-top: 88px;
  }

  .archive-stage {
    width: 100%;
    grid-template-rows: auto minmax(0, 1fr) 66px;
    border-inline: 0;
  }

  .archive-stage .hero-copy {
    position: relative;
    z-index: 8;
    top: auto;
    left: auto;
    order: initial;
    grid-row: 1;
    width: auto;
    padding: 82px 18px 22px;
    background: var(--v9-sheet);
    transform: translateY(calc((1 - var(--hero-copy-opacity)) * -12px));
  }

  .archive-stage .hero-copy h1 {
    max-width: 9ch;
    margin: .2em 0 .24em;
    font-size: clamp(3.25rem, 14.6vw, 5.5rem);
    line-height: .87;
  }

  .archive-stage .hero-copy > p:not(.eyebrow) {
    max-width: 35ch;
    margin-bottom: 1.1em;
    font-size: .92rem;
  }

  .archive-stage .stage-media {
    grid-row: 2;
  }

  /* The calm mobile state reads like a cover: copy first, image second.
     As soon as the archive starts, the image plane takes the whole stage
     so the disappearing copy never leaves a dead white band behind. */
  .archive-stage.is-archive-active .stage-media {
    position: absolute;
    z-index: 6;
    grid-row: 1 / 3;
    inset: 0;
  }

  .archive-stage .stage-tone {
    display: none;
  }

  .archive-stage .stage-scene,
  .archive-frame {
    object-position: 69% center;
  }

  .archive-frame--portrait {
    object-position: center 34%;
  }

  .archive-stage .stage-caption {
    grid-row: 3;
    min-height: 66px;
    padding: 9px 14px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
  }

  .archive-stage .stage-caption > p:first-child {
    gap: 12px;
  }

  .archive-stage .stage-caption > p:nth-child(2) {
    display: none;
  }

  .archive-stage .stage-control {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    min-height: 42px;
    padding-inline: 12px;
  }
}

@media (max-width: 580px) {
  .archive-stage .hero-copy {
    padding-top: 74px;
  }

  .archive-stage .hero-copy h1 {
    font-size: clamp(3rem, 14.5vw, 4.25rem);
  }

  .archive-stage .hero-copy > p:not(.eyebrow) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .archive-stage .stage-control {
    font-size: .62rem;
  }

  .archive-stage .stage-control span:first-child {
    max-width: 12ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero.hero--archive {
    height: 100svh;
  }

  .hero.hero--archive + .thesis {
    margin-top: 0;
  }

  .archive-stage {
    position: relative;
  }

  .hero-rest-frame,
  .archive-stage .stage-tone,
  .archive-stage .hero-copy,
  .archive-stage .stage-control {
    transition: none !important;
  }

  .archive-burst,
  .archive-grain,
  .archive-release,
  .archive-progress,
  .archive-stage .stage-control {
    display: none !important;
  }

  .hero-rest-frame:not(:first-child) {
    display: none;
  }
}

@media print {
  .hero.hero--archive {
    height: auto;
  }

  .archive-stage {
    position: relative;
    height: auto;
    min-height: 760px;
  }

  .archive-burst,
  .archive-grain,
  .archive-release,
  .archive-progress,
  .archive-stage .stage-control {
    display: none !important;
  }
}
