/* Jae Pop — marketing site. One stylesheet, no scripts, no web fonts.
   Cool page surfaces frame the app's six bubble colors and habitat palettes. */

:root {
  color-scheme: light dark;

  --ink: #294361;
  --ink-soft: #4b6380;
  --accent: #4968bc;
  --accent-drop: #3a55a0;
  --cream: #fff2d9;
  --lilac: #ede7ff;
  --petal: #ffe9ef;
  --mint: #287b68;
  --warm: #aa5b35;

  --sky-top: #deedf7;
  --sky-bottom: #edf0f8;
  --card: #ffffff;
  --card-edge: #d3dce9;
  --shadow: 0 12px 32px rgba(41, 67, 97, 0.13);
  --shadow-soft: 0 4px 14px rgba(41, 67, 97, 0.1);

  --red: #ff5466;
  --blue: #389eff;
  --yellow: #ffc929;
  --green: #3fcb6e;
  --purple: #a36bff;
  --orange: #ff8c2e;

  --radius: 28px;
  --page: 1120px;
  /* Safari gets Apple's rounded system font everywhere (ui-rounded). Other browsers can't reach
     it, so display text falls back to a heavy rounded face and body text to the system font. */
  --font: ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: ui-rounded, "Arial Rounded MT Bold", "Nunito", system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef2ff;
    --ink-soft: #c5cff0;
    --accent: #b2c6ff;
    --mint: #8bdbc4;
    --warm: #ffc49d;
    --sky-top: #1e2150;
    --sky-bottom: #3b3f8f;
    --card: rgba(255, 255, 255, 0.08);
    --card-edge: rgba(255, 255, 255, 0.16);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.25);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--sky-bottom);
  background-image: linear-gradient(180deg, var(--sky-top) 0, var(--sky-bottom) 900px);
  background-repeat: no-repeat;
}

img { max-width: 100%; height: auto; }

h1, h2, h3, .title, .tagline, .brand, .store, .mode .who, .world, summary,
.gallery figcaption, .contact .mail { font-family: var(--font-display); }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--page), 100% - 32px); margin-inline: auto; }

/* ── Header ───────────────────────────────────────────── */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 18px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none;
}
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: var(--shadow-soft); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.top nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink-soft); font-weight: 700; text-decoration: none;
}
.top nav a:hover { color: var(--accent); }
.brand { white-space: nowrap; }
@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: 4px 12px; padding-block: 12px; }
  .top nav { gap: 0 8px; font-size: 0.9rem; }
  .top nav .wide { display: none; }
}
@media (max-width: 360px) {
  .top nav { width: 100%; justify-content: space-between; }
}

/* ── Hero ─────────────────────────────────────────────── */

.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 32px;
  padding-block: 24px 56px;
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 8px; }
}

.title {
  margin: 0;
  font-size: clamp(3.6rem, 11vw, 6.6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #fff;
  /* The app's title: white letters, a dark hairline and a solid indigo drop. */
  text-shadow:
    0 0 2px rgba(41, 67, 97, 0.7),
    0 6px 0 var(--accent-drop),
    0 16px 26px rgba(41, 67, 97, 0.28);
}
@media (prefers-color-scheme: dark) {
  .title { text-shadow: 0 0 2px rgba(10, 12, 40, 0.8), 0 6px 0 #4968bc, 0 16px 26px rgba(0, 0, 0, 0.45); }
}

.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 0.9rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.tagline { margin: 20px 0 10px; font-size: clamp(1.35rem, 3.2vw, 1.75rem); font-weight: 800; }
.lead { margin: 0 0 26px; max-width: 34em; color: var(--ink-soft); font-size: 1.15rem; }
@media (max-width: 860px) { .lead { margin-inline: auto; } }
.explore {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 22px; padding: 12px 18px;
  min-height: 48px; border-radius: 999px; background: var(--card); border: 1px solid var(--card-edge);
  color: var(--ink); text-decoration: none; font-weight: 800; box-shadow: var(--shadow-soft);
}
.explore:hover { border-color: var(--accent); }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
@media (max-width: 860px) { .cta { justify-content: center; } }

.store {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 22px 12px 14px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 800; text-decoration: none;
  box-shadow: var(--shadow-soft);
}
@media (prefers-color-scheme: dark) { .store { background: #fff; color: #1e2150; } }
.store img { width: 34px; height: 34px; border-radius: 9px; }
.store small { display: block; font-size: 0.78rem; font-weight: 700; opacity: 0.75; line-height: 1.1; }
.store span { line-height: 1.15; }

.facts { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 860px) { .facts { justify-content: center; } }
.facts li {
  padding: 6px 12px; border-radius: 999px; font-size: 0.92rem; font-weight: 700;
  background: var(--card); border: 1px solid var(--card-edge); color: var(--ink-soft);
}

.stage { position: relative; display: grid; place-items: center; min-height: 520px; }
.stage .phone { width: min(270px, 70vw); transform: rotate(-3deg); }
@media (max-width: 860px) { .stage { min-height: 0; padding-block: 12px 24px; } }

/* ── Bubbles: the app's creatures, dressed like the game ── */

.bubble {
  --c: var(--blue);
  position: relative; display: grid; place-items: center;
  width: var(--size, 96px); aspect-ratio: 1; border-radius: 50%;
  /* Keep a full shell on Safari 15, which predates color-mix(). */
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.7) 0 9%, transparent 10%),
    radial-gradient(circle at 40% 30%, #fff, var(--c) 72%);
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.7) 0 9%, transparent 10%),
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--c) 80%, #fff), var(--c) 72%);
  box-shadow:
    inset 0 -7px 14px rgba(0, 0, 0, 0.13),
    inset 0 0 0 3px rgba(255, 255, 255, 0.35),
    0 10px 20px rgba(41, 67, 97, 0.18);
}
.bubble img { width: 86%; }
.bubble.red { --c: var(--red); }
.bubble.blue { --c: var(--blue); }
.bubble.yellow { --c: var(--yellow); }
.bubble.green { --c: var(--green); }
.bubble.purple { --c: var(--purple); }
.bubble.orange { --c: var(--orange); }

