/* --- GLOBAL RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lexend', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    background: #0a0614;
    color: #f8f8ff;
    position: relative;
    overflow-x: hidden;
}

/* Fixed tech icon (top-right). Gradient fallback looks like a bright moon */
/* Old moon layer no longer used; keeping for reference */
.moon-layer { display: none; }

/* Tech icons in header */
.tech-icons-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
}

.tech-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.9)) drop-shadow(0 0 18px rgba(140,160,255,0.55));
    opacity: 0.95;
    transition: transform 0.15s ease, opacity 0.2s ease, filter 0.3s ease;
    animation: techIconFloat 3s ease-in-out infinite;
}

.tech-icon-img:nth-child(1) { animation-delay: 0s; }
.tech-icon-img:nth-child(2) { animation-delay: 0.4s; }
.tech-icon-img:nth-child(3) { animation-delay: 0.8s; }
.tech-icon-img:nth-child(4) { animation-delay: 1.2s; }
.tech-icon-img:nth-child(5) { animation-delay: 1.6s; }
.tech-icon-img:nth-child(6) { animation-delay: 2.0s; }
.tech-icon-img:nth-child(7) { animation-delay: 2.4s; }

.tech-icon-img:hover {
    transform: translateY(-2px) scale(1.1);
    opacity: 1;
    filter: drop-shadow(0 0 12px rgba(255,255,255,1)) drop-shadow(0 0 24px rgba(140,160,255,0.85));
    animation-play-state: paused;
}

@keyframes techIconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-4px);
    }
}

.tech-icon {
    position: absolute;
    /* Start well below header; parallax will add small movement */
    top: 12%;
    left: 6%;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 35% 35%, #ffffff 0%, #f6f7ff 45%, #dbe4ff 60%, rgba(180,195,255,0.5) 75%, rgba(120,140,255,0.18) 100%);
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 12px rgba(255,255,255,0.9), 0 0 38px rgba(124,166,255,0.55), 0 0 70px rgba(90,120,255,0.35);
    z-index: 1;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.2s ease;
}

.tech-icon:hover { transform: scale(1.06) rotate(-3deg); filter: brightness(1.06) saturate(1.06); }

/* --- PARALLAX BACKGROUND --- */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    width: 120%;
    height: 120%;
    left: -10%;
    top: -10%;
    background-repeat: repeat-x;
    background-position: center bottom;
    background-size: cover;
}

/* Ensure the moon layer uses full viewport bounds (not the 120% overflow) */
.parallax-layer.moon-layer {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.parallax-layer.tech-row-layer {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.stars {
    background: radial-gradient(2px 2px at 20% 30%, white, transparent),
                radial-gradient(2px 2px at 60% 70%, white, transparent),
                radial-gradient(1px 1px at 50% 50%, white, transparent),
                radial-gradient(1px 1px at 80% 10%, white, transparent),
                radial-gradient(2px 2px at 90% 60%, white, transparent),
                radial-gradient(1px 1px at 33% 80%, white, transparent),
                radial-gradient(1px 1px at 15% 50%, white, transparent),
                radial-gradient(1px 1px at 45% 20%, white, transparent),
                radial-gradient(2px 2px at 75% 85%, white, transparent),
                radial-gradient(1px 1px at 10% 40%, white, transparent),
                radial-gradient(1px 1px at 55% 65%, white, transparent),
                radial-gradient(2px 2px at 25% 55%, white, transparent),
                radial-gradient(1px 1px at 85% 35%, white, transparent),
                radial-gradient(1px 1px at 40% 90%, white, transparent),
                radial-gradient(1px 1px at 95% 25%, white, transparent),
                radial-gradient(2px 2px at 5% 75%, white, transparent),
                radial-gradient(1px 1px at 70% 15%, white, transparent),
                radial-gradient(1px 1px at 30% 45%, white, transparent),
                radial-gradient(1px 1px at 65% 80%, white, transparent),
                radial-gradient(2px 2px at 12% 60%, white, transparent);
    background-color: #0a0e27;
    background-size: 200% 200%;
    animation: twinkle 8s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.8);
    animation: fadeInOut 3s ease-in-out infinite;
}

.stars::before {
    top: 25%;
    left: 35%;
    animation-delay: 0s;
}

.stars::after {
    top: 60%;
    left: 75%;
    animation-delay: 1.5s;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes fadeInOut {
    0%, 100% { 
        opacity: 0;
        transform: scale(0);
    }
    50% { 
        opacity: 1;
        transform: scale(1);
    }
}

.fading-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.8);
    animation: fadeInOut 3s ease-in-out forwards;
    pointer-events: none;
}

.spaceship {
    position: absolute;
    width: 30px;
    height: 12px;
    animation: spaceshipFly 2.5s linear forwards;
    pointer-events: none;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.8));
}

.spaceship::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 30px solid #3b82f6;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.spaceship::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 30px;
    width: 60px;
    height: 3px;
    background: linear-gradient(270deg, 
        transparent 0%,
        rgba(255, 107, 53, 0.4) 30%,
        rgba(255, 107, 53, 0.7) 60%,
        rgba(255, 200, 50, 0.9) 100%);
    transform: translateY(-50%);
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.6);
    animation: enginePulse 0.15s ease-in-out infinite alternate;
}

@keyframes spaceshipFly {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: translate(30px, 10px) scale(1);
    }
    90% {
        opacity: 1;
        transform: translate(270px, 90px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(300px, 100px) scale(0.8);
    }
}

@keyframes enginePulse {
    0% {
        width: 60px;
        opacity: 0.7;
    }
    100% {
        width: 70px;
        opacity: 1;
    }
}

/* Slow Spaceship */
.slow-spaceship {
    position: absolute;
    width: 60px;
    height: 60px;
    left: -70px;
    animation: slowSpaceshipFly 18s linear forwards;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
    z-index: 15;
}

.slow-spaceship::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    background-image: url('images/rocket.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(0) saturate(100%) invert(56%) sepia(94%) saturate(2764%) hue-rotate(201deg) brightness(102%) contrast(95%);
    transform: rotate(90deg);
}

.slow-spaceship::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 45px;
    width: 60px;
    height: 40px;
    background-image: url('images/flammable.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: translateY(-50%) rotate(-90deg);
    animation: flamesScale 0.8s ease-in-out infinite;
}

@keyframes slowSpaceshipFly {
    0% {
        left: -60px;
        opacity: 0;
    }
    3% {
        opacity: 1;
    }
    97% {
        opacity: 1;
    }
    100% {
        left: calc(100% + 60px);
        opacity: 1;
    }
}

@keyframes slowEnginePulse {
    0% {
        width: 80px;
        opacity: 0.5;
    }
    100% {
        width: 90px;
        opacity: 0.8;
    }
}

