/* Nicholas turns 10 — invitation pages (EN + UA share this file).
   Look: modern event invite — dark night sky with colour glows, big type, glass cards,
   a sticky action bar. The one showpiece is the "10" built from cubes on a floating
   block island (drawn by assets/app.js). */
:root {
  --bg: #0c0f24;
  --text: #f5f7ff;
  --muted: #b3badf;
  --card: rgba(34, 39, 74, 0.72);
  --line: rgba(255, 255, 255, 0.14);
  --green: #4be38a;
  --cyan: #58e6f0;
  --gold: #ffd23f;
  --violet: #7a5cff;
  --ink: #0c0f24;
  --font: "Geologica", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
  background:
    radial-gradient(34rem 26rem at 0% 0%, rgba(75, 227, 138, 0.26), transparent 65%),
    radial-gradient(34rem 28rem at 100% 12rem, rgba(122, 92, 255, 0.38), transparent 65%),
    radial-gradient(30rem 26rem at 20% 62rem, rgba(88, 230, 240, 0.14), transparent 65%),
    var(--bg);
  background-repeat: no-repeat;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.wrap {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- hero ---------- */
.hero-art {
  position: relative;
  height: min(46vh, 24rem);
  overflow: hidden;
}
.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 40%;
}
.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(12, 15, 36, 0) 40%, var(--bg) 100%);
}

.hero { position: relative; margin-top: -3.5rem; padding: 0 0 0.5rem; text-align: center; }

.hero h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.25rem, 10.5vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.jump {
  display: block;
  width: 100%;
  margin: 0.75rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.jump:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; border-radius: 1.5rem; }

.scene { display: block; animation: float 4.5s ease-in-out infinite alternate; }
.scene { position: relative; will-change: transform; }
.scene::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -0.25rem;
  height: 1.5rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
}
.scene svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}
.jump.is-launched .scene { animation: hop 0.7s 1; }

@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-0.75rem); }
}
@keyframes hop {
  0% { transform: translateY(0) scale(1.03, 0.95); }
  40% { transform: translateY(-2.25rem) scale(0.98, 1.04); }
  100% { transform: translateY(0) scale(1, 1); }
}

.hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.pills li {
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.9375rem;
  font-weight: 600;
}

.lead {
  margin: 1.25rem auto 0;
  max-width: 22rem;
  font-size: 1.125rem;
  color: var(--muted);
}

/* ---------- countdown ---------- */
.count { padding: 1.75rem 0 0.5rem; }
.count-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}
.count-row li {
  padding: 0.9rem 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--card);
}
.count-row b {
  display: block;
  font-weight: 800;
  font-size: 1.875rem;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
.count-row span { display: block; margin-top: 0.35rem; font-size: 0.8125rem; color: var(--muted); }
.count-done {
  margin: 0;
  text-align: center;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--gold);
}

/* ---------- content ---------- */
.content { padding: 1rem 0 1.5rem; }

.card {
  margin-top: 1rem;
  padding: 1.375rem 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  background: var(--card);
}

