/* ═══════════════════════════════════════════
   GLOBAL STYLES — Donilon Strategic Interface
   ═══════════════════════════════════════════ */

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

:root {
    --black: #0a0a0f;
    --charcoal: #141420;
    --dark-gray: #1a1a2e;
    --mid-gray: #2a2a3e;
    --light-gray: #8a8a9e;
    --steel-blue: #4a7fff;
    --ice-blue: #6ba3ff;
    --muted-gold: #c5a55a;
    --gold-light: #dfc07a;
    --white: #e8e8f0;
    --pure-white: #ffffff;
    --red-accent: #ff4444;
    --red-muted: #cc3333;
    --font-primary: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --nav-height: 72px;
}

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

body {
    font-family: var(--font-body);
    background: var(--black);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* ─── PASSWORD GATE ─── */
#access-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#access-gate.unlocked {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.gate-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(74,127,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74,127,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.gate-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(74,127,255,0.015) 2px,
        rgba(74,127,255,0.015) 4px
    );
    pointer-events: none;
}

.gate-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
}

.gate-classification {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: var(--steel-blue);
    opacity: 0.6;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.gate-logo {
    margin: 0 auto 1.5rem;
    width: 60px;
    height: 60px;
    animation: logoSpin 20s linear infinite;
}

@keyframes logoSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.gate-emblem {
    width: 100%;
    height: 100%;
}

.gate-title {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--white);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.gate-subtitle {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--light-gray);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 3rem;
}

.gate-input-area {
    margin-bottom: 3rem;
}

.gate-input-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    color: var(--steel-blue);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.gate-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid rgba(74,127,255,0.2);
    background: rgba(74,127,255,0.03);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.gate-input-wrapper:focus-within {
    border-color: var(--steel-blue);
    box-shadow: 0 0 20px rgba(74,127,255,0.1);
}

#gate-password {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.2rem;
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.15em;
    outline: none;
}

#gate-password::placeholder {
    color: rgba(138,138,158,0.4);
}

#gate-submit {
    background: transparent;
    border: none;
    border-left: 1px solid rgba(74,127,255,0.2);
    padding: 1rem 1.2rem;
    color: var(--steel-blue);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

#gate-submit:hover {
    background: rgba(74,127,255,0.1);
    color: var(--ice-blue);
}

#gate-submit svg {
    width: 18px;
    height: 18px;
}

.gate-error {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--red-accent);
    margin-top: 0.75rem;
    min-height: 1.2em;
    letter-spacing: 0.1em;
}

.gate-hint {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--light-gray);
    opacity: 0.4;
    margin-top: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.gate-data-stream {
    text-align: left;
    max-width: 350px;
    margin: 0 auto;
}

.data-line {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--steel-blue);
    opacity: 0;
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
    animation: dataFade 3s ease-in-out infinite;
}

.data-line:nth-child(1) { animation-delay: 0s; }
.data-line:nth-child(2) { animation-delay: 0.8s; }
.data-line:nth-child(3) { animation-delay: 1.6s; }
.data-line:nth-child(4) { animation-delay: 2.4s; }

@keyframes dataFade {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 0.4; }
}

/* Access Granted */
.access-granted {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
    opacity: 0;
    visibility: hidden;
    z-index: 3;
    transition: opacity 0.5s ease;
}

.access-granted.active {
    opacity: 1;
    visibility: visible;
}

.granted-content {
    text-align: center;
}

.granted-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.granted-circle {
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    animation: drawCircle 0.6s ease forwards;
}

.granted-check {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.4s ease 0.5s forwards;
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.granted-text {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    color: var(--steel-blue);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.granted-sub {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--light-gray);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* ─── NAVIGATION ─── */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(74,127,255,0.08);
    transition: transform 0.3s ease;
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-logo-text {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--white);
    white-space: nowrap;
}

.nav-logo-dot {
    width: 6px;
    height: 6px;
    background: var(--steel-blue);
    border-radius: 50%;
}

.nav-links {
    display: flex;
    gap: 0.2rem;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.5rem 0.9rem;
    color: var(--light-gray);
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: var(--steel-blue);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 22px;
    height: 1.5px;
    background: var(--white);
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav */
.mobile-nav {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10,10,15,0.97);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.mobile-link {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--light-gray);
    transition: color 0.3s ease;
    text-transform: uppercase;
}

.mobile-link:hover,
.mobile-link.active {
    color: var(--white);
}

/* ─── SECTION UTILITIES ─── */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-header {
    margin-bottom: 3rem;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--steel-blue);
    display: block;
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: var(--font-primary);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--white);
    line-height: 1.2;
}

/* ─── FOOTER ─── */
.site-footer {
    background: var(--charcoal);
    border-top: 1px solid rgba(74,127,255,0.08);
    padding: 3rem 0 1.5rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-top {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(74,127,255,0.06);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-logo {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--white);
}

.footer-brand p {
    font-size: 0.8rem;
    color: var(--light-gray);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    justify-content: center;
    align-items: start;
}

.footer-nav a {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--light-gray);
    transition: color 0.3s ease;
}

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

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

.footer-social a {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-gray);
    transition: color 0.3s ease;
}

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

.footer-social svg {
    width: 16px;
    height: 16px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-contact {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--light-gray);
    letter-spacing: 0.05em;
}

.footer-contact a {
    color: var(--light-gray);
    transition: color 0.3s ease;
}

.footer-contact a:hover {
    color: var(--steel-blue);
}

.footer-credit {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--light-gray);
    letter-spacing: 0.05em;
}

.footer-credit a {
    color: var(--muted-gold);
    transition: color 0.3s ease;
}

.footer-credit a:hover {
    color: var(--gold-light);
}

/* ─── ANIMATIONS ─── */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── HIDDEN ─── */
.hidden {
    display: none !important;
}

/* ─── PAGE HEADER (for inner pages) ─── */
.page-header {
    padding: calc(var(--nav-height) + 4rem) 0 3rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(74,127,255,0.05) 0%, transparent 60%);
    pointer-events: none;
}

.page-header .section-container {
    position: relative;
    z-index: 1;
}

.page-header-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(74,127,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74,127,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }
    .nav-toggle {
        display: flex;
    }
    .footer-top {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-social {
        justify-content: center;
    }
    .footer-nav {
        justify-content: center;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .section-container {
        padding: 0 1.25rem;
    }
    .nav-inner {
        padding: 0 1.25rem;
    }
    :root {
        --nav-height: 60px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}
