/* ════════════════════════════════════════
   LODCER PORTAL — main.css
   Sections: base · ambient · progress · header
             · type · buttons · hero · ticker
             · products(bento) · scenarios(split)
             · capabilities(zigzag) · cta · footer
             · palette · responsive
   ════════════════════════════════════════ */

/* ── Reset & base ──────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  background-color: var(--bg-deep);
  background:
    radial-gradient(circle at 15% 20%, var(--mesh-1), transparent 40rem),
    radial-gradient(circle at 85% 15%, var(--mesh-2), transparent 42rem),
    radial-gradient(circle at 50% 65%, var(--mesh-3), transparent 38rem),
    radial-gradient(circle at 20% 85%, var(--mesh-2), transparent 36rem),
    linear-gradient(160deg, var(--bg), var(--bg-deep) 70%);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
  transition: background-color var(--duration-slow) ease, color var(--duration-slow) ease;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
::selection { background: var(--brand); color: #fff; }
header, main, footer { position: relative; z-index: 2; }

/* ── Ambient background system (layered) ── */
.page-shell {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
  perspective: 1200px;
  --react-x: 50%;
  --react-y: 34%;
}
.page-shell::before,
.page-shell::after {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
  opacity: .42;
  will-change: transform, opacity;
}
.page-shell::before {
  background:
    linear-gradient(115deg, transparent 0 28%, rgba(var(--brand-rgb), .08) 31%, transparent 36% 62%, rgba(99, 102, 241, .07) 66%, transparent 72%),
    radial-gradient(circle at 72% 18%, rgba(56,189,248,.12), transparent 22rem);
  filter: blur(14px);
  animation: depth-drift 34s ease-in-out infinite;
}
.page-shell::after {
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 132px 132px;
  transform: rotateX(62deg) translateY(26vh) scale(1.45);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to bottom, transparent, black 28%, transparent 82%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 28%, transparent 82%);
  opacity: .18;
  animation: floor-grid-drift 18s linear infinite;
}
.page-shell.is-reacting::before { opacity: .74; filter: blur(8px) saturate(1.35); }
.page-shell.is-reacting::after { opacity: .34; }

/* Mesh layer: animated shifting radial gradient blobs */
.mesh-layer {
  position: absolute; inset: -10%;
  background:
    radial-gradient(circle at var(--react-x) var(--react-y), rgba(var(--brand-rgb), .22), transparent 17rem),
    radial-gradient(circle at 30% 30%, var(--ambient-tint), transparent 28rem),
    radial-gradient(circle at 70% 40%, var(--mesh-2), transparent 30rem),
    radial-gradient(circle at 50% 75%, var(--mesh-1), transparent 26rem);
  filter: blur(40px);
  opacity: 1;
  animation: mesh-shift 28s ease-in-out infinite;
  will-change: transform, opacity, filter;
  transition: opacity 260ms ease, filter 260ms ease;
}
.page-shell.is-reacting .mesh-layer { filter: blur(28px) saturate(1.45); opacity: 1; }

/* Aurora ribbons: flowing diagonal gradient bands */
.aurora-band {
  position: absolute;
  width: 160vw; height: 40vh;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
  will-change: transform, opacity;
}
.aurora-1 {
  top: -10%; left: -30%;
  background: linear-gradient(100deg, transparent, var(--aurora-1), transparent);
  transform: rotate(-12deg);
  animation: aurora-flow-1 24s ease-in-out infinite;
}
.aurora-2 {
  top: 30%; left: -20%;
  background: linear-gradient(100deg, transparent, var(--aurora-2), transparent);
  transform: rotate(8deg);
  animation: aurora-flow-2 32s ease-in-out infinite;
}
.aurora-3 {
  top: 60%; left: -25%;
  background: linear-gradient(100deg, transparent, var(--aurora-3), transparent);
  transform: rotate(-6deg);
  animation: aurora-flow-3 38s ease-in-out infinite;
}

/* Ambient orbs (parallax on scroll) */
.ambient { position: absolute; border-radius: 999px; filter: blur(70px); opacity: .45; transform: translate3d(0,0,0); transition: transform .4s ease-out; will-change: transform; }
.ambient-a { width: 42vw; height: 42vw; left: -12vw; top: 8vh; background: var(--ambient-tint); }
.ambient-b { width: 34vw; height: 34vw; right: -10vw; top: 0vh; background: var(--mesh-2); }
.ambient-c { width: 28vw; height: 28vw; left: 38%; top: 78vh; background: var(--mesh-1); opacity: .3; }

/* Breathing dot grid */
.grid-noise {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(90deg, rgba(var(--brand-rgb), .12) 1px, transparent 1px),
    linear-gradient(rgba(99,102,241,.10) 1px, transparent 1px),
    radial-gradient(var(--grid-dot) 1.3px, transparent 2px);
  background-size: 96px 96px, 96px 96px, 32px 32px;
  background-position: 0 0;
  mask-image: radial-gradient(circle at 50% 24%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 24%, black, transparent 80%);
  animation: grid-breathe 8s ease-in-out infinite;
  will-change: opacity, transform;
  mix-blend-mode: screen;
  opacity: .8;
}
.page-shell.is-reacting .grid-noise { opacity: 1; transform: scale(1.012); }

/* Particle constellation canvas */
.bg-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: .9;
  filter: saturate(1.08);
}

/* Mouse-follow spotlight */
.spotlight {
  position: absolute;
  width: 680px; height: 680px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(var(--brand-rgb), .12), transparent 32%),
    radial-gradient(circle, var(--spotlight), transparent 68%);
  filter: blur(30px);
  transform: translate(-50%, -50%);
  left: 50%; top: 30%;
  opacity: 0;
  transition: opacity 600ms ease;
  will-change: transform;
}
.spotlight.is-active { opacity: 1; }

