/* Myntley marketing site — one stylesheet, no build step, no external requests.
   Palette mirrors apps/mobile/src/theme in the kidsrewards repo: emerald primary
   (growth/go), amber reserved for Mynts/stars, violet for rewards, coral for
   deductions. Light and dark are both first-class. */

:root {
  --green-800: #0b4b2e;
  --green-700: #12784a;
  --green-600: #12a05c;
  --green-500: #4fc98a;
  --amber-500: #f0b93c;
  --amber-600: #8a6410;
  --violet-500: #7b4ce2;
  --coral-600: #c4452f;

  --bg: #f7f7f4;
  --bg-alt: #f1f1ec;
  --surface: #ffffff;
  --surface-tint: #e6f4ec;
  --border: #e7e7e2;
  --ink: #16211c;
  --ink-2: #5a615d;
  /* Was #8b918d, which measured 3.0:1 on --bg — a WCAG 1.4.3 AA failure, and it
     carried real copy: .note, .colophon, .updated ("Last updated…"), .prose th,
     and the preview captions. #676e6a is 4.87:1 on --bg and 4.61:1 on --bg-alt,
     so it clears AA everywhere it is used while still reading as muted.
     Dark mode's #8a968f was already 6.0:1 and is unchanged. */
  --ink-3: #676e6a;
  --accent: var(--green-700);
  --accent-ink: #ffffff;
  --mynts: var(--amber-600);
  --shadow: 0 1px 2px rgb(20 37 27 / 6%), 0 8px 24px -12px rgb(20 37 27 / 18%);

  --radius: 18px;
  --radius-sm: 12px;
  --measure: 68ch;
  --gap: clamp(1rem, 0.6rem + 1.6vw, 1.75rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1512;
    --bg-alt: #121a16;
    --surface: #16201b;
    --surface-tint: #173026;
    --border: #263229;
    --ink: #edf1ee;
    --ink-2: #a9b4ae;
    --ink-3: #8a968f;
    --accent: #4fc98a;
    --accent-ink: #06120c;
    --mynts: #f7bb52;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 30px -14px rgb(0 0 0 / 70%);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The header is sticky, so every in-page jump used to land with its target
     tucked underneath it — most visibly on /faq/, where the whole section nav is
     twelve such jumps and each one hid the heading you asked for. Keep this
     above .site-header's 66px min-height. */
  scroll-padding-top: 5.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

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

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

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 800; }
h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.35rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.15rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1rem; }
p, li { max-width: var(--measure); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.75rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 10;
}
.skip-link:focus { left: 0; }

.wrap {
  width: min(100% - 2.5rem, 1080px);
  margin-inline: auto;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 66px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.15rem;
  flex-wrap: wrap;
}
.nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.35rem 0;
}
.nav a:hover { color: var(--accent); }
/* Colour alone can't carry "you are here" (WCAG 1.4.1), so the current page
   also gets weight and a rule under it. */
.nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ------------------------------------------------------------------ hero */

