/* Opening and transition surfaces are decorative, with visible-content fallbacks. */
.site-intro, .page-transition { display: none; }

@media screen and (prefers-reduced-motion: no-preference) {
  .motion-opening .site-intro {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: block;
    overflow: hidden;
    background: #080a0e;
    color: #f5f5f7;
    pointer-events: none;
    animation: opening-safety 5s both;
  }
  .site-intro__frame {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(24px, 4vw, 56px);
  }
  .site-intro__meta, .site-intro__foot {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: clamp(9px, .8vw, 11px);
    font-weight: 600;
    letter-spacing: .1em;
    line-height: 1.4;
    color: #9ba9bc;
  }
  .site-intro__meta { padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.15); }
  .site-intro__foot { padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); }
  .site-intro__brand {
    align-self: center;
    width: min(100%, 720px);
    font-family: var(--font-display);
    font-size: clamp(64px, 12vw, 150px);
    font-weight: 700;
    line-height: .8;
    letter-spacing: -.075em;
  }
  .site-intro__row { display: flex; overflow: hidden; }
  .site-intro__row > span { display: block; animation: brand-enter 1100ms cubic-bezier(.16, 1, .3, 1) both; }
  .site-intro__row--middle { justify-content: flex-end; align-items: center; gap: .25em; color: #a8c7ff; }
  .site-intro__row--middle > span { animation-name: brand-enter-side; animation-delay: 180ms; }
  .site-intro__row:nth-child(3) > span { animation-delay: 360ms; }
  .site-intro__row i { width: .55em; height: .55em; border: 1px solid #438fff; border-radius: 50%; animation: brand-orbit 1200ms ease both; }
  .site-intro__dot { color: #4c9cff; }
  .motion-ready .site-intro { animation: opening-handoff 900ms cubic-bezier(.76, 0, .24, 1) both; }

  .motion-opening .page-transition, .motion-entry .page-transition, .motion-exiting .page-transition {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: grid;
    place-items: center;
    background: #111722;
    pointer-events: none;
  }
  .motion-entry .page-transition { animation: surface-safety 4s both; }
  .page-transition__mark { font-family: var(--font-display); font-size: 42px; font-weight: 700; letter-spacing: -.08em; color: #dce9ff; }
  .page-transition__mark span { color: #4c9cff; }
  .motion-revealing .page-transition { transform-origin: top; animation: surface-reveal 1100ms cubic-bezier(.76, 0, .24, 1) both; }
  .motion-revealing .page-transition__mark { animation: mark-out 450ms ease both; }
  .motion-exiting .page-transition { transform-origin: bottom; animation: surface-cover 800ms cubic-bezier(.76, 0, .24, 1) both; }

  .motion-revealing .hero-title { animation: none; }
  .hero-reveal-word { display: inline-block; }
  .motion-revealing .hero-reveal-word { animation: hero-resolve 1000ms cubic-bezier(.16, 1, .3, 1) both; }
  .motion-revealing .hero-reveal-word:nth-child(1) { animation-delay: 150ms; }
  .motion-revealing .hero-reveal-word:nth-child(2) { animation-delay: 210ms; }
  .motion-revealing .hero-reveal-word:nth-child(3) { animation-delay: 270ms; }
  .motion-revealing .hero-reveal-word:nth-child(4) { animation-delay: 330ms; }
  .motion-revealing .hero-reveal-word:nth-child(5) { animation-delay: 390ms; }
  .motion-revealing .hero-eyebrow { animation: hero-soft-enter 900ms ease 100ms both; }
  .motion-revealing .hero-subhead { animation: hero-soft-enter 1000ms cubic-bezier(.16, 1, .3, 1) 300ms both; }
  .motion-revealing .hero-ctas { animation: hero-soft-enter 1000ms cubic-bezier(.16, 1, .3, 1) 400ms both; }

  @keyframes brand-enter { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }
  @keyframes brand-enter-side { from { opacity: 0; transform: translateX(-30%); } to { opacity: 1; transform: translateX(0); } }
  @keyframes brand-orbit { from { opacity: 0; transform: scale(.3) rotate(-90deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
  @keyframes opening-handoff { to { transform: translateY(-100%); visibility: hidden; } }
  @keyframes opening-safety { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
  @keyframes surface-reveal { from { transform: translateY(0); } to { transform: translateY(-100%); visibility: hidden; } }
  @keyframes surface-cover { from { transform: translateY(100%); } to { transform: translateY(0); } }
  @keyframes surface-safety { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
  @keyframes mark-out { to { opacity: 0; transform: translateY(-10px); } }
  @keyframes hero-resolve { from { opacity: 0; filter: blur(8px); transform: translateY(12px); } to { opacity: 1; filter: blur(0); transform: translateY(0); } }
  @keyframes hero-soft-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
}

/* Each animated phrase owns its fill so compositing does not erase it. */
.hero-title:has(.hero-reveal-word) { background: none; -webkit-text-fill-color: currentColor; }
.hero-reveal-word { background: linear-gradient(180deg, #fff 0%, #a1a1a6 100%); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
