/* ============ Base ============ */
html { scroll-behavior: smooth; }
body { cursor: none; }
@media (max-width: 768px) { body { cursor: auto; } }

/* ============ Custom cursor ============ */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; border-radius: 50%; transform: translate(-50%, -50%); transition: transform 0.15s ease, width 0.2s ease, height 0.2s ease, background-color 0.2s ease; mix-blend-mode: difference; }
.cursor-dot { width: 6px; height: 6px; background: #22d3ee; }
.cursor-ring { width: 36px; height: 36px; border: 1.5px solid rgba(34,211,238,0.6); transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.2, 1), width 0.2s, height 0.2s; }
.cursor-ring.hover { width: 60px; height: 60px; border-color: rgba(52,211,153,0.7); background: rgba(52,211,153,0.05); }
@media (max-width: 768px) { .cursor-dot, .cursor-ring { display: none; } }

/* ============ Loader ============ */
.loader-ring { width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.08); border-top-color: #22d3ee; border-right-color: #34d399; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dots { display: inline-block; width: 14px; text-align: left; }
#loader.fade-out { opacity: 0; transition: opacity 0.6s ease; pointer-events: none; }

/* ============ Background FX ============ */
.aurora { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.35; animation: float 18s ease-in-out infinite; }
.aurora-1 { width: 600px; height: 600px; background: radial-gradient(circle, #06b6d4, transparent 70%); top: -150px; left: -150px; }
.aurora-2 { width: 700px; height: 700px; background: radial-gradient(circle, #10b981, transparent 70%); bottom: -200px; right: -200px; animation-delay: -8s; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-30px) scale(1.08); } }
.grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px); background-size: 60px 60px; mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 80%); }
.noise { position: absolute; inset: 0; opacity: 0.04; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.8'/></svg>"); mix-blend-mode: overlay; }

/* ============ Light theme overrides ============ */
html.light body { background: #f7f8fa; color: #0a0d12; }
html.light { background: #f7f8fa; }
html.light .bg-ink-950 { background: #f7f8fa !important; }
html.light .bg-ink-900\/80, html.light .bg-ink-900\/95 { background: rgba(255,255,255,0.85) !important; }
html.light .text-white { color: #0a0d12 !important; }
html.light .text-zinc-200 { color: #1a1f26; }
html.light .text-zinc-300 { color: #2a2f36; }
html.light .text-zinc-400 { color: #4b5563; }
html.light .text-zinc-500 { color: #6b7280; }
html.light .border-white\/5, html.light .border-white\/10 { border-color: rgba(0,0,0,0.08) !important; }
html.light .bg-white\/\[0\.03\], html.light .bg-white\/5 { background: rgba(0,0,0,0.03) !important; }
html.light .grid-bg { background-image: linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px); }
html.light .aurora { opacity: 0.2; }

/* ============ Nav ============ */
#navbar.scrolled { background: rgba(10,13,18,0.7); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(255,255,255,0.05); }
html.light #navbar.scrolled { background: rgba(255,255,255,0.8); border-bottom-color: rgba(0,0,0,0.08); }
.nav-link { position: relative; padding: 4px 2px; transition: color 0.2s ease; }
.nav-link::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: linear-gradient(90deg, #22d3ee, #34d399); transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; }
.nav-link:hover { color: #fff; }
html.light .nav-link:hover { color: #0a0d12; }
.nav-link:hover::after { transform: scaleX(1); }

/* ============ Buttons ============ */
.btn-primary { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 10px; background: linear-gradient(135deg, #06b6d4 0%, #10b981 100%); color: #05070a; font-weight: 600; font-size: 14px; transition: transform 0.2s ease, box-shadow 0.2s ease; box-shadow: 0 4px 24px -8px rgba(34,211,238,0.5); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 30px -8px rgba(34,211,238,0.7); }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); color: #fff; font-size: 14px; font-weight: 500; transition: background 0.2s ease, border-color 0.2s ease; }
.btn-ghost:hover { background: rgba(255,255,255,0.04); border-color: rgba(34,211,238,0.4); }
html.light .btn-ghost { color: #0a0d12; border-color: rgba(0,0,0,0.12); }
html.light .btn-ghost:hover { background: rgba(0,0,0,0.03); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); color: #e4e4e7; transition: border-color 0.2s, background 0.2s; }
.icon-btn:hover { border-color: rgba(34,211,238,0.4); background: rgba(34,211,238,0.06); }
html.light .icon-btn { color: #0a0d12; border-color: rgba(0,0,0,0.12); }
.social-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08); color: #a1a1aa; transition: all 0.2s ease; }
.social-btn:hover { color: #22d3ee; border-color: rgba(34,211,238,0.4); transform: translateY(-2px); }

/* ============ Typography ============ */
.font-display { font-family: 'Space Grotesk', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.text-gradient { background: linear-gradient(135deg, #22d3ee 0%, #34d399 60%, #a7f3d0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.caret { display: inline-block; width: 3px; height: 0.9em; background: #22d3ee; margin-left: 4px; animation: blink 1s steps(2) infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0; } }

/* ============ Section headings ============ */
.section-label { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.02); font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.2em; color: #22d3ee; text-transform: uppercase; }
.section-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; letter-spacing: -0.02em; }

/* ============ Reveal animations ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.9, 0.2, 1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.9, 0.2, 1); }
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.in > * { opacity: 1; transform: translateY(0); }

/* ============ Cards ============ */
.service-card { position: relative; padding: 28px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.06); background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%); backdrop-filter: blur(10px); transition: border-color 0.3s ease, transform 0.3s ease; overflow: hidden; }
.service-card::before { content: ''; position: absolute; inset: -1px; border-radius: 20px; padding: 1px; background: linear-gradient(135deg, rgba(34,211,238,0.5), rgba(52,211,153,0.3)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 0.3s ease; }
.service-card:hover::before { opacity: 1; }
.service-card:hover { transform: translateY(-4px); }
.service-card .icon-wrap { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, rgba(34,211,238,0.15), rgba(52,211,153,0.1)); border: 1px solid rgba(255,255,255,0.06); display: grid; place-items: center; color: #22d3ee; transition: transform 0.3s ease; }
.service-card:hover .icon-wrap { transform: scale(1.08) rotate(-4deg); color: #34d399; }

.project-card { position: relative; border-radius: 24px; overflow: hidden; border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.02); transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.2, 1), border-color 0.3s; }
.project-card:hover { transform: translateY(-6px); border-color: rgba(34,211,238,0.3); }
.project-card .img-wrap { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.project-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s cubic-bezier(0.2, 0.9, 0.2, 1); }
.project-card:hover .img-wrap img { transform: scale(1.08); }
.project-card .img-wrap::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(5,7,10,0.95) 100%); }
.tech-chip { font-family: 'JetBrains Mono', monospace; font-size: 10px; padding: 4px 8px; border-radius: 6px; background: rgba(34,211,238,0.08); border: 1px solid rgba(34,211,238,0.18); color: #67e8f9; }

/* ============ Timeline ============ */
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(180deg, rgba(34,211,238,0.5), rgba(52,211,153,0.3), transparent); }
.timeline-item { position: relative; padding-bottom: 40px; }
.timeline-item::before { content: ''; position: absolute; left: -27px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #0a0d12; border: 2px solid #22d3ee; box-shadow: 0 0 0 4px rgba(34,211,238,0.1); }
html.light .timeline-item::before { background: #f7f8fa; }

/* ============ Contact form ============ */
.field { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 14px 16px; color: #fff; font-size: 14px; width: 100%; transition: border-color 0.2s ease, background 0.2s ease; font-family: 'Inter', sans-serif; }
.field:focus { outline: none; border-color: rgba(34,211,238,0.5); background: rgba(34,211,238,0.03); }
.field::placeholder { color: #52525b; }
html.light .field { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.1); color: #0a0d12; }
html.light .field::placeholder { color: #9ca3af; }

/* ============ Misc ============ */
::selection { background: rgba(34,211,238,0.3); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(34,211,238,0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(34,211,238,0.5); }

/* Marquee */
.marquee { display: flex; gap: 3rem; animation: marquee 30s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Logo pill */
.tool-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.02); font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #a1a1aa; white-space: nowrap; }
.tool-pill i { color: #22d3ee; }