.float { position: absolute; z-index: 2; animation: bob var(--t, 6s) ease-in-out infinite; animation-delay: var(--d, 0s); }
.stage .phone { position: relative; z-index: 1; }
/* Positions live here, not in style attributes: the site's CSP allows no inline styles. */
.f1 { --size: 96px; --t: 6.5s; left: 0; top: 9%; }
.f2 { --size: 78px; --t: 5.6s; --d: -1.4s; right: 3%; top: 3%; }
.f3 { --size: 70px; --t: 7s; --d: -3s; right: 0; top: 47%; }
.f4 { --size: 90px; --t: 6.2s; --d: -2.2s; left: 3%; bottom: 9%; }
.f5 { --size: 62px; --t: 5.2s; --d: -0.6s; right: 12%; bottom: 3%; }
.f6 { --size: 58px; --t: 6.8s; --d: -4s; left: 8%; top: 47%; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}
@media (max-width: 860px) { .float { display: none; } }
@media (prefers-reduced-motion: reduce) { .float { animation: none; } }

/* ── Phones and tablets around the screenshots ───────────── */

.phone {
  margin: 0; aspect-ratio: 1320 / 2868; border-radius: 42px; overflow: hidden;
  border: 9px solid #18202e; background: #18202e; box-shadow: var(--shadow);
}
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tablet {
  margin: 0; aspect-ratio: 2064 / 2752; border-radius: 30px; overflow: hidden;
  border: 12px solid #18202e; background: #18202e; box-shadow: var(--shadow);
}
.tablet img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── Sections ─────────────────────────────────────────── */

section { padding-block: 48px; }
section[id] { scroll-margin-top: 24px; }
.section-head { max-width: 40em; margin: 0 auto 28px; text-align: center; }
.section-head h2 { margin: 0 0 10px; font-size: clamp(1.9rem, 4.4vw, 2.6rem); font-weight: 900; line-height: 1.12; }
.section-head p { margin: 0; color: var(--ink-soft); font-size: 1.12rem; }
@media (max-width: 640px) {
  main section:not(.hero) { padding-block: 32px; }
  .hero { padding-bottom: 32px; }
}

