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

/* ── Tokens ── */
:root {
  --bg: #0c1210;
  --bg-raised: #141c1a;
  --bg-card: #182220;
  --bg-surface: #1a2624;
  --border: #243230;
  --border-hover: #344442;
  --text: #edf0ef;
  --text-muted: #8e9b99;
  --text-dim: #566361;
  --accent: #5de4a7;
  --accent-dim: rgba(93, 228, 167, 0.1);
  --orange: #f0943a;
  --radius: 10px;
  --radius-lg: 14px;
  --max-width: 1120px;
  --font-display: "Newsreader", "Georgia", serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

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

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-raised);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  background: rgba(12, 18, 16, 0.75);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.nav-brand img { border-radius: 8px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 13.5px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

.nav-links .gh-link {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links .gh-link svg {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
  transition: fill 0.15s;
}
.nav-links .gh-link:hover svg { fill: var(--text); }

/* ── Hero ── */
.hero {
  padding: 6rem 0 0;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 400;
  font-style: normal;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

.hero .subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 540px;
  margin: 0 auto 2.25rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(237, 240, 239, 0.12);
}
.btn-primary svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.hero-meta {
  color: var(--text-dim);
  font-size: 12.5px;
  margin-top: 0.5rem;
  line-height: 1.8;
}
.hero-meta code {
  font-size: 11.5px;
}

/* ── Preview image ── */
.preview-wrap {
  margin-top: 3.5rem;
  margin-bottom: 5rem;
}

.preview-wrap img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.02);
}

/* ═══════════════════════════════════════
   Feature sections
   ═══════════════════════════════════════ */

.feat {
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}

.feat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.feat-row-reverse { direction: rtl; }
.feat-row-reverse > * { direction: ltr; }

.feat-text h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.feat-text > p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 14.5px;
  line-height: 1.7;
}

.feat-text > p strong {
  color: var(--text);
  font-weight: 500;
}

.feat-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feat-list li {
  font-size: 13.5px;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.6;
}

.feat-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.feat-list li strong {
  color: var(--text);
  font-weight: 500;
}

/* ── Shared mock styles ── */

.mock-window, .mock-sidebar, .mock-code {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}

.mock-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.mock-title {
  margin-left: 8px;
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Color tokens for code */
.c-green { color: #6ee7b7; }
.c-blue { color: #7dd3fc; }
.c-cyan { color: #67e8f9; }
.c-yellow { color: #fcd34d; }
.c-orange { color: #fdba74; }
.c-red { color: #fca5a5; }
.c-dim { color: var(--text-dim); }

.cursor {
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ── Terminal mock ── */
.mock-splits {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 200px;
}

.mock-pane {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mock-pane code {
  background: none;
  border: none;
  padding: 0;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.mock-divider-v {
  width: 1px;
  background: var(--border);
}

/* ── Sidebar mock ── */
.sidebar-tree {
  padding: 10px 0;
}

.tree-item {
  padding: 4px 14px;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tree-item.active {
  background: var(--accent-dim);
  color: var(--text);
}

.tree-item .tree-icon { font-size: 8px; width: 12px; text-align: center; }
.tree-item .tree-icon.folder { font-size: 10px; color: var(--accent); }
.tree-item .tree-icon.branch { font-size: 14px; }

.indent-1 { padding-left: 30px; }
.indent-2 { padding-left: 46px; }
.indent-3 { padding-left: 62px; }

.tree-item.server { color: var(--text); font-weight: 500; }
.tree-item.server .tree-icon { color: var(--accent); font-size: 7px; }

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: auto;
}
.status-dot.working {
  background: var(--text-dim);
  animation: pulse-dim 1.2s ease-in-out infinite alternate;
}
@keyframes pulse-dim {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

/* ── Agent mock ── */
.mock-agent {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.agent-msg {
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 8px;
}

.agent-msg code {
  font-size: 11px;
}

.agent-msg.user {
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.agent-msg.assistant {
  background: transparent;
}

.agent-role {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.agent-files {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.agent-file {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  padding: 3px 8px;
  background: var(--bg-raised);
  border-radius: 4px;
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--orange);
  padding: 0 4px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  position: relative;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--orange);
  animation: pulse-ring 1.4s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

/* ── Code block mock ── */
.code-block {
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-muted);
  overflow-x: auto;
  background: none;
  margin: 0;
  border-radius: 0;
  max-width: 100%;
}

.mock-code {
  max-width: 100%;
  min-width: 0;
}

.feat-visual {
  min-width: 0;
  overflow: hidden;
}

/* ── Diagram ── */
.mock-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 2.5rem 1rem;
}

.diagram-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.diagram-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.diagram-icon svg { width: 24px; height: 24px; }

.diagram-node span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.diagram-sub {
  font-size: 10.5px !important;
  color: var(--text-dim) !important;
  font-weight: 400 !important;
}

.diagram-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
}
.diagram-arrow span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}
.arrow-line {
  width: 48px;
  height: 1px;
  background: var(--border);
  position: relative;
}
.arrow-line::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3px;
  border: 3px solid transparent;
  border-left: 5px solid var(--border);
}

/* ── iOS screenshot pair ── */
.phone-pair {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0;
}

.phone-frame {
  --phone-w: 230px;
  --bezel: 9px;
  --frame-radius: 44px;
  width: var(--phone-w);
  padding: var(--bezel);
  background: #0a0a0c;
  border-radius: var(--frame-radius);
  box-shadow:
    0 0 0 1.5px #2a2a2e,
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 22px 60px rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.4);
}

.phone-screen {
  position: relative;
  border-radius: calc(var(--frame-radius) - var(--bezel));
  overflow: hidden;
  background: #000;
  line-height: 0;
}

.phone-screen img {
  display: block;
  width: 100%;
  height: auto;
}

.phone-island {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 22px;
  background: #000;
  border-radius: 12px;
  z-index: 2;
}

.phone-back {
  transform: rotate(-5deg) translateY(14px);
  margin-right: -64px;
  z-index: 1;
}

.phone-front {
  transform: rotate(4deg);
  z-index: 2;
}

/* ── Docs CTA ── */
.docs-cta {
  padding: 5rem 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.docs-cta h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.docs-cta p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 1.75rem;
}

.docs-cta-btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.docs-cta-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
  transform: translateY(-1px);
}

/* ── Footer ── */
footer {
  margin-top: 5rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  padding: 3rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  font-size: 13px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text-muted); }

/* ═══════════════════════════════════════
   Responsive
   ═══════════════════════════════════════ */

@media (max-width: 840px) {
  .feat-row {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .feat-row-reverse { direction: ltr; }

  .feat { padding: 4rem 0; }

  .hero { padding: 4rem 0 0; }

  .mock-diagram { flex-wrap: wrap; gap: 1rem; }
  .diagram-arrow { transform: rotate(0); }
}

@media (max-width: 520px) {
  .container { padding-left: 1.25rem; padding-right: 1.25rem; }

  .hero h1 { font-size: 1.8rem; }

  .mock-splits { grid-template-columns: 1fr; }
  .mock-divider-v {
    width: auto;
    height: 1px;
  }

  .code-block {
    font-size: 10px;
    padding: 12px 14px;
  }

  .phone-frame { --phone-w: 195px; --frame-radius: 38px; --bezel: 8px; }
  .phone-back { margin-right: -54px; }
  .phone-island { width: 66px; height: 19px; top: 7px; }

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