/* ============================================================
   intro.css — opening sequence, hero stagger, scroll effects,
   reveal animations, image hover + lightbox.
   ============================================================ */

/* ── 1. INTRO OVERLAY ───────────────────────────────────── */
body:not(.intro-done) { overflow: hidden; }
.topbar { opacity: 0; transition: opacity 0.5s ease; }
body.intro-done .topbar { opacity: 1; }

#intro-overlay {
  position: fixed; inset: 0; z-index: 9000;
  overflow: hidden; pointer-events: none;
}

.ip {
  position: absolute; left: 0; width: 100%; height: 51%;
  background: var(--ink);
  transition: transform 0.72s cubic-bezier(0.76,0,0.24,1);
}
.ip--t { top: 0; }
.ip--b { bottom: 0; }
#intro-overlay.splitting .ip--t { transform: translateY(-102%); }
#intro-overlay.splitting .ip--b { transform: translateY(102%); }

.intro-center {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  transition: opacity 0.28s ease;
}
#intro-overlay.splitting .intro-center { opacity: 0; }

.intro-mono {
  font-family: var(--font-display);
  font-size: clamp(5rem, 13vw, 9.5rem);
  font-weight: 600; color: var(--paper);
  letter-spacing: -0.03em; line-height: 1;
  animation: mono-pulse 1.3s ease-in-out infinite alternate;
}
@keyframes mono-pulse {
  from { opacity: 0.6; transform: scale(0.97); }
  to   { opacity: 1;   transform: scale(1);    }
}

.intro-num {
  font-family: var(--font-mono);
  font-size: clamp(1rem,2.5vw,1.5rem);
  color: var(--signal); letter-spacing: 0.3em;
  text-shadow: 0 0 22px var(--signal-glow);
  font-variant-numeric: tabular-nums;
}

.intro-lbl {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--instrument-dim);
}

.intro-scan {
  position: absolute; left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg,transparent,var(--signal),transparent);
  box-shadow: 0 0 14px var(--signal-glow);
  animation: scan 1.1s ease-in-out forwards; opacity: 0;
}
@keyframes scan {
  0%   { top:0%;   opacity:0; }
  5%   { opacity:1; }
  95%  { opacity:1; }
  100% { top:100%; opacity:0; }
}

.intro-corner {
  position: absolute; width: 28px; height: 28px;
  border-color: var(--signal); border-style: solid; opacity: 0;
  animation: corner-in 0.5s ease 0.15s forwards;
}
@keyframes corner-in {
  from { opacity:0; transform:scale(0.5); }
  to   { opacity:0.7; transform:scale(1); }
}
.ic--tl { top:20px;    left:20px;  border-width: 2px 0 0 2px; }
.ic--tr { top:20px;    right:20px; border-width: 2px 2px 0 0; }
.ic--bl { bottom:20px; left:20px;  border-width: 0 0 2px 2px; }
.ic--br { bottom:20px; right:20px; border-width: 0 2px 2px 0; }

/* ── 2. HERO STAGGER-IN ─────────────────────────────────── */
.hero__eyebrow,
.hero__name,
.hero__readout,
.hero__actions,
.hero__visual,
.scroll-cue {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.85s cubic-bezier(0.16,1,0.3,1),
              transform 0.85s cubic-bezier(0.16,1,0.3,1);
}
.hero-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

@media (prefers-reduced-motion: reduce) {
  .hero__eyebrow,.hero__name,.hero__readout,
  .hero__actions,.hero__visual,.scroll-cue {
    opacity:1; transform:none; transition:none;
  }
  #intro-overlay { display:none; }
  .topbar { opacity:1; transition:none; }
}

/* ── 3. SCROLL REVEALS ──────────────────────────────────── */
.js-reveal-ready .reveal-pending {
  opacity: 0;
  transform: translateY(44px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1),
              transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ── 4. SCROLL PARALLAX will-change ────────────────────── */
.hero__visual, .hero__copy { will-change: transform; }
.section-head h2 {
  will-change: transform, opacity;
  transition: transform 0.14s linear, opacity 0.14s linear;
}

/* ── 5. IMAGE HOVER ─────────────────────────────────────── */
.media-frame {
  cursor: zoom-in;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.35s cubic-bezier(0.16,1,0.3,1),
              border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}
.media-frame::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg,rgba(61,220,138,0.08),transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}
.media-frame:hover {
  transform: scale(1.04) translateY(-4px);
  box-shadow: 0 16px 48px -16px rgba(0,0,0,0.7),
              0 0 0 1px var(--signal-dim),
              0 0 24px -4px var(--signal-glow);
  border-color: var(--signal-dim) !important;
  z-index: 10;
}
.media-frame:hover::after { opacity: 1; }
.media-frame img {
  transition: filter 0.38s ease, transform 0.4s cubic-bezier(0.34,1.2,0.64,1);
}
.media-frame:hover img {
  filter: brightness(1.08) saturate(1.1);
  transform: scale(1.03);
}

