/* ==========================================================================
   CSS Variables & Design Tokens (Modern Architectural Minimalist)
   ========================================================================== */
:root {
    /* Color Palette: Sophisticated grays, muted blues, clean whitespace */
    --color-bg: #f8f9fa; /* Off-white for background */
    --color-surface: #ffffff; /* Pure white for surface containers */
    --color-text-main: #2c3e50; /* Deep muted blue-gray for primary text */
    --color-text-muted: #64748b; /* Lighter cool gray for secondary text */
    --color-accent: #3b82f6; /* Subtle muted blue for interactive elements */
    --color-border: #e2e8f0; /* Light border gray */
    
    /* Typography: Modern, clean sans-serif paired with elegant serif */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-secondary: 'Playfair Display', serif;
    
    /* Layout & Spacing */
    --container-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
    
    /* Transitions & Shadows */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-soft: 0 10px 30px -10px rgba(44, 62, 80, 0.08);
    --shadow-hover: 0 20px 40px -10px rgba(44, 62, 80, 0.12);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--color-text-main);
    background-color: var(--color-bg);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section-padding {
    padding: var(--spacing-xl) 0;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text-main);
}

.eyebrow {
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: var(--spacing-sm);
}

.lead {
    font-size: 1.25rem;
    color: var(--color-text-main);
    line-height: 1.8;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 4px; /* Minimalist slight radius */
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--color-text-main);
    color: var(--color-bg);
}

.btn-primary:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--color-text-main);
    color: var(--color-text-main);
}

.btn-outline:hover {
    background-color: var(--color-text-main);
    color: var(--color-bg);
}

/* Cards (Glassmorphism / Minimal surface hints) */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: var(--spacing-md);
    border-radius: 8px;
    transition: var(--transition-smooth);
    will-change: transform;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(59, 130, 246, 0.2); /* very subtle blue hint */
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: var(--spacing-md) 0;
    transition: var(--transition-smooth);
    background: transparent;
}

.nav.scrolled {
    background: rgba(248, 249, 250, 0.9);
    backdrop-filter: blur(12px);
    padding: var(--spacing-sm) 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    position: relative;
    z-index: 101;
}

.nav-links {
    display: none; /* Mobile first */
}

/* Hamburger Menu (Mobile) */
.hamburger {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
    width: 30px;
    height: 20px;
    position: relative;
}

.hamburger span {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--color-text-main);
    left: 0;
    transition: var(--transition-smooth);
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger span:nth-child(3) { bottom: 0; }

.hamburger.active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-bg);
    z-index: 99;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-links {
    text-align: center;
}

.mobile-links li {
    margin: var(--spacing-md) 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.mobile-menu.active .mobile-links li {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.active .mobile-links li:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-links li:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-links li:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu.active .mobile-links li:nth-child(4) { transition-delay: 0.4s; }

.mobile-links a {
    font-family: var(--font-secondary);
    font-size: 2rem;
    color: var(--color-text-main);
}

/* ==========================================================================
   Hero Section & Canvas
   ========================================================================== */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none; /* Canvas reacts to mouse via document events */
}

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 var(--spacing-md);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 10;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 7rem);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

.top-link {
    cursor: pointer;
    display: inline-block;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--color-text-muted);
    max-width: 500px;
    margin-bottom: var(--spacing-md);
}

.scroll-indicator {
    position: absolute;
    bottom: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    opacity: 0.6;
}

.scroll-indicator span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.scroll-indicator .line {
    width: 1px;
    height: 40px;
    background: var(--color-text-main);
    animation: scrollLine 2s infinite cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top;
}

@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    50.1% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ==========================================================================
   Section Headers (Architectural Grid Style)
   ========================================================================== */
.section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.section-header h2 {
    font-size: 2rem;
    white-space: nowrap;
}

.header-line {
    flex-grow: 1;
    height: 1px;
    background-color: var(--color-border);
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.about-text p {
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-muted);
}

.about-text p.lead {
    color: var(--color-text-main);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: var(--spacing-md);
    text-align: center;
    border-radius: 8px;
}

.stat-number {
    display: block;
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Skills Section
   ========================================================================== */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.skill-category h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-xs);
}

.skill-list li {
    padding: var(--spacing-xs) 0;
    color: var(--color-text-muted);
    position: relative;
    padding-left: 1.5rem;
}

.skill-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--color-accent);
    border-radius: 50%;
    opacity: 0.5;
}

/* ==========================================================================
   Experience Timeline (Architectural layout)
   ========================================================================== */
.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 1px;
    background-color: var(--color-border);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: var(--spacing-lg);
}

.timeline-dot {
    position: absolute;
    top: 24px;
    left: 14px;
    width: 12px;
    height: 12px;
    background-color: var(--color-bg);
    border: 2px solid var(--color-text-main);
    border-radius: 50%;
    box-shadow: 0 0 0 6px var(--color-bg);
}

.timeline-header {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--spacing-sm);
}

.timeline-header h3 {
    font-size: 1.35rem;
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--color-accent);
    font-family: var(--font-secondary);
    font-style: italic;
    margin-top: 4px;
}

.role-highlights {
    list-style-type: none;
}

.role-highlights li {
    margin-bottom: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    position: relative;
    padding-left: 1.2rem;
}

.role-highlights li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--color-border);
}

.role-highlights strong {
    color: var(--color-text-main);
    font-weight: 600;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.footer-title {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: var(--spacing-sm);
}

.mt-4 {
    margin-top: var(--spacing-md);
}

.footer-bottom {
    margin-top: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.social-links {
    display: flex;
    gap: var(--spacing-sm);
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.social-links a:hover {
    background-color: var(--color-text-main);
    color: var(--color-bg);
    border-color: var(--color-text-main);
}

/* ==========================================================================
   Media Queries (Desktop First / Scaling Up)
   ========================================================================== */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
        gap: var(--spacing-md);
    }
    
    .nav-links a {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--color-text-muted);
    }
    
    .nav-links a:hover {
        color: var(--color-text-main);
    }
    
    .hamburger {
        display: none;
    }
    
    .about-grid {
        grid-template-columns: 3fr 2fr;
        gap: var(--spacing-lg);
        align-items: start;
    }

    .about-stats {
        margin-top: 0;
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .timeline-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}
