/* Colors, spacing and type mirror src/theme/tokens.ts so the site looks like the app. */
:root {
  color-scheme: light dark;
  --background: #f4efe6;
  --background-secondary: #fbf8f2;
  --label: #1e1a15;
  --label-secondary: #6b6358;
  --label-tertiary: rgba(30, 26, 21, 0.32);
  --separator: rgba(30, 26, 21, 0.18);
  --fill: rgba(30, 26, 21, 0.07);
  --outline: rgba(30, 26, 21, 0.35);
  --ink: #1e1a15;
  --on-ink: #fbf8f2;
  --accent: #b8432b;
  --accent-soft: rgba(184, 67, 43, 0.1);
  --error: #b8432b;
  --tile-border: rgba(30, 26, 21, 0.12);
  --tile-border-filled: rgba(30, 26, 21, 0.45);
  --tile-shadow: 0 1px 0 rgba(30, 26, 21, 0.08), 0 1px 3px rgba(30, 26, 21, 0.06);
  --mark-correct: #1e1a15;
  --mark-present: #b8432b;
  --mark-absent: #e6dfd1;
  --on-mark-correct: #fbf8f2;
  --on-mark-present: #9e3520;
  --on-mark-absent: #6b6358;
  --key: #fbf8f2;
  --on-key: #1e1a15;
  --key-shadow: 0 1px 0 rgba(30, 26, 21, 0.16), inset 0 0 0 1px rgba(30, 26, 21, 0.08);
  --on-key-used: rgba(30, 26, 21, 0.32);

  --xs: 4px;
  --sm: 8px;
  --md: 16px;
  --lg: 24px;
  --xl: 32px;
  --xxl: 48px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --tap: 44px;

  --serif: ui-serif, 'New York', 'Iowan Old Style', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
}

/* "Lamplight": warm charcoal, never pure black. */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #191612;
    --background-secondary: #24201b;
    --label: #efe8dc;
    --label-secondary: #a89f91;
    --label-tertiary: rgba(239, 232, 220, 0.3);
    --separator: rgba(239, 232, 220, 0.16);
    --fill: rgba(239, 232, 220, 0.08);
    --outline: rgba(239, 232, 220, 0.3);
    --ink: #efe8dc;
    --on-ink: #191612;
    --accent: #f0735a;
    --accent-soft: rgba(240, 115, 90, 0.14);
    --error: #f0735a;
    --tile-border: rgba(239, 232, 220, 0.1);
    --tile-border-filled: rgba(239, 232, 220, 0.45);
    --tile-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    --mark-correct: #efe8dc;
    --mark-present: #f0735a;
    --mark-absent: #120f0c;
    --on-mark-correct: #191612;
    --on-mark-present: #f59a86;
    --on-mark-absent: #8f877a;
    --key: #2c2722;
    --on-key: #efe8dc;
    --key-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
    --on-key-used: rgba(239, 232, 220, 0.3);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--label);
  font: 1.0625rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  margin: 0;
}

p {
  margin: 0;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--lg);
}

/* Small capitals above a section, like a heading in a printed puzzle book. */
.eyebrow {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
}

.section-header {
  font-size: 0.8125rem;
  line-height: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--label-secondary);
}

.muted {
  color: var(--label-secondary);
}

.footnote {
  font-size: 0.8125rem;
  line-height: 1.125rem;
}

/* Buttons follow src/components/Button.tsx. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 var(--md);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--on-ink);
  font: 600 1.0625rem/1.375rem var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 120ms;
}

.button:active {
  opacity: 0.7;
}

.button.secondary {
  background: transparent;
  color: var(--label);
  box-shadow: inset 0 0 0 1px var(--outline);
}

.button.small {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.9375rem;
}

.button:focus-visible,
.key:focus-visible,
.segmented a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--background);
  border-bottom: 1px solid var(--separator);
}

.bar .wrap {
  display: flex;
  align-items: center;
  gap: var(--lg);
  min-height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sm);
  color: var(--label);
  font: 700 1.25rem/1.5625rem var(--serif);
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 22%;
}

.bar nav {
  display: flex;
  gap: var(--lg);
  margin-left: auto;
}

.bar nav a {
  color: var(--label-secondary);
  font-size: 0.9375rem;
  text-decoration: none;
}

.bar nav a:hover {
  color: var(--label);
}

/* Like the app's SegmentedControl. */
.segmented {
  display: flex;
  padding: 2px;
  border-radius: var(--radius-md);
  background: var(--fill);
}

