:root {
    --bg-dark: #0a0a0a;
    --bg-panel: #151515;
    --orange: #ff5500;
    --orange-glow: rgba(255, 85, 0, 0.9);
    --orange-dim: rgba(255, 85, 0, 0.1);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --grid-line: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.1);

    --font-display: 'Unbounded', cursive;
    --font-ui: Arial, Helvetica, sans-serif;
    --font-code: Arial, Helvetica, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-ui);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    perspective: 1500px;
}

/* ========== BACKGROUND SYSTEM ========== */
#nexus-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 100px 100px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.65;
}

.radial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
    /* Increased to 0.4 to be more visible, user asked for 25% but usually needs a bit more to be noticeable against dark bg, sticking to ~25-40% range. Let's use 0.25 as requested strictly first. */
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.25) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
    /* Above canvas/grid, below UI */
}

/* ========== LEVITATING HUD (SCALED 0.8x) ========== */
.kinetic-hud {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    z-index: 10000;
    width: 95%;
    max-width: 950px;
    perspective: 1000px;
    animation: float 8s ease-in-out infinite;
}

body.module-active .kinetic-hud {
    z-index: 30000 !important;
}

body.lightbox-active .kinetic-hud {
    display: none !important;
}

.hud-glass {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid var(--orange);
    border-radius: 4px;
    padding: 1rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 15px 40px rgba(255, 255, 255, 0.1),
        0 0 20px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.scan-line {
    position: absolute;
    top: 0;
    left: -100%;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: skewX(-20deg);
    animation: scan 5s infinite linear;
    pointer-events: none;
}

/* SYSTEM FOOTER */
.system-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem 0;
    text-align: center;
    z-index: 100;
    pointer-events: none;
    /* Background removed as requested */
    background: transparent;
    /* Removed full width border and shadow for localized effect */
    border-bottom: none;
    box-shadow: none;
}

.footer-content {
    position: relative;
    display: inline-block;
}

.footer-text {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: #ffffff;
    letter-spacing: 2px;
    /* Photoshop-style Outer Glow: Multiple layers for depth */
    text-shadow:
        0 0 5px rgba(255, 255, 255, 0.8),
        0 0 10px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(255, 255, 255, 0.3);
    /* Subtle continuous breathing to keep it alive */
    animation: text-glow-pulse 3s infinite alternate ease-in-out;
}

@keyframes text-glow-pulse {
    from {
        text-shadow:
            0 0 5px rgba(255, 255, 255, 0.8),
            0 0 10px rgba(255, 255, 255, 0.5),
            0 0 20px rgba(255, 255, 255, 0.3);
    }

    to {
        text-shadow:
            0 0 7px rgba(255, 255, 255, 0.9),
            0 0 15px rgba(255, 255, 255, 0.6),
            0 0 25px rgba(255, 255, 255, 0.4);
    }
}

.r-mark {
    color: var(--orange);
    font-size: 0.7rem;
    vertical-align: super;
}

.hud-decor {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    opacity: 0.7;
}

.mobile-system-label {
    display: none !important;
}

.hud-links {
    display: flex;
    gap: 2rem;
}

.hud-btn {
    background: transparent;
    border: none;
    color: #ffffff !important;
    font-family: 'Unbounded', cursive;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-shadow: 0 0 0px transparent !important;
    transition: color 0.25s ease, text-shadow 0.25s ease !important;
    position: relative;
    padding: 0.5rem 0;
}

.hud-btn:hover,
.hud-btn.active {
    color: var(--orange) !important;
    text-shadow: 0 0 15px var(--orange) !important;
}

.hud-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0% !important;
    height: 2px;
    background: var(--orange);
    box-shadow: 0 0 0px transparent !important;
    transition: width 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease !important;
}

.hud-btn:hover::after,
.hud-btn.active::after {
    width: 100% !important;
    box-shadow: 0 0 10px var(--orange) !important;
}

.lang-switch {
    display: flex;
    gap: 8px;
}

.l-opt {
    background: transparent !important;
    border: 1px solid var(--border) !important;
    color: #ffffff !important;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.7rem;
    font-family: 'Fira Code', monospace;
    box-shadow: 0 0 0px transparent !important;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease !important;
}

.l-opt:hover,
.l-opt.active {
    border-color: var(--orange) !important;
    color: var(--orange) !important;
    background: rgba(255, 85, 0, 0.05) !important;
    box-shadow: 0 0 10px var(--orange-dim) !important;
}

/* ========== INTERFACE LAYER (SCALED 0.8x) ========== */
.interface-layer {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    transform: scale(0.8);
}

/* HUB VIEW */
.view {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9) translateZ(-100px);
}

.view.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateZ(0);
}

.hub-center {
    text-align: center;
    position: relative;
    z-index: 2;
    transform-style: preserve-3d;
    margin-top: -3rem;
}

.core-avatar {
    width: 160px;
    height: 160px;
    margin: 0 auto 2.5rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* GREY AVATAR PLACEHOLDER */
.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid var(--orange);
    z-index: 2;
    box-shadow: 0 0 50px var(--orange-dim);
    position: relative;
    object-fit: cover;
    /* Ensure image covers the circle */
    background: #111;
    /* Fallback */
}

