/* come-closer.css: Come Closer's title card (T10, step 3). Loaded after
   main.css and alive.css, on Come Closer only. The script is come-closer.js.

   The page is live's (main.css): the photos rise in, in colour, with their
   rounded corners; THE NIGHT stands as it is. Two things are added on top:
   the headings light up word by word (alive.css, as on the home page), and
   the opener becomes round 2's title card.

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

   1. The plain page (no script, Reduce Motion, or GSAP failed to load): the
      opener exactly as live draws it, the photo down to "what it is".
   2. .cc-live on <main>, set by come-closer.js once motion has started: the
      opener is a letterbox strip of its photo across the middle of the screen
      with COME CLOSER on it. The words light up the round 1 way (grey to
      white, one after another), not round 2's red flash. The scroll holds the
      page while the strip opens to the whole screen and the photo pushes in;
      the title passes the camera and is gone; "what it is" lights up word by
      word at the photo's dark foot; the page lets go. */

/* The page's name, drawn only by the title card. 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, centred on the 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. */
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

/* Each word its own box, so each can light on its own (opacity, the same
   light as .alive-word on the rest of the page). */
.cc-title__word {
  display: inline-block;
}

/* 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__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 evenly to the whole
   screen. Clipped across only, which keeps the flying title from widening the
   page and leaves room below for the strip under it (::after). */
.cc-live .come-closer__opener {
  position: relative;
  display: block;
  height: 100vh;
  height: max(600px, 100svh);
  min-height: 0;
  padding-bottom: 0;
  overflow-x: clip;
}

/* The opener carried on below itself, past where a phone's toolbar folds
   away. The opener is a small screen tall (svh), so when the bar folded away
   mid-scroll a strip opened under the held opener and the glow showed through
   it with hard edges (Lars' iPhone, polish #21). This takes the opener's own
   background, black on the title card and clear once the script has faded it,
   so the strip is part of the opener.

   Not lvh minus svh, which is what this was sized by first: iOS 26 Safari
   gives lvh the same value as svh while its toolbar is showing, so the cover
   came out 2px tall and the strip was back, without the black the rest of the
   opener had (Lars' iPhone, 2026-12-02: "an area without filter ... this
   strip jumps in"). A quarter of the screen is more than any toolbar takes,
   and costs nothing: while the page is held only the empty pin spacer is
   under it (on a desktop it is below the screen), and the script has faded
   it clear by the time the page lets go and it scrolls up over the copy.
   lvh minus svh is kept as the floor for a browser whose bar is taller
   still. */
.cc-live .come-closer__opener::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: max(calc(100lvh - 100svh + 2px), 25svh);
  background-color: inherit;
  pointer-events: none;
}

.cc-live .come-closer__frame {
  position: absolute;
  inset: 0;
  min-height: 0;
  /* The strip opens by clip-path (the script). No will-change here: a
     standing clip layer drew a hairline at the photo's foot. */
}

.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;
}

/* No will-change: a standing layer for the photo drew its bottom row past the
   frame's dissolve, a hairline across the page where the photo ends (polish
   #7). GSAP lifts the photo onto a layer of its own while it moves and lays it
   back down once the film is over. */
.cc-live .come-closer__opener-photo {
  transform-origin: 50% 60%;
}

/* Where the red starts, in the film. Inside the held opener the marker stays
   put on the screen while the page scrolls on under it, so the glow, which
   tettpaa-bg.js measures again whenever the page changes height (the Spor
   rows arriving, a rotated phone, an address bar), landed somewhere new each
   time it was measured mid-scroll: the glow jumped (polish #21). The script
   moves the marker to the top of the copy under the opener, raised by the part
   of the opener below the dissolve's start (100% less the 62% in main.css).
   That is the same line on the screen the moment the page lets go, and one
   that never moves on the page. */
.cc-live .come-closer__more {
  position: relative;
}

.cc-live .come-closer__more > .come-closer__glow-start {
  top: -38vh;
  top: calc(max(600px, 100svh) * -0.38);
}

/* The scroll hint, on the title card only: the home hero's chevron, at the
   home hero's place, coming in once the title has lit. Measured from the foot
   of the screen rather than of the opener, which is taller than the screen on
   a phone held sideways (its 600px floor). */
.come-closer__cue {
  display: none;
}

.cc-live .come-closer__cue {
  display: block;
  bottom: calc(100% - 100svh + max(clamp(1rem, 2.5vw, 2rem), var(--inset-bottom)));
  animation: cue-in 0.8s ease 1.4s backwards;
}

/* The menu pins the page at the top as far as site.js can tell, which would
   bring the hint back behind the menu and fade it out over the photo once the
   menu closed. It stays out of sight while the menu is open. */
.nav-open .come-closer__cue {
  opacity: 0;
  transition: none;
}

/* A shade over the photo while it is a strip, so the white title holds on a
   bright red frame. The script takes it down as the strip opens. Not there
   on the plain page. */
.come-closer__shade {
  display: none;
}

.cc-live .come-closer__shade {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
