:root {
    /* Theme Tokens - Light Mode (Limestone & Slate) */
    --bg-color: #fcfbf7; /* Warm Limestone */
    --text-color: #1a1c1e; /* Heavy Slate */
    --text-muted: #4a545e;
    --accent-primary: #0055ff; /* Electric Azure */
    --accent-secondary: #d4af37; /* Muted Gold */
    --surface-color: #ffffff;
    --border-color: rgba(26, 28, 30, 0.06);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --noise-opacity: 0.03;
    
    /* Layout & Variables */
    --transition-cinematic: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --radius-premium: 32px;
    --container-max: 1400px;
}

[data-theme='dark'] {
    /* Theme Tokens - Dark Mode (Obsidian & Azure) */
    --bg-color: #050505; /* Deep Obsidian */
    --text-color: #f0f2f5; /* Soft Slate White */
    --text-muted: rgba(240, 242, 245, 0.5);
    --accent-primary: #3388ff;
    --accent-secondary: #e6c253;
    --surface-color: #0d0d0d;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(13, 13, 13, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --noise-opacity: 0.05;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.8s ease, color 0.8s ease;
    -webkit-font-smoothing: antialiased;
}

/* Texture Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: var(--noise-opacity);
    pointer-events: none;
    z-index: 9999;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 4rem;
}

@media (max-width: 768px) {
    .container { padding: 0 1.5rem; }
}

/* Typography Refinement */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.highlight {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition-smooth);
}

.navbar.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    text-transform: lowercase;
}

.logo span { color: var(--accent-primary); }

.nav-links {
    display: flex;
    gap: 4rem;
    list-style: none;
    align-items: center;
}

.nav-links a.btn-primary {
    color: var(--bg-color) !important;
    background: var(--text-color);
    padding: 0.8rem 2rem;
    border-radius: 100px;
    opacity: 1;
    font-size: 0.9rem;
    font-weight: 700;
    transition: var(--transition-smooth);
    display: inline-block;
    text-align: center;
}

.nav-links a.btn-primary:hover {
    background: transparent;
    color: var(--text-color) !important;
    border: 1px solid var(--text-color);
    transform: translateY(-3px);
}

[data-theme='dark'] .nav-links a.btn-primary {
    background: var(--text-color);
    color: var(--bg-color) !important;
}

[data-theme='dark'] .nav-links a.btn-primary:hover {
    background: transparent;
    color: var(--text-color) !important;
    border-color: var(--text-color);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 10000; /* Force above everything */
}

.menu-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: var(--text-color);
    border-radius: 5px;
    transition: var(--transition-smooth);
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Buttons */
.btn-primary {
    background: var(--text-color);
    color: var(--bg-color);
    padding: 1.25rem 3rem;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition-cinematic);
    display: inline-block;
    border: 1px solid transparent;
}

.btn-primary:hover {
    background: transparent;
    color: var(--text-color);
    border-color: var(--text-color);
    transform: translateY(-5px);
}

.btn-outline {
    background: transparent;
    color: var(--text-color);
    padding: 1.25rem 3rem;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition-cinematic);
    display: inline-block;
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--border-color);
    transform: translateY(-5px);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-top: 100px;
}

.hero-content {
    max-width: 1000px;
}

.tagline {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--accent-primary);
    margin-bottom: 2rem;
    display: block;
}

.hero h1 {
    font-size: clamp(3.5rem, 8vw, 7rem);
    margin-bottom: 2rem;
}

.hero-desc {
    font-size: 1.5rem;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 4rem;
    line-height: 1.4;
}

.hero-btns {
    display: flex;
    gap: 2rem;
}

/* About Section */
.about {
    padding: 15vw 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 8rem;
    align-items: center;
}

.about-visual {
    position: relative;
    height: 600px;
    background: var(--surface-color);
    border-radius: var(--radius-premium);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.visual-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, var(--accent-primary) 0%, transparent 70%);
    opacity: 0.05;
}

.about-content h2 {
    font-size: 4rem;
    margin-bottom: 2.5rem;
}

.about-content p {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
}

.stat-item h3 {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-item p {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    font-weight: 700;
}

/* Projects Grid (Bento) */
.projects {
    padding: 10vw 0;
}

.projects-header {
    margin-bottom: 6rem;
    text-align: center;
}

.projects-header h2 { font-size: 4rem; }

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(300px, auto);
    gap: 2rem;
}

.project-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-premium);
    padding: 3rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-cinematic);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
}

.card-large { grid-column: span 2; grid-row: span 2; }
.card-wide { grid-column: span 2; }

.project-card h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 300px;
}

.project-category {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    display: block;
}

/* Footer */
.footer {
    padding: 15vw 0 5vw;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 8rem;
    margin-bottom: 8vw;
}

.footer-hero h2 {
    font-size: 5rem;
    margin-bottom: 3rem;
}

.footer-links h4 {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
    opacity: 0.5;
}

.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 1rem; }
.footer-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.footer-links a:hover { color: var(--accent-primary); }

.social-icons li {
    margin-bottom: 1.5rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
}

.social-icons i {
    font-size: 1.5rem;
    color: var(--accent-primary);
    transition: var(--transition-smooth);
}

.social-icons a:hover i {
    transform: scale(1.2);
    color: var(--accent-secondary);
}

.footer-bottom {
    padding-top: 4rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.5;
}

/* Global Reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: var(--transition-cinematic);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsiveness */
@media (max-width: 1200px) {
    .container { padding: 0 2rem; }
    .about-grid { gap: 4rem; }
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; gap: 4rem; text-align: center; }
    .footer-main { grid-template-columns: 1fr; gap: 4rem; }
    
    .menu-toggle { 
        display: flex; 
        position: absolute;
        right: 2rem;
        top: 2rem;
    }
    
    .nav-links { 
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        background: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        transition: right 0.4s ease-in-out;
        z-index: 1000;
        margin: 0;
        padding: 0;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .nav-links a.btn-primary {
        width: 80%;
        max-width: 300px;
        margin: 0 auto;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
    
    .hero h1 { font-size: 3.5rem; }
    .footer-hero h2 { font-size: 2.8rem; }
}

@media (max-width: 600px) {
    .nav-container { padding: 0 1.5rem; }
    .hero h1 { font-size: 2.8rem; }
    .hero-desc { font-size: 1.1rem; }
    .hero-btns { flex-direction: column; width: 100%; }
    .btn-primary, .btn-outline { width: 100%; text-align: center; }
    .bento-grid { grid-template-columns: 1fr; }
    .card-large, .card-wide { grid-column: span 1; grid-row: span 1; }
    .stat-num { font-size: 2.5rem; }
    .footer-bottom { flex-direction: column; gap: 2rem; text-align: center; }
}
