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

:root {
  /* Surveyor's notebook — graphite field, chartreuse mark, restrained violet */
  --bg:          oklch(0.10 0.000 0);
  --surface:     oklch(0.15 0.000 0);
  --surface-2:   oklch(0.19 0.000 0);
  --border:      oklch(0.28 0.000 0);
  --ink:         oklch(0.96 0.000 0);
  --muted:       oklch(0.68 0.000 0);
  --primary:     oklch(0.55 0.125 294);
  --primary-dim: oklch(0.42 0.090 294);
  --accent:      oklch(0.86 0.175 128);
  --accent-ink:  oklch(0.18 0.040 128);
  --code-str:    oklch(0.82 0.100 145);
  --code-kw:     oklch(0.78 0.090 294);
  --code-fn:     oklch(0.86 0.120 95);
  --code-cm:     oklch(0.48 0.000 0);

  --font:        'Spline Sans', system-ui, sans-serif;
  --mono:        'Spline Sans Mono', ui-monospace, monospace;

  --r:    4px;
  --r-lg: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --z-header: 20;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  position: relative;
}

.atmosphere {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 15% -10%, oklch(0.55 0.125 294 / 0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 20%, oklch(0.86 0.175 128 / 0.08), transparent 50%),
    linear-gradient(180deg, oklch(0.12 0 0) 0%, var(--bg) 35%);
}

.atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(oklch(1 0 0 / 0.03) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, oklch(0 0 0 / 0.7), transparent 70%);
}

body > * {
  position: relative;
  z-index: 1;
}

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

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: oklch(0.10 0 0 / 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background:
    linear-gradient(135deg, var(--accent) 0 45%, transparent 45% 55%, var(--primary) 55%);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--r);
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface);
}

.site-nav .nav-cta {
  color: var(--accent-ink);
  background: var(--accent);
  margin-left: 0.35rem;
  font-weight: 600;
}

.site-nav .nav-cta:hover {
  background: oklch(0.90 0.160 128);
  color: var(--accent-ink);
}

/* ── Hero ── */
.hero {
  padding: clamp(3.5rem, 10vw, 6.5rem) 0 clamp(4rem, 8vw, 5.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.brand-lockup {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.15rem, 4.5vw, 3.35rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--ink);
  max-width: 14ch;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.hero-desc {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 38ch;
  margin-bottom: 2rem;
  line-height: 1.7;
  text-wrap: pretty;
}

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

.install {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.55rem 0.55rem 0.55rem 1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  max-width: 100%;
}

.install-prefix {
  color: var(--muted);
  user-select: none;
}

.install-cmd {
  color: var(--accent);
  font: inherit;
  background: none;
  overflow-x: auto;
  white-space: nowrap;
}

.copy-btn {
  appearance: none;
  border: 0;
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

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

.copy-btn.is-copied {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: transparent;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.btn-secondary:hover {
  border-color: var(--muted);
  background: var(--surface);
}

.hero-code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.35rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.8;
  tab-size: 2;
  box-shadow: 0 24px 48px oklch(0 0 0 / 0.35);
}

/* ── Sections ── */
.section-heading {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 0.75rem;
  text-wrap: balance;
}

.section-lede {
  font-size: 1rem;
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 2.25rem;
  text-wrap: pretty;
}

.capabilities,
.quickstart,
.products {
  padding: clamp(3.5rem, 7vw, 5rem) 0;
  border-top: 1px solid var(--border);
}

.cap-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
}

.cap-item {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(9rem, 11rem) 1fr;
  gap: 1rem 1.5rem;
  align-items: start;
}

.cap-item:nth-child(odd) {
  padding-right: 1.5rem;
  border-right: 1px solid var(--border);
}

.cap-item:nth-child(even) {
  padding-left: 1.5rem;
}

.cap-item dt {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.cap-item dd {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
  text-wrap: pretty;
}

.quickstart-flow {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(1.75rem, 4vw, 2.75rem);
  align-items: start;
}

.flow-copy {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.flow-copy p {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.6;
  padding-left: 1rem;
  border-left: 2px solid var(--primary);
}

.flow-copy strong {
  color: var(--ink);
  font-weight: 600;
}

.flow-copy code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent);
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre.codeblock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.35rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.7875rem;
  line-height: 1.8;
  tab-size: 2;
}

.kw  { color: var(--code-kw); }
.ty  { color: var(--accent); }
.str { color: var(--code-str); }
.fn  { color: var(--code-fn); }
.cm  { color: var(--code-cm); }
.va  { color: var(--ink); }

.product-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.product-block h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.product-block p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1rem;
  text-wrap: pretty;
}

.product-block > a:not(.product-download) {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.product-block > a:not(.product-download):hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

pre.pkg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.65rem 0.875rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  overflow-x: auto;
  margin-bottom: 0.85rem;
}

.product-download {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r);
  padding: 0.65rem 0.95rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s var(--ease);
}

.product-download:hover {
  filter: brightness(1.06);
}

.product-note {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 0.85rem;
  margin-bottom: 0;
}

.product-note strong {
  color: var(--ink);
  font-weight: 600;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  font-size: 0.8125rem;
  color: oklch(0.45 0 0);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.12s var(--ease);
}

.site-footer a:hover {
  color: var(--ink);
}

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

/* ── Dashboard token bridge ── */
.dashboard-button {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.dashboard-button--secondary {
  background: var(--surface-2);
  color: var(--ink);
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .hero-grid,
  .quickstart-flow,
  .product-cols {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }

  .cap-list {
    grid-template-columns: 1fr;
  }

  .cap-item,
  .cap-item:nth-child(odd),
  .cap-item:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding-left: 0;
    padding-right: 0;
    border-right: none;
  }
}

@media (max-width: 560px) {
  .site-header .wrap {
    height: auto;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .install {
    width: 100%;
  }

  .install-cmd {
    flex: 1;
    min-width: 0;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ── Motion ── */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .hero-code {
    animation: rise 0.7s var(--ease) both;
  }

  .hero-code {
    animation-delay: 0.12s;
  }

  .cap-item {
    animation: rise 0.55s var(--ease) both;
  }

  .cap-item:nth-child(1) { animation-delay: 0.05s; }
  .cap-item:nth-child(2) { animation-delay: 0.1s; }
  .cap-item:nth-child(3) { animation-delay: 0.15s; }
  .cap-item:nth-child(4) { animation-delay: 0.2s; }
  .cap-item:nth-child(5) { animation-delay: 0.25s; }
  .cap-item:nth-child(6) { animation-delay: 0.3s; }

  @keyframes rise {
    from {
      filter: blur(4px);
      transform: translateY(10px);
    }
    to {
      filter: none;
      transform: none;
    }
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
