/* Brand tokens. The one place where colours and typefaces are defined: the site build copies this
   file and the app links it. Rules and contrast numbers: brand/README.md. Plain CSS, no build step. */

/* Text face: Inter. Display face: Newsreader. Both SIL OFL 1.1, Latin and Latin Extended (German, Spanish). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Japanese on Windows: Yu Gothic's Regular is too thin on screen, so the stack names its Medium and Bold through
   local() aliases. Nothing is downloaded. */
@font-face {
  font-family: "Yu Gothic Screen";
  font-weight: 100 500;
  src: local("Yu Gothic Medium"), local("YuGothic-Medium");
}
@font-face {
  font-family: "Yu Gothic Screen";
  font-weight: 600 900;
  src: local("Yu Gothic Bold"), local("YuGothic-Bold");
}

:root {
  color-scheme: light dark;

  /* Colour: light-dark(light, dark). The system setting picks one; data-theme="light|dark" on <html> forces it. */
  --paper: light-dark(#f6f4ef, #121419); /* page background */
  --surface: light-dark(#ffffff, #1a1d26); /* cards, panels, inputs */
  --sunken: light-dark(#ece9e1, #23262f); /* wells, tracks, code, neutral badges */
  --ink: light-dark(#191c27, #eceef4); /* text */
  --ink-muted: light-dark(#575c6b, #a3a8b8); /* secondary text */
  --line: light-dark(#e0dcd2, #2c303c); /* hairlines and card edges, decorative */
  --line-strong: light-dark(#8a8679, #6b7083); /* control edges that must be seen (3:1) */
  --accent: light-dark(#2f3b93, #a5aeff); /* indigo: primary button, focus ring, selected state */
  --accent-hover: light-dark(#253078, #bac1ff);
  --on-accent: light-dark(#ffffff, #121633); /* text on --accent */
  --accent-ink: light-dark(#2f3b93, #aeb6ff); /* links and accent text on paper or surface */
  --accent-soft: light-dark(#e6e8f6, #262b4d); /* tinted background behind accent text */
  --thread: light-dark(#5865c8, #8994f0); /* the stitch: running-stitch lines, never text */
  --ok: light-dark(#1d7348, #6fd29d);
  --ok-soft: light-dark(#e1f1e7, #16301f);
  --warn: light-dark(#865400, #f0c266);
  --warn-soft: light-dark(#faefd6, #352a12);
  --danger: light-dark(#b02a1f, #ff8f84);
  --danger-soft: light-dark(#fbe7e4, #3a1a18);

  /* Type */
  --font-text: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;
  --font-brand: "Newsreader", Georgia, serif; /* the wordmark: the same in every language */
  --display-weight: 560;
  --display-tracking: -0.018em;
  --leading-body: 1.6;
  --leading-heading: 1.08;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;
  --text-5xl: 3.75rem;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Space: a 4 px base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px light-dark(rgb(25 28 39 / 0.08), rgb(0 0 0 / 0.5));
  --shadow-md: 0 1px 2px light-dark(rgb(25 28 39 / 0.06), rgb(0 0 0 / 0.4)), 0 10px 28px -12px light-dark(rgb(25 28 39 / 0.22), rgb(0 0 0 / 0.7));
  --shadow-lg: 0 2px 6px light-dark(rgb(25 28 39 / 0.06), rgb(0 0 0 / 0.4)), 0 32px 64px -24px light-dark(rgb(25 28 39 / 0.32), rgb(0 0 0 / 0.8));

  /* Motion: short and calm. Reduced motion turns every duration to zero. */
  --ease-out: cubic-bezier(0.22, 0.8, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 120ms;
  --duration-base: 220ms;
  --duration-slow: 480ms;

  /* The stitch: a running stitch drawn as dashes */
  --stitch-dash: 7px;
  --stitch-gap: 5px;
  --stitch-weight: 2px;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
}

/* Korean and Japanese: Inter for Latin letters and digits, the system's CJK gothic for the rest. Headings use the
   same sans in bold, because Newsreader has no CJK and a serif Latin beside a gothic CJK looks accidental. */
:lang(ko) {
  --font-text: "Inter", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", sans-serif;
  --font-display: var(--font-text);
  --display-weight: 700;
  --display-tracking: -0.01em;
  --leading-body: 1.75;
  --leading-heading: 1.32;
}
:lang(ja) {
  --font-text: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Screen", Meiryo, "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --font-display: var(--font-text);
  --display-weight: 700;
  --display-tracking: 0;
  --leading-body: 1.8;
  --leading-heading: 1.4;
}

/* Brand components, shared by the app and the site. Every value comes from tokens.css: no colour or font
   name may be written here. Class names are the contract; brand/README.md lists them. */

/* Base: low specificity (:where), so a page layer overrides it without a fight. */
:where(body) {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}
:where(h1, h2, .display) {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: var(--leading-heading);
  text-wrap: balance;
}
:where(:lang(ko)) { word-break: keep-all; overflow-wrap: break-word; }
:where(:lang(ja)) { line-break: strict; }
:where(:lang(ja)) :where(h1, h2, .display) { font-feature-settings: "palt"; } /* proportional kana in headings */
:where(code, kbd, samp) { font-family: var(--font-mono); font-size: 0.9em; }
:where(a) { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:where(a:hover) { text-decoration-thickness: 2px; }
:where(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--ink); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Buttons: one .btn-primary per screen, .btn-quiet for everything else. For <a> and <button> alike. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-text);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--line-strong); }
.btn-lg { min-height: 52px; padding-inline: var(--space-6); font-size: var(--text-lg); }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

/* Card: a surface with a hairline edge. .card-raised lifts it off the paper. */
.card {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.card-raised { box-shadow: var(--shadow-md); }

/* Badge: a short state label, never a control. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--sunken);
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.6;
  white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

/* Stat headline: the result as a number first, its meaning second. */
.stat { display: flex; flex-direction: column; gap: var(--space-1); }
.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--display-weight);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-label { color: var(--ink-muted); font-size: var(--text-sm); }
.stat-ok .stat-value { color: var(--ok); }

/* Before -> after date: the wrong date struck through, the restored one underlined with a stitch.
   <span class="date-pair"><s class="date-before">…</s> <span class="date-after">…</span></span> */
.date-pair {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  font-variant-numeric: tabular-nums;
}
.date-before { color: var(--ink-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.date-before::after {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: var(--space-2);
  border: solid var(--ink-muted);
  border-width: 1.5px 1.5px 0 0;
  transform: translateY(-0.08em) rotate(45deg);
}
.date-after {
  padding-bottom: 3px;
  color: var(--ink);
  font-weight: var(--weight-semibold);
  background: linear-gradient(90deg, var(--thread) var(--stitch-dash), transparent 0) left bottom / calc(var(--stitch-dash) + var(--stitch-gap)) var(--stitch-weight) repeat-x;
}
.date-pair-stacked { flex-direction: column; align-items: flex-start; gap: 0; }
.date-pair-stacked .date-before::after { display: none; }

/* The stitch on its own: a rule or a divider. <hr class="stitch"> */
.stitch {
  height: var(--stitch-weight);
  margin: 0;
  border: 0;
  background: linear-gradient(90deg, var(--thread) var(--stitch-dash), transparent 0) 0 0 / calc(var(--stitch-dash) + var(--stitch-gap)) 100% repeat-x;
}

/* Progress: <progress class="progress" value="…" max="…">. Without a value it runs as a moving stitch. */
.progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--sunken);
  overflow: hidden;
}
.progress::-webkit-progress-bar { background: var(--sunken); border-radius: var(--radius-full); }
.progress::-webkit-progress-value { background: var(--accent); border-radius: var(--radius-full); transition: inline-size var(--duration-base) var(--ease-out); }
.progress::-moz-progress-bar { background: var(--accent); border-radius: var(--radius-full); }
.progress:indeterminate,
.progress:indeterminate::-webkit-progress-bar {
  background: linear-gradient(90deg, var(--thread) var(--stitch-dash), var(--sunken) 0) 0 50% / calc(var(--stitch-dash) + var(--stitch-gap)) 100% repeat-x;
  animation: ds-stitch-run 0.9s linear infinite;
}
@keyframes ds-stitch-run { to { background-position-x: calc(var(--stitch-dash) + var(--stitch-gap)); } }
@media (prefers-reduced-motion: reduce) {
  .progress:indeterminate, .progress:indeterminate::-webkit-progress-bar { animation: none; }
}

/* Empty state: the stitched outline says "drop it here". Add .is-over while something is dragged over it. */
.empty {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-6);
  background: var(--surface);
  border: 2px dashed var(--thread);
  border-radius: var(--radius-xl);
  text-align: center;
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.empty.is-over { background: var(--accent-soft); border-color: var(--accent); }
.empty-icon { color: var(--accent); }
.empty-title { margin: 0; font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: var(--leading-heading); }
.empty-text { margin: 0; max-width: 44ch; color: var(--ink-muted); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-2); }

/* Banners: a message about the whole screen. role="alert" for errors. */
.banner {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  background: var(--sunken);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-md);
}
.banner-title { margin: 0; font-weight: var(--weight-semibold); }
.banner-text { margin: 0; }
.banner-error { background: var(--danger-soft); border-left-color: var(--danger); }
.banner-error .banner-title { color: var(--danger); }
.banner-warn { background: var(--warn-soft); border-left-color: var(--warn); }
.banner-warn .banner-title { color: var(--warn); }

/* The landing site's own layer: layout only. tools/build-web.js puts brand/tokens.css and brand/components.css in
   front of it in style.css. Every colour, typeface, size and shadow comes from those tokens; test/brand fails if
   this file names a colour or a typeface itself. */

:root { --gutter: clamp(16px, 4vw, 40px); }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-size: 1.0625rem; }
:lang(ko) body, :lang(ja) body { font-size: 1rem; }
img { display: block; max-width: 100%; height: auto; }
p, li { text-wrap: pretty; }
h1, h2, h3 { margin: 0; }
:lang(ja) :is(h1, h2, strong, summary, .status, .demo-caption) { word-break: auto-phrase; }
code { padding: 0.08em 0.35em; border-radius: var(--radius-sm); background: var(--sunken); overflow-wrap: anywhere; }

.wrap { width: min(100% - 2 * var(--gutter), 1160px); margin-inline: auto; }

.skip {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 30;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
}
.skip:focus { top: var(--space-3); }

/* Header: the mark and name, three section links from 800 px, the language menu. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: var(--space-5); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-family: var(--font-brand); font-size: 1.5rem; font-weight: var(--weight-semibold); letter-spacing: -0.01em; line-height: 1; }
.site-nav { display: none; gap: var(--space-5); }
.site-nav a { color: var(--ink-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
@media (min-width: 800px) { .site-nav { display: flex; } }

.langs details { position: relative; }
.langs summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover { border-color: var(--line-strong); }
.langs summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: -3px 0 0 2px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.langs svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.langs ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 25;
  min-width: 168px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.langs ul a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; white-space: nowrap; }
.langs ul a:hover { background: var(--sunken); }
.langs ul a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: var(--weight-semibold); }

/* Hero: one sentence, the four reasons, one action, the demo. */
.hero { padding-block: clamp(36px, 6vw, 80px) clamp(56px, 7vw, 96px); }
.hero-grid { display: grid; gap: clamp(40px, 5vw, 64px); align-items: center; }
@media (min-width: 1040px) { .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }
h1 { font-size: clamp(2.2rem, 1.45rem + 2.6vw, 3.4rem); line-height: 1.05; }
:lang(ko) h1, :lang(ja) h1 { font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.6rem); line-height: 1.32; }

/* The four reasons. On a phone only their titles show, two by two, so the demo starts on the first screen;
   the sentence behind each stays for screen readers. */
.sell { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin: var(--space-5) 0 0; padding: 0; list-style: none; }
.sell li { display: grid; gap: var(--space-2); align-content: start; }
.sell-icon { fill: none; stroke: var(--accent-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sell p { margin: 0; color: var(--ink-muted); font-size: var(--text-sm); line-height: 1.5; }
.sell strong { display: block; color: var(--ink); font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: 1.35; }
@media (max-width: 559px) {
  .sell p span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (min-width: 560px) {
  .sell { gap: var(--space-5) var(--space-6); margin-top: var(--space-6); }
  .sell li { grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-3); }
  .sell-icon { margin-top: 1px; }
  .sell strong { margin-bottom: 2px; font-size: var(--text-md); }
}

/* Download first, Buy beside it, the video as a quiet link; on a phone the two buttons stack, full width. */
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }
.hero-film { display: inline-flex; align-items: center; gap: var(--space-2); margin-left: var(--space-2); color: var(--accent-ink); font-size: var(--text-sm); font-weight: var(--weight-semibold); text-decoration: none; white-space: nowrap; }
.hero-film:hover { text-decoration: underline; }
.hero-film circle { fill: none; stroke: currentColor; stroke-width: 1.6; }
.hero-film path { fill: currentColor; }
.hero-note { margin: var(--space-3) 0 0; color: var(--ink-muted); font-size: var(--text-sm); }
@media (max-width: 559px) {
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-film { margin: var(--space-1) auto 0; }
}

/* The demo. Without a script each photo shows both dates; page.js sets data-state and flips them card by card. */
.demo { margin: 0; padding: clamp(16px, 2.4vw, 24px); border-radius: var(--radius-xl); }
.demo-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.demo-title { margin: 0; color: var(--ink-muted); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.demo-toggle { display: inline-flex; padding: 3px; border-radius: var(--radius-full); background: var(--sunken); }
.demo-toggle button {
  padding: 6px 14px;
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.demo-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); margin: 0; padding: 0; list-style: none; }
.photo { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-md); }
.photo-meta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; line-height: 1.4; }
.photo-meta p { margin: 0; }
.photo-file code { display: block; padding: 0; background: none; color: var(--ink-muted); font-size: var(--text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo .date-pair { font-size: var(--text-sm); }
.photo .date-before { font-size: var(--text-xs); transition: color var(--duration-base) var(--ease-out), text-decoration-color var(--duration-base) var(--ease-out); }
.photo-place { color: var(--ink-muted); font-size: var(--text-xs); }
.photo-place span { margin-left: 4px; padding: 0 5px; border-radius: var(--radius-sm); background: var(--sunken); font-variant-numeric: tabular-nums; }
.photo .date-after,
.photo-place { transition: clip-path var(--duration-slow) var(--ease-out), opacity var(--duration-slow) var(--ease-out); }
.demo[data-state] .photo:not(.is-done) .date-before { color: var(--warn); font-weight: var(--weight-semibold); text-decoration-color: transparent; }
.demo[data-state] .photo:not(.is-done) .date-after { clip-path: inset(0 100% 0 0); }
.demo[data-state] .photo:not(.is-done) .photo-place { opacity: 0; }
.demo-caption { margin-top: var(--space-5); color: var(--ink-muted); font-size: var(--text-sm); }

/* The video of the real app (tools/make-demo-video.js), first in "How it works". On a phone it runs edge to edge so
   its captions are as large as they can be; from 900 px its line and button sit beside it, like the screenshots'. */
.film { display: grid; gap: var(--space-4); margin: 0 0 var(--space-6); }
.film video { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.film-caption { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); color: var(--ink-muted); font-size: var(--text-sm); }
.film-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out);
}
.film-toggle:hover { border-color: var(--ink-muted); }
.film-toggle svg { width: 16px; height: 16px; fill: currentColor; }
@media (max-width: 559px) {
  .film video { width: calc(100% + 2 * var(--gutter)); max-width: none; margin-inline: calc(-1 * var(--gutter)); border-inline: 0; border-radius: 0; }
}
@media (min-width: 900px) {
  .film { grid-template-columns: minmax(0, 840px) minmax(200px, 1fr); align-items: end; gap: var(--space-6); }
  .film-caption { display: grid; justify-items: start; }
}

/* Sections */
.section { padding-block: clamp(64px, 8vw, 112px); }
.section h2 { max-width: 24ch; font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); }
:lang(ko) .section h2, :lang(ja) .section h2 { max-width: none; font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.2rem); }
.lead { max-width: 46ch; margin: var(--space-4) 0 0; color: var(--ink-muted); font-size: var(--text-lg); }

/* How it works: a stitched stepper over a row of large screenshots that scrolls sideways. */
.how { background: var(--surface); border-block: 1px solid var(--line); }
.stepper { display: none; flex-wrap: wrap; align-items: center; gap: var(--space-2) 0; margin: var(--space-6) 0 var(--space-5); padding: 0; list-style: none; }
@media (min-width: 640px) { .stepper { display: flex; } }
.how h2 { margin-bottom: var(--space-5); }
.stepper li { display: flex; align-items: center; }
.stepper li + li::before {
  content: "";
  width: clamp(14px, 4vw, 48px);
  height: var(--stitch-weight);
  margin-inline: var(--space-2);
  background: linear-gradient(90deg, var(--thread) 5px, transparent 0) 0 0 / 9px 100% repeat-x;
}
.stepper a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 14px 5px 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--paper);
  color: var(--ink-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  white-space: nowrap;
}
.stepper a:hover { color: var(--ink); }
.stepper a[aria-current] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.stepper-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sunken); color: var(--ink); font-size: var(--text-xs); }
.stepper a[aria-current] .stepper-n { background: var(--accent); color: var(--on-accent); }

.rail {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(100% - 40px);
  gap: var(--space-5);
  margin-inline: -12px;
  padding: 12px 12px 36px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 12px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
@media (min-width: 1040px) { .rail { grid-auto-columns: calc(100% - 112px); } }
.slide { display: grid; gap: var(--space-4); margin: 0; scroll-snap-align: start; }
@media (min-width: 900px) { .slide { grid-template-columns: minmax(0, 1fr) minmax(200px, 0.3fr); align-items: center; gap: var(--space-6); } }
.slide img { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.slide figcaption { display: grid; gap: var(--space-2); align-content: start; color: var(--ink-muted); }
.slide figcaption strong { color: var(--ink); font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.15; }
.slide-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: var(--text-sm); font-weight: var(--weight-semibold); }

/* Price */
.price-grid { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 900px) { .price-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: var(--space-8); } }
.checks { display: grid; gap: var(--space-3); margin: var(--space-5) 0 0; padding: 0; list-style: none; }
.checks li { position: relative; padding-left: 32px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.18em; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); }
.checks li::after {
  content: "";
  position: absolute;
  left: 7.5px;
  top: calc(0.18em + 4.5px);
  width: 5px;
  height: 9px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
:lang(ko) .checks li::before, :lang(ja) .checks li::before { top: 0.3em; }
:lang(ko) .checks li::after, :lang(ja) .checks li::after { top: calc(0.3em + 4.5px); }
.price-card { padding: clamp(24px, 3vw, 36px); border-radius: var(--radius-xl); }
.price-name { margin: 0; color: var(--ink-muted); font-weight: var(--weight-semibold); }
.price-amount { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin: var(--space-2) 0 0; }
.amount { font-family: var(--font-display); font-size: 4.25rem; font-weight: var(--display-weight); font-variant-numeric: lining-nums; letter-spacing: -0.02em; line-height: 1; }
.price-once { color: var(--ink-muted); }
.price-buy { width: 100%; margin-top: var(--space-6); }
.price-secure { margin: var(--space-3) 0 0; color: var(--ink-muted); font-size: var(--text-sm); text-align: center; }
.price-refund { margin: var(--space-5) 0 0; font-weight: var(--weight-semibold); text-align: center; }
.price-fine { margin: var(--space-2) 0 0; color: var(--ink-muted); font-size: var(--text-sm); text-align: center; }

/* What it does not do: short, side by side. */
.limits { padding-top: 0; }
.limits-list { display: grid; gap: var(--space-5) var(--space-6); margin: var(--space-6) 0 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .limits-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .limits-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.limits-list li { padding-top: var(--space-3); border-top: 1px solid var(--line); color: var(--ink-muted); font-size: var(--text-sm); }
.limits-list strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: var(--text-md); font-weight: var(--weight-semibold); }

/* Download, here and on the thank-you page: the button and its facts beside the way past the warnings an unsigned
   installer meets. Size and checksum are stamped in when the site is staged (tools/stage-deploy.js); until then
   their empty slots stay hidden. The drawing of the two Windows steps uses our colours, not a copy of Windows. */
.download-grid { display: grid; gap: var(--space-6); margin-top: var(--space-6); align-items: start; }
@media (min-width: 900px) { .download-grid { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); gap: var(--space-8); } }
.download-get { display: grid; gap: var(--space-4); justify-items: start; min-width: 0; }
.download-facts { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; padding: 0; list-style: none; color: var(--ink-muted); font-size: var(--text-sm); }
.download-facts li:empty { display: none; }
.download-sum { max-width: 100%; color: var(--ink-muted); font-size: var(--text-sm); }
.download-sum:has(code:empty) { display: none; }
.download-sum summary { cursor: pointer; }
.download-sum code { display: block; margin-top: var(--space-2); padding: var(--space-2) var(--space-3); font-size: var(--text-xs); overflow-wrap: anywhere; user-select: all; }

.unsigned { display: grid; gap: var(--space-3); min-width: 0; color: var(--ink-muted); font-size: var(--text-sm); }
.unsigned p { max-width: 64ch; margin: 0; }
.unsigned strong { color: var(--ink); }
.winwarn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); margin-top: var(--space-3); }
@media (max-width: 559px) { .winwarn { grid-template-columns: minmax(0, 1fr); } }
.winwarn-box { position: relative; display: grid; gap: 7px; align-content: start; padding: var(--space-4) var(--space-4) var(--space-5); border-radius: var(--radius-md); background: var(--accent); color: var(--on-accent); font-size: var(--text-xs); line-height: 1.3; box-shadow: var(--shadow-sm); }
.winwarn p { margin: 0; }
.winwarn-title { padding-right: var(--space-4); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.winwarn-line { height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--on-accent) 35%, transparent); }
.winwarn-line + .winwarn-line { width: 64%; }
.winwarn-n { position: absolute; top: -10px; left: -10px; display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.winwarn-link { justify-self: start; margin-top: 2px; padding: 1px 5px; border-radius: var(--radius-sm); box-shadow: 0 0 0 2px var(--on-accent); text-decoration: underline; }
.winwarn .winwarn-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: var(--space-2); }
.winwarn-buttons span { padding: 4px 10px; border: 1px solid var(--on-accent); border-radius: var(--radius-sm); }
.winwarn-buttons .winwarn-other { width: 64px; } /* "Don't run", unlabelled: its Korean and Spanish text is unverified */
.winwarn-buttons .winwarn-run { background: var(--on-accent); color: var(--accent-ink); font-weight: var(--weight-semibold); box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--on-accent); }

/* The thank-you page: what to do with the key, then the download. */
.thanks { padding-block: clamp(36px, 6vw, 80px) clamp(56px, 7vw, 96px); }
.thanks h1 { max-width: 22ch; }
.thanks .lead { max-width: 60ch; }
.thanks-steps { display: grid; gap: var(--space-4); max-width: 64ch; margin: var(--space-6) 0 0; padding: 0; list-style: none; }
.thanks-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.thanks-steps p { margin: 0.2em 0 0; color: var(--ink-muted); }
.thanks-steps strong { color: var(--ink); }
.thanks-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.thanks-pcs { max-width: 64ch; margin: var(--space-5) 0 0; color: var(--ink-muted); }
.thanks-download { margin-top: var(--space-7); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.thanks-download h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
.thanks-home { margin: var(--space-4) 0 0; }

/* Help, under the questions, on the thank-you page and at the foot of the guides: Polar's order email and its
   customer portal, side by side from 640 px. */
.help { max-width: 760px; margin-top: var(--space-7); padding: clamp(20px, 3vw, 28px); }
.help :is(h2, h3) { color: var(--ink); font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: var(--leading-heading); }
.help-list { display: grid; gap: var(--space-4) var(--space-6); margin: var(--space-4) 0 0; padding: 0; list-style: none; color: var(--ink-muted); font-size: var(--text-sm); }
@media (min-width: 640px) { .help-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.help-list strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: var(--text-md); font-weight: var(--weight-semibold); }
.help-list a { font-weight: var(--weight-semibold); }

/* Guides: one column of text, about 68 characters to the line. Code blocks and tables scroll sideways inside
   their own box, so a long command or a wide table never widens the page on a phone. */
.site-nav a[aria-current="page"] { color: var(--ink); }
.guide { padding-block: clamp(28px, 5vw, 64px) clamp(56px, 7vw, 96px); }
.guide-article { width: min(100% - 2 * var(--gutter), 36rem); margin-inline: auto; }
.guide-article h1 { font-size: clamp(2rem, 1.55rem + 1.8vw, 2.75rem); line-height: 1.1; }
.guide-article h2 { margin: var(--space-7) 0 var(--space-3); font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem); }
.guide-article h3 { margin: var(--space-6) 0 var(--space-2); font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: 1.3; }
.guide-article :is(p, ul, ol) { margin: 0 0 var(--space-4); }
.guide-article :is(ul, ol) { padding-left: 1.4em; }
.guide-article li + li { margin-top: var(--space-2); }
.guide-crumb { margin: 0 0 var(--space-3); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.guide-crumb a { text-decoration: none; }
.guide-dates { margin: var(--space-3) 0 var(--space-6); color: var(--ink-muted); font-size: var(--text-sm); }
.guide-article pre {
  margin: 0 0 var(--space-5);
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--sunken);
  font-size: var(--text-sm);
  line-height: 1.55;
  scrollbar-width: thin;
}
.guide-article pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.guide-table { margin: 0 0 var(--space-5); overflow-x: auto; scrollbar-width: thin; }
.guide-table table { min-width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.45; }
.guide-table th, .guide-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.guide-table th { border-bottom-color: var(--line-strong); font-weight: var(--weight-semibold); white-space: nowrap; }
.guide-table :is(th, td):first-child { padding-left: 0; }
.guide-table code { overflow-wrap: normal; } /* file names break at spaces and hyphens only; past that, the box scrolls */
.guide-article code .nobr { white-space: nowrap; } /* an option such as -ext or --keep-input, never split after its hyphen */
.guide-figure { margin: var(--space-6) 0; }
.guide-figure img { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); }
.guide-figure figcaption { margin-top: var(--space-3); color: var(--ink-muted); font-size: var(--text-sm); }
.guide-cta { display: grid; gap: var(--space-4); margin-top: var(--space-7); padding: clamp(20px, 3vw, 32px); border-radius: var(--radius-xl); }
.guide-cta p { margin: 0; }
.guide-cta-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-brand); font-size: 1.375rem; font-weight: var(--weight-semibold); line-height: 1; }
.guide-cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.guide-cta-actions > a:not(.btn) { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.guide-cta-price { color: var(--ink-muted); font-size: var(--text-sm); }
@media (max-width: 559px) { .guide-cta-actions .btn { flex: 1 1 100%; } }
.guide .lead { margin-bottom: var(--space-6); }
.guide-article .guide-list { display: grid; gap: var(--space-5); margin: 0; padding: 0; list-style: none; }
.guide-article .guide-list li { margin: 0; padding-top: var(--space-5); border-top: 1px solid var(--line); }
.guide-list h2 { margin: 0 0 var(--space-2); font-size: var(--text-2xl); }
.guide-list h2 a { color: var(--ink); text-decoration: none; }
.guide-list h2 a:hover { color: var(--accent-ink); text-decoration: underline; }
.guide-list p { margin: 0; color: var(--ink-muted); }
.guide-list .guide-dates { margin-top: var(--space-2); }
.site-footer .help { margin: 0 0 var(--space-5); }

/* Questions: real disclosures. */
.faq { background: var(--surface); border-top: 1px solid var(--line); }
.faq-grid { display: grid; gap: var(--space-6); }
@media (min-width: 900px) {
  .faq-grid { grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr); }
  .faq-grid h2 { position: sticky; top: 104px; align-self: start; }
  .faq-grid .help { grid-column: 2; }
}
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) 0; font-weight: var(--weight-semibold); list-style: none; cursor: pointer; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover { color: var(--accent-ink); }
.faq-list summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin: 0.45em 4px 0 0;
  border: solid var(--ink-muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform var(--duration-base) var(--ease-out);
}
.faq-list details[open] summary::after { margin-top: 0.7em; transform: rotate(-135deg); }
.faq-list details p { max-width: 68ch; margin: 0 0 var(--space-5); color: var(--ink-muted); }

