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

:root {
  --sage: #84a98c;
  --sage-dim: rgba(132,169,140,0.09);
  --sage-border: rgba(132,169,140,0.22);
  --sage-strong: #9bbda3;
  --bg: #0d0f13;
  --bg-surface: #111318;
  --bg-raised: #161a20;
  --border: rgba(255,255,255,0.07);
  --border-s: rgba(255,255,255,0.12);
  --n100: #e8e8e6;
  --n200: #ccccc8;
  --n300: #a8a8a4;
  --n400: #80807c;
  --n500: #5c5c58;
  --n600: #3e3e3a;
  --font: 'Space Grotesk', sans-serif;
  --mono: 'Geist Mono', monospace;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--n100);
  -webkit-font-smoothing: antialiased;
  line-height: 1;
  overflow-x: hidden;
}

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: rgba(13,15,19,0.88);
  backdrop-filter: blur(12px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-loupe-icon {
  width: 28px; height: 28px;
  position: relative;
  flex-shrink: 0;
}

.nav-wordmark {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--n100);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 13px;
  color: var(--n400);
  text-decoration: none;
  transition: color 120ms;
}
.nav-link:hover { color: var(--n200); }
.nav-link.active { color: var(--n200); }

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 40px 80px;
  position: relative;
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(132,169,140,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--sage);
  margin-bottom: 32px;
  padding: 6px 14px;
  border: 1px solid var(--sage-border);
  border-radius: 20px;
  background: var(--sage-dim);
}

.hero-eyebrow-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sage);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--n100);
  max-width: 800px;
  margin-bottom: 28px;
}

.hero-h1 strong {
  font-weight: 600;
  color: #fff;
}

.hero-sub {
  font-size: 18px;
  font-weight: 400;
  color: var(--n400);
  max-width: 480px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  margin-bottom: 48px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 80px;
}

.btn-primary-lg {
  display: inline-block;
  font-size: 14px;
  font-family: var(--font);
  font-weight: 600;
  color: #0d0f13;
  background: var(--sage);
  border: none;
  cursor: pointer;
  padding: 13px 28px;
  border-radius: 6px;
  transition: background 120ms;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.btn-primary-lg:hover { background: var(--sage-strong); }

/* PRODUCT WINDOW */
.product-window-wrap {
  width: 100%;
  max-width: 900px;
  border-radius: 10px;
  border: 1px solid var(--border-s);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: 0 40px 120px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.05);
}

.window-chrome {
  height: 36px;
  background: #0a0c10;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 7px;
  flex-shrink: 0;
}

.wc-dot { width: 11px; height: 11px; border-radius: 50%; }
.wc-dot:nth-child(1) { background: rgba(248,113,113,0.5); }
.wc-dot:nth-child(2) { background: rgba(245,158,11,0.45); }
.wc-dot:nth-child(3) { background: rgba(52,211,153,0.4); }

.window-url {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.window-url-inner {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--n500);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 14px;
}

/* APP INSIDE WINDOW */
.app-shell {
  display: flex;
  height: 420px;
  font-size: 12px;
}

/* sidebar */
.app-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #0d0f14;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--n100);
}

.sidebar-pr-list { flex: 1; padding: 6px 0; overflow-y: auto; }

.sidebar-section-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--n600);
  padding: 8px 14px 4px;
}

.pr-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 80ms;
}
.pr-item:hover { background: rgba(255,255,255,0.025); }
.pr-item.active {
  background: var(--sage-dim);
  border-left-color: var(--sage);
}

.pr-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sage);
  flex-shrink: 0;
}
.pr-dot.gray { background: var(--n600); }

.pr-title {
  font-size: 11.5px;
  color: var(--n400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.pr-item.active .pr-title { color: var(--n200); }
.pr-meta { font-family: var(--mono); font-size: 9px; color: var(--n600); }

/* main diff area */
.app-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.diff-header {
  padding: 0 14px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  flex-shrink: 0;
}

.diff-file-badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--n300);
}

.branch-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--sage-border);
  background: var(--sage-dim);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--sage);
}

.diff-stats { margin-left: auto; display: flex; gap: 8px; }
.diff-stat-add { font-family: var(--mono); font-size: 10px; color: var(--sage); }
.diff-stat-del { font-family: var(--mono); font-size: 10px; color: #f87171; }

/* diff lines */
.diff-body {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-surface);
}

.hunk-head {
  padding: 2px 14px;
  background: rgba(132,169,140,0.04);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--n500);
}

.diff-line {
  display: flex;
  min-height: 20px;
  line-height: 1.6;
  cursor: default;
  transition: background 60ms;
}
.diff-line:hover { background: rgba(255,255,255,0.02); }
.diff-line.selected-line { background: rgba(132,169,140,0.12); }

.line-num {
  width: 40px;
  padding: 0 6px;
  text-align: right;
  color: var(--n600);
  font-family: var(--mono);
  font-size: 10px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  opacity: 0.6;
  user-select: none;
}

.line-mark {
  width: 16px;
  text-align: center;
  color: var(--n500);
  font-family: var(--mono);
  font-size: 11px;
  flex-shrink: 0;
  user-select: none;
}

.line-code {
  flex: 1;
  padding: 0 14px;
  white-space: pre;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--n200);
}

