/* ===== CSS Variables - Black/White/Gray Only ===== */
:root {
    --color-black: #000000;
    --color-dark: #0a0a0a;
    --color-gray-900: #111111;
    --color-gray-800: #1a1a1a;
    --color-gray-700: #2a2a2a;
    --color-gray-600: #3a3a3a;
    --color-gray-500: #666666;
    --color-gray-400: #888888;
    --color-gray-300: #aaaaaa;
    --color-gray-200: #cccccc;
    --color-gray-100: #e5e5e5;
    --color-white: #ffffff;

    --font-main: 'Outfit', sans-serif;

    /* Theme colors (will be inverted in light mode) */
    --bg-primary: var(--color-dark);
    --bg-secondary: var(--color-black);
    --text-primary: var(--color-white);
    --text-secondary: var(--color-gray-400);
    --text-muted: var(--color-gray-600);
    --border-color: var(--color-gray-800);

    /* Glitch Colors (Monochrome) */
    --glitch-1: var(--color-gray-500);
    --glitch-2: var(--color-white);
}

/* Light mode overrides */
/* Light mode overrides */
body.light-mode {
    --bg-primary: #e4e4e7;
    /* Slightly darker/grayer than #f4f4f5 to reduce glare */
    --bg-secondary: var(--color-gray-100);
    --text-primary: var(--color-black);
    --text-secondary: var(--color-gray-600);
    --text-muted: var(--color-gray-400);
    --border-color: var(--color-gray-200);

    --glitch-1: var(--color-gray-400);
    --glitch-2: var(--color-gray-800);
    /* Darker for visibility on light bg */
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

/* Custom text selection highlighting */
::selection {
    background: var(--text-primary);
    color: var(--bg-primary);
}

::-moz-selection {
    background: var(--text-primary);
    color: var(--bg-primary);
}


/* ===== Light Mode Background Logos ===== */
.bg-logos {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Only show in light mode */
body.light-mode .bg-logos {
    opacity: 1;
}

.bg-logo {
    position: absolute;
    width: 8rem;
    height: 8rem;
    color: rgba(0, 0, 0, 0.04);
    transition: color 0.3s ease;
}

.bg-logo svg {
    width: 100%;
    height: 100%;
}

/* Slightly larger logos for some variety */
.bg-logo:nth-child(2),
.bg-logo:nth-child(5),
.bg-logo:nth-child(9) {
    width: 10rem;
    height: 10rem;
}

.bg-logo:nth-child(4),
.bg-logo:nth-child(7) {
    width: 6rem;
    height: 6rem;
}

.bg-logo:nth-child(11) {
    width: 5rem;
    height: 5rem;
}

/* Hide on mobile - too cramped */
@media (max-width: 768px) {
    .bg-logos {
        display: none;
    }
}

/* ===== Loading Screen ===== */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-dark);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.loading-cube {
    width: 60px;
    height: 60px;
    position: relative;
    transform-style: preserve-3d;
    animation: cubeRotate 2s infinite linear;
}

.cube-face {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 1px solid var(--color-white);
    background: transparent;
}

.cube-face.front {
    transform: translateZ(30px);
}

.cube-face.back {
    transform: translateZ(-30px) rotateY(180deg);
}

.cube-face.left {
    transform: translateX(-30px) rotateY(-90deg);
}

.cube-face.right {
    transform: translateX(30px) rotateY(90deg);
}

.cube-face.top {
    transform: translateY(-30px) rotateX(90deg);
}

.cube-face.bottom {
    transform: translateY(30px) rotateX(-90deg);
}

@keyframes cubeRotate {
    0% {
        transform: rotateX(-20deg) rotateY(0deg);
    }

    100% {
        transform: rotateX(-20deg) rotateY(360deg);
    }
}

.loading-text {
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    color: var(--color-gray-400);
}

.loading-bar {
    width: 200px;
    height: 1px;
    background: var(--color-gray-800);
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: var(--color-white);
    transition: width 0.3s ease;
}

/* ===== Three.js Canvas ===== */
#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Hero needs transparent background for 3D to show through */
.hero {
    background: transparent;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    /* Slightly reduced padding for cleanliness */

    /* Glassmorphism */
    background: rgba(10, 10, 10, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    transition: transform 0.3s ease, padding 0.3s ease, background-color 0.2s ease, border-color 0.2s ease;
}

body.light-mode .nav {
    background: rgba(255, 255, 255, 0.65);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav.nav-hidden {
    transform: translateY(-100%);
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    /* object-fit: cover; removed for SVG */
    /* background-color: var(--color-gray-200); removed for transparent SVG */
    border: 2px solid var(--text-primary);
    /* Sync with text color */
    transition: transform 0.3s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-logo-text {
    font-size: 1.5rem;
    /* Increased from 1.25rem */
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--color-gray-100);
    /* Softened from white for dark mode */
    margin-left: 1rem;
    transition: color 0.2s ease;
}

body.light-mode .nav-logo-text {
    color: var(--text-primary);
}

.nav-logo-img:hover {
    transform: scale(1.1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
    /* Updated from white */
    text-decoration: none;
    transition: opacity 0.3s ease, color 0.2s ease;
}

.nav-link:hover {
    opacity: 0.6;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--text-primary);
    /* Updated from white */
    color: var(--text-primary);
    /* Updated from white */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.theme-toggle:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.theme-icon {
    transition: transform 0.5s ease;
}

/* ===== Glitch Animations ===== */
@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-2deg);
    }

    40% {
        transform: skew(2deg);
    }

    60% {
        transform: skew(-1deg);
    }

    80% {
        transform: skew(1deg);
    }

    100% {
        transform: skew(0deg);
    }
}

@keyframes glitch-anim {
    0% {
        text-shadow: -2px 0 var(--glitch-1), 2px 0 var(--glitch-2);
    }

    25% {
        text-shadow: 2px 0 var(--glitch-1), -2px 0 var(--glitch-2);
    }

    50% {
        text-shadow: -1px 0 var(--glitch-1), 1px 0 var(--glitch-2);
    }

    100% {
        text-shadow: 1px 0 var(--glitch-1), -1px 0 var(--glitch-2);
    }
}

.nav-link:hover,
.nav-logo:hover,
.hero-title span:hover,
.section-title:hover,
.work-item:hover .work-name,
.contact-email:hover,
.social-link:hover,
.btn:hover {
    animation: glitch-skew 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both,
        glitch-anim 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    color: var(--text-primary);
    /* Ensure contrast is kept */
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 6rem 4rem;
    z-index: 2;
    background: transparent;
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    pointer-events: auto;
}

.hero-subtitle {
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-gray-400);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 200;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
}

