/* home.css - Next Level UI (Smoothness Perfected & Cursor Fixed) */
:root {
  --home-bg: #030303;
  --bg-glass: rgba(20, 20, 20, 0.4);
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --max-width: 1280px;
}

body {
  background-color: var(--home-bg);
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  margin: 0; padding: 0;
  overflow-x: hidden;
  /* Removed scroll-behavior: smooth to fix scrolling jank */
}

/* FIX: Interactive Cursor - Adjusted z-index and blend mode to ensure visibility */
#cursor-glow {
  position: fixed; top: 0; left: 0; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, rgba(0,0,0,0) 70%);
  border-radius: 50%; transform: translate(-50%, -50%) translateZ(0);
  pointer-events: none;
  z-index: 9999; /* Brought to the front */
  mix-blend-mode: screen; /* Ensures it highlights elements underneath */
  will-change: transform;
}

/* Background Animations */
.hero-bg-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; z-index: -2; opacity: 0.6; }
.bg-traces path { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: bgDraw 8s linear infinite; will-change: stroke-dashoffset; }
.bg-traces path:nth-child(2) { animation-delay: 4s; animation-duration: 10s; }
@keyframes bgDraw { 0% { stroke-dashoffset: 2000; } 100% { stroke-dashoffset: -2000; } }

.home-container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.glass-panel { background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.05); }

/* Nav - Optimized for more links */
.home-nav { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(255,255,255,0.05); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 72px; }
.brand { display: flex; align-items: center; }
.brand-text { font-size: 1.25rem; font-weight: 700; color: white; margin-left: 8px; letter-spacing: -0.02em;}
.brand-sub { color: var(--accent); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; margin-left: 4px; }
.nav-actions { display: flex; gap: 16px; align-items: center; }
.nav-link { color: var(--text-secondary); text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: color 0.2s ease; padding: 4px; }
.nav-link:hover, .nav-link.active { color: var(--accent-bright); }

@media (max-width: 1000px) {
    .nav-actions { gap: 10px; }
    .nav-link { font-size: 0.8rem; }
}

.btn { padding: 10px 18px; font-size: 0.85rem; border-radius: 8px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; cursor: pointer; transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease; will-change: transform; }
.btn-large { padding: 16px 32px; font-size: 1rem; border-radius: 12px; }
.btn-secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border: none; }
.btn-primary:active { transform: scale(0.98); }
.glow-btn { position: relative; }
.glow-btn::before { content: ''; position: absolute; inset: -2px; border-radius: inherit; background: linear-gradient(90deg, var(--accent-bright), var(--accent), var(--accent-bright)); z-index: -1; filter: blur(8px); opacity: 0; transition: opacity 0.3s ease; }
.glow-btn:hover::before { opacity: 0.6; }
.btn-outline { background: transparent; border: 1px solid var(--line-strong); color: white; }
.btn-outline:hover { background: rgba(255,255,255,0.05); transform: translateY(-1px); }
.btn-outline:active { transform: translateY(1px); }

