:root {
    color-scheme: dark;
    --bg: #04050a;
    --bg-deep: #020309;
    --panel: rgba(8, 12, 24, 0.75);
    --panel-border: rgba(120, 210, 255, 0.2);
    --text: #e8f1ff;
    --muted: #a7b4d6;
    --accent: #52f6ff;
    --accent-2: #ff4dff;
    --accent-3: #7cff6b;
    --glow: 0 0 18px rgba(82, 246, 255, 0.5),
        0 0 48px rgba(255, 77, 255, 0.35);
    --shadow: 0 18px 40px rgba(2, 4, 12, 0.7);
    font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

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

html,
body {
    width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: radial-gradient(circle at 10% 10%, #111836, #02040c 60%, #000) fixed;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 80% 20%, #0b1b2e, transparent 60%);
}

#starfield {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#starfield.warp {
    filter: drop-shadow(0 0 12px rgba(82, 246, 255, 0.35));
}

.energy-sweep {
    position: absolute;
    inset: -20% -40%;
    background: linear-gradient(120deg,
            transparent 30%,
            rgba(82, 246, 255, 0.12) 45%,
            rgba(255, 77, 255, 0.2) 55%,
            transparent 70%);
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: screen;
}

.energy-sweep.active {
    animation: energySweep 2.8s ease-in-out forwards;
}

.nebula {
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle at 20% 40%,
            rgba(82, 246, 255, 0.1),
            transparent 60%),
        radial-gradient(circle at 70% 30%,
            rgba(255, 77, 255, 0.1),
            transparent 55%),
        radial-gradient(circle at 50% 80%,
            rgba(124, 255, 107, 0.12),
            transparent 60%);
    filter: blur(40px);
    opacity: 0.9;
}

.scanlines {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0.04),
            rgba(255, 255, 255, 0) 30%);
    background-size: 100% 6px;
    mix-blend-mode: soft-light;
    opacity: 0.2;
    pointer-events: none;
}

.lasers {
    position: absolute;
    inset: -20% 0;
    pointer-events: none;
}

.laser {
    position: absolute;
    width: 2px;
    height: 160%;
    top: -30%;
    background: linear-gradient(180deg,
            transparent,
            rgba(82, 246, 255, 0.3),
            rgba(82, 246, 255, 0.9),
            rgba(255, 77, 255, 0.8),
            transparent);
    filter: drop-shadow(0 0 8px rgba(82, 246, 255, 0.8));
    opacity: 0.5;
    transform: rotate(12deg);
    animation: laserSweep 20s linear infinite;
}

.laser:nth-child(2) {
    left: 55%;
    height: 180%;
    animation-duration: 26s;
    opacity: 0.35;
    filter: drop-shadow(0 0 8px rgba(255, 77, 255, 0.8));
}

.laser:nth-child(3) {
    left: 75%;
    animation-duration: 18s;
    opacity: 0.25;
    filter: drop-shadow(0 0 8px rgba(124, 255, 107, 0.8));
}

@keyframes laserSweep {
    0% {
        transform: translateX(-40vw) rotate(12deg);
    }

    50% {
        transform: translateX(40vw) rotate(12deg);
    }

    100% {
        transform: translateX(-40vw) rotate(12deg);
    }
}

.site-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.2rem 5vw;
    background: rgba(4, 6, 14, 0.78);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(82, 246, 255, 0.08);
    z-index: 10;
}

.logo {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: "Orbitron", "Space Grotesk", sans-serif;
    letter-spacing: 0.12em;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: var(--glow);
}

.nav {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(82, 246, 255, 0.4);
    border-radius: 10px;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    box-shadow: var(--glow);
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 4px 0;
    background: var(--accent);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

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

.nav a {
    color: var(--muted);
    transition: color 0.2s ease;
}

.nav a:hover {
    color: var(--accent);
}

.cta {
    padding: 0.6rem 1.1rem;
    border: 1px solid rgba(82, 246, 255, 0.4);
    border-radius: 999px;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--accent);
    box-shadow: var(--glow);
}

main {
    padding: 5rem 6vw 6rem;
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    align-items: center;
    position: relative;
}

.hero-content {
    max-width: 620px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto;
    height: 140%;
    background: radial-gradient(circle at 30% 20%,
            rgba(82, 246, 255, 0.25),
            transparent 55%),
        radial-gradient(circle at 70% 40%,
            rgba(255, 77, 255, 0.2),
            transparent 60%);
    filter: blur(60px);
    opacity: 0.8;
    pointer-events: none;
    animation: nebulaPulse 9s ease-in-out infinite;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--accent-3);
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

.title {
    font-family: "Orbitron", "Space Grotesk", sans-serif;
    font-size: clamp(2.6rem, 4vw, 4.2rem);
    line-height: 1.05;
    margin: 0 0 1.2rem;
    text-shadow: 0 0 35px rgba(82, 246, 255, 0.5),
        0 0 65px rgba(255, 77, 255, 0.35);
}

