/*
 * Shared styling for Famzi's public pages (privacy, support, account deletion).
 *
 * These pages must stay reachable without the app installed — Google Play
 * requires it — so they are plain static HTML with no build step and no
 * JavaScript. `scripts/postbuild-web.mjs` copies `public/` into `dist/`.
 */

/*
 * The wordmark only. Baloo 2 is what the app itself renders, so without this
 * these pages showed "Famzi" in the visitor's own system font and the brand
 * looked like two different products. Self-hosted and subset to Latin by
 * `scripts/make-webfont.py`; SIL OFL 1.1, licence in public/fonts/OFL.txt.
 *
 * Body copy stays in the system face on purpose. These are pages about
 * permanent deletion, and a playful font undercuts that.
 */
@font-face {
  font-family: 'Baloo 2';
  src: url('/fonts/baloo2-extrabold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #14663a;
  --wash: #e4f4ea;
  --canvas: #fbfaf3;
  --text: #1c2b21;
  --muted: #5c6e62;
  --border: #e2e8dc;
  /* Dark-ground tokens. The gold is the wordmark's, so the button on a dark
   * band is the same yellow as the house in the logo. Spec 022 §0. */
  --gold: #ffd93d;
  --ink-on-dark: #d7e7dc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 20px 64px;
  background: var(--canvas);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

main {
  max-width: 640px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 0 4px;
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--text);
  text-decoration: none;
}

.brand svg {
  display: block;
  flex: none;
}

h1 {
  margin: 14px 0 8px;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.4px;
}

h2 {
  margin: 34px 0 10px;
  font-size: 17px;
  letter-spacing: -0.1px;
}

p {
  margin: 0 0 12px;
  color: var(--muted);
}

.lede {
  font-size: 17px;
  color: var(--text);
}

ul,
ol {
  margin: 0 0 12px;
  padding-left: 22px;
  color: var(--muted);
}

li {
  margin-bottom: 6px;
}

.box {
  padding: 18px 20px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(28, 43, 33, 0.07);
}

.box > :last-child {
  margin-bottom: 0;
}

.settle {
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--wash);
  color: var(--primary);
}

.settle > :last-child {
  margin-bottom: 0;
}

.nothing {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary);
}

