/* Background glows: slow drift, behind everything */
.glow { position: fixed; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; z-index: 0; will-change: transform; }
.glow-a { width: 46vmax; height: 46vmax; left: -14vmax; top: -16vmax; background: radial-gradient(circle, var(--teal), transparent 68%); animation: drift-a 26s ease-in-out infinite alternate; }
.glow-b { width: 52vmax; height: 52vmax; right: -18vmax; bottom: -22vmax; background: radial-gradient(circle, #7A2F63, transparent 68%); animation: drift-b 32s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-12vmax, -9vmax) scale(1.1); } }

.page {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: max(var(--space), env(safe-area-inset-top)) var(--space) max(var(--space), env(safe-area-inset-bottom));
  max-width: 78rem; margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: .7rem; color: var(--saffron); }
.wordmark { font-family: var(--font-display); font-size: var(--step-1); letter-spacing: .01em; color: var(--pearl); }

.hero {
  display: grid; align-items: center; gap: clamp(2rem, 6vw, 5rem);
  grid-template-columns: 1.15fr .85fr;
  padding-block: clamp(2rem, 6vh, 4rem);
}
.copy { max-width: 36rem; }

/* The memorable moment: letters rise once, then the corner tiles keep turning */
h1 { margin: 0 0 1.5rem; font-family: var(--font-display); font-weight: 400; line-height: .92; letter-spacing: -.02em; font-size: clamp(3.6rem, 12.5vw, 9rem); }
.word { display: block; white-space: nowrap; }
.word:last-child { color: var(--rose); font-style: italic; padding-left: .12em; }
.word i { display: inline-block; font-style: inherit; opacity: 0; transform: translateY(.55em) rotate(4deg); animation: rise 1.1s cubic-bezier(.2,.8,.2,1) forwards; }
.word:first-child i:nth-child(1) { animation-delay: .10s } .word:first-child i:nth-child(2) { animation-delay: .17s }
.word:first-child i:nth-child(3) { animation-delay: .24s } .word:first-child i:nth-child(4) { animation-delay: .31s }
.word:first-child i:nth-child(5) { animation-delay: .38s } .word:first-child i:nth-child(6) { animation-delay: .45s }
.word:last-child i:nth-child(1) { animation-delay: .62s } .word:last-child i:nth-child(2) { animation-delay: .69s }
.word:last-child i:nth-child(3) { animation-delay: .76s } .word:last-child i:nth-child(4) { animation-delay: .83s }
@keyframes rise { to { opacity: 1; transform: none; } }

.lede { margin: 0 0 .75rem; color: var(--pearl-dim); font-size: var(--step-1); line-height: 1.55; max-width: 30rem; opacity: 0; animation: fade 1s ease 1.3s forwards; }
.note { margin: 0; display: inline-flex; align-items: center; gap: .6rem; color: var(--saffron); opacity: 0; animation: fade 1s ease 1.6s forwards; }
.note::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; animation: pulse 2.4s ease-in-out infinite; }
@keyframes fade { to { opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.7); opacity: .45; } }

/* Corner tiles: nine quarter-circles turning in a staggered wave */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(.5rem, 1.4vw, .9rem); width: min(100%, 26rem); aspect-ratio: 1; justify-self: center; }
.tiles span { border-radius: 100% 0 0 0; transform-origin: 100% 100%; animation: turn 12s cubic-bezier(.7, 0, .2, 1) infinite; opacity: 0; animation-fill-mode: both; }
.tiles span:nth-child(3n+1) { background: var(--rose); }
.tiles span:nth-child(3n+2) { background: var(--saffron); }
.tiles span:nth-child(3n)   { background: var(--teal); }
.tiles span:nth-child(2), .tiles span:nth-child(4), .tiles span:nth-child(9) { background: var(--pearl); }
.tiles span:nth-child(1) { animation-delay: .9s }  .tiles span:nth-child(2) { animation-delay: 1.1s }
.tiles span:nth-child(3) { animation-delay: 1.3s } .tiles span:nth-child(4) { animation-delay: 1.0s }
.tiles span:nth-child(5) { animation-delay: 1.2s } .tiles span:nth-child(6) { animation-delay: 1.4s }
.tiles span:nth-child(7) { animation-delay: 1.1s } .tiles span:nth-child(8) { animation-delay: 1.3s }
.tiles span:nth-child(9) { animation-delay: 1.5s }
@keyframes turn {
  0%        { opacity: 1; transform: rotate(0deg); }
  18%       { opacity: 1; transform: rotate(0deg); }
  25%, 43%  { opacity: 1; transform: rotate(90deg); }
  50%, 68%  { opacity: 1; transform: rotate(180deg); }
  75%, 93%  { opacity: 1; transform: rotate(270deg); }
  100%      { opacity: 1; transform: rotate(360deg); }
}

.foot { color: var(--pearl-dim); font-size: .9rem; opacity: .8; }

/* Tablet and phone: tiles move above the copy, left-aligned throughout */
@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; align-content: center; }
  .tiles { order: -1; width: min(52vw, 14rem); justify-self: start; }
  h1 { font-size: clamp(3.4rem, 19vw, 7rem); }
}
@media (max-height: 34rem) and (orientation: landscape) { .tiles { display: none; } .hero { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .word i, .lede, .note, .tiles span { opacity: 1; transform: none; }
}