.hero-title span {
    display: block;
    cursor: default;
    transition: all 0.2s ease;
}

.hero-title span:nth-child(2) {
    font-weight: 600;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--bg-primary);
    background: var(--text-primary);
    border: 1px solid var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    opacity: 1;
    transform: translateY(-2px);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.hero-instruction {
    position: absolute;
    bottom: 3rem;
    right: 4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--color-gray-500);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.instruction-line {
    width: 60px;
    height: 1px;
    background: var(--color-gray-600);
}

/* ===== Interactive Terminal ===== */
.terminal {
    position: fixed;
    bottom: 2rem;
    right: 6rem;
    width: 380px;
    max-width: calc(100vw - 2rem);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--color-gray-700);
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    overflow: hidden;
    pointer-events: auto;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Smooth transitions for minimize/restore */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-mode .terminal {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--color-gray-300);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.75rem;
    background: var(--color-gray-900);
    border-bottom: 1px solid var(--color-gray-800);
}

body.light-mode .terminal-header {
    background: var(--color-gray-100);
    border-color: var(--color-gray-200);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-gray-600);
}

.terminal-dot:nth-child(1) {
    background: #ff5f56;
}

.terminal-dot:nth-child(2) {
    background: #ffbd2e;
}

.terminal-dot:nth-child(3) {
    background: #27c93f;
}

.terminal-title {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--color-gray-500);
    letter-spacing: 0.05em;
}

