:root {
    --nav-height: 0px;
}

/* --- Base & Typography --- */
body {
    background-color: #0A192F; /* Dark Navy Blue */
    color: #ccd6f6; /* Light Slate */
    font-family: 'Roboto Mono', monospace;
    font-weight: 300;
    margin: 0;
    padding: 0 0 90px 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 0;
    /* Provide a subtle page-wide backdrop to keep contrast when scrolling */
    background-image:
        linear-gradient(180deg, rgba(10,25,47,0.92), rgba(10,25,47,0.92)),
        radial-gradient(circle at 20% 20%, rgba(100,255,218,0.04), transparent 40%),
        radial-gradient(circle at 80% 40%, rgba(100,200,255,0.04), transparent 45%);
    background-attachment: fixed, fixed, fixed;
    background-blend-mode: normal, screen, screen;
}

.mobile-lite #three-js-container,
.mobile-lite #grid-veil,
.mobile-lite #lattice-overlay,
.mobile-lite #cursor-spotlight,
.mobile-lite #cursor-trails,
.mobile-lite #shockwave,
.mobile-lite #hero-stinger {
    display: none !important;
}

h1, h2 {
    color: #E6F1FF; /* Brightest White */
    font-weight: 700;
}

.ascii-name {
    color: #E6F1FF;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
    margin: 0.5rem 0 0 0;
    white-space: pre;
    text-align: center;
    line-height: 1.15;
    letter-spacing: 0;
    max-width: 100%;
    overflow: hidden;
    padding: 0.5rem 0.6rem;
    display: inline-block;
    position: relative;
    transform: perspective(900px) rotateX(3deg) rotateY(-3deg) translateZ(6px);
    transform-style: preserve-3d;
    background: linear-gradient(90deg, #E6F1FF 0%, #64FFDA 50%, #E6F1FF 100%);
    background-size: 200% 100%;
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    text-shadow:
        0 0 6px rgba(100, 255, 218, 0.2),
        0 0 12px rgba(100, 255, 218, 0.12),
        0 12px 24px rgba(0,0,0,0.55),
        0 18px 42px rgba(0,0,0,0.45);
    animation: hueSweep 6s linear infinite, asciiBreathe 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 24px rgba(0,0,0,0.5));
    transition: transform 0.4s ease, filter 0.4s ease;
}

.ascii-name::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: radial-gradient(circle at 50% 60%, rgba(100,255,218,0.15), transparent 65%);
    filter: blur(10px);
    opacity: 0.65;
    transform: translateZ(-4px);
    z-index: -1;
    pointer-events: none;
}

.ascii-name:hover {
    transform: perspective(900px) rotateX(2deg) rotateY(-2deg) translateZ(10px) scale(1.01);
    filter: drop-shadow(0 14px 30px rgba(0,0,0,0.55));
}

@keyframes asciiBreathe {
    0% { transform: perspective(900px) rotateX(3deg) rotateY(-3deg) translateZ(6px) scale(1); }
    50% { transform: perspective(900px) rotateX(2deg) rotateY(-2deg) translateZ(11px) scale(1.04); }
    100% { transform: perspective(900px) rotateX(3deg) rotateY(-3deg) translateZ(6px) scale(1); }
}

a {
    color: #64FFDA; /* Desaturated Cyan/Mint */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #64FFDA;
    text-shadow: 0 0 8px rgba(100, 255, 218, 0.3);
}

/* --- 3D Background Container --- */
#three-js-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Place it behind everything */
    transform-origin: center center;
    transition: transform 0.9s ease, filter 0.9s ease;
    background: radial-gradient(circle at 30% 30%, rgba(100,255,218,0.12), transparent 35%),
                radial-gradient(circle at 70% 60%, rgba(100,180,255,0.10), transparent 40%),
                #0A192F;
}

#grid-veil {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(100,255,218,0.08) 0, rgba(100,255,218,0.08) 1px, transparent 1.2px),
        linear-gradient(60deg, rgba(100,255,218,0.08) 1px, transparent 1px),
        linear-gradient(-60deg, rgba(100,255,218,0.08) 1px, transparent 1px);
    background-size: 120px 120px, 120px 120px, 120px 120px;
    opacity: 0.25;
    transform: scale(1);
    mix-blend-mode: screen;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#lattice-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(100,255,218,0.06) 0, rgba(100,255,218,0.06) 1px, transparent 1.2px),
        linear-gradient(60deg, rgba(100,255,218,0.04) 1px, transparent 1px),
        linear-gradient(-60deg, rgba(100,255,218,0.04) 1px, transparent 1px);
    background-size: 140px 140px, 140px 140px, 140px 140px;
    opacity: 0.15;
    mix-blend-mode: screen;
    transform: perspective(1200px) rotateX(0deg) rotateY(0deg);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#vignette-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(0,0,0,0.45) 100%);
    opacity: 0.0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.vignette-strong #vignette-overlay {
    opacity: 1;
}

#shockwave {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 3;
}

.shock-circle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100,255,218,0.35) 0%, rgba(100,255,218,0) 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.6;
    animation: shockwave 0.9s ease-out forwards;
}

#cursor-trails {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 3;
}

.trail-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
    animation: trailFade 0.5s ease-out forwards;
}

#section-strip {
    position: fixed;
    left: 8px;
    top: 0;
    width: 3px;
    height: 40px;
    background: linear-gradient(180deg, rgba(100,255,218,0.1), rgba(100,255,218,0.7), rgba(100,255,218,0.1));
    box-shadow: 0 0 12px rgba(100,255,218,0.4);
    border-radius: 999px;
    opacity: 0.7;
    transform: translateY(0);
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 3;
}

.news-panel {
    border: 1px solid rgba(100,255,218,0.16);
    border-radius: 14px;
    padding: 0.9rem;
    background: rgba(10,25,47,0.35);
    box-shadow: 0 16px 32px rgba(0,0,0,0.25);
}

#news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.65rem;
    min-height: 120px;
}

#news-list li {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(230,241,255,0.9);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(100,255,218,0.14);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    box-shadow: 0 12px 26px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
    overflow: hidden;
}

#news-list li span {
    display: block;
    color: rgba(100,255,218,0.78);
    font-size: 0.75rem;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

#news-list li a {
    color: rgba(230,241,255,0.95);
    text-decoration: none;
}

#news-list li a:hover {
    color: #64FFDA;
}

#news-list li:hover {
    transform: translateY(-2px);
    border-color: rgba(100,255,218,0.35);
    box-shadow: 0 12px 26px rgba(0,0,0,0.24);
    background: rgba(255,255,255,0.04);
}

.heat-strip {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 4px;
    background: rgba(100,255,218,0.25);
}

.heat-green .heat-strip { background: rgba(100,255,218,0.7); }
.heat-yellow .heat-strip { background: rgba(255,210,120,0.8); }
.heat-red .heat-strip { background: rgba(255,120,120,0.8); }

.news-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(230,241,255,0.7) !important;
    border: 1px dashed rgba(100,255,218,0.2);
    background: rgba(255,255,255,0.02);
}

.news-badge {
    display: inline-block;
    padding: 2px 6px;
    margin-bottom: 4px;
    border-radius: 6px;
    background: rgba(100,255,218,0.12);
    border: 1px solid rgba(100,255,218,0.3);
    color: #64FFDA;
    font-size: 0.7rem;
    letter-spacing: 0.6px;
}

.news-refresh {
    position: relative;
    background: rgba(100,255,218,0.08);
    border: 1px solid rgba(100,255,218,0.4);
    color: #E6F1FF;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.news-refresh:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: rgba(100,255,218,0.7);
}

