/* ===== TOKENS ===== */
:root {
    --bg: #0f172a;
    --bg-elev: #1e293b;
    --bg-dark: #0b1220;
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-dim: #94a3b8;
    --text-faint: #64748b;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --surface-hover: #334155;

    --radius: 8px;
    --radius-sm: 6px;
    --shadow-dropdown: 0 8px 20px rgba(0, 0, 0, 0.4);
    --transition: 0.3s;

    --container-max: 1100px;
}

/* ===== FONTS ===== */
@font-face {
    font-family: 'Enchanted Land';
    src: url('Art/Warden/Enchanted Land.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'Minimal Pixel';
    src: url('Art/Clockwork/MinimalPixelFont.ttf') format('truetype');
    font-display: swap;
}

.page-warden h1,
.page-warden h2 {
    font-family: 'Enchanted Land', 'Segoe UI', sans-serif;
}

.page-clockwork h1,
.page-clockwork h2 {
    font-family: 'Minimal Pixel', 'Segoe UI', sans-serif;
}

.page-clockwork .hero h1 {
    font-size: 80px;
}

.page-clockwork .section h2 {
    font-size: 56px;
}

/* ===== GLOBAL ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    text-decoration: none;
    color: var(--text);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

img {
    max-width: 100%;
    display: block;
}

/* ===== NAVBAR ===== */
header {
    background: var(--bg-dark);
    padding: 8px 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
}

    .logo img {
        height: 80px;
        width: auto;
    }

.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    color: var(--text);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

    .nav-toggle:hover {
        background: var(--surface-hover);
    }

    .nav-toggle-icon {
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 30px;
        height: 30px;
        transition: transform var(--transition);
    }

    .nav-toggle-dot {
        width: 6px;
        height: 6px;
        background: currentColor;
        border-radius: 50%;
    }

.navbar.nav-open .nav-toggle-icon {
    transform: rotate(90deg);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

    .nav-links li {
        position: relative;
    }

        .nav-links li a {
            padding: 8px 0;
            display: inline-block;
            transition: var(--transition);
        }

            .nav-links > li > a:not(.dropdown-trigger):hover {
                color: var(--accent);
            }

.dropdown-trigger {
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-links > li > a.active {
    color: var(--accent);
    position: relative;
}

    .nav-links > li > a.active::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 2px;
        background: var(--accent);
    }

.dropdown a.active {
    color: var(--accent);
    background: var(--surface-hover);
}

/* ===== DROPDOWN ===== */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-elev);
    min-width: 180px;
    border-radius: var(--radius);
    padding: 8px 0;
    box-shadow: var(--shadow-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

    .nav-links .dropdown a {
        display: block;
        padding: 12px 16px;
        text-align: center;
    }

        .nav-links .dropdown a:hover {
            background: var(--surface-hover);
        }

.nav-links li:hover > .dropdown,
.nav-links li:has(:focus-visible) > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.caret {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--transition);
    vertical-align: middle;
}

.nav-links li:hover > .dropdown-trigger > .caret,
.nav-links li:has(:focus-visible) > .dropdown-trigger > .caret {
    transform: rotate(225deg);
}

/* ===== CAROUSEL ===== */
.carousel {
    width: 100%;
    padding: 60px 0 40px;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

    .carousel-track.dragging {
        cursor: grabbing;
        scroll-snap-type: none;
        scroll-behavior: auto;
    }

    .carousel-track::-webkit-scrollbar {
        display: none;
    }

.carousel-slide {
    flex: 0 0 35%;
    aspect-ratio: 16 / 9;
    scroll-snap-align: center;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-elev);
    position: relative;
}

    .carousel-caption {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 56px 24px 20px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 30%, rgba(0, 0, 0, 0));
        color: var(--text);
        text-decoration: none;
        transition: background var(--transition);
    }

        .carousel-caption h3 {
            font-size: 20px;
            margin-bottom: 6px;
            color: var(--text);
            transition: color var(--transition);
        }

        .carousel-caption p {
            font-size: 14px;
            color: var(--text-muted);
            margin: 0;
        }

        .carousel-caption:hover h3,
        .carousel-caption:focus-visible h3 {
            color: var(--accent);
        }

    .carousel-slide:first-child {
        margin-left: 32.5%;
    }

    .carousel-slide:last-child {
        margin-right: 32.5%;
    }

    .carousel-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        -webkit-user-drag: none;
    }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--text-faint);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

    .carousel-dot:hover {
        background: var(--text-muted);
    }

    .carousel-dot.active {
        background: var(--accent);
        transform: scale(1.2);
    }