.terminal-minimize {
    background: none;
    border: none;
    color: var(--color-gray-400);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
    margin-left: 0.5rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.terminal-minimize:hover {
    color: var(--text-primary);
    transform: scale(1.2);
}

/* Minimized state - small floating button */
.terminal.minimized .terminal-body,
.terminal.minimized .terminal-input-line {
    max-height: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    border: none;
}

.terminal.minimized .terminal-dot,
.terminal.minimized .terminal-title {
    display: none;
}

.terminal.minimized {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    border-radius: 50%;
}

.terminal.minimized .terminal-header {
    padding: 0;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.terminal.minimized .terminal-minimize {
    font-size: 1rem;
    font-weight: bold;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal-body {
    padding: 0.75rem;
    max-height: 150px;
    overflow-y: auto;
    color: var(--color-gray-300);
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

body.light-mode .terminal-body {
    color: var(--color-gray-700);
}

.terminal-line {
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

.terminal-line:last-child {
    margin-bottom: 0;
}

.terminal-cmd {
    color: var(--color-white);
    font-weight: 600;
}

body.light-mode .terminal-cmd {
    color: var(--color-black);
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--color-gray-800);
    background: rgba(0, 0, 0, 0.3);
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    max-height: 50px;
}

body.light-mode .terminal-input-line {
    border-color: var(--color-gray-200);
    background: rgba(0, 0, 0, 0.03);
}

.terminal-prompt {
    color: var(--color-gray-400);
    font-weight: 600;
}

.terminal-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: inherit;
    caret-color: var(--text-primary);
}

.terminal-input::placeholder {
    color: var(--color-gray-600);
}

body.light-mode .terminal-input::placeholder {
    color: var(--color-gray-400);
}

/* Blinking cursor effect via caret */
@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.terminal-input:focus {
    animation: none;
    /* Browser caret handles it */
}

/* ===== Sections ===== */
section {
    position: relative;
    z-index: 2;
    transition: background-color 0.2s ease;
}

section:not(.hero) {
    background: transparent;
    pointer-events: none;
    /* Let clicks pass through to 3D scene */
}

.section-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 6rem 4rem;
    pointer-events: auto;
    /* Re-enable clicks for content */

    /* Glassmorphism */
    background: rgba(10, 10, 10, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    margin-bottom: 2rem;
    /* Spacing between cards */
}

body.light-mode .section-content {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(0, 0, 0, 0.08);
}

.section-number {
    display: block;
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.section-title {
    font-size: 3rem;
    font-weight: 200;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    transition: color 0.2s ease;
    cursor: default;
}

.section-text {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 2rem;
    transition: color 0.2s ease;
}

/* ===== Skills (Simple Icons) ===== */
.skills {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.skill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-gray-500);
    transition: color 0.3s ease, transform 0.3s ease;
}

.skill svg {
    width: 100%;
    height: 100%;
}

.skill:hover {
    color: var(--text-primary);
    transform: translateY(-3px);
}

/* ===== Skills Grid ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.skill-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-gray-800);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

body.light-mode .skill-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--color-gray-200);
}

.skill-card:hover {
    border-color: var(--color-gray-600);
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.05);
}

body.light-mode .skill-card:hover {
    border-color: var(--color-gray-400);
    background: rgba(0, 0, 0, 0.05);
}

.skill-icon {
    width: 40px;
    height: 40px;
    color: var(--color-gray-400);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.skill-icon svg {
    width: 100%;
    height: 100%;
}

.skill-card:hover .skill-icon {
    color: var(--text-primary);
}

.skill-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.skill-desc {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Work Section ===== */
.work-list {
    display: flex;
    flex-direction: column;
}

.work-item {
    display: grid;
    grid-template-columns: 100px 1fr 150px;
    align-items: center;
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--color-gray-800);
    cursor: pointer;
    transition: all 0.3s ease;

    /* Scroll Animation Init State */
    opacity: 0;
    transform: translateX(-30vw);
    /* Slide in from far left */
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), padding 0.3s ease, border-color 0.3s ease;
    will-change: opacity, transform;
}

.work-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.work-item:hover {
    padding-left: 1rem;
    border-color: var(--color-gray-600);
}

.work-item:hover .work-name {
    color: var(--text-primary);
    transform: translateX(10px);
}

/* ===== Contact Section Redesign ===== */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    font-family: var(--font-main);
    /* Ensure font inheritance */
}

@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

.section-subtitle {
    font-size: 0.85rem;
    font-weight: 300;
    /* Lighter weight */
    letter-spacing: 0.1em;
    color: var(--color-gray-500);
    margin-bottom: 0.5rem;
}

.contact-title {
    font-size: 3.5rem;
    font-weight: 200;
    /* Match section-title weight */
    line-height: 1;
    margin-bottom: 4rem;
    color: var(--text-primary);
}

.contact-social-large {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-link-large {
    font-size: 2.5rem;
    font-weight: 200;
    /* Match heavy thin mechanic of the site */
    color: var(--color-gray-600);
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.3s ease;
    width: fit-content;
}

.social-link-large:hover {
    color: var(--text-primary);
    transform: translateX(10px);
}

/* Form Styling */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.9rem;
    color: var(--color-gray-500);
    font-weight: 300;
}

