:root {
    --primary: #00f2ff;
    --primary-dim: rgba(0, 242, 255, 0.1);
    --bg: #0b0e14;
    --bg-alt: #13171f;
    --fg: #ffffff;
    --text-muted: #8a99af;
    --border: rgba(255, 255, 255, 0.07);
    --glass-bg: rgba(11, 14, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: #050a10;
    --shadow: rgba(0, 0, 0, 0.5);
    
    --radius: 12px;
    --font-heading: 'Unbounded', sans-serif;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

body.light-theme {
    --primary: #007aff;
    --primary-dim: rgba(0, 122, 255, 0.1);
    --bg: #f2f2f7;
    --bg-alt: #ffffff;
    --fg: #1c1c1e;
    --text-muted: #8e8e93;
    --border: rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(242, 242, 247, 0.85);
    --glass-border: rgba(0, 0, 0, 0.05);
    --card-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.03);
}

/* --- RESET --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); font-family: var(--font-main); font-size: 16px; scroll-behavior: smooth; }
body { 
    overflow-x: hidden; 
    background-color: var(--bg);
    background-image: 
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 50px 50px;
    transition: background 0.3s, color 0.3s;
}

#canvas-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    z-index: 0; pointer-events: none; opacity: 0.15;
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 6vw; }
.section-padding { padding: 14vh 0; }

/* --- NAVIGATION --- */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem 6vw; position: fixed; top: 0; left: 0; width: 100%;
    z-index: 1000; backdrop-filter: blur(30px); background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
}
.nav-logo { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 800; text-decoration: none; color: var(--fg); }
.nav-logo span { color: var(--primary); }
.nav-links { display: flex; gap: 3rem; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 0.75rem; font-weight: 800; transition: 0.4s; letter-spacing: 2px; text-transform: uppercase; }
.nav-links a:hover { color: var(--primary); }
.nav-cta { color: var(--primary) !important; border: 1px solid var(--primary); padding: 0.6rem 1.4rem; border-radius: 8px; font-size: 0.75rem; background: transparent; }
.nav-cta:hover { background: var(--primary-dim); }

.controls { display: flex; gap: 1rem; align-items: center; border-left: 1px solid var(--glass-border); padding-left: 1.5rem; margin-left: 0.5rem; }
.control-btn { 
    background: transparent; border: 1px solid var(--glass-border); color: var(--fg); 
    width: 40px; height: 40px; border-radius: 8px; cursor: pointer; display: flex; 
    align-items: center; justify-content: center; transition: 0.3s; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 800;
}
.control-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }

#theme-toggle .sun { display: none; }
body.light-theme #theme-toggle .sun { display: block; }
body.light-theme #theme-toggle .moon { display: none; }

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    margin-left: 1.5rem;
}
.menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--fg);
    transition: 0.3s;
    border-radius: 2px;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); background-color: var(--primary); }
.menu-toggle.active span:nth-child(2) { transform: translateY(-8px) rotate(-45deg); background-color: var(--primary); }

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 14, 20, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: 0.4s;
}
.mobile-overlay.active { opacity: 1; visibility: visible; }

/* --- HERO --- */
.hero { min-height: 100vh; display: flex; align-items: center; position: relative; z-index: 1; padding-top: 100px; }
.hero-layout { display: flex; width: 100%; justify-content: flex-start; }
.hero-content { position: relative; z-index: 2; width: 100%; max-width: 850px; text-align: left; }
.hero-tag { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 4px; color: var(--primary); font-weight: 600; display: block; margin-bottom: 1.5rem; text-transform: uppercase; opacity: 0.8; }
.hero-title { font-family: var(--font-heading); font-size: clamp(2.5rem, 8vw, 5rem); line-height: 0.95; font-weight: 900; letter-spacing: -3px; }
.hero-title span { color: var(--primary); }
.hero-name { font-size: clamp(1rem, 2.5vw, 1.8rem); font-weight: 700; margin-top: 1.5rem; color: var(--text-muted); font-family: var(--font-heading); letter-spacing: -1px; }
.hero-lead { font-size: 1.15rem; color: var(--text-muted); max-width: 650px; margin: 2.5rem 0; line-height: 1.7; }
.hero-btns { display: flex; gap: 1.5rem; }