@keyframes flamesScale {
    0%, 100% {
        transform: translateY(-50%) rotate(-90deg) scale(0.9);
    }
    50% {
        transform: translateY(-50%) rotate(-90deg) scale(1.1);
    }
}

@keyframes flamesMove {
    0%, 100% {
        transform: translateY(-50%) translateX(0) rotate(-90deg);
    }
    50% {
        transform: translateY(-50%) translateX(15px) rotate(-90deg);
    }
}

/* Landing Spaceship */
.landing-spaceship {
    position: absolute;
    width: 80px;
    height: 35px;
    left: -100px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    opacity: 0;
}

.landing-spaceship.fly-in {
    animation: spaceshipLanding 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.spaceship-body {
    position: relative;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.9));
    transition: transform 0.1s ease-out;
}

.spaceship-body::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 0;
    width: 0;
    height: 0;
    border-left: 80px solid #3b82f6;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
}

.spaceship-body::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 80px;
    width: 100px;
    height: 4px;
    background: linear-gradient(270deg, 
        transparent 0%,
        rgba(255, 107, 53, 0.4) 30%,
        rgba(255, 107, 53, 0.7) 60%,
        rgba(255, 200, 50, 0.9) 100%);
    transform: translateY(-50%);
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.8);
    animation: enginePulse 0.15s ease-in-out infinite alternate;
}

@keyframes spaceshipLanding {
    0% {
        opacity: 1;
        left: -100px;
        top: 20%;
        transform: translateY(0) scale(0.5) rotate(-15deg);
    }
    25% {
        left: 20%;
        top: 28%;
        transform: translateX(-50%) translateY(0) scale(0.7) rotate(-8deg);
    }
    50% {
        left: 40%;
        top: 38%;
        transform: translateX(-50%) translateY(0) scale(0.9) rotate(-3deg);
    }
    75% {
        left: 50%;
        top: 46%;
        transform: translateX(-50%) translateY(0) scale(0.98) rotate(-1deg);
    }
    90% {
        left: 50%;
        top: 49%;
        transform: translateX(-50%) translateY(-50%) scale(1) rotate(0deg);
    }
    100% {
        opacity: 1;
        left: 50%;
        top: 50%;
        transform: translateX(-50%) translateY(-50%) scale(1) rotate(0deg);
    }
}

.landing-spaceship.landed {
    animation: landedFadeOut 1s ease-out 0.8s forwards;
}

@keyframes landedFadeOut {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-50%) scale(0.8);
    }
}

.landing-spaceship.landed .spaceship-body::after {
    animation: engineShutdown 0.5s ease-out forwards;
}

@keyframes engineShutdown {
    0% {
        width: 100px;
        opacity: 1;
    }
    100% {
        width: 0;
        opacity: 0;
    }
}

.mountains-far {
    background: linear-gradient(to bottom, 
        rgba(31, 58, 147, 0.6) 0%, 
        rgba(31, 58, 147, 0.8) 50%,
        rgba(31, 58, 147, 1) 100%);
    clip-path: polygon(
        0% 70%, 10% 65%, 20% 68%, 30% 60%, 40% 65%, 
        50% 55%, 60% 58%, 70% 62%, 80% 58%, 90% 63%, 100% 68%,
        100% 100%, 0% 100%
    );
}

.mountains-mid {
    background: linear-gradient(to bottom,
        rgba(45, 55, 115, 0.7) 0%,
        rgba(45, 55, 115, 0.9) 50%,
        rgba(30, 35, 75, 1) 100%);
    clip-path: polygon(
        0% 75%, 8% 72%, 15% 68%, 25% 70%, 35% 64%, 
        45% 67%, 55% 62%, 65% 65%, 75% 68%, 85% 64%, 95% 70%, 100% 72%,
        100% 100%, 0% 100%
    );
}

.mountains-near {
    background: linear-gradient(to bottom,
        rgba(75, 50, 100, 0.8) 0%,
        rgba(55, 35, 80, 0.95) 50%,
        rgba(30, 20, 50, 1) 100%);
    clip-path: polygon(
        0% 80%, 12% 76%, 18% 78%, 28% 72%, 38% 75%, 
        48% 70%, 58% 73%, 68% 70%, 78% 74%, 88% 71%, 100% 75%,
        100% 100%, 0% 100%
    );
}

.trees {
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 75%,
        rgba(20, 10, 35, 0.6) 80%,
        rgba(15, 8, 25, 0.9) 90%,
        rgba(10, 6, 20, 1) 100%);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lexend', sans-serif;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* --- LAYOUT HELPERS --- */
.section {
    padding: 100px 20px;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Hero section should be visible immediately */
.hero {
    opacity: 1;
    transform: translateY(0);
}

.section-inner {
    max-width: 960px;
    margin: 0 auto;
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.section-description {
    margin-bottom: 32px;
    color: #c3c3d9;
}

.section-alt {
    background: rgba(10, 8, 32, 0.9);
}

/* --- HEADER / NAVBAR --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(12px);
    background: rgba(5, 5, 20, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(59, 130, 246, 0.5);
    cursor: pointer;
}

/* --- MINI MAZE GAME MODAL --- */
.mini-game-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 10050;
}
.mini-game-modal.active { display: block; }

.mini-game-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
}

.mini-game-dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 380px);
    padding: 14px 14px 16px;
    border-radius: 16px;
    background: radial-gradient(circle at top, rgba(10,16,30,0.96), rgba(6,10,18,0.98));
    border: 1px solid rgba(102, 231, 255, 0.25);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.mini-game-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(102,231,255,0.35);
    background: rgba(10,14,22,0.9);
    color: #c9f6ff;
    cursor: pointer;
    z-index: 2;
}
.mini-game-close:hover { filter: drop-shadow(0 0 8px rgba(102,231,255,0.6)); }

.mini-game-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}
.mini-game-title { font-weight: 700; letter-spacing: .04em; color: #e8f7ff; }
.mini-game-score { font-weight: 800; color: #9ee6ff; }

#miniGameCanvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid rgba(102, 231, 255, 0.25);
    background: #02060d;
}

.mini-game-footer {
    margin-top: 8px;
    text-align: center;
    color: #bcdcff;
    font-size: 0.85rem;
}

.game-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.game-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid rgba(102, 231, 255, 0.35);
    background: rgba(10, 14, 22, 0.9);
    color: #c9f6ff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-btn:hover {
    filter: drop-shadow(0 0 8px rgba(102, 231, 255, 0.6));
    transform: scale(1.05);
}

.game-btn:active {
    transform: scale(0.95);
}

.logo {
    font-family: 'Lexend', sans-serif;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-size: 1rem;
    text-transform: uppercase;
}

.logo span {
    color: #3b82f6;
}

/* NAV LINKS */
.nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 18px;
}

