:root {
  --bg: #ffffff;
  --surface: #f7f7f7;
  --fg: #111111;
  --muted: #737373;
  --border: #e5e5e5;
  --accent: #50289e;
  --accent-secondary: #390188;

  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;

  --radius: 8px;
  --border-weight: 1px;
  --grid: 8px;

  --max-width: 1200px;
  --content-padding: clamp(20px, 5vw, 80px);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }

/* ── Typography ─────────────────────────────────────── */

.display {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h1, .h1 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2, .h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h3, .h3 {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 600;
  line-height: 1.25;
}

.body-lg {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.6;
}

.small {
  font-size: 14px;
  letter-spacing: 0.01em;
}

.label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

.section {
  padding: clamp(64px, 10vw, 120px) 0;
}

.section + .section {
  border-top: var(--border-weight) solid var(--border);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--grid) * 5);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--grid) * 4);
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

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

/* ── Navigation ─────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--border-weight) solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-logo span {
  color: var(--muted);
  font-weight: 400;
}

.nav-links {
  display: none;
  align-items: center;
  gap: calc(var(--grid) * 4);
}

.nav-links a {
  font-size: 14px;
  font-weight: 450;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--fg);
}

.nav-cta {
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.02em;
  padding: 8px 20px;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.nav-cta:hover {
  background: var(--accent-secondary);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.2s, opacity 0.2s;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99;
  padding: calc(var(--grid) * 5) var(--content-padding);
}

.mobile-menu.open { display: flex; flex-direction: column; gap: calc(var(--grid) * 3); }

.mobile-menu a {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--muted);
  transition: color 0.2s;
}

.mobile-menu a:hover,
.mobile-menu a[aria-current="page"] {
  color: var(--fg);
}

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

.hero {
  padding-top: calc(64px + clamp(64px, 12vw, 140px));
  padding-bottom: clamp(64px, 10vw, 120px);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(80, 40, 158, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  width: clamp(300px, 40vw, 500px);
  height: clamp(300px, 40vw, 500px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80, 40, 158, 0.07) 0%, rgba(80, 40, 158, 0) 70%);
  top: -15%;
  right: -10%;
  pointer-events: none;
  z-index: 0;
  animation: hero-orb-subtle 20s ease-in-out infinite;
}

@keyframes hero-orb-subtle {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -15px) scale(1.05); }
}

.hero .container { position: relative; z-index: 2; }

.hero .label {
  margin-bottom: calc(var(--grid) * 3);
}

.hero .display {
  max-width: 14ch;
  margin-bottom: calc(var(--grid) * 3);
}

.hero .body-lg {
  max-width: 52ch;
  color: var(--muted);
  margin-bottom: calc(var(--grid) * 5);
}

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: 0.02em;
  padding: 14px 28px;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius);
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover { background: var(--accent-secondary); }
.btn-primary:active { transform: translateY(1px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: 0.02em;
  padding: 14px 28px;
  background: transparent;
  color: var(--fg);
  border: var(--border-weight) solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.1s;
}

.btn-outline:hover { border-color: var(--muted); }
.btn-outline:active { transform: translateY(1px); }

/* ── Cards ──────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: var(--border-weight) solid var(--border);
  border-radius: var(--radius);
  padding: calc(var(--grid) * 4);
  transition: border-color 0.2s, background 0.2s;
}

.card:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(80, 40, 158, 0.04) 0%, rgba(57, 1, 136, 0.06) 100%);
}

.card .label {
  margin-bottom: calc(var(--grid) * 2);
}

.card h3 {
  margin-bottom: calc(var(--grid) * 1.5);
}

.card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 52ch;
}

/* ── Stats row ──────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--border-weight);
  background: var(--border);
  border: var(--border-weight) solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  background: var(--surface);
  padding: calc(var(--grid) * 4);
  text-align: center;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}

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

.footer {
  border-top: var(--border-weight) solid var(--border);
  padding: calc(var(--grid) * 8) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--grid) * 5);
  margin-bottom: calc(var(--grid) * 8);
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-brand p {
  color: var(--muted);
  font-size: 14px;
  max-width: 32ch;
  margin-top: calc(var(--grid) * 2);
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.02em;
  margin-bottom: calc(var(--grid) * 2);
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--muted);
  padding: 4px 0;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--fg); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: calc(var(--grid) * 2);
  padding-top: calc(var(--grid) * 4);
  border-top: var(--border-weight) solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

/* ── Form ───────────────────────────────────────────── */

.form-group {
  margin-bottom: calc(var(--grid) * 3);
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--fg);
  background: var(--surface);
  border: var(--border-weight) solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

/* ── Utility ────────────────────────────────────────── */

.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ── Focus ──────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary:focus-visible,
.btn-outline:focus-visible,
.nav-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Reduced motion ─────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