/* Footer */
.site-footer { padding-block: var(--space-7) var(--space-8); border-top: 1px solid var(--line); color: var(--ink-muted); font-size: var(--text-sm); }
.footer-grid { display: grid; gap: var(--space-5); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 300px minmax(0, 1fr); } }
.footer-brand { display: flex; align-items: center; gap: 10px; margin: 0; align-self: start; }
.footer-brand span { display: grid; }
.footer-brand strong { color: var(--ink); font-family: var(--font-brand); font-size: 1.25rem; font-weight: var(--weight-semibold); line-height: 1.2; }
.footer-notes p { max-width: 80ch; margin: 0 0 var(--space-2); }
.footer-notes .footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-bottom: var(--space-4); }
.footer-links a { font-weight: var(--weight-semibold); }

.not-found { padding-block: var(--space-8); }
.not-found p { margin: 0 0 var(--space-4); }
.not-found strong { display: block; }

/* Generated by tools/build-web.js from brand/tokens.css for browsers without light-dark(). */
@supports not (color: light-dark(#000, #fff)) {
  :root {
    --paper: #f6f4ef;
    --surface: #ffffff;
    --sunken: #ece9e1;
    --ink: #191c27;
    --ink-muted: #575c6b;
    --line: #e0dcd2;
    --line-strong: #8a8679;
    --accent: #2f3b93;
    --accent-hover: #253078;
    --on-accent: #ffffff;
    --accent-ink: #2f3b93;
    --accent-soft: #e6e8f6;
    --thread: #5865c8;
    --ok: #1d7348;
    --ok-soft: #e1f1e7;
    --warn: #865400;
    --warn-soft: #faefd6;
    --danger: #b02a1f;
    --danger-soft: #fbe7e4;
    --shadow-sm: 0 1px 2px rgb(25 28 39 / 0.08);
    --shadow-md: 0 1px 2px rgb(25 28 39 / 0.06), 0 10px 28px -12px rgb(25 28 39 / 0.22);
    --shadow-lg: 0 2px 6px rgb(25 28 39 / 0.06), 0 32px 64px -24px rgb(25 28 39 / 0.32);
  }
  @media (prefers-color-scheme: dark) {
  :root {
    --paper: #121419;
    --surface: #1a1d26;
    --sunken: #23262f;
    --ink: #eceef4;
    --ink-muted: #a3a8b8;
    --line: #2c303c;
    --line-strong: #6b7083;
    --accent: #a5aeff;
    --accent-hover: #bac1ff;
    --on-accent: #121633;
    --accent-ink: #aeb6ff;
    --accent-soft: #262b4d;
    --thread: #8994f0;
    --ok: #6fd29d;
    --ok-soft: #16301f;
    --warn: #f0c266;
    --warn-soft: #352a12;
    --danger: #ff8f84;
    --danger-soft: #3a1a18;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.5);
    --shadow-md: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px -12px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / 0.4), 0 32px 64px -24px rgb(0 0 0 / 0.8);
  }
  }
}
