/* Our Tiny Planet: the home page. The app's own colours (lib/theme/app_colors.dart),
   its fonts (Fraunces for titles, Nunito Sans for words) and its night sky. */
:root {
  --space-deep: #110a18;
  --space: #1b1026;
  --nebula: #3a2250;
  --surface: #2a1d3a;
  --line: #3d2c52;
  --star: #f7efe9;
  --muted: #cbbdd6;
  --gold: #e0b060;
  --rose: #e4869f;
  --ocean: #4a6ac0;
  --green: #3fa884;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--space-deep);
  background-image: linear-gradient(160deg, var(--space-deep) 0%, var(--space) 45%, var(--nebula) 100%);
  background-attachment: fixed;
  color: var(--star);
  font-family: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--rose); }
img { max-width: 100%; height: auto; }

/* The sky: a canvas of twinkling stars, and slow aurora light behind it. */
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: var(--ocean); top: -25vmax; right: -15vmax; }
.aurora span:nth-child(2) { background: var(--rose); bottom: -30vmax; left: -20vmax; opacity: 0.18; animation-duration: 32s; }
.aurora span:nth-child(3) { background: var(--green); top: 40%; left: 55%; width: 30vmax; height: 30vmax; opacity: 0.12; animation-duration: 38s; }
@keyframes drift { to { transform: translate(-8vmax, 6vmax) scale(1.15); } }

/* The bar along the top. */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 40px) 12px;
  background: #110a18b3;
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid #3d2c5255;
  transition: background .3s;
}
.top.scrolled { background: #110a18e6; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--star);
  text-decoration: none;
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  white-space: nowrap;
}
.brand img { border-radius: 8px; box-shadow: 0 0 14px #4a6ac080; }
.top nav { display: flex; gap: clamp(10px, 2.2vw, 26px); align-items: center; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 15px; transition: color .2s; }
.top nav a:hover { color: var(--star); }
.top nav .pill { color: var(--space); background: var(--gold); padding: 8px 16px; border-radius: 999px; }
.top nav .pill:hover { color: var(--space); filter: brightness(1.08); }

main { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
section { padding: clamp(56px, 9vw, 110px) 0; }
h2 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: clamp(32px, 5.4vw, 52px);
  line-height: 1.1;
  margin: 0 0 14px;
  text-align: center;
  text-wrap: balance;
}
h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; text-wrap: balance; }
.intro { max-width: 640px; margin: 0 auto 40px; text-align: center; color: var(--muted); font-size: 18px; }

