/* ==========================================================================
   SHOTBYADDICT — intro.css  (homepage only)
   The overlay only exists when the inline head script adds html.intro (the FULL intro: fresh visit,
   reload, first homepage view of the visit). Coming back from another page of the site: no class, no overlay.
   NOTE: html and the overlay div both carry the class "intro", so overlay rules are scoped with div.intro.
   Without JS: no class, no overlay, nothing hidden (display:none below).
   Only transform / opacity / clip-path are animated (compositor friendly).
   Motion itself is driven by /js/intro.js (Web Animations API); this file holds
   the layout, the start states and the CSS-only failsafe.
   ========================================================================== */

div.intro,
.intro__skip { display: none; }

html.intro div.intro { display: block; }

/* ---------- scroll lock + header logo hold ---------- */
/* Locked while html.intro is present. The failsafe keyframe below releases it after 5s
   even if every script died. overflow is a discrete property, so it flips at the end. */
html.intro {
  overflow: hidden;
  scrollbar-gutter: stable;   /* no layout shift when the lock is released */
  animation: intro-unlock 0s linear 5s forwards;
}
@keyframes intro-unlock { to { overflow: visible; } }

/* The real header logo is laid out from the start (no CLS) but stays invisible until the
   wordmark has flown into it. */
html.intro [data-intro-target] {
  opacity: 0;
  animation: intro-target 0s linear 5s forwards;
}
html.intro.intro--revealed [data-intro-target] { opacity: 1; animation: none; }
@keyframes intro-target { to { opacity: 1; } }

/* ---------- overlay ---------- */
div.intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  touch-action: none;
  cursor: pointer;
  /* CSS-only failsafe: gone after ~5s whatever happens to the script */
  animation: intro-failsafe 0.3s ease 4.7s forwards;
}
@keyframes intro-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* black curtain, lifted by intro.js (translateY 0 -> -100%); a hairline of red rides its lower edge (off-screen until the curtain lifts) */
.intro__bg {
  position: absolute;
  inset: 0;
  background: #000;
  will-change: transform;
}
.intro__bg::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--red, #fc0101);
}

.intro__stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

/* The lock-up is two images laid on one exact grid (measured in _source/brand/wordmark.json, not published:
   by x=0 w=394, name x=395 w=465 of a 860x59 canvas), so both words stay perfectly aligned at any size. */
.intro__lockup {
  --intro-w: clamp(264px, 84vw, 820px);   /* never above the 860px native width: stays sharp */
  position: relative;
  width: var(--intro-w);
  aspect-ratio: 860 / 59;
}
/* HiDPI: the crops are 860 / 465 px wide, so cap the CSS size to keep them crisp (at most ~1.4x upscale) */
@media (min-resolution: 2dppx) {
  .intro__lockup { --intro-w: clamp(264px, 84vw, 620px); }
}

.intro__by,
.intro__name-wrap {
  position: absolute;
  top: 0;
  height: 100%;
}
.intro__by { left: 0; width: 45.8140%; }                /* 394 / 860 */
.intro__name-wrap { left: 45.9302%; width: 54.0698%; transform-origin: 0 0; will-change: transform; }  /* 395 / 860, 465 / 860 */
.intro__by img,
.intro__name-wrap img { display: block; width: 100%; height: 100%; }

/* start states (so nothing flashes before intro.js takes over) */
.intro__by { opacity: 0; transform-origin: 100% 50%; }
.intro__name-wrap img { clip-path: inset(0 100% 0 0); }

.intro__rule {
  position: absolute;
  left: 0;
  top: calc(100% + clamp(14px, 2.4vw, 28px));
  width: 100%;
  height: 2px;
  background: var(--red, #fc0101);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- skip control (visible on focus only) ---------- */
.intro__skip {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  left: max(0.75rem, env(safe-area-inset-left));
  z-index: 10001;
  padding: 0.7rem 1.1rem;
  background: #fff;
  color: #000;
  border: 0;
  border-radius: 2px;
  font: 600 0.8125rem/1 "Archivo", system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  /* hidden visually until focused; still in the accessibility tree */
  clip-path: inset(50%);
  width: 1px; height: 1px; padding: 0; overflow: hidden; white-space: nowrap;
}
html.intro .intro__skip { display: block; }
.intro__skip:focus,
.intro__skip:focus-visible {
  clip-path: none;
  width: auto; height: auto;
  padding: 0.7rem 1.1rem;
  overflow: visible;
  outline: 2px solid var(--red, #fc0101);
  outline-offset: 2px;
}

/* ---------- reduced motion ---------- */
/* The head script does not add html.intro at all for reduced motion. If the preference flips
   while the overlay is up, intro.js skips (quick fade) and this removes the remaining motion. */
@media (prefers-reduced-motion: reduce) {
  .intro__bg { will-change: auto; }
  .intro__rule { display: none; }
}
