/* hearoutgames.com: the one stylesheet every page links. Fonts, theme tokens, the top bar with its menu, buttons,
   the home page (one screen: the games, the Alien Customs demo in a phone and the download block), the text pages
   (accessibility, privacy, terms, support) and the footer.

   Themes. Every colour is a token. Dark (the brand's navy and gold) is the default; Light and High contrast (black,
   white and yellow) come from the device's settings (prefers-color-scheme, prefers-contrast), as do less motion
   (prefers-reduced-motion) and Windows' forced colours. Text sizes are in rem, so the browser's text size and zoom
   scale everything. In every theme, text keeps a contrast of at least 7:1 on --bg and --surface:
   test/pages.test.js checks --ink, --muted, --faint, --lilac, --accent and --accent-hover there, --accent-ink on
   --accent, --play-ink on --play (the demo's green Play button, yellow in high contrast), and every literal `color:`
   in this file. The purples (--purple, --purple-deep) are for surfaces and glows only, never for text. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- theme: dark (the default) ---------- */
:root {
  color-scheme: dark;
  --bg: #0b1430;
  --bg-deep: #070d22;
  --surface: #0f1a3d;
  --surface-2: #15214a;
  --ink: #f6f8ff;
  --muted: #c5cfee;
  --faint: #b3bee2;
  --accent: #ffd54f;
  --accent-hover: #ffe58a;
  --accent-ink: #241a00;
  --lilac: #cdb9ff;
  --on-purple: #ffffff;
  --purple: #7a4ce0;
  --purple-deep: #2c1263;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.26);
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.075);
  --field: #081028;
  --bar: rgba(9, 16, 40, 0.86);
  --glow: rgba(122, 76, 224, 0.42);
  --glow-gold: rgba(255, 213, 79, 0.14);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
  --frame-1: #2b3466;
  --frame-2: #0a1029;
  --screen: #0a1129;
  --icon-1: #7a4ce0;
  --icon-2: #2c1263;
  --qr-frame: #ffffff;
  --play: #3ddc84;
  --play-hover: #6be7a3;
  --play-ink: #0b1430;
  --play-edge: #3ddc84;
  --play-glow: rgba(61, 220, 132, 0.45);
  --border-w: 1px;
}

/* ---------- theme: light ---------- */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f6f5fb;
    --bg-deep: #ebe9f5;
    --surface: #ffffff;
    --surface-2: #f2f0fa;
    --ink: #0b1430;
    --muted: #323d5c;
    --faint: #3d4767;
    --accent: #47279a;
    --accent-hover: #351b7a;
    --accent-ink: #ffffff;
    --lilac: #47279a;
    --on-purple: #ffffff;
    --purple: #7a4ce0;
    --purple-deep: #4a2a9c;
    --line: rgba(11, 20, 48, 0.14);
    --line-strong: rgba(11, 20, 48, 0.3);
    --card: #ffffff;
    --card-hover: #fbfaff;
    --field: #ffffff;
    --bar: rgba(246, 245, 251, 0.9);
    --glow: rgba(122, 76, 224, 0.2);
    --glow-gold: rgba(255, 196, 0, 0.12);
    --shadow: 0 1px 2px rgba(11, 20, 48, 0.06), 0 18px 40px -26px rgba(11, 20, 48, 0.35);
    --shadow-lg: 0 40px 80px -36px rgba(11, 20, 48, 0.45);
    --frame-1: #2b3466;
    --frame-2: #0b1430;
    --screen: #ffffff;
    --icon-1: #7a4ce0;
    --icon-2: #4a2a9c;
    --qr-frame: #ffffff;
    --play: #3ddc84;
    --play-hover: #2fc874;
    --play-ink: #0b1430;
    --play-edge: #138a4a;
    --play-glow: rgba(19, 138, 74, 0.3);
    --border-w: 1px;
  }
}
/* ---------- theme: high contrast (black, white and yellow), also for prefers-contrast: more ---------- */
@media (prefers-contrast: more) {
  :root {
    color-scheme: dark;
    --bg: #000000;
    --bg-deep: #000000;
    --surface: #000000;
    --surface-2: #000000;
    --ink: #ffffff;
    --muted: #ffffff;
    --faint: #ffffff;
    --accent: #ffff00;
    --accent-hover: #ffff8c;
    --accent-ink: #000000;
    --lilac: #ffff00;
    --on-purple: #ffffff;
    --purple: #000000;
    --purple-deep: #000000;
    --line: #ffffff;
    --line-strong: #ffffff;
    --card: #000000;
    --card-hover: #000000;
    --field: #000000;
    --bar: #000000;
    --glow: transparent;
    --glow-gold: transparent;
    --shadow: none;
    --shadow-lg: none;
    --frame-1: #000000;
    --frame-2: #000000;
    --screen: #000000;
    --icon-1: #000000;
    --icon-2: #000000;
    --qr-frame: #ffffff;
    --play: #ffff00;
    --play-hover: #ffff8c;
    --play-ink: #000000;
    --play-edge: #ffffff;
    --play-glow: transparent;
    --border-w: 2px;
  }
}
/* ---------- sizes ---------- */
:root {
  --radius: 20px;
  --radius-sm: 14px;
  --gutter: 16px;
  --max: 1160px;
  --bar-h: 68px;
  --measure: 68ch;
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; } }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 560px at 85% -160px, var(--glow), transparent 70%),
    radial-gradient(800px 480px at 0% -120px, var(--glow-gold), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font);
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }

/* the apps' keyboard focus ring: 3px, gold (yellow in high contrast, purple in light) */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

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

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  text-decoration: underline;
  z-index: 100;
}
.skip:focus { left: var(--gutter); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 24px;
  border-radius: 999px;
  border: var(--border-w) solid transparent;
  font-family: var(--font);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }

.btn-gold {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-gold:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--card-hover); border-color: var(--ink); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: var(--border-w) solid var(--line);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar { background: var(--bg); }
}

.topbar-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: var(--bar-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  border-radius: 12px;
}
.brand img { width: auto; height: 40px; flex: none; }

/* the logo in white on dark themes, navy on light: one of the pair is shown (and read) at a time */
.on-light { display: none; }
@media (prefers-color-scheme: light) {
  .on-dark { display: none; }
  .on-light { display: block; }
}
@media (prefers-contrast: more) {
  .on-dark { display: block; }
  .on-light { display: none; }
}

.site-menu { order: 2; }
.menu-toggle { order: 3; flex: none; }

.site-menu ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.97rem;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.site-menu a:not(.btn):hover { background: var(--card-hover); text-decoration: underline; text-underline-offset: 4px; }
.site-menu a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* the burger, only on narrow screens and only with JavaScript */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-right: -6px;
  padding: 0;
  border: var(--border-w) solid var(--line-strong);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.menu-toggle:hover { background: var(--card-hover); }