.bg-orbit {
  position: absolute;
  border: 1px solid rgba(var(--brand-rgb), .22);
  border-radius: 50%;
  pointer-events: none;
  opacity: .46;
  mix-blend-mode: screen;
  transform-origin: center;
}
.bg-orbit::before,
.bg-orbit::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 20px rgba(var(--brand-rgb), .8);
}
.bg-orbit::before { left: 18%; top: 8%; }
.bg-orbit::after { right: 12%; bottom: 18%; background: var(--accent-2); box-shadow: 0 0 20px rgba(99,102,241,.75); }
.bg-orbit-a {
  width: min(44vw, 520px);
  height: min(44vw, 520px);
  left: -7vw;
  top: 16vh;
  animation: orbit-spin 30s linear infinite;
}
.bg-orbit-b {
  width: min(38vw, 460px);
  height: min(38vw, 460px);
  right: -8vw;
  bottom: 8vh;
  border-color: rgba(56,189,248,.22);
  animation: orbit-spin-rev 36s linear infinite;
}
.bg-scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0 42%, rgba(var(--brand-rgb), .18) 48%, rgba(56,189,248,.12) 50%, transparent 58%);
  opacity: .34;
  transform: translateY(-80%);
  animation: bg-scan 8s ease-in-out infinite;
  mix-blend-mode: screen;
}
.bg-widget {
  position: absolute;
  display: grid;
  gap: 8px;
  min-width: 126px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  background: rgba(10, 12, 16, .38);
  box-shadow: 0 18px 60px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  color: rgba(255,255,255,.72);
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
  opacity: .64;
  transform: translate3d(0,0,0);
  animation: widget-float 9s ease-in-out infinite;
}
html[data-theme="light"] .bg-widget {
  background: rgba(255,255,255,.46);
  color: rgba(17,19,24,.64);
  border-color: rgba(17,19,24,.12);
}
.bg-widget span { white-space: nowrap; }
.bg-widget b {
  color: var(--brand);
  font-size: 18px;
  letter-spacing: 0;
}
.bg-widget i {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), transparent);
  opacity: .72;
}
.bg-widget i:nth-child(3) { width: 72%; background: linear-gradient(90deg, var(--accent-2), transparent); }
.bg-widget i:nth-child(4) { width: 46%; background: linear-gradient(90deg, var(--accent-3), transparent); }
.bg-widget-a { left: 7vw; top: 58vh; }
.bg-widget-b { right: 8vw; top: 22vh; animation-delay: -2.4s; }
.bg-widget-c { left: 44vw; bottom: 10vh; animation-delay: -5s; }
.page-shell.is-reacting .bg-widget,
.page-shell.is-reacting .bg-orbit { opacity: .9; }

/* Vignette for depth */
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(0,0,0,.18) 100%);
  pointer-events: none;
}
html[data-theme="light"] .vignette {
  background: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(120,100,70,.10) 100%);
}

/* ── Scroll progress bar ───────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  width: 0%; height: 3px;
  background: var(--gradient-brand);
  z-index: 100;
  box-shadow: 0 0 12px var(--brand-glow);
  transition: width 80ms linear;
}

/* ── Header ────────────────────────────── */
.site-header {
  position: sticky; top: 16px; z-index: 20;
  width: min(1160px, calc(100% - 32px));
  margin: 16px auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  box-shadow: var(--shadow-soft);
}
.brand-mark { display: flex; align-items: center; gap: 10px; min-width: max-content; }
.brand-symbol {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 12px; color: var(--invert); background: var(--gradient-brand);
  font-weight: 800; letter-spacing: -.06em;
  transition: transform var(--duration-med) var(--spring);
  box-shadow: 0 6px 18px var(--brand-glow);
}
.brand-mark:hover .brand-symbol { transform: rotate(-7deg) scale(1.06); }
.brand-word { font-weight: 760; letter-spacing: -.04em; }
.site-nav { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--accent-soft); }
.site-nav a { padding: 8px 13px; border-radius: 999px; color: var(--text-soft); font-size: 14px; transition: background var(--duration-med), color var(--duration-med), transform var(--duration-med) var(--spring); }
.site-nav a:hover { background: var(--bg-card-strong); color: var(--text); transform: translateY(-1px); }
.theme-toggle {
  border: 0; background: transparent; color: var(--text); cursor: pointer;
  display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px;
}
.toggle-track { width: 54px; height: 32px; border-radius: 999px; padding: 3px; display: flex; align-items: center; background: var(--bg-card-strong); border: 1px solid var(--line); }
.toggle-thumb { width: 24px; height: 24px; border-radius: 999px; background: var(--accent); transform: translateX(0); transition: transform 520ms var(--spring), background var(--duration-slow); box-shadow: 0 6px 20px rgba(0,0,0,.24); }
html[data-theme="light"] .toggle-thumb { transform: translateX(22px); }
.toggle-text { color: var(--text-muted); font-size: 13px; }

.palette-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--accent-soft); color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background var(--duration-med), color var(--duration-med), transform var(--duration-med) var(--spring);
}
.palette-btn:hover { background: var(--bg-card-strong); color: var(--text); transform: translateY(-1px); }
.palette-btn span { pointer-events: none; }

.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--accent-soft); cursor: pointer;
  transition: background var(--duration-med);
}
.nav-toggle:hover { background: var(--bg-card-strong); }
.nav-toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 1px;
  transition: transform 260ms ease, opacity 260ms ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Typography ────────────────────────── */
.eyebrow { margin: 0 0 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 760; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: clamp(44px, 7.2vw, 96px); line-height: .92; letter-spacing: -.075em; margin-bottom: 28px; max-width: 850px;
  background: var(--gradient-brand);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradient-shift 6s ease infinite;
}
h2 { font-size: clamp(30px, 4.2vw, 56px); line-height: 1.02; letter-spacing: -.055em; margin-bottom: 16px; }
h3 { font-size: 20px; letter-spacing: -.03em; margin-bottom: 10px; }

/* ── Buttons ───────────────────────────── */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid var(--line-strong);
  cursor: pointer; transition: transform var(--duration-med) var(--spring), background var(--duration-med), border-color var(--duration-med), color var(--duration-med), box-shadow var(--duration-med);
  will-change: transform; font-size: 15px; font-weight: 600;
}
.button.primary { color: #fff; background: var(--gradient-brand); border-color: transparent; box-shadow: 0 14px 36px var(--brand-glow); }
.button.secondary { background: var(--bg-card); color: var(--text); backdrop-filter: blur(16px); }
.button:hover { transform: translateY(-2px); }
.button.primary:hover { box-shadow: 0 18px 44px var(--brand-glow); }

/* ── Section wrappers ───────────────────── */
.section {
  padding-top: 96px; padding-bottom: 96px; width: min(1160px, calc(100% - 32px)); margin: 0 auto;
  position: relative;
}
.section::before {
  content: "";
  position: absolute;
  inset: 42px -42px auto;
  height: 190px;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 0%, var(--brand-soft), transparent 22rem),
    linear-gradient(90deg, transparent, var(--line), transparent);
  opacity: .42;
  mask-image: linear-gradient(to bottom, black, transparent);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
}
.section > * { position: relative; z-index: 1; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head p { color: var(--text-soft); line-height: 1.9; font-size: 17px; }
.section-divider {
  width: 100%; height: 1px; max-width: 1160px; margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--brand-line), transparent);
  position: relative; transform: scaleX(0); transform-origin: center;
  transition: transform 900ms var(--spring);
}
html.js .section-divider[data-reveal] { opacity: 1; }
.section-divider.is-visible { transform: scaleX(1); }
.section-divider::after {
  content: ""; position: absolute; left: 50%; top: -2px;
  width: 80px; height: 5px; transform: translateX(-50%) scaleX(0);
  background: radial-gradient(ellipse 50% 100%, var(--brand-glow), transparent 70%);
  opacity: 0; transition: opacity 700ms ease 200ms, transform 700ms var(--spring) 200ms;
}
.section-divider.is-visible::after { opacity: 1; transform: translateX(-50%) scaleX(1); }

