/* ============================================
   Matrix – Color palette
   PRIMARY: Matrix Green #00FF66, Neon Green #2BFF88, Deep Black #0A0A0A, Charcoal Black #141414
   ACCENT / DEPTH: Cyber Green #00CC55, Digital Gray #2E2E2E, Pure White #FFFFFF, Soft Gray #BFBBFF
   ============================================ */

:root {
    --matrix-green: #00FF66;
    --neon-green: #2BFF88;
    --cyber-green: #00CC55;
    --black: #0A0A0A;
    --charcoal: #141414;
    --gray-dark: #2E2E2E;
    --gray-light: #BFBBFF;
    --white: #FFFFFF;
    /* Legacy names mapped to Matrix palette */
    --red-primary: #00FF66;
    --red-dark: #00CC55;
    --orange-fire: #2BFF88;
    --orange: #00CC55;
    --blue-police: #00CC55;
    --blue-dark: #00FF66;

    --font: 'Exo 2', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: 0.25s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

/* Custom scrollbar – right side, Matrix colors */
html {
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-dark) var(--charcoal);
}

html::-webkit-scrollbar {
    width: 10px;
}

html::-webkit-scrollbar-track {
    background: var(--charcoal);
}

html::-webkit-scrollbar-thumb {
    background: var(--gray-dark);
    border-radius: 5px;
    border: 2px solid var(--charcoal);
}

html::-webkit-scrollbar-thumb:hover {
    background: var(--matrix-green);
}

body {
    font-family: var(--font);
    background: var(--black);
    color: var(--gray-light);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--matrix-green);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--gray-light);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--white);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
}

/* Nav user menu (logged in: avatar + name + dropdown) */
.nav-auth-item {
    position: relative;
}

.nav-user-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.nav-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    background: transparent;
    border: 1px solid var(--gray-dark);
    border-radius: var(--radius);
    color: var(--white);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.nav-user-trigger:hover {
    border-color: var(--matrix-green);
    background: rgba(0, 255, 102, 0.08);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.35rem;
    min-width: 160px;
    background: var(--charcoal);
    border: 1px solid var(--gray-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 200;
}

.nav-user-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-user-dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    border-radius: var(--radius);
}

.nav-user-dropdown-item:hover {
    background: var(--gray-dark);
    color: var(--matrix-green);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--matrix-green);
    color: var(--black);
    border-color: var(--matrix-green);
}

.btn-primary:hover {
    background: var(--cyber-green);
    border-color: var(--cyber-green);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 255, 102, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: var(--gray-dark);
}

.btn-outline:hover {
    border-color: var(--matrix-green);
    color: var(--matrix-green);
}

.btn-accent {
    background: var(--neon-green);
    color: var(--black);
    border-color: var(--neon-green);
}

.btn-accent:hover {
    background: var(--cyber-green);
    border-color: var(--cyber-green);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: 1.2rem;
}

.btn-block {
    width: 100%;
}

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 1.5rem 4rem;
    text-align: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 255, 102, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(0, 204, 85, 0.08) 0%, transparent 50%),
        var(--black);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* MATRIX – letter boxes */
.hero-letters-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(0.5rem, 2vw, 1rem);
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    min-height: calc(clamp(4rem, 11vw, 6rem) + 20px);
    padding-bottom: 10px;
}

.hero-letter-box {
    --size: clamp(4rem, 11vw, 6rem);
    width: var(--size);
    height: var(--size);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
}

/* Random 5–15px up/down offset per letter (6 letters: M A T R I X) */
.hero-letter-box:nth-child(1)  { --offset-y: -12px; }
.hero-letter-box:nth-child(2)  { --offset-y: 8px; }
.hero-letter-box:nth-child(3)  { --offset-y: -15px; }
.hero-letter-box:nth-child(4)  { --offset-y: 6px; }
.hero-letter-box:nth-child(5)  { --offset-y: -8px; }
.hero-letter-box:nth-child(6)  { --offset-y: 14px; }

.hero-letter-box {
    transform: translateY(var(--offset-y, 0));
    animation: heroBoxFadeOffset 0.6s ease backwards;
    animation-delay: calc(0.04s * var(--i, 0));
}

