﻿/* ===========================
   VARIABLES
=========================== */
:root {
    --bg: #050608;
    --bg-alt: #10121a;
    --accent: #5b8cff;
    --accent-purple: #a855f7;
    --text: #f5f5f5;
    --muted: #9ca3af;
    --radius-lg: 18px;
    --radius-full: 999px;
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
}

/* ===========================
   GLOBAL
=========================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* ===========================
   CANVAS BACKGROUND
=========================== */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
}

/* ===========================
   HEADER
=========================== */
.main-header {
    padding: 1.5rem clamp(1.5rem, 4vw, 4rem);
    position: sticky;
    top: 0;
    background: rgba(5, 6, 8, 0.8);
    backdrop-filter: blur(20px);
    z-index: 100;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.nav {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1120px;
    margin: 0 auto;
    position: relative;
}

.nav__links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
}

    .nav__links a {
        position: relative;
        color: var(--muted);
        font-size: 0.92rem;
        text-decoration: none;
        transition: color 0.3s ease;
    }

        .nav__links a::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: -0.2rem;
            width: 0;
            height: 2px;
            background: linear-gradient(90deg, var(--accent), var(--accent-purple));
            border-radius: var(--radius-full);
            transition: width 0.3s ease;
        }

        .nav__links a:hover {
            color: var(--text);
        }

            .nav__links a:hover::after {
                width: 100%;
            }

.nav__toggle {
    position: absolute;
    right: 1.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

    .nav__toggle span {
        width: 22px;
        height: 2px;
        border-radius: var(--radius-full);
        background: #e5e7eb;
        transition: transform 0.3s ease;
    }

/* ===========================
   HERO WRAPPER
=========================== */
.hero-wrapper {
    max-width: 1120px;
    margin: 2rem auto;
    padding: 2rem clamp(1.5rem, 4vw, 4rem);
    background: radial-gradient(circle at top left, #1b2440 0, #050608 55%);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

    .hero-wrapper::before {
        content: "";
        position: absolute;
        top: -50%;
        right: -50%;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle, rgba(91, 140, 255, 0.15), transparent 70%);
        animation: float 8s ease-in-out infinite;
    }

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-30px, 30px) rotate(5deg);
    }
}

/* ===========================
   HERO CONTENT
=========================== */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero__name {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, #5b8cff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

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

.hero__tags {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    animation: slideInLeft 0.8s ease-out 0.2s both;
}

.hero__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    color: var(--muted);
    transition: all 0.3s ease;
}

    .hero__tag:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    }

    .hero__tag::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: var(--radius-full);
        background: currentColor;
        box-shadow: 0 0 12px currentColor;
        animation: pulse 2s ease-in-out infinite;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.tag-cpp {
    color: #3b82f6;
}

.tag-cs {
    color: #a855f7;
}

.tag-python {
    color: #facc15;
}

.hero__text {
    color: var(--muted);
    max-width: 36rem;
    margin-bottom: 1.5rem;
    animation: slideInLeft 0.8s ease-out 0.4s both;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    animation: slideInLeft 0.8s ease-out 0.6s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .btn::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .btn:hover::before {
        width: 300px;
        height: 300px;
    }

.btn--primary {
    background: linear-gradient(135deg, #5b8cff, #a855f7);
    color: #f9fafb;
    box-shadow: var(--shadow-soft);
}

    .btn--primary:hover {
        transform: translateY(-3px);
        box-shadow: 0 24px 55px rgba(91, 140, 255, 0.4);
    }

.btn--ghost {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.5);
    color: var(--muted);
}

    .btn--ghost:hover {
        background: rgba(30, 64, 175, 0.3);
        color: var(--text);
        border-color: var(--accent);
    }

/* ===========================
   HERO VISUAL
=========================== */
.hero__visual {
    display: flex;
    justify-content: center;
    animation: slideInRight 0.8s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

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

.hero__card-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    z-index: 1;
    border-radius: var(--radius-lg);
}

.hero__card {
    width: 260px;
    height: 320px;
    padding: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: radial-gradient(circle at top, #1d4ed8 0, #050816 55%);
    border: 1px solid rgba(129, 140, 248, 0.45);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.5s ease;
}

    .hero__card:hover {
        transform: rotateY(5deg) rotateX(5deg);
    }

    .hero__card span {
        font-size: 0.9rem;
        color: #e5e7eb;
        padding: 0.4rem 0.9rem;
        border-radius: var(--radius-full);
        background: rgba(15, 23, 42, 0.7);
        border: 1px solid rgba(148, 163, 184, 0.5);
        position: relative;
        z-index: 2;
        animation: bounce 2s ease-in-out infinite;
    }

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

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

.hero__card::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    top: -40px;
    left: -40px;
    opacity: 0.85;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.45), transparent 60%);
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===========================
   ABOUT SECTION
