:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #4b5563;
  --accent: #2563eb;
  --border: #dbe3ec;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --hero-side-bg: #0f172a;
  --hero-side-text: #e2e8f0;
  --hero-side-muted: #94a3b8;
  --hero-side-accent: #93c5fd;
  --button-secondary-bg: #ffffff;
  --bg-top: #fbfdff;
  --hero-glow: rgba(37, 99, 235, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #111827;
  --text: #e5edf7;
  --muted: #9aa8bd;
  --accent: #60a5fa;
  --border: #253246;
  --shadow: 0 12px 28px rgba(2, 6, 23, 0.36);
  --hero-side-bg: #172033;
  --hero-side-text: #e5edf7;
  --hero-side-muted: #9aa8bd;
  --hero-side-accent: #93c5fd;
  --button-secondary-bg: #182235;
  --bg-top: #0f172a;
  --hero-glow: rgba(96, 165, 250, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background:
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
  color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

.wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: 72px;
  height: 38px;
  padding: 0 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.theme-toggle-icon {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-toggle-sun {
  margin-right: auto;
}

.theme-toggle-moon {
  margin-left: auto;
}

:root[data-theme="dark"] .theme-toggle-knob {
  transform: translateX(34px);
}

:root[data-theme="light"] .theme-toggle-sun,
:root[data-theme="dark"] .theme-toggle-moon {
  color: #ffffff;
}

:root[data-theme="light"] .theme-toggle-moon,
:root[data-theme="dark"] .theme-toggle-sun {
  color: var(--muted);
}

main.wrap {
  padding: 2rem 1rem 4rem;
}

.hero,
.page-copy,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.hero,
.page-copy {
  padding: 2rem;
}

.hero-home {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.8fr);
  gap: 1.5rem;
  align-items: stretch;
  background:
    linear-gradient(135deg, var(--hero-glow), rgba(255, 255, 255, 0) 46%),
    var(--surface);
}

.hero h1,
.page-copy h1 {
  margin: 0 0 1rem;
  font-size: 2.5rem;
  line-height: 1.15;
  color: var(--text);
}

.lede,
.page-copy p,
.card p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 600;
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.button-secondary {
  background: var(--button-secondary-bg);
  color: var(--text);
}

.hero-side {
  padding: 1.25rem;
  border-radius: 12px;
  background: var(--hero-side-bg);
  color: var(--hero-side-text);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
}

.hero-badge {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hero-side-accent);
}

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

.hero-stats div {
  display: grid;
  gap: 0.25rem;
}

.hero-stats dt {
  color: var(--hero-side-muted);
  font-size: 0.85rem;
}

.hero-stats dd {
  margin: 0;
  color: var(--hero-side-text);
  font-size: 1.4rem;
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card {
  padding: 1.5rem;
}

.card h2 {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 1.125rem;
}

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

@media (max-width: 640px) {
  .site-header .wrap,
  .site-header-actions,
  .site-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero,
  .page-copy {
    padding: 1.5rem;
  }

  .hero-home {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .page-copy h1 {
    font-size: 2rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