.nav-link {
    text-decoration: none;
    color: #e6e6ff;
    font-size: 0.95rem;
    position: relative;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: width 0.2s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* NAV TOGGLE (MOBILE) */
.nav-toggle {
    display: none;
    font-size: 1.5rem;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
}

/* --- HERO SECTION --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px; /* space for fixed header */
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-avatar {
    width: 450px;
    height: 450px;
    border-radius: 24px;
    object-fit: cover;
    border: 4px solid rgba(59, 130, 246, 0.6);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5);
    flex-shrink: 0;
    transition: transform 0.15s ease-out;
    opacity: 0;
    transform: scale(0.5);
}

.hero-content {
    opacity: 0;
}

.hero-content.show {
    animation: popIn 0.6s ease-out forwards;
}

.hero-content.show .hero-avatar {
    animation: popIn 0.6s ease-out 0.2s forwards;
}

.hero-content.show .hero-text {
    animation: slideInRight 0.8s ease-out 0.4s forwards;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    60% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 0.8s ease-out 0.5s forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero h1 {
    font-size: clamp(2.8rem, 5vw, 4rem);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    max-width: 100%;
    color: #c3c3d9;
    line-height: 1.8;
    margin-bottom: 32px;
    font-size: 1.15rem;
}

.hero-subtitle-short {
    display: none;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* --- INTRO CARDS (desktop: reveal on scroll; mobile: text) --- */
.intro-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: stretch;
    width: 100%;
}

.intro-card {
    background: linear-gradient(180deg, rgba(10,8,32,0.96), rgba(24,12,56,0.92));
    border-radius: 14px;
    padding: 26px;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.03);
    box-shadow: 0 18px 48px rgba(2,6,20,0.7), 0 0 0 1px rgba(0,0,0,0.25) inset;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateY(28px) scale(0.985);
    opacity: 0;
    transition: transform 520ms cubic-bezier(.2,.9,.2,1), opacity 420ms ease, box-shadow 220ms ease, border-color 220ms ease;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

/* floating idle motion after reveal */
@keyframes floaty {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}

.intro-cards.reveal .intro-card {
    animation: floaty 6.6s ease-in-out infinite 0.6s;
}

.card-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.card-cta {
    display: inline-block;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(38,255,231,0.12), rgba(0,255,209,0.08));
    color: #26ffe7;
    font-weight: 600;
    width: max-content;
    border: 1px solid rgba(38,255,231,0.14);
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
    margin-top: 6px;
}

.card-cta:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(2,20,30,0.5); }

.card-desc { transform: translateY(0); transition: transform 300ms ease, opacity 260ms ease; }
.intro-card:hover .card-desc { transform: translateY(-6px); opacity: 0.98; }

.intro-card .card-icon {
    font-size: 44px;
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

.card-title { font-size: 1.25rem; font-weight: 700; }
.card-desc { color: #d8e9f7; font-size: 0.95rem; line-height: 1.45; }

/* Reveal state (added by JS when section visible) */
.intro-cards.reveal .intro-card { transform: translateY(0) scale(1); opacity: 1; }
.intro-cards.reveal .intro-card.middle { transition-delay: 0s; }
.intro-cards.reveal .intro-card.left   { transition-delay: 0.08s; }
.intro-cards.reveal .intro-card.right  { transition-delay: 0.16s; }

.intro-card:hover { border-color: rgba(38,255,231,0.12); box-shadow: 0 28px 80px rgba(2,10,20,0.7), 0 0 36px rgba(38,255,231,0.03); transform: translateY(-6px) scale(1.02); }

/* neon gradient border pseudo - subtle animated frame */
.intro-card::before{
    content: "";
    position:absolute;
    inset: -2px;
    background: conic-gradient(from 180deg at 50% 50%, rgba(38,255,231,0.06), rgba(0,255,209,0.06), rgba(38,255,231,0.06));
    z-index: 0;
    border-radius: 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 420ms ease, transform 420ms ease;
    transform: scale(0.98);
}

.intro-card:hover::before{ opacity: 1; transform: scale(1); }

/* animated sheen across card */
.intro-card::after{
    content: "";
    position:absolute;
    left: -60%;
    top: -40%;
    width: 40%;
    height: 180%;
    background: linear-gradient(120deg, rgba(255,255,255,0.02), rgba(255,255,255,0.12), rgba(255,255,255,0.02));
    transform: rotate(18deg);
    filter: blur(18px);
    z-index: 0;
    opacity: 0;
    transition: opacity 320ms ease;
}

.intro-card:hover::after{ opacity: 1; left: 120%; transition: left 800ms cubic-bezier(.2,.9,.2,1); }

/* ensure content sits above pseudo elements */
.intro-card > * { position: relative; z-index: 2; }

/* mobile fallback: show text instead of cards */
.mobile-intro { display: none; color: #cfeff0; margin-top: 6px; }
.mobile-intro h3 { margin-top: 8px; margin-bottom: 6px; font-size: 1.1rem; }
.mobile-intro p { margin-bottom: 10px; color: #d6f8f5; }

/* desktop layout tweak: pull cards up a bit under hero */
@media (min-width: 720px) {
    #intro-cards .section-inner { padding-top: 10px; }
    #intro-cards .intro-cards { margin-top: -56px; align-items: start; }
    .intro-card { min-height: 200px; }
}

@media (max-width: 720px) {
    .intro-cards { display: none; }
    .mobile-intro { display: block; }
    
    /* Hide tech icons in mobile/vertical mode */
    .tech-icons-row { display: none; }
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-family: 'Lexend', sans-serif;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn.primary {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.45);
}

.btn.primary:hover {
    transform: translateY(-1px);
}

/* small button variant used in project list and viewer */
.btn.small {
    padding: 6px 10px;
    font-size: 0.82rem;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    color: #fff;
    border: 1px solid rgba(255,255,255,0.06);
}

.btn.secondary {
    background: transparent;
    border-color: #3b82f6;
    color: #93c5fd;
}

.btn.secondary:hover {
    background: rgba(59, 130, 246, 0.15);
}

/* --- PROJECTS GRID --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* Compact grid for quick project overview (4 cols desktop, 2 cols tablet, 1 col mobile) */
.projects-grid-compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.compact-card {
    background: linear-gradient(180deg, rgba(12,10,36,0.85), rgba(24,14,56,0.9));
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 10px 28px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 140ms ease, border-color 120ms ease;
}
.compact-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0,0,0,0.55); border-color: rgba(59,130,246,0.6); }
.compact-card h4 { font-size: 0.95rem; margin-bottom: 2px; }
.compact-tags { display:none; }
.compact-card .tag { font-size: 0.72rem; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.03); color: #e8e8ff; }

@media (max-width: 1000px) {
    .projects-grid-compact { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
    .projects-grid-compact { grid-template-columns: 1fr; }
}

.project-card {
    padding: 18px 16px;
    border-radius: 12px;
    background: rgba(12, 10, 38, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
}

.project-card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.project-card p {
    font-size: 0.95rem;
    color: #d3d3f2;
    margin-bottom: 10px;
}

/* --- MORE PROJECT CARD ACTIONS --- */
.more-project-card .card-actions { margin-top: 10px; display: flex; gap: 8px; justify-content: center; align-items: center; }
.more-project-card .card-actions .btn.small.steam { padding: 6px 10px; background: linear-gradient(90deg, rgba(255,105,245,0.06), rgba(255,255,255,0.02)); color: #ffd0f7; border: 1px solid rgba(255,105,245,0.12); transition: transform 160ms ease, box-shadow 160ms ease; }
.more-project-card .card-actions .btn.small.steam:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.45); }
.more-project-card .card-actions .btn.small.steam.disabled { opacity: 0.48; pointer-events: none; filter: grayscale(18%); border-color: rgba(255,255,255,0.03); }

.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

/* --- CONTACT FORM --- */
#contact .section-inner {
    text-align: center;
}

.contact-form {
    max-width: 520px;
    margin: 8px auto 0 auto;
    text-align: left;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

label {
    font-size: 0.9rem;
    color: #d0d0ff;
}

input,
textarea {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(5, 5, 20, 0.9);
    color: #ffffff;
    font-size: 0.95rem;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

/* --- PROJECT DETAILS SHOWCASE SECTION --- */
.project-details-section {
    padding: 60px 20px;
    background: linear-gradient(180deg, rgba(10,6,20,0.95) 0%, rgba(2,2,10,0.98) 100%);
    position: relative;
    z-index: 10;
}

.back-to-projects-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: 'Lexend', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 40px;
}

.back-to-projects-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    transform: translateX(-4px);
}

.details-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
    text-align: center;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.details-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.detail-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s ease;
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.15);
}