/* ════════════════════════════════════════
   HERO
   ════════════════════════════════════════ */
.hero {
  min-height: 86vh;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  align-items: center;
  gap: 56px;
  padding: 100px 0 72px;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}
.hero-copy { max-width: 580px; }
.hero-lead { color: var(--text-soft); line-height: 1.9; font-size: 18px; max-width: 540px; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; margin-bottom: 24px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-card); backdrop-filter: blur(12px);
  font-size: 13px; color: var(--text-soft);
}
.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-3);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ── Hero GUI App Window (de-cramped, floating agent) ─── */
.hero-app {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(18,20,27,.94), rgba(11,13,17,.97));
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  box-shadow: var(--shadow-soft), 0 0 60px var(--brand-soft);
  overflow: hidden;
  min-height: 520px;
  display: flex; flex-direction: column;
  transform: translateZ(0);
}
html[data-theme="light"] .hero-app {
  background: linear-gradient(160deg, rgba(255,255,255,.94), rgba(247,244,238,.92));
}
.hero-app::before {
  content: ""; position: absolute; inset: -50%;
  background: radial-gradient(circle at var(--spot-x,50%) var(--spot-y,50%), var(--brand-soft), transparent 30%);
  opacity: .6; pointer-events: none; transition: opacity var(--duration-med);
}

/* slow aurora breathing background */
.app-aurora {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(40% 50% at 80% 20%, rgba(var(--brand-rgb,252,110,8),.10), transparent 70%),
    radial-gradient(45% 55% at 15% 85%, rgba(56,189,248,.08), transparent 70%);
  background-size: 200% 200%; opacity: .8;
  animation: aurora-breathe 14s ease-in-out infinite;
}
@keyframes aurora-breathe {
  0%, 100% { background-position: 0% 0%, 100% 100%; }
  50% { background-position: 100% 100%, 0% 0%; }
}

/* sheen sweep */
.app-sheen {
  position: absolute; inset: 0; pointer-events: none; z-index: 6;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.09) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: app-sheen-sweep 6s var(--spring) infinite;
}
@keyframes app-sheen-sweep {
  0%, 70% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

/* topbar */
.app-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 5;
  background: var(--bg-card-strong);
}
.app-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.app-dot.r { background: #ff5f57; }
.app-dot.y { background: #febc2e; }
.app-dot.g { background: #28c840; }
.app-path {
  margin-left: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--text-muted);
}
.app-path i { opacity: .5; margin: 0 4px; font-style: normal; }
.app-path.is-reading { color: var(--brand); }
.app-path.is-reading::after {
  content: ""; display: inline-block; width: 28px; height: 2px; margin-left: 8px;
  vertical-align: middle; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  animation: path-scan 1.4s ease-in-out infinite;
}
@keyframes path-scan {
  0% { transform: translateX(-12px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateX(12px); opacity: 0; }
}
.app-status {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  border: 1px solid var(--brand-line);
  transition: background var(--duration-med), color var(--duration-med);
}
.app-status.is-working { background: rgba(56,189,248,.12); color: #38bdf8; border-color: rgba(56,189,248,.3); }
.app-status.is-done { background: rgba(34,197,94,.12); color: var(--accent-3); border-color: rgba(34,197,94,.3); }
.app-status-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: pulse-dot 2s ease-in-out infinite;
}

/* topbar tabs (multi-file) */
.app-tabs { display: flex; gap: 2px; margin-left: 12px; }
.app-tab {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; color: var(--text-muted);
  padding: 4px 12px; border-radius: 7px 7px 0 0;
  border: 1px solid transparent; border-bottom: none;
  transition: all var(--duration-fast); cursor: default;
  opacity: .6;
}
.app-tab.is-active {
  color: var(--text); background: var(--bg-card);
  border-color: var(--line); opacity: 1; position: relative;
}
.app-tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--bg-card);
}

/* body: gutter + full-width editor */
.app-workspace { flex: 1; display: flex; min-height: 0; position: relative; z-index: 1; }

/* left icon rail */
.app-rail {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  padding: 16px 0; width: 44px; flex-shrink: 0;
  border-right: 1px solid var(--line); background: var(--bg-card-strong);
}
.rail-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: inline-grid; place-items: center;
  font-size: 14px; color: var(--text-muted); opacity: .5;
  cursor: default; transition: all var(--duration-fast);
}
.rail-icon.is-active { opacity: 1; color: var(--brand); background: var(--brand-soft); }

