/* ============================================================
   COMANCHE — Homepage Stylesheet
   Inherits design tokens from loading/index.css
   ============================================================ */

/* ── Fonts ── */

@font-face {
    font-family: "Purista";
    src: url("assets/fonts/purista.ttf") format("truetype");
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
}

@font-face {
    font-family: "Purista";
    src: url("assets/fonts/purista-bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700 800;
    font-display: swap;
}

/* ── Design Tokens ── */

:root {
    --color-orange: #f7931e;
    --color-blue: #4cb3ff;
    --color-white: #f2f2f2;
    --color-muted: rgba(242, 242, 242, 0.6);
    --color-bg: #060a10;
    --color-bg-alt: #080c14;
    --color-bg-card: rgba(255, 255, 255, 0.04);
    --color-bg-card-hover: rgba(255, 255, 255, 0.07);
    --color-border: rgba(255, 255, 255, 0.07);
    --color-border-accent: rgba(247, 147, 30, 0.55);

    --text-glow:
        0 0 10px rgba(255, 255, 255, 0.18),
        0 0 20px rgba(124, 198, 255, 0.28),
        0 0 38px rgba(86, 170, 255, 0.18),
        0 2px 8px rgba(0, 0, 0, 0.5);
    --title-glow:
        0 0 18px rgba(255, 255, 255, 0.32),
        0 0 36px rgba(132, 204, 255, 0.4),
        0 0 60px rgba(94, 178, 255, 0.26),
        0 2px 12px rgba(0, 0, 0, 0.6);
    --orange-glow:
        0 0 14px rgba(247, 147, 30, 0.4),
        0 0 32px rgba(247, 147, 30, 0.22),
        0 2px 8px rgba(0, 0, 0, 0.5);

    --vignette-layer:
        radial-gradient(105% 80% at 42% 33%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 23%, rgba(0, 0, 0, 0.3) 46%, rgba(0, 0, 0, 0.82) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.08) 36%, rgba(0, 0, 0, 0.7) 100%);

    --background-filter: saturate(0.45) brightness(1.8) contrast(0.55) blur(1px);
    --background-fade-ms: 1800ms;
    --background-motion-ms: 14000ms;

    --section-pad-v: 96px;
    --section-pad-h: 120px;
    --header-height: 72px;

    --font-main: "Purista", "Rajdhani", "Trebuchet MS", sans-serif;
}

/* ── Reset & Base ── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--color-bg);
    color: var(--color-white);
    font-family: var(--font-main);
    line-height: 1.5;
    overflow-x: hidden;
}

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

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

/* ── Utility ── */

.section {
    position: relative;
    padding: var(--section-pad-v) var(--section-pad-h);
}

.section-dark {
    background: var(--color-bg-alt);
}

.section-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.section-label {
    display: inline-block;
    color: var(--color-orange);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-shadow: var(--orange-glow);
    margin-bottom: 16px;
}

.section-heading {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(2rem, 3.2vw, 3.2rem);
    line-height: 0.92;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-shadow: var(--title-glow);
    margin-bottom: 24px;
}

.section-subheading {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: clamp(1.1rem, 1.5vw, 1.4rem);
    color: var(--color-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.divider {
    width: 48px;
    height: 2px;
    background: var(--color-orange);
    margin-bottom: 32px;
    box-shadow: 0 0 12px rgba(247, 147, 30, 0.5);
}

/* ── Header ── */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(6, 10, 16, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: height 0.3s ease, background 0.3s ease;
}

.site-header.scrolled {
    height: 58px;
    background: rgba(6, 10, 16, 0.92);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 var(--section-pad-h);
    display: flex;
    align-items: center;
    gap: 40px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-logo {
    height: 36px;
    width: auto;
}

.header-name {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-orange);
    text-shadow: var(--orange-glow);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-left: auto;
}

.nav-link {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(242, 242, 242, 0.75);
    transition: color 0.2s ease;
}

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

.header-cta {
    flex-shrink: 0;
    padding: 9px 22px;
    border: 1px solid var(--color-orange);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-orange);
    transition: background 0.2s ease, color 0.2s ease;
}

.header-cta:hover {
    background: var(--color-orange);
    color: var(--color-bg);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-white);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ── */

#hero {
    position: relative;
    height: 100dvh;
    min-height: 600px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg-stack {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 50%;
    filter: var(--background-filter);
    opacity: 0;
    transform: scale(1.07);
    transition: opacity var(--background-fade-ms) ease, transform var(--background-motion-ms) linear;
}

.hero-bg-layer.active {
    opacity: 1;
    transform: scale(1.015);
}

.hero-vignette {
    position: absolute;
    inset: 0;
    background: var(--vignette-layer);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 var(--section-pad-h);
    padding-top: var(--header-height);
    max-width: 900px;
}

.hero-label {
    display: inline-block;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--color-orange);
    text-shadow: var(--orange-glow);
    margin-bottom: 18px;
}

