/* ─────────────────────────────────────────────────────────────
   karpachess.com

   The palette is the app's own (lib/core/theme/themes.dart): Midnight
   Grove, its default theme, and Ivory Hall, the same tournament green by
   day, which a reader whose system is in light mode gets. The type is the
   app's too: Fraunces for display and Inter for text. Every file this
   page loads is served from this site.
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Until the two faces arrive (or if they never do), text is set in a local
   face scaled to their metrics, so the swap moves nothing. Each figure was
   measured from the font files on the page's own copy: Fraunces at 700 (the
   only weight the page sets it in) against Georgia Bold, Inter at 400 and at
   650 against Arial and Arial Bold. size-adjust also scales the overrides,
   so each override is the web face's ascent or descent divided by it. */
@font-face {
  font-family: "Fraunces Fallback";
  src: local("Georgia Bold"), local("Georgia-Bold");
  font-weight: 700;
  size-adjust: 93.99%;
  ascent-override: 104.06%;
  descent-override: 27.13%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("ArialMT");
  font-weight: 100 500;
  size-adjust: 105.08%;
  ascent-override: 92.19%;
  descent-override: 22.95%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT");
  font-weight: 600 900;
  size-adjust: 103.01%;
  ascent-override: 94.04%;
  descent-override: 23.42%;
  line-gap-override: 0%;
}

/* Midnight Grove */
:root {
  color-scheme: dark;
  --bg: #09130b;
  --panel: #1a211b;
  --raised: #29302a;
  --float: #384039;
  --text: #e4eae5;
  --text-dim: #a7ada8;
  --text-faint: #858a86;
  --accent: #79bb74;
  --on-accent: #0a120b;
  --tint: #497e50;
  --edge: rgba(158, 185, 162, 0.22);
  --check: rgba(73, 126, 80, 0.13);
  --header: rgba(9, 19, 11, 0.82);
  --shadow: 0 24px 60px rgba(2, 6, 3, 0.6);
  --shadow-sm: 0 10px 24px rgba(2, 6, 3, 0.45);
  --device: #030604;

  /* The review ladder, dark themes */
  --q-best: #7fa86a;
  --q-good: #9aa26b;
  --q-inaccuracy: #c9a45c;
  --q-mistake: #c08552;
  --q-blunder: #b9645a;

  --display: "Fraunces", "Fraunces Fallback", Georgia, "Times New Roman", serif;
  --body: "Inter", "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* The type roles, named as the app names them (core/theme/app_typography
     .dart): Fraunces 700 for display, title and heading, Inter for the rest.
     The two big roles follow the window; everything that is read stays put. */
  --type-display: clamp(2.75rem, 1.55rem + 4.4vw, 4.75rem);
  --type-title: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  --type-heading: 1.375rem;
  --type-lead: clamp(1.0625rem, 0.95rem + 0.45vw, 1.25rem);
  --type-body: 1.0625rem;
  --type-label: 0.9375rem;
  --type-caption: 0.8125rem;
  --type-overline: 0.75rem;

  /* Light text on a dark ground reads a touch tighter than it is: the night
     palette sets reading text with a little more air. */
  --leading-body: 1.65;
  --tracking-body: 0.005em;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --page: 1160px;
  --gutter: clamp(20px, 4vw, 40px);
  /* Where the page column starts, measured from the window's edge. */
  --inset: max(var(--gutter), calc((100vw - var(--page)) / 2));

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --quick: 0.18s;
}

/* Ivory Hall */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #efeae2;
    --panel: #fbf6ee;
    --raised: #fffdf5;
    --float: #ffffff;
    --text: #2f291e;
    --text-dim: #534d41;
    --text-faint: #6e675b;
    --accent: #39693b;
    --on-accent: #ffffff;
    --tint: #72824f;
    --edge: #d6d4c2;
    --check: rgba(114, 130, 79, 0.1);
    --header: rgba(239, 234, 226, 0.86);
    --shadow: 0 24px 56px rgba(66, 75, 46, 0.2);
    --shadow-sm: 0 10px 22px rgba(66, 75, 46, 0.14);
    --device: #1a211b;

    --q-best: #3f7040;
    --q-good: #6b7a3c;
    --q-inaccuracy: #9a7a26;
    --q-mistake: #a05f24;
    --q-blunder: #9a4335;

    --leading-body: 1.6;
    --tracking-body: 0;
  }
}

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

* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  font-family: var(--body);
  font-size: var(--type-body);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  color: var(--text);
  background: var(--bg);
  /* Thinned strokes suit light text on a dark ground, where it would
     otherwise bloom; dark text on Ivory keeps the system's full weight. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
@media (prefers-color-scheme: light) {
  body { -webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto; }
  .section--deep, .lightbox { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
}

/* The hero's squares and the screenshot strip run to the window's edges
   (100vw). Where a scrollbar takes up room, 100vw is wider than the page:
   clipping here keeps that from becoming a sideways scroll. */
main { overflow-x: clip; }

::selection { background: color-mix(in srgb, var(--accent) 34%, transparent); color: var(--text); }

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

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

/* The ring takes each control's own shape: never set a radius here, or a
   pill or a round button turns square under the keyboard. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a:not([class]):focus-visible { border-radius: 4px; }

ul[class], ol[class] { list-style: none; }

/* Drawn icons: one stroke, the colour of the text around them. */
.icon {
  flex: none;
  width: 1em; height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--type-label);
  font-weight: 700;
}
.skip:focus { top: 12px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }
/* The heading role: every card, beat and policy section. */
h3 {
  font-size: var(--type-heading);
  line-height: 1.25;
  letter-spacing: -0.006em;
}

strong { font-weight: 650; }

/* ───────── Header ───────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--gutter);
  background: var(--header);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--edge);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.brand__mark { border-radius: 22%; box-shadow: var(--shadow-sm); }
.brand__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--type-heading);
  line-height: 1;
  letter-spacing: -0.01em;
}

.nav__menu { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 28px); }
.nav__menu a {
  color: var(--text-dim);
  font-weight: 600;
  font-size: var(--type-label);
  text-decoration: none;
  border-radius: 8px;
  transition: color var(--quick) var(--ease-out), background-color var(--quick) var(--ease-out),
    filter var(--quick) var(--ease-out), transform var(--quick) var(--ease-out);
}
.nav__menu a:hover { color: var(--text); }
.nav__menu .nav__cta {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
}
.nav__menu .nav__cta:hover { color: var(--on-accent); filter: brightness(1.06); }
.nav__menu .nav__cta:active { transform: scale(0.97); }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
}
.nav__bar {
  display: block;
  width: 22px; height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.24s var(--ease-out), opacity 0.16s var(--ease-out);
}
/* Open, the three bars fold into a cross. */
.nav__toggle[aria-expanded="true"] .nav__bar:nth-child(2) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bar:nth-child(3) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .nav__bar:nth-child(4) { transform: translateY(-7px) rotate(-45deg); }

/* ───────── Shared ───────── */
.section {
  padding: clamp(64px, 9vw, 116px) var(--gutter);
}
.section > * { max-width: var(--page); margin-inline: auto; }
.section--panel { background: var(--panel); border-block: 1px solid var(--edge); }

.section__head { margin-bottom: clamp(32px, 5vw, 52px); }
/* The title role: every section, the closing call and the policy. */
.section__title, .cta h2, .legal h1 {
  font-size: var(--type-title);
  line-height: 1.08;
  letter-spacing: -0.018em;
}
.section__title { max-width: 22ch; }
/* The lead role: the hero's and every section's opening line. */
.hero__lead, .section__lead {
  color: var(--text-dim);
  font-size: var(--type-lead);
  line-height: 1.55;
}
.section__lead {
  margin-top: 18px;
  max-width: 60ch;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--quick) var(--ease-out), filter var(--quick) var(--ease-out),
    transform var(--quick) var(--ease-out);
}
.button:hover { filter: brightness(1.06); }
.button:active { transform: scale(0.97); }
.button--quiet {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--edge);
  box-shadow: none;
}
.button--quiet:hover { background: var(--raised); filter: none; }

