:root {
  --bg: #f7f7fb;
  --bg-elev: #ffffff;
  --text: #14151c;
  --muted: #5a5f73;
  --border: #e3e4ee;
  --accent: #4f46e5;
  --accent-2: #0891b2;
  --accent-contrast: #ffffff;
  --shadow: 0 1px 2px rgba(20, 21, 28, .04), 0 8px 24px rgba(20, 21, 28, .06);
  --term-bg: #12141d;
  --term-text: #e6e8f2;
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f17;
    --bg-elev: #151824;
    --text: #eceef6;
    --muted: #a0a6bd;
    --border: #262a3a;
    --accent: #8b87ff;
    --accent-2: #38d1e8;
    --accent-contrast: #0d0f17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --term-bg: #0a0b11;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(40rem 24rem at -10% 20%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.container { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--accent); color: var(--accent-contrast);
  padding: .5rem 1rem; border-radius: 8px; z-index: 100;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 700; color: var(--text); text-decoration: none;
}
.brand-mark {
  display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 10px; color: #fff; font-size: .95rem;
  background: linear-gradient(135deg, #5b5bf7, #0ea5c6);
}
.nav-links { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: .4rem .8rem; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }

/* Hero */
.hero { padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 7vw, 5rem); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  margin: 0 0 1.25rem; padding: .3rem .8rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-elev); color: var(--muted); font-size: .875rem; font-weight: 500;
}
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 25%, transparent); }
h1 {
  margin: 0; font-size: clamp(2.6rem, 7vw, 4.75rem);
  line-height: 1.05; letter-spacing: -.035em; font-weight: 700;
}
.gradient-text {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { max-width: 38rem; margin: 1.25rem 0 2rem; font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .75rem 1.25rem; border-radius: 12px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-ghost { background: var(--bg-elev); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }

.terminal {
  margin-top: 3.5rem; max-width: 42rem;
  border-radius: var(--radius); overflow: hidden;
  background: var(--term-bg); color: var(--term-text);
  border: 1px solid color-mix(in srgb, var(--term-text) 12%, transparent);
  box-shadow: var(--shadow);
}
.terminal-bar { display: flex; gap: .4rem; padding: .75rem 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.terminal-bar span { width: .7rem; height: .7rem; border-radius: 50%; background: #3a3f52; }
.terminal-bar span:nth-child(1) { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }
.terminal pre { margin: 0; padding: 1.1rem 1.25rem 1.3rem; overflow-x: auto; font: 500 .875rem/1.8 var(--mono); }
.t-muted { color: #7d849c; }
.t-str { color: #f3c77a; }
.t-ok { color: #4ade80; }
.t-link { color: #7dd3fc; }
.terminal .line { opacity: 0; transform: translateY(4px); transition: opacity .35s ease, transform .35s ease; display: inline; }
.terminal .line.show { opacity: 1; transform: none; }

/* Sections */
.section { padding: clamp(3rem, 8vw, 5.5rem) 0; }
.section-title {
  display: flex; align-items: baseline; gap: .75rem;
  margin: 0 0 2rem; font-size: clamp(1.6rem, 3.5vw, 2.25rem); letter-spacing: -.02em;
}
.section-num { font: 500 .9rem var(--mono); color: var(--accent); }

.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.5rem; align-items: start; }
.prose p { margin: 0 0 1rem; max-width: 40rem; }
.prose strong { color: var(--text); }
.facts {
  list-style: none; margin: 0; padding: 1.25rem 1.5rem;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.facts li { display: flex; flex-direction: column; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.facts li:last-child { border-bottom: 0; }
.fact-label { font: 500 .75rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.card {
  position: relative; padding: 1.75rem;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card-feature {
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), color-mix(in srgb, var(--accent-2) 7%, transparent)),
    var(--bg-elev);
}
.card h3 { margin: 1rem 0 .5rem; font-size: 1.25rem; letter-spacing: -.01em; }
.card-feature h3 { font-size: 1.5rem; }
.card p { margin: 0; color: var(--muted); }
.card-icon {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border-radius: 12px; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 1.25rem 0 0; padding: 0; }
.tags li {
  padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 500;
  color: var(--muted); border: 1px solid var(--border); background: var(--bg);
}

.contact-card {
  padding: clamp(2rem, 5vw, 3.5rem); text-align: center;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow);
}
.contact-card .section-title { justify-content: center; margin-bottom: 1rem; }
.contact-card > p { max-width: 34rem; margin: 0 auto 1.75rem; color: var(--muted); }
.contact-card .small { margin: 1.25rem auto 0; font-size: .875rem; }

.site-footer { padding: 2rem 0 3rem; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); }
.site-footer p { margin: 0; }

/* Reveal on scroll (only when JS is active) */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .about-grid, .cards { grid-template-columns: 1fr; }
  .nav-links a { padding: .4rem .55rem; }
  .brand > span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal, .terminal .line { opacity: 1 !important; transform: none !important; }
}