.app-editor {
  position: relative; display: flex; flex: 1; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px; line-height: 2.2; overflow: hidden;
}
.app-gutter {
  display: flex; flex-direction: column; padding: 22px 8px 22px 16px;
  color: var(--text-muted); opacity: .45; text-align: right; user-select: none;
  border-right: 1px solid var(--line); min-width: 50px;
}
.gutter-row { display: flex; align-items: center; justify-content: flex-end; gap: 4px; height: 2.2em; }
.gutter-num { font-size: 12px; }
.gutter-mark { width: 3px; height: 14px; border-radius: 2px; background: transparent; transition: background var(--duration-med); }
.gutter-row.is-added .gutter-mark { background: var(--accent-3); }
.gutter-row.is-removed .gutter-mark { background: #ef4444; }
.app-code { padding: 22px 22px; flex: 1; min-width: 0; color: var(--text-soft); position: relative; }
.code-line { white-space: pre; transition: all var(--duration-med); }
.code-line .kw { color: #c792ea; }
.code-line .str { color: #c3e88d; }
.code-line .fn { color: #82aaff; }
.code-line .num { color: #f78c6c; }
.code-line .cmt { color: var(--text-muted); opacity: .6; font-style: italic; }
.code-line.diff-line--old { position: relative; }
.code-line.diff-line--old.is-morphing { animation: morph-out 700ms var(--spring) forwards; }
.code-line.diff-line--new.is-hidden { opacity: 0; height: 0; overflow: hidden; }
.code-line.diff-line--new.is-typing { opacity: 1; height: auto; }
.code-line.diff-line--new.is-applied { background: rgba(34,197,94,.12); box-shadow: inset 3px 0 0 var(--accent-3); }
@keyframes morph-out {
  0% { opacity: 1; filter: blur(0); transform: translateY(0); }
  60% { opacity: .3; filter: blur(4px); transform: translateY(-5px); }
  100% { opacity: 0; filter: blur(8px); transform: translateY(-10px); }
}

/* minimap (right strip) */
.app-minimap {
  width: 38px; flex-shrink: 0; padding: 22px 6px; position: relative;
  border-left: 1px solid var(--line); background: var(--bg-card);
  display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.minimap-line { height: 2px; border-radius: 1px; background: var(--text-muted); opacity: .12; }
.minimap-line.short { width: 60%; }
.minimap-viewport {
  position: absolute; left: 4px; right: 4px; height: 40px; top: 22px;
  background: rgba(var(--brand-rgb,252,110,8),.10); border: 1px solid var(--brand-line);
  border-radius: 3px; transition: top 400ms var(--spring);
}

/* active line highlight bar (relative to old line) */
.app-active-line {
  position: absolute; left: 0; right: 0; height: 0;
  background: rgba(var(--brand-rgb,252,110,8),.10);
  pointer-events: none; opacity: 0;
  transition: opacity 400ms var(--spring), top 300ms var(--spring);
  border-left: 2px solid var(--brand);
}
.app-active-line.is-visible { opacity: 1; }

/* editor caret (blinking) */
.app-caret {
  position: absolute; width: 2px; height: 18px; background: var(--brand);
  pointer-events: none; opacity: 0; border-radius: 1px;
  transition: opacity 200ms ease, left 120ms var(--spring), top 300ms var(--spring);
}
.app-caret.is-visible { opacity: 1; animation: cursor-blink 1s step-end infinite; }

/* squiggle (relative to old line, positioned by JS) */
.app-squiggle {
  position: absolute; left: 26px; right: 26px; height: 2px;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--color-error) 0 4px, transparent 4px 8px);
  opacity: 0; transition: opacity var(--duration-med), top 300ms var(--spring);
}
.app-squiggle.is-visible { opacity: 1; animation: squiggle-draw 500ms var(--spring); }
.app-squiggle.is-erasing { animation: squiggle-erase 600ms var(--spring) forwards; }
@keyframes squiggle-draw {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes squiggle-erase {
  0% { opacity: 1; }
  100% { opacity: 0; filter: blur(3px); transform: translateY(-4px); }
}

/* ── floating glass agent card ── */
.app-agent {
  position: absolute; top: 14px; right: 14px; z-index: 4;
  width: 226px; max-width: calc(100% - 28px);
  padding: 12px; border-radius: 14px;
  background: rgba(18,20,27,.74); backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--glass,rgba(255,255,255,.14));
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12px;
  opacity: 0; transform: translateY(-8px) scale(.97);
  transition: opacity 400ms var(--spring), transform 400ms var(--spring);
  pointer-events: none;
}
html[data-theme="light"] .app-agent { background: rgba(255,255,255,.82); border-color: rgba(17,19,24,.1); }
.app-agent.is-visible { opacity: 1; transform: translateY(0) scale(1); }

/* agent plan checklist */
.agent-plan { display: flex; flex-direction: column; gap: 5px; padding: 4px 2px; }
.plan-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-muted);
  opacity: 0; transform: translateX(-6px);
  transition: opacity 300ms var(--spring), transform 300ms var(--spring);
}
.plan-item.is-shown { opacity: 1; transform: translateX(0); }
.plan-check {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--text-muted); flex-shrink: 0;
  display: inline-grid; place-items: center;
  transition: all 300ms var(--spring);
}
.plan-check::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: transparent; transition: background 200ms; }
.plan-item.is-done .plan-check { border-color: var(--accent-3); background: rgba(34,197,94,.15); }
.plan-item.is-done .plan-check::after { background: var(--accent-3); }
.plan-item.is-done .plan-text { color: var(--text-soft); }
.plan-text { transition: color 300ms; }

.agent-bubble {
  align-self: flex-end; max-width: 100%;
  padding: 8px 12px; border-radius: 12px 12px 4px 12px;
  background: var(--brand); color: #fff;
  font-size: 12px; line-height: 1.5; min-height: 18px;
  opacity: 0; transform: translateY(6px);
  transition: opacity 300ms var(--spring), transform 300ms var(--spring);
  word-break: break-all;
}
.agent-bubble.is-visible { opacity: 1; transform: translateY(0); }
.agent-text { display: inline; }
.agent-cursor {
  display: inline-block; width: 6px; height: 12px; background: #fff;
  vertical-align: text-bottom; margin-left: 1px; border-radius: 1px;
  animation: cursor-blink 1s step-end infinite;
}
.agent-cursor.is-hidden { opacity: 0; animation: none; }
.agent-tools { display: flex; flex-direction: column; gap: 6px; }
.agent-tool {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 9px; border-radius: 8px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; color: var(--text-muted);
  opacity: 0; transform: translateX(-8px);
  animation: tool-in 400ms var(--spring) forwards;
  transition: opacity 300ms ease, border-color 300ms ease;
}
html[data-theme="light"] .agent-tool { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.08); }
@keyframes tool-in { to { opacity: 1; transform: translateX(0); } }
.agent-tool-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 4px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.agent-tool-name { color: var(--text); font-weight: 600; }
.agent-tool-status {
  margin-left: auto; width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--text-muted); border-top-color: transparent;
  animation: tool-spin 0.8s linear infinite;
}
.agent-tool.is-done .agent-tool-status {
  border: none; background: var(--accent-3); animation: none;
}
@keyframes tool-spin { to { transform: rotate(360deg); } }
.agent-typing {
  display: flex; gap: 3px; align-self: flex-start; padding: 8px 10px;
  opacity: 1; transition: opacity 300ms ease;
}
.agent-typing.is-hidden { opacity: 0; }
.agent-typing i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.agent-typing i:nth-child(2) { animation-delay: .15s; }
.agent-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* diff chip (inside floating agent) */
.app-diff-chip {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
  padding: 5px 11px; border-radius: 999px;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  color: var(--brand); font-size: 11px; font-weight: 700;
  opacity: 0; transform: translateY(-6px) scale(.9);
  transition: opacity 400ms var(--spring), transform 400ms var(--spring);
}
.app-diff-chip.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.app-diff-chip.is-hidden { opacity: 0; transform: translateY(-6px) scale(.9); }
.diff-chip-mark { font-family: ui-monospace, monospace; }

/* status bar */
.app-statusbar {
  display: flex; align-items: center; gap: 18px;
  padding: 8px 18px; border-top: 1px solid var(--line);
  background: var(--bg-card-strong);
  font-size: 11px; color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  position: relative; z-index: 5;
}
.sb-branch { color: var(--brand); }
.sb-test { display: inline-flex; align-items: center; gap: 4px; }
.sb-test-count { color: var(--accent-3); font-weight: 700; transition: color var(--duration-fast), transform 200ms var(--spring); }
.sb-test-count.is-pop { transform: scale(1.3); }
.sb-spark {
  margin-left: auto; width: 80px; height: 5px; border-radius: 3px;
  background: var(--line); overflow: hidden; position: relative;
}
.sb-spark-fill {
  display: block; height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent-3));
  transition: width 280ms var(--spring);
}
.app-statusbar.is-done { animation: status-pulse 600ms ease; }
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: inset 0 1px 0 rgba(34,197,94,.3), 0 0 24px rgba(34,197,94,.15); }
}

