/* Round 2 (T9c), Come Closer as a film. Loaded after main.css and the kit
   (room.css), on Come Closer only. The film's script is room-come-closer.js.

   Two states, and the first one is the safety net:

   1. The plain page (no script, Reduce Motion, or GSAP failed to load): the
      page as main.css draws it, with THE NIGHT on the grid (below). Everything
      readable, nothing held back.
   2. .cc-live on <main>, set by room-come-closer.js once motion has started:
      the opener becomes a title card on a letterbox strip that the scroll opens
      into the full photo; the headings switch on; the photos open out of a slit
      and drift inside their frames; the Spor room's red light comes up. */

/* ---- THE NIGHT on the grid (both states) ------------------------------------
   Heading on the left line, the photo in the text column over its copy, so
   both edges of the photo line up with the copy below it and with every other
   section's text column. The frame's shape is set here, not by the photo: a
   wide or an upright upload is cropped from the middle into the same 3:2. */
.come-closer__night-grid {
  grid-template-areas:
    "head photo"
    ".    body";
  row-gap: clamp(1.5rem, 3.5vw, 2.5rem);
}

.come-closer__night-grid > .about-statement { grid-area: head; }

/* On a computer the heading stays level with the photo while the copy under
   it is read, instead of leaving the left column empty: it runs the length of
   both rows and holds below the header. */
@media (min-width: 901px) {
  .come-closer__night-grid > .about-statement {
    grid-row: 1 / span 2;
    align-self: start;
    position: sticky;
    top: clamp(6rem, 12vh, 8rem);
  }
}
.come-closer__night-grid > .come-closer__figure { grid-area: photo; }
.come-closer__night-grid > .about-body { grid-area: body; }

.come-closer__figure--grid .come-closer__photo {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 50% 40%;
}

/* Stacked, like every other section on a phone: photo, heading, copy. */
@media (max-width: 900px) {
  .come-closer__night-grid {
    grid-template-areas:
      "photo"
      "head"
      "body";
    row-gap: 0;
  }

  .come-closer__night-grid > .come-closer__figure {
    margin-bottom: clamp(1.5rem, 3.5vw, 2.5rem);
  }

  .come-closer__night-grid > .about-statement {
    margin-bottom: var(--space-m);
  }

  .come-closer__figure--grid .come-closer__photo {
    aspect-ratio: 4 / 3;
  }
}

/* ---- Frames ------------------------------------------------------------------
   Square, like a projected frame: round corners belong to cards, and this page
   is a film. */
.come-closer .come-closer__figure {
  border-radius: 0;
}

/* A phone stacks every section photo first, so the photo must sit clearly
   nearer its own heading than the copy above it: more air between scenes. */
@media (max-width: 900px) {
  .come-closer__section {
    padding: clamp(4.5rem, 18vw, 6rem) 0;
  }
}

/* The page's red glow (#tettpaa-bg) runs on under the footer, whose black
   cut it off in a straight line. A fade at the foot of the page lets the
   light die out before the footer starts. */
.come-closer {
  position: relative;
  /* Its own stack, so the fade below can sit behind the page's content (the
     Spor button over it stays bright) and still in front of the glow. */
  isolation: isolate;
}

.come-closer::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(14rem, 30vh);
  /* Ends on the black under the footer (#000), not the page's --bg, or the
     two near-blacks meet in a visible step. */
  background: linear-gradient(to bottom, transparent, #000);
  pointer-events: none;
}

/* The header's own wash is short; copy scrolling up under the menu stayed
   readable behind it. A deeper shade under the header, on this page. */
.come-closer::before {
  content: "";
  position: fixed;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(6rem, 13vh, 8rem);
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 40%, rgba(3, 3, 3, 0.75) 66%, transparent 100%);
  pointer-events: none;
}

/* The phone: headings at a size that holds its own against the title card
   and the photos, and one photo (intimacy, the band) edge to edge, so the
   scenes do not all have the same shape. */
@media (max-width: 700px) {
  .come-closer .about-statement {
    font-size: clamp(2.6rem, 11.5vw, 3.4rem);
  }

  .come-closer .come-closer__figure--band {
    width: 100%;
  }
}

/* ---- data-lift ---------------------------------------------------------------
   The fade-up on every block is the generic move round 2 drops: the moments
   that move are named ones. Everything else simply stands there. */
