/* DESIGN SYSTEM */
:root {
    --neon-pink: #ff2d78;
    --neon-cyan: #00f5ff;
    --neon-purple: #bf5fff;
    --bg: #050508;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text: #f0eeff;
    --text-muted: rgba(240, 238, 255, 0.5);
}

/* Sparkle cursor overlay */
#sparkle-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    will-change: transform;
    background: transparent;
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Syne', sans-serif;
    padding-top: 0;
    /* nav height offset handled by scroll-padding-top */
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
}

.mono-text,
label,
.nav-links a,
.lang-toggle,
.player-placeholder,
footer p {
    font-family: 'Space Mono', monospace;
}

/* Mixins / Utilities */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
}

/* -- NAV -- */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(5, 5, 8, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-left .logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--neon-cyan);
}

.nav-links a.active {
    color: var(--neon-cyan);
    border-bottom: 1px solid var(--neon-cyan);
}

.lang-toggle {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--card-border);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.lang-toggle:hover {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text);
    transition: all 0.3s ease;
}

::selection {
    background: rgba(191, 95, 255, 0.3);
    color: #fff;
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--neon-purple), var(--neon-cyan));
    border-radius: 2px;
}

/* Sections Container */
section {
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 170px);
    min-height: calc(100dvh - 170px);
    padding: 4rem 5%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Skip layout/paint for off-screen sections */
    content-visibility: auto;
    contain-intrinsic-size: 0 700px;
}

section:not(#hero)::before {
    content: '';
    display: block;
    width: 100px;
    height: 1px;
    margin: 0 auto 80px;
    background: linear-gradient(90deg, transparent, var(--neon-purple), transparent);
}

/* -- HERO -- */
#hero {
    position: relative;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #050508;
}

#viz-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    will-change: transform;
}

.hero-player {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: min(480px, 90vw);
}

/* Removed dark backdrop behind player to make visualizer clearer */
/* .hero-player::before { ... } removed */

.hero-track-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    letter-spacing: 0.05em;
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
}

.hero-track-duration {
    display: flex;
    gap: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
}

.hero-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.hero-ctrl-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.hero-ctrl-btn svg {
    width: 20px;
    height: 20px;
    fill: rgba(255, 255, 255, 0.8);
}

.hero-ctrl-btn:hover {
    background: rgba(255, 45, 120, 0.3);
    border-color: var(--neon-pink);
    transform: scale(1.08);
}

.hero-play-btn {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #ff2d78, #bf5fff);
    border: none;
    box-shadow: 0 0 30px rgba(255, 45, 120, 0.5);
}

.hero-play-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* CSS-class based play/pause icon state */
.hero-play-btn .icon-play {
    display: block;
}

.hero-play-btn .icon-pause {
    display: none;
}

.hero-play-btn.playing .icon-play {
    display: none;
}

.hero-play-btn.playing .icon-pause {
    display: block;
}

.hero-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(255, 45, 120, 0.7);
}

.hero-seek-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
}

.hero-seek-bar {
    flex: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
}

.hero-seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--neon-cyan);
    cursor: pointer;
    box-shadow: 0 0 8px var(--neon-cyan);
}

.hero-volume-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 140px;
}

.hero-vol-icon {
    width: 16px;
    height: 16px;
    fill: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

/* Scrollable tracklist inside hero player */
.hero-tracklist {
    width: 100%;
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    /* thin scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.hero-tracklist::-webkit-scrollbar {
    width: 3px;
}

.hero-tracklist::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

/* Suno AI credit below tracklist */
.hero-suno-credit {
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

.hero-suno-credit span {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.25);
    font-style: italic;
}

.tracklist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    background: transparent;
}

.tracklist-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tracklist-row.active {
    background: rgba(255, 45, 120, 0.12);
}

.tracklist-num {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    width: 18px;
    flex-shrink: 0;
}

.tracklist-title {
    font-family: 'Syne', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tracklist-row.active .tracklist-title {
    color: var(--neon-pink);
}

.tracklist-play-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.tracklist-row:hover .tracklist-play-btn,
.tracklist-row.active .tracklist-play-btn {
    opacity: 1;
}

.tracklist-play-btn svg {
    width: 14px;
    height: 14px;
    fill: rgba(255, 255, 255, 0.7);
}

.hero-cta {
    margin-top: 40px;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

.cta-primary {
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    color: #fff;
    box-shadow: 0 0 30px rgba(255, 45, 120, 0.4);
    border: none;
}

.cta-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(255, 45, 120, 0.6);
}

.cta-ghost {
    background: transparent;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
}

.cta-ghost:hover {
    background: rgba(0, 245, 255, 0.1);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    animation: bounce 2s infinite;
    z-index: 1;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-20px) translateX(-50%);
    }

    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* -- ABOUT SECTION -- */
#about {
    padding: 120px 5% 40px;
    min-height: auto;
    align-items: center;
}