/* Mosaic tiles — subtler hover (they're in a fixed grid) */
.media-grid--clearread .media-frame:hover {
  transform: scale(1.02) translateY(-2px);
}

/* Video/iframe frames — no zoom cursor, no scale (controls) */
.media-frame.is-wide {
  cursor: default;
}
.media-frame.is-wide:hover {
  transform: none;
}
.media-frame.is-wide::after { display: none; }

/* ── 6. ROLE CARD HOVER ─────────────────────────────────── */
.role-card {
  transition: border-color 0.3s ease, box-shadow 0.3s ease,
              opacity 0.8s cubic-bezier(0.16,1,0.3,1),
              transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.role-card:hover {
  border-color: rgba(61,220,138,0.28) !important;
  box-shadow: 0 12px 48px -20px rgba(61,220,138,0.14);
}

/* ── 7. LIGHTBOX ────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(4,7,10,0.94);
  display: flex; align-items: center; justify-content: center;
  padding: 32px; cursor: zoom-out;
  opacity: 0; pointer-events: none;
  transition: opacity 0.32s ease;
  backdrop-filter: blur(8px);
}
.lightbox-overlay.is-open {
  opacity: 1; pointer-events: auto;
}
.lightbox-overlay img {
  max-width: 92vw; max-height: 90vh;
  width: auto; height: auto;
  border-radius: 5px;
  box-shadow: 0 48px 96px -24px rgba(0,0,0,0.85);
  transform: scale(0.88);
  transition: transform 0.4s cubic-bezier(0.34,1.2,0.64,1);
}
.lightbox-overlay.is-open img { transform: scale(1); }
.lightbox-close {
  position: fixed; top: 18px; right: 22px;
  font-family: var(--font-mono); font-size: 24px;
  color: var(--paper); cursor: pointer;
  opacity: 0.65; z-index: 8001;
  transition: opacity 0.2s ease, transform 0.25s ease;
  line-height: 1;
}
.lightbox-close:hover { opacity: 1; transform: rotate(90deg) scale(1.2); }

/* ── 8. YOUTUBE POSTER FRAME ────────────────────────────── */
.yt-frame {
  cursor: pointer;
  position: relative;
}
.yt-thumb {
  width: 100%;
  height: auto;
  display: block;
  transition: filter 0.3s ease, transform 0.4s cubic-bezier(0.34,1.2,0.64,1);
}
.yt-frame:hover .yt-thumb {
  filter: brightness(0.7);
  transform: scale(1.04);
}
.yt-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(1);
  background: none; border: none; cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
              filter 0.3s ease;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5));
  z-index: 3;
}
.yt-frame:hover .yt-play {
  transform: translate(-50%, -50%) scale(1.15);
  filter: drop-shadow(0 6px 24px rgba(61,220,138,0.4));
}

/* ── 9. MASONRY GALLERY LAYOUT ──────────────────────────── */
.role-card__gallery,
.project-card__gallery,
.ledger-row__images {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.role-card__gallery.has-masonry-cols,
.project-card__gallery.has-masonry-cols,
.ledger-row__images.has-masonry-cols {
  flex-direction: row;
  align-items: flex-start;
}
.masonry-col {
  display: flex; flex-direction: column;
  gap: 12px; flex: 1 1 0; min-width: 0;
}
.role-card__gallery.single-item,
.project-card__gallery.single-item,
.ledger-row__images.single-item {
  display: block;
}
.role-card__gallery.single-item .media-frame,
.project-card__gallery.single-item .media-frame,
.ledger-row__images.single-item .media-frame {
  max-width: 480px;
}
@media (max-width: 520px) {
  .role-card__gallery,
  .project-card__gallery,
  .ledger-row__images,
  .role-card__gallery.has-masonry-cols,
  .project-card__gallery.has-masonry-cols,
  .ledger-row__images.has-masonry-cols {
    display: flex; flex-direction: column; gap: 12px;
  }
  .masonry-col { display: contents; }
  .role-card__gallery.single-item .media-frame,
  .project-card__gallery.single-item .media-frame,
  .ledger-row__images.single-item .media-frame { max-width: 100%; }
}