/* ===== HERO ===== */
.hero {
    padding: 80px 20px;
    text-align: center;
    background: linear-gradient(to right, var(--bg), var(--bg-elev));
}

    .hero h1 {
        font-size: 48px;
        margin-bottom: 20px;
    }

    .hero p {
        font-size: 20px;
        color: var(--text-dim);
        max-width: 700px;
        margin: auto;
    }

/* ===== CONTENT ===== */
.container {
    padding: 80px 40px;
    max-width: var(--container-max);
    margin: 0 auto;
    text-align: center;
}

    .container > h1 {
        font-size: 40px;
        margin-bottom: 20px;
        color: var(--accent);
    }

    .container > p {
        max-width: 800px;
        margin: 0 auto;
        color: var(--text-muted);
    }

.section {
    margin-bottom: 60px;
}

    .section h2 {
        font-size: 32px;
        margin-bottom: 20px;
        color: var(--accent);
    }

    .section p {
        max-width: 800px;
        margin: auto;
        color: var(--text-muted);
    }

/* ===== BUTTON ===== */
.button {
    display: inline-block;
    margin-top: 25px;
    padding: 12px 28px;
    background: var(--accent);
    color: var(--bg);
    border-radius: var(--radius-sm);
    font-weight: bold;
    transition: var(--transition);
}

    .button:hover {
        background: var(--accent-hover);
    }

/* ===== GAME PAGE BANNER / VIDEO ===== */
.game-banner,
.game-video {
    display: block;
    width: 92%;
    max-width: 1000px;
    margin: 60px auto 0;
    border-radius: var(--radius);
}

    .game-video {
        background: #000;
    }

.screenshot-gallery {
    max-width: 1200px;
    margin: 60px auto 0;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

    .screenshot-gallery img {
        width: 100%;
        height: auto;
        border-radius: var(--radius);
    }

@media (max-width: 800px) {
    .screenshot-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .screenshot-gallery {
        grid-template-columns: 1fr;
    }
}

/* ===== EXTERNAL EMBED ===== */
.external-embed {
    width: 100%;
    flex: 1;
    min-height: 0;
    border: 0;
    background: var(--bg);
}

/* ===== STEAM BUTTON ===== */
.steam-button,
.quest-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 25px;
    padding: 4px;
    background: transparent;
    border-radius: var(--radius-sm);
}

    .steam-button img,
    .quest-button img {
        height: 50px;
        width: auto;
        display: block;
        transition: transform var(--transition), filter var(--transition);
    }

    .quest-button img {
        height: 90px;
    }

    .steam-button:hover img,
    .quest-button:hover img {
        transform: scale(1.08);
        filter: brightness(1.2);
    }

.store-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
}

    .store-buttons .steam-button,
    .store-buttons .quest-button {
        margin-top: 0;
    }

/* ===== FOOTER ===== */
footer {
    background: var(--bg-dark);
    text-align: center;
    padding: 20px;
    margin-top: auto;
    color: var(--text-faint);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    header {
        padding: 8px 20px;
    }

    .navbar {
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .logo img {
        height: 64px;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        width: 100%;
    }

    .navbar.nav-open .nav-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 0 4px;
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        padding: 4px 0 4px 16px;
        min-width: 0;
    }

        .nav-links .dropdown a {
            padding: 6px 0;
        }

    .caret {
        display: none;
    }

    .hero {
        padding: 80px 16px;
    }

        .hero h1 {
            font-size: 34px;
        }

        .hero p {
            font-size: 17px;
        }

    .container {
        padding: 60px 20px;
    }

        .container > h1 {
            font-size: 30px;
        }

    .section h2 {
        font-size: 26px;
        }

    .page-clockwork .hero h1 {
        font-size: 56px;
    }

    .page-clockwork .section h2 {
        font-size: 44px;
    }

    .carousel-slide {
        flex: 0 0 85%;
    }

        .carousel-slide:first-child {
            margin-left: 7.5%;
        }

        .carousel-slide:last-child {
            margin-right: 7.5%;
        }
}