.news-refresh.spin {
    animation: spin 0.8s linear infinite;
}

.news-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 36px;
}

.news-updated {
    font-size: 0.85rem;
    color: rgba(204,214,246,0.8);
}

.overlay-content {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: calc(var(--nav-height) - 4px) 2rem 0 2rem; /* top padding keeps content below nav */
    z-index: 1;
    transition: opacity 0.7s ease;
}

.cursor-spotlight {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(240px at 50% 50%, rgba(100,255,218,0.16), transparent 55%);
    mix-blend-mode: screen;
    opacity: 0.35;
    transition: opacity 0.3s ease;
    z-index: 2;
}

#code-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    mix-blend-mode: screen;
}

#code-overlay pre {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    white-space: pre-wrap;
    color: rgba(100, 255, 218, 0.26);
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    line-height: 1.6;
    letter-spacing: 0.5px;
    filter: blur(0.15px);
    text-shadow: 0 0 10px rgba(100,255,218,0.22);
}

@media (max-width: 720px) {
    nav a {
        animation: none;
    }
    .stat-card, .skill-col, .case-card, .contact-card, .contact-form, .news-panel, .button, .chip, .tag {
        box-shadow: 0 8px 16px rgba(0,0,0,0.22);
    }
    #grid-veil, #lattice-overlay, #code-overlay {
        opacity: 0.04;
    }
    :root { --nav-height: 18px; }
    #code-overlay pre {
        color: rgba(100, 255, 218, 0.16);
    }
    body {
        padding: 0 0 78px 0;
        /* High-contrast but static mobile backdrop */
        background-color: #0A192F;
        background-image:
            /* hero glow */
            radial-gradient(ellipse at 24% 18%, rgba(100,255,218,0.12), rgba(10,25,47,0) 46%),
            /* anchor glow */
            radial-gradient(ellipse at 82% 72%, rgba(90,180,255,0.1), rgba(10,25,47,0) 54%),
            /* diagonal wash */
            linear-gradient(135deg, rgba(100,255,218,0.1) 0%, rgba(100,255,218,0.0) 28%, rgba(80,150,255,0.12) 62%, rgba(100,255,218,0.0) 100%),
            /* base depth */
            linear-gradient(180deg, #0b1d31 0%, #0b2236 40%, #0c2c44 100%),
            /* sparse grid */
            repeating-linear-gradient(0deg, rgba(100, 255, 218, 0.016) 0, rgba(100, 255, 218, 0.016) 1px, transparent 1px, transparent 48px),
            repeating-linear-gradient(90deg, rgba(100, 255, 218, 0.016) 0, rgba(100, 255, 218, 0.016) 1px, transparent 1px, transparent 48px),
            /* fine noise */
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='24' height='24' filter='url(%23n)' opacity='0.11'/%3E%3C/svg%3E");
        background-attachment: fixed, fixed, fixed, fixed, fixed, fixed, fixed;
        background-blend-mode: normal, normal, screen, normal, screen, screen, normal;
        position: relative;
    }
    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.12);
        pointer-events: none;
        z-index: 0.5;
    }
    /* Boost readability on mobile */
    body, p, li {
        color: rgba(234, 242, 255, 0.98);
        font-weight: 400;
        letter-spacing: 0.1px;
    }
    h1, h2, h3 {
        color: #f4f7ff;
    }
    .section-sub, .lead {
        color: rgba(234, 242, 255, 0.92);
        font-weight: 500;
    }
    .stat-label {
        color: rgba(234, 242, 255, 0.78);
        font-weight: 500;
    }
    .chip, .tag {
        color: #f0f6ff;
        border-color: rgba(100,255,218,0.55);
    }
    /* Make code overlay punch through the gradient on mobile */
    /* Code overlay sits above the gradient on mobile */
    #code-overlay {
        mix-blend-mode: normal !important;
        opacity: 0.35 !important;
        z-index: 1 !important;
        background: none !important;
    }
    /* Bring back code overlay on mobile for texture */
    .mobile-lite #code-overlay {
        display: block !important;
    }
    .mobile-lite #code-overlay pre {
        color: rgba(255, 255, 255, 0.5);
        font-size: 1rem;
        line-height: 1.5;
        filter: blur(0.2px);
        text-shadow: none;
    }
    .overlay-content {
        padding: 0.4rem 1rem 0 1rem;
    }
    main {
        margin-top: 0.1rem;
        padding-bottom: 3rem;
        scroll-snap-type: y proximity;
    }
    .hero {
        gap: 0.5rem;
    }
    .hero .subtitle {
        margin-top: 0.2rem;
        margin-bottom: 0.4rem;
    }
    #terminal {
        margin-top: 0.2rem;
    }
    .ascii-name {
        margin-top: 0.2rem;
    }
    section h2 {
        font-size: 1.7rem;
        margin-bottom: 1rem;
    }
    .section-header {
        gap: 0.3rem;
        margin-bottom: 1rem;
    }
    .section-kicker {
        font-size: 0.8rem;
        letter-spacing: 1.5px;
    }
    .section-sub, .lead {
        font-size: 1rem;
        line-height: 1.5;
    }
    .lead {
        margin-bottom: 0.9rem;
    }
    .chip-row, .tag-row {
        gap: 0.5rem;
        margin-bottom: 0.9rem;
        overflow-x: auto;
        padding-bottom: 0.2rem;
    }
    .chip, .tag {
        padding: 0.32rem 0.7rem;
        font-size: 0.85rem;
        box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    }
    .stat-grid {
        gap: 0.8rem;
        margin-top: 0.6rem;
    }
    #news-list {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    #mobile-nav {
        padding: 0.45rem 0.35rem;
    }
    /* Sticky refresh pill inside news on mobile */
    #news-refresh {
        position: sticky;
        left: 0;
        bottom: 0.8rem;
        margin-left: 0.2rem;
        z-index: 5;
    }
}


/* --- Navigation --- */
nav {
    display: none !important;
}

#mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10,25,47,0.92);
    border-top: 1px solid rgba(100,255,218,0.16);
    box-shadow: 0 -10px 20px rgba(0,0,0,0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.55rem 0.4rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 2500;
    gap: 0.4rem;
}

#mobile-nav button {
    flex: 1 1 0;
    background: linear-gradient(145deg, rgba(10,25,47,0.9), rgba(10,25,47,0.78));
    color: #64FFDA;
    border: 1px solid rgba(100,255,218,0.22);
    border-radius: 16px;
    padding: 0.4rem 0.2rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    box-shadow: 0 6px 12px rgba(0,0,0,0.35), 0 0 12px rgba(100,255,218,0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

#mobile-nav button span {
    font-size: 0.65rem;
    letter-spacing: 0.4px;
    opacity: 0.9;
    color: #ccd6f6;
}
#mobile-nav .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #64FFDA;
    opacity: 0.9;
}
#mobile-nav .icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

#mobile-nav button.active {
    background: linear-gradient(145deg, rgba(15,40,70,0.95), rgba(12,30,55,0.92));
    border-color: rgba(100,255,218,0.45);
    box-shadow: 0 10px 18px rgba(0,0,0,0.4), 0 0 14px rgba(100,255,218,0.2);
    color: #64FFDA;
}

#mobile-nav button:active {
    transform: translateY(1px);
    background: rgba(10,25,47,0.78);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.35);
}

/* Subtle ripple for primary CTAs and bottom nav (CSS-only) */
.button,
#mobile-nav button {
    position: relative;
    overflow: hidden;
}

.button::after,
#mobile-nav button::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, rgba(100,255,218,0.28) 0%, rgba(100,255,218,0) 60%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.45s ease;
    pointer-events: none;
}

