:root {
    --bg-color: #17171c; /* Deep retro charcoal dark background */
    --text-color: #fdfbf7; /* Off-white for clean, highly legible text */
    --primary-blue: #4361EE;
    --primary-pink: #F72585;
    --primary-yellow: #FEE440;
    --primary-green: #06D6A0;
    --border-color: #0f0f0f; /* Stark solid black borders */
    --border-width: 4px;
    --shadow-color: #000000; /* Dark drop shadows */
    --shadow-offset: 8px;
    
    --font-heading: 'Bricolage Grotesque', sans-serif;
    --font-body: 'Space Mono', monospace;
}

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

html, body {
    background-color: var(--bg-color);
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1.5px, transparent 1.5px);
    background-size: 20px 20px;
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

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

/* Typography */
h1, h2, h3, .logo {
    font-family: var(--font-heading);
    font-weight: 800;
}

.logo {
    font-size: 2rem;
    letter-spacing: -1px;
}

/* Neo-brutalism Utilities */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--text-color);
    border: var(--border-width) solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--shadow-color);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
}

.btn:active {
    transform: translate(4px, 4px) !important;
    box-shadow: calc(var(--shadow-offset) - 4px) calc(var(--shadow-offset) - 4px) 0px var(--shadow-color) !important;
}

.primary-btn {
    background-color: var(--primary-yellow);
    color: #0f0f0f !important;
}

.secondary-btn {
    background-color: var(--primary-blue);
    color: white !important;
}

.highlight {
    display: inline-block;
    padding: 0 8px;
    line-height: 1.1;
    border: 3px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 4px 4px 0px var(--shadow-color);
    transform: rotate(-2deg);
}

.highlight-blue { background-color: var(--primary-blue); color: white; }
.highlight-pink { background-color: var(--primary-pink); color: white; transform: rotate(2deg); }

.yellow-bg { background-color: var(--primary-yellow); color: #0f0f0f !important; }
.green-bg { background-color: var(--primary-green); color: #0f0f0f !important; }
.blue-bg { background-color: #E0E7FF; color: #0f0f0f !important; } /* Lighter blue for card bg */
.pink-bg { background-color: var(--primary-pink); color: white !important; }

/* Mobile CTA item is hidden on desktop (shown in mobile dropdown menu) */
.mobile-cta-item {
    display: none;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 5%;
    border-bottom: var(--border-width) solid var(--border-color);
    background-color: var(--bg-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 4px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-pink);
    transition: width 0.3s ease;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 24px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 100%;
    height: 4px;
    background-color: var(--text-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 180px 5% 40px 5%;
    min-height: 100vh;
    background-color: #0b0b0e; /* Deep retro black backdrop */
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1.5px, transparent 1.5px);
    background-size: 20px 20px;
    border-bottom: var(--border-width) solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
    opacity: 0.12;
}

.hero-content {
    max-width: 900px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-size: 4.5rem;
    line-height: 1.4;
    margin-bottom: 32px;
    color: var(--text-color); /* Light off-white in dark mode */
    font-weight: 800;
    letter-spacing: -2px;
}

.hero .highlight {
    border-color: var(--text-color);
    box-shadow: 4px 4px 0px var(--text-color);
}

.hero-subtitle {
    font-size: 1.1rem;
    margin: 0 auto 24px;
    color: rgba(255, 255, 255, 0.8); /* Beautiful semi-transparent white */
    max-width: 700px;
}

.hero-sparkle {
    position: absolute;
    z-index: 1;
}



/* Sections */
section {
    padding: 80px 5%;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 48px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: -1px;
}

/* About Section */
.about-container {
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr;
    gap: 24px;
    align-items: stretch;
    max-width: 1250px;
    margin: 0 auto;
}

.about-grid-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.about-photo-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    padding: 8px; /* space for sticker */
    z-index: 1;
}



.about-photo-card {
    border: var(--border-width) solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--shadow-color);
    background-color: #24242d; /* Elegant charcoal/gray card bg */
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.photo-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 16px;
    background-color: #24242d; /* Matching deep charcoal card bg */
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    border-radius: 8px;
}

/* Arrow Overlay */
.photo-arrow-overlay {
    position: absolute;
    bottom: 22%;
    right: 0px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transform: scale(0);
    transform-origin: right bottom;
}

.arrow-float-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    animation: arrow-float 2.5s ease-in-out infinite alternate;
}

.arrow-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2rem;
    color: #FF0033;
    text-shadow: 
        2px 2px 0 var(--border-color),
        -2px -2px 0 var(--border-color),  
        2px -2px 0 var(--border-color),
        -2px 2px 0 var(--border-color),
        2px 2px 0 var(--border-color);
    transform: rotate(-5deg);
    margin-top: -10px;
    letter-spacing: 1px;
    text-align: right;
    white-space: nowrap;
}