.card h2 {
  margin: 0 0 0.75rem;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.card p { margin: 0 0 0.75rem; }
.card p:last-child { margin-bottom: 0; }

.time {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.place { font-weight: 600; }
address { font-style: normal; color: var(--muted); margin-bottom: 0.75rem; }
.soft { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.125rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--green);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 0.08s;
}
.btn:active { transform: scale(0.96); }
.btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.gold { background: var(--gold); }

.free {
  border-color: rgba(75, 227, 138, 0.45);
  background: rgba(75, 227, 138, 0.12);
}
.free h2 { color: var(--green); }

.todo { margin: 0; padding-left: 1.4rem; }
.todo li { margin-bottom: 1rem; padding-left: 0.2rem; }
.todo li:last-child { margin-bottom: 0; }
.todo li::marker { font-weight: 800; color: var(--gold); }

/* invitation picture from the family */
.poster-band { padding-top: 1.5rem; }
.poster {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.75rem;
  border: 1px solid var(--line);
}

/* official game pictures used as decoration */
.card.has-pal { position: relative; margin-top: 2.5rem; }
.has-pal > .time,
.has-pal > h2 { margin-right: 5.75rem; }
.pal {
  position: absolute;
  top: -2rem;
  right: 0.5rem;
  width: 5.75rem;
  height: auto;
  --rot: 5deg;
  transform: rotate(var(--rot));
  filter: drop-shadow(0 0.75rem 1rem rgba(0, 0, 0, 0.45));
  pointer-events: none;
}
.pal.tile {
  top: -2rem;
  right: 1rem;
  width: 4.75rem;
  border-radius: 1rem;
  border: 3px solid var(--text);
  --rot: -6deg;
}
.pal.gift { top: -2.5rem; right: 0.75rem; width: 5rem; --rot: 8deg; }

/* small picture in front of a card title */
.h-ico {
  width: 2rem;
  height: 2rem;
  margin-right: 0.45rem;
  vertical-align: -0.45rem;
  object-fit: contain;
}

/* drawn decorations around the island */
.jump { position: relative; }
.deco {
  position: absolute;
  height: auto;
  pointer-events: none;
  will-change: transform;
}
.deco-balloons { top: -0.25rem; right: 0.25rem; width: 4.5rem; transform-origin: 50% 100%; }
.deco-monster { left: 0; bottom: 2.25rem; width: 5.5rem; }

.outro {
  position: relative;
  margin-top: 2rem;
  border-radius: 1.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
}
.outro img { display: block; width: 100%; aspect-ratio: 16 / 11; object-fit: cover; }
.outro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(12, 15, 36, 0) 35%, rgba(12, 15, 36, 0.9) 100%);
}
.outro p {
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.125rem;
  z-index: 1;
  margin: 0;
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.legal {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.bye {
  padding: 2.5rem 0 1rem;
  text-align: center;
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.bye p { margin: 0; }

/* ---------- sticky action bar ---------- */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: rgba(12, 15, 36, 0.78);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.bar .wrap { display: flex; gap: 0.625rem; }
.bar .btn { flex: 1 1 0; padding-left: 0.75rem; padding-right: 0.75rem; }

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* ---------- motion (only when app.js adds .motion: JS on, reduced motion off) ---------- */
.motion .hero-art img { translate: 0 var(--py, 0px); will-change: transform; animation: kenburns 16s ease-out both; }
@keyframes kenburns { from { scale: 1.2; } to { scale: 1.05; } }

.motion .hero h1 { animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s backwards; }
.motion .hint, .motion .lead { animation: fade 0.8s 1.7s backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(2rem); } }
@keyframes fade { from { opacity: 0; } }

/* the island and the "10" assemble cube by cube */
.motion .cube {
  animation: drop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.25) backwards;
  animation-delay: calc(var(--i) * 8ms + 350ms);
}
.motion .cube.floaty { animation-delay: 1.3s; }
@keyframes drop { from { opacity: 0; transform: translateY(-70px); } }

/* things fade and slide in when scrolled into view */
.motion .reveal {
  opacity: 0;
  transform: translateY(1.75rem) scale(0.96);
  transition: opacity 0.6s ease-out, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.motion .reveal.in { opacity: 1; transform: none; }

/* characters pop in a moment after their card */
.motion .reveal .pal {
  transform: rotate(28deg) scale(0);
  transition: transform 0.65s cubic-bezier(0.3, 1.6, 0.5, 1) 0.3s;
}
.motion .reveal.in .pal { transform: rotate(var(--rot)) scale(1); }

.motion .deco-balloons { animation: popIn 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) 1.5s backwards, sway 3.2s ease-in-out 2.1s infinite alternate; }
.motion .deco-monster { animation: popIn 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) 1.7s backwards, boing 0.9s cubic-bezier(0.3, 0, 0.7, 1) 2.3s infinite alternate; }
@keyframes popIn { from { opacity: 0; transform: scale(0); } }
@keyframes sway { from { transform: rotate(-5deg); } to { transform: rotate(6deg) translateY(-0.4rem); } }
@keyframes boing { from { transform: translateY(0) scale(1.06, 0.92); } to { transform: translateY(-1.4rem) scale(0.97, 1.04); } }

.motion .outro img { scale: 1.02; transition: scale 7s ease-out; }
.motion .outro.in img { scale: 1.14; }

.motion .count-row b.tick { animation: tick 0.35s ease-out; }
@keyframes tick { from { transform: translateY(-0.35em) scale(1.2); opacity: 0.4; } }

.motion .btn.gold { position: relative; }
.motion .btn.gold::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 3px solid var(--gold);
  pointer-events: none;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(1.18, 1.5); opacity: 0; }
}

.motion .bar { animation: barUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 1.4s backwards; }
@keyframes barUp { from { transform: translateY(110%); } }

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.ambient span {
  position: absolute;
  bottom: -2rem;
  opacity: 0.28;
  border-radius: 3px;
  animation: drift linear infinite;
}
@keyframes drift {
  to { transform: translateY(-115vh) rotate(260deg); }
}

@media (prefers-reduced-motion: reduce) {
  .scene, .jump.is-launched .scene { animation: none; }
}