.button:active::after,
#mobile-nav button:active::after {
    transform: scale(1);
    opacity: 1;
}

.hide-nav {
    transform: translateY(-120%);
    transition: transform 0.35s ease;
}
nav a {
    display: inline-flex;
}
nav a:hover {
    display: inline-flex;
}
nav a.active {
    display: inline-flex;
}
.audio-toggle, nav a {
    transition: color 0.25s ease, text-shadow 0.25s ease, transform 0.25s ease;
}
nav a:hover, nav a:focus-visible {
    transform: translateY(-2px);
    background: rgba(100,255,218,0.08);
    border-radius: 8px;
}

.settings-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.settings-toggle {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(100,255,218,0.3);
    color: #E6F1FF;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.settings-toggle:hover,
.settings-toggle[aria-expanded="true"] {
    border-color: rgba(100, 255, 218, 0.8);
    box-shadow: 0 0 12px rgba(100, 255, 218, 0.25);
}

.settings-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: rgba(10, 25, 47, 0.88);
    border: 1px solid rgba(100,255,218,0.25);
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
    padding: 0.65rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 150;
}

.settings-menu.show {
    display: flex;
}

#nav-select {
    display: none;
    background: rgba(10,25,47,0.8);
    border: 1px solid rgba(100,255,218,0.4);
    color: #E6F1FF;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 1px;
}

.focus-toggle {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(100,255,218,0.3);
    color: #E6F1FF;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.focus-toggle:hover, .focus-toggle[aria-pressed="true"] {
    border-color: rgba(100, 255, 218, 0.8);
    box-shadow: 0 0 12px rgba(100, 255, 218, 0.25);
}

.nav-label {
    display: inline-block;
}

.no-motion nav a {
    animation: none;
    background: none;
    -webkit-text-fill-color: #ccd6f6;
}

#zoom-overlay {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#zoom-overlay.hide {
    opacity: 0;
    visibility: hidden;
}

body.intro-running #three-js-container {
    transform: scale(1.55) rotate(1.5deg);
    filter: blur(14px) brightness(1.15);
}

body.intro-running nav,
body.intro-running .overlay-content {
    opacity: 1;
}

body.intro-done #three-js-container {
    transform: scale(1) rotate(0deg);
    filter: blur(0) brightness(1);
}

body.intro-done nav,
body.intro-done .overlay-content {
    opacity: 1;
}

body.intro-done #zoom-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#hero-stinger {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(120deg, rgba(100,255,218,0) 45%, rgba(100,255,218,0.18) 50%, rgba(100,255,218,0) 55%);
    transform: translateX(-120%) skewX(-10deg);
    opacity: 0;
    transition: opacity 0.4s ease;
}

body.stinger-run #hero-stinger {
    animation: stingerSweep 1.1s ease forwards;
}

@media (max-width: 720px) {
    .cursor-spotlight {
        opacity: 0;
    }
    #section-strip {
        opacity: 0;
    }
}

.nav-underline {
    position: absolute;
    bottom: 4px;
    left: 0;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, rgba(100,255,218,0.1) 0%, rgba(100,255,218,0.8) 60%, rgba(100,255,218,0.1) 100%);
    border-radius: 999px;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.3s ease;
    pointer-events: none;
    overflow: hidden;
}

.nav-underline::after {
    content: "";
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: scan 1.4s linear infinite;
}

nav a:hover .nav-underline,
nav a:focus-visible .nav-underline,
nav a.active .nav-underline {
    transform: scaleX(1);
}
.audio-toggle {
    background: rgba(100, 255, 218, 0.08);
    border: 1px solid rgba(100, 255, 218, 0.3);
    color: #E6F1FF;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.audio-toggle:hover, .audio-toggle[aria-pressed="true"] {
    border-color: rgba(100, 255, 218, 0.8);
    box-shadow: 0 0 12px rgba(100, 255, 218, 0.25);
}

/* --- Layout & Sections --- */
.hero {
    padding-top: 0.6rem; /* Tighten top gap now that top nav is removed */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    filter: drop-shadow(0 18px 32px rgba(0,0,0,0.35));
}
/* --- Terminal Styles --- */

.hero h1 {
    font-size: 4rem;
    margin: 0;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: #64FFDA; /* Accent color */
    margin-top: 1rem;
    letter-spacing: 3px;
}
.cursor {
    display: inline-block;
    background-color: #64FFDA;
    width: 8px;
    animation: blink 1s step-end infinite, caretGlow 1.4s ease-in-out infinite;
}

.terminal-aura {
    box-shadow: 0 0 24px var(--aura-color, rgba(100,255,218,0.35)), 0 0 0 1px rgba(100,255,218,0.25), 0 0 20px rgba(0, 0, 0, 0.5);
}

#skeleton-overlay {
    display: none !important;
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(100, 255, 218, 0.2), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.8s infinite;
}

.skeleton-title {
    width: min(360px, 80%);
    height: 36px;
}

.skeleton-sub {
    width: min(260px, 70%);
    height: 16px;
}

.skeleton-terminal {
    width: min(720px, 90%);
    height: 220px;
}

#terminal {
    width: 100%;
    max-width: 800px; /* Made wider */
    height: 320px; /* Made taller */
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(100, 255, 218, 0.4);
    border-radius: 4px;
    margin-top: 4rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.62), 0 0 14px rgba(100, 255, 218, 0.24);
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    cursor: text; /* Change cursor to indicate it's a text input area */
    overflow: hidden;
    transition: box-shadow 0.4s ease;
    position: relative;
}

.terminal-tabs {
    display: flex;
    gap: 0.4rem;
    padding: 8px 10px 0 10px;
}

.terminal-tab {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(100,255,218,0.25);
    color: rgba(230,241,255,0.9);
    padding: 0.35rem 0.7rem;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.terminal-tab.active {
    background: rgba(100,255,218,0.08);
    border-color: rgba(100,255,218,0.5);
    color: #64FFDA;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

.terminal-pane {
    display: none;
    padding: 10px;
    flex: 1 1 auto;
}

.terminal-pane.active {
    display: block;
}

.hero-toast {
    position: absolute;
    top: -10px;
    right: 10px;
    background: rgba(10,25,47,0.92);
    border: 1px solid rgba(100,255,218,0.3);
    color: #E6F1FF;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-toast.show {
    opacity: 1;
    transform: translateY(0);
}


#terminal-output {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    text-align: left;
    word-wrap: break-word;
}

#terminal-status {
    padding: 6px 10px;
    font-size: 0.8rem;
    color: rgba(204,214,246,0.8);
    border-top: 1px solid rgba(100,255,218,0.12);
    background: rgba(255,255,255,0.02);
    letter-spacing: 0.2px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

#cmd-picker {
    position: absolute;
    right: 10px;
    bottom: 48px;
    min-width: 220px;
    background: rgba(10, 25, 47, 0.92);
    border: 1px solid rgba(100,255,218,0.25);
    border-radius: 10px;
    box-shadow: 0 12px 26px rgba(0,0,0,0.45);
    color: #E6F1FF;
    font-size: 0.9rem;
    display: none;
    flex-direction: column;
    max-height: 260px;
    overflow-y: auto;
    z-index: 5;
}

#cmd-picker.show {
    display: flex;
}

#cmd-picker button {
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s ease, color 0.15s ease;
}

#cmd-picker button:last-child {
    border-bottom: none;
}

#cmd-picker button:hover {
    background: rgba(100,255,218,0.12);
    color: #64FFDA;
}

.pong-wrapper {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    width: 100%;
    position: relative;
}

