/* overflow-x: clip (not hidden) — hidden on one axis forces the other axis's
   computed overflow to auto, which makes body itself the scroll container
   and breaks position: sticky on .l-nav. clip avoids that pairing rule. */
.landing-body { overflow-x: clip; }
.landing-body a { text-decoration: none; color: inherit; }

/* ---------- Nav ---------- */
.l-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 16px 32px; background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.l-nav .brand-mark { color: var(--accent); }
.l-nav-links { display: flex; gap: 24px; margin-right: auto; }
.l-nav-links a { font-size: 13.5px; font-weight: 600; color: var(--text-dim); }
.l-nav-links a:hover { color: var(--text); }
.l-nav-actions { display: flex; gap: 10px; }

/* ---------- Hero ---------- */
.l-hero { position: relative; padding: 90px 24px 60px; text-align: center; }
.l-hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.l-blob {
  position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(70px);
  opacity: 0.35; animation: l-drift 22s ease-in-out infinite alternate;
}
.l-blob-1 { top: -180px; left: -120px; background: var(--accent); }
.l-blob-2 { top: -80px; right: -160px; background: oklch(70% 0.15 25); animation-delay: -8s; animation-duration: 26s; }
@keyframes l-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.15); }
}
.l-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(color-mix(in oklab, var(--text) 18%, transparent) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 20%, black 40%, transparent 100%);
}
.l-hero-content { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.l-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--accent-text);
  background: var(--accent-soft); border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 20px; letter-spacing: 0.02em;
}
/* Terminal/HUD-style corner brackets — a small recurring motif to give the
   otherwise plain pill labels a more "instrument panel" feel. */
.l-eyebrow::before { content: '['; opacity: 0.6; }
.l-eyebrow::after { content: ']'; opacity: 0.6; }
.l-h1 {
  font-size: 52px; line-height: 1.08; font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.l-accent-text {
  background: linear-gradient(100deg, var(--accent) 20%, oklch(70% 0.18 200) 50%, var(--accent) 80%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: l-gradient-sweep 6s ease-in-out infinite;
}
@keyframes l-gradient-sweep {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.l-sub { font-size: 17px; line-height: 1.6; color: var(--text-dim); max-width: 560px; margin: 0 auto 32px; }
.l-hero-actions { display: flex; justify-content: center; gap: 12px; margin-bottom: 56px; flex-wrap: wrap; }
.l-btn-lg { padding: 13px 24px; font-size: 14.5px; border-radius: 10px; transition: box-shadow .2s, transform .15s, background-color .12s, border-color .12s; }
.l-btn-lg.btn-primary {
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 40%, transparent), 0 8px 24px color-mix(in oklab, var(--accent) 35%, transparent);
}
.l-btn-lg.btn-primary:hover {
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 55%, transparent), 0 0 32px color-mix(in oklab, var(--accent) 55%, transparent);
  transform: translateY(-1px);
}

.l-stats { display: flex; justify-content: center; gap: 56px; flex-wrap: wrap; }
.l-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.l-stat-num { font-size: 30px; font-weight: 800; color: var(--text); font-family: var(--font-mono); }
.l-stat-text { color: var(--accent); }
.l-stat-label { font-size: 12.5px; color: var(--text-faint); font-weight: 600; }

/* ---------- Shared section chrome ---------- */
.l-section { max-width: 1080px; margin: 0 auto; padding: 90px 24px; }
.l-section-head { text-align: center; max-width: 560px; margin: 0 auto 44px; }
.l-section-head h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 14px; position: relative; }
.l-section-head h2::after {
  content: ''; display: block; width: 56px; height: 3px; margin: 14px auto 0; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.l-section-head p { font-size: 15px; color: var(--text-dim); margin: 0; }

.l-reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.l-reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Live demo ---------- */
.l-demo-frame {
  display: flex; height: 440px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), 0 0 40px color-mix(in oklab, var(--accent) 12%, transparent);
}
.l-demo-editor {
  width: 380px; flex-shrink: 0; background: var(--code-bg); display: flex; flex-direction: column;
}
.l-demo-dots { display: flex; gap: 6px; padding: 14px 16px; }
.l-demo-dots span { width: 10px; height: 10px; border-radius: 50%; background: color-mix(in oklab, var(--code-text) 25%, transparent); }
.l-demo-code {
  flex: 1; margin: 0; padding: 4px 18px 18px; overflow: hidden;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--code-text);
  white-space: pre-wrap; word-break: break-word;
}
.l-demo-canvas { flex: 1; position: relative; background: var(--bg); }
.l-demo-canvas .diagram-svg { pointer-events: none; }