/* Alternate layout: image on right */
.detail-item:nth-child(even) {
    grid-template-columns: 1fr 1fr;
}

.detail-item:nth-child(even) .detail-image {
    order: 2;
}

.detail-item:nth-child(even) .detail-text {
    order: 1;
}

.detail-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.detail-item:hover .detail-image img {
    transform: scale(1.05);
}

.detail-text {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 0;
}

.detail-text h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-text p {
    font-size: 1rem;
    line-height: 1.7;
    color: #c0c0d0;
}

/* Responsive Design */
@media (max-width: 900px) {
    .detail-item,
    .detail-item:nth-child(even) {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .detail-item:nth-child(even) .detail-image,
    .detail-item:nth-child(even) .detail-text {
        order: unset;
    }
    
    .details-title {
        font-size: 2rem;
    }
    
    .detail-text h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .details-title {
        font-size: 1.6rem;
        margin-bottom: 40px;
    }
    
    .details-content {
        gap: 50px;
    }
    
    .detail-item {
        padding: 20px;
    }
}

/* --- FOOTER --- */
.site-footer {
    padding: 32px 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #a0a0c0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(2, 2, 10, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.footer-socials {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-socials a {
    color: #a0a0c0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
}

.footer-socials a:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.footer-socials svg {
    width: 20px;
    height: 20px;
}

.footer-content p {
    margin: 0;
}


/* --- RESPONSIVE --- */
@media (max-width: 720px) {
    .hero {
        padding-top: 80px;
        min-height: 100vh;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .hero-avatar {
        width: 250px;
        height: 250px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-subtitle-full {
        display: none;
    }

    .hero-subtitle-short {
        display: block;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
}

/* Landscape mobile/tablet for hero section */
@media (max-width: 920px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 20px 40px;
    }
    
    .hero-content {
        flex-direction: row;
        gap: 30px;
        max-width: 100%;
    }
    
    .hero-avatar {
        width: 180px;
        height: 180px;
    }
    
    .hero-text {
        text-align: left;
    }
    
    .hero h1 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    
    .hero-buttons {
        flex-direction: row;
        gap: 8px;
    }
    
    .hero-buttons .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* Mobile and Tablet - Dropdown Navigation */
@media (max-width: 1024px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 56px;
        right: 8px;
        width: 200px;
        flex-direction: column;
        background: rgba(5, 5, 20, 0.98);
        backdrop-filter: blur(10px);
        padding: 8px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .nav-links.show {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links li {
        margin: 0;
    }

    .nav-link {
        padding: 12px 14px;
        display: block;
        border-radius: 6px;
        transition: background 0.2s ease;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(59, 130, 246, 0.1);
    }

    .nav-link::after {
        display: none;
    }
}

/* Tablet portrait */
@media (min-width: 721px) and (max-width: 1024px) and (orientation: portrait) {
    .hero-content {
        gap: 40px;
    }
    
    .hero-avatar {
        width: 300px;
        height: 300px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* --- PROJECTS LAYOUT --- */
.projects-layout {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 24px;
}

.projects-list {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding-right: 16px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
}

.projects-header {
    flex-shrink: 0;
    padding-bottom: 12px;
}

/* Click Indicator Animation */
.click-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: rgba(59, 130, 246, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeIn 0.5s ease-in;
    transition: opacity 0.3s ease;
}

.click-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.indicator-text {
    animation: pulse 2s ease-in-out infinite;
}

.indicator-arrow {
    width: 20px;
    height: 20px;
    animation: bounce 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(5px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.projects-header .section-title-row {
    margin: 0 0 20px 0;
}

.projects-scroll {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding-right: 12px;
}

/* Desktop: Allow vertical scrolling for project list */
@media (min-width: 1025px) {
    .projects-scroll {
        overflow-y: auto;
        max-height: none;
    }
}

/* Dark themed scrollbar for project list (WebKit browsers) */
.projects-scroll::-webkit-scrollbar { width: 12px; }
.projects-scroll::-webkit-scrollbar-track { background: transparent; margin: 8px 0; border-radius: 10px; }
.projects-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(80,50,110,0.9), rgba(90,35,130,0.8));
    border-radius: 10px;
    border: 3px solid rgba(0,0,0,0.18);
}
.projects-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(110,45,170,0.95), rgba(255,105,245,0.5));
}

/* Dark themed scrollbar for the viewer and other scroll containers */
.project-viewer::-webkit-scrollbar, .viewer-panels::-webkit-scrollbar { width: 10px; }
.project-viewer::-webkit-scrollbar-track, .viewer-panels::-webkit-scrollbar-track { background: transparent; border-radius: 10px; }
.project-viewer::-webkit-scrollbar-thumb, .viewer-panels::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(50,30,80,0.9), rgba(60,22,100,0.8));
    border-radius: 10px;
    border: 2px solid rgba(0,0,0,0.14);
}

/* Firefox: make scrollbars dark & thin */
.projects-scroll, .project-viewer, .viewer-panels { scrollbar-width: thin; scrollbar-color: rgba(100,60,160,0.85) transparent; }

/* PROJECT LIST CARDS */
.project-item {
    padding: 12px 12px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(15, 13, 60, 0.95), rgba(30, 16, 80, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-30px);
    position: relative;
}

.project-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 197, 253, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-item.active {
    border-color: rgba(59, 130, 246, 1);
    background: linear-gradient(135deg, rgba(25, 23, 90, 0.98), rgba(50, 36, 120, 0.98));
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4), inset 0 0 20px rgba(59, 130, 246, 0.15);
    transform: scale(1.02);
}

.project-item.active::before {
    opacity: 1;
}

.project-item.animate-in {
    animation: slideInLeft 0.5s ease-out forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Project list: compact card with thumbnail */
.project-item {
    display: flex;
    gap: 12px;
    align-items: center;
}

.project-thumb {
    width: auto;
    max-width: 110px;
    height: auto;
    max-height: 72px;
    object-fit: contain;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.04);
}

.project-item .project-meta {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

/* Landscape mode: stack vertically with image on top */
@media (max-width: 920px) and (orientation: landscape) {
    .project-item {
        flex-direction: column;
        align-items: center;
    }
    
    .project-thumb {
        width: auto;
        max-width: 180px;
        height: auto;
        max-height: 100px;
        order: -1;
    }
    
    .project-item .project-meta {
        order: 1;
    }
}

.project-item h3 { margin-bottom: 6px; }
.project-item p { margin-bottom: 8px; color: #cfcff1; }

.project-tags { display: none; }

.project-item .btn.small { margin-left: 0; margin-top: 8px; }

/* viewer links area */
#viewerLinks { display:flex; gap:8px; margin: 10px 0 12px 0; }

/* Tighter projects section spacing so page doesn't leave large empty areas */
#projects { padding-top: 60px; padding-bottom: 48px; }

/* Ensure left list and viewer align at top */
.projects-layout { align-items: start; }



/* Make the viewer fill available space and look balanced */
.project-viewer { 
    display: flex; 
    flex-direction: column;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes viewerUpdate {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    60% {
        transform: scale(1.02) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.viewer-box { min-height: 340px; }

/* Featured video in project viewer */
.viewer-featured { margin: 12px 0 18px; }
.viewer-featured video { width: 100%; height: auto; border-radius: 12px; border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 20px 50px rgba(0,0,0,0.6); }

/* Standalone featured video section (under Projects) */
.featured-video-section { padding-top: 36px; padding-bottom: 36px; }
.featured-video-section .featured-video-wrap { margin-top: 8px; max-width: 100%; }
.featured-video-section video { width: 100%; height: auto; border-radius: 12px; border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 20px 50px rgba(0,0,0,0.6); background: #000; }

/* ---- MORE PROJECTS section layout + card styles ---- */
.more-projects-section { padding-top: 28px; padding-bottom: 28px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 14px; justify-content: center; justify-items: center; }
.more-project-card { 
    background: linear-gradient(180deg, rgba(8,6,28,0.9), rgba(16,10,40,0.95)); 
    border-radius: 12px; 
    overflow: hidden; 
    border: 1px solid rgba(255,255,255,0.04); 
    box-shadow: 0 16px 40px rgba(0,0,0,0.6); 
    display: flex; 
    flex-direction: column; 
    text-align: center; 
    max-width: 320px; 
    width: 100%;
    opacity: 0;
    transform: translateY(30px);
}

.more-project-card.animate-in {
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.more-project-card .thumb { height: 140px; background: #fdfdfd; display:flex; align-items:center; justify-content:center; }
.more-project-card .thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.more-project-card h3 { font-size: 1.05rem; padding: 12px 12px 4px 12px; margin: 0; }
.more-project-card .card-desc { padding: 0 12px 12px 12px; color: #cfd3ff; font-size: 0.92rem; line-height:1.25; min-height: 44px; }
.more-project-card .card-meta { display:flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 12px 12px 12px; gap:10px; }
.more-project-card .card-tags { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }
.more-project-card .card-cta { margin-left: 0; display:flex; align-items:center; }
.more-project-card .btn.small {
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,105,245,0.18), rgba(38,255,231,0.08));
    color: #ffffff;
    border: 1px solid rgba(255,105,245,0.24);
    /* remove external glow and keep a single inner highlight to avoid double outline */
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.02);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 140ms cubic-bezier(.2,.9,.2,1), box-shadow 140ms ease, background 120ms ease;
}
.more-project-card .btn.small:hover,
.more-project-card .btn.small:focus { 
    transform: translateY(-4px);
    /* keep inner highlight only on hover/focus */
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.03);
    background: linear-gradient(90deg, rgba(255,105,245,0.26), rgba(38,255,231,0.12));
    outline: none;
}

/* keyboard-focus shows a subtle outer purple ring for accessibility, but it's not a permanent outer outline */
.more-project-card .btn.small:focus-visible { box-shadow: inset 0 -1px 0 rgba(255,255,255,0.03), 0 0 0 4px rgba(140,55,185,0.12); outline: none; }
.more-project-card .btn.small:active { transform: translateY(-1px) scale(0.995); }

/* Ensure CTAs sit on their own line on narrow screens */
@media (max-width: 560px) {
    .more-project-card .card-meta { flex-direction: column; align-items: stretch; gap: 8px; }
    .more-project-card .card-cta { justify-content: flex-end; }
    .more-project-card .btn.small { width: 100%; justify-content: center; }
}

/* Responsive adjustments for more projects grid */
@media (max-width: 1000px) {
    .more-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .more-grid { grid-template-columns: 1fr; }
}

/* Landscape mobile devices - show 2 columns */
@media (max-width: 920px) and (orientation: landscape) {
    .more-grid { 
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .more-project-card {
        padding: 12px;
    }
}

/* Portrait mobile and tablet adjustments for project list */
@media (max-width: 720px) {
    .projects-scroll {
        grid-template-columns: 1fr;
        overflow-y: visible;
    }
}

@media (min-width: 721px) and (max-width: 1024px) {
    .projects-scroll {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Landscape tablets and small desktops */
@media (min-width: 1025px) and (max-width: 1400px) and (orientation: landscape) {
    .projects-section .section-inner {
        grid-template-columns: 1fr 1.2fr;
    }
}

/* Mobile landscape fixes */
@media (max-width: 920px) and (orientation: landscape) {
    .projects-section .section-inner {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    .projects-list {
        max-height: none;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding-right: 0;
        padding-bottom: 16px;
    }
    
    .projects-scroll {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        max-height: none;
        overflow-y: visible;
    }
    
    .project-item {
        padding: 8px;
        font-size: 0.85rem;
    }
    
    .project-item h3 {
        font-size: 0.9rem;
    }
    
    .project-item p {
        font-size: 0.8rem;
    }
    
    .project-tags {
        display: none;
    }
    
    .project-viewer {
        min-height: 300px;
    }
    
    .viewer-box {
        min-height: 250px;
    }
    
    #viewerVideo,
    #viewerIframe {
        min-height: 250px;
        max-height: 40vh;
    }
    
    .viewer-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .viewer-tab {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}

/* Tablet portrait - stack sections vertically */
@media (max-width: 1024px) and (orientation: portrait) {
    .projects-section .section-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .projects-list {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding-right: 0;
        padding-bottom: 16px;
        max-height: none;
    }
}

/* Gallery grid inside viewer */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.gallery-item { border-radius: 10px; overflow: hidden; background: rgba(233, 24, 24, 0.02); border: 1px solid rgba(255,255,255,0.03); box-shadow: 0 8px 20px rgba(0,0,0,0.6); cursor: pointer; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display:block; }

/* Lightbox overlay controls (uses existing overlay element if present) */
#imageZoomOverlay { display: none; }
#imageZoomOverlay.show { display:flex; }
#imageZoomOverlay .overlay-controls { position: absolute; inset: 0; display:flex; align-items:center; justify-content:space-between; pointer-events:none; }
#imageZoomOverlay button.overlay-btn { pointer-events:auto; background: rgba(0,0,0,0.45); border: none; color: white; padding:10px 14px; margin: 12px; border-radius: 8px; cursor: pointer; }
#imageZoomOverlay img { max-width: 94vw; max-height: 84vh; border-radius: 10px; }

/* Responsive: stack project items on small screens */
@media (max-width: 880px) {
    .project-item { flex-direction: column; align-items: center; }
    .project-thumb { width: 100%; max-width: 100%; height: 140px; object-fit: cover; }
    .project-item .btn.small { margin-left: 0; margin-top: 6px; }
}

.project-item:hover:not(.active) {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

.project-item h3 {
    margin-bottom: 4px;
    font-size: 1rem;
}

.project-item p {
    font-size: 0.9rem;
    color: #c9c9f1;
    margin-bottom: 6px;
}

.project-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    justify-content: center;
}

/* PROJECT VIEWER */
.project-viewer h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

#viewerDescription {
    font-size: 0.95rem;
    color: #c3c3d9;
    margin-bottom: 12px;
}

/* Viewer tabs (Video / Playable / Code / Gallery) */
.viewer-tabs {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(10, 8, 32, 0.9);
}

.viewer-tab {
    border: none;
    background: transparent;
    color: #dcdcff;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.viewer-tab.active {
    background: #3b82f6;
    color: #ffffff;
}

/* Viewer box with nice edges */
.viewer-box {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px;
    background: radial-gradient(circle at top, rgba(35, 25, 90, 0.9), rgba(6, 4, 20, 0.95));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
}

.viewer-panels {
    width: 100%;
}

.viewer-panel {
    display: none;
}

.viewer-panel.is-active {
    display: block;
}

#viewerVideo {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    border: none;
    display: block;
    background: #000;
}

#viewerIframe {
    width: 950px;
    height: 600px;
    border-radius: 10px;
    border: none;
    display: block;
    background: #000;
    margin: 0 auto;
}

/* Hide WebGL fullscreen button */
#viewerIframe::shadow .fullscreen-button,
#viewerIframe /deep/ .fullscreen-button,
iframe >>> .fullscreen-button {
    display: none !important;
}

/* Target Unity WebGL fullscreen button */
#unityContainer .unity-fullscreen-button,
#unity-canvas .unity-fullscreen-button,
.unity-desktop #unity-fullscreen-button {
    display: none !important;
}

.large-play-btn {
    font-size: 1.5rem;
    padding: 20px 50px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.large-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.large-play-btn:active {
    transform: translateY(0);
}

.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(59, 130, 246, 0.5);
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.fullscreen-btn:hover {
    background: rgba(59, 130, 246, 0.8);
    border-color: #3b82f6;
    transform: scale(1.1);
}

/* GAME POPUP MODAL */
.game-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

.game-popup.active {
    display: flex;
}

.game-popup-content {
    position: relative;
    width: 95vw;
    height: 95vh;
    max-width: 1600px;
    max-height: 1000px;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 100%);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9), 
                0 0 40px rgba(59, 130, 246, 0.3);
    border: 2px solid;
    border-image: linear-gradient(135deg, 
                    rgba(59, 130, 246, 0.6) 0%, 
                    rgba(147, 51, 234, 0.6) 50%, 
                    rgba(236, 72, 153, 0.6) 100%) 1;
    overflow: hidden;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(147, 51, 234, 0.6));
    }
}

#popupIframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 18px;
    background: #000;
}

.close-popup-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.3s ease;
    filter: drop-shadow(0 4px 20px rgba(255, 0, 0, 0.6));
}

.close-popup-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(18%) sepia(98%) saturate(7495%) hue-rotate(0deg) brightness(102%) contrast(118%);
    transition: filter 0.3s ease;
}

.close-popup-btn::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 8px;
    background: linear-gradient(90deg, rgba(255, 100, 50, 0.8) 0%, rgba(255, 200, 50, 0.6) 50%, transparent 100%);
    border-radius: 4px;
    opacity: 0;
}