.pong-canvas {
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(100,255,218,0.4);
    box-shadow: 0 0 12px rgba(0,0,0,0.5);
    width: 100%;
    height: auto;
}

.pong-touch {
    position: absolute;
    left: 0;
    right: 0;
    opacity: 0;
    z-index: 2;
}

.pong-touch.up {
    top: 0;
    height: 45%;
}

.pong-touch.down {
    bottom: 0;
    height: 45%;
}

.touch-enabled .pong-touch {
    opacity: 0.1;
}

/* Custom scrollbar for terminal */
#terminal-output::-webkit-scrollbar {
    width: 8px;
}
#terminal-output::-webkit-scrollbar-track {
    background: transparent;
}
#terminal-output::-webkit-scrollbar-thumb {
    background: rgba(100, 255, 218, 0.3);
    border-radius: 4px;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    padding: 0 10px 10px 10px;
}

.prompt-led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(100,255,218,0.3);
    margin-right: 8px;
    box-shadow: 0 0 8px rgba(100,255,218,0.4);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.prompt-led.blink {
    transform: scale(1.2);
}

.prompt {
    color: #64FFDA; /* Accent color for prompt */
    margin-right: 8px;
    white-space: nowrap;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #ccd6f6;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    flex-grow: 1;
    outline: none;
    caret-color: #64FFDA; /* Make the actual caret match the theme */
}

main {
    flex-grow: 1;
    position: relative; /* Anchor for the absolute sections */
    margin-top: 1rem; /* Add space between terminal and content */
    padding-bottom: 4rem; /* Add some breathing room at the bottom */
    scroll-snap-type: y mandatory;
}

section {
    position: relative;
    width: 100%;
    scroll-margin-top: calc(var(--nav-height) + 8px);
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    display: none;
    overflow: hidden;
    scroll-snap-align: start;
}

body:not(.js-ready) section {
    display: block;
    opacity: 1;
    pointer-events: auto;
    position: relative;
}

section.active {
    opacity: 1;
    pointer-events: auto;
    display: block;
}

