/* Light is "Mist", a pale lavender page; dark is "Dusk", a soft violet-grey that stays clearly lighter than the app's
   deep indigo screens, so the phones in the demos never melt into the page (docs/website/mockup.html, option A).
   The page follows the system until the button in the bar is tapped; site.js then sets data-theme on <html>.
   One file for every page; no build step. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#f3f2fa, #2b2847);
  --fg: light-dark(#15132e, #f1f0fa);
  --dim: light-dark(#5d5980, #b4afd6);
  --line: light-dark(#dcd9ee, #423e66);
  --accent: light-dark(#4b3fd1, #a9a1ff);
  --accent-hover: light-dark(#3d32b8, #c2bcff);
  --on-accent: light-dark(#fff, #15132e);
  --danger: light-dark(#c8463c, #ff8a80);
  --card: light-dark(#fff, #353259);
  --bar: light-dark(rgba(243, 242, 250, 0.8), rgba(43, 40, 71, 0.8));
  --frame: light-dark(#2b2a35, #5c5888);
  --shadow: light-dark(rgba(20, 18, 46, 0.25), rgba(0, 0, 0, 0.45));
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* The app's font (src/theme.ts), cut into Latin, Latin Extended (Czech, Hungarian, Polish, Turkish) and Greek. A browser
   downloads a cut only when the page uses its letters. Hindi, Japanese, Korean and Chinese use the system font:
   Commissioner has none of their letters. The system font shows until a cut loads. */