/* Remove the ::after pseudo-element since we have a real image now */
.avatar-img::after {
    display: none;
}

/* Assuming .module-content is a new or existing rule where scrollbar styles should apply */
.module-content {
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--orange) rgba(0, 0, 0, 0.3);
}

.module-content::-webkit-scrollbar {
    width: 6px;
}

.module-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.module-content::-webkit-scrollbar-thumb {
    background: var(--orange);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--orange-dim);
}

.module-content::-webkit-scrollbar-thumb:hover {
    background: #ff7733;
    box-shadow: 0 0 15px var(--orange);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--orange);
    box-shadow: 0 0 20px var(--orange-dim);
    position: relative;
    object-fit: cover;
    background: #111;
}

.profile-avatar::after {
    display: none;
}

.core-ring {
    position: absolute;
    border: 1px dashed rgba(255, 85, 0, 0.3);
    border-radius: 50%;
}

.core-ring.outer {
    width: 100%;
    height: 100%;
    animation: spin 40s linear infinite;
}

.core-ring.inner {
    width: 140px;
    height: 140px;
    animation: spin 25s linear infinite reverse;
    border-style: solid;
    border-width: 1px;
    border-color: transparent var(--orange) transparent var(--orange);
    opacity: 0.8;
}

.core-ring.static {
    width: 200px;
    height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* NAME ANIMATION (CONTINUOUS LOOP) */
.core-title {
    font-family: 'Unbounded', cursive;
    font-size: 1.9rem;
    line-height: 1.1;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.title-row {
    display: flex;
    gap: 2px;
}

.char {
    display: inline-block;
    color: white;
    position: relative;
    animation: hacker-glitch 3s infinite linear alternate-reverse;
    animation-delay: calc(var(--i) * 0.1s);
}

.char::before,
.char::after {
    content: attr(data-char);
    /* Requires JS to set data-char, or we use the content from HTML if possible, but CSS content attr only works on pseudo elements if attr is on parent. We will stick to visual glitching of the element itself or simple shadow offsets */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    opacity: 0.8;
    pointer-events: none;
}

.char::before {
    left: 2px;
    text-shadow: -1px 0 #cccccc;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.char::after {
    left: -2px;
    text-shadow: -1px 0 #888888;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes hacker-glitch {
    0% {
        transform: translate(0);
        opacity: 1;
        text-shadow: none;
    }

    2% {
        transform: translate(-2px, 1px);
        opacity: 0.8;
        text-shadow: 2px 0 white;
    }

    4% {
        transform: translate(2px, -1px);
        opacity: 1;
        text-shadow: -2px 0 #aaaaaa;
    }

    6% {
        transform: translate(0);
        opacity: 1;
        text-shadow: none;
    }

    90% {
        transform: translate(0);
        opacity: 1;
    }

    92% {
        transform: skew(10deg);
        opacity: 0.9;
    }

    94% {
        transform: skew(-10deg);
        opacity: 1;
    }

    100% {
        transform: translate(0);
    }
}

.services-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    width: min(780px, calc(100vw - 2rem));
    color: var(--text-main);
    border: none;
    padding: 0;
    background: transparent;
    font-weight: 600;
    letter-spacing: 0;
    cursor: default;
    position: relative;
    margin: 0 auto;
}

.services-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

#hub-view .service-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    min-height: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.25;
    text-align: center;
    text-transform: uppercase;
}

#hub-view .service-line i {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    flex: 0 0 auto;
}

.hub-quick-contact {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.55rem;
    width: min(720px, calc(100vw - 2rem));
    margin: 1.1rem auto 0;
}

.hub-contact-pill,
.hub-contact-pill:link,
.hub-contact-pill:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 36px;
    padding: 0.55rem 1rem;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    background: rgba(10, 10, 10, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom-color: rgba(255, 85, 0, 0.55);
    border-radius: 3px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
    transition: 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hub-contact-pill i {
    color: var(--orange);
    font-size: 0.86rem;
}

.hub-contact-pill:hover,
.hub-contact-pill:active {
    color: #ffffff;
    text-decoration: none;
    border-color: rgba(255, 85, 0, 0.8);
    background: rgba(255, 85, 0, 0.1);
    box-shadow: 0 0 18px rgba(255, 85, 0, 0.16);
    transform: translateY(-1px);
}

.hub-contact-pill--whatsapp i {
    color: #25d366;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #00ff00;
    box-shadow: 0 0 15px #00ff00;
    border-radius: 50%;
    /* Make it a circle */
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        opacity: 1;
        box-shadow: 0 0 15px #00ff00;
    }

    50% {
        opacity: 0.5;
        box-shadow: 0 0 30px #00ff00;
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 15px #00ff00;
    }
}

/* LIQUID GLASS NODES (iOS-style) */
.node {
    position: absolute;
    width: 140px;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    z-index: 2;
    transform-style: preserve-3d;
    will-change: transform;
    animation: liquid-float 6s ease-in-out infinite;
}

.node:nth-child(odd) {
    animation-delay: -1.5s;
}

.node:nth-child(even) {
    animation-delay: -3s;
}

