:root {
    --bg: #05060a;
    --bg-alt: #0c0d16;
    --surface: #11121f;
    --surface-alt: #171828;
    --surface-soft: #1f2034;
    --text: #e6e7f2;
    --muted: #9ca3c8;
    --accent: #a855f7;
    --accent-strong: #c084fc;
    --accent-contrast: #0b0c14;
    --accent-secondary: #20c997;
    --shadow-soft: 0 20px 40px rgba(5, 6, 10, 0.45);
    --shadow-card: 0 18px 35px rgba(5, 6, 10, 0.65);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: clamp(3rem, 7vw, 4.5rem);
}

/* Reset & base ------------------------------------------------------------ */
*
,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Space Grotesk", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, rgba(168, 85, 247, 0.25), transparent 45%),
                radial-gradient(circle at 20% 20%, rgba(32, 201, 151, 0.2), transparent 40%),
                var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--accent-strong);
}

section {
    padding: var(--space-2xl) 0;
}

.container {
    width: min(1200px, 92vw);
    margin: 0 auto;
}

p {
    margin: 0 0 var(--space-md);
    color: var(--muted);
}

/* Utilities --------------------------------------------------------------- */
.eyebrow {
    font-size: 0.85rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: linear-gradient(120deg, var(--accent), var(--accent-secondary));
    color: var(--accent-contrast);
    border: 0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 12px 25px rgba(168, 85, 247, 0.35);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(230, 231, 242, 0.25);
    box-shadow: none;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.12);
    color: var(--accent-strong);
    font-size: 0.85rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.stat-card {
    background: var(--surface);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-soft);
}

.stat-card span {
    display: block;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--accent-strong);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--muted);
}

.section-header {
    margin-bottom: var(--space-lg);
    text-align: center;
}

.section-header h2 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin: 0 0 var(--space-sm);
    color: #fff;
}

.section-header p {
    margin-left: auto;
    margin-right: auto;
    max-width: 60ch;
}

/* Header ----------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    backdrop-filter: blur(18px);
    background: rgba(5, 6, 10, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
}

.logo {
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.nav-links a {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    color: var(--muted);
    transition: background 0.2s;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* Hero ------------------------------------------------------------------- */
.hero {
    padding-top: clamp(4rem, 8vw, 6rem);
}

.hero-grid {
    display: grid;
    gap: var(--space-lg);
}

.hero-content h1 {
    font-size: clamp(2.4rem, 8vw, 3.6rem);
    margin: 0 0 var(--space-sm);
    color: #fff;
}

.hero-visual {
    background: radial-gradient(circle at top, rgba(168, 85, 247, 0.5), rgba(32, 201, 151, 0.15));
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.hero-visual img {
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-visual::after {
    content: "";
    position: absolute;
    inset: 20px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

/* Feature cards ----------------------------------------------------------- */
.section-muted {
    background: var(--surface-alt);
}

.mr-slider {
    position: relative;
    padding-block: var(--space-lg);
}

.mr-viewport {
    overflow: hidden;
    padding-inline: clamp(var(--space-sm), 6vw, var(--space-lg));
}

.mr-track {
    display: flex;
    gap: var(--space-md);
    align-items: stretch;
    transition: transform 0.6s ease;
    will-change: transform;
}

.case-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    display: grid;
    gap: var(--space-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: var(--shadow-soft);
    flex: 0 0 clamp(280px, 58vw, 620px);
    transition: transform 0.35s ease, opacity 0.35s ease, box-shadow 0.35s ease;
}

.mr-slider[data-ready="true"] .case-card {
    opacity: 0.3;
    transform: scale(0.9);
}

.mr-slider[data-ready="true"] .case-card.is-current {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 20px 45px rgba(5, 6, 10, 0.7);
    z-index: 2;
}

.mr-slider[data-ready="true"] .case-card.is-prev,
.mr-slider[data-ready="true"] .case-card.is-next {
    opacity: 0.6;
    transform: scale(0.95);
}

.case-card .media-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.case-card .description-container {
    display: grid;
    gap: var(--space-xs);
}

.case-card h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
}

.games {
    margin-top: var(--space-md);
}

.mr-controls {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: var(--space-sm);
    pointer-events: none;
}

.mr-control {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: rgba(5, 6, 10, 0.7);
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: var(--shadow-soft);
}

.mr-dots {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-2xs);
}

.mr-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
}

.mr-dots button.is-active {
    background: var(--accent-strong);
}

/* Games ------------------------------------------------------------------ */
.games .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
}

