/* ─── Intro: title animation → iMessage chat ─────────────
   Shown once per browser session on the home page.
   Uses the tokens from style.css (--bg, --gold, --pink…). */

html.intro-open { overflow: hidden; }
html.intro-off .intro { display: none; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 45%, rgba(155,114,255,0.28), transparent 70%),
    radial-gradient(40% 35% at 85% 10%, rgba(255,115,199,0.16), transparent 70%),
    radial-gradient(45% 40% at 10% 90%, rgba(81,168,255,0.14), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.4,0,.2,1);
}

.intro.leaving {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

/* Film grain */
.intro-grain {
  position: absolute;
  inset: -50%;
  opacity: 0.09;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.8s steps(3) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-3%, 2%); }
  66%  { transform: translate(2%, -3%); }
  100% { transform: translate(0, 0); }
}

/* ─── Shooting stars ─────────────────────────────────── */
.intro-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.intro-shoot {
  position: absolute;
  width: 150px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #fff, rgba(255,255,255,0.6) 20%, rgba(255,255,255,0));
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.9));
  transform-origin: 0 50%;
  opacity: 0;
  animation: intro-shoot var(--dur, 1.4s) linear forwards;
}

/* Travels head-first down and to the left */
@keyframes intro-shoot {
  0%   { opacity: 0; transform: rotate(var(--a)) translateX(0); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(-70vmax); }
}

/* ─── Stickers ───────────────────────────────────────── */
.intro-stickers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.8s ease, filter 0.8s ease;
}

.intro.chat .intro-stickers { opacity: 0.5; filter: saturate(0.85); }

/* Stickers in the middle column would sit on the chat, so they leave */
.intro.chat .sticker.c-hide { animation: none; opacity: 0; transition: opacity 0.3s ease; }

.sticker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 120px);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(0);
  opacity: 0;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.45));
}

.intro.play .sticker {
  animation:
    sticker-pop 0.7s cubic-bezier(.34,1.56,.64,1) forwards,
    sticker-float 6s ease-in-out infinite alternate;
  animation-delay: var(--d, 0.9s), calc(var(--d, 0.9s) + 0.7s);
}

@keyframes sticker-pop {
  to { transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1); opacity: 1; }
}

@keyframes sticker-float {
  from { transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1); opacity: 1; }
  to   { transform: translate(-50%, calc(-50% - 10px)) rotate(calc(var(--r, 0deg) * -0.6)) scale(1); opacity: 1; }
}

/* Round zodiac chips, like little stickers */
.chip {
  --s: 64px;
  display: grid;
  place-items: center;
  height: var(--s);
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--c, var(--pink));
  color: #1a1030;
  font-size: calc(var(--s) * 0.46);
  font-weight: 900;
  line-height: 1;
}

.emoji { --s: 56px; font-size: var(--s); line-height: 1; text-align: center; }

/* ─── Stage 1: title ─────────────────────────────────── */
.intro-title-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 16px;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.4,0,.2,1);
}

.intro.chat .intro-title-stage {
  opacity: 0;
  transform: translateY(-40px) scale(0.92);
  pointer-events: none;
}

.intro-eyebrow {
  font-weight: 900;
  font-size: clamp(12px, 1.6vw, 16px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(248,245,239,0.85);
  opacity: 0;
  transform: translateY(10px);
}

.intro.play .intro-eyebrow { animation: rise 0.5s ease forwards 0.1s; }

.intro-title {
  margin: 10px 0 18px;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.03em;
  font-size: clamp(54px, 13.5vw, 176px);
}

.intro-title .line { display: block; white-space: nowrap; }

.intro-title .ch {
  display: inline-block;
  color: #fff7ee;
  text-shadow:
    0 0 14px rgba(255,115,199,0.55),
    0 0 40px rgba(155,114,255,0.55),
    0 5px 0 rgba(26,16,48,0.6);
  opacity: 0;
  transform: translateY(45%) scale(0.35) rotate(var(--rot, 0deg));
}

/* One gradient across the whole word, split over its letters */
.intro-title .accent .ch {
  color: transparent;
  background: linear-gradient(100deg, var(--gold) 0%, #ffb35c 30%, var(--pink) 65%, var(--purple) 100%);
  background-size: calc(var(--n) * 100%) 100%;
  background-position: calc(var(--i) / (var(--n) - 1) * 100%) 0;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 16px rgba(255,115,199,0.55)) drop-shadow(0 5px 0 rgba(26,16,48,0.6));
}

.intro.play .intro-title .ch {
  animation: letter-in 0.65s cubic-bezier(.34,1.56,.64,1) forwards;
  animation-delay: calc(0.3s + var(--k) * 0.055s);
}

.intro.play .intro-title .accent {
  animation: glow-pulse 2.4s ease-in-out infinite alternate 1.4s;
}

@keyframes letter-in {
  to { opacity: 1; transform: none; }
}

@keyframes glow-pulse {
  from { filter: drop-shadow(0 0 0 rgba(244,200,74,0)); }
  to   { filter: drop-shadow(0 0 26px rgba(244,200,74,0.45)); }
}

.intro-tagline {
  font-weight: 800;
  font-size: clamp(14px, 2vw, 21px);
  color: #fde9ff;
  text-shadow: 0 0 18px rgba(255,115,199,0.6);
  opacity: 0;
  transform: translateY(10px);
}

.intro.play .intro-tagline { animation: rise 0.6s ease forwards 1.5s; }

@keyframes rise { to { opacity: 1; transform: none; } }

.intro-skip {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: 0;
  padding: 10px 16px;
  font: 800 12px/1 "Nunito", sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(248,245,239,0.45);
  cursor: pointer;
}

.intro-skip:hover { color: rgba(248,245,239,0.8); }

/* ─── Stage 2: chat ──────────────────────────────────── */
.intro-chat-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px 16px max(20px, env(safe-area-inset-bottom));
  opacity: 0;
  transform: translateY(40px);
  pointer-events: none;
  transition: opacity 0.55s ease 0.15s, transform 0.7s cubic-bezier(.22,1,.36,1) 0.15s;
}