.section-header {
    width: 100%;
    margin-bottom: 3rem;
}

.section-label {
    font-family: 'Space Mono', monospace;
    color: var(--neon-cyan);
    letter-spacing: 0.3em;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.section-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-main-title {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--text);
    margin: 0;
    line-height: 1.2;
}

.section-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #ff2d78, #00f5ff);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    width: 100%;
}

/* About Left */
.about-left {
    max-width: 380px;
    margin: 0 auto;
    width: 100%;
}

.photo-container {
    position: relative;
    z-index: 1;
}

.photo-container::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--neon-pink);
    border-radius: 24px;
    z-index: -1;
}

#about-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    box-shadow: 0 0 60px rgba(191, 95, 255, 0.2);
    display: block;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 2rem;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    color: var(--text);
    text-decoration: none;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.social-btn:hover {
    border-color: var(--neon-cyan);
}

.social-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* About Right */
.about-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-bio {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.skills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-pill {
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--neon-cyan);
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.skill-pill:hover {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
}

.stats-row {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* -- MUSIC SECTION -- */
#music {
    padding: 120px 5% 40px;
    min-height: auto;
}

.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    width: 100%;
}

.track-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.track-card:hover {
    transform: translateY(-4px);
}

.track-card.active {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.2);
}

.track-cover {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.track-info {
    flex-grow: 1;
    min-width: 0;
}

.track-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-duration {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.track-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff2d78, #bf5fff);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    transition: transform 0.2s ease;
}

.track-play-btn:hover {
    transform: scale(1.1);
}

.track-play-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* -- PLAYER & VISUALIZER -- */
@media (max-width: 480px) {
    .hero-player {
        width: 92vw;
        gap: 12px;
    }

    .hero-play-btn {
        width: 56px;
        height: 56px;
    }

    .hero-ctrl-btn {
        width: 42px;
        height: 42px;
    }
}

/* Footer */
#footer {
    padding: 80px 40px 40px;
    border-top: 1px solid var(--card-border);
    background: linear-gradient(to bottom, transparent, rgba(191, 95, 255, 0.05));
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo-area .logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.footer-subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-nav a {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: var(--neon-cyan);
}

.footer-middle {
    margin: 48px 0;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.footer-social-btn {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-social-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    transition: all 0.3s ease;
}

.footer-social-btn.linkedin:hover {
    border-color: #0077b5;
}

.footer-social-btn.linkedin:hover svg {
    fill: #0077b5;
    transform: translateY(-3px);
}

.footer-social-btn.instagram:hover {
    border-color: #e1306c;
}

.footer-social-btn.instagram:hover svg {
    fill: #e1306c;
    transform: translateY(-3px);
}

.footer-social-btn.github:hover {
    border-color: #fff;
}

.footer-social-btn.github:hover svg {
    fill: #fff;
    transform: translateY(-3px);
}

.footer-bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
    text-align: center;
}

.footer-bottom p {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.player-placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* -- VISUALS SECTION -- */
#visuals {
    padding: 120px 5% 40px;
    min-height: auto;
}

.visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
}

.visual-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    cursor: pointer;
    aspect-ratio: 1;
}

.visual-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.visual-card:hover img {
    transform: scale(1.08);
}

.visual-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 8, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    pointer-events: none;
}

.visual-card:hover .visual-overlay {
    opacity: 1;
}

.visual-tool-badge {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    padding: 4px 10px;
    border-radius: 20px;
    align-self: flex-start;
}

.visual-hint {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    align-self: flex-end;
}

/* Visuals Modal */
.visual-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    /* Higher than sparkles */
    /* Removed backdrop-filter to fix desktop lag. 
       Full-screen blurs are extremely GPU-heavy on large monitors.
       Increased opacity slightly to compensate. */
    background: rgba(5, 5, 8, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    /* GPU layer so the fade doesn't trigger page repaints */
    will-change: opacity;
}