.arrow-float-container svg {
    filter: drop-shadow(4px 4px 0px var(--border-color));
    transform: rotate(-12deg);
    transform-origin: right bottom;
}

@keyframes arrow-float {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-15px) rotate(-5deg); }
}

.about-card {
    padding: 24px;
    border: var(--border-width) solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--shadow-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    flex: 1;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: inline-block;
}

.about-card h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.about-card p {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Projects Section */
.projects-section {
    padding: 100px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Exactly 3 columns on desktop */
    gap: 24px;
}

.projects-more-container {
    display: flex;
    justify-content: center;
    margin-top: 60px;
    width: 100%;
}

.projects-more-btn {
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 800;
    box-shadow: 6px 6px 0px var(--border-color);
}

@media (max-width: 1200px) {
    .projects-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 28px;
    }
    .project-card {
        width: calc(50% - 14px); /* Perfectly equal-sized columns on tablet and centered bottom card */
    }
}

@media (max-width: 768px) {
    .projects-section {
        padding: 60px 6%;
    }
    .projects-grid {
        display: flex;
        flex-direction: column;
        gap: 32px;
    }
    .project-card {
        width: 100%; /* Full-width stacked on mobile */
        max-width: 100%;
    }
    .projects-more-container {
        margin-top: 40px;
    }
    .projects-more-btn {
        width: 100%; /* Full width button on mobile for excellent tap accessibility */
        text-align: center;
    }
}

.project-card {
    border: var(--border-width) solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 10px 10px 0px var(--shadow-color);
    background-color: #24242d; /* Elegant dark card bg */
    display: flex;
    flex-direction: column;
}

.project-img-wrapper {
    width: 100%;
    height: 250px;
    border-bottom: var(--border-width) solid var(--border-color);
    background-color: #1a1a22; /* Darker tone for image frame */
}

.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    box-shadow: 2px 2px 0px var(--shadow-color);
    align-self: flex-start; /* Prevent tag from stretching to full width in flex container */
}

.tag-pink { background-color: var(--primary-pink); color: white; }
.tag-blue { background-color: var(--primary-blue); color: white; }

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.project-info p {
    margin-bottom: 24px; /* Jarak aman agar deskripsi tidak mepet dengan tombol */
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-btn {
    margin-top: auto; /* Push the button to the bottom of the card */
    display: inline-block;
    padding: 8px 16px;
    font-size: 1rem;
}

/* Marquee Section */
.marquee-section {
    padding: 24px 0;
    background-color: var(--primary-yellow);
    border-top: var(--border-width) solid var(--border-color);
    border-bottom: var(--border-width) solid var(--border-color);
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    transform: rotate(-2deg);
    width: 110%;
    left: -5%;
    margin: 40px 0;
}

.marquee-content {
    display: inline-block;
    animation: marquee-scroll 15s linear infinite;
    will-change: transform;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

.marquee-text {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: #0f0f0f !important; /* Force high-contrast solid black on yellow background */
}

/* Footer */
.footer {
    padding: 48px 5% 24px 5%;
    display: flex;
    justify-content: center;
    background-color: #0b0b0e; /* Deep retro black backdrop */
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1.5px, transparent 1.5px);
    background-size: 20px 20px;
    border-top: var(--border-width) solid var(--border-color);
    color: #fdfbf7;
}

.footer-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
}

.footer-content h2 {
    font-size: 3rem;
    margin-bottom: 16px;
    color: white;
}

