* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables */
:root {
    --bg-color: #1d1412;
    --bg-light: #3a2824;

    --text-primary: #f0e4d2;
    --text-secondary: #b9a99a;
    
    --border-color: #6e5544;
    --border-light: #a88362;

    --accent: #e63224;
    --accent-dark: #8f211a;
    --accent-hover: #ff4938;

    --navbar-height: 112px;

    --fs-h1: clamp(3rem, 2rem + 4vw, 7rem);
    --fs-h2: clamp(2rem, 1.5rem + 2vw, 3.5rem);
    --fs-h3: clamp(1.5rem, 1.2rem + 1vw, 2.25rem);

    --fs-body: clamp(1rem, .95rem + .2vw, 1.125rem);
    --fs-large: clamp(1.1rem, 1rem + .3vw, 1.25rem);
    --fs-small: .875rem;

    --radius: 4px;
    --transition: .2s ease;
    --section-spacing: clamp(5rem, 8vw, 8rem);

}

body {
    color: var(--text-primary);
    background: var(--bg-color);
    line-height: 1.6;
    font-family: Lato, sans-serif;
    font-size: var(--fs-body);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
}

a {
    text-decoration: none;
    color: var(--text-primary);
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Cormorant Garamond", serif;
    line-height: 1.1;
}

h1 {
    font-size: var(--fs-h1);
    font-weight: 500;
    letter-spacing: 0.05rem;
}

h2 {
    font-size: var(--fs-h2);
}

h3 {
    font-size: var(--fs-h3);
}

p {
    max-width: 65ch;
}

.wrapper {
    max-width: 1600px;
    margin-inline: auto;
    padding: 0 2rem;
}

.section {
    padding-block: var(--section-spacing);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-size: var(--fs-large);
    padding: .5rem 1.25rem;
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    font-weight: 500;
    transition: var(--transition);
}


/* ===== NAVBAR ===== */
.site-header {
    position: absolute;
    inset: 0 0 auto 0;
    width: 100%;
    height: var(--navbar-height);
    padding: 1rem 2rem;
    z-index: 99;
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.navbar-logo img {
    height: 60px;
}
.navbar-logo span {
    font-size: var(--fs-h3);
    font-family: "Cormorant Garamond", sans-serif;
    letter-spacing: 0.05rem;
    transition: 0.2s ease;
}
.navbar-logo span:hover {
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.3),
        0 0 25px rgba(255, 255, 255, 0.2),
        0 0 40px rgba(255, 255, 255, 0.1);
}
.navbar ul {
    display: flex;
    gap: 2rem;
    font-weight: bold;
}
.navbar-toggle {
    display: none;
}
.navbar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-size: 1.25rem;
    font-weight: 400;
    transition: 0.2s ease;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.navbar-item.active {
    border-bottom-color: var(--accent);
}

.navbar-item:hover {
    border-bottom-color: var(--accent);
}

.navbar-icon {
    fill: currentColor;
    height: 2rem;
}


/* ===== HERO ===== */
.hero {
    position: relative;
    background:
        linear-gradient(
            to bottom,
            rgb(0 0 0 / .7) 0%,
            rgb(0 0 0 / .35) 10%,
            transparent 30%
        ),
        url("/images/hero.webp") center / cover no-repeat;

    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--navbar-height);
}

.hero-content {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 3rem;
    margin-bottom: 8rem;
}

.hero-upper-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-subtitle {
    font-size: clamp(1rem, .85rem + .5vw, 1.5rem);
    font-weight: 300;
    letter-spacing: clamp(.12rem, .5vw, .25rem);
    word-spacing: .5rem;
}

.hero-logo {
    height: 150px;
}

.hero-links {
    display: flex;
    gap: 2rem;
}

.join-button {
    background-color: var(--accent-dark);
    border: 2px solid var(--accent);
}

.join-button:hover {
    background-color: var(--accent);
}

.vs-logo {
    height: 2rem;
}

.hero-discord-button {
    background-color: var(--bg-color);
}

.hero-discord-button:hover {
    background-color: var(--border-color);
}

#hero-discord-icon {
    fill: var(--text-primary);
    height: 2rem;
}

.player-count-container {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-large);
    text-transform: uppercase;
}

.player-count-dot {
    font-size: 2rem;
    color: #5fa62e;
    margin-right: 1rem;
}

.player-count-dot.error {
    color: red;
}

#player-count {
    padding-right: .25rem;
}

#max-players {
    color: var(--text-secondary);
    padding: 0 1rem 0 .25rem;
}