@keyframes liquid-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.node-glass {
    position: absolute;
    width: 100%;
    height: 100%;
    /* Liquid glass layered background */
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.03) 40%, rgba(255, 255, 255, 0.08) 100%);
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    /* Squircle shape */
    border-radius: 32px;
    /* Subtle glass border */
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease !important;
    /* Inner shadow for depth + outer soft glow */
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        inset 0 -1px 1px rgba(0, 0, 0, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 0.5px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Inner light refraction */
.node-glass::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%,
            rgba(255, 255, 255, 0.12) 0%,
            transparent 50%);
    pointer-events: none;
    transition: all 0.5s ease;
}

/* Bottom reflection */
.node-glass::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 40%;
    background: linear-gradient(to top,
            rgba(255, 255, 255, 0.04),
            transparent);
    border-radius: 0 0 28px 28px;
    pointer-events: none;
}

.node-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transform: translateZ(20px);
    width: 100%;
    height: 100%;
}

.node-glow {
    position: absolute;
    width: 160%;
    height: 160%;
    background: radial-gradient(circle, rgba(255, 85, 0, 0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    filter: blur(10px);
}

.node:hover {
    transform: translateY(-12px) scale(1.08);
    animation-play-state: paused;
}

.node:hover .node-glass {
    background:
        linear-gradient(135deg, rgba(255, 85, 0, 0.12) 0%, rgba(255, 255, 255, 0.06) 40%, rgba(255, 85, 0, 0.08) 100%);
    border-color: rgba(255, 85, 0, 0.5);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        inset 0 -1px 1px rgba(0, 0, 0, 0.1),
        0 12px 40px rgba(255, 85, 0, 0.15),
        0 0 60px rgba(255, 85, 0, 0.08),
        0 0 0 0.5px rgba(255, 85, 0, 0.3);
}

.node:hover .node-glass::before {
    background: radial-gradient(ellipse at 30% 20%,
            rgba(255, 85, 0, 0.15) 0%,
            transparent 50%);
}

.node:hover .node-glow {
    opacity: 1;
}

.node i {
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    margin: 0;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.node-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    transition: all 0.4s ease;
}

.node:hover i {
    color: var(--orange);
    filter: drop-shadow(0 0 12px rgba(255, 85, 0, 0.5));
    transform: scale(1.1);
}

.node:hover .node-label {
    color: var(--orange);
    text-shadow: 0 0 15px rgba(255, 85, 0, 0.4);
}

/* Language switcher as footer */
.lang-switch {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.lang-switch .l-opt {
    margin: 0;
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Hide any language switcher that might be inside HUD (top) */
.hud-decor .lang-switch {
    display: flex !important;
    position: static;
    transform: none;
    background: transparent;
    border: none;
    padding: 0;
}

.footer-lang-switch {
    display: none !important;
}


/* Footer language switcher (visible on all sizes, but hidden on mobile via above rule) */
.footer-lang-switch {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    /* hidden by default, shown on desktop via media query */
    gap: 0.5rem;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.footer-lang-switch .l-opt {
    margin: 0;
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
}


.node:hover i,
.node:hover .node-label {
    color: var(--orange);
    text-shadow: 0 0 20px var(--orange);
}

/* Positioning Nodes (Wide X Layout - 2 Left, 2 Right) */

.node-about {
    top: 25%;
    left: 10%;
}

/* Top Left */
.node-skills {
    bottom: 25%;
    left: 10%;
}

/* Bottom Left */

.node-work {
    top: 25%;
    right: 10%;
}

/* Top Right */
.node-contact {
    bottom: 25%;
    right: 10%;
}

/* Bottom Right */


/* MODULES */
/* MODULES CONTAINER (Centered Overlay) */
.modules-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.module-active .modules-container {
    pointer-events: auto;
}

.module {
    position: absolute;
    width: 90%;
    max-width: 1200px;
    height: 85%;
    background: rgba(15, 15, 15, 0.98);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    -webkit-transform: translateY(40px) scale(0.97);
    transform: translateY(40px) scale(0.97);
    -webkit-transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    z-index: 20;
    border-radius: 8px;
    will-change: transform, opacity;
}

.module.active {
    opacity: 1;
    pointer-events: all;
    -webkit-transform: translateY(0) scale(1);
    transform: translateY(0) scale(1);
}

.holo-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--orange);
    box-shadow: 0 0 30px var(--orange);
    animation: scan 4s infinite linear;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 4rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.module-header h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: white;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.module-close {
    font-size: 1.5rem;
    color: var(--orange);
    cursor: pointer;
    transition: 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
}

.module-close:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--orange);
    border-color: var(--orange);
    box-shadow: 0 0 15px var(--orange-dim);
    transform: rotate(90deg);
}

.close-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 50%;
}

.close-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
    transform: rotate(90deg);
    box-shadow: 0 0 30px var(--orange-dim);
}

.module-content {
    padding: 3rem 4rem;
    overflow-y: auto;
    flex: 1;
}

/* ========== FORM STATUS MESSAGES ========== */
.form-status {
    margin-bottom: 1rem;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    display: none;
    /* Hidden by default */
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease-in-out;
}

.form-status:not(:empty) {
    display: flex;
}