section.fading-out {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

section.fading-in {
    animation: fadeInSection 0.35s ease;
}

section::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 12px;
    border: 1px solid rgba(100,255,218,0.0);
    box-shadow: 0 0 0 rgba(100,255,218,0), 0 0 24px rgba(100,255,218,0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
}

section.glow::before {
    border-color: rgba(100,255,218,0.35);
    box-shadow: 0 0 0 1px rgba(100,255,218,0.2), 0 0 26px rgba(100,255,218,0.4);
    opacity: 1;
}

section.glow-pulse::before {
    animation: none;
}

section .corner-brackets {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.corner {
    display: none;
}

section .sweep {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(100,255,218,0) 35%, rgba(100,255,218,0.08) 50%, rgba(100,255,218,0) 65%);
    transform: translateX(-105%) skewX(-4deg);
    pointer-events: none;
    opacity: 0;
}

section.sweep-run .sweep {
    animation: sweepPass 1s ease-in-out forwards;
}

/* Custom scrollbar for content sections */
section::-webkit-scrollbar {
    width: 8px;
}
section::-webkit-scrollbar-track {
    background: transparent;
}
section::-webkit-scrollbar-thumb {
    background: rgba(100, 255, 218, 0.3);
    border-radius: 4px;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    will-change: transform;
    transition: transform 0.25s ease;
    position: relative;
    overflow: visible;
}

.scan-accent {
    position: absolute;
    bottom: -6px;
    left: 0;
    height: 2px;
    width: 160px;
    max-width: 60%;
    background: linear-gradient(90deg, rgba(100,255,218,0.0) 0%, rgba(100,255,218,0.8) 50%, rgba(100,255,218,0.0) 100%);
    transform: scaleX(0);
    transform-origin: left;
    opacity: 0.9;
    filter: drop-shadow(0 0 8px rgba(100,255,218,0.4));
}

.scan-animate {
    animation: none;
}

.decode-title {
    position: relative;
    display: inline-block;
    background: linear-gradient(90deg, #E6F1FF 0%, #64FFDA 50%, #E6F1FF 100%);
    background-size: 200% 100%;
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    animation: hueSweep 4s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .decode-title {
        animation: none;
        -webkit-text-fill-color: #E6F1FF;
    }
}

.section-kicker {
    color: rgba(100, 255, 218, 0.7);
    letter-spacing: 2px;
    font-size: 0.9rem;
}

.section-sub {
    margin: 0;
    color: rgba(204, 214, 246, 0.85);
    line-height: 1.6;
}

.lead {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #E6F1FF;
    margin-bottom: 1.2rem;
}

.chip-row, .tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.chip, .tag {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(100, 255, 218, 0.5);
    background: rgba(100, 255, 218, 0.08);
    color: #E6F1FF;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(0,0,0,0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    transform-origin: center;
}

.tag.soft {
    border-color: rgba(100, 255, 218, 0.3);
    background: rgba(100, 255, 218, 0.05);
}

.chip:hover, .tag:hover, .chip:focus-visible, .tag:focus-visible {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 24px rgba(0,0,0,0.28);
    border-color: rgba(100, 255, 218, 0.8);
    outline: none;
}

.chip:active,
.tag:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

[data-stagger-item] {
    opacity: 1;
    transform: none;
}

.stagger-in {
    animation: fadeUp 0.35s ease forwards;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    --depth: 0px;
    --liftY: 0px;
    --tiltX: 0deg;
    --tiltY: 0deg;
    --scale: 1;
    padding: 1rem;
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 18px 40px rgba(0,0,0,0.36), 0 0 14px rgba(100,255,218,0.16);
    transform: perspective(1200px) translateZ(var(--depth)) translateY(var(--liftY)) rotateX(var(--tiltX)) rotateY(var(--tiltY)) scale(var(--scale));
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.stat-label {
    color: rgba(204, 214, 246, 0.75);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.4rem;
    color: #E6F1FF;
    margin-top: 0.3rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.skill-col {
    --depth: 0px;
    --liftY: 0px;
    --tiltX: 0deg;
    --tiltY: 0deg;
    --scale: 1;
    padding: 1.1rem;
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    box-shadow: 0 16px 34px rgba(0,0,0,0.34), 0 0 14px rgba(100,255,218,0.14);
    transform: perspective(1200px) translateZ(var(--depth)) translateY(var(--liftY)) rotateX(var(--tiltX)) rotateY(var(--tiltY)) scale(var(--scale));
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.skill-col h3 {
    margin: 0 0 0.3rem 0;
    color: #E6F1FF;
}

.muted {
    color: rgba(204, 214, 246, 0.75);
    margin: 0 0 0.6rem 0;
}

.skill-col ul {
    padding-left: 18px;
    margin: 0 0 0.8rem 0;
    line-height: 1.6;
}

.playbooks h3 {
    margin: 0 0 0.6rem 0;
}

.playbooks details {
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    margin-bottom: 0.7rem;
    overflow: hidden;
}

.playbooks summary {
    padding: 0.9rem 1rem;
    cursor: pointer;
    user-select: none;
    color: #E6F1FF;
}

.playbook-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem;
    padding: 0.9rem 1rem 1rem 1rem;
    color: #ccd6f6;
    line-height: 1.5;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.edge-divider {
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, rgba(100,255,218,0) 0%, rgba(100,255,218,0.8) 40%, rgba(100,255,218,0) 100%);
    opacity: 0;
    transform: scaleX(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
    box-shadow: 0 0 12px rgba(100,255,218,0.4);
}

.edge-divider.pulse {
    opacity: 0.7;
    transform: scaleX(1);
    animation: none;
}

.site-footer {
    margin: 2rem 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(204, 214, 246, 0.8);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    position: relative;
}

.site-footer .mono {
    font-family: 'Roboto Mono', monospace;
    color: #E6F1FF;
}

.footer-copy {
    color: rgba(204, 214, 246, 0.7);
    font-size: 0.85rem;
    letter-spacing: 0.4px;
}

.footer-rail {
    height: 3px;
    width: 100%;
    margin: 1.5rem 0 0.5rem 0;
    background: linear-gradient(90deg, rgba(100,255,218,0.0), rgba(100,255,218,0.7), rgba(100,255,218,0.0));
    background-size: 200% 100%;
    animation: railSweep 6s linear infinite;
    opacity: 0.6;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(100,255,218,0.3);
}

.footer-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64FFDA;
    box-shadow: 0 0 10px rgba(100,255,218,0.8);
    animation: statusPulse 1.5s ease-in-out infinite;
}

.footer-text {
    flex: 1;
}

@keyframes statusPulse {
    0% { opacity: 0.5; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.5; transform: scale(0.95); }
}

@keyframes railSweep {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes navBreathe {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}




.seal {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid rgba(100,255,218,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.seal.visible {
    opacity: 0.9;
    transform: translateY(0) scale(1);
}

.seal-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(100,255,218,0.3);
    box-shadow: 0 0 12px rgba(100,255,218,0.3);
    animation: sealRotate 8s linear infinite;
}

.seal-initials {
    position: relative;
    font-family: 'Roboto Mono', monospace;
    color: #E6F1FF;
    letter-spacing: 2px;
    font-size: 0.9rem;
    text-shadow: 0 0 8px rgba(100,255,218,0.35);
}

.seal::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 1px dashed rgba(100,255,218,0.3);
}

.qr-sig {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(100,255,218,0.5);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(100,255,218,0.25);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.qr-sig:hover {
    box-shadow: 0 0 16px rgba(100,255,218,0.45);
    transform: translateY(-2px);
}

.qr-pattern {
    position: absolute;
    inset: 4px;
    background:
        linear-gradient(90deg, rgba(100,255,218,0.25) 2px, transparent 2px),
        linear-gradient(0deg, rgba(100,255,218,0.25) 2px, transparent 2px);
    background-size: 6px 6px, 6px 6px;
    mask-image: radial-gradient(circle at 20% 20%, rgba(0,0,0,1) 8px, transparent 9px),
                radial-gradient(circle at 80% 20%, rgba(0,0,0,1) 8px, transparent 9px),
                radial-gradient(circle at 20% 80%, rgba(0,0,0,1) 8px, transparent 9px);
    mask-repeat: no-repeat;
    mask-size: 18px 18px;
    mask-position: 0 0, 100% 0, 0 100%;
    background-blend-mode: screen;
}

.discord-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(100,255,218,0.4);
    border-radius: 6px;
    color: #E6F1FF;
    background: rgba(255,255,255,0.03);
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.discord-link:hover {
    transform: translateY(-2px);
    border-color: rgba(100,255,218,0.6);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.discord-icon {
    display: inline-flex;
    width: 100%;
    height: 100%;
}

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

.discord-icon svg path {
    fill: #64FFDA;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

@keyframes softPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(100,255,218,0.2); opacity: 1; }
    50% { transform: scale(1.05); box-shadow: 0 0 14px rgba(100,255,218,0.35); opacity: 0.9; }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(100,255,218,0.2); opacity: 1; }
}

.pulse-sync {
    animation: softPulse 1.8s ease-in-out;
}

.focus-mode #grid-veil,
.focus-mode #cursor-spotlight,
.focus-mode #cursor-trails,
.focus-mode #hero-stinger,
.focus-mode #shockwave {
    opacity: 0.05;
}

.focus-mode #three-js-container {
    filter: grayscale(0.8) brightness(0.3) blur(3px);
}

.focus-mode .overlay-content {
    filter: brightness(1.1);
}

.focus-mode * {
    animation-play-state: paused !important;
}

.case-card {
    --depth: 0px;
    --liftY: 0px;
    --tiltX: 0deg;
    --tiltY: 0deg;
    --scale: 1;
    padding: 1.2rem;
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 14px;
    background: rgba(255,255,255,0.035);
    box-shadow: 0 20px 44px rgba(0,0,0,0.36), 0 0 16px rgba(100,255,218,0.14);
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    transform: perspective(1200px) translateZ(var(--depth)) translateY(var(--liftY)) rotateX(var(--tiltX)) rotateY(var(--tiltY)) scale(var(--scale));
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.case-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.case-title {
    font-weight: 700;
    color: #E6F1FF;
}

.badge-pill {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.5);
    color: #E6F1FF;
    font-size: 0.85rem;
}

.badge-pill.red {
    border-color: rgba(255, 99, 132, 0.5);
    color: #ff9fb2;
    background: rgba(255, 99, 132, 0.1);
}

.case-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: rgba(204, 214, 246, 0.85);
}

.case-steps li span {
    display: inline-block;
    min-width: 72px;
    color: #64FFDA;
    font-weight: 600;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
}

.metric {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(100,255,218,0.15);
    color: #E6F1FF;
}

.metric span {
    display: block;
    color: rgba(204, 214, 246, 0.7);
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.stat-card:hover,
.skill-col:hover,
.case-card:hover,
.contact-card:hover,
.contact-form:hover {
    --scale: 1.02;
    --liftY: -2px;
    box-shadow: 0 18px 38px rgba(0,0,0,0.3);
    border-color: rgba(100, 255, 218, 0.5);
}

.magnetic {
    transition: transform 0.15s ease;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1rem;
}

.contact-card, .contact-form {
    --depth: 0px;
    --liftY: 0px;
    --tiltX: 0deg;
    --tiltY: 0deg;
    --scale: 1;
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 14px;
    padding: 1.2rem;
    background: rgba(255,255,255,0.035);
    box-shadow: 0 20px 44px rgba(0,0,0,0.36), 0 0 16px rgba(100,255,218,0.14);
    transform: perspective(1200px) translateZ(var(--depth)) translateY(var(--liftY)) rotateX(var(--tiltX)) rotateY(var(--tiltY)) scale(var(--scale));
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.1rem;
    border-radius: 8px;
    border: 1px solid rgba(100, 255, 218, 0.4);
    color: #E6F1FF;
    text-decoration: none;
    letter-spacing: 1px;
    font-weight: 600;
    box-shadow: 0 12px 26px rgba(0,0,0,0.32);
    transition: all 0.2s ease;
}

.button.primary {
    background: linear-gradient(135deg, rgba(100,255,218,0.3), rgba(100,255,218,0.15));
}

.button.ghost {
    background: rgba(255,255,255,0.02);
}

.button.full {
    width: 100%;
}

.button:hover {
    box-shadow: 0 16px 32px rgba(0,0,0,0.36), 0 0 16px rgba(100, 255, 218, 0.3);
    border-color: rgba(100, 255, 218, 0.8);
}

.button:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3), 0 0 14px rgba(100,255,218,0.35);
}

.button:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3), 0 0 14px rgba(100,255,218,0.35);
}

.button.magnet {
    transform: translate3d(0,0,0);
    transition: transform 0.1s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    will-change: transform;
}

.button.rippling::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    background: radial-gradient(circle, rgba(100,255,218,0.35) 0%, rgba(100,255,218,0.0) 60%);
    opacity: 0;
    animation: ripple 0.6s ease forwards;
    pointer-events: none;
}

.button.rippling {
    animation: bounce 0.25s ease;
}