.intro.chat .intro-chat-stage { opacity: 1; transform: none; pointer-events: auto; }

.intro-chat-heading {
  font-weight: 900;
  font-size: clamp(28px, 4.4vw, 46px);
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
}

.phone {
  width: min(400px, 100%);
  height: min(560px, calc(100dvh - 210px));
  min-height: 360px;
  display: flex;
  flex-direction: column;
  border-radius: 36px;
  background: #0b0b14;
  border: 7px solid #1d1b2e;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.08), 0 0 80px rgba(155,114,255,0.25);
  overflow: hidden;
}

.phone-head {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  padding: 10px 12px 8px;
  background: rgba(30,28,46,0.92);
  border-bottom: 1px solid var(--line);
}

.phone-back {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #0a84ff;
  font-size: 22px;
  line-height: 1;
}

.phone-back b {
  font: 800 12px/1 "Nunito", sans-serif;
  background: #0a84ff;
  color: #fff;
  border-radius: 999px;
  padding: 3px 7px;
}

.phone-contact { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.phone-contact img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(244,200,74,0.6);
}

.phone-contact span { font-size: 12px; font-weight: 700; color: var(--text); }
.phone-contact span::after { content: " ›"; color: var(--muted); }

.phone-video {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #0a84ff;
  transition: transform 0.15s ease;
}

.phone-video:hover { transform: scale(1.1); }

.phone-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  scrollbar-width: none;
}

.phone-body::-webkit-scrollbar { display: none; }

/* Without this the scrolling column squashes the link card to nothing */
.phone-body > * { flex-shrink: 0; }

.phone-meta {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.35;
}

.phone-meta b { font-weight: 700; }

.bubble {
  align-self: flex-start;
  max-width: 78%;
  padding: 8px 13px;
  border-radius: 19px;
  background: #26252f;
  color: #f4f2f8;
  font: 600 15px/1.35 -apple-system, system-ui, "Nunito", sans-serif;
  transform-origin: 0 100%;
  animation: bubble-in 0.35s cubic-bezier(.34,1.4,.64,1);
}

.bubble.from-me {
  align-self: flex-end;
  background: #0a84ff;
  color: #fff;
  transform-origin: 100% 100%;
}

@keyframes bubble-in {
  from { opacity: 0; transform: scale(0.6) translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.bubble.typing {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
}

.bubble.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8e8d98;
  animation: dot 1s ease-in-out infinite;
}

.bubble.typing i:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot {
  0%, 60%, 100% { opacity: 0.35; transform: none; }
  30%           { opacity: 1; transform: translateY(-3px); }
}

.bubble.card {
  padding: 0;
  overflow: hidden;
  width: 78%;
  text-decoration: none;
}

.bubble.card img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.bubble.card div { padding: 8px 12px 10px; }
.bubble.card strong { display: block; font-size: 13px; }
.bubble.card small { display: block; font-size: 12px; color: var(--muted); }




.intro-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.intro-actions a,
.intro-actions button {
  font: 900 15px/1 "Nunito", sans-serif;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.intro-get {
  background: linear-gradient(100deg, var(--gold), var(--pink));
  color: #1a1030;
  box-shadow: 0 8px 30px rgba(255,115,199,0.35);
}

.intro-enter {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.18);
}

.intro-actions a:hover,
.intro-actions button:hover { transform: translateY(-2px); }

.intro-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.intro-links a:hover { color: var(--text); }

/* ─── Phones ─────────────────────────────────────────── */
@media (max-width: 640px) {
  img.sticker { width: min(var(--s), 24vw); }
  .chip { --s: 44px; border-width: 3px; }
  .emoji { --s: 38px; }
  .m-hide { display: none; }
  .intro-chat-heading { display: none; }
  .intro.chat .intro-stickers { opacity: 0; }
  .phone { height: min(560px, calc(100dvh - 170px)); }
}

/* ─── Reduced motion: no animation, straight to the chat ─ */
@media (prefers-reduced-motion: reduce) {
  .intro *, .intro *::before, .intro *::after {
    animation: none !important;
    transition: none !important;
  }
  .intro .sticker { transform: translate(-50%, -50%) rotate(var(--r, 0deg)); opacity: 1; }
  .intro .ch, .intro-eyebrow, .intro-tagline { opacity: 1; transform: none; }
}