=========================== */
.about-wrapper {
    max-width: 1120px;
    margin: 3rem auto 0;
    padding: 0;
}

.about-inner {
    padding: 0;
    max-width: 1120px;
    margin: 0 auto;
}

.about-extra {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 1fr;
    gap: 2rem;
    justify-content: center;
    align-items: stretch;
}

.extra-card {
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.25);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
}

    .extra-card.visible {
        opacity: 1;
        transform: translateY(0);
    }

    .extra-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
        border-color: rgba(91, 140, 255, 0.5);
    }

    .extra-card h2 {
        margin: 0 0 1rem 0;
        font-size: 1.4rem;
        background: linear-gradient(135deg, var(--accent), var(--accent-purple));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

/* ===========================
   TOOLS GRID
=========================== */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem 1.2rem;
    margin-top: 1rem;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.25);
    transition: all 0.3s ease;
    cursor: default;
}

    .tool-item img {
        width: 26px;
        height: 26px;
        object-fit: contain;
        opacity: 0.9;
        transition: all 0.3s ease;
    }

    .tool-item span {
        font-size: 0.95rem;
        color: var(--muted);
        transition: all 0.3s ease;
    }

    .tool-item:hover {
        transform: translateX(10px);
        background: rgba(30, 41, 59, 0.6);
        border-color: rgba(91, 140, 255, 0.6);
    }

        .tool-item:hover img {
            opacity: 1;
            transform: scale(1.2) rotate(5deg);
        }

        .tool-item:hover span {
            color: var(--text);
        }

/* ===========================
   EXPERIENCE LIST
=========================== */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1rem;
}

.experience-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.25);
    text-decoration: none;
    color: var(--muted);
    transition: all 0.3s ease;
}

    .experience-item img {
        width: 32px;
        height: 32px;
        object-fit: contain;
        opacity: 0.9;
        transition: all 0.3s ease;
    }

    .experience-item span {
        font-size: 0.95rem;
        transition: all 0.3s ease;
    }

    .experience-item:hover {
        transform: translateX(10px);
        background: rgba(30, 41, 59, 0.6);
        border-color: rgba(91, 140, 255, 0.6);
    }

        .experience-item:hover img {
            opacity: 1;
            transform: scale(1.2) rotate(-5deg);
        }

        .experience-item:hover span {
            color: var(--text);
        }

/* ===========================
   JOURNEY / SINE WAVE
=========================== */
.journey-wrapper {
    max-width: 1120px;
    margin: 0 auto;
    padding: 3rem clamp(1.5rem, 4vw, 4rem);
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.journey-title {
    font-size: 2rem;
    margin-bottom: 0.4rem;
    text-align: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.journey-eyebrow {
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.4);
    margin-bottom: 2.5rem;
}

.journey-wrapper .glow-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(90px);
    opacity: 0.07;
    animation: floatOrb 12s ease-in-out infinite;
}

.journey-wrapper .glow-orb-1 {
    width: 350px;
    height: 350px;
    background: var(--accent);
    top: 10%;
    left: 5%;
}

.journey-wrapper .glow-orb-2 {
    width: 280px;
    height: 280px;
    background: var(--accent-purple);
    bottom: 10%;
    right: 5%;
    animation-delay: -6s;
}