.lede {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
}

.btn {
    padding: 0.9rem 1.8rem;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transform: translateX(-120%);
    transition: transform 0.6s ease;
}

.btn:hover::after {
    transform: translateX(120%);
}

.btn.primary {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #02030c;
    box-shadow: 0 0 24px rgba(82, 246, 255, 0.5);
}

.btn.ghost {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
}

.btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0 32px rgba(82, 246, 255, 0.5);
}

.signal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--muted);
}

.chip {
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(82, 246, 255, 0.25);
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: rgba(4, 12, 18, 0.6);
}

.hero-panel {
    padding: 2rem;
    border-radius: 20px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.2s ease;
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(82, 246, 255, 0.1),
            transparent 45%,
            rgba(255, 77, 255, 0.12));
    opacity: 0.6;
    mix-blend-mode: screen;
    pointer-events: none;
    animation: panelGlow 8s ease-in-out infinite;
}

.panel-title {
    font-family: "Orbitron", sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--accent);
    margin-bottom: 1.8rem;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 1.5rem;
}

.panel {
    background: rgba(7, 10, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 1rem;
}

.panel-label {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.panel-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0.6rem 0;
    display: block;
    color: var(--accent-2);
}

.panel-value.pulse {
    animation: valuePulse 3s ease-in-out infinite;
}

.panel-detail {
    font-size: 0.8rem;
    color: var(--muted);
}

.section {
    display: grid;
    gap: 2.5rem;
    scroll-margin-top: 110px;
}

.section-head h2 {
    font-family: "Orbitron", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 1.6rem;
    margin: 0 0 0.8rem;
}

.section-head p {
    color: var(--muted);
    max-width: 700px;
    line-height: 1.7;
}

.about-grid,
.work-grid,
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.6rem;
}

.card,
.work-card,
.quote {
    background: var(--panel);
    border: 1px solid rgba(82, 246, 255, 0.12);
    border-radius: 18px;
    padding: 1.6rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.work-card {
    display: flex;
    flex-direction: column;
}

.card,
.work-card,
.quote,
.stack-col {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover,
.work-card:hover,
.quote:hover,
.stack-col:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 50px rgba(10, 20, 50, 0.8),
        0 0 40px rgba(82, 246, 255, 0.2);
}

.card h3,
.work-card h3 {
    margin-top: 0;
    font-size: 1.2rem;
}

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

.stack-col {
    background: rgba(6, 10, 18, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 1.6rem;
}

.stack-col h3 {
    margin-top: 0;
    color: var(--accent-3);
}

.stack-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.7rem;
    color: var(--muted);
}

.work-top {
    display: block;
}

.work-tags {
    margin-top: auto;
    margin-bottom: 0.8rem;
}

.work-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.work-tag {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    color: var(--accent);
    border: 1px solid rgba(82, 246, 255, 0.4);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    margin-right: 0.6rem;
    vertical-align: middle;
}

.work-meta {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 1.2rem;
    margin-top: auto;
    padding-top: 1.2rem;
}

.quote {
    font-style: italic;
    position: relative;
    margin: 0;
}

.quote::before {
    content: "“";
    position: absolute;
    top: -0.6rem;
    left: 1rem;
    font-size: 3rem;
    color: rgba(82, 246, 255, 0.3);
}

.quote cite {
    display: block;
    margin-top: 1rem;
    font-style: normal;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
}

.contact-card {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
    align-items: center;
    padding: 2.4rem;
    border-radius: 24px;
    border: 1px solid rgba(82, 246, 255, 0.2);
    background: linear-gradient(120deg,
            rgba(82, 246, 255, 0.12),
            rgba(255, 77, 255, 0.1));
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.contact-hint {
    margin: 0.6rem 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.contact-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%,
            rgba(82, 246, 255, 0.2),
            transparent 60%);
    opacity: 0.7;
    animation: nebulaPulse 10s ease-in-out infinite;
    pointer-events: none;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 2rem 6vw 3rem;
    color: var(--muted);
    font-size: 0.85rem;
}


.flare {
    position: absolute;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            rgba(124, 255, 107, 0.8),
            rgba(255, 255, 255, 0.8),
            transparent);
    opacity: 0.7;
    filter: drop-shadow(0 0 12px rgba(124, 255, 107, 0.8));
    animation: flareFlight 6s linear infinite;
}

@keyframes flareFlight {
    0% {
        transform: translateX(-60vw) translateY(0) rotate(-8deg);
        opacity: 0;
    }

    15% {
        opacity: 0.8;
    }

    60% {
        opacity: 0.4;
    }

    100% {
        transform: translateX(60vw) translateY(-20vh) rotate(-8deg);
        opacity: 0;
    }
}

