/* Peggo Drop — Gummy Galaxy, as in the app (lib/core/theme). */

@font-face { font-family: "Bagel Fat One"; src: url("../fonts/BagelFatOne-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../fonts/Fredoka-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../fonts/Fredoka-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../fonts/Fredoka-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../fonts/Fredoka-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --night: #2A1240;
  --night-high: #3D1760;
  --night-deep: #1E0C30;
  --grape: #5B2A86;
  --grape-shade: #45206A;
  --jelly: #8E4CE0;
  --jelly-shade: #6A2FB3;
  --jelly-dim: #B79BE0;
  --milk: #E9D8FF;
  --milk-shade: #C4AEEA;
  --gum: #FF7AC6;
  --gum-shade: #D9529F;
  --mint: #6FF0C9;
  --mint-shade: #3FC9A0;
  --lemon: #FFD84D;
  --lemon-shade: #E0A91F;
  --mute: #7A6A92;
  --ink: #170A24;

  --outline: 3px;
  --lip: 5px;
  --shade: 6px;
  --radius-card: 22px;
  --radius-panel: 28px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-width: 250px;
  background-color: var(--night-deep);
  color: var(--milk);
  font-family: "Fredoka", system-ui, sans-serif;
  overflow-x: hidden;
}

/* The sky behind every page: deep night, two nebula glows and a starfield. */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 40vmax at 85% 10%, rgba(142, 76, 224, 0.30), transparent 60%),
    radial-gradient(50vmax 36vmax at 5% 70%, rgba(255, 122, 198, 0.16), transparent 60%),
    radial-gradient(40vmax 30vmax at 60% 100%, rgba(111, 240, 201, 0.08), transparent 60%),
    linear-gradient(180deg, var(--night-deep) 0%, #24103A 55%, #2E1148 100%);
}
.sky::before, .sky::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, rgba(233, 216, 255, 0.9), transparent 60%),
    radial-gradient(1px 1px at 28% 72%, rgba(233, 216, 255, 0.7), transparent 60%),
    radial-gradient(1.6px 1.6px at 46% 36%, rgba(255, 216, 77, 0.8), transparent 60%),
    radial-gradient(1px 1px at 64% 12%, rgba(233, 216, 255, 0.8), transparent 60%),
    radial-gradient(1.2px 1.2px at 78% 58%, rgba(233, 216, 255, 0.7), transparent 60%),
    radial-gradient(1.6px 1.6px at 90% 86%, rgba(233, 216, 255, 0.9), transparent 60%),
    radial-gradient(1px 1px at 6% 92%, rgba(111, 240, 201, 0.8), transparent 60%),
    radial-gradient(1.2px 1.2px at 54% 88%, rgba(233, 216, 255, 0.6), transparent 60%);
  background-size: 420px 420px;
}
.sky::after { background-size: 640px 640px; background-position: 120px 80px; opacity: 0.7; animation: twinkle 7s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 0.8; } }

/* ---------- type ---------- */
.font-display { font-family: "Bagel Fat One", "Fredoka", system-ui, sans-serif; font-weight: 400; letter-spacing: 0.005em; }

/* Display text with the app's ink outline and ink drop. */
.ink-title {
  font-family: "Bagel Fat One", "Fredoka", system-ui, sans-serif;
  color: var(--lemon);
  -webkit-text-stroke: 0.09em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.09em 0 var(--ink);
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.ink-title.milk { color: var(--milk); }
.ink-title.gum { color: var(--gum); }
.ink-title.mint { color: var(--mint); }

.eyebrow { font-weight: 600; font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lemon); }

