:root {
    --primary-dark: #0d0d1a;
    --secondary-dark: #1a1a2e;
    --accent-glow: #00f2fe;
    --accent-secondary: #ff00e5;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0c0;
    --font-header: 'Orbitron', sans-serif;
    --font-body: 'Roboto Mono', monospace;
}

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

html, body {
    min-height: 100%;
}

body {
    background-color: var(--primary-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-glow);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: white;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(13, 13, 26, 0.75);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(0, 242, 254, 0.18);
}

.navbar .logo {
    font-family: var(--font-header);
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    text-shadow: 0 0 5px var(--accent-glow);
}

#omglogo {
    height: 70px;
    filter: drop-shadow(0 0 5px var(--accent-glow));
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links a:hover {
    color: var(--accent-glow);
    text-shadow: 0 0 10px var(--accent-glow);
}

.hero {
    min-height: 90vh;
    padding: 10rem 5rem 6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.glitch-text {
    position: relative;
    font-family: var(--font-header);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 700;
    color: white;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

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

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-glow);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-secondary);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

.hero h3 {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    letter-spacing: 0.2em;
}

.section {
    padding: 7rem 5%;
    min-height: 50vh;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    position: relative;
    scroll-margin-top: 120px;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-family: var(--font-header);
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin-bottom: 1rem;
    text-align: center;
    text-transform: uppercase;
    color: white;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1rem;
    letter-spacing: 0.08em;
}

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

.cyber-card {
    background: var(--secondary-dark);
    border: 1px solid rgba(0, 242, 254, 0.25);
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cyber-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
}

.card-image img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 26, 0.75);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.cyber-card:hover .card-overlay {
    opacity: 0;
}

.card-title {
    font-family: var(--font-header);
    font-size: 1.4rem;
    color: white;
    margin-bottom: 0.5rem;
}

.card-tags {
    color: var(--accent-glow);
    font-size: 0.85rem;
}

#about p,
.contact-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-secondary);
}

.contact-content {
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 2rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-glow);
    text-shadow: 0 0 15px var(--accent-glow);
}

.footer {
    text-align: center;
    padding: 2rem 5%;
    border-top: 1px solid rgba(0, 242, 254, 0.2);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: rgba(0, 242, 254, 0.1);
    border: 2px solid rgba(0, 242, 254, 0.25);
    color: var(--text-primary);
    padding: 0.9rem 1.8rem;
    font-family: var(--font-header);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.3), transparent);
    transition: left 0.5s ease;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    background: rgba(0, 242, 254, 0.18);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--accent-glow);
    border-color: var(--accent-glow);
    color: var(--primary-dark);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.gallery-container {
    margin-bottom: 4rem;
}

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

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: var(--secondary-dark);
    border: 1px solid rgba(0, 242, 254, 0.2);
    height: 200px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-glow);
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.3s ease;
    text-transform: uppercase;
    font-family: var(--font-header);
    letter-spacing: 0.12em;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13, 13, 26, 0.95);
    z-index: 1200;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    display: block;
    border-radius: 14px;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    color: var(--accent-glow);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
}

.lightbox-close {
    top: -40px;
    right: 0;
}

.lightbox-prev {
    left: -50px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: -50px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-nav:hover {
    color: white;
}

.lightbox-info {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-family: var(--font-body);
}

.lightbox-info p {
    margin: 0.35rem 0;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 3rem;
    color: var(--accent-glow);
    margin-bottom: 1rem;
    display: block;
}

#three-scene {
    padding: 6rem 5%;
    min-height: auto;
}

.three-scene-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    align-items: flex-start;
    justify-content: center;
}

.three-scene {
    flex: 1;
    min-width: 320px;
    max-width: 760px;
}

.three-container {
    width: 100%;
    height: 70vh;
    max-height: 760px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(10, 10, 18, 0.85), rgba(18, 18, 32, 0.95));
    border: 2px solid rgba(0, 242, 254, 0.18);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.15), inset 0 0 20px rgba(0, 242, 254, 0.05);
    position: relative;
}

.three-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.model-viewer-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    z-index: 10;
}

.model-info {
    background: rgba(13, 13, 26, 0.85);
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    max-width: 760px;
    animation: fadeIn 0.6s ease-out;
}

