/* ─── TOKENS ──────────────────────────────────────────────────── */
:root {
    --void: #03030a;
    --space-dark: #0a0a1a;
    --panel: rgba(10, 10, 26, 0.72);
    --panel-solid: rgba(8, 8, 20, 0.92);
    --accent: #e8676b;
    --accent-dim: rgba(232, 103, 107, 0.15);
    --accent-glow: rgba(232, 103, 107, 0.35);
    --star: #ffffff;
    --dim: rgba(255, 255, 255, 0.45);
    --dim-hi: rgba(255, 255, 255, 0.65);
    --border: rgba(255, 255, 255, 0.07);
    --border-hi: rgba(255, 255, 255, 0.14);
    --green: #428230;
    --font-brand: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --nav-h: 56px;
    --section-px: 8vw;
    --radius: 3px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--void);
    color: var(--star);
    font-family: var(--font-body);
    font-weight: 300;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── BACKGROUND ──────────────────────────────────────────────── */
#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Static starfield fallback — used on sub-pages (no Three.js planet) */
.page-bg {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(232, 103, 107, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 80% 60%, rgba(232, 103, 107, 0.04) 0%, transparent 60%),
        var(--void);
}

/* Canvas-drawn twinkling stars, layered above .page-bg — populated by shared.js */
#star-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* ─── NAV ─────────────────────────────────────────────────────── */
nav#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(20px, var(--section-px), 64px);
    z-index: 201;
    background: rgba(3, 3, 10, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

nav#main-nav.scrolled {
    background: rgba(3, 3, 10, 0.85);
}

.nav-logo {
    text-decoration: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    filter: drop-shadow(0 0 12px var(--accent-glow)) drop-shadow(0 0 24px rgba(232, 103, 107, 0.15));
}

.nav-logo img {
    height: clamp(22px, 2.8vw, 32px);
    width: auto;
    display: block;
}

/* Center links */
.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 2.5vw, 44px);
    list-style: none;
}

.nav-links a {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dim);
    text-decoration: none;
    transition: color 0.25s;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--star);
}

.nav-links a.active {
    color: var(--accent);
}

.nav-contact {
    font-family: var(--font-brand);
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 8px 18px;
    border-radius: var(--radius);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.25s, color 0.25s;
}

.nav-contact:hover,
.nav-contact.active {
    background: var(--accent);
    color: var(--void);
}

/* Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border: none;
    background: transparent;
    z-index: 202;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--star);
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile drawer */
.mobile-menu {
    display: flex;
    position: fixed;
    top: var(--nav-h);
    left: 12px;
    right: 12px;
    flex-direction: column;
    gap: 0;
    padding: 28px 24px 36px;
    background: rgba(6, 6, 18, 0.45);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 0 1px rgba(232, 103, 107, 0.08);
    border-radius: 0 0 16px 16px;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.3s;
}

.mobile-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.mobile-menu a {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: color 0.2s, padding-left 0.2s;
    display: block;
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-menu a:hover {
    color: var(--star);
    padding-left: 6px;
}

.mobile-menu a.mobile-contact {
    color: var(--accent);
    border-bottom: none;
    margin-top: 8px;
    text-shadow: 0 0 16px var(--accent-glow);
}

.mobile-menu a.active {
    color: var(--accent);
}

/* ─── FOOTER ──────────────────────────────────────────────────── */
footer {
    position: relative;
    z-index: 10;
    background: rgba(3, 3, 10, 0.97);
    border-top: 1px solid var(--border);
    padding: clamp(60px, 8vw, 90px) clamp(24px, var(--section-px), 80px) clamp(28px, 4vw, 44px);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: clamp(32px, 4vw, 56px);
    padding-bottom: clamp(40px, 5vw, 64px);
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}

.footer-brand-logo {
    margin-bottom: 16px;
    display: block;
}

.footer-brand-logo img {
    height: 36px;
    width: auto;
    display: block;
    filter: drop-shadow(0 0 16px rgba(232, 103, 107, 0.35));
}

.footer-brand-desc {
    font-size: 12px;
    line-height: 1.75;
    color: var(--dim);
    max-width: 240px;
}

.footer-col-heading {
    font-family: var(--font-brand);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 18px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.38);
    text-decoration: none;
    transition: color 0.2s;
    letter-spacing: 0.02em;
}

.footer-links a:hover {
    color: var(--star);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-copy {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.28);
    letter-spacing: 0.06em;
}

.footer-built {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.16);
    letter-spacing: 0.06em;
}

/* ─── SHARED PAGE LAYOUT ──────────────────────────────────────── */
.page-content {
    position: relative;
    z-index: 10;
    padding-top: var(--nav-h);
}

.page-hero {
    padding: clamp(64px, 10vh, 120px) clamp(24px, var(--section-px), 80px) clamp(48px, 6vh, 80px);
    border-bottom: 1px solid var(--border);
}

.page-eyebrow {
    font-family: var(--font-brand);
    font-size: 10px;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.page-eyebrow::before {
    content: '';
    display: block;
    width: 28px;
    height: 1px;
    background: var(--accent);
    flex-shrink: 0;
}

.page-title {
    font-family: var(--font-brand);
    font-size: clamp(32px, 5vw, 72px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    max-width: 800px;
}

.page-title em {
    font-style: normal;
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
}

.page-desc {
    font-size: clamp(13px, 1.3vw, 16px);
    color: var(--dim-hi);
    line-height: 1.75;
    max-width: 560px;
    margin-top: 20px;
}

.section-label {
    font-family: var(--font-brand);
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-label::before {
    content: '';
    display: block;
    width: 20px;
    height: 1px;
    background: var(--accent);
}

.section-heading {
    font-family: var(--font-brand);
    font-size: clamp(24px, 3.5vw, 52px);
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
}

/* Buttons */
.btn-primary {
    font-family: var(--font-brand);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 14px clamp(24px, 2.5vw, 36px);
    background: var(--accent);
    color: var(--void);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-block;
    white-space: nowrap;
}

.btn-primary:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.btn-ghost {
    font-family: var(--font-brand);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 14px clamp(24px, 2.5vw, 36px);
    background: transparent;
    color: var(--star);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
    display: inline-block;
    white-space: nowrap;
}

.btn-ghost:hover {
    border-color: var(--star);
}

/* ─── REVEAL ANIMATION ────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* ─── RESPONSIVE ──────────────────────────────────────────────── */
@media (min-width: 769px) {
    .mobile-menu {
        display: none !important;
    }
}

@media (max-width: 768px) {
    :root {
        --section-px: 5vw;
    }

    .nav-links {
        display: none;
    }

    .nav-hamburger {
        display: flex;
    }

    .mobile-menu {
        display: flex;
    }

    footer {
        padding: 56px 24px 32px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }

    .footer-grid>div:first-child {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}