@font-face { font-family: Commissioner; font-weight: 400; font-display: swap; src: url(/fonts/commissioner-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: Commissioner; font-weight: 500; font-display: swap; src: url(/fonts/commissioner-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: Commissioner; font-weight: 600; font-display: swap; src: url(/fonts/commissioner-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: Commissioner; font-weight: 700; font-display: swap; src: url(/fonts/commissioner-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: Commissioner; font-weight: 400; font-display: swap; src: url(/fonts/commissioner-ext-400.woff2) format("woff2"); unicode-range: U+0100-0130, U+0132-017F, U+0218-021B; }
@font-face { font-family: Commissioner; font-weight: 500; font-display: swap; src: url(/fonts/commissioner-ext-500.woff2) format("woff2"); unicode-range: U+0100-0130, U+0132-017F, U+0218-021B; }
@font-face { font-family: Commissioner; font-weight: 600; font-display: swap; src: url(/fonts/commissioner-ext-600.woff2) format("woff2"); unicode-range: U+0100-0130, U+0132-017F, U+0218-021B; }
@font-face { font-family: Commissioner; font-weight: 700; font-display: swap; src: url(/fonts/commissioner-ext-700.woff2) format("woff2"); unicode-range: U+0100-0130, U+0132-017F, U+0218-021B; }
@font-face { font-family: Commissioner; font-weight: 400; font-display: swap; src: url(/fonts/commissioner-greek-400.woff2) format("woff2"); unicode-range: U+0370-03FF; }
@font-face { font-family: Commissioner; font-weight: 500; font-display: swap; src: url(/fonts/commissioner-greek-500.woff2) format("woff2"); unicode-range: U+0370-03FF; }
@font-face { font-family: Commissioner; font-weight: 600; font-display: swap; src: url(/fonts/commissioner-greek-600.woff2) format("woff2"); unicode-range: U+0370-03FF; }
@font-face { font-family: Commissioner; font-weight: 700; font-display: swap; src: url(/fonts/commissioner-greek-700.woff2) format("woff2"); unicode-range: U+0370-03FF; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.6 Commissioner, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 7rem; /* links to #how, #why and #get land below the bar */
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* The bar stays at the top, frosted over the page that scrolls under it. Its contents line up with main's column. */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 2rem;
  padding: 0.75rem max(1.5rem, calc((100% - 57rem) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
}
.brand { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--fg); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 22.5%; box-shadow: 0 0.25rem 0.75rem var(--shadow); }
header nav { display: flex; gap: 1.75rem; margin-left: auto; font-size: 0.9375rem; font-weight: 500; }
header nav a { color: var(--fg); white-space: nowrap; }
header nav a:hover, header nav a[aria-current] { color: var(--accent); text-decoration: none; }
.cta { padding: 0.5rem 1.125rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.9375rem; font-weight: 600; white-space: nowrap; }
.cta:hover { background: var(--accent-hover); text-decoration: none; }

/* Dark or light, then the language: round buttons beside Download (docs/website/mockup.html, S1 and L1). */
.tools { display: flex; align-items: center; gap: 0.5rem; margin-left: -1rem; }
.theme, .lang summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 2.25rem;
  min-width: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.theme:hover, .lang summary:hover, .lang[open] summary { border-color: var(--accent); color: var(--accent); }
/* The button needs site.js; without it the page simply follows the system. It shows where a tap goes: the sun on
   dark pages, the moon on light ones. */
.theme { display: none; padding: 0; }
.js .theme { display: flex; }
.theme .sun { display: none; }
:root[data-theme="dark"] .theme .sun { display: block; }
:root[data-theme="dark"] .theme .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: block; }
  :root:not([data-theme="light"]) .theme .moon { display: none; }
}
/* The language menu is a plain <details>, so it opens without the script; each language is named in its own words. */
.lang { position: relative; }
.lang summary { padding: 0 0.625rem; list-style: none; }
.lang summary::-webkit-details-marker { display: none; }
.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.125rem 0.25rem;
  width: max-content;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: 0 1rem 2.5rem var(--shadow);
  list-style: none;
}
.lang li a { display: block; padding: 0.375rem 0.75rem; border-radius: 0.5rem; color: var(--fg); font-size: 0.9375rem; white-space: nowrap; }
.lang li a:hover { background: var(--line); text-decoration: none; }
.lang li a[aria-current] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
/* Phones: logo and Download on the first row, the links on a second. */
@media (max-width: 52rem) {
  .tools { margin-left: auto; }
  /* The language menu hangs from the bar, centered, so it never runs off a phone's edge. */
  .lang { position: static; }
  .lang ul { left: 50%; right: auto; top: 3.5rem; width: min(100% - 2rem, 22rem); transform: translateX(-50%); }
  .cta { padding: 0.4375rem 1rem; }
  header nav { order: 1; width: 100%; justify-content: space-between; gap: 1rem; margin-left: 0; font-size: 0.875rem; }
}
/* Small phones fit three links; the demos start right under the hero there anyway. */
@media (max-width: 26.5rem) {
  header { gap: 0.5rem 0.625rem; padding-inline: 1rem; }
  header .how { display: none; }
  /* The icon alone, so both buttons and Download fit beside it; long link names wrap onto a second line. */
  .brand span { display: none; }
  .tools { gap: 0.375rem; }
  .lang summary { padding: 0 0.5rem; }
  .lang summary svg:last-child { display: none; }
  .cta { padding: 0.4375rem 0.75rem; }
  header nav { flex-wrap: wrap; justify-content: center; gap: 0.25rem 1rem; }
}

main { width: 100%; max-width: 60rem; margin: 0 auto; padding: 0 1.5rem 6rem; }

/* White cards on the lavender page: Why Glass Budget? on the home page, and the support and privacy pages. */
.card { padding: 1.75rem; border: 1px solid var(--line); border-radius: 1.25rem; background: var(--card); }
.card h2 { color: var(--fg); font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }

/* Japanese has no spaces: break lines between phrases, not inside words. */
:lang(ja) { word-break: auto-phrase; }

h1, h2 { line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 7vw, 4rem); font-weight: 700; letter-spacing: -0.035em; }
p, li { color: var(--dim); text-wrap: pretty; }

/* Home */
.hero { padding-top: clamp(2rem, 8vw, 5rem); text-align: center; }
.hero p { margin-top: 1rem; font-size: 1.25rem; }
/* The name is the headline; what the app does is the line under it, then the plain description. */
.hero .promise { margin-top: 0.75rem; color: var(--fg); font-size: clamp(1.375rem, 4vw, 1.875rem); font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; text-wrap: balance; }
.hero .promise + p { margin-top: 0.5rem; font-size: 1.125rem; }
.app-icon { display: block; width: 7.5rem; height: auto; margin: 0 auto 2rem; border-radius: 22.5%; box-shadow: 0 1.25rem 2.5rem var(--shadow); }
@media (max-width: 48rem) { .app-icon { width: 6rem; } }

/* A phone around a 390 × 844 screen recording (docs/onboarding/mockup.html, recorded by scripts/record-website-demos.mjs). */
.phone {
  width: min(100%, 18rem);
  margin: 0 auto;
  padding: 0.5rem;
  border: 1px solid var(--frame);
  border-radius: 12% / 5.6%;
  background: #000;
  box-shadow: 0 2rem 4rem var(--shadow);
}
.phone video { display: block; width: 100%; height: auto; border-radius: 8% / 3.7%; }

/* Why Glass Budget?: six cards, each an icon, a few words and one line. */
.why { margin-top: clamp(5rem, 12vw, 9rem); text-align: center; }
.why > h2 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; letter-spacing: -0.035em; }
.why svg { color: var(--accent); }
.why svg .over { fill: var(--danger); }
.why ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2.5rem; list-style: none; }
.why h3 { margin-top: 1rem; color: var(--fg); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.why li p { margin-top: 0.25rem; }
@media (max-width: 48rem) { .why ul { grid-template-columns: 1fr; } }

/* The demos zigzag: phone left, then right. On narrow screens the words sit above each phone. */
.demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem 4rem;
  margin-top: clamp(5rem, 12vw, 9rem);
}
.demo:nth-child(even) .copy { order: -1; justify-self: end; }
.copy { max-width: 24rem; }
.demo:nth-child(odd) .copy { justify-self: start; }
.copy h2 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; letter-spacing: -0.035em; }
.copy p { margin-top: 1rem; font-size: 1.25rem; }
@media (max-width: 48rem) {
  .demo { grid-template-columns: 1fr; text-align: center; }
  .demo .copy { order: -1; justify-self: center; }
}

