/* Design tokens lifted from the Flutter app (app/lib/theme/app_colors.dart)
   so the landing page and the app read as one product. The app ships light
   only and deliberately so; `color-scheme: light` stops browsers in dark mode
   from auto-inverting this page into a palette nobody designed. */
:root {
  --bg: #fffbf5;
  --surface: #ffffff;
  --sand: #efdbba;
  --ink: #292f33;
  /* The app's mutedForeground token is the same value as its foreground,
     which works in a dense UI but leaves a marketing page with no secondary
     voice. Derived here instead: 6.6:1 on --bg, so it stays readable rather
     than becoming decorative grey. */
  --ink-soft: #5a6469;
  --sage: #94cb9c;
  --sage-light: #c9ecd2;
  --sage-deep: #5c9d6e;
  --terracotta: #e1824e;
  --line: #e5e5e5;

  --measure: 1040px;
  --radius: 10px;

  --font-brand: "Monomaniac One", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;

  color-scheme: light;
}

@font-face {
  font-family: "Monomaniac One";
  src: url("fonts/MonomaniacOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* One gutter rule for the whole page, so nothing touches the edge of a
   phone and no section has to remember its own padding. */
.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 20px;
}

a { color: var(--sage-deep); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 { text-wrap: balance; line-height: 1.35; margin: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.wordmark {
  font-family: var(--font-brand);
  font-size: 24px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sage-deep); color: #fff; }
.btn-primary:hover { background: #4f8a5f; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--sage-light); border-color: var(--sage); }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 40px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
/* A grid item defaults to min-width:auto, so a column refuses to shrink below
   its content's minimum - and the score card carries a min-width so its seven
   number columns stay readable. Without this the whole hero stayed 534px wide
   on a 390px phone and took the page sideways with it. */
.hero-grid > * { min-width: 0; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 56px; }
  .hero { padding: 96px 0 56px; }
}
.hero h1 {
  font-size: clamp(30px, 5.2vw, 46px);
  letter-spacing: 0.01em;
}
.hero h1 .accent { color: var(--sage-deep); }
.hero-lead {
  margin: 20px 0 0;
  font-size: clamp(16px, 2.2vw, 18px);
  color: var(--ink-soft);
  max-width: 34em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.hero-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- score table preview ---------- */
/* Not a screenshot: a real table, so it stays sharp, reflows on a phone and
   can be read by a crawler as the content it is. */
.score-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 16px 40px -28px rgba(41, 47, 51, 0.45);
}
.score-preview figcaption {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
/* Seven columns of numbers do not fit a 390px phone, and shrinking the type
   until they do makes the figures unreadable - which is the opposite of the
   point. The table scrolls inside its own card instead, so the page itself
   never moves sideways. */
.score-scroll { overflow-x: auto; }
.score-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.score-table th, .score-table td {
  padding: 7px 8px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.score-table thead th { color: var(--ink-soft); font-weight: 600; font-size: 12px; }
.score-table th:first-child, .score-table td:first-child { text-align: left; }
.score-table tbody tr:last-child td { border-bottom: none; }
.score-table tfoot td {
  border-top: 2px solid var(--ink);
  border-bottom: none;
  font-weight: 700;
  padding-top: 10px;
}
.plus { color: var(--sage-deep); }
.minus { color: var(--terracotta); }

/* ---------- sections ---------- */
section { padding: 56px 0; }
.section-label {
  font-family: var(--font-brand);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--sage-deep);
  text-transform: uppercase;
  margin: 0 0 8px;
}
section h2 { font-size: clamp(22px, 3.4vw, 30px); }
.section-lead { margin: 12px 0 0; color: var(--ink-soft); max-width: 40em; }

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 32px;
}
@media (min-width: 720px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.card .glyph {
  font-family: var(--font-brand);
  font-size: 22px;
  color: var(--sage-deep);
  display: block;
  margin-bottom: 10px;
}

/* ---------- steps ---------- */
.steps { counter-reset: step; margin: 32px 0 0; padding: 0; list-style: none; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before {
  content: counter(step);
  font-family: var(--font-brand);
  font-size: 20px;
  color: var(--sage-deep);
  line-height: 1.5;
}
.steps h3 { font-size: 16px; margin-bottom: 4px; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- band ---------- */
.band {
  background: var(--sand);
  border-block: 1px solid color-mix(in srgb, var(--sand) 70%, var(--ink) 8%);
}
.band h2 { margin-bottom: 8px; }
.band p { color: #5c5340; }
.band .btn-primary { margin-top: 20px; }

/* ---------- plain document pages ---------- */
.doc { padding: 48px 0 64px; max-width: 760px; }
.doc h1 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 8px; }
.doc .updated { color: var(--ink-soft); font-size: 14px; margin: 0 0 32px; }
.doc h2 { font-size: 20px; margin: 40px 0 10px; }
.doc h3 { font-size: 16px; margin: 24px 0 6px; }
.doc p, .doc li { color: var(--ink); }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 6px 0; }
.doc .callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--terracotta);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
}
.doc .callout p:first-child { margin-top: 0; }
.doc .callout p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 48px;
  font-size: 14px;
  color: var(--ink-soft);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: baseline;
  justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }

/* ---------- consent ---------- */
#consent {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
#consent[hidden] { display: none; }
#consent .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}
#consent .text { flex: 1 1 320px; }
#consent strong { display: block; font-size: 14px; }
#consent p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
#consent .actions { display: flex; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Visually hidden but available to screen readers and crawlers. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