.close-popup-btn:hover {
    filter: drop-shadow(0 0 30px rgba(255, 100, 50, 0.9)) 
            drop-shadow(0 0 15px rgba(255, 200, 50, 0.7));
}

.close-popup-btn:hover img {
    filter: brightness(0) saturate(100%) invert(42%) sepia(93%) saturate(6394%) hue-rotate(10deg) brightness(110%) contrast(105%);
}

.close-popup-btn.launching {
    animation: rocketShake 0.3s ease-in-out, rocketLaunch 0.6s 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

.close-popup-btn.launching::after {
    animation: flameStart 0.3s ease-in-out, flameFlicker 0.08s 0.3s infinite, flameLaunch 0.6s 0.3s ease-out forwards;
}

.close-popup-btn.launching img {
    filter: brightness(0) saturate(100%) invert(60%) sepia(93%) saturate(3000%) hue-rotate(10deg) brightness(110%) contrast(105%);
}

@keyframes rocketShake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-3px) rotate(-2deg);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(3px) rotate(2deg);
    }
}

@keyframes rocketLaunch {
    0% {
        transform: translateX(0) scale(1);
        filter: drop-shadow(0 0 30px rgba(255, 100, 50, 0.9)) 
                drop-shadow(0 0 15px rgba(255, 200, 50, 0.7));
    }
    100% {
        transform: translateX(calc(-100vw - 100px)) scale(1.5);
        filter: drop-shadow(0 0 60px rgba(255, 100, 50, 1)) 
                drop-shadow(0 0 40px rgba(255, 200, 50, 0.9))
                drop-shadow(0 0 80px rgba(255, 50, 0, 0.8));
    }
}