.form-status.success {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.form-status.error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff0000;
    color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Disabled State */
.elegant-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* PERFECT CONTACT FORM */
.system-form {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    gap: 3rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    position: relative;
}

.form-group label {
    font-size: 0.75rem;
    color: var(--orange);
    letter-spacing: 2px;
    font-weight: 700;
    font-family: var(--font-code);
}

.form-group input,
.form-group textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    color: white;
    font-family: var(--font-ui);
    font-size: 1.1rem;
    transition: 0.3s;
    width: 100%;
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--orange);
    transition: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 0 15px var(--orange);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    padding-left: 15px;
    border-bottom-color: transparent;
}

.form-group input:focus~.input-line,
.form-group textarea:focus~.input-line {
    width: 100%;
}

.system-btn {
    background: var(--orange);
    color: black;
    border: none;
    padding: 1.5rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
    letter-spacing: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 2rem;
    border-radius: 2px;
}

.system-btn:hover {
    background: white;
    box-shadow: 0 0 40px var(--orange);
    transform: translateY(-3px);
}

/* ANIMATIONS */
@keyframes float {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-8px);
    }
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes scan {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
        box-shadow: 0 0 15px var(--orange);
    }

    50% {
        opacity: 0.5;
        box-shadow: 0 0 30px var(--orange);
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 15px var(--orange);
    }
}

/* ========== FOOTER ========== */
.system-footer {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: 100%;
    text-align: center;
    pointer-events: none;
}

.footer-content {
    display: inline-block;
    position: relative;
}

.footer-text {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    opacity: 0.6;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.r-mark {
    color: var(--orange);
    font-size: 0.6rem;
    vertical-align: super;
}

.footer-line {
    width: 0%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--orange), transparent);
    margin: 5px auto 0;
    transition: 1s;
    opacity: 0.5;
}

.system-footer:hover .footer-line {
    width: 100%;
}

/* CONTACT SPLIT LAYOUT */
.contact-split {
    display: flex;
    gap: 4rem;
    height: 100%;
}

.contact-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-divider {
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--border), transparent);
}

.contact-section h3 {
    font-family: var(--font-display);
    color: var(--orange);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.contact-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ELEGANT BUTTON */
.elegant-btn {
    background: transparent;
    color: white;
    border: 1px solid var(--border);
    padding: 1rem 2rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    margin-top: auto;
    /* Push to bottom if flex container allows */
    display: flex;
    justify-content: center;
    align-items: center;
}

.elegant-btn .btn-text {
    position: relative;
    z-index: 2;
    letter-spacing: 2px;
}

.elegant-btn .btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 85, 0, 0.2), transparent);
    transition: 0.5s;
    z-index: 1;
}

.elegant-btn:hover {
    border-color: var(--orange);
    box-shadow: 0 0 20px var(--orange-dim);
}

.elegant-btn:hover .btn-glow {
    left: 100%;
}

/* CHAT INTERFACE */
.chat-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.chat-history {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: var(--font-code);
    font-size: 0.9rem;
}

.chat-msg {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.chat-msg.system {
    color: #00ff00;
}

.chat-msg.user {
    color: white;
    align-self: flex-end;
    /* Optional: align user messages to right */
    flex-direction: row-reverse;
}

.msg-sender {
    font-weight: 700;
    opacity: 0.7;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: var(--font-code);
    font-size: 1rem;
}

#chat-input:focus {
    outline: none;
}

.elegant-btn.small {
    padding: 0.5rem 1.5rem;
    font-size: 0.8rem;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* RESPONSIVE CONTACT */
@media (max-width: 768px) {
    .contact-split {
        flex-direction: column;
        gap: 2rem;
    }

    .contact-divider {
        width: 100%;
        height: 1px;
        background: linear-gradient(to right, transparent, var(--border), transparent);
    }
}

/* ========== LIGHTBOX ========== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999999 !important;
    opacity: 0;
    pointer-events: none;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    border: 2px solid var(--orange);
    box-shadow: 0 0 40px rgba(255, 85, 0, 0.35);
    border-radius: 8px;
}

.lightbox-close-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: #000000;
    border: 2px solid var(--orange);
    color: #ffffff;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-display), sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 999999;
    
    /* Hardware acceleration fix for Safari/WebKit 3D context positioning */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.lightbox-close-btn:hover {
    background: var(--orange);
    color: #000000;
    box-shadow: 0 0 15px var(--orange-glow);
}

.lightbox-close-btn i {
    font-size: 0.9rem;
}

/* ========== RICH CONTENT STYLES ========== */

/* DATA PROFILE (About) */
.data-profile {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: #222;
    border-radius: 50%;
    border: 2px solid var(--orange);
    box-shadow: 0 0 20px var(--orange-dim);
    position: relative;
}

.profile-avatar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.profile-info h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.profile-info .role {
    font-family: var(--font-code);
    color: var(--orange);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: #00ff88;
    font-family: var(--font-code);
    border: 1px solid rgba(0, 255, 136, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 255, 136, 0.05);
}

.status-indicator .dot {
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff88;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.profile-bio {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.bio-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.9rem 1.2rem;
    border-left: 2px solid rgba(255, 85, 0, 0.3);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 6px 6px 0;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.bio-block:hover {
    border-left-color: var(--orange);
    background: rgba(255, 85, 0, 0.05);
}

.bio-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-code);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--orange);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.9;
}

