/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #09090b;
    --bg-surface: #0f0f13;
    --bg-card: #141419;
    --bg-card-hover: #1a1a22;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --text-dim: #52525b;
    --accent: #9333ea;
    --accent-bright: #a855f7;
    --accent-dim: rgba(147, 51, 234, 0.08);
    --accent-glow: rgba(147, 51, 234, 0.12);
    --accent-secondary: #7c3aed;
    --red: #ff0000;
    --blue: #00d4ff;
    --gradient: linear-gradient(135deg, #ff0000, #a855f7, #00d4ff);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --radius: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== Canvas ===== */
#grid-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.35; }

/* ===== Nav ===== */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 2.5rem; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.nav.scrolled { background: rgba(9, 9, 11, 0.9); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-bottom: 1px solid var(--border); padding: 0.75rem 2.5rem; }
.nav-logo { display: flex; align-items: center; gap: 0.5rem; z-index: 101; }
.logo-venn { flex-shrink: 0; }
.logo-text { font-family: var(--mono); font-size: 1rem; font-weight: 600; color: var(--text); letter-spacing: 0.05em; }
.nav-links { display: flex; gap: 2.5rem; }
.nav-links a { font-size: 0.85rem; font-weight: 400; color: var(--text-muted); transition: color 0.3s; letter-spacing: 0.02em; }
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; z-index: 101; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
.mobile-menu { display: none; position: fixed; inset: 0; background: rgba(9, 9, 11, 0.98); backdrop-filter: blur(20px); z-index: 99; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.mobile-menu.active { opacity: 1; pointer-events: all; }
.mobile-menu a { font-size: 1.5rem; font-weight: 300; color: var(--text-muted); transition: color 0.3s; }
.mobile-menu a:hover { color: var(--accent); }

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.875rem 1.75rem; border-radius: 10px; font-size: 0.875rem; font-weight: 600; font-family: var(--font); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); cursor: pointer; border: none; white-space: nowrap; }
.btn-primary { background: var(--gradient); color: #fff; }
.btn-primary:hover { box-shadow: 0 0 40px rgba(147, 51, 234, 0.4); transform: translateY(-2px); filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-hover); }
.btn-ghost:hover { border-color: var(--accent-bright); color: var(--accent-bright); background: var(--accent-dim); transform: translateY(-2px); }

/* ===== Hero ===== */
.hero { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 8rem 2.5rem 4rem; }
.hero-content { max-width: 1200px; margin: 0 auto; width: 100%; display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 4rem; }

.hero h1 { font-size: clamp(3.5rem, 7vw, 5rem); font-weight: 900; line-height: 1.1; letter-spacing: -0.04em; margin-bottom: 1rem; }
.hero-line-gradient { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.hero-typed-wrap { font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: 300; color: var(--text-muted); margin-bottom: 1.5rem; min-height: 2.5rem; }
.hero-typed-prefix { color: var(--text); font-weight: 500; }
#typed-text { color: var(--text); font-weight: 500; }
.typed-cursor { color: var(--accent); animation: blink 0.8s step-end infinite; font-weight: 300; }
@keyframes blink { 50% { opacity: 0; } }

.hero-subtitle { font-size: 1rem; color: var(--text-dim); max-width: 520px; line-height: 1.8; margin-bottom: 1.5rem; font-weight: 400; }

.hero-certs { display: flex; gap: 0.5rem; margin-bottom: 2rem; }
.cert-badge { font-family: var(--mono); font-size: 0.7rem; font-weight: 600; padding: 0.4rem 0.75rem; border: 1px solid rgba(147, 51, 234, 0.25); border-radius: 6px; color: var(--accent-bright); background: var(--accent-dim); letter-spacing: 0.1em; }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Hero Image */
.hero-image { display: flex; justify-content: center; align-items: center; position: relative; }

.image-frame { position: relative; width: 280px; height: 280px; border-radius: 50%; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; position: relative; z-index: 2; transition: all 0.5s; }
.image-frame:hover img { transform: scale(1.02); }

/* Anaglyph 3D chromatic aberration — split tint overlay */
.image-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.15) 0%, transparent 50%, rgba(0, 212, 255, 0.15) 100%);
}