/* ---------- gummy surfaces ---------- */
.gummy {
  --fill: var(--milk); --fill-shade: var(--milk-shade); --label: var(--ink);
  position: relative;
  background: var(--fill);
  color: var(--label);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: 0 var(--lip) 0 var(--ink), inset 0 calc(var(--shade) * -1) 0 var(--fill-shade);
  isolation: isolate;
}
.gummy::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 1.5px; right: 1.5px; top: 1.5px; height: min(45%, 26px);
  border-radius: calc(var(--radius-card) - 4px) calc(var(--radius-card) - 4px) 999px 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
}
.gummy.panel { border-radius: var(--radius-panel); }
.gummy.panel::before { border-radius: calc(var(--radius-panel) - 4px) calc(var(--radius-panel) - 4px) 999px 999px; }
.tone-lemon { --fill: var(--lemon); --fill-shade: var(--lemon-shade); --label: var(--ink); }
.tone-gum { --fill: var(--gum); --fill-shade: var(--gum-shade); --label: var(--ink); }
.tone-mint { --fill: var(--mint); --fill-shade: var(--mint-shade); --label: var(--ink); }
.tone-milk { --fill: var(--milk); --fill-shade: var(--milk-shade); --label: var(--ink); }
.tone-jelly { --fill: var(--jelly); --fill-shade: var(--jelly-shade); --label: var(--milk); }
.tone-grape { --fill: var(--grape); --fill-shade: var(--grape-shade); --label: var(--milk); }
.tone-night { --fill: var(--night); --fill-shade: var(--night-deep); --label: var(--milk); }
/* Big dark panels keep a softer gloss, so it reads as shine, not a band. */
.panel.tone-night::before, .panel.tone-grape::before { opacity: 0.45; }
.pill { --radius-card: 999px; border-radius: 999px; }

/* Pill button that sinks into its ink lip when pressed, like GummyButton. */
.gummy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 52px; padding: 0.7rem 1.6rem;
  border-radius: 999px;
  font-family: "Bagel Fat One", "Fredoka", system-ui, sans-serif; font-size: 1.15rem; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 90ms var(--ease-out), box-shadow 90ms var(--ease-out), filter 160ms ease;
  max-width: 100%;
}
.gummy-btn::before { border-radius: 999px; height: min(45%, 22px); }
.gummy-btn:hover { filter: brightness(1.06) saturate(1.05); }
.gummy-btn:active { transform: translateY(3px) scaleX(1.02); box-shadow: 0 2px 0 var(--ink), inset 0 calc(var(--shade) * -1) 0 var(--fill-shade); }
.gummy-btn:focus-visible, .nav-link:focus-visible, .store-btn:focus-visible, .text-link:focus-visible {
  outline: 3px solid var(--mint); outline-offset: 4px;
}
.gummy-btn.small { min-height: 42px; padding: 0.5rem 1.1rem; font-size: 1rem; }
.gummy-btn[disabled] { --fill: var(--mute); --fill-shade: #5E5072; --label: #C9BEDA; cursor: not-allowed; filter: none; }

/* Store buttons: icon, small caption, big label — three parts in one pill. */
.store-btn {
  display: inline-flex; align-items: center; gap: 0.8rem;
  min-height: 64px; padding: 0.55rem 1.5rem 0.65rem 1.1rem;
  border-radius: 999px; text-decoration: none; text-align: left;
  transition: transform 90ms var(--ease-out), box-shadow 90ms var(--ease-out), filter 160ms ease;
  max-width: 100%;
}
.store-btn::before { border-radius: 999px; height: min(45%, 24px); }
.store-btn:hover { filter: brightness(1.06); }
.store-btn:active { transform: translateY(3px) scaleX(1.02); box-shadow: 0 2px 0 var(--ink), inset 0 calc(var(--shade) * -1) 0 var(--fill-shade); }
.store-btn .store-icon { font-size: 1.85rem; width: 2rem; text-align: center; flex: none; }
.store-btn .store-text { display: flex; flex-direction: column; min-width: 0; }
.store-btn .store-caption { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 0.72rem; letter-spacing: 0.04em; opacity: 0.85; white-space: nowrap; }
.store-btn .store-label { font-family: "Bagel Fat One", sans-serif; font-size: 1.3rem; line-height: 1.05; white-space: nowrap; }
@media (max-width: 340px) {
  .store-btn { padding: 0.5rem 1rem 0.6rem 0.8rem; gap: 0.55rem; }
  .store-btn .store-label { font-size: 1.05rem; }
  .store-btn .store-icon { font-size: 1.45rem; width: 1.6rem; }
  .gummy-btn { padding: 0.6rem 1.1rem; font-size: 1rem; }
}

/* Round icon button (nav toggle), like the app's round gummy buttons. */
.round-btn { width: 46px; height: 46px; border-radius: 999px; display: inline-grid; place-items: center; cursor: pointer; font-size: 1.1rem; --lip: 3px; }
.round-btn::before { border-radius: 999px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(30, 12, 48, 0.72); border-bottom: 2px solid rgba(23, 10, 36, 0.9); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 12px; border: var(--outline) solid var(--ink); box-shadow: 0 3px 0 var(--ink); flex: none; }
.brand span { font-family: "Bagel Fat One", sans-serif; color: var(--milk); font-size: 1.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 300px) { .brand span { font-size: 1.1rem; } .brand img { width: 34px; height: 34px; } }
.nav-link { color: var(--milk); text-decoration: none; font-weight: 600; padding: 0.45rem 0.8rem; border-radius: 999px; transition: background 160ms ease, color 160ms ease; }
.nav-link:hover { background: rgba(142, 76, 224, 0.28); }
.nav-link[aria-current="page"] { background: var(--grape); box-shadow: inset 0 0 0 2px var(--ink); color: var(--lemon); }
.mobile-nav { display: none; }
.mobile-nav.open { display: block; }
.mobile-nav .nav-link { display: block; padding: 0.8rem 1rem; }

/* ---------- phone frames ---------- */
.phone {
  position: relative; border-radius: 13% / 6%; background: var(--ink);
  padding: 3.2%; box-shadow: 0 10px 0 #0A0412, 0 30px 60px rgba(6, 1, 12, 0.6);
  border: 2px solid var(--jelly-shade);
}
.phone img { display: block; width: 100%; height: auto; border-radius: 10.5% / 4.9%; }

/* Light pops floating off the board, like the app's "+150". */
.pop {
  position: absolute; font-family: "Bagel Fat One", sans-serif; color: var(--lemon);
  -webkit-text-stroke: 0.14em var(--ink); paint-order: stroke fill; text-shadow: 0 0.1em 0 var(--ink);
  white-space: nowrap; pointer-events: none; animation: bob 4.2s ease-in-out infinite;
}
.pop.milk { color: var(--milk); }
.pop.mint { color: var(--mint); }
.pop.gum { color: var(--gum); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(var(--tilt, 0deg)); } 50% { transform: translateY(-10px) rotate(var(--tilt, 0deg)); } }

