:root {
  --bg: #fbfcfe;
  --bg-tint: #f3f5fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #55607a;
  --line: #e3e7f0;
  --dot: #d5dbe8;
  --accent: #4f46e5;
  --accent-2: #0891b2;
  --accent-ink: #ffffff;
  --ok: #059669;
  --editor-bg: #0f172a;
  --editor-text: #e2e8f0;
  --editor-line: #1e293b;
  --feature-bg: #0f172a;
  --feature-text: #e2e8f0;
  --feature-muted: #94a3b8;
  --feature-accent: #a5b4fc;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 8px 24px rgb(15 23 42 / 0.06);
  --radius: 14px;
  --wrap: 1120px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --bg-tint: #10162a;
    --surface: #131a2e;
    --text: #e6e9f2;
    --muted: #98a2b8;
    --line: #232c44;
    --dot: #222b42;
    --accent: #8b85ff;
    --accent-2: #22d3ee;
    --accent-ink: #0b0f19;
    --ok: #34d399;
    --editor-bg: #070a12;
    --editor-line: #1a2236;
    --feature-bg: #141b33;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 {
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); max-width: 22em; }
h3 { font-size: 1.07rem; letter-spacing: -0.01em; }

p { margin: 0 0 1em; }

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

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 4px;
}

.accent { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.label {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 0.9em;
}

.intro {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 44em;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 600;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  height: 34px;
  padding: 0 8px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

nav {
  display: flex;
  align-items: center;
  gap: 4px 22px;
  flex-wrap: wrap;
}

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

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

nav .nav-cta {
  color: var(--accent);
  font-weight: 600;
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.actions.center { justify-content: center; margin-top: 0; }

.button {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent);
}

.button.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.button.ghost:hover { box-shadow: var(--shadow); }

/* Hero */
.hero {
  position: relative;
  padding: clamp(56px, 10vw, 112px) 0 clamp(56px, 8vw, 96px);
  background-image:
    radial-gradient(40rem 22rem at 90% 0%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%),
    radial-gradient(36rem 24rem at 0% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.lead {
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  max-width: 34em;
}

/* Code editor */
.editor {
  margin: 0;
  background: var(--editor-bg);
  color: var(--editor-text);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgb(15 23 42 / 0.25), 0 0 0 1px var(--editor-line);
  overflow: hidden;
  min-width: 0;
}

.editor-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--editor-line);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #334155;
}

.dot:nth-child(1) { background: #f87171; }
.dot:nth-child(2) { background: #fbbf24; }
.dot:nth-child(3) { background: #34d399; }

.editor-file {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #94a3b8;
}

.editor pre {
  margin: 0;
  padding: 20px 22px 22px;
  overflow-x: auto;
  font: 0.86rem/1.7 var(--mono);
}

@media (max-width: 480px) {
  .editor pre { font-size: 0.74rem; padding: 16px; }
}

.editor code {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
}

.editor .k { color: #c084fc; }
.editor .t { color: #67e8f9; }
.editor .s { color: #86efac; }
.editor .n { color: #fda4af; }
.editor .c { color: #64748b; }

/* Stats */
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.stats dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stats dl > div {
  padding: 28px 20px;
  border-left: 1px solid var(--line);
}

.stats dl > div:first-child { border-left: 0; padding-left: 0; }

.stats dt {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stats dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 700px) {
  .stats dl { grid-template-columns: repeat(2, 1fr); }
  .stats dl > div { border-left: 0; padding: 20px 0; }
  .stats dl > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* Sections */
.section {
  padding: clamp(64px, 9vw, 104px) 0;
}

.section.tinted {
  background: var(--bg-tint);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cards,
.tech,
.cases {
  list-style: none;
  padding: 0;
  margin: 36px 0 0;
  display: grid;
  gap: 16px;
}

.cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tech { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cases { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.cards li,
.tech li,
.cases li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.cards p,
.cases p:not(.case-tag) {
  color: var(--muted);
  margin: 0;
}

/* Tech cards */
.tech li {
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.tech li:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.tech-name {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}

.tech-name::before { content: "$ "; color: var(--muted); }

.tech p { color: var(--muted); }

.tech .gain {
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.tech .gain::before {
  content: "→ ";
  color: var(--ok);
  font-family: var(--mono);
}

.more { margin-top: 40px; }

/* Tags */
.tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
}

/* AI feature */
.section.feature {
  background:
    radial-gradient(30rem 20rem at 100% 0%, rgb(99 102 241 / 0.25), transparent 70%),
    radial-gradient(26rem 18rem at 0% 100%, rgb(6 182 212 / 0.18), transparent 70%),
    var(--feature-bg);
  color: var(--feature-text);
}

.feature .label { color: var(--feature-accent); }
.feature p { color: var(--feature-muted); }

.split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px 64px;
  align-items: start;
}

@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
}

.checks {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: grid;
  gap: 12px;
}

.checks li {
  position: relative;
  padding-left: 30px;
}

.checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--feature-bg);
  background: #34d399;
}

/* Cases */
.case-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
  border-radius: 6px;
  padding: 2px 8px;
  margin-bottom: 12px;
}

.cases + .small { margin-top: 24px; }

/* Steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 36px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  border-top: 2px solid var(--line);
  padding-top: 18px;
  position: relative;
}

.steps li::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.steps p {
  color: var(--muted);
  margin: 0;
}

/* Contact */
.section.cta {
  text-align: center;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
}

.section.cta h2 { margin-left: auto; margin-right: auto; }

.section.cta > .wrap > p:not(.label) {
  color: var(--muted);
  margin: 0 auto 28px;
}

.section.cta .small { margin: 24px 0 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p { margin: 0 0 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  .button, .tech li { transition: none; }
}

/* Language switch */
nav .lang {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
}

nav .lang:hover {
  color: var(--text);
  border-color: var(--muted);
}