.burger { position: relative; display: block; width: 22px; height: 16px; }
.burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 6.75px; }
.burger span:nth-child(3) { top: 13.5px; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(1) { top: 6.75px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(3) { top: 6.75px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  /* without JavaScript the links simply sit under the logo, all reachable */
  .topbar-inner { padding-top: 10px; padding-bottom: 10px; }
  .site-menu { width: 100%; }

  /* with JavaScript: a burger, and a panel under the bar */
  .js .topbar-inner { flex-wrap: nowrap; padding-top: 0; padding-bottom: 0; }
  .js .menu-toggle { display: inline-flex; }
  .js .site-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    max-height: calc(100vh - var(--bar-h));
    overflow-y: auto;
    background: var(--surface);
    border-bottom: var(--border-w) solid var(--line);
    box-shadow: var(--shadow-lg);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .js .site-menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
  }
  .js .site-menu ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-width: calc(var(--max) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 12px var(--gutter) 20px;
  }
  .js .site-menu a {
    display: flex;
    min-height: 56px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 1.15rem;
  }
  .js .site-menu li + li { border-top: var(--border-w) solid var(--line); }
  .js .site-menu li a:not(.btn) { margin: 2px 0; }
}

/* ---------- small parts ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card {
  border-radius: var(--radius);
  background: var(--card);
  border: var(--border-w) solid var(--line);
  box-shadow: var(--shadow);
  padding: 28px;
}

/* ---------- home: one screen. The wordmark, the demo in a phone, the games and the download block: on a wide
   screen the phone on the left and the rest beside it, centred; on a narrow one, one column in the same order. ---------- */
.home {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  grid-template-rows: 1fr auto auto 1fr;
  grid-template-areas: "demo ." "demo games" "demo get" "demo .";
  column-gap: clamp(40px, 6vw, 96px);
  align-items: start;
  padding-top: 28px;
  padding-bottom: 16px;
}
.demo { grid-area: demo; }
.games-block { grid-area: games; margin-bottom: 32px; }
.games-title { margin-bottom: 20px; font-size: clamp(1.6rem, 2.6vw, 2rem); letter-spacing: -0.01em; }
.get { grid-area: get; }

/* ---------- home: the phone and the demo ---------- */
.phone {
  position: relative;
  width: min(100%, 360px);
  margin: 0 auto;
  padding: 10px;
  border-radius: 54px;
  background: linear-gradient(150deg, var(--frame-1), var(--frame-2) 60%);
  border: var(--border-w) solid var(--line-strong);
  box-shadow: var(--shadow-lg), 0 0 120px -20px var(--glow);
}
.phone::before {
  /* the glow behind it */
  content: "";
  position: absolute;
  inset: 12% -8% 8%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}
.phone-notch {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 96px;
  height: 26px;
  margin-left: -48px;
  border-radius: 20px;
  background: #02040c;
  box-shadow: inset 0 0 0 1px var(--line);
  z-index: 3;
}
.phone-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: clamp(560px, calc(100vh - 190px), 680px);
  border-radius: 43px;
  overflow: hidden;
  background: var(--screen);
  border: var(--border-w) solid var(--line);
}

/* the game's header bar, as the app's */
.demo-title {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 50px 18px 12px;
  background: var(--surface-2);
  border-bottom: var(--border-w) solid var(--line);
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  color: var(--ink);
}

/* the start: the talking circle (the game's cover in its ring) and Play */
.demo-cover {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  min-height: 0;
  padding: 20px 22px 36px;
  text-align: center;
}
.talk-circle {
  position: relative;
  width: 172px;
  height: 172px;
  padding: 12px;
  border-radius: 50%;
  box-shadow: 0 0 70px -12px var(--glow);
}
.talk-circle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid var(--accent);
}
.talk-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  min-width: 200px;
  padding: 10px 38px 10px 30px;
  border-radius: 999px;
  border: 2px solid var(--play-edge);
  background: var(--play);
  color: var(--play-ink);
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 14px 34px -12px var(--play-glow);
  transition: transform 0.18s ease, background-color 0.18s ease;
}
.play-button:hover { background: var(--play-hover); transform: translateY(-1px); }
.play-button svg { width: 28px; height: 28px; flex: none; }
.cover-note { color: var(--muted); font-size: 0.92rem; line-height: 1.45; max-width: 30ch; }
.demo-cover[hidden], .player[hidden] { display: none; }
.demo-foot { margin: 12px auto 0; max-width: 44ch; color: var(--muted); font-size: 0.88rem; text-align: center; }

/* the player */
.player {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 10px 12px 14px;
  gap: 8px;
}
.player-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 6px 4px;
  border-radius: 14px;
  border: var(--border-w) solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
}
.tool svg { width: 20px; height: 20px; flex: none; }
.tool:hover:not([aria-disabled="true"]) { background: var(--card-hover); border-color: var(--line-strong); }
.tool[aria-disabled="true"] { cursor: default; color: var(--muted); border-style: dashed; }
.tool .i-play { display: none; }
.tool[data-paused] .i-play { display: block; }
.tool[data-paused] .i-pause { display: none; }
.tool[data-paused] { border-color: var(--accent); color: var(--accent); }

