/* 
  Laser Squad Resurrection
*/

@font-face {
    font-family: LaserSquad;
    src: url("assets/fonts/laser_squad_small.ttf") format("truetype");
    font-display: swap;
}

/* Base & layout */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
}

body {
    margin: 0;
    background: var(--c64-black);
    color: var(--c64-white);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    overflow-x: hidden;
    background-image: 
        radial-gradient(ellipse 90% 36% at 50% 82%, rgba(46, 44, 161, .26), transparent 85%),
        linear-gradient(180deg, #14223a 0%, #101b30 28%, #080e1c 55%, #050a15 78%, var(--c64-black) 100%
    );
    background-repeat: no-repeat;
}

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

button {
    font: inherit;
}

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

.container {
    width: min(1200px, calc(100% - 72px));
    margin-inline: auto;
}

/* Header & navigation */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--c64-black);
    border-bottom: 2px solid var(--c64-red);
}

.header-inner {
    min-height: 80px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 24px;
}

.header-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: LaserSquad, monospace;
    font-size: 24px;
    line-height: 1;
    color: var(--c64-yellow);
}

.header-title {
    min-width: 0;
}

.header-logo span {
    white-space: pre;
}

.header-wordmark {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 58px;
    flex-shrink: 1;
    font-family: LaserSquad, monospace;
    font-weight: normal;
    min-width: 0;
}

.header-slogan,
.header-game-name {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.header-slogan {
    font-size: 16px;
    line-height: 1.5;
}

.header-slogan span:first-child {
    color: var(--c64-yellow);
}

.header-slogan span:last-child {
    color: var(--c64-orange);
}

.header-game-name {
    opacity: 0;
    visibility: hidden;
    font-size: 20px;
    line-height: 1.5;
}

.header-game-name span {
    align-self: flex-start;
    transform: scaleY(2.5);
    transform-origin: center;
    background: linear-gradient(to bottom, var(--c64-yellow) 50%, var(--c64-orange) 50%);
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.site-header.has-scrolled .header-slogan {
    opacity: 0;
    visibility: hidden;
}

.site-header.has-scrolled .header-game-name {
    opacity: 1;
    visibility: visible;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: none;
}

.nav-link {
    font-family: LaserSquad, monospace;
    font-size: 14px;
    color: var(--c64-white);
    transition: color .20s;
}

.nav-link:hover {
    color: var(--c64-white);
}

.nav-feature {
    --feature-color: var(--c64-yellow);
    display: inline-block;
    padding: 8px 10px;
    border: 2px solid var(--feature-color);
    color: var(--feature-color);
    font-family: LaserSquad, monospace;
    font-size: 14px;
    line-height: 1.55;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-feature:nth-child(1) { 
    --feature-color: var(--c64-cyan);
}

.nav-feature:nth-child(2) { 
    --feature-color: var(--c64-light-blue);
}

.nav-feature:nth-child(3) { 
    --feature-color: var(--c64-yellow);
}

.nav-feature:nth-child(4) { 
    --feature-color: var(--c64-orange);
}

.nav-feature:hover {
    color: var(--c64-black);
    background: var(--feature-color);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--c64-green);
    color: var(--c64-yellow);
    padding: 5px 11px;
    font-size: 24px;
}

/* Shared content */

.section-title {
    margin: 0 0 32px;
    font-family: LaserSquad, monospace;
    font-size: 32px;
    font-weight: normal;
    line-height: 2;
    letter-spacing: -0.027em;
    text-align: left;
}

.section-title span {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-inline: 0;
    transform: scaleY(2);
    transform-origin: left center;
    background: linear-gradient(to bottom, var(--c64-light-green) 50%, var(--c64-green) 50%);
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.section-title--hero {
    font-size: 48px;
    white-space: nowrap;
}

.section-title--hero span {
    background: linear-gradient(to bottom, var(--c64-yellow) 50%, var(--c64-orange) 50%);
    background-clip: text;
}

.section-text {
    margin: 0;
    font-family: LaserSquad, monospace;
    font-size: 14px;
    line-height: 1.7;
    color: var(--c64-cyan);
    text-transform: uppercase;
}

.actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.media-frame {
    border: 2px solid var(--c64-red);
    padding: 5px;
    background: var(--c64-black);
}

.media-frame img {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}

/* Hero & actions */

.hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-bottom: 2px solid var(--c64-red);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    width: min(1400px, 100%);
    height: 100%;
    margin-inline: auto;
    background-image: url("assets/images/background_hero.png");
    background-position: center bottom;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    filter: brightness(0.5);
    image-rendering: pixelated;
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    pointer-events: none;
    z-index: 0;
}

.hero-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 50px;
    padding: 40px 0;
}

.hero-copy,
.hero-media {
    min-width: 0;
}

/* Hero video */

.hero-video {
    position: relative;
    z-index: 2;
}

.hero-video video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    pointer-events: auto;
}

