/* iMessage Wrapped — landing page.
   Rest state: Messages on a Mac. White (or black), system type, one blue.
   Creative output (the song, the Wrapped cards) is the only thing with color,
   and when the song plays the color takes over the whole hero. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg2: #f2f2f7;
  --label: #000000;
  --label2: rgba(60, 60, 67, 0.62);
  --label3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.14);
  --blue: #007aff;
  --bubble: #e9e9eb;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.05);

  --live-bg: #c6ff3d;
  --live-ink: #0b0b0f;
  --live-pop: #ff2d78;
  --live-pop2: #2b4bff;

  --gutter: clamp(20px, 5vw, 48px);
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg2: #1c1c1e;
    --label: #ffffff;
    --label2: rgba(235, 235, 245, 0.62);
    --label3: rgba(235, 235, 245, 0.3);
    --sep: rgba(120, 120, 128, 0.36);
    --blue: #0a84ff;
    --bubble: #26252a;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--label);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; }

/* ---------- Buttons */

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 54px; padding: 0 28px; border-radius: 27px;
  background: var(--blue); color: #fff;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.5s ease, color 0.5s ease;
}
.pill:hover { filter: brightness(1.08); }
.pill:active { transform: scale(0.97); }
.pill:focus-visible, .play:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 50%, transparent); outline-offset: 3px; }
.pill.small { height: 34px; padding: 0 16px; font-size: 15px; }
.pill .apple { width: 19px; height: 19px; margin-top: -3px; }

/* ---------- Nav */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 var(--gutter);
  transition: background 0.3s ease, color 0.5s ease;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--sep);
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; margin: 0 -2px; }

/* ---------- The bloom: color taking over while the song plays */

.bloom {
  position: absolute; top: 0; left: 0; right: 0; height: var(--hero-h, 100vh); z-index: 0;
  background: var(--live-bg); overflow: hidden; pointer-events: none;
  clip-path: circle(0px at var(--x, 70%) var(--y, 50%));
  transition: clip-path 0.9s var(--ease);
}
.live .bloom { clip-path: circle(160vmax at var(--x, 70%) var(--y, 50%)); }
.shape { position: absolute; transform: scale(0) rotate(-40deg); transition: transform 0.8s var(--spring); }
.live .shape { transform: scale(1) rotate(0deg); }
.s1 { width: 34vmin; top: -8vmin; right: 6vw; fill: var(--live-pop); transition-delay: 0.1s; }
.s2 { width: 22vmin; bottom: 8%; left: 3vw; fill: var(--live-pop2); transition-delay: 0.2s; }
.s3 { width: 34vmin; top: 16%; left: 34%; stroke: var(--live-ink); transition-delay: 0.3s; }
.s4 { width: 30vmin; bottom: -1px; right: 26%; fill: #ffffff; transition-delay: 0.25s; }
.s5 { width: 20vmin; top: 46%; right: -6vmin; stroke: var(--live-pop2); transition-delay: 0.35s; }
.s6 { width: 22vmin; top: 11%; left: -5vmin; fill: #ffffff; transition-delay: 0.15s; }
.live .s2 { animation: spin 14s linear infinite 0.9s; }
.live .s1, .live .s5 { animation: pulse 0.714s ease-in-out infinite 0.9s; }
.live .s3 { animation: sway 2.8s ease-in-out infinite 0.9s; }
@keyframes spin { to { transform: scale(1) rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.08); } }
@keyframes sway { 50% { transform: translateX(3vmin) rotate(6deg); } }

/* ---------- Hero */

main { position: relative; z-index: 1; }
.hero {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: 132px var(--gutter) 88px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: clamp(32px, 6vw, 88px); align-items: center;
  min-height: min(100svh, 900px);
}
.eyebrow { font-size: 15px; font-weight: 600; color: var(--label2); margin-bottom: 18px; transition: color 0.5s ease; }
h1 {
  display: grid; font-size: clamp(44px, 6.2vw, 78px); line-height: 0.98; letter-spacing: -0.04em; font-weight: 700;
  text-wrap: balance; min-height: 2.94em; align-content: start;
}
h1 { transition: color 0.5s ease; }
h1 > span { grid-area: 1 / 1; transition: opacity 0.35s ease, transform 0.5s var(--ease); }
h1 .lyric { opacity: 0; transform: translateY(14px); font-weight: 900; color: var(--live-ink); }
.loud h1 .pitch { opacity: 0; transform: translateY(-14px); }
.loud h1 .lyric { opacity: 1; transform: none; }
.live .hero-copy h1 { color: var(--live-ink); }
h1 .lyric.swap { opacity: 0; transform: translateY(10px); transition-duration: 0.12s; }
.lede { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.42; color: var(--label2); max-width: 30em; margin-top: 22px; text-wrap: pretty; transition: color 0.5s ease; }
.cta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 32px; }
.cta-row.center { justify-content: center; }
.fine { font-size: 13px; color: var(--label2); transition: color 0.5s ease; }
.fine.legal { text-align: center; margin-top: 16px; }
.fine.legal a { color: inherit; text-underline-offset: 2px; }

