/* Base */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6e6e73;
  --hairline: rgba(0, 0, 0, 0.08);
  --card: #f5f5f7;
  --accent: #0a84ff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #f5f5f7;
    --muted: #a1a1a6;
    --hairline: rgba(255, 255, 255, 0.12);
    --card: #1c1c1e;
    --accent: #0a84ff;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(10, 132, 255, 0.18);
}

.container {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-link {
  color: var(--fg);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  opacity: 1;
}

.brand {
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Hero */
.hero {
  padding: 96px 0 48px;
  background: radial-gradient(1200px 600px at 50% -200px, color-mix(in oklab, var(--accent) 22%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in oklab, var(--card) 70%, transparent), transparent 60%);
  border-bottom: 1px solid var(--hairline);
}

.hero-title {
  margin: 0 0 12px 0;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.hero-logo {
  display: block;
  margin: 0 auto 16px;
  width: clamp(88px, 18vw, 140px);
  height: auto;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.04));
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2.4vw, 18px);
}

.hero-subtitle span {
  color: var(--fg);
  font-weight: 500;
}

.author-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}

.author-link:hover {
  color: var(--fg);
  border-bottom-color: currentColor;
}

/* Prose */
.prose {
  padding: 32px 0 96px;
}

.prose .lead {
  font-size: 20px;
  line-height: 1.75;
  color: var(--fg);
  margin-bottom: 28px;
}

.prose h2 {
  margin: 56px 0 12px;
  font-size: clamp(22px, 3.2vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.prose p {
  margin: 14px 0;
  color: var(--fg);
  overflow-wrap: anywhere;
  hyphens: auto;
}

.prose em {
  font-style: italic;
}

.prose strong {
  font-weight: 600;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.footer-cta {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
}

.footer-cta:hover {
  color: var(--accent);
}

/* Responsive rhythm */
@media (max-width: 640px) {
  .container {
    padding: 0 20px;
  }

  .header-inner {
    padding: 10px 20px;
  }

  .hero {
    padding: 64px 0 32px;
  }

  .hero-title {
    font-size: clamp(28px, 7vw, 40px);
  }

  .hero-logo {
    margin-bottom: 12px;
    width: clamp(76px, 22vw, 120px);
  }

  .prose {
    padding-bottom: 64px;
  }

  .prose .lead {
    font-size: 18px;
    line-height: 1.75;
  }

  .prose h2 {
    margin: 44px 0 10px;
    font-size: clamp(20px, 4.6vw, 24px);
  }
}

@media (max-width: 420px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 56px 0 28px;
  }

  .hero-title {
    letter-spacing: -0.015em;
  }

  .site-footer {
    padding: 24px 0 40px;
  }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
  .site-header .header-inner {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}


/* Form embed */
.form-embed {
  margin-top: 16px;
}

.form-embed iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--hairline);
  background: var(--card);
  border-radius: 12px;
  height: 1650px;
}

@media (max-width: 640px) {
  .form-embed iframe {
    height: 1800px;
  }
}

/* Tighter spacing for the join section */
.join-section {
  padding-top: 8px;
}

.join-section h2 {
  margin-top: 16px;
}