/* status bar extras */
.sb-problems { color: #fbbf24; transition: color var(--duration-med); }
.sb-problems.is-clear { color: var(--accent-3); }
.sb-problems.is-clear::before { content: "✓ "; }
.sb-token { color: var(--text-muted); }

/* ── collapsible bottom panel (Problems/Terminal/Tests) ── */
.app-panel {
  border-top: 1px solid var(--line);
  background: var(--bg-card-strong);
  max-height: 0; overflow: hidden;
  transition: max-height 420ms var(--spring);
  position: relative; z-index: 5;
}
.app-panel.is-open { max-height: 132px; }
.panel-tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 14px 0; border-bottom: 1px solid var(--line);
}
.panel-tab {
  appearance: none; background: transparent; border: none;
  padding: 6px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; color: var(--text-muted); cursor: default;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all var(--duration-fast);
  display: inline-flex; align-items: center; gap: 5px;
}
.panel-tab.is-active { color: var(--text); border-bottom-color: var(--brand); }
.panel-tab-count {
  font-size: 10px; padding: 0 5px; border-radius: 8px;
  background: var(--bg-card); color: var(--text-muted);
}
.panel-tab.is-active .panel-tab-count { background: var(--brand-soft); color: var(--brand); }
.panel-tab-count.is-zero { display: none; }
.panel-spacer { flex: 1; }
.panel-clear { font-size: 14px; color: var(--text-muted); opacity: .5; padding: 0 8px; }
.panel-body { padding: 8px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.panel-pane { display: none; }
.panel-pane.is-active { display: block; animation: panelIn 300ms var(--spring); }
@keyframes panelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* problems list */
.problem-row {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-soft); line-height: 1.7;
  transition: opacity 300ms ease, text-decoration 300ms;
}
.problem-icon { color: #fbbf24; }
.problem-msg { flex: 1; }
.problem-loc { color: var(--text-muted); }
.problem-row.is-resolved { opacity: 0; text-decoration: line-through; transform: translateX(8px); }

/* terminal stream */
.term-line {
  color: var(--text-soft); line-height: 1.8; white-space: pre;
  animation: panelIn 250ms var(--spring);
}
.term-line .term-prompt { color: var(--brand); }
.term-line .term-ok { color: var(--accent-3); }
.term-line .term-dim { color: var(--text-muted); }

/* test list */
.test-row {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-soft); line-height: 1.8;
  animation: panelIn 250ms var(--spring);
}
.test-mark { color: var(--accent-3); font-weight: 700; }
.test-name { flex: 1; }
.test-time { color: var(--text-muted); }

/* success toast + self-drawing checkmark */
.app-toast {
  position: absolute; right: 18px; top: 64px; z-index: 7;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px 11px 13px; border-radius: 12px;
  background: var(--bg-card-strong); border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 0 32px rgba(34,197,94,.18);
  font-size: 13px; color: var(--text);
  opacity: 0; transform: translateY(-12px) scale(.94); pointer-events: none;
  transition: opacity 500ms var(--spring), transform 500ms var(--spring);
}
.app-toast.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.app-toast-check {
  display: inline-flex; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-3); align-items: center; justify-content: center;
}
.app-toast-check svg { width: 14px; height: 14px; fill: none; stroke: #051a0c; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.app-toast-check svg path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.app-toast.is-visible .app-toast-check svg path { animation: check-draw 500ms var(--spring) 100ms forwards; }
@keyframes check-draw { to { stroke-dashoffset: 0; } }

@media (max-width: 880px) {
  .hero-app { min-height: 440px; }
  .app-agent { width: 176px; }
  .app-code { font-size: 12px; padding: 18px 16px; }
  .app-minimap { display: none; }
  .app-rail { width: 38px; }
  .app-tabs { display: none; }
}
@media (max-width: 560px) {
  .app-agent { position: static; width: auto; margin: 0 12px 12px; }
  .app-workspace { flex-direction: column; }
  .app-rail { display: none; }
  .sb-token, .sb-problems { display: none; }
}

/* ════════════════════════════════════════
   TICKER (dual row)
   ════════════════════════════════════════ */
.ticker-wrap { width: 100%; overflow: hidden; padding: 18px 0; mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent); }
.ticker { display: flex; gap: 10px; width: max-content; padding: 8px; animation: ticker 24s linear infinite; }
.ticker.rev { animation-name: ticker-reverse; animation-duration: 34s; }
.ticker span { padding: 8px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--text-soft); white-space: nowrap; font-size: 14px; border: 1px solid var(--line); }
.ticker span.brand-tag { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.ticker span.indigo-tag { background: rgba(99,102,241,.12); color: var(--accent-2); border-color: rgba(99,102,241,.3); }

/* ════════════════════════════════════════
   PRODUCTS — Bento layout
   ════════════════════════════════════════ */
.product-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  min-height: 460px;
  position: relative;
  isolation: isolate;
}
.product-grid::before {
  content: "";
  position: absolute;
  inset: -22px;
  z-index: -1;
  border-radius: calc(var(--radius-lg) + 10px);
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb), .16), transparent 30%),
    radial-gradient(circle at 82% 28%, rgba(99,102,241,.18), transparent 20rem),
    repeating-linear-gradient(90deg, transparent 0 26px, rgba(255,255,255,.045) 27px 28px);
  opacity: .36;
  transform: skewY(-1deg);
}
.product-card {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--bg-card-strong), var(--bg-card));
  backdrop-filter: blur(20px) saturate(1.25);
  overflow: hidden;
  transform-style: preserve-3d;
  box-shadow: var(--shadow-card);
  transition: border-color var(--duration-med), box-shadow var(--duration-med);
}
.product-card::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(420px circle at var(--spot-x,50%) var(--spot-y,50%), rgba(var(--brand-rgb), .16), transparent 42%),
    linear-gradient(135deg, rgba(255,255,255,.10), transparent 34% 66%, rgba(99,102,241,.10));
  opacity: .72; pointer-events: none;
}
.product-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -44px;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: conic-gradient(from 120deg, transparent, var(--brand-line), rgba(99,102,241,.2), transparent 70%);
  opacity: .48;
  pointer-events: none;
  transition: transform var(--duration-slow) var(--spring), opacity var(--duration-med);
}
.product-card > * { position: relative; z-index: 1; }

.product-card--featured {
  grid-row: span 2;
  border-color: var(--brand-line);
  box-shadow: var(--shadow-card), 0 0 40px var(--brand-soft);
}
.product-card--featured .product-icon { box-shadow: 0 12px 34px var(--brand-glow), 0 0 0 8px rgba(var(--brand-rgb), .08); }
.product-card--featured::after {
  content: ""; position: absolute; inset: 0;
  width: auto; height: auto; right: 0; bottom: 0; border: 0; border-radius: 0;
  background:
    linear-gradient(160deg, var(--brand-soft), transparent 40%),
    repeating-linear-gradient(135deg, transparent 0 18px, rgba(255,255,255,.05) 19px 20px);
  opacity: .65; pointer-events: none;
}
.product-card--compact { padding: 22px; }