.hero-heading {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(3.4rem, 6.5vw, 7rem);
    line-height: 0.88;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-shadow: var(--title-glow);
    margin-bottom: 28px;
    color: var(--color-white);
}

.hero-heading em {
    font-style: normal;
    color: var(--color-orange);
    text-shadow: var(--orange-glow);
}

.hero-lore {
    max-width: 620px;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: clamp(1rem, 1.3vw, 1.22rem);
    line-height: 1.55;
    color: rgba(242, 242, 242, 0.88);
    text-shadow: var(--text-glow);
    margin-bottom: 44px;
}

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

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 34px;
    background: var(--color-orange);
    color: #0a0e14;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border: 1px solid var(--color-orange);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    background: #ffab3a;
    box-shadow: 0 0 24px rgba(247, 147, 30, 0.45);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 34px;
    background: transparent;
    color: var(--color-white);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border: 1px solid rgba(242, 242, 242, 0.3);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--color-white);
    color: var(--color-white);
}

.hero-scroll {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(242, 242, 242, 0.4);
    font-family: var(--font-main);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: scrollBounce 2.4s ease-in-out infinite;
}

.hero-scroll svg {
    width: 20px;
    height: 20px;
    opacity: 0.5;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ── Overview ── */

#overview .section-inner {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 80px;
    align-items: center;
}

.overview-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.overview-logo {
    width: min(280px, 100%);
    filter: drop-shadow(0 0 24px rgba(247, 147, 30, 0.25));
}

.overview-rule {
    width: 1px;
    height: 80px;
    background: linear-gradient(180deg, transparent 0%, var(--color-orange) 50%, transparent 100%);
    opacity: 0.5;
}

.overview-body p {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.65;
    color: rgba(242, 242, 242, 0.82);
    margin-bottom: 20px;
}

.overview-body p:last-child {
    margin-bottom: 0;
}

.overview-quote {
    border-left: 3px solid var(--color-orange);
    padding-left: 20px;
    margin: 28px 0;
    font-style: normal;
    color: rgba(242, 242, 242, 0.92) !important;
    font-weight: 600 !important;
    box-shadow: -3px 0 12px rgba(247, 147, 30, 0.2);
}

/* ── Gameplay ── */

#gameplay {
    position: relative;
    overflow: hidden;
}

.gameplay-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 40%;
    filter: saturate(0.3) brightness(0.35) contrast(0.9);
    z-index: 0;
}

.gameplay-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 10, 16, 0.55) 0%, rgba(6, 10, 16, 0.72) 100%);
    z-index: 1;
}

#gameplay .section-inner {
    position: relative;
    z-index: 2;
}

.gameplay-header {
    max-width: 640px;
    margin-bottom: 56px;
}

.gameplay-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
}

.gameplay-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    padding: 32px 28px;
    transition: background 0.2s ease;
}

.gameplay-card:hover {
    background: var(--color-bg-card-hover);
}

.gameplay-card-icon {
    font-size: 1.6rem;
    margin-bottom: 18px;
    line-height: 1;
}

.gameplay-card-title {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-orange);
    margin-bottom: 12px;
    text-shadow: var(--orange-glow);
}

.gameplay-card p {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgba(242, 242, 242, 0.72);
}

/* ── Features ── */

#features .features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    margin-top: 48px;
}

.feature-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-top: 2px solid var(--color-border-accent);
    padding: 32px 28px;
    transition: background 0.2s ease, border-top-color 0.2s ease;
}

.feature-card:hover {
    background: var(--color-bg-card-hover);
    border-top-color: var(--color-orange);
}

.feature-card-title {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-white);
    margin-bottom: 10px;
}

.feature-card p {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(242, 242, 242, 0.65);
}

/* ── Factions ── */

#factions {
    background: var(--color-bg);
}

#factions .section-inner > .section-heading,
#factions .section-inner > .section-label,
#factions .section-inner > .divider {
    max-width: 1400px;
}

.factions-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    margin-top: 48px;
}

.faction-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: default;
}