.player-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 24px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}
.player-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.player-state[data-state="speaking"]::before { background: var(--lilac); animation: pulse 1.2s ease-in-out infinite; }
.player-state[data-state="turn"]::before, .player-state[data-state="listening"]::before { background: var(--accent); }
.player-state[data-state="listening"]::before { animation: pulse 0.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: 0.6; } }

.captions {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 6px 10px;
  border-radius: 16px;
  scroll-behavior: smooth;
}
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.feed li { line-height: 1.45; font-size: 1rem; }
.feed .line { padding: 8px 12px; border-radius: 14px; border: var(--border-w) solid transparent; transition: background-color 0.2s ease; }
.feed .line.is-now { background: var(--card-hover); border-color: var(--line); }
.feed .who {
  display: block;
  color: var(--lilac);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.feed .reply {
  align-self: flex-end;
  max-width: 85%;
  padding: 8px 14px;
  border-radius: 16px 16px 4px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.feed .note {
  align-self: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.end-panel {
  margin: 14px 4px 4px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-2);
  border: var(--border-w) solid var(--line-strong);
  text-align: center;
}
.end-panel[hidden] { display: none; }
.end-panel h3 { font-size: 1.2rem; margin-bottom: 6px; }
.end-panel h3:focus { outline: none; }
.player[data-state="ended"] .answer-bar, .player[data-state="ended"] .mic-note { display: none; }
.end-panel p { color: var(--muted); font-size: 0.95rem; }
.end-actions, .end-stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.end-stores[hidden] { display: none; }
.end-actions .btn, .store-mini { min-height: 44px; padding: 8px 18px; font-size: 0.95rem; }
.store-mini {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: var(--border-w) solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.store-mini:hover { border-color: var(--ink); }
.end-soon { flex-basis: 100%; font-size: 0.85rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips:empty { display: none; }
.chip {
  min-height: 44px;
  min-width: 64px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}
.chip:hover { background: var(--accent); color: var(--accent-ink); }

.answer-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}
.answer-bar input {
  min-width: 0;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 14px;
  border: var(--border-w) solid var(--line-strong);
  background: var(--field);
  color: var(--ink);
  font-size: 1rem;
}
.answer-bar input::placeholder { color: var(--faint); opacity: 1; }
.answer-bar input:focus-visible { outline-offset: 1px; }
.send, .mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  min-width: 48px;
  padding: 8px 14px;
  border-radius: 14px;
  border: var(--border-w) solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
}
.send { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mic svg { width: 20px; height: 20px; }
.mic[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mic[data-listening] { background: var(--accent); color: var(--accent-ink); }
.mic[hidden] { display: none; }
.mic-note { color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.mic-note[hidden] { display: none; }
@media (max-width: 380px) {
  .mic span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------- home: the games, small ---------- */
.games {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.game { display: flex; flex-direction: column; align-items: center; text-align: center; }
.game .cover {
  width: 100%;
  max-width: 96px;
  aspect-ratio: 1;
  height: auto;
  object-fit: cover;
  border-radius: 22px;
  background: var(--surface-2);
  border: var(--border-w) solid var(--line-strong);
}
.game h2 { margin-top: 8px; font-size: 0.95rem; line-height: 1.25; letter-spacing: 0; }
.game-type {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- home: download ---------- */
.get {
  padding: 18px 22px;
  border-radius: 22px;
  background: var(--card);
  border: var(--border-w) solid var(--line);
  box-shadow: var(--shadow);
}
.get h2 { font-size: 1.3rem; }
.get-lede { margin-top: 2px; color: var(--muted); font-size: 0.95rem; }
.get-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.get-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "qr store" "qr for";
  align-content: center;
  align-items: center;
  gap: 4px 14px;
}
.qr {
  grid-area: qr;
  display: block;
  width: 84px;
  height: 84px;
  padding: 4px;
  border-radius: 12px;
  background: var(--qr-frame);
  forced-color-adjust: none;
}
.store {
  grid-area: store;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 18px 6px 14px;
  border-radius: 14px;
  background: var(--ink);
  border: var(--border-w) solid var(--ink);
  color: var(--bg);
  text-decoration: none;
  line-height: 1.15;
  white-space: nowrap;
}
.store:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.store svg { width: 26px; height: 26px; flex: none; }
.store small { display: block; font-size: 0.72rem; font-weight: 700; }
.store strong { display: block; font-size: 1.1rem; font-weight: 800; }
.get-for { grid-area: for; align-self: start; color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.soon-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: var(--border-w) solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}
.soon-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- text pages ---------- */
.page-head { max-width: var(--measure); margin: 0 auto; padding: 64px 0 40px; }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 3.5rem); margin: 14px 0; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); font-size: 1.12rem; }
.page-head .eyebrow {
  padding: 6px 14px;
  border-radius: 999px;
  border: var(--border-w) solid var(--accent);
}

.doc { max-width: var(--measure); margin: 0 auto; }

.summary { margin-bottom: 44px; border-color: var(--line-strong); }
.summary h2 { font-size: 1.4rem; margin-bottom: 16px; color: var(--accent); }

.doc .checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 34px; }
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--icon-1), var(--icon-2));
  border: var(--border-w) solid var(--line-strong);
}
.checks li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  width: 8px;
  height: 5px;
  border-left: 2.5px solid var(--on-purple);
  border-bottom: 2.5px solid var(--on-purple);
  transform: rotate(-45deg);
}

