/* Glimmerfen / Apprentio landing page. Moonlit night, warm potion gold, a cozy marsh.
   Atkinson Hyperlegible for all reading; Pixelify Sans only for the logo and headings
   (never for numbers: its 2 and 3 look like 8). Both fonts are served from this site. */

@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("/fonts/pixelify.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --night: #13123a;     /* deep indigo sky */
  --dusk: #2a2163;      /* purple horizon */
  --moon: #fff3c4;      /* moonlight: headings */
  --gold: #ffc23d;      /* potion gold: buttons, accents */
  --gold-deep: #a86a12; /* potion edge */
  --line: #b9a8ff;      /* beaker measuring lines */
  --ink: #ecebff;       /* body text on night */
  --muted: #c9c3ec;     /* secondary text on night */
  --parchment: #f6ecd2; /* the founder's letter */
  --letter-ink: #2b2140;
  --read: "Atkinson Hyperlegible", "Trebuchet MS", system-ui, sans-serif;
  --pixel: "Pixelify Sans", var(--read);
  --step-0: 1.0625rem;  /* body on phones, 17px */
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(2.1rem, 7.5vw, 3.6rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--read);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--gold); color: var(--night); padding: 0.6rem 1rem; z-index: 10; font-weight: 700; }
.skip:focus { left: 0.5rem; }

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.narrow { max-width: 40rem; margin-inline: auto; }

h1, h2, h3 { margin: 0 0 0.75rem; line-height: 1.15; }
h2 { font: 600 var(--step-2)/1.2 var(--pixel); color: var(--moon); letter-spacing: 0.01em; }
h3 { font: 700 var(--step-1)/1.3 var(--read); color: var(--moon); }
p { margin: 0 0 1rem; }

/* ---------- Hero: the moonlit marsh ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #161a3f 0%, #241d55 55%, #2e2458 100%);
  padding-bottom: 5.5rem;
}
/* Stars and the moon, drawn with gradients (no images). */
.sky {
  position: absolute; inset: 0; pointer-events: none;
  /* A small moon tucked in the corner on phones, clear of the headline. */
  --moon-x: calc(100% - 2.6rem); --moon-y: 5.6rem; --moon-r: 1.1rem;
  background:
    radial-gradient(circle at var(--moon-x) var(--moon-y), rgba(255, 243, 196, 0.95) 0 var(--moon-r), rgba(255, 243, 196, 0.12) calc(var(--moon-r) + 1px) calc(var(--moon-r) * 1.75), transparent calc(var(--moon-r) * 1.75 + 1px)),
    radial-gradient(1.5px 1.5px at 12% 22%, #fff3c4 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 12%, #fff3c4 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 46% 30%, #fff3c4 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 9%, #fff3c4 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 40%, #fff3c4 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 46%, #fff3c4 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 58%, #fff3c4 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 64%, #fff3c4 50%, transparent 51%);
}
.bar { position: relative; display: flex; justify-content: space-between; align-items: center; width: min(100% - 2.5rem, 68rem); margin: 0 auto; padding: 1.1rem 0; }
.brand { font: 600 1.15rem/1 var(--pixel); color: var(--moon); text-decoration: none; }
.bar-link { color: var(--ink); font-weight: 700; padding: 0.6rem 0; }

.hero-inner { position: relative; width: min(100% - 2.5rem, 68rem); margin: 0 auto; padding-top: 1.5rem; display: grid; gap: 2.25rem; }
.logo { font: 500 1.35rem/1 var(--pixel); color: var(--gold); margin-bottom: 1rem; letter-spacing: 0.02em; }
h1 { font: 700 var(--step-3)/1.05 var(--pixel); color: var(--moon); max-width: 12ch; margin-bottom: 1.1rem; }
.lede { font-size: var(--step-1); line-height: 1.55; max-width: 34rem; color: var(--ink); }
.promise { margin-top: 1rem; font-size: 0.95rem; color: var(--muted); }

.button {
  display: inline-block;
  min-height: 3.1rem;
  padding: 0.8rem 1.4rem;
  border: 2px solid var(--gold-deep);
  border-radius: 999px;
  background: var(--gold);
  color: #2b1a02;
  font: 700 1.1rem/1.3 var(--read);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--gold-deep), 0 0 24px rgba(255, 194, 61, 0.28);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.button:hover { background: #ffd56e; }
.button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-deep); }

/* Game screenshots: framed like a lit window in the night. */
.shot { margin: 0; }
.shot img { border-radius: 14px; border: 2px solid rgba(255, 194, 61, 0.55); box-shadow: 0 18px 40px rgba(5, 4, 25, 0.55); }
.shot figcaption { margin-top: 0.7rem; color: var(--muted); font-size: 0.95rem; }

.marsh { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 5rem; }