.diff-line.add { background: rgba(132,169,140,0.07); border-left: 2px solid rgba(132,169,140,0.4); }
.diff-line.add .line-mark { color: var(--sage); }
.diff-line.del { background: rgba(248,113,113,0.06); border-left: 2px solid rgba(248,113,113,0.3); }
.diff-line.del .line-mark { color: #f87171; }
.diff-line.del .line-code { color: var(--n500); text-decoration: line-through; }

/* inline comment */
.inline-comment {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--sage-border);
  border-bottom: 1px solid var(--sage-border);
  background: rgba(132,169,140,0.05);
  animation: slideDown 0.25s cubic-bezier(0.16,1,0.3,1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.comment-gutter {
  width: 56px;
  border-right: 1px solid var(--sage-border);
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10px;
}

.comment-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--sage-dim);
  border: 1px solid var(--sage-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 600;
  color: var(--sage);
  font-family: var(--mono);
}

.comment-body {
  flex: 1;
  padding: 10px 14px;
}

.comment-author {
  font-size: 10px;
  font-weight: 600;
  color: var(--n300);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-badge {
  font-family: var(--mono);
  font-size: 8px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--sage-dim);
  border: 1px solid var(--sage-border);
  color: var(--sage);
  font-weight: 500;
}

.comment-text {
  font-size: 12px;
  color: var(--n300);
  line-height: 1.55;
}

.comment-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comment-btn {
  font-size: 11px;
  font-family: var(--font);
  color: var(--n500);
  background: none;
  border: 1px solid var(--border-s);
  border-radius: 4px;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 80ms;
}
.comment-btn:hover { color: var(--n200); border-color: var(--border); }
.comment-btn.sage { color: var(--sage); border-color: var(--sage-border); background: var(--sage-dim); }

/* agent panel */
.agent-panel {
  height: 140px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.agent-tabs {
  height: 32px;
  display: flex;
  align-items: stretch;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.agent-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  font-size: 11px;
  color: var(--n500);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  font-family: var(--font);
}

.agent-tab.active {
  color: var(--n200);
}
.agent-tab.active::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--sage);
}

.agent-tab-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sage);
}

.agent-response {
  flex: 1;
  padding: 10px 14px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--n300);
  line-height: 1.6;
}

.agent-response .thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--n500);
  font-size: 11px;
  font-family: var(--mono);
}

.thinking-dots {
  display: flex;
  gap: 3px;
}

.thinking-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--sage);
  animation: blink 1.2s ease-in-out infinite;
}
.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

.agent-typed {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--sage);
}

.agent-code-inline {
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(132,169,140,0.1);
  border: 1px solid var(--sage-border);
  border-radius: 3px;
  padding: 0 5px;
  color: var(--sage);
}

/* SECTION LAYOUTS */
section {
  padding: 100px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 20px;
}

/* HOW IT WORKS */
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  margin-top: 56px;
}

.how-card {
  padding: 28px 26px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  position: relative;
}

.how-card:first-child { border-radius: 8px 0 0 8px; }
.how-card:last-child  { border-radius: 0 8px 8px 0; }

.how-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--sage);
  margin-bottom: 16px;
  opacity: 0.7;
}

.how-title {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--n100);
  margin-bottom: 10px;
}

.how-desc {
  font-size: 13.5px;
  color: var(--n400);
  line-height: 1.65;
}

.how-arrow {
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  background: var(--bg-raised);
  border: 1px solid var(--border-s);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--sage);
  z-index: 2;
}

/* SECTION TITLE */
.section-h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--n100);
  max-width: 600px;
}

.section-h2 strong {
  font-weight: 600;
  color: #fff;
}

.section-sub {
  font-size: 16px;
  color: var(--n400);
  line-height: 1.65;
  max-width: 460px;
  margin-top: 18px;
  letter-spacing: -0.01em;
}

/* LOOP comparison */
.loop-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 56px;
}

.loop-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.loop-panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  gap: 10px;
}

.loop-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--n400);
}

.loop-label.bad  { color: #f87171; }
.loop-label.good { color: var(--sage); }

.loop-badge {
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 3px;
  margin-left: auto;
}

.loop-badge.bad  { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.25); color: #f87171; }
.loop-badge.good { background: var(--sage-dim); border: 1px solid var(--sage-border); color: var(--sage); }

.loop-steps { padding: 18px; }

.loop-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.loop-step:last-child { border-bottom: none; }

.step-icon {
  width: 22px; height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  margin-top: 1px;
}

.step-icon.bad  { background: rgba(248,113,113,0.08); color: #f87171; }
.step-icon.good { background: var(--sage-dim); color: var(--sage); }

.step-txt {
  font-size: 12.5px;
  color: var(--n400);
  line-height: 1.5;
}

.step-time {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--n600);
  flex-shrink: 0;
}
.step-time.fast { color: var(--sage); }

/* PRINCIPLES */
.principles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 56px;
}

.principle-card {
  padding: 28px 28px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}
.principle-card:nth-child(1) { border-radius: 8px 0 0 0; }
.principle-card:nth-child(2) { border-radius: 0 8px 0 0; }
.principle-card:nth-child(3) { border-radius: 0 0 0 8px; }
.principle-card:nth-child(4) { border-radius: 0 0 8px 0; }

.principle-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--sage);
  opacity: 0.6;
  margin-bottom: 14px;
}

.principle-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--n100);
  margin-bottom: 10px;
}

.principle-desc {
  font-size: 13px;
  color: var(--n400);
  line-height: 1.65;
}

/* DOWNLOADS */
.downloads-section {
  padding: 80px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 48px;
}

.download-card {
  padding: 28px 24px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.download-card:hover {
  border-color: var(--sage-border);
  background: rgba(132,169,140,0.04);
}

.download-platform {
  font-size: 15px;
  font-weight: 500;
  color: var(--n200);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.download-arch {
  font-size: 12px;
  color: var(--n500);
  font-family: var(--mono);
  margin-bottom: 12px;
}

.download-ext {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--sage);
  font-family: var(--mono);
}

.downloads-note {
  margin-top: 20px;
  font-size: 12px;
  color: var(--n500);
  line-height: 1.5;
}

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

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-copy {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--n600);
}