/* A text link that leads somewhere, its arrow after it. */
.go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.go .icon { width: 1.05em; height: 1.05em; transition: transform var(--quick) var(--ease-out); }
.go:hover .icon { transform: translateX(3px); }

/* The store badges. KarpaChess is on the App Store: Apple's official black
   badge (badges/app-store.svg, from Apple's App Store Marketing Tools), first
   in the row as Apple asks, never modified or animated, with clear space of a
   quarter of its height (the gap). Google Play still says "Coming soon";
   swap in Google's official badge when that listing goes live. */
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.store-badge { display: inline-flex; flex: none; border-radius: 10px; }
.store-badge img { display: block; width: auto; height: 56px; }
.stores--center { justify-content: center; }
.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: 176px;
  min-height: 56px;
  padding: 8px 20px;
  border-radius: 14px;
  border: 1px dashed var(--text-faint);
  background: var(--raised);
  line-height: 1.15;
}
.store__small { color: var(--text-dim); font-size: var(--type-caption); font-weight: 600; }
/* Sized to the App Store badge's wordmark beside it, not to a role. */
.store__name { font-size: 1.125rem; font-weight: 700; }

/* ───────── Hero ───────── */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(56px, 8vw, 104px);
}
/* A board's worth of faint squares behind the devices. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  background:
    conic-gradient(var(--check) 25%, transparent 0 50%, var(--check) 0 75%, transparent 0)
    0 0 / 96px 96px;
  -webkit-mask-image: radial-gradient(ellipse 55% 70% at 72% 45%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 55% 70% at 72% 45%, #000 20%, transparent 75%);
}

/* The display role: the hero alone. */
.hero__title {
  font-size: var(--type-display);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}
.hero__lead {
  max-width: 52ch;
  margin-bottom: 32px;
}
.hero__lead strong { color: var(--text); }

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
  color: var(--text-dim);
  font-size: var(--type-label);
  font-weight: 600;
}
.hero__facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero__facts li::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

.hero__devices {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1 / 1.04;
  justify-self: end;
}
.device {
  position: absolute;
  background: var(--device);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}
.device--tablet {
  top: 0; right: 0;
  width: 77%;
  padding: 2.4%;
  border-radius: 26px;
}
.device--tablet img { border-radius: 14px; }
.device--phone {
  bottom: 0; left: 0;
  width: 37%;
  padding: 2.2%;
  border-radius: 34px;
}
.device--phone img { border-radius: 26px; }

/* ───────── Numbers ───────── */
.numbers {
  padding: 0 var(--gutter);
}
.numbers__list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: var(--page);
  margin-inline: auto;
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
}
.numbers__list > div {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  padding: 26px 12px;
  text-align: center;
}
.numbers__list > div + div { border-left: 1px solid var(--edge); }
.numbers__list dd {
  font-family: var(--display);
  font-size: var(--type-title);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.018em;
  color: var(--accent);
}
.numbers__list dt { color: var(--text-dim); font-size: var(--type-label); font-weight: 600; }

/* ───────── How it teaches ───────── */
.journey {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: beat;
}
.journey__step {
  position: relative;
  padding: 28px 26px 30px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  background: var(--panel);
}
.journey__step h3 { margin: 20px 0 8px; }
.journey__step p { color: var(--text-dim); }
/* The chevron between two beats, as the lesson's own tracker draws it:
   two strokes, centred in the gap. */