.btn { padding: 1.2rem 2.8rem; border-radius: 10px; text-decoration: none; font-weight: 800; font-size: 0.85rem; transition: 0.4s; border: 1px solid transparent; text-transform: uppercase; letter-spacing: 1px; }
.btn-primary { background: var(--primary); color: var(--bg); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 40px var(--primary-dim); }
.btn-secondary { color: var(--fg); background: var(--border); border: 1px solid var(--glass-border); }
.btn-secondary:hover { background: var(--glass-border); border-color: var(--primary); }

/* --- SECTIONS --- */
.section-header { margin-bottom: 6rem; }
.sub-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 3px; color: var(--primary); font-weight: 600; display: block; margin-bottom: 1rem; text-transform: uppercase; }
.section-title { font-family: var(--font-heading); font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.05; font-weight: 900; letter-spacing: -2px; }

/* --- ABOUT --- */
.about-text p { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 2rem; line-height: 1.8; }
.about-text b, .about-text strong { color: var(--fg); font-weight: 700; }
.personal-matrix { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.q-tag { padding: 0.7rem 1.4rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; font-size: 0.75rem; color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }

/* --- SKILLS --- */
.skills-matrix { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 2rem; 
}
.skill-group { 
    background: var(--bg-alt); 
    padding: 3rem; 
    border-radius: 24px; 
    border: 1px solid var(--border); 
    transition: 0.5s; 
}
.skill-group:hover { 
    border-color: var(--primary); 
    box-shadow: 0 20px 60px var(--shadow); 
}
.group-title { 
    font-family: var(--font-heading); 
    font-size: 0.9rem; 
    margin-bottom: 2rem; 
    color: var(--primary); 
    letter-spacing: 2px; 
    text-transform: uppercase; 
}
.skill-badges { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 0.8rem; 
}
.skill-badges span { 
    padding: 0.6rem 1.2rem; 
    background: var(--border); 
    border: 1px solid var(--glass-border); 
    border-radius: 10px; 
    font-size: 0.8rem; 
    color: var(--fg); 
    font-weight: 600; 
}

/* --- PROJECTS --- */
.projects-list { display: flex; flex-direction: column; gap: 12rem; }
.project-card { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8vw; align-items: start; }
.project-card.reverse { direction: rtl; }
.project-card.reverse .p-info { direction: ltr; }
.p-title { font-family: var(--font-heading); font-size: 2.5rem; margin-bottom: 1.5rem; letter-spacing: -1.5px; }
.p-desc { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; line-height: 1.7; }
.p-tech-spec { font-family: var(--font-mono); font-size: 0.8rem; color: var(--primary); margin-bottom: 2rem; padding: 1.2rem; background: rgba(0,242,255,0.04); border-radius: 15px; border: 1px solid var(--border); line-height: 1.6; }
.p-tags { display: flex; gap: 0.8rem; margin-bottom: 3rem; }
.p-tags span { padding: 0.6rem 1.2rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; font-size: 0.75rem; color: var(--fg); font-weight: 800; text-transform: uppercase; }
.p-link { color: var(--fg); text-decoration: none; border-bottom: 2px solid var(--primary); font-weight: 800; font-size: 1rem; transition: 0.4s; display: inline-block; padding-bottom: 4px; }
.p-link:hover { padding-left: 10px; color: var(--primary); }

.p-visual { 
    width: 100%; height: 420px; border-radius: 30px; 
    background: #000; border: 1px solid var(--border); overflow: hidden; position: relative;
    padding: 12px; box-shadow: 0 40px 80px rgba(0,0,0,0.6);
}
.p-visual img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; transition: 1s ease; opacity: 0.8; }
.p-visual:hover img { transform: scale(1.03); opacity: 1; }

/* --- FLOATING REFERENCE CONTACT CARD --- */
.contact-floating-card {
    margin: 4rem auto; max-width: 1100px;
    border-radius: 30px; overflow: hidden;
    box-shadow: 0 50px 150px var(--shadow);
    border: 1px solid var(--glass-border);
}