.faction-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.faction-banner {
    width: 100%;
    aspect-ratio: 16 / 7;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.faction-body {
    flex: 1;
    padding: 18px 16px 20px;
    background: var(--color-bg-card);
}

.faction-name {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-orange);
    margin-bottom: 8px;
    text-shadow: var(--orange-glow);
}

.faction-desc {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgba(242, 242, 242, 0.65);
}

/* ── Name Meaning ── */

#about {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin-top: 48px;
}

.about-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    padding: 36px 32px;
}

.about-card-eyebrow {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: 10px;
}

.about-card-title {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(1.3rem, 1.8vw, 1.8rem);
    line-height: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-orange);
    text-shadow: var(--orange-glow);
    margin-bottom: 16px;
}

.about-card p {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.92rem;
    line-height: 1.6;
    color: rgba(242, 242, 242, 0.75);
}

/* ── FAQ ── */

#faq .faq-list {
    margin-top: 48px;
    border-top: 1px solid var(--color-border);
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    padding: 22px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-white);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.4;
    text-align: left;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: var(--color-orange);
}

.faq-toggle {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 1px solid var(--color-border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-orange);
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.25s ease, background 0.2s ease;
}

.faq-item.open .faq-toggle {
    transform: rotate(45deg);
    background: rgba(247, 147, 30, 0.12);
}

.faq-answer {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
}

.faq-answer-inner {
    padding: 0 0 24px;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.92rem;
    line-height: 1.65;
    color: rgba(242, 242, 242, 0.72);
    max-width: 860px;
}

/* ── CTA / Join ── */

#join {
    position: relative;
    text-align: center;
    overflow: hidden;
}

.join-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: saturate(0.25) brightness(0.25) contrast(0.9);
    z-index: 0;
}

.join-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 10, 16, 0.6) 0%, rgba(6, 10, 16, 0.75) 100%);
    z-index: 1;
}

#join .section-inner {
    position: relative;
    z-index: 2;
}

.join-heading {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 5.5rem);
    line-height: 0.9;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-shadow: var(--title-glow);
    margin-bottom: 18px;
}

.join-sub {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    color: rgba(242, 242, 242, 0.7);
    margin-bottom: 48px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.55;
}

.join-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

/* ── Footer ── */

.site-footer {
    background: #040710;
    border-top: 1px solid var(--color-border);
    padding: 48px var(--section-pad-h);
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    height: 28px;
    width: auto;
    opacity: 0.7;
}

.footer-name {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(242, 242, 242, 0.55);
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.footer-link {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(242, 242, 242, 0.4);
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: rgba(242, 242, 242, 0.8);
}

.footer-credit {
    width: 100%;
    font-family: var(--font-main);
    font-size: 0.74rem;
    color: rgba(242, 242, 242, 0.28);
    letter-spacing: 0.06em;
}

.footer-accent {
    color: var(--color-orange);
    opacity: 0.7;
}

.footer-copy {
    font-family: var(--font-main);
    font-size: 0.72rem;
    color: rgba(242, 242, 242, 0.2);
    letter-spacing: 0.04em;
}

/* ── Responsive: 1200px ── */

@media (max-width: 1200px) {
    :root {
        --section-pad-h: 60px;
    }

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

    .factions-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .header-inner {
        padding: 0 60px;
    }
}

/* ── Responsive: 900px ── */

@media (max-width: 900px) {
    :root {
        --section-pad-h: 32px;
        --section-pad-v: 64px;
    }

    .header-nav,
    .header-cta {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .site-header.nav-open .header-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: rgba(6, 10, 16, 0.97);
        padding: 24px 32px;
        gap: 20px;
        border-bottom: 1px solid var(--color-border);
    }

    .site-header.nav-open .header-cta {
        display: none;
    }

    .header-inner {
        padding: 0 32px;
    }

    #overview .section-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .overview-media {
        flex-direction: row;
        justify-content: flex-start;
    }

    .overview-rule {
        width: 80px;
        height: 1px;
        background: linear-gradient(90deg, transparent 0%, var(--color-orange) 50%, transparent 100%);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

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

    .about-grid {
        grid-template-columns: 1fr;
    }

    .footer-nav {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Responsive: 600px ── */

@media (max-width: 600px) {
    :root {
        --section-pad-h: 20px;
        --section-pad-v: 48px;
    }

    .gameplay-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr !important;
    }

    .factions-grid {
        grid-template-columns: 1fr;
    }

    .hero-heading {
        font-size: clamp(2.6rem, 11vw, 3.6rem);
    }

    .hero-lore {
        font-size: 0.95rem;
    }

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

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

    .footer-nav {
        gap: 16px;
    }
}