.bio-label i {
    font-size: 0.75rem;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.bio-block p {
    font-family: var(--font-code);
    font-size: 0.97rem;
    line-height: 1.85;
    color: rgba(210, 210, 210, 0.92);
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    letter-spacing: 0.2px;
}

.data-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    padding-bottom: 3rem;
    margin-bottom: 3rem;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: 0.3s;
}

.stat-item:hover {
    border-color: var(--orange);
    background: rgba(255, 85, 0, 0.05);
    transform: translateY(-5px);
}

.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* SKILLS GRID — Service blocks */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}

@media (min-width: 768px) {
    .skills-grid .skill-card:last-child:nth-child(odd) {
        grid-column: span 2;
    }
}

.skill-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.skill-card:hover {
    border-color: var(--orange);
    background: rgba(255, 85, 0, 0.04);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.skill-service-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.3rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 85, 0, 0.25);
}

.skill-service-header i {
    font-size: 2.4rem;
    color: #ffffff;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
    transition: 0.3s;
    filter: drop-shadow(0 0 8px rgba(255, 85, 0, 0.5));
}

.skill-card:hover .skill-service-header i {
    filter: drop-shadow(0 0 16px rgba(255, 85, 0, 0.9));
    transform: scale(1.1);
}

.skill-service-title {
    font-family: var(--font-code);
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.35;
}

.skill-desc {
    font-family: var(--font-code);
    font-size: 0.97rem;
    line-height: 1.75;
    color: rgba(210, 210, 210, 0.9);
    margin: 0;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.skill-tags span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-code);
    font-size: 0.88rem;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.13);
    padding: 0.4rem 0.85rem;
    border-radius: 5px;
    transition: 0.25s;
}

.skill-tags span i {
    font-size: 1rem;
    color: var(--orange);
    flex-shrink: 0;
}

.skill-card:hover .skill-tags span {
    border-color: rgba(255, 85, 0, 0.4);
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 85, 0, 0.07);
}

.skill-card:hover .skill-tags span i {
    color: #ff7a20;
}

.skill-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-top: auto;
}

.skill-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--orange), rgba(255, 140, 0, 0.7));
    box-shadow: 0 0 8px var(--orange);
    transform: translateX(-100%);
    transition: 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.module.active .skill-bar .fill {
    transform: translateX(0);
}

/* PROJECTS GALLERY */
.projects-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    transition: 0.3s;
}

.project-card:hover {
    border-color: var(--orange);
    transform: translateY(-5px);
}

.project-img-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    cursor: pointer;
}

.project-img-wrapper > img.gallery-img,
.projects-gallery img.gallery-img,
.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-filter: grayscale(100%) saturate(0%) contrast(0.96) !important;
    filter: grayscale(100%) saturate(0%) contrast(0.96) !important;
    transition: 0.5s;
}

.project-card:hover .gallery-img,
.project-img-wrapper:hover > img.gallery-img {
    -webkit-filter: grayscale(100%) saturate(0%) contrast(0.96) !important;
    filter: grayscale(100%) saturate(0%) contrast(0.96) !important;
    transform: scale(1.1);
}

.lightbox #lightbox-img,
#lightbox-img {
    -webkit-filter: none !important;
    filter: none !important;
}

/* HIDE MOBILE ELEMENTS ON DESKTOP */
.mobile-lines,
.mobile-lang-menu {
    display: none !important;
}

/* PRELOADER */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: 0.3s;
}

.project-img-wrapper:hover .img-overlay {
    opacity: 1;
}

