/* ========================================
   Hermes Agent + Pi Coding Agent
   ======================================== */

:root {
    --bg-primary: #060a06;
    --bg-secondary: #0a120a;
    --bg-card: #0d180d;
    --bg-elevated: #111a11;
    --accent-green: #22c55e;
    --accent-green-dim: #16a34a;
    --accent-green-glow: rgba(34, 197, 94, 0.15);
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.15);
    --text-primary: #e8f5e8;
    --text-secondary: #86a386;
    --text-muted: #4a6b4a;
    --text-dim: #2a3d2a;
    --border-color: #152215;
    --border-hover: #224422;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-sans: 'Inter', system-ui, sans-serif;
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-sans); background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

#particle-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.noise-overlay { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.03; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 24px; font-family: var(--font-sans); font-size: 0.875rem; font-weight: 600; border-radius: 10px; border: none; cursor: pointer; transition: all 0.3s var(--ease-smooth); white-space: nowrap; }
.btn-primary { background: var(--accent-green); color: var(--bg-primary); box-shadow: 0 0 30px rgba(34, 197, 94, 0.2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(34, 197, 94, 0.35); }
.btn-ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-ghost:hover { background: var(--bg-card); border-color: var(--border-hover); transform: translateY(-2px); }
.btn-nav { padding: 8px 18px; font-size: 0.8125rem; background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-nav:hover { border-color: var(--accent-green); box-shadow: 0 0 20px var(--accent-green-glow); }
.btn-block { width: 100%; }
.btn-large { padding: 14px 32px; font-size: 1rem; }

/* Navigation */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 16px 0; transition: all 0.4s var(--ease-smooth); }
.nav.scrolled { background: rgba(6, 10, 6, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border-color); padding: 12px 0; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; }
.logo-mark { color: var(--accent-green); font-size: 1.25rem; animation: pulse-glow 3s ease-in-out infinite; }
.logo-accent { color: var(--accent-green); }
@keyframes pulse-glow { 0%, 100% { text-shadow: 0 0 10px rgba(34, 197, 94, 0.3); } 50% { text-shadow: 0 0 25px rgba(34, 197, 94, 0.6); } }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 0.875rem; color: var(--text-secondary); transition: color 0.3s ease; position: relative; }
.nav-links a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 1px; background: var(--accent-green); transition: width 0.3s var(--ease-smooth); }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 4px; z-index: 1001; }
.menu-toggle span { display: block; width: 22px; height: 1.5px; background: var(--text-primary); transition: all 0.3s ease; transform-origin: center; }
.menu-toggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.mobile-menu { position: fixed; inset: 0; z-index: 999; background: rgba(6, 10, 6, 0.98); backdrop-filter: blur(20px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
.mobile-menu.active { opacity: 1; pointer-events: all; }
.mobile-menu a { font-family: var(--font-mono); font-size: 1.25rem; color: var(--text-secondary); transition: color 0.3s ease; }
.mobile-menu a:hover { color: var(--accent-green); }

/* Hero — Новая жизнь (centered) */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 140px 24px 100px; overflow: hidden; z-index: 2; }
.hero-grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(34, 197, 94, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(34, 197, 94, 0.03) 1px, transparent 1px); background-size: 60px 60px; mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%); }
.hero-content { position: relative; z-index: 2; }
.hero-center { text-align: center; max-width: 760px; margin: 0 auto; }
.hero-title { font-family: var(--font-sans); font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 24px; }
.hero-title .line { display: block; opacity: 0; animation: fadeUp 0.8s var(--ease-smooth) forwards; }
.hero-title .line:nth-child(1) { animation-delay: 0.3s; }
.hero-title .line:nth-child(2) { animation-delay: 0.45s; }
.hero-subtitle { font-size: 1.125rem; color: var(--text-secondary); line-height: 1.7; margin: 0 auto 36px; max-width: 560px; opacity: 0; animation: fadeUp 0.8s var(--ease-smooth) 0.6s forwards; }
.hero-actions { display: flex; gap: 12px; opacity: 0; animation: fadeUp 0.8s var(--ease-smooth) 0.8s forwards; flex-wrap: wrap; }
.hero-actions-center { justify-content: center; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* Agent Section (бывший hero с терминалом) */
.agent-section { position: relative; z-index: 2; padding: 140px 24px; }
.agent-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.agent-content { position: relative; z-index: 2; }
.agent-title { font-family: var(--font-sans); font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; margin-bottom: 24px; }
.agent-title .line { display: block; }
.agent-subtitle { font-size: 1.0625rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 36px; max-width: 480px; }
.agent-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.agent-terminal-wrap { position: relative; display: flex; align-items: center; justify-content: center; min-height: 400px; }

/* Terminal */
.terminal-window { width: 100%; max-width: 520px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.05), 0 40px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(34, 197, 94, 0.05); transition: transform 0.5s var(--ease-smooth), box-shadow 0.5s ease; }
.terminal-window:hover { box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.1), 0 50px 100px rgba(0, 0, 0, 0.6), 0 0 80px rgba(34, 197, 94, 0.08); }
.terminal-large { max-width: 100%; }
.terminal-large:hover { transform: none; }
.terminal-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--bg-elevated); border-bottom: 1px solid var(--border-color); }
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots span { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dots span:nth-child(1) { background: #ef4444; }
.terminal-dots span:nth-child(2) { background: #eab308; }
.terminal-dots span:nth-child(3) { background: var(--accent-green); }
.terminal-title { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.terminal-spacer { flex: 1; }
.terminal-tabs { display: flex; gap: 4px; margin-left: 12px; }
.terminal-tabs .tab { padding: 4px 12px; font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); background: transparent; border: 1px solid transparent; border-radius: 6px; cursor: pointer; transition: all 0.3s ease; }
.terminal-tabs .tab:hover { color: var(--text-secondary); }
.terminal-tabs .tab.active { color: var(--accent-green); background: var(--accent-green-glow); border-color: rgba(34, 197, 94, 0.2); }
.terminal-body { padding: 20px; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.8; min-height: 240px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.term-line { margin-bottom: 2px; }
.term-prompt { color: var(--accent-green); margin-right: 8px; text-shadow: 0 0 8px rgba(34, 197, 94, 0.3); }
.term-cmd { color: var(--text-primary); }
.term-output { color: var(--text-secondary); padding-left: 24px; }
.term-output.dim { color: var(--text-muted); }
.term-success { color: var(--accent-green); }
.term-highlight { color: var(--accent-cyan); }
.term-cursor { color: var(--accent-green); animation: blink 1s step-end infinite; }
.term-input { color: var(--text-primary); outline: none; caret-color: var(--accent-green); }
.term-welcome { color: var(--text-muted); white-space: pre; line-height: 1.6; }
.term-comment { color: var(--text-dim); font-style: italic; }
.code-k { color: var(--accent-cyan); }
.code-s { color: var(--accent-green); }
.code-b { color: #f59e0b; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Floating cards */
.floating-card { position: absolute; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); animation: float-card 6s ease-in-out infinite; z-index: 3; }
.f-icon { font-size: 1.25rem; }
.f-label { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.f-text { font-size: 0.8125rem; color: var(--text-primary); font-weight: 500; }
.card-1 { top: -20px; right: -20px; animation-delay: 0s; }
.card-2 { bottom: 40px; left: -40px; animation-delay: -2s; }
.card-3 { bottom: -10px; right: 20px; animation-delay: -4s; }
@keyframes float-card { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Scroll hint */
.scroll-hint { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 2; opacity: 0; animation: fadeUp 0.8s var(--ease-smooth) 1.2s forwards; }
.scroll-mouse { width: 22px; height: 34px; border: 1.5px solid var(--text-dim); border-radius: 12px; display: flex; justify-content: center; padding-top: 6px; }
.scroll-wheel { width: 3px; height: 6px; background: var(--accent-green); border-radius: 2px; animation: scroll-wheel 2s ease-in-out infinite; }
@keyframes scroll-wheel { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(8px); opacity: 0.3; } }

/* Marquee */
.marquee-section { position: relative; z-index: 2; padding: 40px 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); overflow: hidden; background: var(--bg-secondary); }
.marquee-label { text-align: center; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-muted); margin-bottom: 20px; }
.marquee-track { display: flex; overflow: hidden; mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); }
.marquee-content { display: flex; gap: 60px; animation: marquee 30s linear infinite; white-space: nowrap; }
.marquee-content span { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--text-muted); transition: color 0.3s ease; }
.marquee-content span:hover { color: var(--accent-green); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Section Headers */
.section-header { text-align: center; margin-bottom: 80px; position: relative; z-index: 2; }
.section-eyebrow { display: inline-block; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent-green); margin-bottom: 16px; }
.section-title { font-size: clamp(1.75rem, 3.5vw, 2.75rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 16px; }
.section-title em { font-style: normal; color: var(--accent-green); text-shadow: 0 0 30px rgba(34, 197, 94, 0.2); }
.section-desc { font-size: 1.0625rem; color: var(--text-secondary); max-width: 540px; margin: 0 auto; line-height: 1.7; }

/* Realization */
.realization { position: relative; z-index: 2; padding: 140px 0; }
.realization-content { max-width: 800px; margin: 0 auto; }
.realization .section-eyebrow { margin-bottom: 40px; }
.realization blockquote { font-family: var(--font-sans); font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); line-height: 1.85; color: var(--text-secondary); }
.realization blockquote p { margin-bottom: 20px; }
.realization blockquote strong { color: var(--text-primary); font-weight: 600; }
.realization footer { margin-top: 40px; font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-muted); }
.realization footer strong { color: var(--text-primary); font-weight: 600; }