.button.magnet {
    transform: translate3d(0,0,0);
    transition: transform 0.1s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    will-change: transform;
}

.contact-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.checksum-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(100,255,218,0.25);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: rgba(230,241,255,0.9);
    font-size: 0.85rem;
}

.checksum-value {
    font-family: 'Roboto Mono', monospace;
    color: #64FFDA;
}

.checksum-copy {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(100,255,218,0.3);
    color: rgba(230,241,255,0.9);
    border-radius: 6px;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checksum-copy:hover {
    border-color: rgba(100,255,218,0.6);
    box-shadow: 0 0 12px rgba(100,255,218,0.25);
}

.pgp-block {
    margin-top: 1rem;
    padding: 0.9rem;
    border-radius: 10px;
    border: 1px dashed rgba(100, 255, 218, 0.3);
    color: rgba(204, 214, 246, 0.8);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

.pgp-label {
    color: #64FFDA;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.sla {
    margin-top: 0.6rem;
    color: rgba(204, 214, 246, 0.7);
}

.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    color: #E6F1FF;
    font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(100,255,218,0.2);
    border-radius: 8px;
    padding: 0.75rem;
    color: #E6F1FF;
    font-family: 'Roboto Mono', monospace;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 1px solid rgba(100, 255, 218, 0.6);
}

.contact-form textarea {
    resize: vertical;
    min-height: 140px;
}
@media (max-width: 960px) {
    nav {
        padding: 1.1rem 0.5rem;
    }
    nav a {
        margin: 0 1rem;
        font-size: 1rem;
        letter-spacing: 1.2px;
    }
    .audio-toggle {
        padding: 0.45rem 0.8rem;
        margin-left: 0.5rem;
    }
    .overlay-content {
        padding: 0 1.25rem;
    }
    .hero h1 {
        font-size: 3.2rem;
    }
    #terminal {
        height: 280px;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .case-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    .playbook-body {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 720px) {
    :root { --nav-height: 0px; }
    nav {
        display: none !important;
    }
    #mobile-nav {
        display: flex;
    }
    .hero {
        position: relative;
    }
    .hero::before {
        content: "";
        position: absolute;
        inset: -20px -16px 10px -16px;
        background: radial-gradient(circle at 50% 30%, rgba(100,255,218,0.18), rgba(10,25,47,0) 55%);
        z-index: 0;
        pointer-events: none;
        filter: blur(4px);
    }
    .hero > * {
        position: relative;
        z-index: 1;
    }
    nav .settings-wrap {
        display: none;
    }
    nav a {
        display: inline-flex;
        font-size: 1rem;
        padding: 0.35rem 0.55rem;
        margin: 0 0.35rem;
    }
    #nav-select {
        display: none;
    }
    .hero {
        padding-top: 0.6rem;
    }
    section {
        scroll-margin-top: 0;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .hero .subtitle {
        font-size: 1rem;
        min-height: 1.2rem;
        display: inline-block;
    }
    .hero .ascii-name {
        margin-top: 1rem;
    }
    section {
        scroll-margin-top: 0;
    }
    #terminal {
        width: 100%;
        min-height: 320px;
        font-size: 0.9rem;
        box-shadow: 0 14px 28px rgba(0,0,0,0.35);
    }
    main {
        margin-top: 1.5rem;
    }
    .stat-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    .skills-grid, .case-grid, .contact-grid {
        grid-template-columns: 1fr;
    }
    .case-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .button-row {
        flex-direction: column;
    }
    .button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .ascii-name {
        font-size: 0.38rem;
        padding: 0.35rem 0.28rem;
        transform: perspective(650px) rotateX(2deg) rotateY(-2deg) translateZ(3px);
        animation: hueSweep 6s linear infinite, asciiBreathe 3s ease-in-out infinite;
    }
    .ascii-name::before {
        opacity: 0.45;
        filter: blur(8px);
    }
    .ascii-name:hover {
        transform: perspective(650px) rotateX(2deg) rotateY(-2deg) translateZ(5px) scale(1.02);
    }
    #terminal {
        max-width: 100%;
        height: 260px;
        box-shadow: 0 16px 32px rgba(0,0,0,0.55);
    }
    .terminal-tabs {
        padding: 8px 10px 0 10px;
        gap: 0.3rem;
        flex-wrap: wrap;
    }
    .terminal-tab {
        padding: 0.3rem 0.6rem;
    }
    nav a {
        display: inline-flex;
    }
    .stat-card, .skill-col, .case-card, .contact-card, .contact-form {
        box-shadow: 0 14px 28px rgba(0,0,0,0.32), 0 0 10px rgba(100,255,218,0.1);
    }
    .chip, .tag {
        box-shadow: 0 8px 18px rgba(0,0,0,0.24);
    }
    .button {
        box-shadow: 0 10px 22px rgba(0,0,0,0.28);
    }
    .news-panel {
        box-shadow: 0 12px 24px rgba(0,0,0,0.26);
    }
    .overlay-content {
        padding: 0 1rem;
        background: transparent;
        border: none;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    :root { --nav-height: 0px; }
    .ascii-name {
        font-size: 0.32rem;
        padding: 0.32rem 0.24rem;
        line-height: 1.05;
        transform: perspective(600px) rotateX(1.5deg) rotateY(-1.5deg) translateZ(2px) scale(0.92);
        margin-top: 0.2rem;
    }
    .hero {
        padding-top: 0.6rem;
    }
    section {
        scroll-margin-top: 0;
    }
    #terminal {
        min-height: 320px;
        font-size: 0.9rem;
        box-shadow: 0 12px 22px rgba(0,0,0,0.28);
    }
    .news-panel {
        padding: 0.75rem;
    }
    .news-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* --- Components --- */
#skills ul {
    list-style-type: '>> ';
    padding-left: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.project-card {
    background: rgba(100, 255, 218, 0.05);
    border-left: 3px solid #64FFDA;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: background 0.3s ease, transform 0.3s ease;
}

.project-card:hover {
    background: rgba(100, 255, 218, 0.1);
    transform: translateY(-5px);
}