.model-info h3 {
    color: var(--accent-glow);
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.model-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.model-category {
    display: inline-block;
    color: var(--accent-secondary);
    background: rgba(255, 0, 229, 0.12);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-top: 0.75rem;
    border: 1px solid rgba(255, 0, 229, 0.3);
}

.model-loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    pointer-events: none;
}

.model-loading-spinner.active {
    display: flex;
    pointer-events: auto;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 242, 254, 0.2);
    border-top-color: var(--accent-glow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.model-loading-spinner p {
    color: var(--accent-glow);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.85rem;
}

.model-loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 242, 254, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: auto;
}

.model-loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-glow), var(--accent-secondary));
    transition: width 0.25s ease;
}

.models-gallery-section {
    flex: 1;
    min-width: 360px;
    max-width: 460px;
}

.models-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-height: 120vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.models-gallery::-webkit-scrollbar {
    width: 6px;
}

.models-gallery::-webkit-scrollbar-track {
    background: rgba(0, 242, 254, 0.05);
    border-radius: 3px;
}

.models-gallery::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.3);
    border-radius: 3px;
}

.models-gallery::-webkit-scrollbar-thumb:hover {
    background: var(--accent-glow);
}

.model-card {
    background: var(--secondary-dark);
    border: 2px solid rgba(0, 242, 254, 0.15);
    border-radius: 14px;
    display: flex;
    gap: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.model-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 242, 254, 0.5);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}

.model-card.active {
    border-color: var(--accent-glow);
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.08), rgba(255, 0, 229, 0.05));
}

.model-card-image {
    width: 110px;
    min-width: 110px;
    height: 110px;
    overflow: hidden;
    border-radius: 12px;
}

.model-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.model-card:hover .model-card-image img {
    transform: scale(1.05);
}

.model-card-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
}

.model-card-title {
    color: white;
    font-family: var(--font-header);
    font-size: 1rem;
    margin: 0;
}

.model-card-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.model-card-category {
    color: var(--accent-glow);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.game-card {
    background: var(--secondary-dark);
    border: 1px solid rgba(0, 242, 254, 0.18);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}

.video-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background: #000;
}

.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.game-card h3 {
    font-family: var(--font-header);
    font-size: 1.2rem;
    color: white;
    margin: 1rem 1.25rem 0.5rem;
}

.game-card p {
    color: var(--text-secondary);
    margin: 0 1.25rem 1.25rem;
    line-height: 1.6;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(3% 0 94% 0); }
    25% { clip-path: inset(72% 0 1% 0); }
    50% { clip-path: inset(26% 0 33% 0); }
    75% { clip-path: inset(5% 0 77% 0); }
    100% { clip-path: inset(95% 0 2% 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(81% 0 11% 0); }
    25% { clip-path: inset(7% 0 69% 0); }
    50% { clip-path: inset(82% 0 1% 0); }
    75% { clip-path: inset(23% 0 49% 0); }
    100% { clip-path: inset(1% 0 92% 0); }
}

@keyframes glitch-skew {
    0% { transform: skew(-3deg); }
    10% { transform: skew(0deg); }
    20% { transform: skew(2deg); }
    30% { transform: skew(0deg); }
    40% { transform: skew(-1deg); }
    50% { transform: skew(0deg); }
    60% { transform: skew(5deg); }
    70% { transform: skew(0deg); }
    80% { transform: skew(-4deg); }
    90% { transform: skew(0deg); }
    100% { transform: skew(1deg); }
}

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

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

@media (max-width: 1024px) {
    .three-scene-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .models-gallery-section {
        max-width: 100%;
        width: 100%;
    }

    .models-gallery {
        overflow-x: auto;
        overflow-y: hidden;
        max-height: 180px;
        grid-auto-flow: column;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .model-card {
        min-width: 240px;
        width: 240px;
    }

    .model-card-image {
        width: 100%;
        min-width: auto;
        height: 100px;
    }

    .model-card-info {
        padding: 0.75rem;
    }

    .model-card-description {
        display: none;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 8rem 2.5rem 4rem;
    }

    .section {
        padding: 5rem 2.5rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .three-container {
        height: 55vh;
        max-height: 520px;
    }

    .game-grid {
        gap: 1rem;
    }

    .game-card h3 {
        margin: 0.85rem 1rem 0.4rem;
    }

    .game-card p {
        margin: 0 1rem 1rem;
    }

    .model-info {
        max-width: 100%;
    }
}
