/* ==========================================================================
   Homepage panels, top to bottom: hero slideshow, handwritten note, the
   black parallax panel, the four story tiles, the contact form.
   ========================================================================== */

/* ---------- hero ----------
   Pinned under the page. Everything after it scrolls over it, and a black
   layer on top of the photos darkens to 80% over the first viewport of
   scroll, so the note panel seems to rise out of the dark. lvh, not svh:
   the panel is pinned, so when the phone's toolbar collapses the extra
   height must already be covered by photo, not by a strip of body. */
.hero {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  background: var(--black);
}
.hero__slides { position: absolute; inset: 0; }
.hero__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.6s var(--ease-soft);
  will-change: opacity, transform;
}
.hero__slide.is-on { opacity: 1; z-index: 1; animation: hero-drift 7.6s linear forwards; }
/* the outgoing slide sits on top and fades away over the one already lit
   beneath it, so the dissolve reads the same whichever order they stack */
.hero__slide.is-off { opacity: 0; z-index: 2; }
@keyframes hero-drift {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--black);
  opacity: var(--overlay, 0);
  pointer-events: none;
}
/* two short lines centred on the slideshow, set like the
   parallax panel's headline (same ramp, weight and italic phrase) */
.hero__text {
  position: absolute;
  inset: 0 var(--page-margin) auto;
  /* the hero is 100lvh so the photo covers the strip the phone toolbar
     uncovers, but the headline centres in the small viewport, what is
     actually on screen at load; in lvh it hung low behind the toolbar */
  height: 100vh;
  height: 100svh;
  z-index: 3;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--white);
  pointer-events: none;
}
.hero__title {
  font-family: var(--serif);
  font-weight: var(--serif-weight);
  font-size: calc(var(--fs-h2) * 1.2); /* 72 / 58 / 48 */
  line-height: 1;
  letter-spacing: var(--track-head);
  max-width: 24ch;
  margin: 0;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.3);
}
.hero__title .line { display: block; }
/* ---------- scroll cue ----------
   A hairline chevron near the foot of the screen on phones, bouncing
   gently until the first scroll (js/hero.js sets .is-scrolled on the
   hero), then gone. It sits off 100svh, the height actually on screen at
   load, because the hero itself is 100lvh and its foot hides behind the
   phone toolbar. Desktop never shows it. */
.hero__scroll {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100svh - 64px - env(safe-area-inset-bottom, 0px));
  z-index: 3;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  color: var(--white);
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease-soft);
}
.hero__scroll-arrow {
  display: block;
  animation: hero-bounce 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes hero-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__scroll-arrow { animation: none; }
}
@media (max-width: 734px) {
  .hero__scroll { display: block; }
  .hero.is-ready .hero__scroll { opacity: 0.9; }
  .hero.is-scrolled .hero__scroll { opacity: 0; }
}
@media (max-width: 734px) {
  /* sized to the viewport so each line stays on one line down to 320px */
  .hero__title { font-size: clamp(36px, 11.2vw, 48px); max-width: 16ch; }
  /* slides that only work landscape sit out the phone rotation (js/hero.js
     skips hidden slides) */
  .hero__slide--wide { display: none; }
}

/* where the browser can drive it, the overlay follows scroll off the main
   thread; js/hero.js then leaves --overlay alone */