@keyframes energySweep {
    0% {
        transform: translateX(-60%) translateY(10%) rotate(6deg);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    60% {
        opacity: 0.6;
    }

    100% {
        transform: translateX(60%) translateY(-10%) rotate(6deg);
        opacity: 0;
    }
}

@keyframes nebulaPulse {

    0%,
    100% {
        opacity: 0.55;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

@keyframes panelGlow {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes valuePulse {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(255, 77, 255, 0.4);
    }

    50% {
        text-shadow: 0 0 24px rgba(82, 246, 255, 0.7);
    }
}

@media (max-width: 900px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 1024px) {

    .hero,
    .about-grid,
    .stack-grid,
    .work-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }

    .site-header {
        position: sticky;
        flex-direction: row;
        align-items: center;
    }

    .nav {
        position: absolute;
        top: 100%;
        right: 6vw;
        background: rgba(4, 6, 14, 0.95);
        border: 1px solid rgba(82, 246, 255, 0.2);
        border-radius: 14px;
        padding: 1rem 1.2rem;
        flex-direction: column;
        gap: 1rem;
        box-shadow: var(--shadow);
        display: none;
        z-index: 20;
    }

    .site-header.nav-open .nav {
        display: flex;
    }

    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .site-header.nav-open .nav-toggle-bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .site-header.nav-open .nav-toggle-bar:nth-child(2) {
        opacity: 0;
    }

    .site-header.nav-open .nav-toggle-bar:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .cta {
        display: none;
    }
}

@media (max-width: 720px) {
    main {
        padding: 4rem 6vw;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .work-meta {
        flex-direction: column;
        gap: 0.4rem;
    }
}

/* ============================================
   EASTER EGG EFFECTS
   ============================================ */

/* Hyperspace Jump (Konami Code) */
body.hyperspace {
    animation: hyperspaceFlash 3s ease-out;
}

body.hyperspace #starfield {
    animation: hyperspaceWarp 3s ease-out !important;
}

body.hyperspace .laser,
body.hyperspace .flare {
    animation: hyperspaceLaser 3s linear !important;
}

@keyframes hyperspaceFlash {

    0%,
    100% {
        filter: brightness(1);
    }

    10% {
        filter: brightness(3) saturate(2);
    }

    50% {
        filter: brightness(1.5) saturate(1.5);
    }
}

@keyframes hyperspaceWarp {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

@keyframes hyperspaceLaser {
    0% {
        transform: translateX(0) scaleX(1);
        opacity: 0.5;
    }

    50% {
        transform: translateX(100vw) scaleX(5);
        opacity: 0.8;
    }

    100% {
        transform: translateX(200vw) scaleX(10);
        opacity: 0;
    }
}

/* Ludicrous Speed (Triple-click logo) */
body.ludicrous-speed * {
    animation-duration: 0.33s !important;
    transition-duration: 0.1s !important;
}

body.ludicrous-speed .laser {
    animation-duration: 4s !important;
}

body.ludicrous-speed #starfield {
    filter: brightness(1.5) saturate(1.5);
}

/* Engage Thrusters (Type "engage") */
body.engage-thrusters {
    animation: thrusterPulse 2s ease-out;
}

@keyframes thrusterPulse {

    0%,
    100% {
        filter: brightness(1);
    }

    15% {
        filter: brightness(1.3) saturate(1.5);
    }

    30% {
        filter: brightness(1.1);
    }

    50% {
        filter: brightness(1.2);
    }
}

/* Red Alert (Click year 5x) */
body.red-alert {
    --accent: #ff4444;
    --accent-2: #ff6666;
    --accent-3: #ff8888;
    --glow: 0 0 18px rgba(255, 68, 68, 0.6),
        0 0 48px rgba(255, 68, 68, 0.4);
}

body.red-alert::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(255, 0, 0, 0.1);
    pointer-events: none;
    z-index: 9999;
    animation: redAlertFlash 1.5s ease-in-out infinite;
}

@keyframes redAlertFlash {

    0%,
    100% {
        opacity: 0.05;
    }

    50% {
        opacity: 0.15;
    }
}

/* Logo Charging (Hover 5sec) */
.logo.charging {
    animation: logoCharge 5s linear;
}

.logo.burst {
    animation: logoBurst 0.8s ease-out !important;
}

@keyframes logoCharge {
    0% {
        text-shadow: var(--glow);
    }

    100% {
        text-shadow: 0 0 30px rgba(82, 246, 255, 1),
            0 0 60px rgba(255, 77, 255, 0.8),
            0 0 90px rgba(124, 255, 107, 0.6);
    }
}

@keyframes logoBurst {
    0% {
        transform: scale(1);
        text-shadow: 0 0 30px rgba(82, 246, 255, 1),
            0 0 60px rgba(255, 77, 255, 0.8);
    }

    50% {
        transform: scale(1.15);
        text-shadow: 0 0 60px rgba(82, 246, 255, 1),
            0 0 120px rgba(255, 77, 255, 1),
            0 0 180px rgba(124, 255, 107, 0.8);
    }

    100% {
        transform: scale(1);
        text-shadow: var(--glow);
    }
}