.segmented a {
  min-width: 40px;
  padding: var(--xs) var(--sm);
  border-radius: var(--radius-sm);
  color: var(--label-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.segmented a[aria-current='true'] {
  background: var(--background-secondary);
  color: var(--label);
  box-shadow: var(--tile-shadow);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 420px);
  gap: var(--xxl);
  align-items: start;
  padding-top: 72px;
  padding-bottom: 96px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: var(--md);
  padding-top: var(--xl);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.hero h1 em {
  color: var(--accent);
}

.lead {
  max-width: 34rem;
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--label-secondary);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: var(--sm);
}

/* Sections */
section.block {
  padding: 88px 0;
  border-top: 1px solid var(--separator);
}

.block-head {
  display: flex;
  flex-direction: column;
  gap: var(--sm);
  max-width: 40rem;
  margin-bottom: var(--xl);
}

.block-head h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
}

/* Game list, like the rows on Today. */
.games {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--xl);
  margin: 0;
  padding: 0;
  list-style: none;
}

.games li {
  display: flex;
  align-items: center;
  gap: var(--md);
  min-height: 60px;
  padding: 12px var(--xs);
  border-bottom: 1px solid var(--separator);
}

.games li:nth-child(-n + 2) {
  border-top: 1px solid var(--separator);
}

.game-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--separator);
  color: var(--label);
}

.game-icon svg {
  width: 20px;
  height: 20px;
}

.games h3 {
  font-size: 1.0625rem;
  line-height: 1.375rem;
  font-weight: 600;
}

.games p {
  font-size: 0.8125rem;
  line-height: 1.125rem;
  color: var(--label-secondary);
}

/* How it plays */
.how {
  display: grid;
  grid-template-columns: minmax(260px, 400px) 1fr;
  gap: 72px;
  align-items: center;
}

.art {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--separator);
  box-shadow: 0 18px 50px rgba(30, 26, 21, 0.14);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--xl);
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--md);
}

.step-number {
  font: 700 1.75rem/2.125rem var(--serif);
  color: var(--accent);
}

.steps h3 {
  font-size: 1.25rem;
  line-height: 1.5625rem;
  font-weight: 600;
  margin-bottom: var(--xs);
}

.steps p {
  color: var(--label-secondary);
}

/* Free and Premium */
.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--lg);
  align-items: start;
}

.plan {
  display: flex;
  flex-direction: column;
  gap: var(--md);
  padding: var(--lg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
}

.plan.premium {
  background: var(--background-secondary);
}

.plan h3 {
  font-size: 1.75rem;
  line-height: 2.125rem;
  font-weight: 700;
}

.plan ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Bullets are the right-place dot from Guess Five. */
.plan li {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.plan li::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--label);
  transform: translateY(-2px);
}

.plan.premium li::before {
  background: var(--accent);
}

footer {
  border-top: 1px solid var(--separator);
  padding: var(--lg) 0 var(--xxl);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sm) var(--lg);
  font-size: 0.8125rem;
  color: var(--label-secondary);
}

footer a {
  color: var(--label-secondary);
}

footer .spacer {
  flex: 1;
}

@media (max-width: 860px) {
  .bar nav {
    display: none;
  }

  .bar .segmented {
    margin-left: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: var(--xl);
    padding-top: var(--xl);
    padding-bottom: 64px;
  }

  .hero-text {
    padding-top: 0;
  }

  .how {
    grid-template-columns: 1fr;
    gap: var(--xxl);
  }

  .art {
    max-width: 360px;
    margin: 0 auto;
    display: block;
  }

  section.block {
    padding: 64px 0;
  }
}

@media (max-width: 620px) {
  .wrap {
    padding: 0 var(--md);
  }

  .games,
  .plans {
    grid-template-columns: 1fr;
  }

  .games li:nth-child(2) {
    border-top: 0;
  }
}

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