.img-overlay i {
    font-size: 2rem;
    color: var(--orange);
    transform: scale(0.5);
    transition: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-img-wrapper:hover .img-overlay i {
    transform: scale(1);
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: white;
}

.project-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tags .tag {
    font-family: var(--font-code);
    font-size: 0.65rem;
    letter-spacing: 1px;
    padding: 3px 10px;
    border: 1px solid rgba(255, 85, 0, 0.3);
    border-radius: 20px;
    color: var(--orange);
    background: rgba(255, 85, 0, 0.05);
    transition: 0.3s;
}

.project-card:hover .project-tags .tag {
    border-color: var(--orange);
    background: rgba(255, 85, 0, 0.1);
    box-shadow: 0 0 8px rgba(255, 85, 0, 0.15);
}

/* GLITCH TEXT ANIMATION */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    pointer-events: none;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.hud-btn .glitch-text::before,
.hud-btn .glitch-text::after {
    display: none !important;
}


.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(38px, 9999px, 84px, 0);
        transform: skew(0.65deg);
    }

    5% {
        clip: rect(26px, 9999px, 98px, 0);
        transform: skew(0.7deg);
    }

    10% {
        clip: rect(6px, 9999px, 83px, 0);
        transform: skew(0.08deg);
    }

    15% {
        clip: rect(56px, 9999px, 4px, 0);
        transform: skew(0.65deg);
    }

    20% {
        clip: rect(78px, 9999px, 16px, 0);
        transform: skew(0.24deg);
    }

    25% {
        clip: rect(13px, 9999px, 51px, 0);
        transform: skew(0.79deg);
    }

    30% {
        clip: rect(16px, 9999px, 34px, 0);
        transform: skew(0.48deg);
    }

    35% {
        clip: rect(89px, 9999px, 66px, 0);
        transform: skew(0.18deg);
    }

    40% {
        clip: rect(24px, 9999px, 5px, 0);
        transform: skew(0.66deg);
    }

    45% {
        clip: rect(74px, 9999px, 89px, 0);
        transform: skew(0.36deg);
    }

    50% {
        clip: rect(51px, 9999px, 23px, 0);
        transform: skew(0.04deg);
    }

    55% {
        clip: rect(9px, 9999px, 42px, 0);
        transform: skew(0.76deg);
    }

    60% {
        clip: rect(6px, 9999px, 78px, 0);
        transform: skew(0.25deg);
    }

    65% {
        clip: rect(33px, 9999px, 54px, 0);
        transform: skew(0.34deg);
    }

    70% {
        clip: rect(66px, 9999px, 21px, 0);
        transform: skew(0.63deg);
    }

    75% {
        clip: rect(10px, 9999px, 92px, 0);
        transform: skew(0.15deg);
    }

    80% {
        clip: rect(21px, 9999px, 65px, 0);
        transform: skew(0.95deg);
    }

    85% {
        clip: rect(99px, 9999px, 38px, 0);
        transform: skew(0.32deg);
    }

    90% {
        clip: rect(55px, 9999px, 8px, 0);
        transform: skew(0.65deg);
    }

    95% {
        clip: rect(42px, 9999px, 18px, 0);
        transform: skew(0.48deg);
    }

    100% {
        clip: rect(12px, 9999px, 64px, 0);
        transform: skew(0.28deg);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(12px, 9999px, 64px, 0);
        transform: skew(0.28deg);
    }

    5% {
        clip: rect(42px, 9999px, 18px, 0);
        transform: skew(0.48deg);
    }

    10% {
        clip: rect(55px, 9999px, 8px, 0);
        transform: skew(0.65deg);
    }

    15% {
        clip: rect(99px, 9999px, 38px, 0);
        transform: skew(0.32deg);
    }

    20% {
        clip: rect(21px, 9999px, 65px, 0);
        transform: skew(0.95deg);
    }

    25% {
        clip: rect(10px, 9999px, 92px, 0);
        transform: skew(0.15deg);
    }

    30% {
        clip: rect(66px, 9999px, 21px, 0);
        transform: skew(0.63deg);
    }

    35% {
        clip: rect(33px, 9999px, 54px, 0);
        transform: skew(0.34deg);
    }

    40% {
        clip: rect(6px, 9999px, 78px, 0);
        transform: skew(0.25deg);
    }

    45% {
        clip: rect(9px, 9999px, 42px, 0);
        transform: skew(0.76deg);
    }

    50% {
        clip: rect(51px, 9999px, 23px, 0);
        transform: skew(0.04deg);
    }

    55% {
        clip: rect(74px, 9999px, 89px, 0);
        transform: skew(0.36deg);
    }

    60% {
        clip: rect(24px, 9999px, 5px, 0);
        transform: skew(0.66deg);
    }

    65% {
        clip: rect(89px, 9999px, 66px, 0);
        transform: skew(0.18deg);
    }

    70% {
        clip: rect(16px, 9999px, 34px, 0);
        transform: skew(0.48deg);
    }

    75% {
        clip: rect(13px, 9999px, 51px, 0);
        transform: skew(0.79deg);
    }

    80% {
        clip: rect(78px, 9999px, 16px, 0);
        transform: skew(0.24deg);
    }

    85% {
        clip: rect(56px, 9999px, 4px, 0);
        transform: skew(0.65deg);
    }

    90% {
        clip: rect(6px, 9999px, 83px, 0);
        transform: skew(0.08deg);
    }

    95% {
        clip: rect(26px, 9999px, 98px, 0);
        transform: skew(0.7deg);
    }

    100% {
        clip: rect(38px, 9999px, 84px, 0);
        transform: skew(0.65deg);
    }
}

/* Responsive */
/* Responsive & Mobile Optimization */
@media (max-width: 1024px) {
    .node {
        width: 110px;
        height: 110px;
    }

    /* Adjust positioning for tablets */
    .node-about {
        top: 15%;
        left: 10%;
    }

    .node-skills {
        bottom: 15%;
        left: 10%;
    }

    .node-work {
        top: 15%;
        right: 10%;
    }

    .node-contact {
        bottom: 15%;
        right: 10%;
    }
}