.form-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-gray-700);
    padding: 0.5rem 0;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-bottom-color: var(--text-primary);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.btn-submit {
    margin-top: 1rem;
    padding: 1.25rem 2rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
    font-family: var(--font-main);
    font-weight: 400;
    /* Standard button weight */
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    transition: all 0.2s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn-submit .arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn-submit:hover .arrow {
    transform: translateX(5px);
}

/* ===== Project Details Section ===== */
.project-features {
    margin: 3rem 0;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.section-logo {
    height: 60px;
    width: auto;
    filter: invert(1);
    /* Default dark mode: Black SVG -> White */
    transition: filter 0.2s ease;
}

body.light-mode .section-logo {
    filter: invert(0);
    /* Light mode: Black SVG -> Black */
}

.feature-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-list li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding-left: 1.5rem;
    position: relative;
}

.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--text-primary);
}

.feature-list strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* Code Preview */
.code-preview {
    background: #0a0a0a;
    border: 1px solid var(--color-gray-800);
    border-radius: 8px;
    overflow: hidden;
    margin: 3rem 0;
    font-family: 'JetBrains Mono', monospace;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.code-preview:hover {
    transform: translateY(-5px);
    border-color: var(--color-gray-600);
}

.code-header {
    background: var(--color-gray-900);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--color-gray-800);
}

.code-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.code-dot.red {
    background: #ff5f56;
}

.code-dot.yellow {
    background: #ffbd2e;
}

.code-dot.green {
    background: #27c93f;
}

.code-title {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--color-gray-500);
}

.code-preview pre {
    padding: 1.5rem;
    overflow-x: auto;
    color: #e5e5e5;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Syntax Highlighting Sim (Basic) */
.language-python {
    color: #cccccc;
}

/* Project Links */
.project-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
}

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

/* Light Mode Overrides for Project Details */
body.light-mode .code-preview {
    background: #ffffff;
    border-color: var(--color-gray-200);
}

body.light-mode .code-header {
    background: var(--color-gray-100);
    border-color: var(--color-gray-200);
}

body.light-mode .code-preview pre {
    color: #1a1a1a;
}

body.light-mode .language-python {
    color: #333333;
}

.work-year {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-muted);
}

.work-name {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: inline-block;
    /* Required for transform */
}

.work-category {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--color-gray-600);
    text-align: right;
}

/* ===== Contact Section ===== */
/* ===== Contact Section ===== */
/* Social links now handle the layout */

.social-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    /* allow wrapping on small screens */
    justify-content: center;
    /* center them since title is centered usually or left aligned? */
}

.social-link {
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-gray-500);
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: var(--text-primary);
}

/* ===== Footer ===== */
.footer {
    position: relative;
    z-index: 2;
    padding: 2rem 4rem;
    background: var(--bg-primary);
    /* Keep footer solid or make similar to cards */
    /* background: rgba(10, 10, 10, 0.9); */
    border-top: 1px solid var(--color-gray-900);
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--color-gray-600);
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* ===== Mobile Menu Elements (Hidden on Desktop) ===== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    padding: 0;
    z-index: 101;
}

.mobile-menu-btn .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    /* Only right side */
    width: 50vw;
    max-width: 300px;
    z-index: 200;
    background: rgba(10, 10, 10, 0.95);
    /* Deep dark for contrast */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    /* Shadow on left */
}

body.light-mode .mobile-menu {
    background: rgba(255, 255, 255, 0.95);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    font-size: 3rem;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 200;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.mobile-nav-link {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav {
        padding: 1.5rem 1.5rem;
        /* Restored padding */
    }

    .nav-links {
        display: none;
        /* Hide standard links on mobile */
    }

    .mobile-menu-btn {
        display: flex;
        /* Show hamburger */
    }

    .nav-logo-img {
        width: 45px;
        height: 45px;
    }

    .nav-logo-text {
        font-size: 1.25rem;
        /* Restored size */
        margin-left: 1rem;
    }

    .hero {
        padding: 8rem 1rem 2rem;
        /* Increased top padding */
        justify-content: flex-start;
        /* Align content top */
    }

    .hero-subtitle {
        font-size: 0.75rem;
        margin-bottom: 0px;
    }

    .hero-title {
        font-size: clamp(4rem, 16vw, 6rem);
        /* Further increased for impact */
        margin-bottom: 1.5rem;
        margin-top: 25vh;
        /* Push title down to create gap */
    }

    .hero-instruction {
        display: none;
        /* Hide on mobile to reduce clutter */
    }

    .section-content {
        padding: 3rem 1.5rem;
        border-radius: 16px;
    }

    .section-title {
        font-size: 3rem;
        /* Increased from 2.5rem */
    }

    .work-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .work-category {
        text-align: left;
        margin-bottom: 0.5rem;
    }

    .work-name {
        font-size: 1.25rem;
    }

    .contact-email {
        font-size: 1.5rem;
    }

    .footer {
        padding: 2rem 1.5rem;
    }

    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    /* Terminal mobile adjustments */
    .terminal {
        display: none !important;
    }
}

/* ===== Experience Section ===== */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    position: relative;
    padding-left: 2rem;
    border-left: 1px solid var(--color-gray-800);
}

