/*
  Raya Events — motion layer (RY-02 "The Table" + RY-04 "The Invitation").
  CSS only. To remove: delete the <link> to this file in index.html and apply.html
  (and the class="invite" on apply.html's <body>). Nothing else depends on it.
*/

/* ── RY-04: Apply → waitlist. The Apply button opens into the card (browsers
      without cross-page view transitions simply load the page as before). ── */
@view-transition { navigation: auto; }
.hero-main .btn-solid { view-transition-name: invite; }
body.invite #formCard { view-transition-name: invite; }
::view-transition-group(invite) { animation-duration: .75s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
::view-transition-old(invite), ::view-transition-new(invite) { height: 100%; object-fit: fill; animation-duration: .5s; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .6s; }

/* the waitlist page becomes the invitation: a cream card in the same dusk as the homepage */
body.invite { background: #0c0c0c; position: relative; }
body.invite::before { content: ''; position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(8,8,8,.82), rgba(8,8,8,.9)), url('/assets/hero.jpg') center 62% / cover no-repeat; }
body.invite > * { position: relative; z-index: 1; }
body.invite .wordmark, body.invite .nav a { color: #efe9db; }
body.invite .footer a, body.invite .footer span { color: #efe9db; opacity: .7; }
body.invite .footer a:hover { color: #efe9db; opacity: 1; }
body.invite .card { background: #efe9db; border-radius: 6px; padding: 3rem 2.6rem 2.6rem; max-width: 500px;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.7); }
body.invite .card input, body.invite .card textarea, body.invite .card .ig { border-bottom-color: #cfc8b6; }
body.invite .card input:focus, body.invite .card textarea:focus, body.invite .card .ig:focus-within { border-bottom-color: #0c0c0c; }
body.invite .card .ig input { border-bottom: none; }
body.invite .card button { color: #efe9db; }
@media (max-width: 640px) { body.invite .card { padding: 2.4rem 1.5rem 2rem; } }

@media (prefers-reduced-motion: no-preference) {
  /* ── RY-02: the hero opens on the dusk sky and tilts down to the table ── */
  .hero-bg { inset: -25% 0; will-change: transform; animation: ry-tilt 10s cubic-bezier(.45, 0, .2, 1) both; }
  @keyframes ry-tilt { from { transform: translateY(14%) scale(1.06); } to { transform: translateY(-11%) scale(1); } }
  .hero-logo, .hero-rule, .hero-tag span, .hero-main .btn-solid { opacity: 0; animation: ry-rise 1.4s cubic-bezier(.22, 1, .36, 1) forwards; }
  .hero-logo { animation-delay: .35s; }
  .hero-rule { animation-delay: 1s; }
  .hero-tag span { display: inline-block; }
  .hero-tag span:nth-child(1) { animation-delay: 1.5s; }
  .hero-tag span:nth-child(2) { animation-delay: 2.1s; }
  .hero-tag span:nth-child(3) { animation-delay: 2.7s; }
  .hero-main .btn-solid { animation-delay: 3.3s; }
  @keyframes ry-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

  /* ── RY-04: the invitation is written line by line; the reply settles in ── */
  body.invite #formCard .logo, body.invite #formCard h1, body.invite #formCard .lead,
  body.invite #formCard .field, body.invite #formCard button { opacity: 0; animation: ry-rise 1s cubic-bezier(.22, 1, .36, 1) forwards; }
  body.invite #formCard .logo { animation-delay: .35s; }
  body.invite #formCard h1 { animation-delay: .5s; }
  body.invite #formCard .lead { animation-delay: .65s; }
  body.invite #formCard .field:nth-of-type(1) { animation-delay: .85s; }
  body.invite #formCard .field:nth-of-type(2) { animation-delay: 1s; }
  body.invite #formCard .field:nth-of-type(3) { animation-delay: 1.15s; }
  body.invite #formCard .field:nth-of-type(4) { animation-delay: 1.3s; }
  body.invite #formCard button { animation-delay: 1.5s; }
  body.invite #doneCard { animation: ry-rise 1.1s cubic-bezier(.22, 1, .36, 1) both; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