.live .nav:not(.past) { color: var(--live-ink); }
.live .nav.scrolled:not(.past) { background: color-mix(in srgb, var(--live-bg) 82%, transparent); border-bottom-color: transparent; }
.live .eyebrow, .live .lede, .live .hero .fine { color: color-mix(in srgb, var(--live-ink) 72%, transparent); }
.live .hero .pill, .live .nav:not(.past) .pill { background: var(--live-ink); color: var(--live-bg); }

/* ---------- The thread */

.thread {
  background: var(--bg); color: var(--label);
  border-radius: 30px; box-shadow: var(--shadow); overflow: hidden;
  width: 100%; justify-self: end;
  transition: transform 0.6s var(--ease);
}
.live .thread { transform: rotate(-1.2deg) scale(1.01); }
.thread-head { text-align: center; padding: 18px 16px 12px; border-bottom: 0.5px solid var(--sep); background: color-mix(in srgb, var(--bg2) 60%, var(--bg)); }
.avatars { display: inline-flex; margin-bottom: 6px; }
.avatars i { width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 15px; font-weight: 600; border: 2px solid var(--bg); margin-left: -8px; }
.avatars i:first-child { margin-left: 0; }
.thread-name { font-size: 13px; font-weight: 600; }
.thread-sub { font-size: 11px; color: var(--label2); margin-top: 1px; }
.thread-body { padding: 16px 14px 18px; display: flex; flex-direction: column; gap: 3px; }

.msg { display: flex; flex-direction: column; max-width: 80%; margin-top: 6px; }
.msg.them { align-self: flex-start; align-items: flex-start; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .who { font-size: 11px; color: var(--label2); margin: 0 0 3px 13px; }
.bubble { position: relative; padding: 8px 13px; border-radius: 19px; font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; }
.them .bubble { background: var(--bubble); border-bottom-left-radius: 5px; }
.me .bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 5px; }
.tapback { position: absolute; top: -13px; right: -12px; width: 28px; height: 26px; border-radius: 14px; background: var(--bubble); border: 2px solid var(--bg); display: grid; place-items: center; font-size: 12px; }
.delivered { font-size: 11px; color: var(--label2); margin: 4px 4px 0 0; }

[data-step] { opacity: 0; transform: translateY(10px) scale(0.94); transform-origin: bottom left; transition: opacity 0.3s ease, transform 0.45s var(--spring); }
.me[data-step] { transform-origin: bottom right; }
[data-step].in { opacity: 1; transform: none; }

/* ---------- The song card: always in color */