@keyframes flameStart {
    0%, 100% {
        width: 0;
        opacity: 0;
    }
    50% {
        width: 30px;
        height: 10px;
        opacity: 0.8;
    }
}

@keyframes flameFlicker {
    0%, 100% {
        transform: translateY(-50%) scaleY(0.9) scaleX(1);
    }
    50% {
        transform: translateY(-50%) scaleY(1.3) scaleX(1.1);
    }
}

@keyframes flameLaunch {
    0% {
        width: 30px;
        height: 10px;
        opacity: 0.8;
    }
    50% {
        width: 180px;
        height: 16px;
        opacity: 1;
    }
    100% {
        width: 150px;
        height: 12px;
        opacity: 1;
    }
}

.close-popup-btn:active {
    transform: scale(0.95);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


.hint-text {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #a8a8d2;
}

/* Code Panel Image and Description */
.code-image-preview {
    margin: 16px auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 70%;
    max-height: 500px;
}

.code-image-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.3);
}

.code-image-preview img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

.code-video-preview {
    margin: 16px auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    max-width: 70%;
    max-height: 500px;
}

.code-video-preview video {
    width: 100%;
    height: auto;
    max-height: 500px;
    display: block;
    background: #000;
}

.code-description {
    margin-top: 16px;
    padding: 20px;
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid #3b82f6;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #d0d0e0;
}