/* Capabilities */
.capabilities { position: relative; z-index: 2; padding: 140px 0; }
.capabilities-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cap-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 36px 28px; transition: all 0.5s var(--ease-smooth); position: relative; overflow: hidden; }
.cap-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-green), transparent); opacity: 0; transition: opacity 0.5s ease; }
.cap-card:hover { transform: translateY(-6px); border-color: var(--border-hover); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(34, 197, 94, 0.05); }
.cap-card:hover::before { opacity: 0.5; }
.cap-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; color: var(--accent-green); margin-bottom: 24px; transition: all 0.4s ease; }
.cap-card:hover .cap-icon { background: var(--accent-green-glow); border-color: var(--accent-green-dim); box-shadow: 0 0 20px rgba(34, 197, 94, 0.1); }
.cap-card h3 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 10px; }
.cap-card p { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.7; }
.pi-section { background: var(--bg-secondary); border-top: 1px solid var(--border-color); }

/* Demo Section */
.demo-section { position: relative; z-index: 2; padding: 140px 0; background: var(--bg-secondary); border-top: 1px solid var(--border-color); }
.demo-layout { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start; }
.demo-sidebar { display: flex; flex-direction: column; gap: 8px; }
.demo-cmd { padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; cursor: pointer; transition: all 0.3s var(--ease-smooth); font-family: var(--font-mono); font-size: 0.8125rem; display: flex; flex-direction: column; gap: 4px; }
.demo-cmd:hover, .demo-cmd.active { border-color: var(--accent-green); background: var(--accent-green-glow); transform: translateX(4px); }
.cmd-prompt { color: var(--accent-green); margin-right: 4px; }
.cmd-desc { font-family: var(--font-sans); font-size: 0.75rem; color: var(--text-muted); padding-left: 20px; }
.demo-terminal-wrapper { position: sticky; top: 100px; }

