@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
    --background-rgb: 5, 5, 5;
    --background: rgb(var(--background-rgb));
    --surface: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.06);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --accent-color: #3D7EFF;
    --accent-hover: #6494FF;
    --accent-dim: rgba(61, 126, 255, 0.12);
    --shadow-accent: rgba(61, 126, 255, 0.2);
    --glass-blur: blur(16px);
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-base: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    --background-rgb: 248, 250, 252;
    --background: rgb(var(--background-rgb));
    --surface: #ffffff;
    --card-bg: rgba(0, 0, 0, 0.02);
    --card-hover: rgba(0, 0, 0, 0.05);
    --border: rgba(0, 0, 0, 0.06);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-color: #2563EB;
    --accent-hover: #1D55D4;
    --accent-dim: rgba(37, 99, 235, 0.08);
    --shadow-accent: rgba(37, 99, 235, 0.15);
}

/* --- Foundation --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: 'Outfit', 'Prompt', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

h1, h2, h3, h4 {
    letter-spacing: -0.03em;
}

section > .container > h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 8px;
}

section {
    padding: 120px 0;
    position: relative;
    opacity: 1;
}


/* --- Floating Navbar --- */
.full-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 24px 0;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), padding 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-container {
    max-width: 1300px;
    width: 90%;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    background: transparent;
    border-radius: 24px;
    transition: background 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.full-nav.scrolled {
    padding: 16px 0;
}

.full-nav.scrolled .nav-container {
    background: rgba(var(--background-rgb), 0.7);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    cursor: default;
}

.nav-links {
    display: flex;
    gap: 4px;
    background: var(--card-bg);
    padding: 4px;
    border-radius: 99px;
    border: 1px solid var(--border);
}

.nav-item {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 20px;
    border-radius: 99px;
    opacity: 0.5;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    background: var(--text-primary);
    color: var(--background);
    opacity: 1;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#theme-toggle, #menu-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* display:none must follow the shared rule to win the cascade */
#menu-toggle { display: none; }
.mobile-only { display: none; }

#theme-toggle:hover {
    background: var(--card-hover);
    transform: rotate(45deg);
}

/* --- Mobile Menu Overlay --- */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(var(--background-rgb), 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 40px;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.mobile-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.mobile-nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 80px;
}

.mobile-logo { font-size: 2.5rem; font-weight: 900; }

#menu-close {
    background: var(--card-bg);
    border: 1px solid var(--border);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav-item {
    font-size: 3.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-primary);
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
    transition-delay: calc(var(--i) * 0.06s);
}

.mobile-overlay.is-open .mobile-nav-item {
    opacity: 1;
    transform: translateX(0);
}

.mobile-nav-item:hover, .mobile-nav-item.active {
    color: var(--accent-color);
}

.mobile-nav-footer { margin-top: auto; padding-top: 40px; border-top: 1px solid var(--border); }

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: clamp(3rem, 12vw, 9rem);
    line-height: 0.9;
    font-weight: 900;
    margin-bottom: 32px;
}

.highlight {
    color: var(--accent-color);
    padding-right: 0.05em;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.4rem);
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 56px;
    font-weight: 400;
}

/* --- Buttons --- */
.cta-buttons { display: flex; gap: 20px; justify-content: center; }

.btn {
    padding: 18px 40px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn.primary, .gradient-button {
    background: var(--accent-color);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px var(--shadow-accent);
}

.btn.primary:hover, .gradient-button:hover {
    background: var(--accent-hover);
    box-shadow: 0 8px 24px var(--shadow-accent);
}

.btn.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn.secondary:hover {
    background: var(--card-bg);
    border-color: var(--text-muted);
}

/* --- Glass Card System --- */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px;
    transition: background 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    background: var(--card-hover);
    border-color: var(--text-muted);
}

/* --- Bento Grid --- */
.bento-complex {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 280px;
    gap: 24px;
}

.bento { display: flex; flex-direction: column; justify-content: flex-end; }
.bento-icon { width: 44px; height: 44px; margin-bottom: 24px; color: var(--accent-color); stroke-width: 1.5; transition: color 0.3s ease, transform 0.3s ease; }
.span-2-col { grid-column: span 2; }
.span-row-2 { grid-row: span 2; }
.align-center { align-items: center; text-align: center; justify-content: center; }

.tech-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.tag {
    padding: 4px 10px;
    background: var(--accent-dim);
    border: 1px solid rgba(61, 126, 255, 0.2);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-color);
}

/* --- Project Grid --- */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
    gap: 24px;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.project-card:hover {
    border-color: var(--text-muted);
}

.project-card h3 { font-size: 1.8rem; margin-bottom: 12px; }
.project-card p { color: var(--text-secondary); font-size: 1.1rem; }

.masonry-img {
    width: 100%;
    border-radius: 20px;
    margin-top: 24px;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}


/* --- Performance Section --- */
.typo-hero { text-align: center; margin-bottom: 80px; }
.massive-text {
    font-size: clamp(8rem, 25vw, 18rem);
    font-weight: 900;
    line-height: 0.8;
    color: var(--text-primary);
    opacity: 0.07;
}

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.feature-item { text-align: center; padding: 40px; }
.feature-icon { width: 48px; height: 48px; margin-bottom: 28px; color: var(--accent-color); }
.feature-item h4 { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; }