.code-description-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 12px;
    display: block;
}

/* CODE BLOCK WITH HEADER TABS */ 
.code-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.code-tab {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 8, 32, 0.8);
    color: #ffffff;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border 0.15s ease;
}

.code-tab.active {
    background: #3b82f6;
    border-color: #93c5fd;
    color: #ffffff;
}

/* Hidden sources for code */
.project-code-source {
    display: none;
}

/* GALLERY GRID */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Vertical layout for specific projects like Skyrocket */
.gallery-grid.gallery-vertical {
    grid-template-columns: 1fr;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: right center;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.gallery-item video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: right center;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.05);
    opacity: 0.95;
}

.gallery-item-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 8px 12px;
    font-size: 0.85rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gallery-item:hover .gallery-item-description {
    opacity: 1;
}

.gallery-item.wide {
    grid-column: span 3;
    min-height: 600px;
    height: 600px;
}

.gallery-item.wide video {
    width: 100%;
    height: 600px;
    object-fit: contain;
    background: #000;
}

.gallery-wide-item {
    width: 100%;
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    background: #000;
}

.gallery-wide-item video {
    width: 100%;
    height: auto;
    max-height: 450px;
    display: block;
    object-fit: contain;
    object-position: right center;
}

.gallery-wide-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    object-position: right center;
}

.gallery-wide-item .gallery-item-description {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px;
    font-size: 0.9rem;
    text-align: center;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .projects-layout {
        grid-template-columns: 1fr;
    }

    .projects-list {
        border-right: none;
        padding-right: 0;
        margin-bottom: 20px;
    }
}

/* Journey section specific fixes */
.journey-grid {
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 32px;
    align-items: start;
    width: 100%;
}

.journey-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.journey-text {
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.journey-text-short {
    display: none;
}

.journey-text p {
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.journey-video {
    display: flex;
    justify-content: center;
    align-items: start;
}

.journey-video .video-card {
    width: 100%;
    max-width: 720px;
}

.journey-video video {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    display: block;
}

.journey-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
    width: 100%;
}

.journey-gallery img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

/* Responsive adjustments for journey section */
/* Mobile portrait: show video, hide gallery */
@media (max-width: 1029px) and (orientation: portrait) {
    .journey-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 20px !important;
        margin: 0 !important;
    }
    
    .section-title-row.journey-title-row {
        justify-content: center !important;
    }
    
    .section-title-row.journey-title-row .title-line {
        display: none !important;
    }
    
    .section-title-row.journey-title-row h2 {
        text-align: center !important;
    }
    
    .journey-video,
    .journey-video .video-card,
    .journey-video video {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        margin: 20px 0 !important;
        padding: 0 !important;
    }
    
    .journey-gallery {
        display: none !important;
    }
    
    .journey-text-full {
        display: none !important;
    }
    
    .journey-text-short {
        display: block !important;
    }
    
    .journey-text-full {
        display: none !important;
    }
    
    .journey-text-short {
        display: block !important;
    }
    
    .journey-column {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 auto !important;
        grid-column: 1 / -1 !important;
    }
    
    .journey-text {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        text-align: center !important;
    }
    
    .journey-text p {
        font-size: 1rem !important;
        line-height: 1.7 !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 16px !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        hyphens: auto !important;
        text-align: center !important;
    }
    
    .about-section .section-inner {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* Mobile landscape: show gallery, hide video */
@media (max-width: 1029px) and (orientation: landscape) {
    .journey-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 20px !important;
        margin: 0 !important;
    }
    
    .journey-video,
    .journey-video .video-card,
    .journey-video video {
        display: none !important;
    }
    
    .journey-gallery {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 20px 0 0 0 !important;
    }
    
    .journey-column {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 auto !important;
        grid-column: 1 / -1 !important;
    }
    
    .journey-text {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        text-align: left !important;
    }
    
    .journey-text p {
        font-size: 1rem !important;
        line-height: 1.7 !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 16px !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        hyphens: auto !important;
        text-align: justify !important;
    }
    
    .about-section .section-inner {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}



@media (max-width: 600px) {
    .journey-text p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .journey-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
        width: 100% !important;
    }
}

/* MY JOURNEY */
.journey-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
    gap: 26px;
    margin-bottom: 20px;
}

.journey-text p {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #f5f5ff;
}

.journey-text strong {
    color: #ffffff;
}

.journey-image .image-card {
    border-radius: 20px;
}

/* CV BLOCK */
.cv-block {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
    gap: 24px;
    align-items: start;
}

.cv-text {
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.cv-text p {
    font-size: 0.95rem;
    color: #f5f5ff;
    margin-bottom: 10px;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.cv-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.cv-download-btn,
.cv-preview-btn {
    margin-top: 0;
}

.cv-preview .image-card {
    border-radius: 20px;
}

/* CV section title alignment */
.cv-title-row {
    margin-bottom: 20px;
}

/* CV Preview Modal */
.cv-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.cv-modal.active {
    display: flex;
}

.cv-modal-content {
    position: relative;
    width: 90vw;
    max-width: 900px;
    height: 90vh;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 100%);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9), 
                0 0 40px rgba(59, 130, 246, 0.3);
    border: 2px solid;
    border-image: linear-gradient(135deg, 
                    rgba(59, 130, 246, 0.6) 0%, 
                    rgba(147, 51, 234, 0.6) 50%, 
                    rgba(236, 72, 153, 0.6) 100%) 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cv-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 8, 32, 0.9);
}

