/* Paperwing: the game's own palette and type. Baloo 2 is self-hosted (no font requests to third parties). */
@font-face {
  font-family: "Baloo 2";
  src: url("/assets/fonts/Baloo2-Variable.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --sky: #bfe7ff;
  --blush: #ffe3f1;
  --ink: #3f3358;
  --ink-soft: #6a5d85;
  --star: #ffd84d;
  --fly: #ff7eb6;
  --fly-deep: #e45c97;
  --paper: #fffaf5;
  --night: #262a57;

  --display: "Baloo 2", ui-rounded, system-ui, sans-serif;
  --body: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.9rem;
  --step-0: 1.0625rem;
  --step-1: 1.35rem;
  --step-2: 1.8rem;
  --step-3: 2.6rem;
  --step-4: clamp(3.4rem, 11vw, 7.5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip; /* nothing wider than the screen (the loop, the flying plane) may let phones pan sideways */
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: var(--fly-deep); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--fly); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.5rem 1rem; z-index: 10; }

/* ---------- Top bar ---------- */
.bar {
  position: absolute; inset: 0 0 auto 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
}
.bar .brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-weight: 800;
  font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.bar .brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 3px 0 rgba(63, 51, 88, 0.15); }
.bar nav { display: flex; gap: 1.4rem; font-weight: 600; }
.bar nav a { color: var(--ink); text-decoration: none; }
.bar nav a:hover { color: var(--fly-deep); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(100svh, 920px);
  display: grid; place-items: center;
  padding: 7rem 1.25rem 5rem;
  background: linear-gradient(var(--sky), var(--blush));
  text-align: center;
}
.cloud { position: absolute; width: 260px; height: 90px; border-radius: 90px; background: #fff; opacity: 0.85; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 120px; height: 120px; left: 40px; top: -60px; }
.cloud::after { width: 90px; height: 90px; left: 130px; top: -40px; }
.cloud.c1 { left: -60px; top: 22%; transform: scale(0.9); }
.cloud.c2 { right: -40px; top: 58%; transform: scale(1.2); }
.cloud.c3 { left: 55%; top: 12%; transform: scale(0.55); opacity: 0.6; }

.hero-inner { position: relative; z-index: 2; max-width: 60rem; }
.loop { position: absolute; z-index: 1; left: 50%; top: 50%; width: min(1100px, 130vw); translate: -50% -58%; }

/* The title as the game draws it: each letter its own color, a thick white sticker outline. */
.title { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.title span { display: inline-block; -webkit-text-stroke: 0.14em #fff; paint-order: stroke fill;
  text-shadow: 0 0.06em 0 rgba(63, 51, 88, 0.18); }
.title span:nth-child(1) { color: #ff8cbf; } .title span:nth-child(2) { color: #7cc4ff; }
.title span:nth-child(3) { color: #b38cff; } .title span:nth-child(4) { color: #62cfa0; }
.title span:nth-child(5) { color: #ffb45c; } .title span:nth-child(6) { color: #ff8cbf; }
.title span:nth-child(7) { color: #7cc4ff; } .title span:nth-child(8) { color: #b38cff; }
.title span:nth-child(9) { color: #62cfa0; }
.hero .lede { margin: 1.2rem auto 0; max-width: 34ch; font-size: var(--step-1); font-weight: 600; line-height: 1.35; }
.cta { display: inline-flex; align-items: center; gap: 0.7rem; margin-top: 2rem; padding: 0.95rem 1.8rem;
  border-radius: 999px; background: var(--fly); color: #fff; font-family: var(--display); font-weight: 800;
  font-size: 1.3rem; text-decoration: none; box-shadow: 0 5px 0 var(--fly-deep); }
.cta:hover { color: #fff; transform: translateY(1px); box-shadow: 0 4px 0 var(--fly-deep); }
.cta[aria-disabled="true"] { cursor: default; }
.cta svg { width: 1.4em; height: 1.4em; }
.fineprint { margin-top: 0.9rem; font-size: var(--step--1); color: var(--ink-soft); font-weight: 600; }

/* ---------- How to fly ---------- */
.how { background: var(--blush); padding: 5rem clamp(1.25rem, 5vw, 4rem); }
.how h2, .parents h2, .houses-intro h2 { font-size: var(--step-3); }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3.5rem);
  max-width: 68rem; margin: 2.5rem auto 0; }
.how-inner { max-width: 68rem; margin: 0 auto; }
.how figure { margin: 0; }
.how figure svg { width: 100%; max-width: 13rem; height: auto; margin-bottom: 1rem; }
.how h3 { font-size: var(--step-1); margin-bottom: 0.4rem; }
.how p { color: var(--ink-soft); max-width: 30ch; }

/* ---------- Houses: the flight ---------- */
.houses { position: relative; background: var(--sky); overflow-x: clip; }
.houses-intro { padding: 5rem clamp(1.25rem, 5vw, 4rem) 3rem; max-width: 68rem; margin: 0 auto; }
.houses-intro p { margin-top: 0.8rem; max-width: 52ch; font-size: var(--step-1); line-height: 1.4; }

.flight { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.flight svg.trail { position: absolute; inset: 0; width: 100%; height: 100%; }
.flight .trail path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0.1 16;
  vector-effect: non-scaling-stroke; opacity: 0.95; }
.flight .plane { position: absolute; left: 0; top: 0; width: 110px; will-change: transform; filter: drop-shadow(0 8px 6px rgba(63, 51, 88, 0.22)); }

.house {
  --wall: #ddd0f7;
  position: relative;
  min-height: 60vh;
  display: flex; align-items: center;
  padding: 4rem clamp(1.25rem, 6vw, 6rem);
  background-color: var(--wall);
  background-size: 64px 64px;
}
.house:nth-of-type(even) { justify-content: flex-end; }
.house-card { position: relative; z-index: 4; max-width: 26rem; }
.house .emoji { display: grid; place-items: center; width: 5.5rem; height: 5.5rem; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); font-size: 2.9rem; box-shadow: 0 5px 0 rgba(63, 51, 88, 0.12); }
.house .num { margin-top: 1.1rem; font-family: var(--display); font-weight: 700; color: var(--ink-soft); }
.house h3 { font-size: var(--step-3); margin-top: 0.1rem; }
.house p { margin-top: 0.6rem; font-size: var(--step-1); line-height: 1.4; }
.house .free { display: inline-block; margin-top: 0.9rem; padding: 0.2rem 0.8rem; border-radius: 999px;
  background: var(--star); font-weight: 700; font-size: var(--step--1); }

/* Wallpapers, drawn like the game's, in translucent white over each house's wall color. */
.p-stars { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='%23fff' fill-opacity='.5'%3E%3Cpath d='M16 7l2.6 5.3 5.8.8-4.2 4.1 1 5.8L16 20.3l-5.2 2.7 1-5.8-4.2-4.1 5.8-.8z'/%3E%3Cpath d='M48 39l2.6 5.3 5.8.8-4.2 4.1 1 5.8L48 52.3l-5.2 2.7 1-5.8-4.2-4.1 5.8-.8z'/%3E%3Ccircle cx='48' cy='15' r='2'/%3E%3Ccircle cx='15' cy='49' r='2'/%3E%3C/g%3E%3C/svg%3E"); }
.p-waves { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M0 16c8-8 24-8 32 0s24 8 32 0M0 48c8-8 24-8 32 0s24 8 32 0' fill='none' stroke='%23fff' stroke-opacity='.55' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.p-diamonds { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M32 8l16 24-16 24-16-24z' fill='%23fff' fill-opacity='.45'/%3E%3C/svg%3E"); }
.p-boards { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='%23fff' fill-opacity='.4'%3E%3Crect x='0' width='3' height='64'/%3E%3Crect x='32' width='3' height='64'/%3E%3Ccircle cx='10' cy='6' r='1.6'/%3E%3Ccircle cx='42' cy='58' r='1.6'/%3E%3C/g%3E%3C/svg%3E"); }
.p-grid { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M0 .5h32M.5 0v32' stroke='%23fff' stroke-opacity='.8' stroke-width='1.5'/%3E%3C/svg%3E"); background-size: 32px 32px; }
.p-stripes { background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0 30px, transparent 30px 64px); }
.p-gingham { background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 16px, transparent 16px 32px),
  repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.35) 0 16px, transparent 16px 32px); background-size: auto; }
.p-brick { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='32'%3E%3Cpath d='M0 1h64M0 17h64M1 1v16M33 17v16' stroke='%23fff' stroke-opacity='.18' stroke-width='2'/%3E%3C/svg%3E"); background-size: 64px 32px; }
.p-panels { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.14' stroke-width='3'%3E%3Crect x='6' y='6' width='68' height='68' rx='3'/%3E%3Crect x='16' y='16' width='48' height='48' rx='2'/%3E%3C/g%3E%3C/svg%3E"); background-size: 80px 80px; }
.p-rivets { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='%23fff' fill-opacity='.7'%3E%3Crect y='31' width='64' height='2'/%3E%3Crect x='31' width='2' height='64'/%3E%3Ccircle cx='8' cy='8' r='2'/%3E%3Ccircle cx='24' cy='8' r='2'/%3E%3Ccircle cx='40' cy='40' r='2'/%3E%3Ccircle cx='56' cy='40' r='2'/%3E%3C/g%3E%3C/svg%3E"); }
.p-leaves { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='%23fff' fill-opacity='.45'%3E%3Cellipse cx='16' cy='17' rx='9' ry='4.5' transform='rotate(-35 16 17)'/%3E%3Cellipse cx='48' cy='49' rx='9' ry='4.5' transform='rotate(40 48 49)'/%3E%3C/g%3E%3C/svg%3E"); }

/* The two night houses: the moonlit version of their walls, stars outside. */
.house.night { color: #f3efff; }
.house.night .num { color: #c9c2ea; }
.house.night .emoji { background: rgba(255, 255, 255, 0.14); }
.house.night::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(1.5px 1.5px at 12% 20%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 37% 70%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 68% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 84% 76%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 55% 12%, #fff 50%, transparent 51%);
  opacity: 0.8; }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 38%; pointer-events: none; opacity: 0.9; }

/* ---------- For parents ---------- */
.parents { background: var(--paper); padding: 6rem clamp(1.25rem, 5vw, 4rem); }
.parents-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(2rem, 6vw, 6rem);
  max-width: 68rem; margin: 0 auto; align-items: start; }
.parents .sub { margin-top: 1rem; color: var(--ink-soft); font-size: var(--step-1); line-height: 1.4; max-width: 24ch; }
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.4rem; }
.promises li { display: grid; grid-template-columns: 2rem 1fr; gap: 0.9rem; align-items: start; }
.promises li svg { width: 1.8rem; height: 1.8rem; margin-top: 0.1rem; }
.promises strong { display: block; font-family: var(--display); font-size: var(--step-1); line-height: 1.2; }
.promises span { color: var(--ink-soft); }

/* ---------- Questions parents ask ---------- */
.faq { background: var(--blush); padding: 5rem clamp(1.25rem, 5vw, 4rem); }
.faq-inner { max-width: 46rem; margin: 0 auto; }
.faq h2 { font-size: var(--step-3); }
.faq dl { margin: 2rem 0 0; }
.faq dt { font-family: var(--display); font-weight: 700; font-size: var(--step-1); margin-top: 1.5rem; }
.faq dd { margin: 0.3rem 0 0; color: var(--ink-soft); max-width: 60ch; }

/* ---------- Footer ---------- */
.foot { background: var(--ink); color: #eae4fb; padding: 3.5rem clamp(1.25rem, 5vw, 4rem) 3rem; }
.foot-inner { max-width: 68rem; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.foot a { color: #fff; }
.foot .links { display: flex; gap: 1.6rem; font-weight: 600; }
.foot .credit { color: #c9c2ea; font-size: var(--step--1); margin-top: 0.4rem; }

/* ---------- Legal pages ---------- */
.legal-top { background: linear-gradient(var(--sky), var(--blush)); padding: 7rem clamp(1.25rem, 5vw, 4rem) 3rem; }
.legal-top h1 { font-size: var(--step-3); max-width: 46rem; margin: 0 auto; }
.legal-top p { max-width: 46rem; margin: 0.6rem auto 0; color: var(--ink-soft); font-weight: 600; }
.legal { max-width: 46rem; margin: 0 auto; padding: 3rem clamp(1.25rem, 5vw, 2rem) 5rem; }
.legal h2 { font-size: var(--step-2); margin: 2.6rem 0 0.8rem; }
.legal h3 { font-size: var(--step-1); margin: 1.6rem 0 0.5rem; }
.legal p, .legal li { line-height: 1.65; }
.legal p + p { margin-top: 0.9rem; }
.legal ul { padding-left: 1.3rem; }
.legal li + li { margin-top: 0.45rem; }
.legal .summary { background: var(--blush); border-radius: 18px; padding: 1.4rem 1.6rem; }
.legal .summary strong { font-family: var(--display); font-size: var(--step-1); }
.todo { background: #fff3b0; padding: 0 0.3em; border-radius: 4px; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .bar nav { gap: 1rem; font-size: 0.95rem; }
  .bar nav .hide-sm { display: none; }
  .how-grid { grid-template-columns: 1fr; }
  .parents-inner { grid-template-columns: 1fr; }
  .house, .house:nth-of-type(even) { justify-content: flex-start; min-height: 0; padding-top: 5rem; padding-bottom: 5rem; }
  .flight .plane { width: 76px; }
  /* The loop is wider than the screen; slide it left so the plane at its end lands fully in view. */
  .loop { width: 170vw; translate: -68% -63%; }
  .cta { font-size: 1.05rem; padding: 0.85rem 1.3rem; gap: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flight .plane { display: none; }
}