.msg.card { max-width: 86%; width: 270px; }
.songcard { width: 100%; background: var(--live-bg); color: var(--live-ink); border-radius: 22px; border-bottom-right-radius: 6px; overflow: hidden; }
.cover { position: relative; aspect-ratio: 1.25; overflow: hidden; display: grid; place-items: center; }
.cover > svg, .cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.play {
  position: relative; width: 68px; height: 68px; border-radius: 50%;
  background: #fff; color: #0b0b0f; display: grid; place-items: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 0 0 5px rgba(11, 11, 15, 0.9); transition: transform 0.2s var(--spring);
}
.play:hover { transform: scale(1.07); }
.play:active { transform: scale(0.95); }
.play svg { width: 28px; height: 28px; }
.play::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 3px solid #fff; opacity: 0; animation: ring 2.2s ease-out infinite; }
.live .play::after { animation: none; }
@keyframes ring { 0% { transform: scale(0.85); opacity: 0.55; } 100% { transform: scale(1.35); opacity: 0; } }
.meta { padding: 12px 14px 14px; }
.card-lyric { font-size: 21px; font-weight: 900; letter-spacing: -0.035em; line-height: 1.04; text-wrap: balance; max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.5s var(--ease), opacity 0.2s ease, margin 0.5s var(--ease); }
.live .card-lyric { max-height: 3.2em; min-height: 2.1em; opacity: 1; margin-top: 12px; }
.live .card-lyric.swap { opacity: 0; }
.sound { position: absolute; left: 10px; top: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px 0 8px; border-radius: 15px; background: #0b0b0f; color: #fff; font-size: 13px; font-weight: 700; animation: nudge 1.8s ease-in-out infinite; }
.sound svg { width: 18px; height: 18px; }
.sound[hidden] { display: none; }
@keyframes nudge { 50% { transform: scale(1.06); } }
.song-title { font-size: 18px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.song-sub { font-size: 13px; font-weight: 600; opacity: 0.7; margin-top: 3px; font-variant-numeric: tabular-nums; }
.wave { display: flex; align-items: center; gap: 3px; height: 22px; margin-top: 10px; }
.wave i { flex: 1; max-width: 5px; border-radius: 3px; background: var(--live-ink); height: 30%; opacity: 0.85; }
.wave i:nth-child(3n) { height: 70%; } .wave i:nth-child(4n) { height: 100%; } .wave i:nth-child(5n) { height: 50%; } .wave i:nth-child(7n) { height: 85%; }
.live .wave i { animation: bars 0.714s ease-in-out infinite; }
.live .wave i:nth-child(2n) { animation-delay: -0.2s; } .live .wave i:nth-child(3n) { animation-delay: -0.4s; } .live .wave i:nth-child(5n) { animation-delay: -0.55s; }
@keyframes bars { 50% { transform: scaleY(0.35); } }

/* ---------- Sections */

.section { background: var(--bg); padding: clamp(72px, 10vw, 128px) var(--gutter); }
.section-head { max-width: var(--max); margin: 0 auto clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(34px, 4.8vw, 56px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance; max-width: 16em; }
.section-head p { font-size: clamp(18px, 1.6vw, 20px); line-height: 1.42; color: var(--label2); margin-top: 16px; max-width: 32em; text-wrap: pretty; }

/* Wrapped cards */
.wrapped { padding-inline: 0; overflow: hidden; }
.wrapped .section-head { padding-inline: var(--gutter); max-width: calc(var(--max) + 2 * var(--gutter)); }
.cards {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(74vw, 272px); gap: 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 16px max(var(--gutter), calc((100vw - var(--max)) / 2)) 36px;
}
.cards::-webkit-scrollbar { display: none; }
.wcard {
  position: relative; overflow: hidden; scroll-snap-align: center;
  aspect-ratio: 3 / 4.4; border-radius: 30px; padding: 24px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  transition: transform 0.5s var(--spring);
}
.wcard:nth-child(odd) { transform: rotate(-1.6deg); }
.wcard:nth-child(even) { transform: rotate(1.4deg) translateY(10px); }
@media (hover: hover) { .wcard:hover { transform: rotate(0) scale(1.03); } .wcard:hover .deco { transform: rotate(40deg) scale(1.08); } }
.wcard .deco { position: absolute; width: 75%; top: -12%; right: -18%; transition: transform 0.9s var(--ease); }
.wcard .big { font-size: 44px; font-weight: 900; line-height: 0.92; letter-spacing: -0.045em; position: relative; text-wrap: balance; }
.wcard .big.num { font-size: 60px; font-variant-numeric: tabular-nums; }
.wcard .s { font-size: 16px; font-weight: 600; line-height: 1.25; position: relative; text-wrap: pretty; }
.c-pink { background: #ff2d78; color: #fff; }
.c-blue { background: #2b4bff; color: #fff; }
.c-blue .deco { top: auto; bottom: 46%; right: -10%; }
.c-lime { background: #c6ff3d; color: #0b0b0f; justify-content: flex-start; }
.c-orange { background: #ff6a1f; color: #fff; }
.c-orange .deco { width: 110%; top: 12%; right: -20%; transform: rotate(-12deg); }
.c-ink { background: #0b0b0f; color: #fff; }
.c-ink .deco { width: 62%; top: 7%; right: 8%; }
.cast { list-style: none; margin-top: 18px; display: grid; gap: 13px; }
.cast li { display: grid; gap: 1px; }
.cast b { font-size: 26px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.cast span { font-size: 14px; font-weight: 700; opacity: 0.7; }

/* Steps */
.steplist { list-style: none; max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); }
.steplist .n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--bg2); font-size: 15px; font-weight: 600; margin-bottom: 18px; }
.steplist h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.steplist p { font-size: 17px; line-height: 1.42; color: var(--label2); margin-top: 8px; text-wrap: pretty; }

/* Genres */
.chips { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; border-radius: 999px;
  background: var(--bg2); font-size: clamp(17px, 2vw, 22px); font-weight: 600; letter-spacing: -0.02em; cursor: default; user-select: none;
  transition: background 0.25s ease, color 0.25s ease, transform 0.4s var(--spring);
}
.chip.lit { background: var(--c0); color: var(--c4); transform: rotate(var(--tilt, -2deg)) scale(1.06); }
@media (hover: hover) { .chip:hover { background: var(--c0); color: var(--c4); transform: rotate(var(--tilt, -2deg)) scale(1.06); } }

/* Privacy */
.convo { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 3px; }
.privacy .section-head { text-align: center; }
.privacy .section-head h2 { margin-inline: auto; }
.convo .bubble { font-size: 17px; }

/* Closing */
.closing .section-head { text-align: center; }
.closing .section-head h2, .closing .section-head p { margin-inline: auto; }

/* FAQ */
.faq { max-width: calc(760px + 2 * var(--gutter)); margin: 0 auto; }
.faq .section-head { margin-bottom: 20px; }
details { border-top: 0.5px solid var(--sep); }
details:last-of-type { border-bottom: 0.5px solid var(--sep); }
summary { list-style: none; cursor: pointer; padding: 20px 36px 20px 0; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; position: absolute; right: 6px; top: 26px; width: 9px; height: 9px; border-right: 2px solid var(--label3); border-bottom: 2px solid var(--label3); transform: rotate(45deg); transition: transform 0.25s ease; }
details[open] summary::after { transform: rotate(225deg) translate(-3px, -3px); }
details p { font-size: 17px; line-height: 1.5; color: var(--label2); padding: 0 0 22px; max-width: 38em; text-wrap: pretty; }

/* Footer */
.footer { background: var(--bg); position: relative; z-index: 1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 32px var(--gutter) max(32px, env(safe-area-inset-bottom)); font-size: 13px; color: var(--label2); border-top: 0.5px solid var(--sep); }
.footer nav { display: flex; gap: 20px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--label); }

/* Sticky phone CTA + toast */
.sticky-cta { display: none; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); z-index: 40; background: var(--label); color: var(--bg); padding: 12px 20px; border-radius: 22px; font-size: 15px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.35s var(--spring); max-width: calc(100vw - 40px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Plain document pages (privacy, terms) */
.doc { max-width: 680px; margin: 0 auto; padding: 120px var(--gutter) 96px; }
.doc h1 { display: block; min-height: 0; font-size: clamp(36px, 6vw, 52px); margin-bottom: 12px; }
.doc h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 36px 0 10px; }
.doc p, .doc li { font-size: 17px; line-height: 1.55; color: var(--label2); margin-bottom: 12px; }
.doc ul { padding-left: 22px; }
.doc .updated { font-size: 14px; }

/* ---------- Small screens */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 104px; padding-bottom: 64px; gap: 44px; min-height: 0; }
  h1 { min-height: 2.94em; }
  .thread { justify-self: center; max-width: 420px; }
  .steplist { grid-template-columns: 1fr; }
  .plan { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 16px; padding: 20px 22px; }
  .plan-price { grid-row: 1 / 3; grid-column: 2; font-size: 40px; margin: 0; }
  .plan-blurb { font-size: 15px; }
  .s3 { left: 10%; top: 40%; }
}

@media (max-width: 720px) {
  .hero .cta-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero .cta-row .fine { text-align: center; }
  .sticky-cta {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 30; padding: 12px var(--gutter) max(12px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--sep); transform: translateY(110%); transition: transform 0.4s var(--ease);
  }
  .sticky-cta.show { transform: none; }
  .sticky-cta .pill { width: 100%; }
  .footer { padding-bottom: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  [data-step] { opacity: 1; transform: none; }
}