/* featured card code decoration */
.featured-code {
  margin: 20px 0;
  position: relative; height: 86px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: rgba(0,0,0,.25); opacity: .7;
}
html[data-theme="light"] .featured-code { background: rgba(0,0,0,.04); }
.featured-code-track {
  position: absolute; inset: 0; padding: 12px 16px;
  font-family: ui-monospace, monospace; font-size: 12px; line-height: 1.7;
  color: var(--text-muted);
  animation: code-flow 8s linear infinite;
}
.featured-code-track .kw { color: var(--brand); }
.featured-code-track .str { color: var(--accent-3); }

.product-icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 16px; background: var(--gradient-brand);
  color: #fff; font-weight: 800; font-size: 22px;
  margin-bottom: 20px; flex-shrink: 0;
  box-shadow: 0 8px 22px var(--brand-glow);
  transition: transform var(--duration-med) var(--spring), box-shadow var(--duration-med);
}
.product-card--compact .product-icon { width: 40px; height: 40px; font-size: 18px; margin-bottom: 14px; }
.product-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.product-status, .product-platform {
  color: var(--text-muted); font-size: 11px; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; background: var(--accent-soft);
}
.product-status.is-live { color: var(--accent-3); border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.08); }
.product-status.is-soon { color: #fbbf24; border-color: rgba(251,191,36,.25); }

.product-card h3 { font-size: clamp(22px, 2.6vw, 34px); line-height: 1; margin-bottom: 8px; }
.product-card--compact h3 { font-size: 20px; }
.product-card .product-tagline { color: var(--text-soft); font-size: 14px; margin-bottom: 12px; font-weight: 500; }
.product-card .product-desc { color: var(--text-muted); line-height: 1.7; font-size: 13px; flex: 1; }
.product-card--compact .product-desc { font-size: 12px; }
.product-link {
  margin-top: 18px; display: inline-flex; align-items: center; justify-content: space-between;
  width: 100%; border-top: 1px solid var(--line); padding-top: 14px; color: var(--text); font-weight: 600; font-size: 14px;
}
.product-link.is-disabled { opacity: .5; pointer-events: none; cursor: default; }
.product-link span:last-child { transition: transform var(--duration-med) var(--spring); }
.product-card:hover .product-link span:last-child { transform: translateX(5px); }
.product-card:hover { border-color: var(--line-strong); }
.product-card:hover .product-icon { transform: translateY(-2px) scale(1.04); }
.product-card:hover::after { transform: rotate(18deg) scale(1.12); opacity: .78; }
.product-card--featured:hover { border-color: var(--brand); box-shadow: var(--shadow-card), 0 0 50px var(--brand-glow); }

/* ════════════════════════════════════════
   SCENARIOS — Interactive split
   ════════════════════════════════════════ */
.scenario-split {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  min-height: 320px;
  position: relative;
  isolation: isolate;
}
.scenario-split::before {
  content: "";
  position: absolute;
  inset: 28px -18px -18px 112px;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 22%, rgba(34,197,94,.12), transparent 16rem),
    radial-gradient(circle at 82% 78%, rgba(var(--brand-rgb), .12), transparent 18rem),
    linear-gradient(135deg, transparent, var(--accent-soft));
  opacity: .72;
}
.scenario-list { display: flex; flex-direction: column; gap: 4px; }
.scenario-tab {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-soft);
  cursor: pointer; text-align: left; width: 100%;
  font-size: 15px; font-weight: 500;
  transition: background var(--duration-med), color var(--duration-med), border-color var(--duration-med), transform var(--duration-med) var(--spring);
  position: relative;
}
.scenario-tab .tab-icon {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  font-size: 18px; flex-shrink: 0; transition: transform var(--duration-med) var(--spring);
}
.scenario-tab .tab-icon.i1 { background: rgba(99,102,241,.18); }
.scenario-tab .tab-icon.i2 { background: rgba(252,110,8,.18); }
.scenario-tab .tab-icon.i3 { background: rgba(34,197,94,.16); }
.scenario-tab .tab-icon.i4 { background: rgba(244,114,182,.16); }
.scenario-tab:hover { background: var(--bg-card); color: var(--text); transform: translateX(4px); }
.scenario-tab:hover .tab-icon { transform: scale(1.08); }
.scenario-tab.is-active {
  background: var(--bg-card-strong); color: var(--text);
  border-color: var(--line);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), .10), 0 14px 34px rgba(0,0,0,.12);
}
.scenario-tab.is-active::before {
  content: ""; position: absolute; left: 0; top: 18%; bottom: 18%;
  width: 3px; border-radius: 3px; background: var(--gradient-brand);
}
.scenario-tab.is-active .tab-icon { transform: scale(1.1); }

.scenario-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--bg-card-strong), var(--bg-card));
  backdrop-filter: blur(20px) saturate(1.2);
  padding: 36px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.scenario-panel::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, var(--brand-soft), transparent 50%);
  opacity: .5; pointer-events: none;
}
.scenario-panel > * { position: relative; z-index: 1; }
.scenario-panel::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -48px;
  width: 220px;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(var(--brand-rgb), .12), transparent 58%),
    conic-gradient(from 160deg, transparent, rgba(255,255,255,.12), transparent 34%);
  opacity: .7;
  pointer-events: none;
}
.scenario-panel[data-active] .sp-content { animation: panel-in 380ms var(--spring) both; }
.sp-icon {
  width: 64px; height: 64px; border-radius: 20px;
  display: grid; place-items: center; font-size: 30px;
  margin-bottom: 24px;
}
.sp-icon.i1 { background: rgba(99,102,241,.2); }
.sp-icon.i2 { background: rgba(252,110,8,.2); }
.sp-icon.i3 { background: rgba(34,197,94,.18); }
.sp-icon.i4 { background: rgba(244,114,182,.18); }
.sp-title { font-size: clamp(22px, 3vw, 32px); margin-bottom: 14px; }
.sp-desc { color: var(--text-soft); line-height: 1.8; font-size: 16px; max-width: 540px; margin-bottom: 24px; }
.sp-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-tag { padding: 5px 12px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); background: var(--accent-soft); color: var(--text-soft); }

/* ════════════════════════════════════════
   CAPABILITIES — Zigzag
   ════════════════════════════════════════ */
.cap-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 80px;
  position: relative;
}
.cap-item::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 0% 50%, rgba(var(--brand-rgb), .10), transparent 18rem),
    linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent);
  opacity: 0;
  transform: scale(.985);
  transition: opacity var(--duration-med), transform var(--duration-med) var(--spring);
  pointer-events: none;
}
.cap-item:hover::before { opacity: 1; transform: scale(1); }
.cap-item:last-child { margin-bottom: 0; }
.cap-item[data-flip] .cap-text { order: 2; }
.cap-num {
  position: absolute; top: -32px; left: -8px;
  font-size: 96px; font-weight: 900; letter-spacing: -.06em;
  color: var(--brand); opacity: .1; pointer-events: none; line-height: 1;
  font-family: var(--font-main);
}
.cap-text h3 { font-size: clamp(22px, 2.8vw, 30px); margin-bottom: 14px; }
.cap-text p { color: var(--text-soft); line-height: 1.85; font-size: 16px; }