.journey__step + .journey__step::before {
  content: "";
  position: absolute;
  top: 50%; left: -11px;
  width: 8px; height: 8px;
  border-top: 2px solid var(--text-faint);
  border-right: 2px solid var(--text-faint);
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(45deg);
}
.journey__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--raised);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--type-label);
  counter-increment: beat;
}
.journey__chip::before {
  content: counter(beat);
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--type-caption);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* The eight arts in the app's order. A name never breaks across lines. */
.arts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 28px;
  color: var(--text-dim);
  font-size: var(--type-label);
  text-align: center;
}
.arts__label { color: var(--text); font-weight: 600; }
.arts__list { display: flex; flex-wrap: wrap; justify-content: center; row-gap: 4px; }
.arts__list li { white-space: nowrap; }
.arts__list li:not(:last-child)::after {
  content: "·";
  margin-inline: 0.5em;
  color: var(--text-faint);
}

/* ───────── Features ───────── */
/* Six modes as an open, ruled grid: a hairline over each, its mark beside
   its name. */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px clamp(28px, 4vw, 48px);
}
.feature {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-content: start;
  align-items: center;
  column-gap: 14px;
  padding-top: 26px;
  border-top: 1px solid var(--edge);
}
.feature > :not(.feature__icon):not(h3) { grid-column: 1 / -1; }
.feature__icon {
  width: 40px; height: 40px;
  padding: 9px;
  border-radius: 12px;
  background: var(--raised);
  border: 1px solid var(--edge);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature p { margin-top: 14px; color: var(--text-dim); }

/* Ink lifted toward the text colour until each grade reads at 4.5:1 on its
   own wash, as the app's AppTokens.legible does. */
.quality { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.quality li {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: var(--type-caption);
  font-weight: 700;
  color: color-mix(in srgb, var(--q) 70%, var(--text));
  background: color-mix(in srgb, var(--q) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--q) 38%, transparent);
}
.quality--best { --q: var(--q-best); }
.quality--good { --q: var(--q-good); }
.quality--inaccuracy { --q: var(--q-inaccuracy); }
.quality--mistake { --q: var(--q-mistake); }
.quality--blunder { --q: var(--q-blunder); }

/* ───────── Screens ───────── */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-top: 24px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--panel);
}
.tabs__tab {
  min-width: 96px;
  min-height: 40px;
  padding: 6px 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font: 600 var(--type-label) / 1.35 var(--body);
  cursor: pointer;
  transition: background-color var(--quick) var(--ease-out), color var(--quick) var(--ease-out),
    transform var(--quick) var(--ease-out);
}
.tabs__tab:hover { color: var(--text); }
.tabs__tab:active { transform: scale(0.97); }
.tabs__tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }

.gallery { position: relative; }
/* The strip runs to the window's edges, so a screen is cut by the edge of
   the window rather than mid-page, and it still starts on the column. */
.shots {
  display: flex;
  gap: 22px;
  margin-inline: calc(50% - 50vw);
  padding: 6px var(--inset) 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--inset);
  scrollbar-color: var(--tint) transparent;
  overscroll-behavior-x: contain;
}
.shots[hidden] { display: none; }
.shot {
  flex: 0 0 auto;
  width: 236px;
  scroll-snap-align: start;
}
.shots--tablet .shot { width: 372px; }
.shot__open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 26px;
}
.shots--tablet .shot__open { border-radius: 18px; }
.shot img {
  width: 100%;
  border: 6px solid var(--device);
  border-radius: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
}
.shots--tablet .shot img { border-radius: 18px; }
.shot__open:hover img { transform: translateY(-4px); box-shadow: var(--shadow); }
.shot figcaption {
  margin-top: 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: var(--type-label);
  font-weight: 600;
}