.game-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--space-md);
    display: grid;
    gap: var(--space-xs);
    box-shadow: var(--shadow-soft);
}

.game-card h3 a {
    color: var(--accent-strong);
}

.view-more-btn {
    margin-top: var(--space-md);
    display: flex;
    justify-content: center;
}

/* Publications ------------------------------------------------------------ */
.publication-grid {
    display: grid;
    gap: var(--space-md);
}

.publication-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: var(--space-sm);
    grid-template-columns: 1fr;
    align-items: stretch;
}

.publication-visual {
    width: 100%;
}

@media (min-width: 900px) {
    .publication-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .publication-visual {
        align-self: stretch;
    }
}

.publication-details {
    display: grid;
    gap: var(--space-xs);
    justify-content: center;
}

.publication-card h4 {
    margin: 0;
    font-size: 1.15rem;
    color: #fff;
}

.slideshow-container {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.slide.active-slide {
    opacity: 1;
}

.slideshow-nav {
    position: absolute;
    bottom: var(--space-xs);
    right: var(--space-xs);
    display: flex;
    gap: var(--space-2xs);
}

.slideshow-nav button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: rgba(5, 6, 10, 0.65);
    color: #fff;
    cursor: pointer;
}

.article-grid {
    margin-top: var(--space-lg);
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.article-card {
    background: var(--surface);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: var(--shadow-soft);
}

.article-card h3 {
    margin: var(--space-xs) 0 0;
}

/* Article detail -------------------------------------------------------- */
.article-page {
    background: radial-gradient(circle at top, rgba(168, 85, 247, 0.15), transparent 40%), var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: var(--space-2xl) 0;
}

.article-detail .article-shell {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    gap: var(--space-md);
}

.article-hero h1 {
    margin: var(--space-xs) 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.article-tag {
    font-size: 0.9rem;
    color: var(--accent-strong);
    letter-spacing: 0.2em;
}

.article-link a {
    color: var(--accent-secondary);
    font-weight: 600;
}

.article-visual img {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-soft);
}

.article-body {
    line-height: 1.8;
    color: var(--muted);
}

.article-body h2,
.article-body h3 {
    color: #fff;
    margin-top: var(--space-md);
}

.article-body p {
    color: var(--muted);
}

.article-actions {
    display: flex;
    justify-content: flex-end;
}

/* Contact ---------------------------------------------------------------- */
.contact {
    background: var(--surface-alt);
}

.contact-grid {
    display: grid;
    gap: var(--space-lg);
}

.contact form {
    display: grid;
    gap: var(--space-sm);
}

.form-wrapper {
    display: grid;
    gap: var(--space-sm);
}

.form-messages {
    display: grid;
    gap: var(--space-2xs);
}

.alert {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}

.alert.success {
    background: rgba(32, 201, 151, 0.12);
    border: 1px solid rgba(32, 201, 151, 0.4);
}

.alert.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.contact input,
.contact textarea {
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font: inherit;
}

.contact input:focus,
.contact textarea:focus {
    outline: 2px solid rgba(168, 85, 247, 0.5);
    border-color: transparent;
}

.social-links {
    list-style: none;
    padding: 0;
    display: flex;
    gap: var(--space-sm);
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.social-links img {
    width: 20px;
    height: 20px;
}

/* Footer ----------------------------------------------------------------- */
footer {
    text-align: center;
    padding: var(--space-lg) 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Lightbox --------------------------------------------------------------- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 10, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.lightbox-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius-md);
    background: #000;
    box-shadow: var(--shadow-card);
}

.lightbox-close {
    position: absolute;
    top: clamp(12px, 3vw, 28px);
    right: clamp(12px, 3vw, 28px);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Responsive ------------------------------------------------------------- */
@media (min-width: 900px) {
    .hero-grid {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: center;
    }

    .contact-grid {
        grid-template-columns: 0.9fr 1.1fr;
        align-items: start;
    }

    .mr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* .publication-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    } */
}

@media (max-width: 640px) {
    .nav-links {
        justify-content: space-between;
    }

    .hero-visual {
        padding: var(--space-md);
    }

    .btn-group {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);
    }

    .social-links {
        flex-direction: column;
    }
}

/* Mobile adjustments ----------------------------------------------------- */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .hero-grid {
        display: grid;
        gap: var(--space-md);
    }

    .hero-visual {
        padding: var(--space-md);
    }

    .case-card {
        min-width: calc(100vw - 3rem);
    }

    .mr-controls {
        justify-content: center;
    }

    .game-card,
    .publication-card,
    .article-card {
        padding: var(--space-sm);
    }
}