.doc section { margin: 0 0 40px; padding-top: 4px; }
.doc section:last-child { margin-bottom: 0; }
.doc section + section { border-top: var(--border-w) solid var(--line); padding-top: 36px; }
.doc h2 { font-size: clamp(1.45rem, 3.6vw, 1.8rem); margin-bottom: 14px; }
.doc h3 { font-size: 1.15rem; margin: 26px 0 8px; color: var(--lilac); }
.doc p + p, .doc p + ul, .doc ul + p, .doc p + .table, .doc .table + p, .doc p + dl, .doc dl + p { margin-top: 12px; }
.doc section > p, .doc section > ul, .doc section > dl { color: var(--ink); }
.doc ul { padding-left: 22px; margin: 0; }
.doc ul li + li { margin-top: 8px; }
.doc ul li::marker { color: var(--lilac); }
.doc a { color: var(--accent); font-weight: 700; text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc a:hover { color: var(--accent-hover); }
.doc strong { color: var(--ink); }
.doc kbd {
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  border: var(--border-w) solid var(--line-strong);
  background: var(--surface-2);
  font-family: inherit;
  font-size: 0.92em;
  font-weight: 700;
}
.doc dl { margin: 0; display: grid; gap: 10px; }
.doc dt { font-weight: 800; }
.doc dd { margin: 2px 0 0; color: var(--muted); }

.note { color: var(--muted); font-size: 0.97rem; }
main { padding-bottom: 32px; }

/* support */
.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  border-color: var(--line-strong);
}
.contact h2 { font-size: 1.4rem; margin-bottom: 6px; color: var(--accent); }
.contact p { color: var(--muted); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.doc .button, .doc .button:hover { color: var(--accent-ink); }
.button:hover { background: var(--accent-hover); }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 44px; }
.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--card);
  border: var(--border-w) solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.93rem;
  text-decoration: none;
}
.doc .toc a { color: var(--ink); }
.toc a:hover { background: var(--card-hover); border-color: var(--line-strong); text-decoration: underline; }

.table {
  margin: 14px 0;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: var(--border-w) solid var(--line);
  background: var(--card);
}
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 11px 14px; vertical-align: top; }
th { color: var(--accent); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
tbody tr { border-top: var(--border-w) solid var(--line); }
td small { display: block; color: var(--muted); font-size: 0.82rem; }
td:first-child { font-weight: 700; }

/* 404 */
.lost { text-align: center; padding: 96px 0 64px; }
.lost img { width: 160px; margin: 0 auto 24px; }
.lost h1 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 12px; }
.lost p { color: var(--muted); margin-bottom: 28px; }

