/*
 * Static landing page. Hand-written on purpose: the Flutter engine is ~3.5 MB
 * and paints to a canvas, so it can neither paint fast nor be indexed.
 *
 * Tokens mirror lib/core/theme/scoreboard_tokens.dart (Sb) and scoreboard_text
 * .dart. Where the app's colour fails WCAG AA for text on white it is darkened
 * here and says so (--sb-text-secondary, --sb-text-tertiary).
 */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/space-grotesk-400.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/space-grotesk-700.woff2") format("woff2");
}

:root {
  /* Sb colours (same hex as the app). */
  --sb-indigo: #5b4be0;
  --sb-indigo-tint-bg: #eef0fb;
  --sb-indigo-on-dark: #a99cff;
  --sb-ink: #1c2030;
  --sb-ink-label-on-dark: #a6acbe;
  --sb-surface: #ffffff;
  --sb-canvas: #eef0f4;
  --sb-border: #e4e7ee;

  /* Darkened for AA on white: the app's #7B8194 is 3.9:1 and #9AA0B0 is
     2.6:1; these are 6.3:1. */
  --sb-text-secondary: #5a6074;
  --sb-text-tertiary: #5a6074;
  /* Outline-button edge: 3:1 against white (the app's --sb-border is 1.2:1). */
  --sb-border-strong: #8b91a3;

  /* Sb radii. */
  --sb-radius-xs: 6px;
  --sb-radius-md: 12px;
  --sb-radius-lg: 14px;

  /* Sb sizing. */
  --sb-min-tap: 44px;
  --sb-button-height: 52px;
  --sb-button-height-sm: 50px;

  --font-ui: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--sb-surface);
  color: var(--sb-ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--sb-indigo);
  outline-offset: 3px;
  border-radius: var(--sb-radius-xs);
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--sb-ink);
  color: var(--sb-surface);
  border-radius: var(--sb-radius-md);
}

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

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--sb-surface);
  border-bottom: 1px solid var(--sb-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1120px;
  height: 64px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .site-header__inner {
    padding: 0 24px;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--sb-min-tap);
  margin-right: auto;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--sb-radius-xs);
  background: var(--sb-indigo);
  color: var(--sb-surface);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--sb-min-tap);
  padding: 0 12px;
  text-decoration: none;
}

.nav-link:hover {
  text-decoration: underline;
}

/* At 320px the header cannot hold wordmark + two actions; the hero repeats
   Log In directly below, so it is the one dropped. */
@media (max-width: 399px) {
  .site-header .nav-link {
    display: none;
  }
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--sb-button-height);
  padding: 0 32px;
  border: 1px solid transparent;
  border-radius: var(--sb-radius-lg);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.btn--sm {
  min-height: var(--sb-button-height-sm);
  padding: 0 20px;
}

.btn--primary {
  background: var(--sb-indigo);
  color: var(--sb-surface);
}

.btn--outline {
  border-color: var(--sb-border-strong);
  background: var(--sb-surface);
  color: var(--sb-ink);
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: filter 130ms ease, background-color 130ms ease;
  }
}

.btn--primary:hover {
  filter: brightness(0.92);
}

.btn--outline:hover {
  background: var(--sb-canvas);
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 720px) {
  .container {
    padding: 0 64px;
  }
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  padding: 64px 0;
}

.hero h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

.hero__lead {
  max-width: 520px;
  margin: 20px 0 0;
  color: var(--sb-text-secondary);
  font-size: 17px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.br-wide {
  display: none;
}

@media (min-width: 720px) {
  .hero {
    text-align: center;
  }

  .hero h1 {
    font-size: 48px;
  }

  .hero__lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .br-wide {
    display: inline;
  }
}

/* ── Features ───────────────────────────────────────────────────────────── */

.features {
  padding: 48px 0 64px;
  border-top: 1px solid var(--sb-border);
}

.features__list {
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .features__list {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

.feature__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius-md);
  background: var(--sb-indigo-tint-bg);
  color: var(--sb-indigo);
}

.feature__icon svg {
  width: 24px;
  height: 24px;
}

.feature h3 {
  margin: 16px 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.feature p {
  margin: 0;
  color: var(--sb-text-secondary);
}

/* ── CTA band ───────────────────────────────────────────────────────────── */

.cta {
  padding: 48px 32px;
  border-radius: var(--sb-radius-lg);
  background: var(--sb-ink);
  color: var(--sb-surface);
  text-align: center;
}

.cta h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.cta p {
  margin: 16px 0 32px;
  color: var(--sb-ink-label-on-dark);
}

.cta :focus-visible {
  outline-color: var(--sb-indigo-on-dark);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 64px 0 32px;
  color: var(--sb-text-tertiary);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--sb-min-tap);
}

/* ── Prose pages (privacy, 404) ─────────────────────────────────────────── */

.prose {
  max-width: 680px;
  padding: 40px 0 32px;
}

.prose h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.prose h2 {
  margin: 28px 0 6px;
  font-size: 16px;
}

.prose p,
.prose ul {
  margin: 0 0 12px;
  color: var(--sb-text-secondary);
  line-height: 1.6;
}

.prose ul {
  padding-left: 22px;
}

.prose .meta {
  font-size: 14px;
}

.prose a {
  color: var(--sb-indigo);
}
