/* Nines — minimal hand-rolled CSS */

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

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a2e;
  --color-muted: #6b7280;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-border: #e5e7eb;
  --color-surface: #f9fafb;
  --color-featured: #eff6ff;
  --color-featured-border: #bfdbfe;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --radius: 0.375rem;
  --radius-lg: 0.75rem;
  --max-width: 64rem;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

/* ─── Layout ─── */
header {
  border-bottom: 1px solid var(--color-border);
  padding: 0 1.5rem;
}

nav.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 3.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
  flex: 1;
}

.nav-links a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
}

.footer-brand p {
  margin: 0.5rem 0 0;
  color: var(--color-muted);
  font-size: 0.875rem;
  max-width: 20rem;
}

.footer-links {
  display: flex;
  gap: 3rem;
}

.footer-col h4 {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

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

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: 1rem 1.5rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.footer-bottom p {
  margin: 0;
}

/* ─── Buttons ─── */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-align: center;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--color-surface);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.0625rem;
}

/* ─── Sections ─── */
.section-title {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.75rem;
}

.section-subtitle {
  text-align: center;
  color: var(--color-muted);
  margin: 0 0 2.5rem;
}

/* ─── Hero ─── */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  margin: 0 0 1.25rem;
  line-height: 1.1;
}

.hero p {
  font-size: 1.125rem;
  color: var(--color-muted);
  max-width: 38rem;
  margin: 0 auto 2.25rem;
}

/* ─── Features ─── */
.features {
  padding: 4rem 0;
  border-top: 1px solid var(--color-border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.feature {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.feature h3 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
}

.feature p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

/* ─── How it works ─── */
.how-it-works {
  padding: 4rem 0;
  border-top: 1px solid var(--color-border);
}

.steps {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step h3 {
  margin: 0 0 0.375rem;
  font-size: 1.0625rem;
}

.step p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

/* ─── Pricing ─── */
.pricing {
  padding: 4rem 0;
  border-top: 1px solid var(--color-border);
}

.pricing-full-link {
  text-align: center;
  margin-top: 2rem;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.pricing-full-link a {
  color: var(--color-primary);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.pricing-card {
  position: relative;
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pricing-card--featured {
  border-color: var(--color-primary);
  background: var(--color-featured);
}

.pricing-badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.pricing-header h2,
.pricing-header h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.price-amount {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
}

.price-period {
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.pricing-tagline {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.pricing-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex: 1;
}

.pricing-features li {
  font-size: 0.9375rem;
  padding-left: 1.375rem;
  position: relative;
}

.pricing-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 700;
}

/* ─── Pricing page ─── */
.pricing-page {
  padding-top: 3rem;
}

.pricing-intro {
  text-align: center;
  padding-bottom: 1rem;
}

.pricing-intro h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin: 0 0 0.75rem;
}

.pricing-intro p {
  color: var(--color-muted);
  font-size: 1.125rem;
  margin: 0;
}

/* ─── Feature matrix ─── */
.feature-matrix {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--color-border);
}

.feature-matrix h2 {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
  text-align: center;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.comparison-table thead th {
  font-weight: 700;
  background: var(--color-surface);
}

.comparison-table thead th:not(:first-child) {
  text-align: center;
}

.comparison-table td:not(:first-child) {
  text-align: center;
}

.comparison-table tbody tr:hover {
  background: var(--color-surface);
}

/* ─── FAQ ─── */
.pricing-faq {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--color-border);
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.pricing-faq h2 {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
  text-align: center;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.faq-item dt {
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.faq-item dd {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

/* ─── Docs ─── */
.docs-layout {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 3rem;
  padding-top: 2rem;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 1.5rem;
}

.docs-nav-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin: 0 0 0.75rem;
}

.docs-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.docs-nav-link {
  display: block;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.docs-nav-link:hover,
.docs-nav-link--active {
  background: var(--color-surface);
  color: var(--color-text);
}

.docs-content h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 1rem;
}

.docs-lead {
  font-size: 1.125rem;
  color: var(--color-muted);
  margin: 0 0 2.5rem;
}

.docs-content h2 {
  font-size: 1.375rem;
  margin: 2.5rem 0 0.75rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-border);
}

.docs-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.docs-content section + section h2 {
  border-top: 1px solid var(--color-border);
  padding-top: 2.5rem;
}

.docs-content p, .docs-content li {
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.docs-content strong {
  color: var(--color-text);
}

.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.docs-cta {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--color-featured);
  border: 1px solid var(--color-featured-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.docs-cta p {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
}

.docs-cta a {
  color: var(--color-primary);
  font-weight: 600;
}

/* ─── Auth forms ─── */
.auth-form {
  max-width: 24rem;
  margin: 4rem auto 0;
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.auth-form h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 1.5rem;
}

.auth-form form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.field .hint {
  font-weight: 400;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.field input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.field input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-error {
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: #b91c1c;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.field-error {
  display: block;
  font-size: 0.8125rem;
  color: #b91c1c;
  margin-top: 0.125rem;
}

.auth-form .btn {
  width: 100%;
  margin-top: 0.5rem;
}

.auth-form .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-form > p {
  margin: 1.25rem 0 0;
  font-size: 0.9375rem;
  color: var(--color-muted);
  text-align: center;
}

.auth-form > p a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-form > p a:hover {
  text-decoration: underline;
}

/* ─── Responsive ─── */
@media (max-width: 48rem) {
  .nav-links {
    display: none;
  }

  .footer-container {
    grid-template-columns: 1fr;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 2rem;
  }

  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.5rem;
  }

  .docs-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
  }

  .auth-form {
    margin-top: 2rem;
    padding: 1.25rem;
  }
}
