/* Talking Buttons — marketing site (static)
   Mobile-first: base rules = narrow viewports; @media (min-width: …) adds wider layouts.
   Light default; dark when OS/browser prefers dark (optional). */
:root {
  color-scheme: light dark;
  /* Light, airy default palette */
  --bg: #f9fbff;
  --surface: #ffffff;
  --text: #13263a;
  --text-muted: #58677a;
  --accent: #1e88e5;
  --accent-hover: #1565c0;
  --border: #d6e2f2;
  --focus: #f59e0b;
  --on-accent: #ffffff;
  /* Content width: full-bleed text block on small phones; cap grows at larger breakpoints */
  --maxw: 100%;
  --pad-inline: 1rem;
}

/* Tablet-ish and up: readable max line length, slightly roomier gutters */
@media (min-width: 36rem) {
  :root {
    --maxw: 42rem;
    --pad-inline: 1.25rem;
  }
}

@media (min-width: 48rem) {
  :root {
    --maxw: 48rem;
  }
}

@media (min-width: 64rem) {
  :root {
    --maxw: 52rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #1a2332;
    --text: #f0f4f8;
    --text-muted: #b8c5d6;
    --accent: #3d94eb;
    --accent-hover: #64acf5;
    --border: #2d3a4d;
    --focus: #ffc53d;
    --on-accent: #ffffff;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--text);
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 var(--pad-inline) 3rem;
}

.site-header {
  padding: 1rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  padding-bottom: 0;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
}

.logo a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}

.logo a:hover {
  color: var(--accent);
}

.nav-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.9375rem;
}

.nav-main a[aria-current="page"] {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

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

main {
  padding-top: 2rem;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  font-weight: 600;
  color: var(--text);
}

h3 {
  font-size: 1.0625rem;
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
}

p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

p strong,
li strong {
  color: var(--text);
}

.lead {
  font-size: 1.125rem;
  color: var(--text-muted);
}

ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

li {
  margin-bottom: 0.35rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}

.store-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
}

.store-cta .cta-row {
  margin: 0;
}

.play-store-qr {
  text-align: center;
  padding: 0.5rem 0;
}

.play-store-qr-code {
  width: 160px;
  height: 160px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.play-store-qr-caption {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.play-store-badge {
  width: 160px;
  margin-top: 0.35rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  text-decoration: none;
  border-radius: 6px;
  border: 2px solid transparent;
}

.btn:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--surface);
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.card-grid {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

@media (min-width: 520px) {
  .card-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.card p:last-child {
  margin-bottom: 0;
}

.figure-placeholder {
  margin: 1.5rem 0;
  padding: 2rem 1rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Mobile app screenshots (landing) */
.app-screenshots {
  margin: 2rem 0 1.5rem;
}

.app-screenshots h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

/* Horizontal carousel: one row, swipe / trackpad / scrollbar */
.screenshot-carousel-hint {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.screenshot-carousel {
  margin-top: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0.5rem;
  padding: 0.35rem 0 0.65rem;
  outline: none;
}

.screenshot-carousel:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: no-preference) {
  .screenshot-carousel {
    scroll-behavior: smooth;
  }
}

.screenshot-track {
  display: flex;
  flex-flow: row nowrap;
  align-items: stretch;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0 0.25rem;
  width: max-content;
  min-height: min-content;
}

.screenshot-item {
  flex: 0 0 auto;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  scroll-snap-align: center;
  scroll-snap-stop: normal;
}

.screenshot-item img {
  display: block;
  width: auto;
  max-width: min(64vw, 30rem);
  height: auto;
  max-height: 28rem;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

@media (min-width: 40rem) {
  .screenshot-item img {
    max-width: min(28vw, 28rem);
    max-height: 30rem;
  }
}

/* Single screenshot (non-carousel) */
.screenshot-single {
  margin-top: 0.75rem;
}

.screenshot-single img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 24rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

@media (min-width: 40rem) {
  .screenshot-single img {
    max-height: 28rem;
  }
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0 0 0.5rem;
}

.chooser {
  text-align: center;
  padding: 3rem 0 2rem;
}

.chooser h1 {
  margin-bottom: 0.5rem;
}

.chooser .lead {
  margin-bottom: 2rem;
}

.chooser-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 16rem;
  margin: 0 auto;
}

.chooser-links a {
  display: block;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.chooser-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.faq-item {
  margin-bottom: 1.5rem;
}

.faq-item h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

/* Board repository (OBF/OBZ downloads) */
.board-repo-intro {
  margin-bottom: 1.25rem;
}

.board-repo-wrap {
  margin: 1rem 0 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.board-repo {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.board-repo caption {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.board-repo th,
.board-repo td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.board-repo th {
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  white-space: nowrap;
}

.board-repo tbody tr:last-child th,
.board-repo tbody tr:last-child td {
  border-bottom: none;
}

.board-repo td.board-repo-name {
  font-weight: 600;
  color: var(--text);
}

.board-repo-row--reserved td {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

.board-repo-note {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.board-download-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Use margin, not gap: flex `gap` is ignored in some older browsers / embedded WebViews. */
.board-download-stack .board-download + .board-download {
  margin-top: 0.75rem;
}

.board-download {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--on-accent);
  background: var(--accent);
  text-decoration: none;
  border-radius: 6px;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
  max-width: 9.5rem;
}

.board-download:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.board-download:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.board-download--secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.board-download--secondary:hover {
  background: var(--surface);
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

@media (max-width: 44rem) {
  .board-repo th:nth-child(3),
  .board-repo td:nth-child(3) {
    display: none;
  }
}