/* Hero */
.hero { position: relative; padding: 120px 0 80px; text-align: center; }
.hero-badge { display: inline-block; padding: 6px 16px; margin-bottom: 32px; background: rgba(249, 115, 22, 0.1); border: 1px solid rgba(249, 115, 22, 0.2); border-radius: 50px; color: var(--accent-bright); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.hero-title { font-size: clamp(3.5rem, 6vw, 5.5rem); line-height: 1.05; letter-spacing: -0.04em; margin: 0 0 24px; font-weight: 800; }
.text-gradient { background: linear-gradient(135deg, #ffffff 20%, #a0a0a0 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
#typewriter-text { background: linear-gradient(135deg, var(--accent-bright) 0%, #ff5e00 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.cursor { color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-subtitle { font-size: 1.25rem; color: var(--text-secondary); max-width: 650px; margin: 0 auto 40px; line-height: 1.6; }
.hero-cta { display: flex; gap: 16px; justify-content: center; margin-bottom: 80px; }

/* Video Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(10px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content {
  width: 90%; max-width: 900px; background: #000; border-radius: 16px; border: 1px solid var(--line-strong);
  position: relative; transform: translateY(20px); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); overflow: hidden;
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.close-modal { position: absolute; top: 16px; right: 16px; background: none; border: none; color: white; font-size: 2rem; cursor: pointer; z-index: 10; opacity: 0.7; transition: opacity 0.2s;}
.close-modal:hover { opacity: 1; }
.video-container { position: relative; padding-bottom: 56.25%; height: 0; }
.video-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #111; color: var(--text-secondary); text-align: center; }
.video-container iframe, .video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Dashboard 3D Effect - Smooth rendering perfected */
.hero-dashboard-container { perspective: 1200px; margin: 0 auto; max-width: 1000px; }
.dashboard-3d-wrapper { 
  transform: rotateX(15deg) rotateY(0deg) translateZ(0); 
  /* REMOVED CSS transition on transform so JS can interpolate without fighting CSS */
  transform-style: preserve-3d;
  box-shadow: 0 40px 100px -20px rgba(249, 115, 22, 0.25); 
  border-radius: 16px;
  will-change: transform;
}

.dashboard-glass { background: rgba(15, 15, 15, 0.8); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; overflow: hidden; backdrop-filter: blur(20px); }
.dash-top { padding: 12px 16px; background: rgba(0,0,0,0.5); border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center; gap: 8px; position: relative;}
.dash-top .dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f56; } .dot.yellow { background: #ffbd2e; } .dot.green { background: #27c93f; }
.dash-url { position: absolute; left: 50%; transform: translateX(-50%); font-family: monospace; color: var(--ink-3); font-size: 0.8rem; background: rgba(255,255,255,0.05); padding: 4px 12px; border-radius: 4px; }
.dash-body { position: relative; height: 500px; background: var(--canvas-bg); overflow: hidden; display: flex; align-items: center; justify-content: center;}

/* Complex Mini PCB Animation inside Dashboard */
.mini-pcb { width: 100%; height: 100%; position: absolute; inset: 0; }
.chip { fill: var(--bg-1); stroke: var(--layer-silk); stroke-width: 2; transition: all 0.3s ease; }
.chip.mcu { stroke: var(--accent); fill: rgba(249,115,22,0.1); filter: url(#pcbGlow); }
.active-trace { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: traceFlow 4s ease-in-out infinite; will-change: stroke-dashoffset; }
.active-trace.offset-1 { animation-delay: 0.5s; stroke: var(--accent-bright); }
.active-trace.offset-2 { animation-delay: 1.0s; stroke-width: 2; }
.active-trace.offset-3 { animation-delay: 1.5s; stroke-width: 2; stroke: var(--accent-bright); }
.active-trace.offset-4 { animation-delay: 2.0s; }
.via { fill: var(--accent-bright); opacity: 0; animation: viaPop 4s ease-in-out infinite; will-change: opacity, transform; }
.via:nth-child(n+2) { animation-delay: 0.5s; }
@keyframes traceFlow { 0%, 10% { stroke-dashoffset: 400; } 50%, 90% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -400; } }
@keyframes viaPop { 0%, 40% { opacity: 0; transform: scale(0.5); } 50%, 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }

/* Dynamic AI Prompt Overlay */
.ai-prompt-overlay { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%) translateZ(0); background: rgba(10, 10, 10, 0.85); border: 1px solid var(--accent-a56); padding: 20px 32px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); text-align: left; width: 80%; backdrop-filter: blur(10px); }
.typing-prompt { font-family: monospace; color: white; font-size: 1rem; margin-bottom: 12px; min-height: 24px;}
.ai-response { font-size: 0.9rem; color: var(--text-secondary); display: flex; align-items: center; gap: 8px;}
.ai-response .check { color: #27c93f; background: rgba(39, 201, 63, 0.1); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 0.7rem; }

/* Bento Box Grid */
.bento-section { padding: 120px 0; position: relative; z-index: 10;}
.section-header { text-align: center; margin-bottom: 60px; }
.section-title { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 16px; letter-spacing: -0.02em; font-weight: 700;}
.section-subtitle { color: var(--text-secondary); font-size: 1.1rem; }

.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(300px, auto); gap: 24px; }
.bento-card { background: var(--bg-1); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 24px; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease; will-change: transform; }
.bento-card:hover { transform: translateY(-6px); border-color: rgba(249, 115, 22, 0.3); }
.bento-large { grid-column: span 3; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 900px) { .bento-large { grid-template-columns: 1fr; } .bento-grid { grid-template-columns: 1fr; } }

.card-content h3 { font-size: 1.75rem; margin: 0 0 16px; font-weight: 600;}
.card-content p { color: var(--text-secondary); line-height: 1.6; margin: 0 0 24px; font-size: 1.05rem;}
.card-content .icon { width: 40px; height: 40px; color: var(--accent-bright); margin-bottom: 24px; }
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { margin-bottom: 12px; color: white; display: flex; align-items: center; gap: 8px; font-size: 0.95rem;}

.card-visual { width: 100%; height: 100%; min-height: 250px; border-radius: 16px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;}
.abstract-circuit { background: radial-gradient(circle at center, rgba(249, 115, 22, 0.1) 0%, transparent 70%); border: 1px dashed rgba(255,255,255,0.1); }
.abstract-circuit::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(var(--accent-dim) 1px, transparent 1px); background-size: 20px 20px; opacity: 0.3; }
.image-hint { font-family: monospace; color: var(--ink-3); font-size: 0.8rem; z-index: 2;}
.card-visual-img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; display: block; }

/* CTA Section */
.cta-section { padding: 60px 0 120px; }
.cta-box { padding: 80px 40px; text-align: center; border-radius: 24px; position: relative; overflow: hidden; }
.cta-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 600px; height: 600px; background: radial-gradient(circle, rgba(249, 115, 22, 0.15) 0%, transparent 70%); z-index: -1; }
.cta-box h2 { font-size: 2.5rem; margin: 0 0 16px; letter-spacing: -0.02em; }
.cta-box p { color: var(--text-secondary); font-size: 1.2rem; margin: 0; }

/* Footer */
.home-footer { background: var(--bg-0); border-top: 1px solid rgba(255,255,255,0.05); padding: 80px 0 32px; }
.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; margin-bottom: 60px; }
.footer-desc { color: var(--text-secondary); margin-top: 16px; font-size: 0.95rem; max-width: 300px;}
.footer-links { display: flex; gap: 80px; }
.link-group h4 { color: white; margin-top: 0; margin-bottom: 20px; font-size: 1rem; }
.link-group a { display: block; color: var(--text-secondary); text-decoration: none; margin-bottom: 12px; font-size: 0.9rem; transition: color 0.2s ease;}
.link-group a:hover { color: var(--accent-bright); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 32px; color: var(--ink-3); font-size: 0.85rem; flex-wrap: wrap; gap: 20px;}
.payment-methods { display: flex; align-items: center; gap: 12px; }
.pay-badge { padding: 4px 8px; border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; font-weight: 600; color: var(--text-secondary); }

/* Reveal Animations - Upgraded for Smoothness */
.reveal { opacity: 0; transform: translateY(40px); transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1); will-change: transform, opacity; }
.reveal.active { opacity: 1; transform: translateY(0); }
