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

:root {
  --bg:        #151423;
  --bg-card:   #1a1930;
  --bg-code:   #0f0e1c;
  --blue:      #5785CA;
  --blue-dim:  #3d6aad;
  --green:     #98C948;
  --green-dim: #7aab2f;
  --text:      #FAFAFA;
  --muted:     #A5A5AD;
  --border:    #2a2940;
  --border-mid:#3C4A4E;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}



a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--green); }

code, pre {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.875em;
}

/* ── Layout ───────────────────────────────────────────────────── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
}

section { padding: 6rem 0; scroll-margin-top: 6rem; }
section:nth-child(even) { background: rgba(255,255,255,0.018); }

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.75rem;
}

.section-sub {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 620px;
  margin-bottom: 3rem;
}

/* ── Nav ──────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(21, 20, 35, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  background: linear-gradient(110deg, var(--text) 40%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-brand img {
  width: 88px;
  height: 88px;
  display: block;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  font-size: 0.9rem;
}

.nav-links a { color: var(--muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--text);
  flex-direction: column;
  gap: 5px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ─────────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 10rem 0 6rem;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(ellipse at center,
    rgba(87,133,202,0.18) 0%,
    rgba(152,201,72,0.08) 40%,
    transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 3rem;
  align-items: center;
}

.hero-demo-wrap {
  min-width: 0; /* prevent grid blowout */
}

.hero-demo-wrap #hero-demo {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.hero-demo-caption {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.hero-demo-caption a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-warning {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid rgba(152,201,72,0.35);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-title .live {
  color: var(--green);
  text-shadow: 0 0 40px rgba(152,201,72,0.5);
}

.hero-title .wire {
  color: var(--blue);
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  max-width: 560px;
}

.hero-tagline strong {
  color: var(--text);
  font-style: italic;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border: 1px solid transparent;
}
.btn-primary:hover {
  background: var(--blue-dim);
  color: #fff;
  box-shadow: 0 0 24px rgba(152,201,72,0.35);
  border-color: var(--green);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-mid);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--blue);
}

/* ── Problem ──────────────────────────────────────────────────── */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.problem-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

.problem-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.problem-card p { color: var(--muted); font-size: 0.95rem; }

.problem-card .emoji {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.problem-card.highlight {
  border-color: var(--green);
  background: linear-gradient(135deg, rgba(152,201,72,0.06), var(--bg-card));
}

.loop-arrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1.75rem 0;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.loop-arrow .step {
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.loop-arrow .step.bad   { color: #e07070; }
.loop-arrow .step.good  { color: var(--green); }
.loop-arrow .step.struck {
  color: var(--muted);
  opacity: 0.4;
  text-decoration: line-through;
  text-decoration-color: #e07070;
  text-decoration-thickness: 2px;
}

.loop-badge {
  margin-left: 0.75rem;
  background: rgba(152, 201, 72, 0.12);
  color: var(--green);
  border: 1px solid rgba(152, 201, 72, 0.3);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.loop-arrow .arrow {
  color: var(--muted);
  opacity: 0.35;
  font-size: 1rem;
  line-height: 1;
  user-select: none;
}

.problem-pivot {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  opacity: 0.55;
  margin: 2rem 0 2.5rem;
  font-style: italic;
}

/* ── Architecture ─────────────────────────────────────────────── */
.arch-box {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  font-family: monospace;
  font-size: 0.92rem;
  line-height: 2;
  color: var(--muted);
  max-width: 720px;
  margin: 3rem 0;
  overflow-x: auto;
  white-space: nowrap;
}

.arch-box .hl-green { color: var(--green); }
.arch-box .hl-blue  { color: var(--blue); }
.arch-box .hl-text  { color: var(--text); }

/* ── Features ─────────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 12px;
  padding: 2rem 2.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 0; /* prevent grid blowout */
}

.feature-card:hover {
  border-left-color: var(--green);
  box-shadow: 0 4px 32px rgba(87,133,202,0.1);
}

.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card h3 code {
  color: var(--green);
  font-size: 0.95em;
}

.feature-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ── Code blocks ──────────────────────────────────────────────── */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.7;
  min-width: 0;
}

.code-block pre {
  margin: 0;
  white-space: pre;
  min-width: 0;
}

.code-block .c  { color: #5a6a7a; }   /* comments */
.code-block .kw { color: var(--blue); }/* keywords / fn names */
.code-block .s  { color: #e6a95a; }   /* strings */
.code-block .n  { color: var(--green); }/* numbers / special vals */
.code-block .p  { color: var(--muted); }/* punctuation */
.code-block .r  { color: #c47bdb; }   /* result output */

/* ── Human-friendly ───────────────────────────────────────────── */
.human-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 860px;
  margin: 3rem 0;
}
.human-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}
.human-card.agent { border-top: 3px solid var(--green); }
.human-card.human { border-top: 3px solid var(--blue); }
.human-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.human-card p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
}
.human-card .card-icon {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}
.human-tagline {
  max-width: 860px;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0;
}
@media (max-width: 768px) {
  .human-block { grid-template-columns: 1fr; }
}

/* ── Story ────────────────────────────────────────────────────── */
#story { position: relative; overflow: hidden; }

#story::before {
  content: '';
  position: absolute;
  right: -200px; top: 50%;
  transform: translateY(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(152,201,72,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.story-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 780px;
  font-size: 1.05rem;
  line-height: 1.8;
}

.story-box p { color: var(--muted); margin-bottom: 1rem; }
.story-box p:last-child { margin-bottom: 0; }
.story-box strong { color: var(--text); }
.story-box .result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--green);
}

.story-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--green);
  line-height: 1;
  display: block;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