/* Gummy star, drawn like the board's star pegs. */
.star-shape { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.sparkle { position: absolute; width: 22px; height: 22px; background: var(--lemon); pointer-events: none; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: glint 3.6s ease-in-out infinite; }
@keyframes glint { 0%, 100% { transform: scale(0.75); opacity: 0.6; } 50% { transform: scale(1.1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .pop, .sparkle, .sky::after, .float { animation: none !important; }
}
.float { animation: drift 6s ease-in-out infinite; }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* A row of pegs, the board's own pattern, as a section divider. */
.peg-row {
  height: 34px;
  background-image: radial-gradient(circle at 50% 50%, var(--jelly) 0 6px, var(--ink) 6px 8.5px, transparent 9px);
  background-size: 44px 34px; background-position: center; opacity: 0.9;
}
.peg-row.offset { background-position: calc(50% + 22px) center; }

/* The slot cups along the bottom of the board. */
.cups { display: flex; gap: 6px; justify-content: center; flex-wrap: nowrap; overflow: hidden; }
.cup {
  --fill: var(--milk); --fill-shade: var(--milk-shade);
  flex: 0 1 64px; min-width: 0; height: 72px; display: grid; align-items: end; justify-items: center; padding-bottom: 8px;
  border-radius: 8px 8px 20px 20px; background: var(--fill); border: var(--outline) solid var(--ink);
  box-shadow: inset 0 -6px 0 var(--fill-shade), 0 4px 0 var(--ink);
  font-family: "Bagel Fat One", sans-serif; font-size: 0.95rem; color: var(--ink);
}

/* ---------- content ---------- */
.text-link { color: var(--lemon); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.text-link:hover { color: #fff1aa; }

.feature-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 1.4rem; flex: none; --lip: 4px; }
.feature-icon::before { border-radius: 14px 14px 999px 999px; }

/* Horizontal screenshot rail */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 250px); gap: 1.6rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 1rem 1.25rem 2.5rem; scrollbar-width: thin; scrollbar-color: var(--jelly) transparent; }
.rail > * { scroll-snap-align: center; }
@media (max-width: 420px) { .rail { grid-auto-columns: 78%; gap: 1rem; } }

/* FAQ */
details.faq summary { list-style: none; cursor: pointer; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary .chev { transition: transform 200ms var(--ease-out); }
details.faq[open] summary .chev { transform: rotate(180deg); }

/* Forms */
.field { width: 100%; background: #fff7ff; color: var(--ink); border: var(--outline) solid var(--ink); border-radius: 16px; padding: 0.8rem 1rem; font: 500 1rem "Fredoka", sans-serif; box-shadow: inset 0 3px 0 rgba(23, 10, 36, 0.08); }
.field:focus { outline: 3px solid var(--jelly); outline-offset: 2px; }
.field[aria-invalid="true"] { border-color: #B3125E; background: #FFF0F6; }
.field-error { color: #FFB3D6; font-weight: 600; font-size: 0.9rem; min-height: 1.25rem; }

/* Legal pages */
.legal { color: var(--ink); line-height: 1.7; font-size: 1rem; overflow-wrap: anywhere; }
.legal h1 { font-family: "Bagel Fat One", sans-serif; font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.1; margin: 0 0 0.5rem; color: var(--ink); }
.legal .meta { color: var(--grape); font-weight: 600; margin-bottom: 1.5rem; }
.legal h2 { font-family: "Bagel Fat One", sans-serif; font-weight: 400; font-size: clamp(1.1rem, 3vw, 1.35rem); color: var(--grape); margin: 2.2rem 0 0.7rem; line-height: 1.25; scroll-margin-top: 90px; }
.legal h3 { font-weight: 700; font-size: 1.05rem; margin: 1.4rem 0 0.5rem; color: var(--ink); }
.legal p { margin: 0 0 0.85rem; }
.legal ul, .legal ol { margin: 0 0 1rem 1.3rem; padding: 0; }
.legal ul { list-style: none; }
.legal ul li { position: relative; padding-left: 0.4rem; margin-bottom: 0.35rem; }
.legal ul li::before { content: ""; position: absolute; left: -1rem; top: 0.62em; width: 8px; height: 8px; border-radius: 999px; background: var(--jelly); box-shadow: 0 0 0 2px var(--ink); }
.legal ol { list-style: decimal; }
.legal ol li { margin-bottom: 0.35rem; padding-left: 0.3rem; }
.legal a { color: var(--jelly-shade); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.legal .table-wrap { overflow-x: auto; margin: 0 0 1rem; border: var(--outline) solid var(--ink); border-radius: 16px; background: #fff; }
.legal table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
.legal th { background: var(--grape); color: var(--milk); text-align: left; padding: 0.65rem 0.8rem; font-weight: 600; }
.legal td { padding: 0.65rem 0.8rem; border-top: 2px solid #eadcff; vertical-align: top; }
.legal .inline-btn { display: inline-flex; vertical-align: middle; margin: 0.2rem 0; }
.toc a { color: var(--milk); text-decoration: none; display: block; padding: 0.3rem 0; font-size: 0.92rem; }
.toc a:hover { color: var(--lemon); }

/* Cookie banner */
.cookie-banner { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: 12px; max-width: 980px; margin: 0 auto; transform: translateY(140%); transition: transform 420ms var(--ease-out); }
.cookie-banner.show { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .cookie-banner { transition: none; } }

/* Hero art: fades into the sky at the bottom, stays quiet under the copy. */
.hero-art { opacity: 0.3; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); object-position: 70% 30%; }
@media (min-width: 1024px) { .hero-art { opacity: 0.6; } }
.hero-veil { background: linear-gradient(90deg, rgba(30, 12, 48, 0.92) 0%, rgba(30, 12, 48, 0.7) 38%, rgba(30, 12, 48, 0.15) 70%, rgba(30, 12, 48, 0) 100%); }
@media (max-width: 1023px) { .hero-veil { background: linear-gradient(180deg, rgba(30, 12, 48, 0.55), rgba(30, 12, 48, 0.2) 60%, rgba(30, 12, 48, 0)); } }

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
img { max-width: 100%; }