.footer-content p {
    font-size: 1.2rem;
    margin-bottom: 32px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-credit {
    margin-top: 24px;
    font-size: 1rem !important;
    color: #a0a0a0 !important;
    font-family: var(--font-body);
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background-color: #24242d; /* Charcoal gray link buttons */
    color: var(--text-color);
    border: 3px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-decoration: none;
    box-shadow: 4px 4px 0px var(--primary-yellow);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.social-btn svg {
    width: 24px;
    height: 24px;
}

.social-btn:active {
    transform: translate(2px, 2px) !important;
    box-shadow: 2px 2px 0px var(--primary-yellow) !important;
}

/* Base animations classes (to be handled by JS or CSS fallback) */
.fade-in-up, .fade-in-scale, .card-anim, .hero-word, .hero-pop {
    opacity: 0;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* GPU acceleration for frequently animated elements */
.project-card,
.about-card,
.about-photo-wrapper,
.social-btn,
.marquee-content {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: -80px;
    right: 32px;
    width: 64px;
    height: 64px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scroll-top-btn.visible {
    bottom: 32px;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    border: 3px solid var(--border-color);
    border-radius: 8px;
    background-color: #24242d; /* Matching deep dark background for language toggler */
    box-shadow: 4px 4px 0px var(--border-color);
    overflow: hidden;
    padding: 2px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lang-switcher:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--border-color);
}

.lang-btn {
    border: none;
    background: none;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.9rem;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--text-color);
}

.lang-btn.active {
    background-color: var(--primary-pink);
    color: white;
    transform: scale(1.05);
}

.lang-btn:hover:not(.active) {
    background-color: var(--primary-yellow);
    color: #0f0f0f !important;
}

@media (max-width: 480px) {
    .lang-switcher {
        box-shadow: 2px 2px 0px var(--border-color);
    }
    .lang-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    /* Hide CTA button from navbar on mobile — it lives inside the mobile menu dropdown */
    .nav-actions .btn.primary-btn {
        display: none;
    }

    .nav-links {
        position: fixed;
        top: -100vh;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-color);
        background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1.5px, transparent 1.5px);
        background-size: 20px 20px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 80px 24px 40px;
        transition: top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        border-bottom: var(--border-width) solid var(--border-color);
        z-index: 999;
        gap: 8px;
    }

    .nav-links.active {
        top: 0;
    }

    .nav-links li {
        margin-bottom: 16px;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

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

    .nav-links.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.15s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.25s; }
    .nav-links.active li:nth-child(5) { transition-delay: 0.3s; }

    .nav-links a {
        font-size: 1.6rem;
        letter-spacing: -0.5px;
    }

    /* Mobile CTA button inside dropdown menu */
    .nav-links .mobile-cta-item {
        display: list-item;
        margin-top: 8px;
    }

    .nav-links .mobile-cta-item .btn {
        padding: 14px 32px;
        font-size: 1.1rem;
        display: inline-block;
    }

    /* Navbar Spacing & Adjustments */
    .nav-actions {
        gap: 14px;
    }

    .navbar .btn {
        padding: 8px 16px;
        font-size: 0.95rem;
    }

    /* Hero Section */
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 140px 6% 60px 6%;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 3.2rem;
        line-height: 1.25;
        margin-bottom: 24px;
        letter-spacing: -1.5px;
    }

    /* Hero Tags Spacing & Layout */
    .hero-tags {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 12px;
        margin-top: 16px;
        width: 100%;
        white-space: normal;
        flex-wrap: wrap;
    }

    .tag-and {
        font-family: var(--font-body);
        font-weight: 700;
        font-size: 0.9em;
        color: var(--text-color);
        margin: 0 4px;
    }

    .hero .highlight {
        font-size: 0.95em;
        padding: 6px 14px;
        border-width: 3px;
        box-shadow: 4px 4px 0px var(--bg-color);
        margin: 4px 0;
    }

    .hero-subtitle {
        font-size: 1.05rem;
        line-height: 1.7;
        margin: 0 auto 32px;
        max-width: 550px;
        padding: 0 8px;
        color: rgba(255, 255, 255, 0.75);
    }

    .profile-card {
        width: 280px;
        height: 280px;
    }
    
    .about-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .about-grid-col {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
    
    .about-card {
        aspect-ratio: auto;
        min-height: 190px;
        padding: 18px;
    }

    .about-photo-card {
        height: 400px;
    }

    /* Section titles */
    .section-title {
        font-size: 2.4rem;
        margin-bottom: 36px;
    }

    /* Footer mobile */
    .footer-content h2 {
        font-size: 2.2rem;
        margin-bottom: 12px;
    }

    .footer-content p {
        font-size: 1.05rem;
        margin-bottom: 24px;
    }

    .social-links {
        gap: 10px;
    }

    .social-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
        gap: 8px;
    }

    /* Marquee mobile */
    .marquee-section {
        transform: rotate(-1.5deg);
    }

    .marquee-text {
        font-size: 1.5rem;
    }

    /* Projects section description (from projects.html inline) */
    .projects-header-content p {
        font-size: 0.95rem !important;
        padding: 0 8px;
        margin-bottom: 40px !important;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 130px 5% 50px 5%;
        min-height: 100vh;
    }

    .hero-title {
        font-size: 2.4rem;
        line-height: 1.3;
        letter-spacing: -1px;
    }

    /* Tags in a row on small mobile */
    .hero-tags {
        display: flex;
        flex-direction: row;
        gap: 10px;
        margin-top: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .tag-and {
        font-size: 1.2em;
    }

    .hero .highlight {
        font-size: 1rem;
        padding: 8px 16px;
        border-width: 3px;
        box-shadow: 3px 3px 0px var(--bg-color);
        margin: 2px 0;
    }

    .hero-subtitle {
        font-size: 0.92rem;
        line-height: 1.6;
        padding: 0 4px;
    }
    
    .profile-card {
        width: 220px;
        height: 220px;
    }

    .about-container {
        gap: 14px;
    }
    
    /* Single column cards on small mobile for readability */
    .about-grid-col {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .about-card {
        padding: 16px;
        aspect-ratio: auto;
        min-height: auto;
    }

    .about-photo-card {
        height: 300px;
    }
    
    .photo-arrow-overlay {
        right: 10px;
        bottom: 12%;
    }
    
    .card-icon {
        margin-bottom: 6px;
    }
    
    .card-icon svg {
        width: 36px;
        height: 36px;
    }
    
    .about-card h3 {
        font-size: 1.15rem;
        margin-bottom: 4px;
    }
    
    .about-card p {
        font-size: 0.82rem;
        line-height: 1.45;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Section titles */
    .section-title {
        font-size: 2rem;
        margin-bottom: 28px;
    }

    /* Project cards mobile */
    .project-img-wrapper {
        height: 200px;
    }

    .project-info {
        padding: 18px;
    }

    .project-info h3 {
        font-size: 1.3rem;
    }

    .project-info p {
        font-size: 0.88rem;
    }

    /* Footer compact */
    .footer {
        padding: 36px 5% 20px 5%;
    }

    .footer-content h2 {
        font-size: 1.8rem;
    }

    .footer-content p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .social-links {
        gap: 8px;
    }

    .social-btn {
        padding: 10px 14px;
        font-size: 0.82rem;
        gap: 6px;
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }

    .social-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Music controller: icon-only on small mobile */
    .music-status-text {
        display: none;
    }

    /* Marquee compact */
    .marquee-text {
        font-size: 1.2rem;
    }

    .marquee-section {
        padding: 18px 0;
    }

    /* Navbar mobile links */
    .nav-links a {
        font-size: 1.4rem;
    }

    /* Projects header description */
    .projects-header-content p {
        font-size: 0.88rem !important;
        line-height: 1.5 !important;
    }
}
/* Terminal Typing Styles (For Footer) */
.terminal-text {
    opacity: 0;
}
.terminal-text.typing,
.terminal-text.typed {
    opacity: 1;
}

.terminal-cursor {
    display: inline-block;
    width: 12px;
    height: 1.1em;
    background-color: currentColor;
    vertical-align: middle;
    margin-left: 4px;
    animation: terminal-blink 0.8s infinite steps(2);
}

@keyframes terminal-blink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* ==========================================
   RETRO HACKER CRT TERMINAL LAUNCH SCREEN
   ========================================== */

/* Body Lock while terminal is active */
body.terminal-active {
    overflow: hidden !important;
    height: 100vh !important;
}

/* Retro CRT Terminal Screen Overlay */
.terminal-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #020502;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: 'Space Mono', Courier, monospace;
    padding: 20px;
    box-sizing: border-box;
}

/* CRT Curved Glass & Ambient Phosphor Glow */
.crt-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, 0.45) 75%, rgba(0, 0, 0, 0.9) 100%),
        radial-gradient(circle at center, rgba(0, 255, 80, 0.05) 0%, transparent 80%);
    pointer-events: none;
    z-index: 10;
    box-shadow: inset 0 0 100px rgba(0, 255, 51, 0.2);
}