/* ---------- Feature grid ---------- */
/* This section carries the app's whole feature list, so it gets its own
   framed "panel" treatment (background/border/shadow) rather than sitting
   flush with the page like the other sections — the goal is for it to read
   as the one-stop reference, not just another scroll stop. */
.l-features-section {
  position: relative; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 28px;
  padding: 64px 40px; box-shadow: var(--shadow-lg);
}
/* The same dot-grid motif as the hero, faded in behind the panel — ties the
   two visually loudest sections of the page together instead of the hero
   being the only section with any texture. */
.l-features-section::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(color-mix(in oklab, var(--text) 14%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 30%, transparent 100%);
}
.l-features-section > * { position: relative; z-index: 1; }
.l-feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.l-feature-group-label {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-faint); margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border);
}
.l-feature-group-label::before { content: '//'; color: var(--accent); opacity: 0.7; }
.l-feature-group-label:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.l-feature-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.l-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in oklab, var(--accent) 35%, transparent);
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border-strong));
}
.l-feature-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-text); margin-bottom: 14px;
}
/* Fixed hex per category (not theme tokens) — the tint and the glyph share
   one hue, so contrast between them holds regardless of light/dark mode. */
.l-feature-icon.cat-export { background: color-mix(in oklab, #06b6d4 16%, transparent); color: #06b6d4; }
.l-feature-icon.cat-collab { background: color-mix(in oklab, #a855f7 16%, transparent); color: #a855f7; }
.l-feature-icon.cat-account { background: color-mix(in oklab, #22c55e 16%, transparent); color: #22c55e; }
.l-feature-icon.cat-workflow { background: color-mix(in oklab, #eab308 20%, transparent); color: #a16207; }
.l-feature-card h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.l-feature-card p { font-size: 13px; line-height: 1.55; color: var(--text-dim); margin: 0; }
.l-feature-card code { font-family: var(--font-mono); font-size: 12px; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- MCP spotlight ---------- */
.l-mcp-frame {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch;
}
.l-mcp-tools { display: flex; flex-direction: column; gap: 2px; }
.l-mcp-tool {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 4px; border-bottom: 1px solid var(--border);
}
.l-mcp-tool code {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--accent-text);
}
.l-mcp-tool span { font-size: 12.5px; color: var(--text-dim); }
.l-mcp-code {
  background: var(--code-bg); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 40px color-mix(in oklab, var(--accent) 12%, transparent);
}
.l-mcp-code pre {
  margin: 0; padding: 0 20px 16px; font-family: var(--font-mono); font-size: 12px; line-height: 1.6;
  color: var(--code-text); overflow-x: auto; flex: 1;
}
.l-mcp-caption { margin: 0; padding: 12px 20px 18px; font-size: 12px; color: color-mix(in oklab, var(--code-text) 70%, transparent); border-top: 1px solid color-mix(in oklab, var(--code-text) 12%, transparent); }

/* ---------- Steps ---------- */
.l-steps { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.l-steps-line {
  position: absolute; top: 20px; left: 16.6667%; width: 66.6666%; height: 2px;
  overflow: visible; z-index: 0;
}
.l-steps-line line {
  stroke: var(--border-strong); stroke-width: 2;
  stroke-dasharray: 600; stroke-dashoffset: 600;
  transition: stroke-dashoffset 1.1s ease .25s;
}
.l-reveal.is-visible .l-steps-line line { stroke-dashoffset: 0; }

.l-step { position: relative; z-index: 1; text-align: center; }
.l-step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-family: var(--font-mono);
  margin: 0 auto 16px; transform: scale(0);
  transition: transform .55s cubic-bezier(.34, 1.56, .64, 1);
}
.l-reveal.is-visible .l-step-num { transform: scale(1); }
.l-reveal.is-visible .l-step-2 .l-step-num { transition-delay: .15s; }
.l-reveal.is-visible .l-step-3 .l-step-num { transition-delay: .3s; }

.l-step h3, .l-step p {
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
}
.l-reveal.is-visible .l-step h3, .l-reveal.is-visible .l-step p { opacity: 1; transform: none; }
.l-reveal.is-visible .l-step-1 h3, .l-reveal.is-visible .l-step-1 p { transition-delay: .15s; }
.l-reveal.is-visible .l-step-2 h3, .l-reveal.is-visible .l-step-2 p { transition-delay: .3s; }
.l-reveal.is-visible .l-step-3 h3, .l-reveal.is-visible .l-step-3 p { transition-delay: .45s; }

.l-step h3 { font-size: 15.5px; font-weight: 700; margin: 0 0 6px; }
.l-step p { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; margin: 0; }

/* ---------- FAQ ---------- */
.l-faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.l-faq-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 4px 20px; transition: border-color .15s, box-shadow .15s;
}
.l-faq-item[open] { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.l-faq-item summary {
  list-style: none; cursor: pointer; padding: 16px 28px 16px 0; position: relative;
  font-size: 14.5px; font-weight: 700; line-height: 1.5;
}
.l-faq-item summary::-webkit-details-marker { display: none; }
.l-faq-item summary::after {
  content: ''; position: absolute; right: 2px; top: 50%; width: 10px; height: 10px;
  transform: translateY(-50%) rotate(45deg);
  border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim);
  transition: transform .2s ease;
}
.l-faq-item[open] summary::after { transform: translateY(-20%) rotate(225deg); }
.l-faq-item p {
  margin: 0; padding: 0 0 18px; font-size: 13.5px; line-height: 1.65; color: var(--text-dim);
  animation: l-faq-open .2s ease;
}
.l-faq-item code { font-family: var(--font-mono); font-size: 12px; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
@keyframes l-faq-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .l-faq-item p { animation: none; }
  .l-accent-text { animation: none; background-position: 0% 50%; }
}

/* ---------- Final CTA ---------- */
.l-cta {
  text-align: center; padding: 80px 24px; margin: 40px 0 0;
  background: var(--panel-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.l-cta h2 { font-size: 28px; font-weight: 800; margin: 0 0 26px; letter-spacing: -0.01em; }

/* ---------- Footer ---------- */
.l-footer { text-align: center; padding: 40px 24px 56px; color: var(--text-faint); }
.l-footer .brand-mark { justify-content: center; color: var(--accent); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.l-footer p { font-size: 13px; margin: 0; }

@media (max-width: 860px) {
  .l-nav-links { display: none; }
  .l-h1 { font-size: 38px; }
  .l-demo-frame { flex-direction: column; height: auto; }
  .l-demo-editor { width: auto; }
  .l-demo-code { max-height: 160px; }
  .l-demo-canvas { height: 320px; }
  .l-steps { grid-template-columns: 1fr; }
  .l-steps-line { display: none; }
  .l-mcp-frame { grid-template-columns: 1fr; }
  .l-features-section { padding: 40px 20px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .l-blob { animation: none; }
  .l-reveal { transition: none; opacity: 1; transform: none; }
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 48px; height: 48px; padding: 0; border: none; border-radius: 50%;
  background: var(--panel); color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.back-to-top.visible { opacity: 1; transform: none; pointer-events: auto; }
.btt-ring { position: absolute; inset: 0; width: 48px; height: 48px; transform: rotate(-90deg); }
.btt-ring-bg { fill: none; stroke: var(--border); stroke-width: 3; }
.btt-ring-progress {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
}
.btt-arrow { position: relative; z-index: 1; }
