/* Vukka: blue-and-white porcelain, with marigold.
   Porcelain white-blue for the page, cobalt for text, buttons and the Plus panel, marigold for the warm accents.
   Headings use Nunito (SIL Open Font License, shared/fonts/Nunito), a rounded face that sits with the bear icon
   and looks the same in every browser; the variable font covers every weight, so 800 is real, not faked.
   It has Latin and Vietnamese only (subset in nunito.woff): Chinese, Japanese and Korean fall through to the
   system faces after it. The store graphics use the same font (shared/icons/app/make_feature_graphic.py). */
@font-face {
  font-family: "Nunito";
  src: url("/nunito.woff") format("woff");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
:root {
  --page: #EDF1F9;
  --surface: #F8FAFD;
  --cobalt: #1C3D9A;
  --cobalt-mid: #3E66D3;
  --cobalt-soft: #93ACEA;
  --sky: #C9D7F4;
  --marigold: #F3AE35;
  --ink: #0E1C3C;
  --muted: #4E5A77;
  --line: #CBD5EA;
  --on-dark: #F4F7FD;
  --round: "Nunito", ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "PingFang SC", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0A1330; --surface: #101C42; --cobalt: #2C52C0; --cobalt-mid: #5A80E6; --cobalt-soft: #8EA7E9;
    --sky: #26386A; --ink: #E6ECFA; --muted: #9AA7CA; --line: #22315C; --on-dark: #F4F7FD;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "PingFang SC", "Hiragino Sans", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background: var(--page);
}
h1, h2, h3, .brand { font-family: var(--round); }
a { color: var(--cobalt-mid); text-underline-offset: 3px; }
a:focus-visible, .button:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 28px; }
.note { color: var(--muted); font-size: 14px; }
.lead { font-size: 19px; color: var(--muted); max-width: 34em; }

/* Header */
header.site { padding: 22px 0; }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 21px; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
nav.site a { color: var(--muted); text-decoration: none; margin-left: 20px; font-size: 15px; white-space: nowrap; }
nav.site a:hover { color: var(--ink); }

/* Buttons */
.stores { display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0 14px; }
.button {
  display: inline-block; padding: 14px 24px; border-radius: 999px; font-weight: 600; text-decoration: none;
  background: var(--cobalt); color: var(--on-dark);
}
.button + .button { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--cobalt); }
/* Store badges, both 48px tall as seen (Apple's minimum is 40px; clear space at least a quarter of that).
   Google's images carry their own transparent margin, so they are drawn larger and pulled in by it:
   English is the newer layout (a 564 by 168 badge inside 646 by 250); the other languages are the older one
   (646 by 192 inside 646 by 250, padded top and bottom only). */
.badges { align-items: center; gap: 14px; }
.badge { display: inline-flex; border-radius: 10px; }
.badge img { display: block; }
.badge.apple img { height: 48px; width: auto; }
.badge.play img { height: 71.4px; width: auto; margin: -11.7px; }
.badge.play.older img { height: 62.5px; margin: -7.25px 0; }
.button.primary { background: var(--marigold); color: #2A1E05; box-shadow: none; }

/* Home: hero */
.home-hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: center;
  padding: 64px 0 72px;
}
.home-hero h1 {
  font-size: clamp(42px, 6.4vw, 76px); line-height: 1.02; font-weight: 800; letter-spacing: -0.035em;
  margin: 0 0 22px; color: var(--cobalt);
}
@media (prefers-color-scheme: dark) { .home-hero h1 { color: var(--ink); } }
/* The Chinese headline is one short line (8 characters with the full stop): size it to the column so it never
   wraps. cqi is 1% of the column's width. */
.home-hero .words { container-type: inline-size; }
html[lang^="zh"] .home-hero h1 { white-space: nowrap; letter-spacing: 0; font-size: min(68px, 100cqi / 8.3); }
.home-hero .lead { margin: 0; }

/* The ring: an arrow going round the month. A pale track; a fill that runs light to dark and back to light;
   a V notch cut in the tail at the top; and an arrowhead that leads the fill and, when the ring is full, sits
   in the notch. The page's one moment of motion. One property, --sweep, drives the fill and the head
   together. The ring's own mask cuts the hole; the band is the outer 26% of the radius, so in a 100 by 100
   box it runs from y 0 to 13 at the top, which is where the notch and head shapes sit. */