.cv-modal-header h3 {
    font-size: 1.4rem;
    color: #fff;
    margin: 0;
}

.cv-modal-body {
    flex: 1;
    overflow: hidden;
    background: #1a1a2e;
}

#cvPdfViewer {
    width: 100%;
    height: 100%;
    border: none;
}

.close-cv-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid rgba(255, 0, 0, 0.5);
    color: #ff4444;
    font-size: 32px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
    line-height: 1;
}

.close-cv-modal-btn:hover {
    background: rgba(255, 0, 0, 0.4);
    border-color: #ff4444;
    transform: scale(1.1);
}

/* Mobile responsive for CV modal */
@media (max-width: 768px) {
    .cv-modal-content {
        width: 95vw;
        height: 95vh;
    }
    
    .cv-modal-header {
        padding: 16px;
    }
    
    .cv-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .close-cv-modal-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 15px;
        right: 15px;
    }
}

/* Reuse generic image-card style from earlier sections */
.image-card {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(102, 231, 255, 0.6);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.85);
    background: radial-gradient(circle at top, #3526a0, #050308);
    padding: 10px;
}

.image-card img {
    width: 100%;
    border-radius: 12px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .code-lang-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .journey-grid,
    .cv-block {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .code-lang-grid {
        grid-template-columns: 1fr;
    }
}

/* --- IMAGE POPUP MODAL --- */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.modal-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: #3b82f6;
}

.modal-caption {
    color: #f1f1f1;
    text-align: center;
    padding: 20px;
    font-size: 1.1rem;
}

/* CV Centered Layout */
.cv-centered-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    max-width: 600px;
    margin: 0 auto;
}

.cv-column-centered {
    text-align: center;
    width: 100%;
}

.cv-text {
    margin-bottom: 20px;
}

.cv-text p {
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.6;
}

.cv-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cv-preview-centered {
    width: 100%;
    max-width: 500px;
}

.cv-preview-centered .image-card {
    width: 100%;
}

.cv-preview-centered img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* CV SECTION - Override journey-grid styles for CV */
.cv-section .journey-grid.cv-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: start;
    padding: 0;
    margin: 0;
}

.cv-section .journey-column.cv.column {
    width: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.cv-section .journey-video.cv-preview {
    display: flex !important;
    justify-content: flex-end;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cv-section .journey-video.cv-preview .video-card.image-card {
    display: block !important;
    width: 100% !important;
    max-width: 380px !important;
    height: auto !important;
}

.cv-section .journey-video.cv-preview img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
}

.cv-section .cv-title-row {
    justify-content: flex-start;
    text-align: left;
}

.cv-section .cv-title-row .title-line {
    display: block;
}

.cv-section .cv-text {
    text-align: left;
}

.cv-section .cv-actions {
    justify-content: flex-start;
}

/* CV Mobile - stack vertically and show preview */
@media (max-width: 767px) {
    .cv-section .journey-grid.cv-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 30px !important;
        align-items: center !important;
    }

    .cv-section .journey-column.cv.column {
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .cv-section .journey-video.cv-preview {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 auto !important;
    }

    .cv-section .journey-video.cv-preview .video-card.image-card {
        display: block !important;
        width: 100% !important;
        max-width: 350px !important;
    }

    .cv-section .cv-title-row {
        justify-content: center;
        text-align: center;
    }

    .cv-section .cv-title-row .title-line {
        display: none;
    }

    .cv-section .cv-text {
        text-align: center;
    }

    .cv-section .cv-actions {
        justify-content: center;
    }
}

/* CV Landscape mobile - better layout */
@media (max-width: 920px) and (orientation: landscape) {
    .cv-section .section-inner {
        display: block !important;
    }

    .cv-section h2 {
        display: none !important;
    }

    .cv-section .cv-title-row {
        display: none !important;
    }

    .cv-section .journey-grid.cv-grid {
        display: flex !important;
        flex-direction: row !important;
        gap: 30px !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    .cv-section .journey-column.cv-column,
    .cv-section .journey-column {
        text-align: center !important;
        width: auto !important;
        flex: 1 !important;
        order: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .cv-section .journey-column.cv-column::before,
    .cv-section .journey-column::before {
        content: 'CV' !important;
        display: block !important;
        font-size: 1.3rem !important;
        font-weight: 600 !important;
        margin-bottom: 12px !important;
        text-align: center !important;
        color: #f8f8ff !important;
    }

    .cv-section .journey-video.cv-preview {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: auto !important;
        height: auto !important;
        flex: 1 !important;
        order: 2 !important;
    }

    .cv-section .journey-video.cv-preview::before {
        display: none !important;
    }

    .cv-section .journey-video.cv-preview .video-card.image-card {
        display: block !important;
        width: 100% !important;
        max-width: 280px !important;
    }

    .cv-section .cv-text p {
        font-size: 0.85rem !important;
        margin-bottom: 6px !important;
        line-height: 1.4 !important;
    }

    .cv-section .cv-actions {
        justify-content: center !important;
        gap: 8px !important;
    }

    .cv-section .cv-actions .btn {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }

    .cv-section .cv-text {
        text-align: center !important;
    }
}

/* Very small landscape screens - show preview on right */
@media (max-height: 500px) and (orientation: landscape) {
    .cv-section .section-inner {
        display: block !important;
    }

    .cv-section h2 {
        display: none !important;
    }

    .cv-section .cv-title-row {
        display: none !important;
    }

    .cv-section .journey-grid.cv-grid {
        display: flex !important;
        flex-direction: row !important;
        gap: 20px !important;
        width: 100% !important;
    }

    .cv-section .journey-column.cv-column,
    .cv-section .journey-column {
        flex: 1 !important;
        text-align: center !important;
        order: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .cv-section .journey-column.cv-column::before,
    .cv-section .journey-column::before {
        content: 'CV' !important;
        display: block !important;
        font-size: 1.2rem !important;
        font-weight: 600 !important;
        margin-bottom: 10px !important;
        text-align: center !important;
        color: #f8f8ff !important;
    }

    .cv-section .journey-video.cv-preview {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        flex: 1 !important;
        order: 2 !important;
    }

    .cv-section .journey-video.cv-preview::before {
        display: none !important;
    }

    .cv-section .journey-video.cv-preview .video-card.image-card {
        max-width: 200px !important;
    }

    .cv-section .cv-actions {
        justify-content: center !important;
    }

    .cv-section .cv-text {
        text-align: center !important;
    }
}