/* Scoped XIE entry animation; the reference site's layout remains independent. */
.intro {
  --xie-ease: cubic-bezier(.5, 0, .1, 1);
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: #fff;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.intro[hidden] { display: none; }
.intro.is-brush-playing { animation: intro-out 5s var(--xie-ease) forwards; }
.intro__paper {
  position: relative;
  width: min(47vw, 760px, 64svh);
  aspect-ratio: 892 / 1172;
  overflow: hidden;
}
.intro-filters { position: absolute; pointer-events: none; }
.intro__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  /* Keep dark ink values intact and lift the baked pale shadows to paper white. */
  filter: url('#intro-white-paper');
}
.intro.is-brush-playing .intro__frame--one { animation: brush-reveal-one 5s var(--xie-ease) forwards; }
.intro.is-brush-playing .intro__frame--two { animation: brush-reveal-two 5s var(--xie-ease) forwards; }
.intro.is-brush-playing .intro__frame--three { animation: brush-reveal-three 5s var(--xie-ease) forwards; }
/* The original brush-head spans are intentionally invisible; the PNG frames
   carry the actual brush artwork and retain their original clip-path timing. */
.intro__brush { display: none; }
.brush-active .wrapper { pointer-events: none; }
.js .is-not-ready .home-hero .hero-image { animation-play-state: paused; }

@keyframes brush-reveal-one {
  0% { opacity: 1; clip-path: inset(0 100% 0 0); }
  29%, 100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes brush-reveal-two {
  0%, 30% { opacity: 1; clip-path: polygon(0 48%, 0 48%, 0 66%, 0 66%); }
  57%, 100% { opacity: 1; clip-path: polygon(0 48%, 76% 48%, 76% 66%, 0 66%); }
}
@keyframes brush-reveal-three {
  0%, 58% { opacity: 1; clip-path: polygon(43% 10%, 74% 10%, 74% 10%, 43% 10%); }
  83%, 100% { opacity: 1; clip-path: polygon(43% 10%, 74% 10%, 74% 97%, 43% 97%); }
}
@keyframes intro-out {
  0%, 84% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

.home-hero .hero-mark {
  position: absolute;
  right: 7%;
  top: auto;
  bottom: 0;
  width: min(24%, 34svh);
  height: auto;
  aspect-ratio: 1 / 2;
  z-index: 1;
  overflow: visible;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 1s cubic-bezier(.5, 0, .1, 1);
}
.hero-mark__canvas { position: absolute; display: block; max-width: none; pointer-events: none; }
.hero-mark__fallback {
  display: block;
  width: 100%;
  height: 100%;
  color: transparent;
  font-size: 0;
  background: repeating-linear-gradient(to bottom, rgb(255 255 255 / .7) 0 1.85px, transparent 1.85px 4px);
  clip-path: polygon(0 0, 29% 0, 50% 29.577%, 71% 0, 100% 0, 64.5% 50%, 100% 100%, 71% 100%, 50% 70.423%, 29% 100%, 0 100%, 35.5% 50%);
}
.hero-mark[data-xie-mark-ready] .hero-mark__fallback { visibility: hidden; }
.js .is-not-ready .home-hero .hero-mark { opacity: 0; }
.home-hero > :is(.hero-project, .hero-statement, .hero-scroll) { z-index: 2; }

@media (max-width: 760px) {
  .intro__paper { width: min(76vw, 400px, 64svh); }
  /* The mobile image panel is clamp(240px, 55svh, 520px). Limit width
     before deriving height so the X never becomes vertically compressed. */
  .home-hero .hero-mark { right: 6%; top: auto; bottom: 0; transform: translateY(40%); width: min(44%, calc(clamp(240px, 55svh, 520px) * .35)); aspect-ratio: 1 / 3.6; pointer-events: auto; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .home-hero .hero-media { touch-action: pan-y pinch-zoom; }
  .hero-mark__fallback { background: repeating-linear-gradient(to bottom, rgb(255 255 255 / .7) 0 1.35px, transparent 1.35px 2.6px); }
}
@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  .home-hero .hero-mark { transition: none; }
}
