:root {
    --bg-base: #000000;
    --bg-surface: #0a0a0a;
    --bg-elevated: #111111;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-tertiary: #555555;
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.25);
    --accent: #ffffff;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
    background-color: var(--bg-base);
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography Links */
.text-link {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    text-decoration-color: var(--text-tertiary);
    transition: var(--transition);
}
.text-link:hover {
    text-decoration-color: var(--text-primary);
}

/* Floating Topbar */
header {
    position: fixed;
    top: 1.5rem;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    pointer-events: none;
}

.nav-container {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    transition: var(--transition);
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.logo-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
}

.lang-selector a {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.lang-selector a:hover {
    color: var(--text-primary);
}

.lang-selector a.active {
    background: var(--text-primary);
    color: var(--bg-base);
}

.nav-btn {
    padding: 0.5rem 1.25rem;
    background: var(--text-primary);
    color: var(--bg-base) !important;
    border-radius: 999px;
    font-weight: 600 !important;
}
.nav-btn:hover {
    transform: scale(1.02);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 0.5rem;
}
.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Sections */
section {
    padding: 8rem 0;
    position: relative;
}

.section-header {
    margin-bottom: 4rem;
}

.section-label {
    display: inline-block;
    font-family: monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}
.btn-primary {
    background: var(--text-primary);
    color: var(--bg-base);
}
.btn-primary:hover {
    background: #d4d4d8;
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    filter: blur(60px);
    z-index: -1;
    pointer-events: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}
.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

.hero-title {
    font-size: clamp(3.5rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
}
.text-gradient {
    background: linear-gradient(180deg, #ffffff 0%, #71717a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 2rem auto;
    line-height: 1.6;
}

.hero-tech-stack {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.hero-tech-stack span {
    padding: 0.35rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.about-visual {
    position: relative;
    border-radius: 24px;
    padding: 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.about-img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    border-radius: 18px;
    filter: grayscale(100%);
    transition: var(--transition);
}

.about-img:hover {
    filter: grayscale(0%);
}

.about-img-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    filter: blur(40px);
    z-index: -1;
    pointer-events: none;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.about-text strong {
    color: var(--text-primary);
}

/* Bento Grid (Manageopy) */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
    gap: 1.5rem;
}
.bento-large {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.bento-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.bento-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}

.bento-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bento-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.bento-icon-wrapper i {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.bento-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
.bento-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.bento-visual {
    padding-left: 2rem;
}
.mockup-window {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
}
.mockup-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    gap: 6px;
}
.mockup-header i {
    width: 10px; height: 10px; border-radius: 50%; background: #333;
}
.mockup-layout {
    display: flex;
    height: 200px;
}
.mockup-sidebar {
    width: 25%;
    border-right: 1px solid var(--border-subtle);
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.side-item {
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    width: 80%;
}
.side-item.active {
    background: var(--text-secondary);
    width: 100%;
}
.mockup-body {
    width: 75%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.mockup-stats {
    display: flex;
    gap: 0.75rem;
}
.stat-box {
    flex: 1;
    height: 30px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
}
.mockup-chart {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    padding: 0.75rem;
    gap: 0.5rem;
}
.chart-bar {
    flex: 1;
    background: linear-gradient(to top, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    border-radius: 2px 2px 0 0;
    transition: var(--transition);
}
.bento-card:hover .chart-bar {
    background: linear-gradient(to top, #ffffff, rgba(255,255,255,0.2));
}

/* Engineering Projects List */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-row {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 3rem;
    transition: var(--transition);
}
.project-row:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.project-info h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.project-info p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 800px;
}

.tech-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.tech-tags span {
    padding: 0.35rem 1rem;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Games Carousel */
.games-section {
    border-top: 1px solid var(--border-subtle);
    overflow: hidden;
}

.carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
}

.carousel-controls {
    display: flex;
    gap: 1rem;
}

.carousel-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
}

.carousel-wrapper {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
}

.carousel-mask {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10vw;
    z-index: 10;
    pointer-events: none;
}
.left-mask {
    left: 0;
    background: linear-gradient(to right, var(--bg-base) 0%, transparent 100%);
}
.right-mask {
    right: 0;
    background: linear-gradient(to left, var(--bg-base) 0%, transparent 100%);
}

.games-carousel {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 2rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.games-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-spacer {
    min-width: max(2rem, calc((100vw - 1040px) / 2));
}

.game-card {
    min-width: 340px;
    scroll-snap-align: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.game-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.game-img-wrapper {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}
.game-card:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.game-info {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
}

.game-details {
    display: flex;
    flex-direction: column;
}
.game-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.game-details span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.game-platform {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: var(--transition);
}
.game-card:hover .game-platform {
    background: var(--text-primary);
    color: var(--bg-base);
}

/* Contact */
.contact-section {
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}
.contact-box {
    max-width: 600px;
    margin: 0 auto;
}
.contact-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}
.contact-desc {
    color: var(--text-secondary);
    margin-bottom: 3rem;
}
.contact-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Footer */
footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.footer-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    filter: grayscale(100%);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(8px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Staggered delays for child elements if we want to use them */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* Responsive */
@media (max-width: 768px) {
    section { padding: 4rem 0; }
    .section-header { margin-bottom: 2rem; }
    .section-title { font-size: 2rem; }
    
    .nav-container { padding: 0.5rem; }
    .nav-toggle { display: flex; }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(10,10,10,0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1rem;
        border: 1px solid var(--border-subtle);
        border-radius: 16px;
        margin-top: 0.5rem;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }
    .nav-links.active {
        opacity: 1;
        visibility: visible;
    }
    
    .hero-title { font-size: 2.75rem; }
    .hero-tech-stack { gap: 0.5rem; font-size: 0.75rem; }
    .hero-cta { flex-direction: column; width: 100%; }
    .hero-cta .btn { width: 100%; }
    
    .about-grid { grid-template-columns: 1fr; gap: 2rem; }
    
    .bento-large { grid-template-columns: 1fr; }
    .bento-grid { grid-template-columns: 1fr; }
    .bento-card { padding: 1.5rem; }
    .bento-visual { padding-left: 0; margin-top: 1.5rem; }
    
    .project-row { padding: 1.5rem; }
    .project-info h3 { font-size: 1.4rem; }
    
    .carousel-header { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
    .game-card { min-width: 280px; }
    
    .contact-title { font-size: 2rem; }
    .footer-content { flex-direction: column; gap: 1.5rem; text-align: center; }
}