/* ---------- Sections ---------- */
main section { padding: 3.5rem 0; }
.problem { background: #23234f; }
.problem p { font-size: var(--step-1); }

/* "How it works": items separated like the lines on the beaker. */
.how-grid { display: grid; gap: 2.5rem; }
.features { list-style: none; margin: 0; padding: 0; }
.features li { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; padding: 1.15rem 0; border-top: 1px solid rgba(185, 168, 255, 0.35); }
.features li:last-child { border-bottom: 1px solid rgba(185, 168, 255, 0.35); }
.features h3 { margin-bottom: 0.25rem; }
.features p { margin: 0; color: var(--muted); }
.icon { width: 3rem; height: 3rem; }

/* A stacked fraction, the way kids see them in school (same as in the game). */
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-weight: 700; color: var(--gold); line-height: 1; font-size: 0.85em; margin: 0 0.1em; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 0.15em 0.08em; }
.frac > span:last-child { padding-top: 0.08em; }
.nowrap { white-space: nowrap; }

.parents { background: linear-gradient(180deg, var(--night), #1b1946); }
.checks { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.85rem; }
.checks li { position: relative; padding-left: 2.2rem; font-weight: 700; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.2rem; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%232b1a02' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}

/* The founder's letter: warm parchment in the night. */
.founder { background: #1b1946; }
.letter { background: var(--parchment); color: var(--letter-ink); border-radius: 6px 6px 18px 6px; padding: 2rem 1.5rem; box-shadow: 0 14px 34px rgba(5, 4, 25, 0.5); }
.letter h2 { color: #4a2c10; }
.letter p { font-size: 1.1rem; line-height: 1.7; }
.signature { font-weight: 700; margin: 1.5rem 0 0; }

/* Sign-up */
.join { background: linear-gradient(180deg, #1b1946, var(--dusk)); }
.join-grid { display: grid; gap: 2rem; align-items: center; }
.join-shot { order: 2; } /* phones: the form comes first */
.join-panel { border: 2px solid rgba(255, 194, 61, 0.55); border-radius: 18px; padding: 1.75rem 1.4rem; background: rgba(19, 18, 58, 0.7); }
.signup label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.signup input[type="email"] {
  width: 100%; min-height: 3.1rem; padding: 0.7rem 0.9rem; border-radius: 10px;
  border: 2px solid var(--line); background: #fdfcff; color: #1d1a33; font: 400 1.1rem/1.3 var(--read);
}
.check { display: flex; gap: 0.75rem; align-items: center; min-height: 2.75rem; margin: 1rem 0 1.1rem; } /* the whole row is the tap target */
.check input { width: 1.6rem; height: 1.6rem; accent-color: var(--gold); flex: none; margin: 0; }
.check label { margin: 0; font-weight: 400; padding: 0.6rem 0; cursor: pointer; flex: 1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.error { color: #ffd0c2; background: rgba(191, 54, 12, 0.35); border-left: 4px solid #ff7043; padding: 0.6rem 0.8rem; border-radius: 6px; }
.signup .button { width: 100%; }
.fine { font-size: 0.95rem; color: var(--muted); margin: 0.9rem 0 0; }
.thanks h3 { font: 700 var(--step-2)/1.2 var(--pixel); color: var(--gold); }
.thanks:focus { outline: none; }

.footer { padding: 2rem 0 2.5rem; background: var(--dusk); color: var(--muted); }
.footer p { margin: 0; }
.footer a { color: var(--ink); }

/* Privacy page */
.page-head { background: linear-gradient(180deg, #161a3f, #241d55); padding-bottom: 2.5rem; }
.page-head h1 { font-size: var(--step-3); max-width: none; margin-top: 1.5rem; }
.prose { padding: 2.5rem 0 3.5rem; }
.prose h2 { margin-top: 2.2rem; font-size: 1.4rem; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }
.updated { color: var(--muted); font-size: 0.95rem; }

/* ---------- Wider screens ---------- */
@media (min-width: 60rem) {
  :root { --step-0: 1.125rem; --step-2: 2rem; }
  .hero { padding-bottom: 7rem; }
  .hero-inner { grid-template-columns: 1fr 1.05fr; align-items: center; padding-top: 3rem; gap: 3.5rem; }
  .marsh { height: 7rem; }
  .sky { --moon-x: 72%; --moon-y: 7.5rem; --moon-r: 2.2rem; }
  main section { padding: 5rem 0; }
  .how-grid { grid-template-columns: 1fr 1.1fr; align-items: center; gap: 3.5rem; }
  .letter { padding: 3rem 3.25rem; }
  .join-grid { grid-template-columns: 0.9fr 1fr; gap: 3.5rem; }
  .join-shot { order: 0; }
  .join-panel { padding: 2.25rem 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