/* Hero slideshow */

.hero-slideshow {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
}

.hero-slideshow img {
    position: absolute;
    inset: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    object-fit: contain;
    opacity: 0;
    transition: opacity 1.0s ease;
}

.hero-slideshow img.is-active {
    opacity: 1;
}

.hero-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.hero-dot,
.gallery-dot {
    width: 16px;
    height: 16px;
    padding: 0;
    border: 1px solid var(--c64-red);
    border-radius: 100%;
    background: transparent;
    cursor: pointer;
}

.hero-dot.is-active,
.gallery-dot.is-active {
    background: var(--c64-yellow);
    border-color: var(--c64-yellow);
}

.hero-dot:focus-visible,
.gallery-dot:focus-visible {
    outline: 2px solid var(--c64-cyan);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .hero-slideshow img {
        transition: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(128px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

    .scroll-reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Feature sections */

.feature-section {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 50px;
    padding: 60px 0;
}

.feature-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 100vw;
    height: 2px;
    background: var(--c64-red);
    transform: translateX(-50%);
}

.feature-section.reverse .feature-media {
    order: 2;
}

.feature-section.reverse .feature-copy {
    order: 1;
}

.feature-media,
.feature-copy {
    min-width: 0;
}

.section-text span:first-child {
    color: var(--c64-white);
}

.section-text span:last-child {
    color: var(--c64-light-blue);
}

.hero .section-text span {
    color: var(--c64-white);
}

.platforms {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.platforms img {
    display: block;
    object-fit: contain;
    height: 112px;
    width: 112px;
    overflow: visible;
}

/* Gallery */

.gallery-title {
    margin: 0 0 24px;
    text-align: center;
}

.gallery-title span {
    margin-inline: auto;
}

.gallery-section {
    position: relative;
    padding: 60px 0;
}

.gallery-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 100vw;
    height: 2px;
    background: var(--c64-red);
    transform: translateX(-50%);
}

.gallery-layout {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.gallery-arrow {
    display: grid;
    place-items: center;
    width: 48px;
    height: 80px;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: LaserSquad, monospace;
    font-size: 30px;
    cursor: pointer;
}

.gallery-arrow span {
    display: block;
    transform: scaleY(2);
    background: linear-gradient(to bottom, var(--c64-yellow) 50%, var(--c64-orange) 50%);
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.gallery-arrow:hover span {
    background: none;
    color: var(--c64-white);
    -webkit-text-fill-color: var(--c64-white);
}

.gallery-track {
    min-width: 0;
    display: flex;
    gap: 10px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex: 0 0 24%;
    flex-shrink: 0;
    box-sizing: border-box;
    min-width: 205px;
    padding: 4px;
    border: 1px solid var(--c64-red);
    background: var(--c64-black);
    cursor: zoom-in;
    scroll-snap-align: start;
}

.gallery-item img {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.gallery-item:hover {
    border-color: var(--c64-yellow);
}

.gallery-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.image-dialog {
    max-width: min(94vw, 1250px);
    max-height: 92vh;
    padding: 12px;
    background: var(--c64-black);
    border: 1px solid var(--c64-red);
    color: var(--c64-white);
}

.image-dialog::backdrop {
    background: rgba(0, 0, 0, 0.9);
}

.image-dialog img {
    max-width: 100%;
    max-height: calc(90vh - 40px);
    width: auto;
    image-rendering: pixelated;
}

.dialog-close-form {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    margin: 0;
}

.dialog-close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: var(--c64-yellow);
    color: var(--c64-black);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

/* Closing section */

.closing-section {
    position: relative;
    text-align: center;
    padding: 60px 0;
}

.closing-section .section-title span {
    margin-inline: auto;
}

.closing-section .section-text {
    max-width: 600px;
    margin-inline: auto;
}

.center-actions {
    justify-content: center;
}

.closing-section .actions {
    margin-top: 32px;
}

.closing-section .nav-feature:nth-child(1) {
    --feature-color: var(--c64-yellow);
}

.closing-section .nav-feature:nth-child(2) {
    --feature-color: var(--c64-orange);
}

/* Footer */

.site-footer {
    padding: 25px 0;
    background: var(--c64-black);
    border-top: 2px solid var(--c64-red);
}

.legal-line {
    margin: 0;
    font-family: LaserSquad, monospace;
    font-size: 12px;
    line-height: 1.8;
    color: var(--c64-gray-3);
    text-align: center;
}

/* Responsive rules */

@media (max-width: 1000px) {
    .header-inner {
        column-gap: 14px;
    }

    .main-nav {
        gap: 12px;
    }

    .nav-link {
        font-size: 11px;
    }

    .header-slogan {
        font-size: 11px;
    }

    .header-game-name {
        font-size: 11px;
    }

    .section-title--hero {
        font-size: clamp(24px, 4.4vw, 44px);
    }

    .feature-section {
        gap: 5%;
    }
}

@media (max-width: 750px) {
    .container {
        width: min(calc(100% - 34px), 550px);
    }

    .header-inner {
        min-height: 68px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        column-gap: 12px;
    }

    .header-wordmark {
        height: 50px;
    }

    .header-slogan {
        font-size: clamp(8px, 1.7vw, 11px);
    }

    .header-game-name {
        font-size: clamp(7px, 1.4vw, 10px);
    }

    .mobile-menu-toggle {
        display: block;
        grid-column: 3;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        padding: 20px 25px 25px;
        background: var(--c64-black);
        border-bottom: 2px solid var(--c64-red);
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav .nav-link {
        font-size: 14px;
    }

    .main-nav .nav-feature {
        width: max-content;
    }

    .hero::before {
        height: clamp(110px, 25vw, 190px);
    }

    .hero-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
        padding: 30px 0 clamp(140px, 29vw, 225px);
    }

    .section-title--hero {
        font-size: clamp(26px, 7.5vw, 52px);
    }

    .section-title:not(.section-title--hero) {
        font-size: clamp(20px, 5vw, 28px);
    }

    .feature-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        padding: 42px 0;
    }

    .feature-section.reverse .feature-media,
    .feature-section.reverse .feature-copy {
        order: initial;
    }

    .gallery-section,
    .closing-section {
        padding: 42px 0;
    }

    .gallery-layout {
        grid-template-columns: 32px minmax(0, 1fr) 32px;
        gap: 8px;
    }

    .gallery-arrow {
        width: 32px;
        height: 60px;
        font-size: 22px;
    }

    .gallery-item {
        flex-basis: 65%;
    }
}

@media (max-width: 410px) {
    .header-inner {
        column-gap: 8px;
    }

    .header-slogan {
        font-size: 7px;
    }

    .header-game-name {
        font-size: 6.5px;
    }
}

@media (max-width: 390px) {
    .hero-layout {
        padding-top: 32px;
    }

    .section-title--hero {
        font-size: 7vw;
    }

    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .gallery-item {
        flex-basis: 80%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition: none !important;
    }
}