.gallery__step {
  position: absolute;
  top: calc(50% - 30px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: 1px solid var(--edge);
  border-radius: 50%;
  background: var(--float);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: opacity var(--quick) var(--ease-out), transform var(--quick) var(--ease-out),
    background-color var(--quick) var(--ease-out);
}
.gallery__step:hover { background: var(--raised); }
.gallery__step:active { transform: scale(0.94); }
.gallery__step--back { left: -10px; }
.gallery__step--next { right: -10px; }
.gallery__step:disabled { opacity: 0; pointer-events: none; }

/* ───────── Make it yours ───────── */
/* The overline: small capitals over each picker strip. */
.picker__title {
  margin: 36px auto 14px;
  font-family: var(--body);
  font-size: var(--type-overline);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.picker__title:first-of-type { margin-top: 0; }

.themes, .boards, .sets { display: grid; gap: 14px; }
.themes { grid-template-columns: repeat(5, 1fr); }
.boards { grid-template-columns: repeat(5, 1fr); }
.sets { grid-template-columns: repeat(5, 1fr); }

/* A theme card, drawn the way the app's theme picker draws one. */
.themes li {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 1.3;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: var(--sw-bg);
  color: var(--sw-text);
  font-size: var(--type-caption);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.themes li::before {
  content: "";
  position: absolute;
  top: 10px; left: 10px; right: 10px;
  height: 16px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 10px 50%, var(--sw-accent) 0 4px, transparent 4.5px),
    var(--sw-panel);
}
.themes li::after {
  content: "";
  position: absolute;
  top: 40%; left: 50%;
  width: 20%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 6px;
  background: var(--sw-accent);
  opacity: 0.8;
}

.boards li, .sets li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: var(--raised);
  color: var(--text-dim);
  font-size: var(--type-caption);
  font-weight: 600;
}
.boards li::before {
  content: "";
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: repeating-conic-gradient(var(--dark) 0 25%, var(--light) 0 50%) 0 0 / 50% 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--dark) 70%, #000);
}
.boards li { gap: 14px; padding-top: 14px; }

/* A piece set on a 2×2 corner of the tournament board, as the app's set
   picker previews it. */
.set {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: repeating-conic-gradient(#769656 0 25%, #eeeed2 0 50%) 0 0 / 100% 100%;
}
.set img { width: 100%; height: 100%; }

/* ───────── Languages ───────── */
.langs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.langs li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-md);
  background: var(--panel);
  font-weight: 600;
}
.langs__flag { font-size: 1.45rem; line-height: 1; }
/* The system fonts that draw these scripts run small beside Inter; a
   tighter line keeps their tiles the height of the others. */
.langs [lang="ar"], .langs [lang="hi"] { font-size: 1.12em; line-height: 1.4; }

/* ───────── Privacy ───────── */
/* Always the app's night palette, in both of the page's themes. */
.section--deep {
  --text: #e4eae5;
  --text-dim: #a7ada8;
  --accent: #79bb74;
  --edge: rgba(158, 185, 162, 0.22);
  color: var(--text);
  background:
    conic-gradient(rgba(73, 126, 80, 0.055) 25%, transparent 0 50%, rgba(73, 126, 80, 0.055) 0 75%, transparent 0)
    0 0 / 96px 96px,
    #0b170e;
}
.privacy {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px clamp(24px, 3vw, 40px);
}
.privacy__card {
  padding-top: 22px;
  border-top: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.privacy__card h3 { margin-bottom: 8px; color: var(--accent); }
.privacy__card p { color: var(--text-dim); }
.privacy__more { margin-top: clamp(32px, 4vw, 44px); }

/* ───────── Open source ───────── */
.source {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 32px 56px;
}
.source p { margin-top: 16px; max-width: 62ch; color: var(--text-dim); }
.source__links { display: flex; flex-wrap: wrap; gap: 12px; }

/* ───────── Support ───────── */
.support {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px clamp(28px, 4vw, 48px);
}
.support__card {
  padding-top: 24px;
  border-top: 1px solid var(--edge);
}
.support__card h3 { margin-bottom: 8px; }
.support__card p { color: var(--text-dim); }
.support__contact { margin-top: 14px; font-weight: 700; overflow-wrap: anywhere; }

/* ───────── Get the app ───────── */
.cta {
  padding: clamp(64px, 9vw, 112px) var(--gutter);
  text-align: center;
  background:
    radial-gradient(ellipse 50% 70% at 50% 40%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%),
    var(--bg);
}
.cta__mark { margin: 0 auto 22px; border-radius: 22%; box-shadow: var(--shadow); }
.cta p { max-width: 46ch; margin: 14px auto 28px; color: var(--text-dim); }

/* ───────── Footer ───────── */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 44px var(--gutter) 52px;
  border-top: 1px solid var(--edge);
  background: var(--panel);
  text-align: center;
}
.site-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; }
.site-footer__links a {
  color: var(--text-dim);
  font-size: var(--type-label);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: color var(--quick) var(--ease-out);
}
.site-footer__links a:hover,
.site-footer__links a[aria-current="page"] { color: var(--text); }
.site-footer__legal { color: var(--text-faint); font-size: var(--type-caption); }

