/* ==========================================================================
   AGV — agv.gg
   Ground-up design system. Dark, Earth 2 community aesthetic.
   ========================================================================== */

:root {
    --bg: #05070b;
    --bg-raised: #0c111a;
    --bg-card: #101724;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #e8edf4;
    --text-muted: #93a0b4;
    --accent: #e63946;
    --accent-soft: rgba(230, 57, 70, 0.14);
    --accent-glow: rgba(230, 57, 70, 0.45);
    --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
    --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --radius: 14px;
    --nav-height: 72px;
    --container: 1160px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--text);
    text-decoration: none;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    line-height: 1.15;
    margin: 0;
}

p {
    margin: 0;
}

.container {
    width: min(var(--container), 100% - 3rem);
    margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--nav-height);
    background: rgba(5, 7, 11, 0.72);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.nav {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-brand img {
    height: 40px;
    width: auto;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    margin: 4px 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-radius: 8px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    color: var(--text);
}

.nav-links a.active::after {
    content: "";
    display: block;
    height: 2px;
    margin-top: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.nav-links .nav-icon {
    padding: 0.5rem;
    color: var(--text-muted);
}

.nav-links .nav-icon:hover {
    color: var(--text);
}

.nav-links .nav-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
}

.nav-cta {
    margin-left: 0.5rem;
}

@media (max-width: 900px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.75rem 1.5rem 1.25rem;
        background: rgba(5, 7, 11, 0.97);
        border-bottom: 1px solid var(--border);
        display: none;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 0.8rem 0.5rem;
    }

    .nav-links .nav-icon svg {
        width: 22px;
        height: 22px;
    }

    .nav-cta {
        margin: 0.5rem 0 0;
    }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease,
        background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-ghost:hover {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
}

.btn-sm {
    padding: 0.45rem 1.1rem;
    font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        rgba(5, 7, 11, 0.55) 0%,
        rgba(5, 7, 11, 0.35) 45%,
        var(--bg) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 780px;
}

.hero-kicker {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: clamp(3rem, 9vw, 5.5rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.hero-tagline {
    margin-top: 1.25rem;
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    color: var(--text);
    opacity: 0.9;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

.hero-actions {
    margin-top: 2.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    justify-content: center;
}

/* Sub-page hero (image, shorter) */

.hero-sub {
    min-height: 56svh;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
    padding: 6.5rem 0;
}

.section-raised {
    background: var(--bg-raised);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-head {
    max-width: 680px;
    margin: 0 auto 3.5rem;
    text-align: center;
}

.eyebrow {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.9rem;
}

.section-head h2 {
    font-size: clamp(1.9rem, 4.5vw, 2.6rem);
    font-weight: 700;
}

.section-head .lede {
    margin-top: 1.1rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    align-items: center;
}

.about-copy h2 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    margin-bottom: 1.25rem;
}

.about-copy p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.about-media img {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

/* --------------------------------------------------------------------------
   Codex
   -------------------------------------------------------------------------- */

.codex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.codex-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem 1.75rem;
    text-align: center;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.codex-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.codex-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
}

.codex-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.codex-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.codex-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@media (max-width: 900px) {
    .codex-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Colonies
   -------------------------------------------------------------------------- */

.colony-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.colony-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease,
        box-shadow 0.2s ease;
}

.colony-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.colony-media {
    background: radial-gradient(
        circle at 50% 30%,
        rgba(230, 57, 70, 0.12),
        transparent 65%
    );
    padding: 2rem 1.5rem 1rem;
}

.colony-media img {
    height: 190px;
    width: auto;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.55));
}

.colony-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.25rem 1.5rem 1.75rem;
    text-align: center;
}

.colony-body h3 {
    font-size: 1.25rem;
    margin-bottom: 0.6rem;
}

.colony-body p {
    color: var(--text-muted);
    font-size: 0.95rem;
    flex: 1;
}

.colony-actions {
    margin-top: 1.4rem;
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.warp-link {
    margin-top: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px dashed var(--border-strong);
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.warp-link:hover {
    color: var(--text);
    border-color: var(--accent);
}

.warp-link img {
    height: 26px;
    width: auto;
}

@media (max-width: 1000px) {
    .colony-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .colony-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Colony dialogs
   -------------------------------------------------------------------------- */

.colony-dialog {
    width: min(880px, calc(100% - 2rem));
    background: var(--bg-raised);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
}

.colony-dialog::backdrop {
    background: rgba(3, 4, 7, 0.8);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.dialog-head h3 {
    font-size: 1.2rem;
}

.dialog-close {
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.dialog-close:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.dialog-body {
    padding: 1.5rem;
    display: grid;
    gap: 1.5rem;
}

.dialog-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: center;
}

.dialog-row img {
    border-radius: 10px;
    border: 1px solid var(--border);
    width: 100%;
}

.dialog-row h4 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.dialog-row p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@media (max-width: 700px) {
    .dialog-row {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Partners
   -------------------------------------------------------------------------- */

.partner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.partner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 2.5rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.partner-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.partner-card img {
    height: 96px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 900px) {
    .partner-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Team
   -------------------------------------------------------------------------- */

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    justify-content: center;
}

.team-grid-narrow {
    grid-template-columns: repeat(2, minmax(0, 340px));
    justify-content: center;
}

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem 1.5rem;
    text-align: center;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.team-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-4px);
}

.team-card img {
    width: 148px;
    height: 148px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-strong);
}

.team-card h3 {
    font-size: 1.2rem;
}

.team-role {
    display: inline-block;
    margin-top: 0.4rem;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.team-card p {
    margin-top: 0.9rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

@media (max-width: 900px) {
    .team-grid,
    .team-grid-narrow {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Releases
   -------------------------------------------------------------------------- */

.release-list {
    display: grid;
    gap: 1.25rem;
    max-width: 820px;
    margin: 0 auto;
}

.release-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    transition: border-color 0.2s ease;
}

.release-card:hover {
    border-color: var(--border-strong);
}

.release-index {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.3;
}

.release-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.release-meta {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.release-card p {
    margin-top: 0.6rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.release-card .release-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--accent);
    font-weight: 500;
    font-size: 0.92rem;
    word-break: break-all;
}

.release-card .release-link:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .release-card {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* --------------------------------------------------------------------------
   Events / empty state
   -------------------------------------------------------------------------- */

.empty-panel {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    background: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 3.5rem 2rem;
}

.empty-panel h3 {
    font-size: 1.4rem;
    margin-bottom: 0.9rem;
}

.empty-panel p {
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    background: var(--bg);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-inner img {
    height: 34px;
    width: auto;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 640px;
}

.footer-copy a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
}

.footer-copy a:hover {
    text-decoration-color: var(--accent);
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.footer-social a:hover {
    color: var(--text);
}

.footer-social svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    display: block;
}

/* --------------------------------------------------------------------------
   Scroll reveal
   -------------------------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

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

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