.image-border { position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(from 0deg, #ff0000, #a855f7, #00d4ff, #a855f7, #ff0000); z-index: 1; animation: rotate-border 6s linear infinite; }
@keyframes rotate-border { to { transform: rotate(360deg); } }

.image-glow { position: absolute; inset: -40px; border-radius: 50%; background: radial-gradient(circle, rgba(147, 51, 234, 0.15) 0%, transparent 70%); z-index: 0; animation: glow-pulse 4s ease-in-out infinite; }
@keyframes glow-pulse { 0%, 100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 0.8; transform: scale(1.08); } }

/* Floating Stats */
.floating-stat { position: absolute; background: rgba(20, 20, 25, 0.9); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 1.25rem; display: flex; flex-direction: column; z-index: 3; animation: float 6s ease-in-out infinite; }
.floating-stat .fs-num { font-family: var(--mono); font-weight: 700; font-size: 1rem; color: var(--accent); }
.floating-stat .fs-label { font-size: 0.65rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.fs-1 { top: 10%; right: -10%; animation-delay: 0s; }
.fs-2 { bottom: 10%; left: -5%; animation-delay: 3s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Scroll Indicator */
.scroll-indicator { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.scroll-text { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-dim); }
.scroll-line { width: 1px; height: 40px; background: linear-gradient(to bottom, var(--accent), transparent); animation: scroll-down 2s ease-in-out infinite; }
@keyframes scroll-down { 0% { opacity: 0; transform: scaleY(0); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { opacity: 0; transform: scaleY(0); transform-origin: bottom; } }

/* Hero animations */
.hero-text { opacity: 0; transform: translateY(30px); animation: fade-up 0.8s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.hero-image { opacity: 0; transform: translateY(30px); animation: fade-up 0.8s 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }

/* ===== Social Proof Bar ===== */
.proof-bar { position: relative; z-index: 1; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1.25rem 0; background: var(--bg-surface); }
.clients-marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, white 8%, white 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, white 8%, white 92%, transparent); }
.marquee-track { display: flex; gap: 3rem; animation: marquee 40s linear infinite; width: max-content; }
.marquee-track span { font-size: 0.85rem; font-weight: 500; color: var(--text-dim); white-space: nowrap; letter-spacing: 0.03em; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ===== Sections ===== */
.section { position: relative; z-index: 1; padding: 8rem 0; }
.section-dark { background: var(--bg-surface); }
.section-label { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); margin-bottom: 1.5rem; letter-spacing: 0.08em; }
.section-title { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.75rem; }
.section-subtitle { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 3.5rem; font-weight: 300; max-width: 500px; }

/* ===== About ===== */
.about-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 5rem; align-items: center; }
.about-heading { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 700; line-height: 1.35; letter-spacing: -0.02em; margin-bottom: 1.5rem; }
.highlight { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.about-body { color: var(--text-muted); font-size: 1rem; line-height: 1.8; margin-bottom: 1rem; font-weight: 300; }
.about-body em { color: var(--text); font-style: italic; }

/* Terminal Card */
.terminal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.terminal-dots { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.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: #22c55e; }
.terminal-body { padding: 1.25rem 1.5rem; font-family: var(--mono); font-size: 0.8rem; line-height: 2; }
.terminal-line { color: var(--text-dim); }
.t-prompt { color: var(--accent); margin-right: 0.5rem; }
.t-output { color: var(--text-muted); padding-left: 1rem; }
.t-blink { animation: blink 1s step-end infinite; color: var(--accent); }

/* ===== Projects ===== */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

.project-card { position: relative; border-radius: var(--radius); overflow: hidden; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); background: var(--bg-card); border: 1px solid var(--border); }
.project-card:hover { transform: translateY(-6px); border-color: rgba(147, 51, 234, 0.3); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(147, 51, 234, 0.15); }

.project-card-inner { padding: 2rem; display: flex; flex-direction: column; height: 100%; position: relative; z-index: 1; }

.project-number { font-family: var(--mono); font-size: 2.5rem; font-weight: 700; color: rgba(147, 51, 234, 0.08); position: absolute; top: 1rem; right: 1.5rem; }

.project-glow { position: absolute; top: -50%; right: -50%; width: 200%; height: 200%; background: radial-gradient(circle at center, rgba(147, 51, 234, 0.04) 0%, transparent 50%); pointer-events: none; }

.project-featured { grid-column: span 2; }
.project-featured .project-card-inner { padding: 2.5rem; }

.project-tag { font-family: var(--mono); font-size: 0.65rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.75rem; }
.project-card h3 { font-size: 1.375rem; font-weight: 700; margin-bottom: 0.75rem; letter-spacing: -0.01em; }
.project-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; flex: 1; font-weight: 300; }
.project-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.meta-pill { font-size: 0.65rem; padding: 0.3rem 0.75rem; border-radius: 100px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); color: var(--text-dim); font-weight: 500; letter-spacing: 0.03em; }
.project-link { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.25rem; font-size: 0.85rem; color: var(--accent); font-weight: 500; transition: gap 0.3s; }
.project-card:hover .project-link { gap: 0.7rem; }

/* ===== Contact ===== */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.contact-heading { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1rem; line-height: 1.2; }
.contact-body { color: var(--text-muted); font-size: 1rem; line-height: 1.8; font-weight: 300; }
.contact-right { display: flex; flex-direction: column; gap: 1rem; }

.contact-card { display: flex; align-items: center; gap: 1.25rem; padding: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.contact-card:hover { border-color: rgba(147, 51, 234, 0.3); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(147, 51, 234, 0.1); }
.cc-icon { flex-shrink: 0; }
.cc-venn { display: block; }
.cc-label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; display: block; }
.cc-value { font-size: 0.95rem; font-weight: 500; color: var(--text); display: block; margin-top: 0.15rem; }

/* ===== Footer ===== */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 1.5rem 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-dim); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { transition: color 0.3s; }
.footer-links a:hover { color: var(--accent); }

/* ===== Animations ===== */
[data-animate] { opacity: 0; transform: translateY(28px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
[data-animate].visible { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hero-content { grid-template-columns: 1fr; text-align: center; gap: 3rem; }
    .hero-image { order: -1; }
    .hero-subtitle { margin: 0 auto 1.5rem; }
    .hero-actions { justify-content: center; }
    .hero-certs { justify-content: center; }
    .image-frame { width: 220px; height: 220px; }
    .floating-stat { display: none; }
    .about-layout { grid-template-columns: 1fr; gap: 3rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-featured { grid-column: span 1; }
    .contact-layout { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    .mobile-menu { display: flex; }
    .hero { padding: 7rem 1.5rem 3rem; }
    .section { padding: 5rem 0; }
    .container { padding: 0 1.5rem; }
    .nav, .nav.scrolled { padding-left: 1.5rem; padding-right: 1.5rem; }
    .image-frame { width: 180px; height: 180px; }
    .hero h1 { font-size: 2.75rem; }
    .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
    .footer-links { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; align-items: stretch; }
    .btn { justify-content: center; }
}