.visual-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.visual-modal {
    max-width: 800px;
    width: 100%;
    /* Solid background is CRUCIAL here. A transparent background forces the 
       browser to recalculate the blurred backdrop behind it on every scroll frame! */
    background: #0a0a0e;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.modal-image-container {
    padding: 20px;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    aspect-ratio: 1;
}

.modal-info {
    padding: 30px 30px 30px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.modal-badge-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.modal-prompt-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--neon-purple);
    letter-spacing: 0.2em;
}

.modal-prompt-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    /* Solid background prevents transparency composition lag */
    background: #000000;
    border-radius: 8px;
    padding: 16px;
    border-left: 2px solid var(--neon-purple);
    max-height: 280px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-purple) transparent;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
}

.modal-prompt-text::-webkit-scrollbar {
    width: 4px;
}

.modal-prompt-text::-webkit-scrollbar-thumb {
    background: var(--neon-purple);
    border-radius: 10px;
}

.modal-copy-btn {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    background: transparent;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    align-self: flex-start;
}

.modal-copy-btn:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    font-family: 'Space Mono', monospace;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close-btn:hover {
    color: var(--neon-pink);
}

/* Lightbox Sub-Modal for Zooming */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    /* Highest priority */
    /* Using high opacity black instead of backdrop-filter 'blur' 
       Blur is extremely expensive on desktop when opening large images. */
    background: rgba(0, 0, 0, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    cursor: zoom-out;
    /* Simplified shadow to reduce GPU load */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    /* HW acceleration for the image layer */
    transform: translateZ(0);
}

.lightbox-close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: var(--text);
    font-size: 1.2rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close-btn:hover {
    background: var(--neon-pink);
    border-color: var(--neon-pink);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .visual-modal {
        grid-template-columns: 1fr;
        max-height: 90vh;
        max-height: 90dvh;
        /* Let the modal grid handle its own layout instead of bursting out */
        display: flex;
        flex-direction: column;
    }

    .modal-image-container {
        padding: 16px 16px 0;
        /* Constrain image height on mobile so it leaves room for text */
        max-height: 35vh;
        max-height: 35dvh;
        display: flex;
        justify-content: center;
    }

    .modal-image {
        /* Ensure image doesn't push bounds out */
        height: auto;
        max-height: 100%;
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }

    .modal-info {
        padding: 12px 16px 20px;
        gap: 10px;
        /* Let info box fill remaining space but not overflow */
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .modal-prompt-text {
        /* Force the inner text box to scroll, not the whole screen */
        flex: 1;
        max-height: 100%;
        min-height: 80px;
        /* at least some area before scrolling starts */
        padding: 10px;
        font-size: 0.75rem;
        /* slightly smaller text for mobile */
    }
}

/* -- WORKS SECTION -- */
#works {
    padding: 120px 5% 40px;
    min-height: auto;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    width: 100%;
}

.work-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    padding: 32px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.work-card:hover {
    transform: translateY(-6px);
    border-color: var(--neon-cyan);
    box-shadow: 0 20px 60px rgba(0, 245, 255, 0.1);
}

.work-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.work-number {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--neon-purple);
    letter-spacing: 0.2em;
}

.work-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: all 0.3s;
}

.work-card:hover .work-arrow {
    color: var(--neon-cyan);
    transform: translate(3px, -3px);
}

.work-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text);
    margin-top: 20px;
}

.work-desc {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-top: 12px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    flex-grow: 1;
}

.work-tags {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.work-tag {
    background: rgba(191, 95, 255, 0.1);
    border: 1px solid rgba(191, 95, 255, 0.3);
    color: var(--neon-purple);
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 20px;
}

.works-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    text-align: center;
}

.works-empty-icon {
    font-family: 'Space Mono', monospace;
    color: var(--neon-purple);
    font-size: 3rem;
    margin-bottom: 16px;
}

.works-empty-text {
    font-family: 'Space Mono', monospace;
    color: var(--text-muted);
}

/* -- RESPONSIVE -- */
@media (max-width: 768px) {
    .footer-top {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .footer-nav {
        flex-direction: column;
        gap: 16px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(5, 5, 8, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 2rem 5%;
        border-bottom: 1px solid var(--card-border);
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    /* Hamburger Animation */
    .hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}