/* --- Modal Stylings --- */
.project-modal {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 3000;
    display: flex;
    visibility: hidden;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.project-modal.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.project-modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 32px;
    max-width: 1100px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    transform: translateY(24px) scale(0.98);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-modal.is-open .project-modal-box {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: fixed;
    top: 30px;
    right: 30px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4000;
    transition: background 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
    background: var(--accent-color);
    transform: rotate(90deg);
}

.image-zoom-modal { cursor: zoom-out; }

.zoom-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.modal-img-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-img-container img {
    height: 300px;
    border-radius: 16px;
    cursor: zoom-in;
}

.modal-content { padding: 40px; }
.modal-content h3 { font-size: 2.5rem; margin-bottom: 20px; font-weight: 800; }
.modal-content p { font-size: 1.1rem; line-height: 1.7; margin-bottom: 30px; color: var(--text-secondary); }

/* --- Lang Toggle --- */
.lang-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 99px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lang-toggle .active-lang { color: var(--accent-color); }

/* --- Responsive & Mobile Optimizations --- */
@media (max-width: 1024px) {
    .container { padding: 0 30px; }
    .bento-complex { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: 1fr; }
    .masonry-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    section { padding: 80px 0; }
    .hero h1 { font-size: 4.5rem; }
    .subtitle { font-size: 1.1rem; }
    .cta-buttons { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
    
    .logo { font-size: 1.2rem; }
    .nav-links { display: none; }
    #menu-toggle { display: flex; }
    .mobile-only { display: flex; }
    
    .bento-complex { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .span-2-col, .span-row-2 { grid-column: auto; grid-row: auto; }
    .glass-card { padding: 32px; border-radius: 16px; }
    
    .massive-text { font-size: 7rem; }
    
    .modal-content { padding: 40px 24px; }
}


/* --- Focus Indicators --- */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 4px;
}

:focus:not(:focus-visible) { outline: none; }

/* --- Utility --- */
.hidden { display: none; }

/* --- Scroll Progress Navigation --- */
.scroll-progress {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    position: relative;
}

.dot::before {
    content: '';
    position: absolute;
    inset: -18px;
}

.dot.active {
    background: var(--text-primary);
    transform: scale(1.5);
}

/* --- Footer --- */
.site-footer {
    padding: 48px 0;
    border-top: 1px solid var(--border);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* --- Undeclared classes resolved --- */
.typo-sub {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    margin-top: 24px;
}

.massive-text-suffix {
    font-size: 0.5em;
    vertical-align: super;
}

.masonry-img--sized {
    height: 220px;
}

.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.modal-website-btn {
    margin-top: 8px;
}

.mobile-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-socials {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.mobile-socials a {
    color: var(--text-muted);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.mobile-socials a:hover {
    color: var(--text-primary);
}

/* --- Motion Preferences --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* --- Motion-safe section reveal --- */
.js-reveal-pending {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Scrollbar Customization --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Hero Entrance Choreography --- */
@keyframes heroIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

#home h1 {
    animation: heroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#home .subtitle {
    animation: heroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

#home .cta-buttons {
    animation: heroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both;
}

/* --- Scroll Mouse Indicator --- */
.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.mouse {
    width: 22px;
    height: 36px;
    border: 2px solid var(--text-muted);
    border-radius: 11px;
    display: flex;
    justify-content: center;
    padding-top: 5px;
}

@keyframes scrollWheel {
    0%   { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(10px); }
}

.wheel {
    width: 3px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 2px;
    animation: scrollWheel 1.6s ease-in infinite;
}

/* --- About Section Layout --- */
.split-pane {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 48px;
    align-items: start;
}

.split-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.split-content p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.split-visual {
    min-height: 240px;
}

.about-icon {
    width: 64px;
    height: 64px;
    color: var(--accent-color);
    stroke-width: 1;
    margin-bottom: 16px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-role {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stat-row {
    display: flex;
    gap: 48px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 500;
}

/* --- Interaction Feedback --- */
.btn:active {
    transform: scale(0.97);
    transition-duration: 0.08s;
}

.tag {
    transition: background 0.2s ease, border-color 0.2s ease;
    cursor: default;
}

.dot:not(.active):hover {
    background: var(--text-secondary);
    transform: scale(1.25);
}

/* --- Touch-safe hover transforms --- */
@media (hover: hover) {
    .btn.primary:hover, .gradient-button:hover {
        transform: translateY(-2px);
    }

    .btn.secondary:hover {
        transform: translateY(-2px);
    }

    .project-card:hover {
        transform: translateY(-2px);
    }

    .project-card:hover .masonry-img {
        transform: scale(1.05);
    }

    .glass-card:hover .bento-icon {
        color: var(--accent-hover);
        transform: translateY(-3px);
    }

    .split-visual:hover .about-icon {
        transform: scale(1.08) rotate(5deg);
    }

    .tag:hover {
        background: rgba(61, 126, 255, 0.2);
        border-color: rgba(61, 126, 255, 0.4);
    }
}

/* --- Responsive About --- */
@media (max-width: 768px) {
    .split-pane {
        grid-template-columns: 1fr;
    }
    .stat-row {
        gap: 32px;
    }
}
