@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Fira+Code:wght@400;500&display=swap');

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

:root {
  --bg:          #0D1117;
  --surface:     #161B22;
  --surface-alt: #1C2128;
  --border:      #21262D;
  --border-sub:  #30363D;
  --text:        #E6EDF3;
  --text-muted:  #7D8590;
  --accent:      #F6821F;
  --accent-dim:  rgba(246, 130, 31, 0.10);
  --ok:          #3FB950;
  --danger:      #F85149;
  --nav-bg:      rgba(13, 17, 23, 0.90);
  --sans:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:        'Fira Code', 'Cascadia Code', 'SF Mono', monospace;
  --max-w:       1200px;
  --px:          clamp(20px, 5vw, 64px);
  --section-gap: clamp(64px, 10vw, 112px);
}

[data-theme="light"] {
  --bg:          #F6F8FA;
  --surface:     #FFFFFF;
  --surface-alt: #EAEEF2;
  --border:      #D0D7DE;
  --border-sub:  #BABFC5;
  --text:        #24292F;
  --text-muted:  #57606A;
  --accent:      #E07A10;
  --accent-dim:  rgba(224, 122, 16, 0.08);
  --ok:          #1A7F37;
  --danger:      #CF222E;
  --nav-bg:      rgba(246, 248, 250, 0.92);
}

[data-theme="light"] ::selection { background: var(--accent); color: #FFFFFF; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-sub); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: var(--accent); color: #0D1117; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* ── Nav ─────────────────────────────────────────────────────────── */

.l-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--px);
  height: 56px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.l-nav__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.l-nav__brand svg { flex-shrink: 0; color: var(--accent); }

.l-nav__brand-sep {
  color: var(--border-sub);
  font-weight: 400;
  margin: 0 2px;
}

.l-nav__brand-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}

.l-nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.l-nav__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 5px;
  transition: color 0.15s;
}

.l-nav__link:hover { color: var(--text); }

.l-nav__cta {
  font-size: 13px;
  font-weight: 600;
  color: #0D1117;
  background: var(--accent);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 5px;
  letter-spacing: -0.01em;
  transition: opacity 0.15s;
}

.l-nav__cta:hover { opacity: 0.88; }

.l-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 5px;
  padding: 0;
  transition: color 0.15s;
}

.l-theme-toggle:hover { color: var(--text); }

.l-theme-toggle .icon-moon { display: none; }

[data-theme="light"] .l-theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .l-theme-toggle .icon-moon { display: block; }

/* ── Hero ─────────────────────────────────────────────────────────── */

.l-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 100px) var(--px);
}

.l-hero__headline {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.04em;
  margin-bottom: 22px;
  color: var(--text);
}

.l-hero__headline em {
  color: var(--accent);
  font-style: normal;
}

.l-hero__body {
  font-size: clamp(14px, 1.5vw, 16px);
  color: var(--text-muted);
  max-width: 50ch;
  line-height: 1.7;
  margin-bottom: 36px;
}

.l-hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #0D1117;
  background: var(--accent);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 5px;
  letter-spacing: -0.01em;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 5px;
  border: 1px solid var(--border-sub);
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

/* ── Demo window ─────────────────────────────────────────────────── */