/* ---------------------------------------------------------------- the hero */
.hero { text-align: center; padding-top: clamp(40px, 7vw, 80px); padding-bottom: 20px; }
.planet-wrap { position: relative; width: 168px; height: 168px; margin: 0 auto; }
.planet {
  width: 100%;
  height: 100%;
  border-radius: 38px;
  box-shadow: 0 0 60px #4a6ac0a6, 0 0 120px #e4869f40;
  animation: float 6s ease-in-out infinite;
}
.planet.small { width: 112px; height: 112px; border-radius: 26px; display: block; margin: 0 auto 18px; }
@keyframes float { 50% { transform: translateY(-12px) rotate(1.5deg); } }
.orbit { position: absolute; inset: -34px; border: 1px dashed #e0b06040; border-radius: 50%; animation: spin 18s linear infinite; }
.orbit span { position: absolute; color: var(--rose); font-size: 20px; text-shadow: 0 0 12px var(--rose); }
.orbit span:first-child { top: -12px; left: 50%; }
.orbit span:last-child { bottom: -12px; right: 30%; font-size: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }
.kicker { margin: 30px 0 0; color: var(--gold); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; font-size: 13px; }
/* The title as the app draws it (cream, gold and rose, a blue glow), shimmering slowly. */
.title {
  margin: 8px 0 8px;
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: clamp(50px, 11vw, 104px);
  line-height: 1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  background: linear-gradient(100deg, var(--star) 0%, var(--gold) 30%, var(--rose) 50%, var(--gold) 70%, var(--star) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px #4a6ac0b3);
  animation: shimmer 9s ease-in-out infinite;
}
@keyframes shimmer { 50% { background-position: 100% 0; } }
.lede { margin: 0; font-size: clamp(20px, 3.4vw, 27px); font-weight: 700; }
.sub { max-width: 640px; margin: 16px auto 0; color: var(--muted); font-size: 18px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.badge, .ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s;
}
.badge { background: var(--gold); color: var(--space); box-shadow: 0 10px 30px #e0b06059; }
.ghost { border: 1.5px solid var(--line); color: var(--star); background: #2a1d3a99; }
.badge:hover, .ghost:hover { transform: translateY(-2px); }
.ghost:hover { border-color: var(--gold); }

/* Phones: a frame round each screenshot. */
.phone {
  margin: 0;
  position: relative;
  border-radius: clamp(20px, 4vw, 42px);
  padding: clamp(5px, .9vw, 10px);
  background: linear-gradient(160deg, #46335f, #1a1226 60%);
  box-shadow: 0 40px 80px #00000099, 0 0 0 1px #ffffff1a inset, 0 0 60px #4a6ac026;
}
.phone img { display: block; width: 100%; height: auto; border-radius: clamp(15px, 3.2vw, 33px); }
.phones {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 54px auto 0;
  height: clamp(380px, 62vw, 640px);
  perspective: 1400px;
}
.phones .phone { position: absolute; width: clamp(150px, 25vw, 270px); transition: transform .8s var(--ease); will-change: transform; }
.p-mid { z-index: 2; width: clamp(170px, 28vw, 300px) !important; transform: translateY(-4%) rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)); }
.p-left { transform: translateX(-72%) translateY(6%) rotate(-7deg) rotateY(var(--ry, 0deg)); }
.p-right { transform: translateX(72%) translateY(6%) rotate(7deg) rotateY(var(--ry, 0deg)); }

/* Buildings drifting by. */
.marquee {
  overflow: hidden;
  border-block: 1px solid #3d2c5266;
  background: #1b102699;
  margin: 30px calc(-1 * clamp(16px, 4vw, 32px));
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.track { display: flex; gap: 14px; width: max-content; padding: 16px 0; animation: scroll 50s linear infinite; }
.track span { white-space: nowrap; padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; color: var(--muted); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Numbers. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; padding-top: 30px; }
.stat { text-align: center; padding: 26px 18px; border-radius: 24px; background: #2a1d3a99; border: 1px solid var(--line); }
.stat b {
  display: block;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(44px, 6vw, 60px);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px #e0b06059;
}
.stat span { display: block; margin-top: 8px; color: var(--muted); font-weight: 600; }

/* A day: a timeline whose line fills as you scroll. */
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 720px; position: relative; }
.timeline::before, .timeline::after {
  content: "";
  position: absolute;
  left: 92px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--line);
}
.timeline::after { background: linear-gradient(var(--gold), var(--rose)); transform-origin: top; transform: scaleY(var(--fill, 0)); box-shadow: 0 0 14px #e0b06080; }
.timeline li { display: grid; grid-template-columns: 70px 46px 1fr; gap: 0 14px; align-items: start; padding: 14px 0; position: relative; z-index: 1; }
.timeline time { text-align: right; padding-top: 10px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.timeline .dot {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  font-size: 22px;
  box-shadow: 0 0 0 6px var(--space-deep);
}
.timeline h3 { margin: 6px 0 2px; font-size: 21px; }
.timeline p { margin: 0; color: var(--muted); }

/* The tour: on wide screens a phone stays put while the stories scroll by. */
.tour-grid { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: clamp(30px, 6vw, 90px); align-items: start; }
.tour-phone { position: sticky; top: 100px; }
/* Never taller than the window, so the whole phone is always in view. */
.tour-phone .phone { width: min(100%, 340px, calc((100vh - 150px) * 600 / 1304)); margin: 0 auto; aspect-ratio: 600 / 1304; }
.tour-phone .phone img {
  position: absolute;
  inset: clamp(5px, .9vw, 10px);
  width: calc(100% - 2 * clamp(5px, .9vw, 10px));
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .7s var(--ease), transform 1.2s var(--ease);
}
.tour-phone .phone img.on { opacity: 1; transform: none; }
.story { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; padding: 30px 0; opacity: .35; transition: opacity .6s var(--ease); }
.story.active { opacity: 1; }
.story .tag { align-self: flex-start; padding: 6px 14px; border-radius: 999px; background: #e0b0601f; border: 1px solid #e0b06055; color: var(--gold); font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.story h3 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.12; margin: 14px 0 10px; }
.story p { color: var(--muted); font-size: 18px; max-width: 520px; margin: 0; }
.story .inline { display: none; }

/* Lands: a carousel you can swipe or nudge. */
.carousel {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 10px 4px 26px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel figure { flex: 0 0 auto; width: clamp(220px, 28vw, 300px); margin: 0; scroll-snap-align: center; text-align: center; transition: transform .5s var(--ease); }
.carousel figure:hover { transform: translateY(-8px) rotate(-1deg); }
/* Just the land: the middle of the screenshot, as a card. */
.carousel img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 52%; border-radius: 26px; box-shadow: 0 24px 48px #00000080, 0 0 0 1px #ffffff1a; display: block; }
.carousel figcaption { margin-top: 12px; font-family: Fraunces, Georgia, serif; font-size: 20px; }
.carousel-nav { display: flex; justify-content: center; gap: 12px; }
.carousel-nav button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--star);
  font-size: 20px;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.carousel-nav button:hover { border-color: var(--gold); transform: scale(1.06); }

/* The Couple Plan. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 820px; margin: 0 auto; }
.card { position: relative; padding: 30px 28px; border-radius: 28px; background: #2a1d3acc; border: 1px solid var(--line); }
.card h3 { margin: 0; font-size: 26px; }
.card .price { margin: 10px 0 0; font-family: Fraunces, Georgia, serif; font-size: 46px; line-height: 1; color: var(--star); }
.card .price small { font-size: 18px; color: var(--muted); }
.card .alt { margin: 6px 0 0; color: var(--muted); }
.card ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.card li { position: relative; padding-left: 28px; color: var(--muted); }
.card li::before { content: "✦"; position: absolute; left: 0; color: var(--gold); }
.card li strong { color: var(--star); }
.card .fine { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.card.glow { border-color: #e0b06099; box-shadow: 0 0 0 1px #e0b06055, 0 20px 60px #e0b06026; background: linear-gradient(160deg, #3a2a52cc, #2a1d3acc); }
.ribbon { position: absolute; top: -14px; right: 22px; padding: 6px 14px; border-radius: 999px; background: var(--rose); color: var(--space); font-weight: 800; font-size: 13px; }

/* Questions. */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 40px 18px 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 21px;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 14px; font-size: 26px; color: var(--gold); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--muted); }
.faq details[open] p { animation: open .45s var(--ease); }
@keyframes open { from { opacity: 0; transform: translateY(-6px); } }

/* The end: hearts rising. */
.finale { position: relative; text-align: center; overflow: hidden; border-radius: 40px; margin-bottom: 60px; padding: clamp(60px, 9vw, 100px) 20px; background: radial-gradient(80% 70% at 50% 100%, #3a2250, transparent); }
.rise { position: absolute; inset: 0; pointer-events: none; }
.rise i { position: absolute; bottom: -30px; color: var(--rose); font-style: normal; animation: up linear forwards; opacity: 0; }
@keyframes up { 10% { opacity: .9; } to { transform: translateY(-520px) rotate(25deg); opacity: 0; } }
.steps { list-style: none; padding: 0; margin: 26px auto 30px; max-width: 520px; display: grid; gap: 12px; text-align: left; }
.steps li { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 18px; background: #2a1d3acc; border: 1px solid var(--line); color: var(--muted); }
.steps b { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--space); }

.foot { text-align: center; padding: 40px 18px calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #3d2c5266; color: var(--muted); }
.foot img { border-radius: 9px; }
.foot p { margin: 8px 0; }
.foot nav { display: flex; gap: 22px; justify-content: center; }
.foot nav a { color: var(--star); text-decoration: none; font-weight: 700; }
.heart { color: var(--rose); }
.small { font-size: 13px; opacity: .75; }

/* Things glide in as they come into view (only with scripts on, so the page is
   whole without them). */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .phones .phone { opacity: 0; }
.js .phones.in .phone { opacity: 1; transition: transform .8s var(--ease), opacity 1s var(--ease); }
.js .phones.in .p-left { transition-delay: .15s; }
.js .phones.in .p-right { transition-delay: .3s; }

@media (max-width: 860px) {
  .top nav a:not(.pill) { display: none; }
  .tour-grid { display: block; }
  .tour-phone { display: none; }
  .story { min-height: 0; opacity: 1; text-align: center; align-items: center; padding: 34px 0; }
  .story .tag { align-self: center; }
  .story .inline { display: block; width: min(250px, 64vw); margin: 22px auto 0; border-radius: 30px; box-shadow: 0 30px 60px #00000099, 0 0 0 1px #ffffff1a; }
  .timeline::before, .timeline::after { left: 74px; }
  .timeline li { grid-template-columns: 52px 46px 1fr; gap: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .phones .phone { opacity: 1; transform: none; }
}