.card {
  background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

/* Three modes: the native play badges make each kind of play recognizable. */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.mode { padding: 26px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.mode > img { width: 132px; filter: drop-shadow(0 8px 14px rgba(41, 67, 97, 0.2)); }
.mode h3 { margin: 16px 0 2px; font-size: 1.7rem; font-weight: 900; }
.mode .who { margin: 0; min-height: 3.1em; font-weight: 800; color: var(--warm); }
.mode.kid .who { color: var(--accent); }
.mode.peekaboo .who { color: var(--mint); }
.mode ul { margin: 14px 0 0; padding-left: 1.2em; color: var(--ink-soft); text-align: left; }
.mode li { margin-block: 6px; }
.mode li strong { color: var(--ink); }
@media (max-width: 960px) {
  .modes { grid-template-columns: 1fr; max-width: 640px; margin-inline: auto; }
  .mode { display: grid; grid-template-columns: 112px 1fr; gap: 4px 20px; align-items: start; text-align: left; }
  .mode > img { grid-row: span 2; width: 112px; }
  .mode h3 { margin: 10px 0 0; }
  .mode .who { min-height: 0; }
  .mode ul { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .mode { grid-template-columns: 76px 1fr; padding: 22px; }
  .mode > img { width: 76px; }
}

/* Screenshot gallery: swipe on phones, a row of phones on wide screens */
.section-head .gallery-hint { margin-top: 10px; font-size: 0.95rem; font-weight: 700; }
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 22px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  padding: 10px max(16px, (100% - var(--page)) / 2) 26px;
  scrollbar-width: thin;
}
.gallery figure { margin: 0; scroll-snap-align: center; }
.gallery .phone { border-radius: 36px; border-width: 8px; }
.gallery figcaption { margin-top: 12px; text-align: center; font-weight: 800; font-size: 0.98rem; }
.gallery figcaption span { display: block; font-weight: 600; color: var(--ink-soft); font-size: 0.9rem; }

.ipad-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 18px; }
@media (max-width: 760px) { .ipad-row { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; } .ipad-row figure:not(:first-child) { display: none; } }

/* The seven habitats and four seasons. */
.worlds { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 980px) { .worlds { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .worlds { grid-template-columns: repeat(2, 1fr); } }
.world {
  display: grid; justify-items: center; gap: 8px; padding: 18px 10px 14px;
  border-radius: 24px; text-align: center; font-weight: 800; color: #294361;
  background: linear-gradient(180deg, var(--top), var(--bottom));
  border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: var(--shadow-soft);
}
.world img { width: 84px; filter: drop-shadow(0 6px 10px rgba(41, 67, 97, 0.22)); }
.world.dark { color: #fff; }
/* Each world's real sky, from World.swift and HabitatTheme.swift. */
.w-meadow { --top: #bfe6ff; --bottom: #fff4d9; }
.w-jungle { --top: #c9eedb; --bottom: #edf5ce; }
.w-desert { --top: #ffdfc2; --bottom: #fff1d9; }
.w-ocean { --top: #5fc3e6; --bottom: #cff5ea; }
.w-space { --top: #242451; --bottom: #635595; }
.w-night { --top: #3b3f8f; --bottom: #5d4f9f; }
.w-party { --top: #ffc9d9; --bottom: #ffe7c4; }
.world span { font-weight: 600; font-size: 0.85rem; }
.seasons-head { margin-top: 40px; }
.seasons-head h3 { margin: 0 0 10px; font-size: 1.6rem; font-weight: 900; }
.seasons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.seasons .world { padding-block: 22px 18px; }
.seasons .world img { width: 112px; }
.w-spring { --top: #c5eaf6; --bottom: #f7e7dc; }
.w-summer { --top: #bde9f4; --bottom: #f9edc5; }
.w-fall { --top: #f5ddbd; --bottom: #fff0db; }
.w-winter { --top: #c8e1ef; --bottom: #edf4f6; }
.season-note { max-width: 40em; margin: 22px auto 0; text-align: center; color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 640px) { .seasons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature {
  padding: 22px; display: grid; grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: min-content 1fr; gap: 4px 16px; align-items: start;
}
.feature .bubble { --size: 64px; grid-row: span 2; }
.feature h3 { margin: 4px 0 0; font-size: 1.15rem; font-weight: 800; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 1rem; }

/* Grown-ups */
.grownups { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
@media (max-width: 820px) { .grownups { grid-template-columns: 1fr; } }
.promise { padding: 30px; }
.promise h3, .parents h3 { margin: 0 0 14px; font-size: 1.5rem; font-weight: 900; }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 38px; font-weight: 700; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.05em;
  width: 26px; height: 26px; border-radius: 50%; background: #d9f3e3;
}
.checks li::after {
  content: ""; position: absolute; left: 10px; top: calc(0.05em + 5px);
  width: 6px; height: 12px; border: solid #22714e; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.parents { padding: 30px; }
.parents p { margin: 0 0 12px; color: var(--ink-soft); }
.parents p:last-child { margin-bottom: 0; }

/* Closing call to action */
.closing { text-align: center; padding: 40px 24px; }
.closing img.icon { width: 112px; border-radius: 26px; box-shadow: var(--shadow); }
.closing h2 { margin: 18px 0 6px; font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 900; }
.closing p { margin: 0 auto; max-width: 32em; color: var(--ink-soft); }

/* ── Footer ───────────────────────────────────────────── */

.foot { padding-block: 36px 48px; color: var(--ink-soft); font-size: 0.95rem; }
.foot .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); font-weight: 700; }
.foot .fine { margin: 14px 0 0; font-size: 0.85rem; opacity: 0.85; }

/* ── Text pages: privacy, terms, support ──────────────── */

.doc { max-width: 780px; margin: 8px auto 0; padding: clamp(24px, 5vw, 48px); }
.doc h1 { margin: 0 0 6px; font-size: clamp(2.1rem, 6vw, 2.8rem); font-weight: 900; line-height: 1.1; }
.doc .meta { margin: 0 0 22px; color: var(--ink-soft); font-weight: 700; }
.doc h2 { margin: 34px 0 10px; font-size: 1.35rem; font-weight: 900; }
.doc p, .doc li { color: var(--ink); }
.doc ul { padding-left: 1.3em; }
.doc li { margin-block: 6px; }
.doc .summary {
  margin: 0 0 8px; padding: 18px 20px; border-radius: 20px;
  background: rgba(63, 203, 110, 0.14);
  background: color-mix(in srgb, var(--green) 14%, transparent); font-weight: 700;
}
.contact {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px;
  margin: 22px 0 8px; padding: 20px 22px; border-radius: 22px;
  background: rgba(73, 104, 188, 0.12);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.contact .mail { min-width: 0; overflow-wrap: anywhere; font-size: clamp(1rem, 4vw, 1.25rem); font-weight: 800; }

details { border-top: 1px solid rgba(75, 99, 128, 0.24); border-top-color: color-mix(in srgb, var(--ink) 14%, transparent); padding-block: 4px; }
details:last-of-type { border-bottom: 1px solid rgba(75, 99, 128, 0.24); border-bottom-color: color-mix(in srgb, var(--ink) 14%, transparent); }
summary {
  cursor: pointer; list-style: none; padding: 14px 36px 14px 0; position: relative;
  font-weight: 800; font-size: 1.08rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 700; color: var(--accent);
}
details[open] summary::after { content: "–"; }
details p, details ol, details ul { margin-top: 0; color: var(--ink-soft); }

.notfound { text-align: center; padding-block: 60px 80px; }
.notfound .bubble { --size: 120px; margin: 0 auto 22px; }
.notfound h1 { margin: 0 0 8px; font-size: 2.4rem; font-weight: 900; }
.notfound p { color: var(--ink-soft); }

/* ── A gentle entrance as each part of the page comes into view ──
   All content is visible by default. Scroll timelines enhance modern browsers;
   older Safari keeps the static layout without JavaScript or scroll listeners.
   Text-bearing elements stay opaque so pausing mid-scroll never washes out copy. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .hero > div:first-child { animation: hello 650ms ease-out both; }
  .hero .stage { animation: hello 850ms ease-out both; }
  .explore { transition: transform 180ms ease, box-shadow 180ms ease; }
  .mode > img, .world img { transition: transform 240ms ease; }

  @supports (animation-timeline: view()) and (animation-range: entry 0% entry 50%) {
    .section-head {
      animation: heading-arrive 1s ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
    .mode, .feature, .grownups > .card, .closing, .ipad-row > figure {
      animation: card-arrive 1s ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 32%;
    }
    .world {
      animation: friend-arrive 1s ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }
    .gallery {
      animation: card-arrive 1s ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 25%;
    }
    .card:focus-within, .gallery:focus-within { animation: none; }
  }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .explore:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .mode:hover > img { transform: translateY(-3px) rotate(-2deg); }
  .world:hover img { transform: translateY(-4px); }
}
@keyframes hello {
  from { transform: translateY(12px); }
  to { transform: translateY(0); }
}
@keyframes heading-arrive {
  from { transform: translateY(clamp(10px, 2vw, 18px)); }
  to { transform: translateY(0); }
}
@keyframes card-arrive {
  from { transform: translateY(clamp(12px, 2.4vw, 24px)) scale(0.985); }
  to { transform: translateY(0) scale(1); }
}
@keyframes friend-arrive {
  0% { transform: translateY(clamp(10px, 2vw, 18px)) scale(0.94); }
  75% { transform: translateY(0) scale(1.015); }
  100% { transform: translateY(0) scale(1); }
}
@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