.demo-window {
  background: var(--surface);
  border: 1px solid var(--border-sub);
  border-radius: 8px;
  overflow: hidden;
  animation: demo-enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes demo-enter {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

.demo-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.demo-dots {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.demo-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-sub);
}

.demo-title-text {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 2px;
}

.demo-body {
  display: grid;
  grid-template-columns: 1fr 176px;
}

.demo-chat {
  padding: 14px 12px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.demo-msg { display: flex; flex-direction: column; gap: 5px; }

.demo-msg__frame {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
}

.demo-msg__frame .dm-arrow { color: var(--accent); }
.demo-msg__frame .dm-arrow--user { color: var(--text-muted); }

.demo-msg__body {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  padding-left: 14px;
}

.demo-msg__code {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg);
  border-radius: 4px;
  padding: 5px 8px;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.demo-inspector {
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
}

.demo-insp__title {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
}

.demo-status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.07em;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(246, 130, 31, 0.14);
  color: var(--accent);
}

.demo-section { display: flex; flex-direction: column; gap: 3px; }

.demo-section__lbl {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.demo-conn-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
}

.sym-ok   { color: var(--ok); flex-shrink: 0; }
.sym-bad  { color: var(--danger); flex-shrink: 0; }
.sym-unk  { color: var(--text-muted); flex-shrink: 0; }
.conn-lbl { color: var(--text-muted); }
.conn-val { margin-left: auto; }
.conn-val--ok  { color: var(--ok); }
.conn-val--bad { color: var(--danger); }
.conn-val--unk { color: var(--text-muted); }

.demo-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-list li {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.4;
  padding-left: 8px;
  position: relative;
}

.demo-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.demo-nextstep {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
  padding: 5px 6px;
  background: var(--accent-dim);
  border-radius: 3px;
  line-height: 1.4;
}

/* ── Tech strip ──────────────────────────────────────────────────── */

.l-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.l-strip__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
  display: flex;
  align-items: center;
  height: 48px;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
}

.l-strip__inner::-webkit-scrollbar { display: none; }

.l-strip__item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0 20px;
  height: 100%;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.l-strip__item:first-child { padding-left: 0; }
.l-strip__item:last-child  { border-right: none; }

.l-strip__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── How it works ────────────────────────────────────────────────── */

.l-how {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--section-gap) var(--px);
}

.l-section-h {
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 40px;
  color: var(--text);
}

.l-how__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  list-style: none;
  padding: 0;
}

.l-step {
  background: var(--surface);
  padding: 28px 26px;
}

.l-step__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.l-step__body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 34ch;
}

.l-step__detail {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  opacity: 0.8;
}

/* ── State model ─────────────────────────────────────────────────── */

.l-state {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.l-state__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--section-gap) var(--px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.l-state__text h2 {
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.l-state__text p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 44ch;
  margin-bottom: 14px;
}

.l-state__text p strong {
  color: var(--text);
  font-weight: 600;
}

.l-state__model {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 22px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
}

.sm-key   { color: var(--accent); }
.sm-type  { color: var(--text-muted); }
.sm-val   { color: var(--text); }
.sm-sep   { display: block; height: 1px; background: var(--border); margin: 8px 0; }
.sm-note  { color: var(--text-muted); font-size: 11px; }

/* ── Architecture ────────────────────────────────────────────────── */

.l-arch {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--section-gap) var(--px);
}

.l-arch__diagram {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  overflow-x: auto;
}

.arch-node {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border-sub);
  border-radius: 6px;
  padding: 14px 18px;
  flex-shrink: 0;
}

.arch-node__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.arch-node__sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
}

.arch-arrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--border-sub);
  padding: 0 10px;
  flex-shrink: 0;
  user-select: none;
}

.arch-node--focus {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.arch-node--focus .arch-node__label { color: var(--accent); }

.arch-note {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  max-width: 72ch;
  line-height: 1.65;
}

/* ── Footer ──────────────────────────────────────────────────────── */

.l-footer {
  border-top: 1px solid var(--border);
  padding: 28px var(--px);
}

.l-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.l-footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.l-footer__brand svg { color: var(--accent); }

.l-footer__meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}

.l-footer__links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.l-footer__link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.l-footer__link:hover { color: var(--text); }

/* ── Responsive ──────────────────────────────────────────────────── */

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

  .l-hero__body { max-width: none; }

  .demo-body {
    grid-template-columns: 1fr;
  }

  .demo-inspector {
    border-top: 1px solid var(--border);
  }

  .l-how__steps {
    grid-template-columns: 1fr;
  }

  .l-state__inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .l-state__text p { max-width: none; }

  .l-arch__diagram { gap: 8px; flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .l-nav__brand-sub { display: none; }
  .l-nav__brand-sep { display: none; }
  .l-nav__link      { display: none; }

  .l-footer__meta { order: 3; width: 100%; }
}