/* ───────── Lightbox ───────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(3, 6, 4, 0.94);
  transition: opacity 0.22s var(--ease-out);
}
.lightbox[hidden] { display: none; }
.lightbox__figure { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.lightbox__img {
  max-width: min(92vw, 900px);
  max-height: 82vh;
  width: auto;
  border: 6px solid #000;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transition: transform 0.32s var(--ease-out);
}
/* Opening fades the viewer in and lets the screen settle into place. */
@starting-style {
  .lightbox { opacity: 0; }
  .lightbox__img { transform: scale(0.96); }
}
.lightbox__caption { margin-top: 14px; color: #e4eae5; font-size: var(--type-label); font-weight: 600; }
.lightbox__close,
.lightbox__step {
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  cursor: pointer;
  transition: background-color var(--quick) var(--ease-out), transform var(--quick) var(--ease-out);
}
.lightbox :focus-visible { outline-color: #79bb74; }
.lightbox__close {
  position: absolute;
  top: 14px; right: 18px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: none;
  font-size: 28px;
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.12); }
.lightbox__step {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 26px;
}
.lightbox__step:hover { background: rgba(255, 255, 255, 0.24); }
.lightbox__step:active, .lightbox__close:active { transform: scale(0.94); }

/* ───────── Policy pages: privacy, legal notice, accessibility ───────── */
.legal {
  max-width: calc(38rem + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(36px, 7vw, 72px) var(--gutter) 96px;
}
.legal__back { margin-bottom: 30px; text-decoration: none; }
.legal__back .icon { transition: transform var(--quick) var(--ease-out); }
.legal__back:hover .icon { transform: translateX(-3px); }
.legal h1 { margin-bottom: 12px; }
.legal h2 {
  font-size: var(--type-heading);
  line-height: 1.25;
  letter-spacing: -0.006em;
  margin: 44px 0 12px;
}
/* A section's parts (the app's, the site's, each region's rights): the lead
   role, a step under the heading role of the section above them. */
.legal h3 {
  font-size: var(--type-lead);
  line-height: 1.3;
  margin: 30px 0 10px;
}
.legal p, .legal ul, .legal dl { margin-bottom: 14px; }
.legal ul { padding-left: 1.3em; }
.legal ul ul { margin: 8px 0 0; }
.legal li { margin-bottom: 8px; }
.legal li::marker { color: var(--accent); }
.legal code, .legal kbd { font-family: var(--mono); font-size: 0.9em; }
.legal kbd {
  padding: 1px 6px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--raised);
}

/* The policy's contents, under its summary: a quiet panel whose title is
   the overline, as over the picker strips. */
.toc {
  margin: 0 0 8px;
  padding: 18px 22px 8px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-md);
  background: var(--panel);
}
.legal .toc__title {
  margin: 0 0 12px;
  font-family: var(--body);
  font-size: var(--type-overline);
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.toc ul { columns: 2 13rem; column-gap: 28px; }
.toc li { break-inside: avoid; }

/* The legal notice's facts (publisher, host): label beside value, stacked
   on a phone. */
.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 22px;
}
.facts dt { color: var(--text-dim); font-weight: 600; }
.facts dd { overflow-wrap: anywhere; }
/* A paragraph that is all bold: the policy's summary, on a wash of the
   accent. */