.hero {
  padding: clamp(2.5rem, 1rem + 7vw, 5.5rem) 0 clamp(2rem, 1rem + 4vw, 3.5rem);
  background:
    radial-gradient(58rem 26rem at 12% -8%, var(--surface-tint), transparent 62%),
    radial-gradient(44rem 22rem at 96% 4%, color-mix(in srgb, var(--amber-500) 14%, transparent), transparent 60%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(17rem, 0.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero-grid > * { min-width: 0; }

.app-preview {
  width: min(100%, 25rem);
  min-width: 0;
  max-width: 100%;
  justify-self: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 1.2rem;
  box-shadow: 0 24px 65px -30px rgb(11 75 46 / 42%);
  transform: rotate(1.25deg);
}
.app-preview-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.app-preview-title { font-weight: 800; font-size: 1.15rem; }
.balance-pill { border-radius: 999px; background: #fdf3dc; color: #3b2c05; padding: 0.4rem 0.75rem; font-weight: 800; white-space: nowrap; }
/* Gradient darkened from #12784a and the caption lightened from #a9cbb6: that
   pair measured 3.13:1 at the light end of the gradient (WCAG 1.4.3 AA needs
   4.5:1 for this size). Now 5.0:1 at the lightest point and 8.2:1 at the
   darkest. White on the new start colour is 7.0:1. */
.preview-hero { background: linear-gradient(145deg, #0f6640, #0a4229); color: #fff; border-radius: 1.35rem; padding: 1.15rem; margin-bottom: 0.8rem; }
.preview-hero small { color: #c8e0d2; font-weight: 700; }
.preview-hero strong { display: block; font-size: 1.35rem; margin-top: 0.2rem; }
.preview-row { display: flex; align-items: center; gap: 0.8rem; border: 1px solid var(--border); border-radius: 1rem; padding: 0.8rem; margin-top: 0.65rem; background: var(--surface); }
.preview-row-icon { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 0.8rem; background: var(--surface-tint); font-size: 1.25rem; flex: 0 0 auto; }
.preview-row-copy { min-width: 0; flex: 1; }
.preview-row-copy strong, .preview-row-copy small { display: block; }
.preview-row-copy small { color: var(--ink-3); }
.preview-points { color: var(--mynts); font-weight: 800; white-space: nowrap; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--surface-tint);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.lede {
  font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.3rem);
  color: var(--ink-2);
  max-width: 56ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }

.note { font-size: 0.9rem; color: var(--ink-3); margin-top: 0.9rem; }

/* --------------------------------------------------------------- section */

section { padding: clamp(2.25rem, 1.2rem + 4vw, 4rem) 0; }
section > .wrap > h2 { margin-bottom: 0.35rem; }
.section-lede { color: var(--ink-2); max-width: 60ch; margin-bottom: 2rem; }

.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

/* ----------------------------------------------------------------- cards */

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 0.35rem; }
.card p { color: var(--ink-2); margin: 0; font-size: 0.97rem; }
.card p + p { margin-top: 0.6rem; }

.tile {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 22px;
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  border: 1px solid var(--border);
  margin-bottom: 0.9rem;
}

/* --------------------------------------------------------------- numbers */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: var(--gap); }
.steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem 1.3rem 4.1rem;
  position: relative;
  max-width: none;
  box-shadow: var(--shadow);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1.3rem;
  top: 1.25rem;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.95rem;
}
.steps h3 { margin-bottom: 0.2rem; }
.steps p { color: var(--ink-2); margin: 0; }

/* ------------------------------------------------------------------- faq */

.faq { display: grid; gap: 0.7rem; }

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 1.15rem;
  box-shadow: var(--shadow);
}
details[open] { padding-bottom: 0.35rem; }
summary {
  cursor: pointer;
  font-weight: 700;
  padding: 1rem 0;
  list-style: none;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  margin-left: auto;
  color: var(--accent);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
}
details[open] > summary::after { content: "\2212"; }
details > :not(summary) { color: var(--ink-2); }
details > p:last-child { margin-bottom: 1rem; }

.faq-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0;
  list-style: none;
}
.faq-nav a {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-2);
}
.faq-nav a:hover { color: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------------------ prose */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.25rem; font-size: 1.45rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--ink-3); font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; }

.callout {
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); }

.updated { color: var(--ink-3); font-size: 0.9rem; }

/* These two replaced the site's only four `style="…"` attributes. Inline style
   attributes are governed by style-src 'unsafe-inline', so four top margins were
   the only thing standing between us and a strict CSP. (KR-194) */
.more-link { margin-top: 2rem; }
.callout.spaced { margin-top: 2.5rem; }

/* --------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2.5rem 0 3rem;
  margin-top: 2rem;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  align-items: baseline;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-left: auto; }
.site-footer a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; font-weight: 600; }
.site-footer a:hover { color: var(--accent); }
.site-footer a[aria-current="page"] {
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.colophon { color: var(--ink-3); font-size: 0.88rem; margin: 1.5rem 0 0; max-width: var(--measure); }

.mynts { color: var(--mynts); font-weight: 700; }
.feature-tag { display: inline-block; margin-left: 0.3rem; padding: 0.12rem 0.45rem; border-radius: 999px; background: #fdf3dc; color: #8a6410; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 0.15em; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .app-preview { justify-self: start; transform: none; }
}

@media (max-width: 600px) {
  .site-header .wrap { padding-block: 0.55rem; }
  .nav { width: 100%; justify-content: space-between; gap: 0.35rem 0.75rem; }
  .nav a { font-size: 0.88rem; }
}

/* --------------------------------------------------- Windows High Contrast */
/* forced-colors replaces our palette with the user's system colours and drops
   background-color and box-shadow entirely. Anything whose shape came only from
   a fill needs a border back, or the button/badge silently disappears. */

@media (forced-colors: active) {
  :focus-visible { outline: 3px solid Highlight; }
  .btn { border: 2px solid currentColor; }
  .eyebrow,
  .balance-pill,
  .feature-tag,
  .tile,
  .preview-row-icon { border: 1px solid currentColor; }
  .steps li::before { border: 1px solid currentColor; }
  .callout { border: 1px solid currentColor; border-left-width: 4px; }
  /* Underline survives forced-colors; our accent colour does not. */
  .nav a[aria-current="page"] { text-decoration: underline; }
}