@media (max-width: 768px) {

    /* HUD Mobile */
    .kinetic-hud {
        width: 100%;
        top: 0;
        transform: none;
        animation: none;
        padding: 0;
    }

    .hud-glass {
        border-radius: 0;
        border-top: none;
        border-left: none;
        border-right: none;
        padding: 0.8rem;
        justify-content: center;
        -webkit-backdrop-filter: blur(20px);
        /* Safari support */
        backdrop-filter: blur(20px);
    }

    .hud-decor {
        display: none;
    }

    .hud-links {
        gap: 0.8rem;
        width: 100%;
        justify-content: space-around;
    }

    .hud-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }

    /* Hub Center Mobile */
    .hub-center {
        margin-top: 6rem;
        transform: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .core-avatar {
        margin-bottom: 1rem;
        width: 140px;
        height: 140px;
    }

    .core-title {
        font-size: 1rem;
    }

    /* Transform Nodes to List View */
    .view-hub {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 100px;
        /* Space for HUD */
        overflow-y: auto;
        /* Allow scrolling if needed */
    }

    .node {
        position: relative;
        width: 90%;
        max-width: 320px;
        height: 60px;
        margin: 0.5rem 0;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
    }

    .node-glass {
        transform: none;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.08);
        -webkit-backdrop-filter: blur(10px) !important;
        backdrop-filter: blur(10px) !important;
    }

    .node-content {
        flex-direction: row;
        gap: 1rem;
        transform: none;
        justify-content: flex-start;
        padding-left: 1.5rem;
    }

    .node i {
        font-size: 1.2rem;
        width: 30px;
        text-align: center;
    }

    .node-label {
        display: block;
        font-size: 1rem;
        font-weight: 600;
        letter-spacing: 2px;
    }

    /* Module Mobile */
    .module {
        width: 100%;
        height: 100%;
        border: none;
        border-radius: 0;
    }

    .module-header {
        padding: 1rem 1.5rem;
    }

    .module-content {
        padding: 1.5rem;
    }

    .module-close {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }
}

.hub-address {
    display: block;
    margin-top: 1rem;
    font-family: var(--font-code);
    font-size: 1.00rem;
    color: #ffffff !important;
    text-decoration: none;
    letter-spacing: 2px;
    text-shadow: 0 0 0px transparent !important;
    transition: color 0.25s ease, text-shadow 0.25s ease !important;
    opacity: 1;
}

.hub-address:hover {
    color: var(--orange) !important;
    text-shadow: 0 0 10px var(--orange) !important;
    opacity: 1;
}

/* ========== RESPONSIVE DESIGN FOR MOBILE ========== */

/* Tablet devices */
@media (max-width: 1024px) {
    .hud-glass {
        padding: 0.8rem 1.5rem;
    }

    .hud-links {
        gap: 1rem;
    }

    .hud-btn {
        font-size: 0.7rem;
    }

    .module {
        width: 95%;
        height: 90%;
    }

    .module-header {
        padding: 1.5rem 2rem;
    }

    .module-content {
        padding: 2rem;
    }
}