/* --- Cursor Animation --- */
@keyframes blink {
    from, to { background-color: transparent }
    50% { background-color: #64FFDA; }
}

@keyframes shimmer {
    0% { transform: translateX(0); }
    100% { transform: translateX(300%); }
}

@keyframes fadeInSection {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scanLine {
    from { transform: scaleX(0); opacity: 0.2; }
    30% { opacity: 1; }
    to { transform: scaleX(1); opacity: 0.9; }
}

@keyframes ripple {
    from { opacity: 0.5; transform: scale(0.9); }
    to { opacity: 0; transform: scale(1.25); }
}

@keyframes bounce {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(1px) scale(0.99); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes scan {
    0% { transform: translateX(0); opacity: 0.8; }
    50% { opacity: 1; }
    100% { transform: translateX(220%); opacity: 0.6; }
}

@keyframes edgePulse {
    0% { opacity: 0.2; transform: scaleX(0.6); }
    50% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0.2; transform: scaleX(0.8); }
}

@keyframes hueSweep {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes stingerSweep {
    0% { transform: translateX(-120%) skewX(-10deg); opacity: 0; }
    20% { opacity: 0.8; }
    50% { transform: translateX(10%) skewX(-10deg); opacity: 0.4; }
    100% { transform: translateX(120%) skewX(-10deg); opacity: 0; }
}

@keyframes sealRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes edgePulseBig {
    0% { box-shadow: 0 0 0 0 rgba(100,255,218,0.15), 0 0 24px rgba(100,255,218,0.4); }
    50% { box-shadow: 0 0 0 2px rgba(100,255,218,0.25), 0 0 32px rgba(100,255,218,0.55); }
    100% { box-shadow: 0 0 0 0 rgba(100,255,218,0.15), 0 0 24px rgba(100,255,218,0.35); }
}

@keyframes sweepPass {
    0% { transform: translateX(-105%) skewX(-4deg); opacity: 0.2; }
    40% { opacity: 0.35; }
    50% { transform: translateX(5%) skewX(-4deg); opacity: 0.3; }
    100% { transform: translateX(105%) skewX(-4deg); opacity: 0; }
}

@keyframes caretGlow {
    0% { box-shadow: 0 0 0 rgba(100,255,218,0); }
    50% { box-shadow: 0 0 12px rgba(100,255,218,0.55); }
    100% { box-shadow: 0 0 0 rgba(100,255,218,0); }
}

@keyframes shockwave {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0.6; }
    70% { opacity: 0.2; }
    100% { transform: translate(-50%, -50%) scale(16); opacity: 0; }
}

@keyframes trailFade {
    0% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}


@keyframes cornerSlide {
    from { opacity: 0; }
    to { opacity: 0; }
}

@keyframes termGlitch {
    0% { opacity: 0.35; transform: translateX(-2px); }
    30% { opacity: 0.2; transform: translateX(2px); }
    60% { opacity: 0.3; transform: translateX(-1px); }
    100% { opacity: 0; transform: translateX(0); }
}

@keyframes termWave {
    0% { opacity: 0.25; transform: translateY(0); }
    50% { opacity: 0.15; transform: translateY(-4px); }
    100% { opacity: 0; transform: translateY(0); }
}













/* ==============================================
   MIND-BLOWING MOBILE OPTIMIZATIONS
   Replace ALL mobile media queries in your CSS with this
   ============================================== */

/* Base - Prevent any overflow */
html {
    overflow-x: hidden;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

* {
    box-sizing: border-box;
}

/* Tablet - 960px */
@media (max-width: 960px) {
    nav {
        padding: 1rem 0.5rem;
    }
    nav a {
        margin: 0 0.8rem;
        font-size: 1rem;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
    }
    .overlay-content {
        padding: 0 1.25rem;
    }
    .hero h1 {
        font-size: 3rem;
    }
    #terminal {
        height: 280px;
    }
}

/* Mobile - 720px and below - THIS IS WHERE THE MAGIC HAPPENS */
@media (max-width: 720px) {
    
    /* ==== NAVIGATION - Sticky, Clean, Always Accessible ==== */
    nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: rgba(10, 25, 47, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-bottom: 1px solid rgba(100, 255, 218, 0.2);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        padding: 0.7rem 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 0.4rem;
        z-index: 1000;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        /* Hide scrollbar but keep functionality */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    nav::-webkit-scrollbar {
        display: none;
    }
    
    nav a {
        flex-shrink: 0;
        font-size: 0.9rem;
        padding: 0.6rem 0.9rem;
        margin: 0 0.15rem;
        letter-spacing: 1px;
        min-height: 48px;
        min-width: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    
    nav a.active {
        background: rgba(100, 255, 218, 0.12);
        border: 1px solid rgba(100, 255, 218, 0.3);
    }
    
    .settings-wrap {
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .settings-toggle {
        min-height: 48px;
        min-width: 48px;
        padding: 0.6rem;
        border-radius: 8px;
    }
    
    .settings-menu {
        right: 0;
        top: calc(100% + 10px);
    }
    
    .focus-toggle,
    .audio-toggle {
        min-height: 44px;
        padding: 0.5rem 0.9rem;
        width: 100%;
        text-align: left;
        font-size: 0.9rem;
    }
    
    /* ==== HERO SECTION - Perfect Balance ==== */
    .hero {
        padding-top: calc(var(--nav-height) + 10px); /* Account for fixed nav */
        padding-bottom: 2rem;
        min-height: auto;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        margin: 0.8rem 0 0.5rem 0;
        line-height: 1.1;
    }
    
    .hero .subtitle {
        font-size: 1rem;
        margin-top: 0.8rem;
        min-height: 1.5rem;
        letter-spacing: 2px;
    }
    
    /* ==== ASCII NAME - Perfectly Sized, Beautiful ==== */
    .ascii-name {
        font-size: 0.4rem !important;
        padding: 0.4rem 0.3rem;
        line-height: 1.08;
        margin: 1rem auto 0.5rem;
        max-width: 98vw;
        overflow-x: auto;
        overflow-y: hidden;
        transform: perspective(700px) rotateX(2deg) rotateY(-2deg) translateZ(4px) scale(0.95);
        /* Smooth scrolling for ASCII */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .ascii-name::-webkit-scrollbar {
        display: none;
    }
    
    .ascii-name::before {
        opacity: 0.5;
        filter: blur(8px);
    }
    
    .ascii-name:hover {
        transform: perspective(700px) rotateX(1.5deg) rotateY(-1.5deg) translateZ(6px) scale(0.98);
    }
    
    /* ==== TERMINAL - Optimized Height, Still Immersive ==== */
    #terminal {
        max-width: 100%;
        width: 100%;
        height: 260px; /* Perfect balance */
        font-size: 0.88rem;
        margin-top: 2.5rem;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6),
                    0 0 20px rgba(100, 255, 218, 0.15);
        border-radius: 8px;
        overflow: hidden;
    }
    
    .terminal-tabs {
        padding: 8px 12px 0 12px;
        gap: 0.4rem;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .terminal-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .terminal-tab {
        padding: 0.45rem 0.8rem;
        min-height: 40px;
        min-width: 80px;
        font-size: 0.85rem;
        flex-shrink: 0;
        border-radius: 6px 6px 0 0;
    }
    
    #terminal-output {
        font-size: 0.88rem;
        padding: 12px;
        line-height: 1.5;
    }
    
    .terminal-input-line {
        padding: 0 12px 12px 12px;
    }
    
    #terminal-input {
        font-size: 0.88rem;
        padding: 0.3rem 0;
    }
    
    .prompt {
        font-size: 0.85rem;
    }
    
    #terminal-status {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    /* ==== CONTENT SECTIONS - Smooth, Spacious ==== */
    main {
        margin-top: 2rem;
        padding-bottom: 3rem;
    }
    
    section {
        scroll-margin-top: calc(var(--nav-height) + 20px);
        padding: 1.5rem 0;
        margin-bottom: 1rem;
        overflow-x: hidden;
        min-height: auto;
    }
    
    .overlay-content {
        padding: 0 1rem;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    section h2 {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .section-header {
        margin-bottom: 1.5rem;
    }
    
    .section-sub {
        font-size: 1rem;
        line-height: 1.6;
        margin-top: 0.5rem;
    }
    
    .lead {
        font-size: 1.05rem;
        line-height: 1.7;
        margin-bottom: 1.5rem;
    }
    
    /* ==== GRIDS - Perfect Single Column ==== */
    .stat-grid,
    .skills-grid,
    .case-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* ==== CARDS - Gorgeous on Mobile ==== */
    .stat-card,
    .skill-col,
    .case-card,
    .contact-card,
    .contact-form {
        padding: 1.2rem;
        border-radius: 12px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35),
                    0 0 16px rgba(100, 255, 218, 0.08);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        transform: translateY(0);
    }
    
    .stat-card:active,
    .skill-col:active,
    .case-card:active {
        transform: scale(0.98);
    }
    
    .stat-card {
        text-align: center;
    }
    
    .stat-value {
        font-size: 1.8rem;
        margin-top: 0.5rem;
    }
    
    /* ==== BUTTONS & CHIPS - Perfect Touch Targets ==== */
    .chip,
    .tag {
        padding: 0.6rem 1rem;
        min-height: 44px;
        font-size: 0.9rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 24px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    }
    
    .chip-row,
    .tag-row {
        gap: 0.7rem;
        margin-bottom: 1.2rem;
    }
    
    .button {
        min-height: 52px;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        border-radius: 10px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
        transition: all 0.2s ease;
    }
    
    .button:active {
        transform: scale(0.97);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    }
    
    .button-row {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    /* ==== NEWS SECTION - Beautiful Cards ==== */
    .news-panel {
        padding: 1rem;
        border-radius: 12px;
    }
    
    #news-list {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    #news-list li {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        border-radius: 10px;
        min-height: 80px;
    }
    
    #news-list li span {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }
    
    .news-actions {
        flex-wrap: wrap;
        gap: 0.8rem;
        margin-top: 0.8rem;
    }
    
    .news-refresh {
        min-width: 48px;
        min-height: 48px;
        border-radius: 50%;
    }
    
    .news-updated {
        font-size: 0.9rem;
    }
    
    /* ==== CASE CARDS - Beautiful Layout ==== */
    .case-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
        margin-bottom: 0.8rem;
    }
    
    .case-title {
        font-size: 1.15rem;
    }
    
    .case-steps {
        gap: 0.5rem;
        line-height: 1.6;
    }
    
    .case-steps li {
        font-size: 0.95rem;
    }
    
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.7rem;
        margin-top: 1rem;
    }
    
    .metric {
        padding: 0.8rem;
        text-align: center;
    }
    
    /* ==== CONTACT SECTION ==== */
    .contact-card,
    .contact-form {
        padding: 1.3rem;
    }
    
    .contact-form label {
        margin-bottom: 1rem;
        font-size: 1rem;
    }
    
    .contact-form input,
    .contact-form textarea {
        padding: 0.9rem;
        font-size: 1rem;
        border-radius: 8px;
        min-height: 48px;
    }
    
    .contact-form textarea {
        min-height: 140px;
    }
    
    .contact-links {
        flex-wrap: wrap;
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .contact-links a {
        font-size: 1.05rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    
    /* ==== PLAYBOOKS ==== */
    .playbooks details {
        margin-bottom: 1rem;
        border-radius: 10px;
    }
    
    .playbooks summary {
        padding: 1rem;
        font-size: 1.05rem;
        min-height: 52px;
    }
    
    .playbook-body {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    /* ==== FOOTER - Clean ==== */
    .site-footer {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem 0;
        font-size: 0.85rem;
    }
    
    .footer-text {
        flex-basis: 100%;
        order: 3;
    }
    
    .footer-dot {
        order: 1;
    }
    
    .seal {
        order: 2;
        width: 56px;
        height: 56px;
    }
    
    .qr-sig {
        order: 4;
        width: 44px;
        height: 44px;
    }
    
    .discord-link {
        order: 5;
        width: 48px;
        height: 48px;
    }
    .footer-copy {
        order: 6;
        flex-basis: 100%;
        font-size: 0.8rem;
        margin-top: 0.3rem;
    }
    
    /* ==== EFFECTS - Optimized for Mobile ==== */
    .cursor-spotlight {
        opacity: 0;
        display: none;
    }
    
    #section-strip {
        display: none;
    }
    
    #code-overlay pre {
        font-size: 0.9rem;
        opacity: 0.4;
        line-height: 1.5;
    }
    
    /* Simplify animations on mobile */
    #cursor-trails,
    #shockwave {
        display: none;
    }
    
    /* Keep the vignette subtle */
    #vignette-overlay {
        opacity: 0.5;
    }
}

/* ==== SMALL PHONES - 600px ==== */
@media (max-width: 600px) {
    
    /* Slightly smaller ASCII */
    .ascii-name {
        font-size: 0.36rem !important;
        padding: 0.35rem 0.28rem;
        transform: perspective(650px) rotateX(1.8deg) rotateY(-1.8deg) translateZ(3px) scale(0.92);
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero .subtitle {
        font-size: 0.95rem;
    }
    
    #terminal {
        height: 240px;
        font-size: 0.85rem;
        margin-top: 2rem;
    }
    
    section h2 {
        font-size: 2rem;
    }
    
    .overlay-content {
        padding: 0 0.8rem;
    }
    
    nav a {
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }
}

/* ==== TINY PHONES - 480px ==== */
@media (max-width: 480px) {
    :root { --nav-height: 0px; }
    
    .ascii-name {
        font-size: 0.32rem !important;
        padding: 0.3rem 0.25rem;
        transform: perspective(600px) rotateX(1.5deg) rotateY(-1.5deg) translateZ(2px) scale(0.88);
    }
    
    .hero {
        padding-top: calc(var(--nav-height) - 12px);
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero .subtitle {
        font-size: 0.9rem;
    }
    
    #terminal {
        height: 220px;
        font-size: 0.82rem;
    }
    
    nav {
        padding: 0.6rem 0.8rem;
    }
    
    nav a {
        font-size: 0.8rem;
        padding: 0.5rem 0.7rem;
    }
    
    section h2 {
        font-size: 1.8rem;
    }
    
    .overlay-content {
        padding: 0 0.6rem;
    }
    
    .stat-card,
    .skill-col,
    .case-card,
    .contact-card,
    .contact-form {
        padding: 1rem;
    }
}

/* ==== LANDSCAPE PHONES - Special handling ==== */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding-top: calc(var(--nav-height) + 4px);
    }
    
    #terminal {
        height: 180px;
        margin-top: 1.5rem;
    }
    
    .ascii-name {
        font-size: 0.32rem !important;
        margin: 0.5rem auto;
    }
    
    section {
        padding: 1rem 0;
    }
}