/* Download: Google's official badge (its transparent edge is the clear space Google asks for), then the App Store
   as plain words: Apple has no "coming soon" badge, and its badge may only link to a live app. */
.get { display: flex; flex-direction: column; align-items: center; margin-top: 1.5rem; }
.get img { display: block; width: 13.5rem; height: auto; }
.hero .get p, .end .get p { margin-top: 0; font-size: 0.9375rem; }

.end { margin-top: clamp(6rem, 14vw, 10rem); text-align: center; }
.end h2 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; letter-spacing: -0.035em; }

/* Words rise in as they scroll into view. CSS only (no scripts, so the CSP stays strict); browsers without
   scroll-driven animations, and people who ask for less motion, simply see them in place. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .copy h2, .copy p, .why li, .end {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 90%;
    }
    .copy p { animation-range: entry 30% entry 100%; }
    .demo .phone {
      animation: settle linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(2.5rem); } }
@keyframes settle { from { transform: scale(0.92); } }

/* Text pages: support, privacy, 404. Each topic is a card; wide ones span both columns. */
.text { padding-top: clamp(2rem, 6vw, 4rem); }
.text h1 { font-size: clamp(2.25rem, 6vw, 3rem); margin-bottom: 1rem; }
.text .lead { color: var(--fg); font-size: 1.25rem; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.cards .wide { grid-column: 1 / -1; }
@media (max-width: 48rem) { .cards { grid-template-columns: 1fr; } }
.text ol, .text ul { padding-left: 1.25rem; }
.text li + li { margin-top: 0.5rem; }
.text time { display: block; margin-top: 2rem; color: var(--dim); }