.mail {
  display: inline-block;
  margin-top: 6px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.updated {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

a {
  color: var(--primary);
}

footer {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

/* ==========================================================================
 * The marketing site (index.html) — spec 006.
 *
 * Extends the tokens above rather than forking them, so the site and the
 * legal pages cannot drift into looking like two different products.
 *
 * One deliberate divergence: headings here use Baloo 2, which the legal pages
 * refuse on purpose. Those are pages about permanent deletion, where a playful
 * font undercuts the message. This is a page about children earning stars,
 * where the app's own face is the right one.
 * ========================================================================== */

body.site {
  padding: 0;
}

/*
 * The legal pages clamp `main` to a 640px reading column. This page is a
 * stack of full-bleed bands, so it has to opt out or every band's background
 * stops at 640px and the whole colour rhythm collapses.
 */
body.site main {
  max-width: none;
  margin: 0;
}

/* Bands ------------------------------------------------------------------
 *
 * The page is a stack of full-bleed bands, each with an inner .wrap that
 * holds the 1040px column. Two bands are dark — the top one and the story —
 * and everything between them is light. That alternation is the whole of the
 * visual rhythm; there is no gradient machinery and no background imagery.
 * Spec 022 §0.
 */
.band {
  padding: clamp(56px, 9vw, 96px) 0;
}

.band-tight {
  padding: clamp(40px, 6vw, 64px) 0;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.center {
  text-align: center;
}

.band-dark {
  background: var(--primary);
  color: var(--ink-on-dark);
}

.band-wash {
  background: var(--wash);
}

/* The header sits inside this band and supplies its own top padding, so the
 * band must not add more above it. */
.band-top {
  padding-top: 0;
}

/*
 * Hairlines only between two plain bands. A colour change is already a
 * boundary, so a rule on top of it reads as a seam.
 */
.band + .band {
  border-top: 1px solid var(--border);
}

.band-dark + .band,
.band-wash + .band,
.band + .band-dark,
.band + .band-wash {
  border-top: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar .brand {
  padding: 20px 0;
}

.topbar-link {
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.topbar-link:hover {
  text-decoration: underline;
}

.site h1,
.site h2,
.site h3 {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 800;
  color: var(--text);
}

/*
 * Fluid rather than stepped. The old 34px/46px pair left everything between
 * 360px and 759px at the small size, so a large phone got a headline sized
 * for a small one. Spec 022 P8.
 */
.site h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 6.2vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.6px;
  text-wrap: balance;
}

.site h2 {
  margin: 0 0 18px;
  font-size: clamp(25px, 3.6vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.3px;
  text-wrap: balance;
}

.site h3 {
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: -0.1px;
}

/* Hero ------------------------------------------------------------------- */

/*
 * §4.3 binds: at 360x640dp the headline, subline, primary button and the top
 * of the media must all clear the fold. The budget is tight, which is why the
 * hero padding and the lede length are both deliberately small.
 */
.hero {
  padding: 8px 0 40px;
}

.hero-copy .lede {
  margin: 0 0 20px;
  font-size: 17px;
  color: var(--muted);
  max-width: 34em;
}

.cta {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
}

.cta:hover {
  background: #0f5230;
}

.cta-quiet {
  display: inline-block;
  margin-left: 18px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.cta-quiet:hover {
  text-decoration: underline;
}

/*
 * Sits under a CTA. No text-align on purpose: it inherits, so it is left in
 * the hero and centred inside a .wrap.center.
 */
.cta-note {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.hero-media {
  margin-top: 34px;
}

/*
 * A bezel, not a device mock. A photographic iPhone frame around an Android
 * product would be its own small lie.
 */
.phone {
  width: 100%;
  max-width: 270px;
  margin: 0 auto;
  padding: 10px;
  border-radius: 34px;
  background: #16281e;
  box-shadow: 0 18px 44px rgba(28, 43, 33, 0.22);
}

.phone-screen {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 25px;
  background: var(--primary);
  object-fit: cover;
}

.media-note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* Content blocks --------------------------------------------------------- */

.steps {
  margin: 0;
  padding-left: 22px;
  max-width: 44em;
}

.steps li {
  margin-bottom: 14px;
  color: var(--muted);
}

.steps strong {
  color: var(--text);
}

.grid {
  display: grid;
  gap: 26px;
}

.grid p {
  margin: 0;
}

.trust {
  margin: 0;
  padding-left: 22px;
  max-width: 44em;
}

.trust li {
  margin-bottom: 10px;
}

.site-footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 56px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer p {
  margin: 0 0 6px;
}

@media (min-width: 760px) {
  .hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 48px;
    padding: 32px 0 64px;
  }

  .hero-media {
    margin-top: 0;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px 44px;
  }

  .steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 34px;
    padding-left: 0;
    list-style: none;
    counter-reset: step;
    max-width: none;
  }

  .steps li {
    margin-bottom: 0;
    counter-increment: step;
  }

  .steps li::before {
    content: counter(step);
    display: block;
    margin-bottom: 8px;
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-size: 30px;
    line-height: 1;
    color: var(--primary);
    opacity: 0.45;
  }
}

/* Dark grounds ------------------------------------------------------------
 *
 * Every inversion needed inside .band-dark, kept in one place rather than
 * scattered through each component, so the whole of it can be read at once.
 */
.band-dark h1,
.band-dark h2,
.band-dark h3,
.band-dark .brand {
  color: #fff;
}

.band-dark .lede,
.band-dark .cta-note,
.band-dark .media-note {
  color: var(--ink-on-dark);
}

.band-dark a {
  color: var(--gold);
}

.band-dark .cta {
  background: var(--gold);
  color: #14331f;
}

.band-dark .cta:hover {
  background: #ffe368;
}

/* The bezel is nearly the band's own colour, so it needs to go darker or the
 * phone dissolves into the background. */
.band-dark .phone {
  background: #0c3a22;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
}

/* The story -------------------------------------------------------------- */

.story {
  max-width: 34em;
  margin: 0 auto;
}

.story p {
  color: var(--ink-on-dark);
}

.story-lead {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: clamp(19px, 2.6vw, 25px);
  line-height: 1.35;
  color: #fff;
}

/*
 * The pull quote is the one line most people will actually take away, so it
 * gets the gold and the size. No quote marks: the sentence is stronger
 * without the decoration.
 */
.story blockquote {
  margin: 30px 0;
  padding: 0;
  border: 0;
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: clamp(22px, 3.4vw, 31px);
  line-height: 1.24;
  letter-spacing: -0.3px;
  color: var(--gold);
  text-wrap: balance;
}

/* Reveal on scroll --------------------------------------------------------
 *
 * Native CSS scroll-driven animation: no JavaScript, no library, no scroll
 * listener. Browsers without `animation-timeline` skip the entire block and
 * render the page static and correct, which is the reason it sits behind
 * @supports rather than being polyfilled. Spec 022 §4.7.
 *
 * The inner .wrap moves, never the band itself — animating the band would
 * fade its background and undo the whole point of the colour rhythm.
 */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal > .wrap {
      animation: reveal-rise linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 62%;
    }

    @keyframes reveal-rise {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: none;
      }
    }
  }
}