/* ==== iOS SAFARI FIXES ==== */
@supports (-webkit-touch-callout: none) {
    /* Fix 100vh on iOS */
    .hero {
        min-height: -webkit-fill-available;
    }
    
    /* Better tap highlighting */
    * {
        -webkit-tap-highlight-color: rgba(100, 255, 218, 0.15);
    }
    
    /* Smooth scrolling */
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* ==== IMPROVE TOUCH INTERACTIONS ==== */
@media (pointer: coarse) {
    /* Larger tap targets on touch devices */
    a, button, input, select, textarea, .chip, .tag {
        -webkit-tap-highlight-color: rgba(100, 255, 218, 0.2);
    }
    
    /* Remove hover effects on touch */
    .stat-card:hover,
    .skill-col:hover,
    .case-card:hover,
    .contact-card:hover,
    .button:hover,
    .chip:hover,
    .tag:hover {
        transform: none;
    }
    
    /* Add active states instead */
    .stat-card:active,
    .skill-col:active,
    .case-card:active,
    .contact-card:active,
    .button:active,
    .chip:active,
    .tag:active {
        transform: scale(0.97);
    }
}

/* ==== EXTRA LIGHTWEIGHT MOBILE (<480px) ==== */
@media (max-width: 480px) {
    .stat-card,
    .skill-col,
    .case-card,
    .contact-card,
    .contact-form,
    .news-panel,
    .chip,
    .tag,
    .button {
        box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
        border-color: rgba(100,255,218,0.25) !important;
    }
    section::before {
        box-shadow: none;
        border: 1px solid rgba(100,255,218,0.08);
    }
}

/* ==== PERFORMANCE - Reduce motion if preferred ==== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==== DARK MODE ENHANCEMENT ==== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0A192F;
    }
    
    nav {
        background: rgba(10,25,47,0.92);
    }
}

/* --- Final nav transparency override (desktop & mobile) --- */
nav {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