/* Cathode Ray Tube Scanlines & Vertical Sweep Bar */
.crt-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.28) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 11;
}

.crt-scanlines::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(18,16,16,0) 0%, rgba(0, 255, 51, 0.08) 8%, rgba(18,16,16,0) 18%);
    pointer-events: none;
    z-index: 12;
    animation: crt-sweep-anim 8s linear infinite;
}

@keyframes crt-sweep-anim {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.crt-flicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #00ff33;
    opacity: 0.012;
    pointer-events: none;
    z-index: 9;
    animation: crt-flicker-anim 0.2s infinite;
}

@keyframes crt-flicker-anim {
    0% { opacity: 0.009; }
    50% { opacity: 0.014; }
    100% { opacity: 0.009; }
}

/* IBM PC / Macintosh Retro Monitor Bezel (Chassis Simulation) */
.terminal-window {
    width: 95vw;
    max-width: 1240px;
    height: 92vh;
    background-color: #020502;
    border: 18px solid #242d24; /* Thick olivine vintage cabinet plastic */
    border-radius: 28px;
    box-shadow: 
        0 0 0 4px #0c120c, /* outer border */
        0 35px 80px rgba(0, 0, 0, 0.9), /* shadow dropped on table */
        inset 0 0 40px rgba(0, 0, 0, 0.95); /* screen inset glass shadow */
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 5;
    overflow: hidden;
    transform: perspective(1200px) rotateX(1.5deg) rotateY(-0.5deg); /* Authentic 3D cabinet tilted stand angle */
}

.terminal-header {
    background-color: #081508;
    border-bottom: 2px solid #00ff33;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: inset 0 5px 10px rgba(0, 255, 51, 0.05);
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.btn-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 255, 51, 0.1);
    border: 1px solid #00ff33;
}

