/*
 * Bendlo website styles. Plain CSS, no build step.
 * Colours, fonts and radii mirror apps/mobile/src/theme/tokens.ts (values from docs/04-screens.md).
 * Every text/background pair below meets WCAG AA (>= 4.5:1); see progress/M7.2.md.
 */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/Fraunces-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/Fraunces-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/fonts/AtkinsonHyperlegible-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/fonts/AtkinsonHyperlegible-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #f4f1ea;
  --surface: #fffdf8;
  --border: #e1dacb;
  --grid-line: #d9d2c3;
  --ink: #1f2a2e;
  --muted: #56615f;
  --accent: #2e6e8e;
  --streak: #a8501f;

  --radius-card: 20px;
  --radius-button: 16px;

  --font-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:
    'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  color-scheme: light;
}

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

html {
  /* Large, readable default for older players; scales with the browser's text size. */
  font-size: 118.75%; /* 19px when the browser default is 16px */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (min-width: 48em) {
  html {
    font-size: 125%; /* 20px */
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2em;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.5em;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

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

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

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

strong {
  font-weight: 700;
}

/* ---- Layout ---- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--surface);
  border-radius: 12px;
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
  color: var(--surface);
}

.container {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  padding: 1rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  text-decoration: none;
}

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

.brand svg {
  width: 2rem;
  height: 2rem;
  flex: none;
}

main {
  padding-bottom: 3rem;
}

/* ---- Landing ---- */

.hero {
  padding: 2rem 0 1rem;
  text-align: center;
}

.hero-board {
  width: min(15rem, 70vw);
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.25em;
}

.tagline {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 1rem;
  text-wrap: balance;
}

.lede {
  font-size: 1.1rem;
  max-width: 34rem;
  margin: 0 auto 1.5rem;
}

.chips {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.chips li {
  margin: 0;
  padding: 0.35rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Placeholder until the apps are live; replace with the official store badges (see README). */
.store-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: min(12rem, 100%);
  max-width: 100%;
  min-height: 3.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius-button);
  text-align: left;
  line-height: 1.25;
}

.store-badge small {
  font-size: 0.8rem;
}

.store-badge span {
  font-weight: 700;
  font-size: 1.1rem;
}

.store-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-top: 2rem;
}

.card h2 {
  margin-top: 0;
}

.steps {
  padding-left: 1.4rem;
}

.steps li::marker {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent);
}

/* ---- Legal pages ---- */

.legal h1 {
  margin-top: 1.5rem;
}

.meta {
  color: var(--muted);
}

.summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.summary h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.summary ul {
  margin-bottom: 0;
}

.toc ol {
  padding-left: 1.4rem;
}

.toc li + li {
  margin-top: 0;
}

/* Taller tap targets for the list of section links. */
.toc a {
  display: inline-block;
  padding: 0.45rem 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1em;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--surface);
  font-size: 0.95rem;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  font-weight: 700;
}

/* ---- 404 ---- */

.not-found {
  text-align: center;
  padding-top: 3rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.5rem 1.75rem;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius-button);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: var(--accent);
  color: var(--surface);
}

/* ---- Footer ---- */

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

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

.site-footer nav li {
  margin: 0;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.site-footer p {
  margin: 0;
}

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

@media print {
  .skip-link,
  .site-footer nav {
    display: none;
  }

  body {
    background: #fff;
  }
}