.cap-visual {
  height: 240px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--bg-card); backdrop-filter: blur(18px);
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  isolation: isolate;
}
.cap-visual::before,
.cap-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}
.cap-visual::before {
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, var(--brand-soft), transparent 14rem),
    linear-gradient(135deg, transparent, rgba(255,255,255,.05));
}
.cap-visual::after {
  width: 170px;
  height: 170px;
  right: -58px;
  top: -58px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: conic-gradient(from 90deg, transparent, var(--brand-line), transparent 42%);
  opacity: .55;
  transition: transform var(--duration-slow) var(--spring), opacity var(--duration-med);
}
.cap-item:hover .cap-visual::after { transform: rotate(24deg) scale(1.08); opacity: .82; }
/* visual 1: file tree */
.cv-files { padding: 24px; font-family: ui-monospace, monospace; font-size: 13px; color: var(--text-muted); line-height: 2; width: 100%; }
.cv-files .f { color: var(--text-soft); }
.cv-files .f:hover { color: var(--brand); }
.cv-files .del { text-decoration: line-through; color: rgba(255,100,100,.6); }
.cv-files .new { color: var(--accent-3); }
/* visual 2: browser */
.cv-browser { width: 80%; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.cv-browser-bar { background: var(--bg-card-strong); padding: 8px 12px; display: flex; gap: 6px; align-items: center; border-bottom: 1px solid var(--line); }
.cv-browser-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); opacity: .5; }
.cv-browser-bar .url { margin-left: auto; font-size: 11px; color: var(--text-muted); font-family: ui-monospace, monospace; }
.cv-browser-body { padding: 20px; }
.cv-browser-body .ln { height: 8px; border-radius: 4px; background: var(--accent-soft); margin-bottom: 8px; }
.cv-browser-body .ln.short { width: 50%; }
/* visual 3: terminal */
.cv-term { width: 80%; font-family: ui-monospace, monospace; font-size: 13px; }
.cv-term .l { color: var(--text-muted); margin-bottom: 6px; }
.cv-term .prompt { color: var(--brand); }
.cv-term .ok { color: var(--accent-3); }
/* visual 4: steps */
.cv-steps { display: flex; align-items: center; gap: 0; width: 90%; }
.cv-step { flex: 1; text-align: center; position: relative; }
.cv-step i { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); border: 2px solid var(--brand-line); display: inline-grid; place-items: center; font-size: 13px; color: var(--brand); font-style: normal; }
.cv-step span { display: block; font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.cv-step::after { content: ""; position: absolute; top: 16px; right: -50%; width: 100%; height: 2px; background: var(--line); }
.cv-step:last-child::after { display: none; }

/* ── scroll-driven assembly ── */
.cap-rail {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; height: 100%; transform: translateX(-50%);
  overflow: visible; pointer-events: none; z-index: 0;
}
.cap-rail-line {
  stroke: var(--brand-line); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 200ms linear;
}
.cap-rail.is-reduced .cap-rail-line { stroke-dashoffset: 0; }

/* number scramble glow */
.cap-num[data-cap-num].is-scrambling { color: var(--brand); opacity: .45; }
.cap-num[data-cap-num].is-settled { opacity: .12; transition: opacity 600ms var(--spring); }

/* assembly: children start hidden, reveal in sequence via --i */
[data-assemble] > * { opacity: 0; transform: translateY(8px); transition: opacity 420ms var(--spring), transform 420ms var(--spring); transition-delay: calc(var(--i, 0) * 90ms); }
[data-assemble].is-assembled > * { opacity: 1; transform: translateY(0); }
[data-assemble].is-reduced > * { opacity: 1; transform: none; }

/* step connector draw */
.cv-steps .cv-step::after { transform: scaleX(0); transform-origin: left; transition: transform 500ms var(--spring); transition-delay: calc(var(--i, 0) * 90ms + 200ms); }
.cv-steps.is-assembled .cv-step::after { transform: scaleX(1); }

/* ════════════════════════════════════════
   CTA — Full width
   ════════════════════════════════════════ */
.cta-section { width: 100%; padding: 80px 0; position: relative; overflow: hidden; }
.cta-section::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-line), transparent);
}
.cta-inner { width: min(1160px, calc(100% - 32px)); margin: 0 auto; position: relative; }
.cta-card {
  text-align: center;
  padding: 72px 40px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--bg-card-strong), var(--bg-card));
  backdrop-filter: blur(24px) saturate(1.25);
  box-shadow: var(--shadow-soft);
  position: relative; overflow: hidden;
}
.cta-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(700px circle at 50% 0%, var(--brand-soft), transparent 60%);
  pointer-events: none;
}
.cta-card > * { position: relative; z-index: 1; }
.cta-card h2 { margin-bottom: 14px; }
.cta-card > p { color: var(--text-soft); font-size: 18px; margin-bottom: 36px; }
.cta-button { font-size: 16px; padding: 0 36px; min-height: 56px; display: inline-flex; }
.cta-contact {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
  margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line);
}
.cta-contact span {
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--accent-soft); color: var(--text-soft); font-size: 14px;
}

/* ── Footer ────────────────────────────── */
.site-footer {
  width: min(1160px, calc(100% - 32px)); margin: 0 auto;
  padding: 34px 0 46px; display: flex; justify-content: space-between; gap: 24px;
  color: var(--text-muted); border-top: 1px solid var(--line);
}
.site-footer strong { color: var(--text); }
.site-footer p { margin: 8px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: flex-end; }
.footer-links a { color: var(--text-muted); transition: color var(--duration-med); }
.footer-links a:hover { color: var(--brand); }