.hero-letter-box span {
    font-family: 'Bebas Neue', var(--font);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 400;
    color: var(--matrix-green);
    -webkit-text-stroke: 2px var(--matrix-green);
    -webkit-text-fill-color: var(--matrix-green);
    letter-spacing: 0.02em;
}

@keyframes heroBoxFadeOffset {
    from {
        opacity: 0;
        transform: translateY(calc(16px + var(--offset-y, 0)));
    }
    to {
        opacity: 1;
        transform: translateY(var(--offset-y, 0));
    }
}

/* Roleplay – text under the letter boxes */
.hero-roleplay-label {
    font-size: clamp(2.25rem, 5.5vw, 3.5rem);
    font-weight: 700;
    color: var(--matrix-green);
    letter-spacing: 0.12em;
    text-align: center;
    margin: 0 0 1.5rem;
}

.server-status {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--charcoal);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-dark);
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--matrix-green);
    animation: pulse 2s ease-in-out infinite;
}

.server-status.online .status-dot {
    background: var(--neon-green);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-weight: 600;
    color: var(--white);
}

.status-players,
.status-uptime {
    color: var(--gray-light);
    font-size: 0.9rem;
}

/* Section titles */
.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    text-align: center;
    color: var(--gray-light);
    max-width: 560px;
    margin: 0 auto 3rem;
}

/* About */
.about {
    padding: 5rem 0;
    background: var(--charcoal);
}

.about-text {
    max-width: 700px;
    margin: 0 auto 2rem;
    text-align: center;
    font-size: 1.1rem;
}

.about-text strong {
    color: var(--matrix-green);
}

.about-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

/* FAQ */
.faq {
    padding: 5rem 0;
    background: var(--charcoal);
}

.faq-list {
    max-width: 700px;
    margin: 0 auto;
}

.faq-item {
    background: var(--black);
    border: 1px solid var(--gray-dark);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: border-color var(--transition);
}

.faq-item:hover,
.faq-item[open] {
    border-color: var(--matrix-green);
}

.faq-item summary {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--white);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--matrix-green);
    transition: transform var(--transition);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    padding: 0 1.5rem 1.25rem;
    color: var(--gray-light);
    font-size: 0.95rem;
    border-top: 1px solid var(--gray-dark);
    padding-top: 1rem;
    margin: 0 1.5rem 1rem;
}

/* CTA */
.cta {
    padding: 5rem 0;
    text-align: center;
}

.cta-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
}

.cta-text {
    color: var(--gray-light);
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--gray-dark);
}

.footer-live {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--matrix-green);
    margin-bottom: 0.5rem;
}

.footer-copy {
    font-size: 0.9rem;
    color: var(--gray-dark);
}

/* Nordyn Studio – collaboration badge (bottom right, Matrix colors) */
.collab-badge {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 1rem;
    background: var(--charcoal);
    border: 1px solid var(--matrix-green);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.collab-badge:hover {
    border-color: var(--cyber-green);
    box-shadow: 0 4px 20px rgba(0, 255, 102, 0.25);
}

.collab-badge-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.collab-badge-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    line-height: 1.35;
}

.collab-badge-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gray-light);
    letter-spacing: 0.02em;
}

.collab-badge-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--matrix-green);
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .collab-badge {
        bottom: 0.75rem;
        right: 0.75rem;
        padding: 0.5rem 0.8rem;
        gap: 0.6rem;
    }
    .collab-badge-logo {
        width: 24px;
        height: 24px;
    }
    .collab-badge-label {
        font-size: 0.65rem;
    }
    .collab-badge-name {
        font-size: 0.8rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--charcoal);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        border-bottom: 1px solid var(--gray-dark);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    }

    .nav-links.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.is-active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .nav-toggle.is-active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.is-active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    .nav-toggle span {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .hero-title {
        flex-wrap: wrap;
        justify-content: center;
    }

    .server-status {
        flex-direction: column;
    }

    .about-cta {
        flex-direction: column;
    }

    .tiers {
        grid-template-columns: 1fr;
    }
}