@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, -20px);
    }
}

.sine-container {
    position: relative;
    width: 100%;
    height: 580px;
    user-select: none;
}

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

.tl-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.wave-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    border: 2.5px solid var(--bg);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.35), 0 0 22px rgba(91, 140, 255, 0.55);
    z-index: 3;
}

    .wave-dot.lit {
        opacity: 1;
    }

.tl-connector {
    position: absolute;
    width: 1px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease 0.15s;
    z-index: 2;
}

    .tl-connector.lit {
        opacity: 1;
    }

.tl-card {
    position: absolute;
    width: 195px;
    pointer-events: auto;
    opacity: 0;
    transform: scale(0.9) translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.22,1,.36,1);
    z-index: 4;
}

    .tl-card.lit {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

.tl-card-inner {
    background: rgba(8, 12, 24, 0.92);
    border: 1px solid rgba(91, 140, 255, 0.22);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    backdrop-filter: blur(14px);
    transition: all 0.3s cubic-bezier(.22,1,.36,1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.tl-card:hover .tl-card-inner {
    border-color: rgba(91, 140, 255, 0.75);
    box-shadow: 0 16px 48px rgba(91, 140, 255, 0.22), 0 0 0 1px rgba(91, 140, 255, 0.15);
    transform: translateY(-5px);
}

.tl-year {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.18rem 0.65rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.55rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    color: #fff;
}

.tl-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.tl-sub {
    font-size: 0.72rem;
    color: var(--accent);
    margin-bottom: 0.4rem;
    opacity: 0.85;
}

.tl-desc {
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.55;
    opacity: 0.8;
}

@media (max-width: 680px) {
    .sine-container {
        height: auto;
    }

    #sineCanvas {
        display: none;
    }

    .tl-layer {
        position: static;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem 0;
    }

    .wave-dot,
    .tl-connector {
        display: none;
    }

    .tl-card {
        position: static !important;
        width: 100% !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===========================
   PROJECTS / CAROUSEL
=========================== */
.projects-wrapper {
    max-width: 1120px;
    margin: 4rem auto;
    padding: 3rem clamp(1.5rem, 4vw, 4rem);
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.projects-title {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.carousel {
    position: relative;
    width: 100%;
}

.carousel-track {
    position: relative;
    min-height: 340px;
}

.carousel-item {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 2rem;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transform: translateX(60px);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(.22,1,.36,1);
}

    .carousel-item.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
        position: relative;
    }

    .carousel-item.exit-left {
        opacity: 0;
        transform: translateX(-60px);
    }

.carousel-left {
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
    background: rgba(15,23,42,.6);
    box-shadow: var(--shadow-soft);
}

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

.carousel-left:hover .carousel-video {
    transform: scale(1.03);
}

.carousel-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    justify-content: center;
}

    .carousel-right h3 {
        font-size: clamp(1.4rem, 2.5vw, 2rem);
        font-weight: 800;
        margin: 0;
        background: linear-gradient(135deg, #fff, var(--accent));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .carousel-right p {
        color: var(--muted);
        line-height: 1.75;
        font-size: 0.97rem;
        margin: 0;
    }

.carousel-actions {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 2.5rem;
}

    .carousel-nav button {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(15,23,42,.7);
        border: 1px solid rgba(148,163,184,.35);
        color: var(--text);
        font-size: 1.1rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.25s ease;
    }

        .carousel-nav button:hover {
            background: linear-gradient(135deg, var(--accent), var(--accent-purple));
            border-color: transparent;
            transform: scale(1.1);
            box-shadow: 0 8px 24px rgba(91,140,255,.35);
        }

.carousel-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(148,163,184,.35);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

    .carousel-dot.active {
        background: linear-gradient(90deg, var(--accent), var(--accent-purple));
    }

/* ===========================
   FOOTER
=========================== */
.main-footer {
    background: #111;
    color: #eee;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
}

.footer-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.footer-mail a {
    color: #eee;
    text-decoration: none;
    transition: color 0.3s;
}

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

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn--footer {
    background: #222;
    color: #eee;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s;
}

    .btn--footer:hover {
        background: linear-gradient(135deg, var(--accent), var(--accent-purple));
        transform: translateY(-3px);
    }

/* ===========================
   RESPONSIVE
=========================== */
/* ── LANG SWITCHER ── */
#langSwitcher {
    display: flex;
    gap: .4rem;
    align-items: center;
    position: absolute;
    left: 0;
}

.lang-btn {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    opacity: .5;
    transition: opacity .2s, border-color .2s, transform .2s;
    line-height: 0;
}

    .lang-btn img {
        width: 28px;
        height: 20px;
        object-fit: cover;
        border-radius: 3px;
        display: block;
    }

    .lang-btn:hover {
        opacity: .85;
        transform: scale(1.08);
    }

    .lang-btn.active {
        opacity: 1;
        border-color: var(--accent);
    }

@media (max-width: 768px) {
    #langSwitcher {
        position: absolute;
        left: 0;
        right: auto;
    }
}

@media (max-width: 768px) {
    .nav {
        justify-content: flex-end;
    }

    .nav__toggle {
        display: flex;
    }

    .nav__links {
        position: absolute;
        inset: 64px 1.5rem auto;
        padding: 0.8rem 1rem;
        flex-direction: column;
        gap: 0.6rem;
        background: rgba(15, 23, 42, 0.96);
        border-radius: 14px;
        backdrop-filter: blur(14px);
        transform-origin: top;
        transform: scaleY(0);
        opacity: 0;
        pointer-events: none;
        transition: 0.15s ease;
    }

    .nav__links--open {
        transform: scaleY(1);
        opacity: 1;
        pointer-events: auto;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }

    .hero__visual {
        order: -1;
        margin-bottom: 2rem;
    }

    .hero__content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero__tags {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero__text {
        max-width: 100%;
        padding: 0 1rem;
    }

    .hero__actions {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
    }

    .about-extra {
        grid-template-columns: 1fr;
    }

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

    .carousel-item {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .carousel-track {
        min-height: auto;
    }

    .carousel-item {
        position: relative;
        inset: auto;
    }

        .carousel-item:not(.active) {
            display: none;
        }

        .carousel-item.active {
            position: relative;
        }

    .carousel-actions {
        flex-direction: column;
    }

        .carousel-actions .btn {
            justify-content: center;
            text-align: center;
        }

    .timeline-item {
        min-width: 200px;
    }
}

/* ===========================
   MINI GAME
=========================== */
.minigame-wrapper {
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* ── Preview ── */
.minigame-preview {
    cursor: pointer;
    padding: 0.4rem;
    opacity: 0.3;
    transition: opacity 0.25s, transform 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .minigame-preview:hover {
        opacity: 0.85;
        transform: translateY(-2px);
    }

#previewCanvas {
    image-rendering: pixelated;
    display: block;
}

/* ── Game panel ── */
.minigame-panel {
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    padding: 0 5px;
    box-sizing: border-box;
}

    .minigame-panel.open {
        max-height: 800px;
        opacity: 1;
        padding: 5px;
    }

.minigame-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.9rem;
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid rgba(91,140,255,0.12);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.minigame-label {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: rgba(91,140,255,0.45);
}

.minigame-hint {
    color: rgba(148,163,184,0.3);
    font-size: 0.6rem;
}

    .minigame-hint kbd {
        background: rgba(91,140,255,0.08);
        border: 1px solid rgba(91,140,255,0.18);
        border-radius: 3px;
        padding: 0 4px;
        font-family: monospace;
        color: rgba(91,140,255,0.45);
        font-size: 0.6rem;
    }

.close-game {
    cursor: pointer;
    color: rgba(148,163,184,0.35);
    transition: color 0.2s;
}

    .close-game:hover {
        color: rgba(148,163,184,0.8);
    }

.minigame-score-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-family: 'Courier New', monospace;
}

.score-label {
    color: rgba(148,163,184,0.3);
    font-size: 0.55rem;
    letter-spacing: 0.1em;
}

.score-value {
    color: rgba(91,140,255,0.55);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    min-width: 4ch;
}

.minigame-frame {
    position: relative;
    width: 100%;
    max-width: 100%;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    border: 1px solid rgba(91,140,255,0.12);
    background: #07090f;
    cursor: pointer;
    box-sizing: border-box;
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.game-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 9, 15, 0.5);
    transition: opacity 0.3s;
    cursor: pointer;
}

    .game-overlay.hidden {
        opacity: 0;
        pointer-events: none;
    }

#overlayMsg {
    color: rgba(91,140,255,0.65);
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: clamp(0.6rem, 1.2vw, 0.8rem);
    letter-spacing: 0.15em;
    animation: blink 1.4s step-end infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

50% {
    opacity: 0;
}

}

50% {
    opacity: 0;
}

}

/* ── Name form & leaderboard ── */
.name-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 1rem;
}

.name-form-inner {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    width: 100%;
    justify-content: center;
}

.name-form-left {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
    min-width: 140px;
}

.name-score {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    color: rgba(148,163,184,0.4);
    letter-spacing: 0.1em;
}

    .name-score span {
        color: rgba(91,140,255,0.8);
        font-size: 0.9rem;
        font-weight: 700;
    }

.name-label {
    font-family: 'Courier New', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    color: rgba(148,163,184,0.5);
}

.name-input-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.name-input {
    background: rgba(91,140,255,0.08);
    border: 1px solid rgba(91,140,255,0.3);
    border-radius: 5px;
    color: #5b8cff;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    padding: 0.2rem 0.5rem;
    width: 70px;
    text-align: center;
    outline: none;
    text-transform: uppercase;
}

    .name-input:focus {
        border-color: rgba(91,140,255,0.7);
        background: rgba(91,140,255,0.12);
    }

.name-btn {
    background: rgba(91,140,255,0.15);
    border: 1px solid rgba(91,140,255,0.35);
    border-radius: 5px;
    color: rgba(91,140,255,0.8);
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    transition: background 0.2s;
}

    .name-btn:hover {
        background: rgba(91,140,255,0.25);
    }

    .name-btn:disabled {
        opacity: 0.3;
        cursor: default;
    }

.name-form-right {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 160px;
}

.lb-title {
    font-family: 'Courier New', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    color: rgba(148,163,184,0.35);
    margin-bottom: 0.2rem;
}

.lb-scores {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.lb-scrollable {
    max-height: 80px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(91,140,255,0.3) transparent;
    padding-right: 4px;
}

    .lb-scrollable::-webkit-scrollbar {
        width: 4px;
    }

    .lb-scrollable::-webkit-scrollbar-track {
        background: transparent;
    }

    .lb-scrollable::-webkit-scrollbar-thumb {
        background: rgba(91,140,255,0.3);
        border-radius: 2px;
    }

.lb-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
}

.lb-rank {
    color: rgba(168,85,247,0.5);
    width: 1.5ch;
}

.lb-name {
    color: rgba(245,245,245,0.6);
    flex: 1;
    letter-spacing: 0.1em;
}

.lb-score {
    color: rgba(91,140,255,0.7);
    font-weight: 700;
}

.name-retry {
    background: rgba(91,140,255,0.12);
    border: 1px solid rgba(91,140,255,0.25);
    border-radius: 5px;
    color: rgba(91,140,255,0.65);
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 0.25rem 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

    .name-retry:hover {
        background: rgba(91,140,255,0.2);
        color: rgba(91,140,255,0.9);
    }

.name-input.invalid {
    border-color: rgba(239,68,68,0.7) !important;
}

@media (max-width: 768px) {
    .minigame-topbar {
        gap: 0.3rem;
        padding: 0.3rem 0.5rem;
        font-size: 0.5rem;
    }

    .minigame-hint {
        display: none;
    }

    .minigame-panel.open {
        max-height: 800px;
    }

    .minigame-frame {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}