/* ── Palette ───────────────────────────── */
.palette { position: fixed; inset: 0; z-index: 50; opacity: 0; pointer-events: none; transition: opacity var(--duration-med); }
.palette.is-open { opacity: 1; pointer-events: auto; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.48); backdrop-filter: blur(10px); }
.palette-dialog { position: absolute; left: 50%; top: 50%; width: min(620px, calc(100% - 32px)); transform: translate(-50%, -46%) scale(.96); border: 1px solid var(--line); border-radius: 30px; background: var(--bg-elevated); box-shadow: var(--shadow-soft); padding: 18px; transition: transform 480ms var(--spring); }
.palette.is-open .palette-dialog { transform: translate(-50%, -50%) scale(1); }
.palette-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 8px 14px; }
.palette-head h2 { font-size: 26px; margin: 0; }
.palette-head button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--accent-soft); color: var(--text); cursor: pointer; font-size: 24px; line-height: 1; }
.palette-list { display: grid; gap: 10px; }
.palette-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-card); transition: transform var(--duration-med) var(--spring), background var(--duration-med); }
.palette-item:hover { transform: translateX(4px); background: var(--bg-card-strong); }
.palette-item i { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 16px; background: var(--gradient-brand); color: #fff; font-style: normal; font-weight: 800; }
.palette-item strong { display: block; }
.palette-item span { color: var(--text-muted); font-size: 13px; }
.palette-hint { margin: 14px 8px 2px; color: var(--text-muted); font-size: 13px; }

/* ════════════════════════════════════════
   MOBILE PERFORMANCE MODE
   ════════════════════════════════════════ */
html.is-mobile-perf body { background-attachment: scroll; }
html.is-mobile-perf .mesh-layer,
html.is-mobile-perf .aurora-band,
html.is-mobile-perf .grid-noise,
html.is-mobile-perf .bg-orbit,
html.is-mobile-perf .bg-scanline,
html.is-mobile-perf .bg-widget,
html.is-mobile-perf .app-aurora,
html.is-mobile-perf .app-sheen,
html.is-mobile-perf .featured-code-track,
html.is-mobile-perf .ticker,
html.is-mobile-perf h1 {
  animation: none !important;
}
html.is-mobile-perf .page-shell::before,
html.is-mobile-perf .page-shell::after {
  animation: none !important;
  filter: none !important;
}
html.is-mobile-perf .page-shell::before { opacity: .28; }
html.is-mobile-perf .page-shell::after { opacity: .10; }
html.is-mobile-perf .mesh-layer {
  filter: none !important;
  opacity: .48;
  transform: none !important;
}
html.is-mobile-perf .page-shell.is-reacting .mesh-layer {
  filter: none !important;
  opacity: .58;
}
html.is-mobile-perf .page-shell.is-reacting::before,
html.is-mobile-perf .page-shell.is-reacting::after {
  filter: none !important;
}
html.is-mobile-perf .aurora-band,
html.is-mobile-perf .ambient,
html.is-mobile-perf .bg-orbit,
html.is-mobile-perf .bg-scanline,
html.is-mobile-perf .bg-widget-c,
html.is-mobile-perf .spotlight {
  display: none !important;
}
html.is-mobile-perf .grid-noise {
  opacity: .34;
  transform: none !important;
  mix-blend-mode: normal;
  background-size: 120px 120px, 120px 120px, 44px 44px;
}
html.is-mobile-perf .bg-canvas {
  opacity: .46;
  filter: none !important;
}
html.is-mobile-perf .bg-widget {
  animation: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none;
  opacity: .34;
}
html.is-mobile-perf .site-header,
html.is-mobile-perf .site-nav,
html.is-mobile-perf .hero-badge,
html.is-mobile-perf .button.secondary,
html.is-mobile-perf .hero-app,
html.is-mobile-perf .app-agent,
html.is-mobile-perf .product-card,
html.is-mobile-perf .scenario-panel,
html.is-mobile-perf .cap-visual,
html.is-mobile-perf .cta-card,
html.is-mobile-perf .palette-backdrop,
html.is-mobile-perf .palette-dialog {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.is-mobile-perf .site-header,
html.is-mobile-perf .hero-app,
html.is-mobile-perf .product-card,
html.is-mobile-perf .scenario-panel,
html.is-mobile-perf .cap-visual,
html.is-mobile-perf .cta-card {
  box-shadow: 0 12px 34px rgba(0,0,0,.18);
}
html.is-mobile-perf .hero-app,
html.is-mobile-perf .product-card,
html.is-mobile-perf .cap-item,
html.is-mobile-perf .button {
  transform: none !important;
}
html.is-mobile-perf .app-sheen,
html.is-mobile-perf .app-aurora,
html.is-mobile-perf .app-minimap,
html.is-mobile-perf .app-toast {
  display: none !important;
}
html.is-mobile-perf .featured-code-track {
  transform: none !important;
}
html.is-mobile-perf .hero-badge .dot,
html.is-mobile-perf .app-status-dot,
html.is-mobile-perf .agent-typing i,
html.is-mobile-perf .agent-tool-status,
html.is-mobile-perf .app-caret.is-visible {
  animation: none !important;
}

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */
@media (max-width: 900px) {
  .bg-widget { opacity: .48; transform: scale(.86); }
  .bg-widget-a { left: 5vw; top: 64vh; }
  .bg-widget-b { right: 4vw; top: 18vh; }
  .bg-widget-c { display: none; }
  .bg-orbit-a { width: 70vw; height: 70vw; left: -32vw; top: 24vh; }
  .bg-orbit-b { width: 64vw; height: 64vw; right: -34vw; bottom: 16vh; }
  .nav-toggle { display: flex; }
  .site-nav {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: calc(100% + 8px); left: 16px; right: 16px;
    width: auto; margin: 0; padding: 0;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--bg-elevated); backdrop-filter: blur(22px) saturate(1.35);
    box-shadow: var(--shadow-soft);
    opacity: 0; pointer-events: none; transform: translateY(-8px);
    transition: opacity var(--duration-med), transform var(--duration-med);
  }
  .site-nav.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .site-nav a { padding: 14px 18px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: none; }
  .site-header { position: sticky; }
  .hero { grid-template-columns: 1fr; padding-top: 64px; min-height: auto; gap: 36px; }
  .hero-app { min-height: 380px; }
  .product-grid { grid-template-columns: 1fr; grid-template-rows: auto; min-height: auto; }
  .product-card--featured { grid-row: auto; }
  .scenario-split { grid-template-columns: 1fr; }
  .scenario-list { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 8px; }
  .scenario-tab { flex-shrink: 0; min-width: 140px; }
  .scenario-tab .tab-text { display: none; }
  .cap-item { grid-template-columns: 1fr; gap: 24px; margin-bottom: 56px; }
  .cap-item[data-flip] .cap-text { order: 0; }
  .cap-visual { height: 180px; }
}
@media (max-width: 560px) {
  .page-shell::after { opacity: .12; transform: rotateX(62deg) translateY(34vh) scale(1.9); }
  .bg-widget { min-width: 106px; padding: 10px 12px; font-size: 9px; }
  .bg-widget b { font-size: 15px; }
  .bg-widget-a { display: none; }
  .bg-widget-b { top: 16vh; right: 2vw; }
  .site-header { top: 8px; width: min(100% - 16px, 1160px); padding: 8px; }
  .palette-btn { display: none; }
  .brand-word { display: none; }
  .toggle-text { display: none; }
  h1 { font-size: clamp(36px, 12vw, 56px); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .button { width: 100%; }
  .scenario-panel { padding: 24px; }
  .scenario-split::before { inset: 64px -10px -12px -10px; }
  .cta-card { padding: 48px 20px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .footer-links { justify-content: flex-start; }
}