.btn-close { background: rgba(255, 50, 50, 0.25); border-color: #ff3333; }
.btn-minimize { background: rgba(255, 200, 50, 0.25); border-color: #ffcc33; }
.btn-maximize { background: rgba(50, 255, 50, 0.25); border-color: #33ff33; }

.terminal-title-text {
    color: #00ff33;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-shadow: 0 0 5px rgba(0, 255, 51, 0.4);
}

/* Terminal Internal Content Layout */
.terminal-content {
    flex: 1;
    padding: 24px 30px 16px;
    overflow-y: auto;
    scrollbar-width: none; /* Hide default scrollbar in Firefox */
    -ms-overflow-style: none;  /* Hide default scrollbar in IE/Edge */
    color: #00ff33;
    text-shadow: 0 0 4px rgba(0, 255, 51, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* push actions to bottom nicely */
    gap: 15px;
}

.terminal-content::-webkit-scrollbar {
    display: none; /* Hide default scrollbar in Chrome/Safari/Opera */
}

/* Glowing Monospace ASCII Logo */
.terminal-logo-ascii {
    font-family: 'Space Mono', Courier, monospace;
    font-size: clamp(0.45rem, 1.1vw, 0.95rem);
    line-height: 1.15;
    font-weight: bold;
    color: #00ff33;
    text-shadow: 0 0 8px rgba(0, 255, 51, 0.7);
    margin: 10px auto 5px;
    text-align: center;
    white-space: pre;
    display: block;
    pointer-events: none;
}

.terminal-brand-header {
    text-align: center;
}

.terminal-system-version {
    font-size: 0.75rem;
    color: #88ffaa;
    opacity: 0.7;
    letter-spacing: 2px;
    margin-top: 5px;
    text-transform: uppercase;
}

/* Retro BIOS Diagnostics Status Grid */
.terminal-status-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    border: 1px solid rgba(0, 255, 51, 0.25);
    padding: 14px 20px;
    border-radius: 6px;
    background: rgba(0, 20, 5, 0.3);
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.status-label {
    color: #88ffaa;
    opacity: 0.75;
    letter-spacing: 1px;
}

.status-val {
    font-weight: bold;
    text-shadow: 0 0 5px currentColor;
    letter-spacing: 1px;
}

.status-val.secure {
    color: #00ff33;
}

.status-val.locked {
    color: #ffaa00;
    animation: diagnostic-blink 1s infinite alternate;
}

@keyframes diagnostic-blink {
    0% { opacity: 0.45; text-shadow: 0 0 1px #ffaa00; }
    100% { opacity: 1; text-shadow: 0 0 8px #ffaa00; }
}

/* Visual Instructions Panel */
.terminal-instructions {
    text-align: center;
    padding: 15px 20px;
    background: rgba(0, 255, 80, 0.04);
    border-left: 4px solid #00ff33;
    border-radius: 4px;
    margin: 5px 0;
}

.instruction-text {
    font-size: 0.9rem;
    color: #00ff33;
    text-shadow: 0 0 4px rgba(0, 255, 51, 0.4);
    font-weight: bold;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

.keyword-highlight {
    color: #ffffff;
    background: rgba(0, 255, 51, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #00ff33;
    box-shadow: 0 0 6px rgba(0, 255, 51, 0.25);
    animation: keyword-glow 1.2s infinite alternate;
    font-weight: bold;
}

@keyframes keyword-glow {
    0% { text-shadow: 0 0 2px #fff; box-shadow: 0 0 4px rgba(0, 255, 51, 0.2); }
    100% { text-shadow: 0 0 8px #fff, 0 0 15px #00ff33; box-shadow: 0 0 10px rgba(0, 255, 51, 0.5); }
}

/* User Terminal Prompt Area */
.terminal-input-container {
    display: flex;
    justify-content: center;
    background: rgba(0, 12, 0, 0.6);
    border: 1px solid rgba(0, 255, 51, 0.15);
    border-radius: 6px;
    padding: 14px 20px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.prompt-text {
    color: #00ff33;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 51, 0.4);
    white-space: nowrap;
    letter-spacing: 1px;
}

.input-display {
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 0 15px rgba(0, 255, 51, 0.6);
    min-height: 1.2em;
    word-break: break-all;
    font-size: 1rem;
    letter-spacing: 1px;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: #00ff33;
    box-shadow: 0 0 8px #00ff33;
    vertical-align: middle;
    animation: cursor-blink-anim 0.8s infinite steps(2);
}

@keyframes cursor-blink-anim {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    z-index: -100;
}

/* Action Area & Glowing Arcade Auto-Boot Button */
.terminal-actions {
    margin-top: 5px;
}

.terminal-btn-action {
    position: relative;
    background-color: #031503;
    border: 2px solid #00ff33;
    color: #00ff33;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 4px 10px rgba(0, 255, 51, 0.15),
        inset 0 0 8px rgba(0, 255, 51, 0.1);
    overflow: hidden;
    letter-spacing: 2px;
}

.terminal-btn-action:hover {
    background-color: #00ff33;
    color: #010401;
    box-shadow: 
        0 0 20px rgba(0, 255, 51, 0.75),
        0 0 40px rgba(0, 255, 51, 0.3);
    text-shadow: none;
    transform: translateY(-2px);
}

.terminal-btn-action:active {
    transform: translateY(1px);
    box-shadow: 0 0 10px rgba(0, 255, 51, 0.4);
}

/* Access Granted Flashing Alert Box */
.access-popup {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(1, 4, 1, 0.98);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.access-popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-border {
    padding: 45px 35px;
    border: 3px double #00ff33;
    background-color: #020502;
    border-radius: 12px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 35px rgba(0, 255, 51, 0.6), inset 0 0 25px rgba(0, 255, 51, 0.25);
    position: relative;
    animation: popup-scale-in 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popup-scale-in {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.popup-title {
    color: #00ff33;
    font-size: 0.8rem;
    letter-spacing: 3px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.popup-message {
    color: #00ff33;
    font-size: 2.6rem;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 255, 51, 0.8), 0 0 25px rgba(0, 255, 51, 0.6);
    margin-bottom: 20px;
    letter-spacing: 2px;
    animation: flash-anim 0.5s infinite steps(2);
}

@keyframes flash-anim {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

.popup-subtext {
    color: #88ffaa;
    font-size: 0.8rem;
    margin-bottom: 30px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Decryption Progress Bar */
.popup-loader {
    width: 100%;
    height: 24px;
    border: 2px solid #00ff33;
    padding: 3px;
    border-radius: 4px;
    background: rgba(0, 255, 51, 0.05);
}

.popup-bar {
    height: 100%;
    width: 0%;
    background-color: #00ff33;
    box-shadow: 0 0 12px rgba(0, 255, 51, 0.8);
    transition: width 0.1s linear;
}

/* CRT Screen Turn Off Animation (Physics Screen Deflection Collapse) */
.terminal-screen.shutting-down {
    animation: crt-turn-off-anim 0.65s cubic-bezier(0.25, 1, 0.3, 1) forwards;
}

@keyframes crt-turn-off-anim {
    0% {
        transform: scale(1) translate3d(0, 0, 0);
        filter: brightness(1) contrast(1) blur(0px);
    }
    40% {
        transform: scale(1.02, 0.002) translate3d(0, 0, 0);
        filter: brightness(4) contrast(2) blur(1px);
    }
    100% {
        transform: scale(0, 0) translate3d(0, 0, 0);
        filter: brightness(15) contrast(6) blur(2px);
        opacity: 0;
        visibility: hidden;
    }
}

/* Access Denied Custom Modal Styling */
.access-popup.denied {
    background-color: rgba(10, 0, 0, 0.98); /* subtle red ambient tint */
}

.popup-border-denied {
    border-color: #ff3333;
    box-shadow: 0 0 35px rgba(255, 51, 51, 0.5), inset 0 0 25px rgba(255, 51, 51, 0.15);
}

.popup-title-denied {
    color: #ff3333;
    text-shadow: 0 0 5px rgba(255, 51, 51, 0.4);
}

.popup-message-denied {
    color: #ff3333;
    font-size: 2.6rem;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.8), 0 0 25px rgba(255, 51, 51, 0.6);
    margin-bottom: 20px;
    letter-spacing: 2px;
    animation: flash-anim-red 0.5s infinite steps(2);
}

.popup-subtext-denied {
    color: #ffcccc;
    line-height: 1.6;
}

.keyword-highlight.red {
    color: #ffffff;
    background: rgba(255, 51, 51, 0.2);
    border: 1px solid #ff3333;
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.35);
    animation: keyword-glow-red 1.2s infinite alternate;
}

.btn-denied {
    background-color: #200404;
    border-color: #ff3333;
    color: #ff3333;
    box-shadow: 0 4px 10px rgba(255, 51, 51, 0.15), inset 0 0 8px rgba(255, 51, 51, 0.1);
}

.btn-denied:hover {
    background-color: #ff3333;
    color: #020502;
    box-shadow: 
        0 0 20px rgba(255, 51, 51, 0.75),
        0 0 40px rgba(255, 51, 51, 0.3);
}

@keyframes flash-anim-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

@keyframes keyword-glow-red {
    0% { text-shadow: 0 0 2px #fff; box-shadow: 0 0 4px rgba(255, 51, 51, 0.2); }
    100% { text-shadow: 0 0 8px #fff, 0 0 15px #ff3333; box-shadow: 0 0 10px rgba(255, 51, 51, 0.5); }
}

/* Terminal Language Switcher in Header */
.terminal-lang-select {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Space Mono', Courier, monospace;
    font-size: 0.75rem;
    color: rgba(0, 255, 51, 0.4);
    z-index: 10;
}

.terminal-lang-select .separator {
    opacity: 0.5;
    user-select: none;
    color: #00ff33;
}

.terminal-lang-btn {
    background: none;
    border: none;
    color: rgba(0, 255, 51, 0.4);
    font-family: 'Space Mono', Courier, monospace;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    text-shadow: none;
}

.terminal-lang-btn:hover {
    color: #00ff33;
    text-shadow: 0 0 5px rgba(0, 255, 51, 0.6);
}

.terminal-lang-btn.active {
    color: #020502;
    background-color: #00ff33;
    box-shadow: 0 0 10px rgba(0, 255, 51, 0.5);
    text-shadow: none;
}

/* PHYSICAL DIALS & LED CHASSIS PANEL */
.terminal-chassis-controls {
    background: linear-gradient(to bottom, #1d251d 0%, #151b15 100%);
    border-top: 3px solid #0f140f;
    padding: 8px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.05), 0 -2px 10px rgba(0, 0, 0, 0.6);
    height: 48px;
    box-sizing: border-box;
    user-select: none;
    z-index: 15;
}

.brand-badge {
    color: rgba(0, 255, 51, 0.35);
    font-family: 'Space Mono', Courier, monospace;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
}

.dials-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dial-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dial-label {
    color: rgba(0, 255, 51, 0.3);
    font-family: 'Space Mono', Courier, monospace;
    font-size: 0.5rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dial {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #2a2a2a 0%, #0d0d0d 100%);
    border: 1px solid #050a05;
    box-shadow: 
        0 1px 3px rgba(0,0,0,0.5), 
        inset 0 1px 2px rgba(255,255,255,0.1);
    position: relative;
    cursor: pointer;
}

/* Dial pointer notch indicator */
.dial::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 5px;
    background-color: rgba(0, 255, 51, 0.5);
    border-radius: 1px;
}

/* Custom rotations for different dials to feel set by hand */
.dial-brightness::after { transform: translateX(-50%) rotate(45deg); transform-origin: bottom center; }
.dial-contrast::after { transform: translateX(-50%) rotate(-30deg); transform-origin: bottom center; }
.dial-vhold::after { transform: translateX(-50%) rotate(120deg); transform-origin: bottom center; }

.power-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}

.led-light-amber {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ffaa00; /* Warm vintage power light */
    box-shadow: 
        0 0 6px #ffaa00, 
        0 0 12px #ffaa00, 
        inset 0 1px 1px rgba(255,255,255,0.5);
    animation: led-glow-pulse 2s infinite alternate;
}

@keyframes led-glow-pulse {
    0% { opacity: 0.85; box-shadow: 0 0 4px #ffaa00, 0 0 8px #ffaa00; }
    100% { opacity: 1; box-shadow: 0 0 10px #ffaa00, 0 0 20px #ffaa00; }
}

/* Extra Horizontal Sync Tracking line */
.crt-sync-distortion {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 140px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 255, 51, 0.02) 20%,
        rgba(0, 255, 51, 0.06) 50%,
        rgba(0, 255, 51, 0.02) 80%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 12;
    animation: crt-sync-sweep 18s linear infinite;
    mix-blend-mode: screen;
}

@keyframes crt-sync-sweep {
    0% { transform: translateY(-140px); }
    100% { transform: translateY(100vh); }
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 768px) {
    .terminal-screen {
        padding: 0;
    }

    .terminal-window {
        height: 100vh;
        max-width: 100%;
        border: none;
        border-radius: 0;
        box-shadow: inset 0 0 25px rgba(0,0,0,0.9);
        transform: none !important; /* disable 3D perspective tilt on mobile */
    }

    .terminal-chassis-controls {
        display: none !important; /* hide chassis panel on edge-to-edge mobile screens */
    }

    .terminal-header {
        padding: 12px 15px;
        border-bottom-width: 1px;
    }

    .terminal-title-text {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }

    .terminal-content {
        padding: 16px 14px;
        justify-content: center;
        gap: 12px;
    }

    .terminal-logo-ascii {
        font-size: clamp(0.35rem, 2.5vw, 0.7rem);
        margin: 5px auto;
    }

    .terminal-system-version {
        font-size: 0.65rem;
        letter-spacing: 1.5px;
    }

    .terminal-status-panel {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px 14px;
    }

    .status-item {
        font-size: 0.72rem;
    }

    .terminal-instructions {
        padding: 10px 14px;
    }

    .instruction-text {
        font-size: 0.78rem;
        line-height: 1.6;
    }

    .terminal-input-container {
        padding: 10px 14px;
    }

    .prompt-text {
        font-size: 0.8rem;
    }

    .input-display {
        font-size: 0.9rem;
    }

    /* Larger touch target for auto-boot button */
    .terminal-btn-action {
        padding: 14px 24px;
        font-size: 0.85rem;
        min-height: 48px;
    }

    .popup-border {
        padding: 30px 18px;
        width: 92%;
        border-width: 2px;
    }

    .popup-border-denied {
        padding: 30px 18px;
        width: 92%;
        border-width: 2px;
    }

    .popup-message {
        font-size: 1.6rem;
    }

    .popup-message-denied {
        font-size: 1.6rem;
    }

    .popup-subtext,
    .popup-subtext-denied {
        font-size: 0.72rem;
        line-height: 1.6;
    }

    .popup-actions-denied {
        margin-top: 16px;
    }

    .btn-denied {
        padding: 12px 20px;
        min-height: 48px;
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   FLOATING MUSIC CONTROLLER (NEO-BRUTALIST PREMIUM STYLING)
   ========================================================================== */
.music-control-container {
    position: fixed;
    bottom: 32px;
    left: 32px;
    z-index: 998; /* Floats above normal sections, sits perfectly balanced with scroll-to-top button */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

/* Auto-hide music controller when retro terminal loading screen is active */
.terminal-active .music-control-container {
    display: none !important;
}

.music-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    color: #0f0f0f;
    background-color: var(--primary-yellow);
    border: var(--border-width) solid var(--border-color);
    border-radius: 12px;
    box-shadow: 6px 6px 0px var(--shadow-color);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.3s ease, color 0.3s ease;
    outline: none;
}

.music-toggle-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px var(--shadow-color);
    background-color: var(--primary-pink);
    color: white;
}

.music-toggle-btn:hover .retro-visualizer .bar {
    background-color: white;
}

.music-toggle-btn:active {
    transform: translate(3px, 3px) !important;
    box-shadow: 3px 3px 0px var(--shadow-color) !important;
}

/* Sound Wave & Speaker Icon styling */
.music-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.speaker-icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.music-toggle-btn:hover .speaker-icon {
    transform: scale(1.1);
}

.sound-wave {
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: left center;
}

.music-toggle-btn.paused .sound-wave {
    opacity: 0.15;
    transform: scaleX(0.7);
}

/* Retro Visualizer Jumping Bars */
.retro-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 15px;
    height: 14px;
    flex-shrink: 0;
}

.retro-visualizer .bar {
    width: 3px;
    height: 100%;
    background-color: #0f0f0f;
    border-radius: 1px;
    transform-origin: bottom;
    transition: background-color 0.3s ease, transform 0.3s ease;
    transform: scaleY(0.25);
}

/* Custom jump animations when music is playing */
.music-toggle-btn.playing .retro-visualizer .bar-1 {
    animation: bounce-bar-1 0.6s ease-in-out infinite alternate;
}

.music-toggle-btn.playing .retro-visualizer .bar-2 {
    animation: bounce-bar-2 0.4s ease-in-out infinite alternate;
}

.music-toggle-btn.playing .retro-visualizer .bar-3 {
    animation: bounce-bar-3 0.8s ease-in-out infinite alternate;
}

@keyframes bounce-bar-1 {
    0% { transform: scaleY(0.2); }
    100% { transform: scaleY(0.95); }
}

@keyframes bounce-bar-2 {
    0% { transform: scaleY(0.3); }
    100% { transform: scaleY(1.0); }
}

@keyframes bounce-bar-3 {
    0% { transform: scaleY(0.15); }
    100% { transform: scaleY(0.85); }
}

/* Muted / Paused state visual adjustments */
.music-toggle-btn.paused {
    background-color: #24242d;
    color: var(--text-color);
    box-shadow: 4px 4px 0px var(--shadow-color);
    border-color: var(--border-color);
}

.music-toggle-btn.paused .retro-visualizer .bar {
    background-color: var(--text-color);
}

.music-toggle-btn.paused:hover {
    background-color: var(--primary-pink);
    color: white;
}

.music-toggle-btn.paused:hover .retro-visualizer .bar {
    background-color: white;
}

/* Responsive Scaling for music widget on smaller devices */
@media (max-width: 768px) {
    .music-control-container {
        bottom: 20px;
        left: 20px;
    }
    
    .music-toggle-btn {
        padding: 10px 14px;
        font-size: 0.82rem;
        border-radius: 10px;
        border-width: 3px;
        box-shadow: 4px 4px 0px var(--shadow-color);
    }

    /* Ensure music and scroll-to-top don't overlap */
    .scroll-top-btn.visible {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 480px) {
    .music-control-container {
        bottom: 16px;
        left: 16px;
    }
    
    .music-toggle-btn {
        padding: 10px 12px;
        font-size: 0.75rem;
        gap: 6px;
        border-width: 3px;
        box-shadow: 3px 3px 0px var(--shadow-color);
    }
    
    .retro-visualizer {
        width: 12px;
        height: 11px;
        gap: 2px;
    }
    
    .retro-visualizer .bar {
        width: 2px;
    }

    .scroll-top-btn.visible {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}