/* Mobile devices (including iPhone 16 Pro Max: 430x932px) */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
        height: 100vh;
        height: 100dvh;
        /* Dynamic viewport height for mobile */
    }

    /* Disable parallax and 3D effects on mobile for better performance */
    .hud-glass {
        transform: none !important;
    }

    /* ===== STRICT MOBILE LAYOUT REWRITE ===== */
    /* This forces a specific layout structure regardless of screen size quirks */

    /* 1. Interface Layer - The Canvas */
    .interface-layer {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        transform-origin: center center;
        /* Scaling will be handled by media queries below */
    }

    #hub-view {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        overflow: hidden;
        margin: 0;
        padding: 0;
    }

    /* 2. Hub Center - ABSOLUTE CENTER */
    /* This pins the name/avatar to the dead center of the screen */
    .hub-center {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 300px !important;
        /* Fixed width to prevent wrapping */
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 5;
        min-height: 0 !important;
        /* Reset min-height */
    }

    /* 3. Nodes - CENTER RELATIVE POSITIONING */
    /* We position nodes relative to the CENTER of the screen using calc() */
    /* This guarantees the X shape regardless of screen width/height */

    .node {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        margin: 0 !important;
        width: 56px !important;
        height: 56px !important;
        z-index: 10;

        /* Diamond Shape */
        transform: rotate(45deg) !important;
        border-radius: 12px;
        background: rgba(20, 20, 20, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }

    /* Node Positions - Calculated from Center (0,0) */
    /* Offsets: X = +/- 100px, Y = +/- 120px */

    .node-about {
        /* Top Left */
        margin-top: -160px !important;
        /* Move UP */
        margin-left: -110px !important;
        /* Move LEFT */
    }

    .node-work {
        /* Top Right */
        margin-top: -160px !important;
        /* Move UP */
        margin-left: 54px !important;
        /* Move RIGHT (offset by width) */
    }

    .node-skills {
        /* Bottom Left */
        margin-top: 104px !important;
        /* Move DOWN */
        margin-left: -110px !important;
        /* Move LEFT */
    }

    .node-contact {
        /* Bottom Right */
        margin-top: 104px !important;
        /* Move DOWN */
        margin-left: 54px !important;
        /* Move RIGHT */
    }

    /* Node Content Counter-Rotation */
    .node-glass {
        transform: rotate(-45deg);
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .node i {
        font-size: 1.4rem;
        color: #ddd;
    }

    .node:active {
        transform: rotate(45deg) scale(0.9) !important;
        border-color: var(--orange);
    }

    .node:active i {
        color: var(--orange);
    }

    .node-label {
        display: none !important;
    }

    /* 4. Content Styling */
    .core-avatar {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
    }

    .avatar-img {
        width: 75px;
        height: 75px;
    }

    .core-title {
        font-size: 0.68rem;
        white-space: nowrap;
        margin-bottom: 0.5rem;
    }

    .hub-address {
        font-size: 0.7rem;
        margin-bottom: 1rem;
    }

    .lang-switch {
        margin-top: 0.5rem;
        gap: 0.5rem;
    }

    .l-opt {
        padding: 0.5rem 0.8rem;
        font-size: 0.7rem;
    }

    /* 5. Menu - Fixed at Top */
    .kinetic-hud {
        position: fixed;
        top: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 360px;
        z-index: 10000;
    }

    /* ===== SCALING FOR SMALL SCREENS ===== */
    /* Since we use fixed pixel offsets, we MUST scale the container for small screens */

    @media (max-width: 380px) {
        .interface-layer {
            transform: scale(0.85);
        }
    }

    @media (max-width: 340px) {
        .interface-layer {
            transform: scale(0.75);
        }
    }

    /* Hide Footer */
    .system-footer {
        display: none !important;
    }

    /* Modules - Full Screen Overlay */
    .modules-container {
        z-index: 999;
    }

    .module {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #0a0a0a;
        transform: none;
        border-radius: 0;
    }

    .module.active {
        transform: none !important;
    }

    .module-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        background: rgba(10, 10, 10, 0.98);
        z-index: 10;
    }

    .module-header h2 {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }

    .module-content {
        padding: 1.5rem;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        /* Smooth scrolling on iOS */
    }

    /* Text content - Better readability */
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding-bottom: 1.5rem;
    }

    .profile-info h3 {
        font-size: 1.3rem;
        line-height: 1.3;
    }

    .profile-info .role {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }

    .profile-bio {
        font-family: var(--font-code);
        font-size: 0.8rem;
        line-height: 1.9;
        text-align: left;
    }

    .profile-bio p {
        padding: 0.75rem 1rem;
        margin-top: 0.5rem;
    }

    .data-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .stat-item {
        padding: 1rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Skills Grid - Single column on mobile */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .skill-card {
        padding: 1.5rem;
    }

    .skill-card i {
        font-size: 2.5rem;
    }

    .skill-card span {
        font-size: 0.85rem;
    }

    /* Projects Gallery - Single column */
    .projects-gallery {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-img-wrapper {
        height: 180px;
    }

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

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

    /* Contact Split - Stack vertically */
    .contact-split {
        flex-direction: column;
        gap: 2rem;
        height: auto;
    }

    .contact-divider {
        width: 100%;
        height: 1px;
        background: linear-gradient(to right, transparent, var(--border), transparent);
    }

    .contact-section h3 {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .contact-section p {
        font-size: 0.85rem;
    }

    /* Form elements - Better touch targets */
    .form-group {
        margin-bottom: 1.5rem;
    }

    .form-group label {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
        /* Prevent zoom on iOS */
        padding: 0.9rem 0;
    }

    .form-group textarea {
        min-height: 120px;
    }

    .elegant-btn {
        padding: 1.1rem 1.5rem;
        font-size: 0.85rem;
        width: 100%;
        margin-top: 1rem;
    }

    .elegant-btn .btn-text {
        letter-spacing: 1px;
    }

    .form-status {
        font-size: 0.85rem;
        padding: 0.8rem;
        margin-bottom: 1rem;
    }

    /* Footer - Mobile optimized */
    .system-footer {
        position: relative;
        bottom: auto;
        padding: 1rem 0;
        margin-top: 2rem;
    }

    .footer-text {
        font-size: 0.6rem;
        letter-spacing: 1px;
    }

    .r-mark {
        font-size: 0.5rem;
    }

    /* Chat interface */
    .chat-interface {
        height: 100%;
    }

    .chat-history {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .chat-input-area {
        padding: 1rem;
        position: sticky;
        bottom: 0;
        background: var(--bg-panel);
    }

    #chat-input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }





    /* Grid overlay - Less visible on mobile */
    .grid-overlay {
        opacity: 0.3;
    }
}

/* ========== PREFERS REDUCED MOTION ========== */
/* Disables heavy animations for accessibility and weak devices */
@media (prefers-reduced-motion: reduce) {

    .char,
    .char::before,
    .char::after,
    .glitch-text::before,
    .glitch-text::after,
    .scan-line,
    .core-ring.outer,
    .core-ring.inner,
    .status-dot,
    .footer-text,
    .kinetic-hud,
    .holo-border {
        animation: none !important;
    }

    .view,
    .module,
    .node,
    .hud-btn::after,
    .node-glass,
    .node-glow {
        transition-duration: 0.1s !important;
    }

    .node:hover {
        transform: scale(1.05) !important;
    }
}

@media (min-width: 769px) {
    .interface-layer #hub-view .services-summary {
        width: min(980px, calc(100vw - 2rem)) !important;
    }

    .interface-layer #hub-view .services-summary .services-list {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.7rem !important;
    }

    .interface-layer #hub-view .services-summary .services-list .service-line {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 0.9rem !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: rgba(255, 255, 255, 0.5) !important;
        font-family: Arial, Helvetica, sans-serif !important;
        font-size: 0.88rem !important;
        font-weight: 500 !important;
        letter-spacing: 0.08em !important;
        line-height: 1.25 !important;
        text-align: center !important;
        text-transform: uppercase !important;
        white-space: nowrap !important;
    }

    .interface-layer #hub-view .services-summary .services-list .service-line i {
        color: rgba(255, 255, 255, 0.5) !important;
        font-size: 0.85rem !important;
        flex: 0 0 auto !important;
    }
}