@property --sweep { syntax: "<angle>"; inherits: true; initial-value: 360deg; }
.ring-box { position: relative; width: 100%; max-width: 360px; justify-self: center; container-type: inline-size; }
.ring {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%;
  background: var(--sky);
  -webkit-mask: radial-gradient(farthest-side, transparent 74%, #000 calc(74% + 1px));
  mask: radial-gradient(farthest-side, transparent 74%, #000 calc(74% + 1px));
  animation: sweep 2.2s cubic-bezier(.65, 0, .35, 1) .3s both;
}
.ring .fill, .ring .head { position: absolute; inset: 0; }
.ring .fill {
  background: conic-gradient(var(--cobalt-soft), var(--cobalt-mid) 25%, var(--cobalt) 50%, var(--cobalt-mid) 75%, var(--cobalt-soft));
  -webkit-mask: conic-gradient(#000 var(--sweep), transparent 0), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path fill-rule='evenodd' d='M0 0H100V100H0Z M50 0L56 6.5L50 13Z'/></svg>");
  -webkit-mask-composite: source-in;
  mask: conic-gradient(#000 var(--sweep), transparent 0), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path fill-rule='evenodd' d='M0 0H100V100H0Z M50 0L56 6.5L50 13Z'/></svg>");
  mask-composite: intersect;
  mask-size: 100% 100%;
}
/* The head turns with the sweep and its inner layer turns back the same amount, so the gradient stays put and
   the head always matches the fill under it. (Turning the gradient itself instead is not reliably repainted.) */
.ring .head {
  transform: rotate(var(--sweep));
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M49.5 -1L56.6 6.5L49.5 14Z'/></svg>") 0 0 / 100% 100%;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M49.5 -1L56.6 6.5L49.5 14Z'/></svg>") 0 0 / 100% 100%;
}
.ring .head > div {
  position: absolute; inset: 0; transform: rotate(calc(-1 * var(--sweep)));
  background: conic-gradient(var(--cobalt-soft), var(--cobalt-mid) 25%, var(--cobalt) 50%, var(--cobalt-mid) 75%, var(--cobalt-soft));
}
@keyframes sweep { from { --sweep: 0deg; } to { --sweep: 360deg; } }
@media (prefers-reduced-motion: reduce) { .ring { animation: none; } }
/* The month's total in the hole, counting up with the fill (build.py's COUNT_UP). The hole is 74% of the
   ring's width; --len, the figure's length in characters, shrinks long figures (won, dong) to fit it. */
.month-total {
  position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1.5cqi; text-align: center; pointer-events: none;
}
.month-total .label { font-size: max(12px, 4.4cqi); font-weight: 600; color: var(--muted); line-height: 1.2; }
.month-total .amount {
  font-family: var(--round); font-weight: 800; color: var(--ink); white-space: nowrap; line-height: 1.05;
  font-size: min(14cqi, calc(108cqi / var(--len, 8)));
}

/* Home: how it works, a real sequence */
ol.steps-row {
  list-style: none; margin: 0; padding: 40px 0 0; border-top: 2px solid var(--cobalt);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px;
}
ol.steps-row li { position: relative; }
ol.steps-row .n {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--marigold); color: #2A1E05; font: 800 17px/1 var(--round); margin-bottom: 16px;
}
ol.steps-row h3 { font-size: 23px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
ol.steps-row p { margin: 0; color: var(--muted); font-size: 16px; }
.aside { margin: 44px 0 0; padding: 18px 22px; background: var(--surface); border-radius: 14px; color: var(--muted); font-size: 16px; }
.aside strong { color: var(--ink); margin-right: .6em; }

/* Home: children and responsibility */
.kids {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start;
  margin-top: 96px; padding: 56px; background: var(--surface); border-radius: 28px;
}
.kids h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.025em; margin: 0; font-weight: 800; color: var(--cobalt); }
@media (prefers-color-scheme: dark) { .kids h2 { color: var(--ink); } }
.kids p { margin: 0 0 16px; font-size: 18px; line-height: 1.7; }
.kids p + p { color: var(--muted); }
.kids p.lesson {
  margin: 28px 0 0; padding: 4px 0 4px 20px; border-left: 5px solid var(--marigold);
  font: 800 clamp(20px, 2.2vw, 25px)/1.35 var(--round); letter-spacing: -0.01em; color: var(--ink);
}

/* Home: Free and Plus */
.pricing { padding: 88px 0 80px; }
.pricing h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 14px; font-weight: 800; }
.pricing .lead { margin: 0 0 36px; }
.plans { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: stretch; margin-bottom: 18px; }
.plan { padding: 32px; border-radius: 20px; box-shadow: inset 0 0 0 2px var(--line); }
.plan h3 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.01em; }
.plan > p { margin: 0; color: var(--muted); }
.plan.plus { background: var(--cobalt); color: var(--on-dark); border-radius: 28px; box-shadow: none; }
.plan.plus > p { color: color-mix(in srgb, var(--on-dark) 75%, transparent); }
ul.checks { list-style: none; padding: 0; margin: 22px 0 0; }
ul.checks li { padding: 7px 0 7px 32px; position: relative; font-size: 16px; }
ul.checks li::before {
  content: ""; position: absolute; left: 2px; top: 13px; width: 16px; height: 16px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--cobalt-mid);
}
.plan.plus ul.checks li::before { background: var(--marigold); box-shadow: none; }

