/* Yesterday — scroll-driven logo reveal.
   A tall scroll well with one sticky full-viewport stage inside it; the two
   Figma frames are injected into .ylr-stage as absolutely positioned SVGs and
   driven by /assets/js/logo-reveal.js. All classes are ylr- prefixed so nothing
   collides with the shared site CSS.

   Two colour versions run off the same exports. The neutrals live here as
   variables and the driver rewrites them per version — dark is the artwork as
   drawn, light trades the olive ground for the paper and draws the type in a
   lifted olive. The yellow is not a variable because it never moves. */

.ylr {
  --ylr-paper: #393933;     /* the ground both frames are drawn on */
  --ylr-ink: #F0EFEB;       /* the neutral the type is drawn in */

  position: relative;
  width: 100%;
  height: 300vh;            /* data-length overrides this from JS */
  background: var(--ylr-paper);
}

.ylr-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  width: 100%;
  overflow: hidden;
  background: var(--ylr-paper);
}

/* svh is the correct unit here — the stage must not resize as mobile browser
   chrome retracts, or the sticky frame jitters mid-scroll. */
@supports not (height: 100svh) {
  .ylr-stage { height: 100vh; }
}

/* If the frames cannot be fetched the well would read as dead space; collapse
   it to a single screen of ground rather than three. */
.ylr.is-failed { height: 100svh; }

/* ---- driven ---------------------------------------------------------------
   When another timeline owns the playhead the reveal is not a scroll well of
   its own but a layer inside someone else's stage, so it fills its host and
   the sticky goes away. */
.ylr-driven { position: absolute; inset: 0; height: auto; background: none; }

.ylr-driven .ylr-stage {
  position: absolute;
  inset: 0;
  height: 100%;
  background: none;
}

/* ---- version switch ------------------------------------------------------
   Painted in the version's own two colours, so it stays legible on whichever
   ground is currently underneath it. */

.ylr-versions {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  /* Four options do not fit on one line on a narrow phone; let the group wrap
     rather than push itself off the edge. */
  max-width: calc(100vw - 32px);
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--ylr-ink);
  border-radius: 20px;
  background: var(--ylr-paper);
}

.ylr-version {
  appearance: none;
  margin: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ylr-ink);
  font: 500 12px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.ylr-version:hover { background: color-mix(in srgb, var(--ylr-ink) 18%, transparent); }

.ylr-version.is-on {
  background: var(--ylr-ink);
  color: var(--ylr-paper);
}

.ylr-version:focus-visible {
  outline: 2px solid var(--ylr-ink);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .ylr-versions { right: 12px; bottom: 12px; max-width: calc(100vw - 24px); }
  .ylr-version { padding: 9px 12px; font-size: 11px; }
}