.come-closer [data-lift],
.come-closer [data-lift].is-lifted {
  opacity: 1;
  translate: none;
  animation: none;
}

/* The Spor room's light, hidden on the plain page. */
.come-closer__spor-light {
  display: none;
}

/* ---- Live: the title card ---------------------------------------------------- */

/* The page's name, drawn only by the film (the <h1> stays for screen readers;
   this copy is aria-hidden). Bebas at the size of a title card, on the page's
   left line, across the letterbox strip. Its top is set by the script, from
   where the strip sits. */
.cc-title {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(4rem, calc((100vw - 3rem) / 5.6), 13.5rem);
  line-height: 0.86;
  letter-spacing: 0.012em;
  text-transform: uppercase;
  color: var(--text);
  pointer-events: none;
  /* It flies toward you from its own middle (room-come-closer.js). */
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

/* A phone stacks the two words, each as wide as the screen allows. */
@media (max-width: 600px) {
  .cc-title {
    font-size: clamp(4rem, calc((100vw - 2.5rem) / 3.05), 9rem);
  }

  .cc-title .room__word {
    display: block;
  }
}

/* In the film the photo fills the screen, and "what it is" lies over its dark
   foot (the frame's dissolve), so the strip can open out symmetrically to the
   whole screen. The plain page keeps the photo above the text. overflow:clip
   keeps the flying title from widening the page. */
.cc-live .come-closer__opener {
  position: relative;
  display: block;
  height: 100vh;
  height: max(600px, 100svh);
  min-height: 0;
  padding-bottom: 0;
  overflow: clip;
}

.cc-live .come-closer__frame {
  position: absolute;
  inset: 0;
  min-height: 0;
}

.cc-live .come-closer__intro {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: max(var(--space-l), var(--inset-bottom));
  padding-top: 0;
}

/* The strip opens by clip-path (the script); the photo inside pushes in. */
.cc-live .come-closer__frame {
  will-change: clip-path;
}

.cc-live .come-closer__opener-photo {
  transform-origin: 50% 60%;
  will-change: transform;
}

/* The film's light on the opener sits under the dissolve like the photo. */
.cc-live .come-closer__frame .room__grain {
  opacity: 0.06;
}

/* ---- Live: the scenes ---------------------------------------------------------
   Each photo is a frame on a set: red light coming in from the upper left and
   pooling at the rim, never over the faces in the middle. Plain see-through
   red (no blend mode: a blended layer on a moving frame draws its box edge as
   a hairline). The photo stays in colour. */
.cc-live .come-closer__section .come-closer__figure {
  position: relative;
  isolation: isolate;
}

.cc-live .come-closer__section .come-closer__figure::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(70% 60% at 0% 0%, rgba(255, 26, 40, 0.34), transparent 70%),
    radial-gradient(130% 120% at 50% 45%, transparent 55%, rgba(150, 0, 8, 0.32) 82%, rgba(42, 0, 3, 0.62) 100%);
}

/* The light an open photo throws on the black around it (room-come-closer.js
   places it on the figure's box): the photo itself, blurred and a little
   larger, behind it. Static once on, so the blur is drawn once. */
.cc-live .come-closer__section {
  position: relative;
  isolation: isolate;
}

.cc-spill {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  filter: blur(44px) saturate(1.5);
  transform: scale(1.08);
  opacity: 0;
}

/* The spare edge the drift moves into (room-come-closer.js). */
.cc-live .come-closer__section .come-closer__photo {
  will-change: transform;
}

/* ---- Live: the Spor room ------------------------------------------------------
   A pool of red light behind the mixes, as if the booth's lamp were on. It
   fades out well inside the section on every side, so the room
   has no edge of its own against the page. The script brings it up. */
.cc-live .come-closer__spor {
  position: relative;
  isolation: isolate;
}

.cc-live .come-closer__spor-light {
  display: block;
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  /* Light dies out well before the section ends, never at a ruler edge. */
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 92%);
  background:
    radial-gradient(42% 46% at 66% 44%, rgba(227, 6, 19, 0.24), rgba(227, 6, 19, 0.07) 55%, transparent 100%);
  will-change: opacity;
}

@media (max-width: 900px) {
  .cc-live .come-closer__spor-light {
    background:
      radial-gradient(48% 30% at 50% 66%, rgba(227, 6, 19, 0.22), rgba(227, 6, 19, 0.06) 55%, transparent 100%);
  }
}