/* Other pages */
.hero { text-align: center; padding: 56px 0 40px; }
.hero img { width: 104px; height: 104px; border-radius: 24px; }
.hero h1 { font-size: clamp(32px, 6vw, 48px); line-height: 1.1; margin: 24px 0 10px; letter-spacing: -0.025em; color: var(--cobalt); }
@media (prefers-color-scheme: dark) { .hero h1 { color: var(--ink); } }
.hero .lead { margin: 0 auto; }
.hero .stores { justify-content: center; }
article { max-width: 720px; padding: 20px 0 70px; }
article h1 { font-size: 38px; line-height: 1.15; margin: 10px 0 6px; letter-spacing: -0.02em; color: var(--cobalt); }
@media (prefers-color-scheme: dark) { article h1 { color: var(--ink); } }
article h2 { font-size: 22px; margin-top: 38px; }
article .updated { color: var(--muted); font-size: 14px; }
article li { margin: 4px 0; }
.code {
  font: 700 40px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .18em; color: var(--cobalt);
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--marigold); border-radius: 18px; padding: 22px 26px; display: inline-block; margin: 18px 0;
}
@media (prefers-color-scheme: dark) { .code { color: var(--ink); } }
ol.steps { text-align: left; max-width: 440px; margin: 20px auto; }

/* Footer */
footer.site { background: var(--surface); padding: 32px 0 44px; color: var(--muted); font-size: 14px; }
footer.site a { color: var(--muted); margin-right: 16px; }
footer.site nav.languages { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
footer.site nav.languages a { margin-right: 0; text-decoration: none; }
footer.site nav.languages a[aria-current] { color: var(--ink); font-weight: 600; }

@media (max-width: 760px) {
  .wrap { padding: 0 22px; }
  nav.site a { margin-left: 14px; }
  /* Phones: the ring sits beside the headline, at the size of the headline block, rather than as a big
     picture above it. The words' children join the hero's grid so the headline and ring share a row. */
  .home-hero {
    grid-template-columns: minmax(0, 1fr) var(--ring); column-gap: 16px; row-gap: 0; align-items: center;
    padding: 32px 0 56px; --ring: clamp(132px, 38vw, 168px);
  }
  .home-hero .words { display: contents; }
  .home-hero h1 { grid-column: 1; grid-row: 1; margin: 0; font-size: clamp(36px, 10.5vw, 46px); }
  .ring-box { grid-column: 2; grid-row: 1; max-width: none; }
  .home-hero .lead, .home-hero .stores, .home-hero .note { grid-column: 1 / -1; }
  .home-hero .lead { margin-top: 22px; }
  /* Chinese: still one line, now in the space left of the ring. */
  html[lang^="zh"] .home-hero h1 { font-size: min(40px, (100vw - 44px - 16px - var(--ring)) / 4.3); white-space: normal; }
  .month-total { gap: 2cqi; }
  .month-total .label { max-width: 58%; font-size: max(10px, 6.6cqi); line-height: 1.15; }
  .month-total .amount { font-size: min(15cqi, calc(100cqi / var(--len, 8))); }
  /* Japanese and Korean headlines are longer: a little smaller, and Korean breaks only between words. */
  html[lang="ja"] .home-hero h1, html[lang="ko"] .home-hero h1 { font-size: clamp(28px, 8.4vw, 36px); line-height: 1.12; letter-spacing: -0.02em; }
  html[lang="ko"] .home-hero h1 { word-break: keep-all; }
  ol.steps-row { grid-template-columns: 1fr; gap: 30px; }
  .plans { grid-template-columns: 1fr; }
  .kids { grid-template-columns: 1fr; gap: 20px; padding: 32px 26px; margin-top: 72px; }
  .pricing { padding: 72px 0 60px; }
}