.server-ip-container {
    position: absolute;
    bottom: 0;
    font-size: var(--fs-large);
    text-transform: uppercase;
    display: flex;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
}

.server-ip-text {
    background-color: var(--accent-dark);
    padding: .5rem 1.25rem;
    border-top-left-radius: var(--radius);
}

.server-ip-box {
    background-color: var(--text-primary);
    display: flex;
    padding: .5rem 1.25rem;
    gap: .5rem;
    border-top-right-radius: var(--radius);
}

.server-ip {
    color: var(--bg-color);
    cursor: pointer;
}

.server-ip-box svg {
    width: 1.25rem;
    fill: var(--bg-color);
}
.server-ip.fade {
    opacity: 0;
}

/* ===== ABOUT ===== */
.about {
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

.about-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4rem;
}

.about-text-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about p {
    color: var(--text-secondary);
}

.about img {
    width: 100%;
    max-width: 700px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius);
}

.about-features-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.about-features-box span {
    font-size: var(--fs-large);
}

.feature-icon {
    height: 2rem;
    width: 2rem;
    color: currentColor;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 2px solid var(--accent-dark);
    padding-left: 1rem;
}

.about-bottom {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-block: 2px solid var(--accent-dark);
    padding: 2.5rem 0;
    font-size: var(--fs-large);
}

.server-feature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* ===== MODLIST PAGE ===== */
.mods-page {
    padding-top: var(--navbar-height);
}

.mods-page h1 {
    margin: 4rem 0 1rem;
    text-align: center;
    font-size: var(--fs-h2);
}

.mods-page h2 {
    font-size: var(--fs-h3);
    text-align: center;
}

.mods-page-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--fs-large);
    color: var(--text-secondary);
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.mods-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
}

.mod-card {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-color);
    overflow-wrap: anywhere;
}

.mod-card-image img {
    aspect-ratio: 1 / 1;
    width: 100%;
    display: block;
    object-fit: cover;
    transition: var(--transition);
}

.mod-card-image img:hover {
    object-fit: contain;
}

.mod-card-content {
    height: 100%;
    display: flex;
    gap: 1rem;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--bg-light);
}

.mod-version {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-secondary);
}

.mod-update {
    color: green;
}

.mods-loading {
    font-size: var(--fs-large);
}

.mods-error {
    font-size: var(--fs-large);
    color: var(--accent);
}

/* ===== SETTLEMENTS LIST ===== */
.settlements-page {
    padding-top: calc(var(--navbar-height) + 4rem);
}

.settlements-page h1 {
    text-transform: uppercase;
    font-size: var(--fs-h2);
}

.settlements-header {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.settlements-header p {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: var(--fs-large);
}

.settlements-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}

.settlement-card {
    position: relative;
    min-height: 420px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-light);
    overflow: hidden;
}

.settlement-card-image {
    position: absolute;
    inset: 0;
}

.settlement-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s ease;
}

.settlement-card-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            to top,
            rgb(29 20 18 / .98) 0%,
            rgb(29 20 18 / .75) 40%,
            rgb(0 0 0 / .15) 75%
        );
}

.settlement-card-content {
    position: relative;
    z-index: 1;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
}

.settlement-card h2 {
    font-size: var(--fs-h3);
    margin-bottom: .75rem;
}

.settlement-card p {
    color: var(--text-secondary);
}

.settlement-card:hover .settlement-card-image img {
    transform: scale(1.04);
}


/* ===== SETTLEMENTS SINGLE PAGE ===== */
.settlement-hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
}

.settlement-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settlement-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        /* Navbar shadow */
        linear-gradient(
            to bottom,
            rgb(0 0 0 / .7) 0%,
            rgb(0 0 0 / .35) 10%,
            transparent 30%
        ),

        /* Bottom hero shadow */
        linear-gradient(
            to top,
            var(--bg-color) 0%,
            rgb(29 20 18 / .65) 35%,
            rgb(0 0 0 / .15) 70%
        );
    
        
}

.settlement-hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding-bottom: 5rem;
}

.settlement-hero h1 {
    margin-top: .5rem;
    text-transform: uppercase;
}

.settlement-hero p {
    font-size: var(--fs-large);
    color: var(--text-secondary);
}

.settlement-about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 6rem;
}

.settlement-text {
    display: flex;
    flex-direction: column;
}

.settlement-text h2 {
    margin-bottom: 1.5rem;
    margin-top: 3rem;
}