.legal .lead {
  margin: 26px 0;
  padding: 18px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--edge));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
}
/* ...and the first one, under the title, is its date. */
.legal h1 + .lead {
  margin: 0 0 30px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-dim);
}
.legal h1 + .lead strong { font-weight: 600; }

/* ───────── Narrower windows ───────── */
@media (max-width: 1020px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .privacy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .langs { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero__lead { margin-inline: auto; }
  .hero .stores, .hero__facts { justify-content: center; }
  .hero__devices { justify-self: center; max-width: 480px; }
  .journey { grid-template-columns: 1fr; gap: 28px; }
  .journey__step + .journey__step::before {
    top: -14px; left: 50%;
    transform: translate(-50%, -50%) rotate(135deg);
  }
  .source { grid-template-columns: 1fr; }
  .themes, .sets { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
}

@media (max-width: 760px) {
  .nav__toggle { display: flex; }
  .nav__menu:not(.nav__menu--static) {
    position: absolute;
    top: calc(100% + 8px); right: var(--gutter);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 220px;
    padding: 10px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-md);
    background: var(--float);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav__menu.open { display: flex; }
  .nav__menu:not(.nav__menu--static) a { display: block; padding: 10px 12px; border-radius: 8px; }
  .nav__menu:not(.nav__menu--static) a:not(.nav__cta):hover { background: var(--raised); }
  .nav__menu:not(.nav__menu--static) .nav__cta { margin-top: 6px; text-align: center; }
  .features, .support { grid-template-columns: 1fr; gap: 32px; }
  .feature { padding-top: 22px; }
  .themes, .sets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Five boards as three over two, the two centred beneath. */
  .boards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .boards li { grid-column: span 2; }
  .boards li:nth-child(4) { grid-column: 2 / span 2; }
  .langs { grid-template-columns: repeat(2, 1fr); }
  .gallery__step { display: none; }
  .shot { width: 200px; }
  .shots--tablet .shot { width: 290px; }
  /* A 200px phone keeps every caption on one line at the caption role. */
  .shot figcaption { font-size: var(--type-caption); }
}

/* Five numbers as one over two pairs. */
@media (max-width: 600px) {
  .numbers__list { grid-template-columns: repeat(2, 1fr); }
  .numbers__list > div + div { border-left: 0; border-top: 1px solid var(--edge); }
  .numbers__list > div:first-child { grid-column: 1 / -1; }
  .numbers__list > div:nth-child(odd):not(:first-child) { border-left: 1px solid var(--edge); }
  .numbers__list > div { padding: 20px 10px; }
}

@media (max-width: 480px) {
  :root { --type-body: 1rem; }
  /* Four facts as two pairs, so none is left alone on a line. */
  .hero__facts {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: center;
    gap: 8px 28px;
  }
  .privacy { grid-template-columns: 1fr; gap: 28px; }
  /* The policy pages' header holds the brand and two links, which ran into
     each other at 320px. The brand already links home, so Home goes. */
  .nav__menu--static .nav__home { display: none; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd + dt { margin-top: 10px; }
  /* Half a phone is too narrow for "Bahasa Indonesia" on one line: the
     names flow instead, each tile as wide as its name. */
  .langs { display: flex; flex-wrap: wrap; gap: 8px; }
  .langs li { padding: 10px 14px; gap: 8px; font-size: var(--type-label); }
  .langs__flag { font-size: 1.25rem; }
  .store { min-width: 0; flex: 1 1 150px; }
  .lightbox { padding: 12px; }
  .lightbox__step { position: absolute; bottom: 18px; }
  #lightboxPrev { left: 24px; }
  #lightboxNext { right: 24px; }
  .lightbox__img { max-height: 74vh; }
}

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