.experience-item {
    position: relative;
}

.experience-item::before {
    content: "";
    position: absolute;
    left: -2rem;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-gray-900);
    border: 2px solid var(--color-gray-600);
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

.experience-item:hover::before {
    background: var(--text-primary);
    border-color: var(--text-primary);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.experience-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.role-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}


.company-name {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.company-logo {
    height: 1.2rem;
    width: auto;
    border-radius: 4px;
    filter: invert(1);
    transition: filter 0.3s ease;
}

.experience-description {
    list-style: none;
    padding: 0;
    margin: 0;
}

.experience-description li {
    font-size: 0.95rem;
    color: var(--color-gray-400);
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.6;
}

.experience-description li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    top: 2px;
}

/* Hover Effect */
.experience-item:hover .role-title {
    color: var(--color-white);
}

.experience-item:hover .experience-description li {
    color: var(--text-secondary);
}

/* Light Mode Overrides */
body.light-mode .experience-list {
    border-left-color: var(--color-gray-300);
}

body.light-mode .experience-item::before {
    background: var(--color-gray-100);
    border-color: var(--color-gray-400);
}

body.light-mode .experience-item:hover::before {
    background: var(--text-primary);
    border-color: var(--text-primary);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

body.light-mode .experience-item:hover .role-title {
    color: var(--color-black);
}

body.light-mode .company-logo {
    filter: invert(0);
}

/* ===== Mobile Responsiveness for New Sections ===== */
@media (max-width: 768px) {

    /* Experience Section */
    .experience-list {
        padding-left: 1.5rem;
        gap: 2rem;
    }

    .experience-item::before {
        left: -1.5rem;
        width: 8px;
        height: 8px;
        top: 6px;
    }

    .role-title {
        font-size: 1.1rem;
    }

    .company-name {
        font-size: 0.95rem;
    }

    .experience-description li {
        font-size: 0.9rem;
    }

    /* LazyHooks / Project Detail Section */
    .project-detail {
        padding: 4rem 1.5rem;
        /* Reduce padding */
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .project-features {
        grid-template-columns: 1fr;
        /* Stack features */
    }

    .code-preview {
        margin-top: 2rem;
    }

    .project-links {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .project-links .btn {
        width: 100%;
        text-align: center;
    }
}

/* ===== Work Item Hover Accordion ===== */
.work-item-wrapper {
    border-bottom: 1px solid var(--border-color);
}

.work-item-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 0;
    cursor: pointer;
    transition: padding 0.4s ease-out;
}

.work-item-wrapper.expanded .work-item-header {
    padding: 2rem 0;
}

.work-year {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
    letter-spacing: 0.1em;
}

.work-name {
    flex: 1;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.work-item-wrapper.expanded .work-name {
    color: var(--text-secondary);
}

.work-category {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Toggle Button */
.work-toggle {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.work-toggle:hover {
    background: var(--text-primary);
}

.work-toggle:hover .toggle-icon {
    stroke: var(--bg-primary);
}

.toggle-icon {
    width: 1rem;
    height: 1rem;
    stroke: var(--text-primary);
    transition: transform 0.3s ease;
}

/* When expanded, rotate the plus to become an X */
.work-item-wrapper.expanded .toggle-icon {
    transform: rotate(45deg);
}

/* Expandable Detail Section */
.work-item-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.4s ease-out;
    opacity: 0;
}

.work-item-wrapper.expanded .work-item-detail {
    max-height: 1500px;
    /* Large enough to fit content */
    opacity: 1;
}

.detail-inner {
    padding: 2rem 0 3rem 0;
    border-top: 1px solid var(--border-color);
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Mobile responsiveness for accordion */
@media (max-width: 768px) {
    .work-item-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .work-name {
        flex: 100%;
        order: -1;
        font-size: 1.4rem;
    }

    .work-year {
        font-size: 0.75rem;
    }

    .work-category {
        font-size: 0.8rem;
    }

    .work-toggle {
        margin-left: auto;
    }
}