.settlement-text p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.settlement-info {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-left: 2rem;
    border-left: 1px solid var(--border-color);
}

.settlement-info-label {
    color: var(--accent);
    text-transform: uppercase;
    font-size: var(--fs-small);
    letter-spacing: .1rem;
    font-weight: bold;
}

.projects-grid {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10rem;
    margin-top: 2rem;
    background-color: var(--bg-light);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.ongoing-projects h3 {
    margin-bottom: 2rem;
}

.ongoing-projects h4 {
    font-size: var(--fs-large);
}

.project {
    margin-bottom: 2rem;
}

.project h4 {
    margin-bottom: .25rem;
}

.project p {
    color: var(--text-secondary);
}

.project-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.settlement-gallery h2 {
    margin-bottom: 2rem;
}

.gallery-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.gallery-link {
    color: var(--text-secondary);
    transition: var(--transition);
}

.gallery-link:hover {
    color: var(--text-primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gallery-item {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--radius);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* ===== GALLERY ===== */
.gallery-page {
    padding-top: calc(var(--navbar-height) + 4rem);
}

.gallery-page h1 {
    font-size: var(--fs-h2);
    text-transform: uppercase;
}

.gallery-page-header {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.gallery-page-header p {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: var(--fs-large);
}

.gallery-page .gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.gallery-page .gallery-item {
    position: relative;
    padding: 0;
    border: 0;
    background: none;
    overflow: hidden;
    cursor: pointer;
    border-radius: var(--radius);
}

.gallery-page .gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-page .gallery-item:hover img {
    transform: scale(1.04);
}

/* ===== FOOTER ===== */

.footer-lower {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#gnomed-link {
    cursor: pointer;
    color: gold;
}

#gnomed-gif {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: min(500px, 90vw);
    z-index: 9999;
    display: none;
}

#gnomed-gif.show {
    display: block;
}

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgb(0 0 0 / .9);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: min(1400px, 95vw);
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    border: 0;
    background: none;
    color: var(--text-primary);
    font-size: 3rem;
    cursor: pointer;
}

/* ===== ANIMATIONS / EFFECTS ===== */

/* section fade in */
.fade-in {
    opacity: 0;
    transition:
        opacity 0.8s ease,
        transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
}

/* page transition */
main {
    opacity: 1;
    transition: 0.3s ease;
}

body.is-page-transitioning main {
    opacity: 0;
}

html.page-transition-in main {
    opacity: 0;
}

body.is-nav-transitioning .navbar-item.active {
    border-bottom-color: transparent;
}

body.is-nav-transitioning .navbar-item.is-clicked {
    border-bottom-color: var(--accent);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1300px) {
    .navbar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 0;
        background: none;
        color: var(--text-primary);
        cursor: pointer;
        z-index: 99;
    }

    .navbar-toggle svg {
        width: 2rem;
        height: 2rem;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .navbar-toggle-icon {
        display: flex;
        transition: var(--transition);
    }

    .navbar-toggle.is-open .navbar-toggle-icon {
        transform: rotate(90deg) scale(.9);
    }

    .menu-icon-close {
        display: none;
    }

    .navbar-toggle.is-open .menu-icon-open {
        display: none;
    }

    .navbar-toggle.is-open .menu-icon-close {
        display: block;
    }

    .navbar-menu {
        position: absolute;
        top: 100%;
        left: 2rem;
        right: 2rem;
        display: flex;
        flex-direction: column;
        gap: .5rem;
        padding: 1rem;
        background-color: var(--bg-light);
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: var(--transition);
        z-index: 199;
    }

    .navbar-menu.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .navbar-menu li {
        width: 100%;
    }

    .navbar-item {
        display: flex;
        justify-content: flex-start;
        width: 100%;
        padding: .75rem 1rem;
        border-bottom: 0;
        border-radius: var(--radius);
    }

    .navbar-item:hover {
        background-color: var(--bg-color);
        border-bottom-color: transparent;
    }
}

@media (max-width: 1200px) {
    .mods-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    }

    .gallery-page .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .settlements-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mods-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-page .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .wrapper {
        padding: 0 1rem;
    }
    .settlements-grid {
        grid-template-columns: 1fr;
    }

    .settlement-about-grid {
        display: flex;
        flex-direction: column;
    }

    .settlement-info {
        flex-direction: unset;
        flex-wrap: wrap;
        border: none;
        margin: 0;
        padding: 0;
        gap: 4rem;
    }

    .mods-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    }   

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-page .gallery-grid {
        grid-template-columns: 1fr;
    }
}