@supports (animation-timeline: scroll()) {
  .hero::after {
    animation: hero-dim linear both;
    animation-timeline: scroll(root);
    animation-range: 0 100vh;
  }
}
@keyframes hero-dim {
  from { opacity: 0; }
  to   { opacity: 0.8; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__slide { transform: none; transition: opacity 1s ease; }
  .hero__slide.is-on { animation: none; }
}

/* everything after the hero rides over it */
.page { position: relative; z-index: 1; }

/* ---------- handwritten note ----------
   A full paper panel with Paige's note centred. The note figure itself is
   shared with the gallery pages and lives in css/main.css. */
.note {
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: var(--s-7) var(--page-margin);
}
@media (max-width: 734px) {
  /* on phones the panel is as tall as the note, not a whole screen */
  .note { min-height: 0; padding-block: var(--s-6); }
}

/* ---------- parallax panel ("drift") ----------
   Velaa's navy panel, measured off the site at 1440 wide (2026-10-24):
   the section is 2.5 screens tall and scrolls at normal speed. Two columns
   of 40%-wide tiles, one gutter (6.7%) at the edges, between the columns
   and between tiles, tile aspect 576:910. The right column rides with the
   page, starting one gutter down; the left column runs at 1.1x scroll speed
   (its top starts flush with the section's and climbs past it), which is what makes it
   look like it climbs. The headline is pinned at the centre while the
   section passes and its lines appear one after another.
   --p is the section's progress through the window (js/parallax.js): 0 as
   its top enters at the foot, 1 once its bottom has left the top, so the
   left column's lift is a straight line of scroll with no change of rate. */
.drift {
  --p: 0;
  --gutter: 6.7vw;
  --h: 250lvh;                /* section height */
  --lift: calc(0.1 * (var(--h) + 100lvh)); /* 10% of the full pass = 1.1x scroll */
  position: relative;
  height: var(--h);
  overflow: clip;
  background: var(--black);
  color: var(--white);
}
.drift__cols {
  position: absolute;
  inset: 0 var(--gutter) auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--gutter);
}
.drift__col {
  display: grid;
  row-gap: var(--gutter);
  align-content: start;
}
.drift__col--l {
  will-change: transform;
  margin-top: 0; /* flush with the panel's top as it enters, so no black strip shows above the first photo (Evan, 2026-11-22) */
  transform: translateY(calc(var(--p) * -1 * var(--lift)));
}
.drift__col--r { margin-top: var(--gutter); }
.drift__col img {
  width: 100%;
  aspect-ratio: 576 / 910;
  object-fit: cover;
}
/* three tiles a column on desktop, four on phones */
.drift__col img:nth-child(n + 4) { display: none; }
.drift__text {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  display: grid;
  place-items: center;
  padding-inline: var(--page-margin);
  text-align: center;
  pointer-events: none;
}
.drift__text h2 {
  font-size: var(--fs-h2);
  max-width: 24ch;
}
/* line --i fades up over a slice of --p while the headline is pinned, which
   is --p 0.29 to 0.71 on desktop (one screen in, one screen before the end):
   0.31-0.39, 0.45-0.53, 0.59-0.67 */
.drift__text .line {
  --pin: calc(100lvh / (var(--h) + 100lvh));
  --t: clamp(0, (var(--p) - var(--pin) - 0.02 - var(--i) * 0.14) / 0.08, 1);
  display: block;
  opacity: var(--t);
  transform: translateY(calc((1 - var(--t)) * 20px));
}
@media (max-width: 734px) {
  .drift { --gutter: 6vw; --h: 160lvh; }
  /* a page margin either side and the same gap between the columns and
     between tiles, so the panel reads as one grid like the desktop one
     (was edge to edge with 96px of black between tiles) */
  .drift__cols { inset: 0 var(--page-margin) auto; }
  .drift__col { row-gap: var(--gutter); }
  /* both columns start flush with the section's top, no empty space above
     either first tile (Evan); the stagger comes from the left column
     climbing ahead, which is why it runs a fifth tile */
  .drift__col--l { margin-top: 0; }
  .drift__col--r { margin-top: 0; }
  .drift__col img { aspect-ratio: 172 / 335; }
  .drift__col img:nth-child(n + 4) { display: block; }
  /* the left column runs 01, 02, 05, 03, 04 here so no photo sits beside
     its twin in the right column (05, 03, 01, 02); desktop keeps the
     source order */
  .drift__col--l img:nth-child(1) { order: 5; }
  .drift__col--l img:nth-child(2) { order: 2; }
  .drift__col--l img:nth-child(3) { order: 4; }
  .drift__col--l img:nth-child(4) { order: 1; }
  .drift__col--l img:nth-child(5) { order: 3; }
  /* the headline sits over the photos here, so give it a soft shadow and
     dim the tiles a touch while it is pinned */
  .drift__text h2 { text-shadow: 0 2px 24px rgba(1, 1, 1, 0.55), 0 0 60px rgba(1, 1, 1, 0.45); }
  .drift__col img { filter: brightness(0.82); }
  /* pinned for 0.38 to 0.62 on phones: 0.39-0.45, 0.47-0.53, 0.55-0.61 */
  .drift__text .line { --t: clamp(0, (var(--p) - var(--pin) - 0.01 - var(--i) * 0.08) / 0.06, 1); }
  .drift__text h2 { max-width: 16ch; }
  .drift__text .line { text-wrap: balance; }
}
@media (prefers-reduced-motion: reduce) {
  .drift__col--l { transform: none; }
  .drift__text .line { opacity: 1; transform: none; }
}