/* How It Works */
.how-it-works { position: relative; z-index: 2; padding: 140px 0; }
.steps { display: flex; flex-direction: column; gap: 60px; max-width: 900px; margin: 0 auto; }
.step { display: grid; grid-template-columns: 80px 1fr 280px; gap: 40px; align-items: center; }
.step-number { font-family: var(--font-mono); font-size: 2.5rem; font-weight: 700; color: var(--accent-green); opacity: 0.3; line-height: 1; }
.step-content h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; }
.step-content p { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.7; }
.step-visual { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; min-height: 140px; display: flex; align-items: center; justify-content: center; }
.step-connectors { display: flex; align-items: center; gap: 12px; }
.conn-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--bg-elevated); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.conn-arrow { color: var(--accent-green); font-family: var(--font-mono); font-size: 1.25rem; }
.conn-hub { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-green-glow); border: 1px solid var(--accent-green-dim); display: flex; align-items: center; justify-content: center; color: var(--accent-green); font-size: 1.25rem; box-shadow: 0 0 20px rgba(34, 197, 94, 0.15); }
.step-code { font-family: var(--font-mono); font-size: 0.8125rem; line-height: 2; width: 100%; }
.code-line { color: var(--text-secondary); }
.step-status { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.st-item { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-secondary); }
.st-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); }
.st-dot.running { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); animation: pulse-dot 2s ease-in-out infinite; }
.st-dot.done { background: var(--accent-cyan); }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* CTA */
.cta { position: relative; z-index: 2; padding: 160px 0; overflow: hidden; text-align: center; }
.cta-bg { position: absolute; inset: 0; z-index: 0; }
.orb-cta { position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 197, 94, 0.12), transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); filter: blur(80px); }
.cta-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.cta-content h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 32px; }
.cta-content h2 em { font-style: normal; color: var(--accent-green); }
.cta-form { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-input { flex: 1; min-width: 240px; max-width: 320px; padding: 14px 20px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; color: var(--text-primary); font-family: var(--font-sans); font-size: 0.9375rem; outline: none; transition: all 0.3s ease; }
.cta-input:focus { border-color: var(--accent-green); box-shadow: 0 0 20px rgba(34, 197, 94, 0.1); }
.cta-input::placeholder { color: var(--text-muted); }

/* Footer */
.footer { position: relative; z-index: 2; padding: 80px 0 40px; border-top: 1px solid var(--border-color); background: var(--bg-primary); }
.footer-realization { max-width: 700px; margin-bottom: 60px; }
.footer-realization h4 { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent-green); margin-bottom: 16px; }
.footer-realization p { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.7; }
.footer-bottom { padding-top: 32px; border-top: 1px solid var(--border-color); }
.footer-bottom > p { font-size: 0.8125rem; color: var(--text-dim); margin-bottom: 8px; }
.footer-trademarks { font-size: 0.75rem; color: var(--text-dim); line-height: 1.6; max-width: 800px; }
.footer-trademarks strong { color: var(--text-muted); font-weight: 600; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s var(--ease-smooth), transform 0.8s var(--ease-smooth); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal[style*="--i"] { transition-delay: calc(var(--i) * 0.1s); }

/* ========================================
   pi.dev inspired animations
   ======================================== */

/* Glitch effect for hero title */
.glitch-text { position: relative; }
.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
}
.glitch-text::before {
    color: var(--accent-cyan);
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    animation: glitch-1 3s infinite linear alternate-reverse;
}
.glitch-text::after {
    color: var(--accent-green);
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    animation: glitch-2 2.5s infinite linear alternate-reverse;
}
@keyframes glitch-1 {
    0%, 90%, 100% { opacity: 0; transform: translate(0); }
    92% { opacity: 0.6; transform: translate(-3px, 1px); }
    94% { opacity: 0.3; transform: translate(3px, -1px); }
    96% { opacity: 0.5; transform: translate(-2px, 2px); }
}
@keyframes glitch-2 {
    0%, 85%, 100% { opacity: 0; transform: translate(0); }
    87% { opacity: 0.5; transform: translate(2px, -2px); }
    89% { opacity: 0.3; transform: translate(-3px, 1px); }
    91% { opacity: 0.4; transform: translate(3px, -1px); }
}