/* ---------- footer (the same on every page) ---------- */
footer {
  margin-top: 48px;
  padding: 44px 0 32px;
  border-top: var(--border-w) solid var(--line);
  background: var(--bg-deep);
}
.foot-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px 48px;
}
.foot-brand { display: flex; flex-direction: column; gap: 14px; flex: 1 1 420px; max-width: 72ch; }
.foot-hugo { display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; padding: 6px 0; border-radius: 6px; }
.foot-hugo img { height: 28px; width: auto; filter: brightness(0) invert(1); }
@media (prefers-color-scheme: light) { .foot-hugo img { filter: brightness(0); } }
@media (prefers-contrast: more) { .foot-hugo img { filter: brightness(0) invert(1); } }
.copy { color: var(--faint); font-size: 0.86rem; line-height: 1.55; }

.foot-legal, .foot-help { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.foot-legal a, .foot-help a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.foot-legal a:hover, .foot-help a:hover { text-decoration: underline; text-underline-offset: 4px; background: var(--card-hover); }
.foot-legal { margin-right: -12px; }
.foot-help { margin-left: -12px; }

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: var(--border-w) solid var(--line);
}
.foot-sister { color: var(--faint); font-size: 0.9rem; }
.foot-sister a { color: var(--accent); font-weight: 700; text-underline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .get-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "qr" "store" "for"; align-content: start; }
  .get-card .qr { margin-bottom: 8px; }
}

@media (max-width: 900px) {
  .home {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "games" "demo" "get";
    padding-top: 24px;
  }
  .games-block { margin-bottom: 36px; }
  .get { margin-top: 36px; }
  .get-card { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "qr store" "qr for"; align-content: center; }
  .get-card .qr { margin-bottom: 0; }
}

/* a phone can't scan its own screen: just the store buttons */
@media (max-width: 700px), (pointer: coarse) and (max-width: 1024px) {
  .qr { display: none; }
  .get-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "store" "for"; }
}

@media (max-width: 760px) {
  .card { padding: 22px 20px; }
  .page-head { padding: 40px 0 28px; }
  .foot-legal { margin-right: 0; margin-left: -12px; }
}

@media (max-width: 600px) {
  /* two to a row, each a small cover with its name and type beside it */
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .game { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "cover name" "cover type"; align-content: center; column-gap: 10px; text-align: left; }
  .game .cover { grid-area: cover; align-self: center; max-width: 64px; border-radius: 16px; }
  .game h2 { grid-area: name; align-self: end; margin-top: 0; font-size: 0.9rem; }
  .game-type { grid-area: type; align-self: start; margin-top: 2px; font-size: 0.66rem; letter-spacing: 0.08em; }
  .get { padding: 18px 16px; }
  .get-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .store { justify-self: stretch; }
}

@media (max-width: 560px) {
  .contact .button { width: 100%; }
  th, td { padding: 9px 10px; }
  td:nth-child(2), td:nth-child(3) { white-space: nowrap; }
  td small { white-space: normal; }
}

@media (max-width: 359px) {
  .games { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 440px) {
  .phone::before { inset: 10% 0; }
  .phone { padding: 8px; border-radius: 44px; }
  .phone-screen { border-radius: 36px; }
  .topbar-inner { gap: 8px; }
  .brand img { height: 34px; }
}
@media (max-width: 380px) {
  body { font-size: 1rem; }
  .player { padding: 0 8px 10px; }
  .tool { font-size: 0.72rem; }
}

/* ---------- less motion, from the device's setting ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .play-button:hover { transform: none; }
}
/* ---------- Windows high contrast and other forced colours ---------- */
@media (forced-colors: active) {
  .topbar, footer { border-color: CanvasText; }
  .menu-toggle, .btn, .store, .store-mini, .tool, .chip, .send, .mic, .play-button, .card,
  .get, .phone, .phone-screen, .end-panel, .answer-bar input { border: 1px solid ButtonText; }
  .burger span, .soon-dot, .player-state::before { background: CanvasText; }
  .talk-circle::after { border-color: CanvasText; }
  .phone::before { display: none; }
  .feed .reply { border: 1px solid CanvasText; }
  .feed .line.is-now { border-color: Highlight; }
  .mic[aria-pressed="true"] { border: 3px solid Highlight; }
  .site-menu a[aria-current="page"] { text-decoration: underline; }
}
