/* hello is an original SVG gesture, with no external typeface or video. */
.hello-intro { display: none; }
html[data-intro] > body { overflow: hidden; }
html[data-intro] .hello-intro {
  display: grid; position: fixed; inset: 0; z-index: 100;
  place-items: center; min-height: 100svh; overflow: hidden;
  color: var(--paper); background: var(--night);
}
html[data-intro='running'] #main,
html[data-intro='gather'] #main,
html[data-intro] > body > .skip-link { visibility: hidden; }
.hello-intro::before {
  content: ''; position: absolute; inset: -20%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 48%, color-mix(in srgb, var(--green) 36%, transparent), transparent 52%);
}
.hello-intro__word { width: min(72vw, 680px); height: auto; overflow: visible; position: relative; }
.hello-intro__ink {
  fill: none; stroke: url(#hello-ink); stroke-width: 10;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: hello-write 2250ms cubic-bezier(.38,.05,.32,1) 150ms forwards;
}
.hello-intro__edge { stop-color: var(--gold); }
.hello-intro__center { stop-color: var(--paper); }
.hello-intro__footer {
  position: absolute; left: max(28px, env(safe-area-inset-left));
  right: max(28px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  color: var(--gray); font-size: 12px;
}
.hello-intro__signature { letter-spacing: .14em; font-size: 10px; }
.hello-intro__skip {
  border: 1px solid var(--line); background: transparent; color: var(--paper);
  min-height: 44px; padding: 0 18px; border-radius: 999px; font: inherit;
  cursor: pointer; transition: background 180ms, border-color 180ms;
}
.hello-intro__skip:hover { background: var(--control); border-color: var(--gold); }
.hello-intro__skip:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
.hello-intro__skip:active { background: var(--green); }
html[data-intro='leaving'] .hello-intro { animation: hello-leave 650ms ease-in-out forwards; pointer-events: none; }
html[data-intro='leaving'] .hello-intro__word { animation: hello-lift 650ms cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes hello-write { to { stroke-dashoffset: 0; } }
@keyframes hello-leave { to { opacity: 0; visibility: hidden; } }
@keyframes hello-lift { to { transform: translateY(-12px) scale(1.035); } }
@media (max-width: 600px) {
  .hello-intro__word { width: 88vw; }
  .hello-intro__footer { left: max(20px, env(safe-area-inset-left)); right: max(20px, env(safe-area-inset-right)); }
}
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  html[data-intro] .hello-intro { display: none; }
  html[data-intro] #main, html[data-intro] > body > .skip-link { visibility: visible; }
}

/* Soft bloom: the written hello is drawn into a point at Paopao, which blooms into a diffuse
   lilac glow while the curtain fades and the homepage settles in. No rings, particles or flashes. */
html[data-intro='bloom'] .hello-intro { pointer-events: none; animation: hello-curtain 750ms cubic-bezier(.33,0,.2,1) both; }
@keyframes hello-curtain { to { opacity: 0; visibility: hidden; } }
.hello-intro__word { --gx: 0px; --gy: 0px; }
html[data-intro='gather'] .hello-intro__word {
  transition: transform 520ms cubic-bezier(.45,0,.55,1), opacity 520ms ease-in, filter 520ms ease-in;
  transform: translate(var(--gx), var(--gy)) scale(.12); opacity: 0; filter: blur(3px);
}
html[data-intro='gather'] .hello-intro__signature { opacity: 0; transition: opacity .3s; }
.hello-intro__core {
  position: fixed; left: var(--x); top: var(--y); pointer-events: none;
  width: 30vmin; height: 30vmin; margin: -15vmin 0 0 -15vmin; border-radius: 50%;
  background: radial-gradient(circle, #f6efffcc 0, #e3d2ff99 10%, #c3a0ff52 26%, #9b6ef021 46%, transparent 68%);
  animation: hello-core 560ms cubic-bezier(.45,0,.55,1) both;
}
@keyframes hello-core { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* The shared bloom layer (also used by Paopao's easter egg and the replay button). */
.sunyl-bloom { position: fixed; inset: 0; z-index: 101; pointer-events: none; overflow: hidden; contain: strict; }
.sunyl-bloom > span { position: absolute; left: var(--x); top: var(--y); }
.sunyl-bloom__glow {
  width: 120vmin; height: 120vmin; margin: -60vmin 0 0 -60vmin; border-radius: 50%;
  background: radial-gradient(circle, #f4ecffb3 0, #dcc8ff80 12%, #b994fb4d 28%, #8f5ee82b 44%, #7c3aed12 56%, transparent 70%);
  animation: sunyl-bloom 1250ms cubic-bezier(.22,.8,.3,1) both;
}
.sunyl-bloom.is-compact .sunyl-bloom__glow { width: 150vmin; height: 150vmin; margin: -75vmin 0 0 -75vmin; }
.sunyl-bloom.is-reveal .sunyl-bloom__glow { animation-name: sunyl-reveal; animation-duration: 1900ms; animation-timing-function: linear; }
.sunyl-bloom.is-pulse .sunyl-bloom__glow { animation-name: sunyl-pulse; animation-duration: 950ms; animation-timing-function: cubic-bezier(.33,0,.3,1); }
.sunyl-bloom__pen {
  left: var(--px); top: var(--py); width: 3.4vmin; height: 3.4vmin; margin: -1.7vmin 0 0 -1.7vmin; border-radius: 50%;
  background: radial-gradient(circle, #fff 0, #eadbff 30%, #b98aff66 55%, transparent 72%);
  animation: sunyl-pen 1000ms cubic-bezier(.45,0,.2,1) 1000ms both;
}
@keyframes sunyl-bloom {
  from { transform: scale(calc(.25 * var(--s))); opacity: .95; }
  45% { opacity: .8; }
  to { transform: scale(calc(1.15 * var(--s))); opacity: 0; }
}
@keyframes sunyl-pulse {
  from { transform: scale(calc(.2 * var(--s))); opacity: 0; }
  35% { transform: scale(calc(.6 * var(--s))); opacity: .75; }
  to { transform: scale(calc(.9 * var(--s))); opacity: 0; }
}
/* Intro reveal: swell to a peak at ~30%, then fade while the halo and the cat settle (same 1.9s). */
@keyframes sunyl-reveal {
  from { transform: scale(.25); opacity: .95; animation-timing-function: cubic-bezier(.22,.61,.36,1); }
  30% { transform: scale(.82); opacity: .85; animation-timing-function: cubic-bezier(.4,0,.3,1); }
  to { transform: scale(.95); opacity: 0; }
}
@keyframes sunyl-pen {
  from { transform: translateX(0) scale(.4); opacity: 0; }
  10% { opacity: 1; transform: translateX(0) scale(1); }
  92% { opacity: 1; }
  to { transform: translateX(var(--pw)) scale(.6); opacity: 0; }
}

/* The homepage the bloom reveals (about 2.25s, then plain CSS state). Paopao condenses out of
   the light over 1.9s from the first frame of the bloom: blur, scale and brightness settle on one
   long ease-out while opacity rises a little behind the glow's peak. No spring or overshoot. */
html[data-intro='bloom'] .hero-model-poster,
html[data-intro='bloom'] .hero-model-canvas {
  animation: bloom-cat-fade 1900ms cubic-bezier(.45,.05,.35,1) both, bloom-cat-settle 1900ms cubic-bezier(.22,.61,.36,1) both;
}
html[data-intro='bloom'] .model-shadow { animation: bloom-fade 1900ms cubic-bezier(.45,.05,.35,1) both; }
html[data-intro='bloom'] .hero-model::before { animation: bloom-aura 1900ms cubic-bezier(.22,.61,.36,1) both; }
html[data-intro='bloom'] .hero #hero-title { animation: bloom-write 1000ms cubic-bezier(.45,0,.2,1) 1000ms both; }
html[data-intro='bloom'] .hero-heading .eyebrow { animation: bloom-rise 700ms cubic-bezier(.22,.8,.3,1) 900ms both; }
html[data-intro='bloom'] .hero-intro { animation: bloom-rise 700ms cubic-bezier(.22,.8,.3,1) 1350ms both; }
html[data-intro='bloom'] .cabinet-handles a { animation: bloom-spring 760ms cubic-bezier(.25,.8,.3,1) 1250ms both; }
html[data-intro='bloom'] .cabinet-handles a:nth-child(2) { animation-delay: 1320ms; }
html[data-intro='bloom'] .cabinet-handles a:nth-child(3) { animation-delay: 1390ms; }
html[data-intro='bloom'] .cabinet-handles a:nth-child(4) { animation-delay: 1460ms; }
html[data-intro='bloom'] .site-header,
html[data-intro='bloom'] .hero-foot,
html[data-intro='bloom'] .model-label { animation: bloom-fade 600ms ease-out 1500ms both; }
@keyframes bloom-cat-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bloom-cat-settle {
  from { transform: scale(1.03); filter: blur(14px) brightness(1.4); }
  to { transform: none; filter: blur(0) brightness(1); }
}
/* The bloom recedes into the resting halo; it ends exactly where the breathing aura starts. */
@keyframes bloom-aura {
  from { opacity: 1; transform: translate(-50%,-50%) scale(1.6); filter: brightness(1.8); }
  to { opacity: .75; transform: translate(-50%,-50%) scale(.97); filter: none; }
}
@keyframes bloom-write { from { clip-path: inset(-40% 100% -40% -10%); } to { clip-path: inset(-40% -10% -40% -10%); } }
@keyframes bloom-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes bloom-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bloom-spring {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
  65% { opacity: 1; transform: translateY(-2px) scale(1.005); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  .sunyl-bloom, .hello-intro__core { display: none; }
  html[data-intro] .hero-model-poster, html[data-intro] .hero-model-canvas, html[data-intro] .hero #hero-title,
  html[data-intro] .cabinet-handles a, html[data-intro] .hero-model::before { animation: none; }
}

/* Whole-word gather: hello fades and softens as one piece while it travels, and is gone before it
   reaches the light point, so the point never swallows the last letter first (no "hell" frame).
   The point itself waits a beat, then condenses where the word disappeared. */
html[data-intro='gather'] .hello-intro__word {
  transition: transform 520ms cubic-bezier(.33,0,.25,1), opacity 320ms cubic-bezier(.4,0,.6,1), filter 320ms cubic-bezier(.4,0,.6,1);
}
html[data-intro='gather'] .hello-intro__core { animation: hello-core 400ms cubic-bezier(.45,0,.55,1) 200ms both; }
