/* Signature opening: OK unfolds, then quietly dissolves into the settled page. */
.opening-sequence {
  --opening-muted:#62625c;
  position:fixed; z-index:1000; inset:0; display:grid; place-items:center;
  overflow:hidden; isolation:isolate; color:var(--ink); background:var(--paper);
  opacity:1;
  transition:opacity var(--opening-exit) cubic-bezier(.22,1,.36,1);
}
.opening-sequence:focus { outline:none; }
.opening-sequence.uses-fallback-type {
  --serif:Georgia,"Times New Roman",serif;
  --mono:"Courier New",monospace;
}
.opening-sequence::before {
  content:""; position:absolute; inset:0; pointer-events:none; opacity:.03;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='white' filter='url(%23g)' d='M0 0h160v160H0z'/%3E%3C/svg%3E");
}
.opening-title {
  position:relative; z-index:2; display:flex; flex-direction:column; align-items:center;
  max-width:calc(100% - 40px); margin-top:-2svh;
}
.opening-name {
  position:relative; display:flex; justify-content:center; align-items:baseline; gap:.035em;
  margin:0; font:400 clamp(3.2rem,13vw,13rem)/1.12 var(--serif);
  letter-spacing:-.065em; white-space:nowrap;
}
.opening-word { display:flex; align-items:baseline; }
.opening-initial {
  display:inline-block; opacity:0; transform:translateY(.18em);
}
.opening-tail { display:block; width:0; overflow:hidden; }
.opening-tail-text {
  display:block; width:max-content; padding-right:.045em;
  opacity:0; transform:translateX(-.12em); white-space:nowrap;
}
.opening-sequence.is-ready .opening-initial {
  animation:signature-initial .5s cubic-bezier(.16,1,.3,1) both;
  animation-delay:calc(.04s + var(--word-index) * .08s);
}
.opening-sequence.is-ready .opening-name {
  animation:signature-spacing .96s .72s cubic-bezier(.76,0,.24,1) both;
}
.opening-sequence.is-ready .opening-tail {
  animation:signature-unfold .9s cubic-bezier(.76,0,.24,1) both;
  animation-delay:calc(.72s + var(--word-index) * .055s);
}
.opening-sequence.is-ready .opening-tail-text {
  animation:signature-letters .82s cubic-bezier(.22,1,.36,1) both;
  animation-delay:calc(.79s + var(--word-index) * .055s);
}
.opening-caption {
  position:relative; margin-top:clamp(20px,2.8svh,28px); padding-top:16px;
}
/* A small editorial finish, drawn once as the name settles. */
.opening-caption::before {
  content:""; position:absolute; top:0; left:calc(50% - 14px);
  width:28px; height:1px; background:var(--accent);
  opacity:0; transform:scaleX(0); transform-origin:center;
}
.opening-sequence.is-ready .opening-caption::before {
  animation:signature-rule .5s 1.3s cubic-bezier(.22,1,.36,1) both;
}
.opening-caption p {
  margin:0; color:var(--opening-muted); font:400 10px/1.5 var(--mono);
  letter-spacing:.18em; text-transform:uppercase; opacity:0; transform:translateY(5px);
  transition:color .45s ease;
}
.opening-sequence.is-ready .opening-caption p {
  animation:signature-caption .45s 1.4s cubic-bezier(.22,1,.36,1) both;
}
.opening-sequence.is-leaving { opacity:0; pointer-events:none; }
/* An early skip holds the lettering in place while the overlay dissolves. */
.opening-sequence.is-ready.is-leaving *,
.opening-sequence.is-ready.is-leaving .opening-caption::before { animation-play-state:paused; }
.opening-sr-only {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
@keyframes signature-initial { to { opacity:1; transform:translateY(0); } }
@keyframes signature-unfold { from { width:0; } to { width:var(--tail-size,0px); } }
@keyframes signature-spacing { from { gap:.035em; } to { gap:.16em; } }
@keyframes signature-letters { to { opacity:1; transform:translateX(0); } }
@keyframes signature-caption { to { opacity:1; transform:translateY(0); } }
@keyframes signature-rule { to { opacity:.7; transform:scaleX(1); } }
/* No second entrance underneath the dissolve. Keep the existing layout still. */
/* A reading-position anchor, not an interactive control: avoid the browser's
   fragmented heading outline after restoring focus from the intro dialog. */
:is(h1,h2).intro-focus-anchor:focus { outline:none; }
.intro-complete .hero-cover,
.intro-complete .cover-scene-canvas,
.intro-complete .hero-profile-row,
.intro-complete .hero-copy { animation:none; }
@media (max-width:560px) {
  .opening-name { font-size:clamp(2.5rem,13vw,4.6rem); }
  .opening-caption { margin-top:20px; }
  .opening-caption p { font-size:9px; letter-spacing:.12em; }
}
@media (max-height:440px) {
  .opening-name { font-size:clamp(2.5rem,15vh,5rem); }
  .opening-caption { margin-top:12px; padding-top:12px; }
}
@media (prefers-reduced-motion:reduce) {
  .opening-sequence { display:none; }
  .opening-sequence *, .opening-sequence *::before { animation:none!important; transition:none!important; }
}
