/* SceneVoice website.
   System fonts, no images needed to read it, high contrast by default.
   Body text is at least 7:1 against the background (WCAG AAA) in both schemes;
   site/check.mjs recomputes the ratios from the tokens below, so change them here only. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #111111;
  --muted: #333333;
  --link: #0b4a8f;
  --visited: #5b2a86;
  --button-bg: #0b4a8f;
  --button-text: #ffffff;
  --border: #555555;
  --panel: #f3f3f3;
  --focus: #111111;
  --focus-gap: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #f2f2f2;
    --muted: #d6d6d6;
    --link: #9ecbff;
    --visited: #d8b4ff;
    --button-bg: #9ecbff;
    --button-text: #121212;
    --border: #9a9a9a;
    --panel: #1e1e1e;
    --focus: #ffffff;
    --focus-gap: #121212;
  }
}

/* Windows High Contrast / forced colors: let the system palette through, keep focus visible. */
@media (forced-colors: active) {
  :root {
    --border: CanvasText;
  }
  .button {
    border: 2px solid ButtonText;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* One column, 16 px gutters on a phone, about 70 characters per line. */
.wrap {
  width: 100%;
  max-width: calc(70ch + 32px);
  margin: 0 auto;
  padding: 0 16px;
}

/* Skip link: off screen until it has focus, then the first thing on the page. */
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 0.5rem 1rem;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 700;
  text-decoration: none;
  z-index: 10;
}

.skip-link:focus {
  top: 16px;
}

/* Every keyboard focus is a thick ring with a gap, visible on any background. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-gap);
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 0.09em;
}

a:visited {
  color: var(--visited);
}

a:hover {
  text-decoration-thickness: 0.18em;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 2.5rem 0 0.75rem;
  overflow-wrap: break-word;
}

h1 {
  font-size: 2rem;
  margin-top: 1rem;
}

h2 {
  font-size: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.15rem;
}

p,
li {
  max-width: 70ch;
  overflow-wrap: break-word;
}

ul,
ol {
  padding-left: 1.4em;
}

li + li {
  margin-top: 0.4rem;
}

code,
kbd {
  font-family: ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
}

kbd {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0.3em;
  white-space: nowrap;
}

/* Header: logo, name, language switch. */
.site-header {
  padding: 1rem 0 0;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text);
}

.brand:visited {
  color: var(--text);
}

.brand img {
  width: 40px;
  height: 40px;
}

.lang-switch {
  margin-left: auto;
}

.lead {
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Buttons and button-like links. */
.button {
  display: inline-block;
  min-height: 44px;
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--button-bg);
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--button-text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:visited {
  color: var(--button-text);
}

.button.secondary {
  background: transparent;
  color: var(--link);
  border-color: var(--link);
}

.button.secondary:visited {
  color: var(--link);
}

/* A store that is not open yet: plain text in the row, not a link, so nothing to focus. */
.button.placeholder {
  cursor: default;
  background: transparent;
  color: var(--text);
  border-style: dashed;
  border-color: var(--border);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

/* The hidden attribute must win over display: flex (the "Hear it" row is hidden until script.js runs). */
[hidden] {
  display: none !important;
}

/* The sample transcript: a bordered panel so low-vision readers find it. */
.sample {
  margin: 1rem 0;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  min-height: 3.5rem;
}

.sample p {
  margin: 0;
}

.sample p + p {
  margin-top: 0.5rem;
}

.sample .dialogue {
  color: var(--muted);
  font-style: italic;
}

.status {
  min-height: 1.6rem;
  font-weight: 500;
}

/* Prices as a list, not a table: screen readers read a list the same everywhere. */
.plans dt {
  font-weight: 700;
  margin-top: 1rem;
}

.plans dd {
  margin: 0.25rem 0 0;
}

.steps li {
  margin-top: 0.75rem;
}

.note {
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--border);
  background: var(--panel);
}

.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-footer li + li {
  margin-top: 0;
}

/* Visually hidden, still read by screen readers. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 600px) {
  h1 {
    font-size: 2.4rem;
  }
}