.card-upper {
    background: var(--glass-border); padding: 80px 40px; text-align: center;
    color: var(--fg); border-bottom: 1px solid var(--glass-border);
    position: relative;
}
.card-upper::after {
    content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
    width: 200px; height: 1px; background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.card-hero-title { font-family: var(--font-heading); font-size: 3.5rem; letter-spacing: 2px; margin-bottom: 1.5rem; font-style: italic; font-weight: 300; color: var(--primary); }
.card-subtitle { font-size: 1.1rem; color: rgba(255,255,255,0.6); max-width: 700px; margin: 0 auto; line-height: 1.6; }

.card-lower {
    background: var(--card-bg); padding: 60px 40px 80px;
}
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

.contact-mini-card {
    text-decoration: none; background: var(--border);
    border: 1px solid var(--glass-border); border-radius: 20px;
    padding: 40px 30px; text-align: center; transition: 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    position: relative; overflow: hidden;
}
.mini-icon { 
    font-size: 2.5rem; margin-bottom: 20px; 
    transition: 0.3s;
    color: var(--text-muted);
}
.mini-label { font-family: var(--font-mono); font-size: 0.8rem; color: var(--fg); opacity: 0.4; margin-bottom: 8px; letter-spacing: 2px; }
.mini-value { 
    font-size: 1.1rem; color: var(--primary); font-weight: 700; margin-bottom: 15px; 
    word-break: break-all; transition: 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.mini-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; transition: 0.3s; }

/* Contact Card Hover Improvements */
.contact-mini-card:hover {
    background: var(--glass-border); transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 60px var(--primary-dim);
}
.contact-mini-card:hover .mini-icon { transform: scale(1.1) rotate(5deg); color: var(--primary); }
.contact-mini-card:hover .mini-value { text-decoration: underline; color: var(--fg); }
.contact-mini-card:hover .mini-desc { color: var(--fg); }

@media (max-width: 1000px) {
    .contact-grid { grid-template-columns: 1fr; }
    .card-hero-title { font-size: 2.5rem; }
}

/* --- FOOTER --- */
.footer { padding: 100px 0; border-top: 1px solid var(--border); margin-top: 15vh; text-align: center; }
.footer p { color: var(--text-muted); font-size: 0.8rem; letter-spacing: 2px; font-weight: 700; text-transform: uppercase; }
.footer a { color: var(--primary); text-decoration: none; margin-left: 15px; }

@media (max-width: 1200px) {
    .skills-matrix { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    html { font-size: 14px; }
    .container { padding: 0 6vw; }
    .section-padding { padding: 10vh 0; }
    .section-header { margin-bottom: 3.5rem; }

    .navbar { padding: 1rem 6vw; }
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--bg-alt);
        flex-direction: column;
        justify-content: center;
        gap: 2.5rem;
        transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        border-left: 1px solid var(--border);
        padding: 2rem;
    }
    .nav-links.active { right: 0; }
    .menu-toggle { display: flex; }
    
    .nav-links a { font-size: 1.2rem; }
    .controls { border: none; padding: 0; margin-right: 0; }

    .hero { text-align: center; padding-top: 120px; }
    .hero-layout { justify-content: center; }
    .hero-content { max-width: 100%; }
    .hero-title { font-size: 12vw; letter-spacing: -2px; }
    .hero-lead { font-size: 1rem; margin: 2rem 0; }
    .hero-btns { flex-direction: column; gap: 1rem; width: 100%; }
    .btn { width: 100%; text-align: center; padding: 1rem; }

    .about-text p { font-size: 1rem; }
    .skills-matrix { grid-template-columns: 1fr; gap: 1.5rem; }
    .skill-group { padding: 2rem; }

    .p-title { font-size: 2rem; }
    .p-desc { font-size: 1rem; }
    .project-card { grid-template-columns: 1fr; gap: 3rem; }
    .project-card.reverse { direction: ltr; }
    .p-visual { height: 300px; border-radius: 20px; }
    .projects-list { gap: 6rem; }

    .card-hero-title { font-size: 2.2rem; margin-bottom: 1rem; letter-spacing: 0; word-break: break-word; }
    .card-subtitle { font-size: 0.95rem; }
    .card-upper { padding: 40px 20px; }
    .card-lower { padding: 30px 20px; }
    .contact-mini-card { padding: 30px 20px; }
}
