/* ══════════════════════════════════════════════════════════════════════
   Intro — grain field that flips dark → light, then clears away to
   reveal the hero. Plays on a fresh load or refresh of the home page.
   ══════════════════════════════════════════════════════════════════════ */

#intro { display: none; }

html.intro-pending { overflow: hidden; }
html.intro-pending #intro,
#intro.on {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #070707;
  cursor: default;
}
#intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* The two lines */
.intro-line {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: max-content;
  max-width: 88vw;
  text-align: center;
  font-family: -apple-system, "SF Pro Display", "Inter", BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: clamp(26px, 3.4vw, 56px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.3;
  pointer-events: none;
  user-select: none;
}
.intro-line .w { display: inline-block; opacity: 0; will-change: opacity, filter; }
.intro-line.l1 { color: #f4f2ee; text-shadow: 0 0 22px rgba(7,7,7,0.85), 0 0 6px rgba(7,7,7,0.6); }
.intro-line.l2 { color: #4a4844; text-shadow: 0 0 22px rgba(239,237,232,0.95), 0 0 6px rgba(239,237,232,0.8); }
/* Subtitle under line 2 — hangs below so the main line stays centered */
.intro-sub {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.5em;
  white-space: nowrap;
  font-size: clamp(13px, 1.15vw, 18px);
  font-weight: 400;
  letter-spacing: 0;
  color: #8a8781;
}

/* Skip */
.intro-skip {
  position: absolute;
  right: clamp(14px, 2.4vw, 28px);
  bottom: clamp(12px, 2.4vh, 24px);
  padding: 6px 4px;
  border: 0;
  background: none;
  font: 400 9px/1 -apple-system, "SF Mono", Menlo, monospace;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  color: rgba(244, 242, 238, 0.26);
  transition: color 0.4s ease;
}
.intro-skip[data-tone="dark"] { color: rgba(40, 38, 34, 0.24); }
.intro-skip:hover, .intro-skip:focus-visible { color: rgba(244, 242, 238, 0.7); outline: none; }
.intro-skip[data-tone="dark"]:hover, .intro-skip[data-tone="dark"]:focus-visible { color: rgba(40, 38, 34, 0.65); }

/* While the intro runs, keep the hero still so it can be revealed on cue */
html.intro-pending .site-header,
html.intro-pending .hero-text { opacity: 0; }
html.intro-pending .hero-image { transition: none !important; }

/* Hand-off: header and hero text sharpen into place, like the reference */
@keyframes introBlurIn {
  from { opacity: 0; filter: blur(14px); }
  to   { opacity: 1; filter: blur(0); }
}
html.intro-reveal .site-header { animation: introBlurIn 1s cubic-bezier(.2,.7,.2,1) both; }
html.intro-reveal .hero-text   { animation: introBlurIn 1.2s .15s cubic-bezier(.2,.7,.2,1) both; }
html.intro-reveal .hero-image  { animation: introBlurIn 1.3s .05s cubic-bezier(.2,.7,.2,1) both; }