/* ── Screenshots ──────────────────────────────────────────────── */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.screenshot-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: zoom-in;
  position: relative;
}

.screenshot-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(87,133,202,0.15);
}

.screenshot-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top left;
  display: block;
  border-bottom: 1px solid var(--border);
}

.screenshot-caption {
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.screenshot-zoom-icon {
  position: absolute;
  bottom: 2.6rem;
  right: 0.75rem;
  width: 40px;
  height: 40px;
  background: rgba(21, 20, 35, 0.65);
  backdrop-filter: blur(4px);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
  pointer-events: none;
}

.screenshot-card:hover .screenshot-zoom-icon {
  opacity: 1;
}

.screenshot-zoom-icon svg {
  width: 22px;
  height: 22px;
  stroke: rgba(255,255,255,0.95);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Lightbox ─────────────────────────────────────────────────── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 9, 20, 0.92);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

#lightbox.open { display: flex; }

#lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  object-fit: contain;
}

#lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
}

#lightbox-close:hover { color: var(--text); }

/* ── Warning ──────────────────────────────────────────────────── */
#warning {
  background: repeating-linear-gradient(
    -45deg,
    rgba(255,180,0,0.03) 0px,
    rgba(255,180,0,0.03) 2px,
    transparent 2px,
    transparent 12px
  );
  border-top: 1px solid rgba(255,180,0,0.2);
  border-bottom: 1px solid rgba(255,180,0,0.2);
}

.warning-box {
  border: 1px solid rgba(255,180,0,0.35);
  border-left: 4px solid #ffb400;
  border-radius: 12px;
  background: rgba(255,180,0,0.05);
  padding: 2.5rem;
  max-width: 780px;
}

.warning-box .warning-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffb400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.warning-box p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.warning-box p:last-child { margin-bottom: 0; }
.warning-box strong { color: var(--text); }

.warning-verdict {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,180,0,0.2);
  color: #ffb400;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

/* ── Install ──────────────────────────────────────────────────── */
#install { text-align: center; }

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 3rem;
  text-align: left;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.install-step {
  display: grid;
  grid-template-columns: 48px 1fr 1fr;
  gap: 1.5rem 2rem;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  transition: border-color 0.2s;
  min-width: 0;
}

.install-step-body,
.install-step .code-block { min-width: 0; }

.install-step:hover { border-left-color: var(--green); }

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.install-step-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.install-step-body p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.install-footnote {
  margin-top: 0.5rem !important;
  font-size: 0.8rem !important;
  color: var(--muted);
  opacity: 0.75;
}

.install-step .code-block {
  margin: 0;
}

/* ── Footer ───────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.footer-logo img { width: 24px; }

.footer-warning {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.footer-warning strong { color: var(--green); }

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

/* Wide laptop — feature cards drop to 1 col below ~1280px */
@media (max-width: 1280px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* Tablet landscape — ~1024px */
@media (max-width: 1024px) {
  nav { height: 80px; }
  section { scroll-margin-top: 5rem; }
  .nav-brand img { width: 64px; height: 64px; }
  .nav-brand { font-size: 1.45rem; }
  .hero-title { font-size: 2.8rem; }
  .install-step { grid-template-columns: 48px 1fr; }
  .install-step .code-block { grid-column: 1 / -1; }
}

/* Tablet portrait — ~768px */
@media (max-width: 768px) {
  nav { height: 64px; }
  section { scroll-margin-top: 4.5rem; }
  .nav-brand img { width: 44px; height: 44px; }
  .nav-brand { font-size: 1.25rem; }
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0; right: 0;
    background: rgba(21, 20, 35, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 1rem;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 0; }
  .nav-links a { display: block; padding: 0.85rem 1.5rem; font-size: 1rem; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-demo-wrap { order: 2; }
  .hero-title { font-size: 2.2rem; }
  #hero { padding: 7rem 0 4rem; }
  .problem-grid { grid-template-columns: 1fr; }
  .problem-pivot { font-size: 1.15rem; }
  .install-steps { max-width: 100%; }
}

/* Phone — ~480px */
@media (max-width: 480px) {
  nav { height: 64px; padding: 0 1.25rem; }
  .nav-brand img { width: 44px; height: 44px; }
  .nav-brand { font-size: 1.1rem; gap: 0.75rem; }
  .hero-title { font-size: 1.75rem; }
  #hero { padding: 5.5rem 0 3rem; }
  h2 { font-size: 1.75rem; }
  .section-sub { font-size: 0.95rem; }
  .loop-arrow { gap: 0.35rem; }
  .loop-arrow .step { font-size: 0.8rem; }
  .loop-badge { font-size: 0.72rem; padding: 0.15rem 0.55rem; }
  .problem-pivot { font-size: 1rem; }
  .feature-card { padding: 1.5rem; }
  .install-step { padding: 1.25rem; }
  .screenshots-grid { grid-template-columns: 1fr; }
  .arch-box { padding: 1.25rem 1.75rem; font-size: 0.8rem; line-height: 1.8; }
}

/* ── Ko-fi fallback button ────────────────────────────────────── */
@keyframes kofi-wiggle {
  0%,60%        { transform: rotate(0)      scale(1);    }
  75%           { transform: rotate(0)      scale(1.12); }
  80%           { transform: rotate(0)      scale(1.1);  }
  84%, 92%      { transform: rotate(-10deg) scale(1.1);  }
  88%, 96%      { transform: rotate(10deg)  scale(1.1);  }
  100%          { transform: rotate(0)      scale(1);    }
}
.kofi-fallback-img { animation: kofi-wiggle 3s infinite; }