/* Scanlines overlay for terminal sections */
.scanlines {
    position: relative;
}
.scanlines::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    border-radius: inherit;
}

/* Figure corners (pi.dev style frame corners) */
.figure-frame {
    position: relative;
}
.figure-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--accent-green);
    border-style: solid;
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 5;
}
.figure-frame:hover .figure-corner { opacity: 0.8; }
.figure-corner--tl { top: -1px; left: -1px; border-width: 1px 0 0 1px; border-radius: 3px 0 0 0; }
.figure-corner--tr { top: -1px; right: -1px; border-width: 1px 1px 0 0; border-radius: 0 3px 0 0; }
.figure-corner--bl { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; border-radius: 0 0 0 3px; }
.figure-corner--br { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; border-radius: 0 0 3px 0; }

/* Enhanced terminal glow */
.terminal-glow {
    position: relative;
}
.terminal-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), transparent 40%, transparent 60%, rgba(6, 182, 212, 0.1));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    filter: blur(8px);
}
.terminal-glow:hover::before { opacity: 1; }

/* Typewriter line reveal */
.type-line {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid transparent;
    animation: typing 0.6s steps(30, end) forwards, blink-caret 0.7s step-end infinite;
    width: 0;
}
@keyframes typing { from { width: 0; } to { width: 100%; } }
@keyframes blink-caret { 0%, 100% { border-color: transparent; } 50% { border-color: var(--accent-green); } }

/* Magnetic hover effect */
.magnetic {
    transition: transform 0.3s var(--ease-smooth);
}

/* Cursor glow trail */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.04), transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

/* Live dot pulse */
.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    display: inline-block;
    position: relative;
}
.live-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--accent-green);
    animation: live-dot-pulse 2s ease-out infinite;
}
@keyframes live-dot-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: stagger-in 0.6s var(--ease-smooth) forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
@keyframes stagger-in {
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1024px) {
    .agent-layout { grid-template-columns: 1fr; text-align: center; gap: 60px; }
    .agent-subtitle { margin-left: auto; margin-right: auto; }
    .agent-actions { justify-content: center; }
    .agent-terminal-wrap { max-width: 540px; margin: 0 auto; }
    .capabilities-grid { grid-template-columns: repeat(2, 1fr); }
    .demo-layout { grid-template-columns: 1fr; }
    .demo-terminal-wrapper { position: static; }
    .step { grid-template-columns: 60px 1fr; }
    .step-visual { display: none; }
}
@media (max-width: 768px) {
    .nav-links, .btn-nav { display: none; }
    .menu-toggle { display: flex; }
    .capabilities-grid { grid-template-columns: 1fr; }
    .step { grid-template-columns: 1fr; gap: 16px; }
    .step-number { font-size: 1.75rem; }
    .cta-form { flex-direction: column; align-items: stretch; }
    .cta-input { max-width: 100%; }
    .agent-actions { flex-direction: column; }
    .btn { width: 100%; }
    .floating-card { display: none; }
    .terminal-tabs { display: none; }
}

::selection { background: rgba(34, 197, 94, 0.3); color: var(--text-primary); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
