/* THE CORTEX INSTITUTE | DESIGN SYSTEM v2.0
   Style: Organic Brutalism / Nano Banana / High-Stakes Zen
*/

:root {
    /* Palette */
    --bg-void: #050505;
    /* Deeper void */
    --bg-concrete: #121212;
    --bg-glass: rgba(20, 20, 20, 0.6);

    --text-primary: #ededed;
    --text-secondary: #888888;
    --text-muted: #444444;

    --accent-gold: #D4AF37;
    --accent-glow: rgba(212, 175, 55, 0.3);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.2);

    /* Typography */
    --font-heading: 'Helvetica Neue', 'Arial', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Rhythm */
    --max-width: 1400px;
    /* Wider canvas */
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-body);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* TYPOGRAPHY */
h1,
h2,
h3,
h4,
.brand {
    font-family: var(--font-heading);
    font-weight: 300;
    margin: 0;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(3rem, 5vw, 6rem);
    /* Responsive scaling */
    letter-spacing: -0.02em;
    line-height: 0.95;
    margin-bottom: 1.5rem;
}

h1 span {
    font-weight: 600;
    color: var(--text-primary);
    /* Keep it monolithic white or gold */
}

h2 {
    font-size: clamp(2rem, 3vw, 3.5rem);
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent-gold);
}

p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 65ch;
    margin-bottom: 1.5rem;
}

/* UTILITIES */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 8rem 0;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

/* GLASSMORPHISM */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-top: 1px solid var(--border-highlight);
    /* Light source top */
}

/* LAYOUT GRIDS */

/* LAYOUT GRIDS */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
    max-width: 100%;
    /* Prevent blowout */
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 100%;
}

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


/* NAVIGATION */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-subtle);
    max-width: 100%;
}

.brand {
    font-size: 1.25rem;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
}

.brand span {
    color: var(--accent-gold);
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

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

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 1px solid var(--border-highlight);
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
}

.btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.btn:hover {
    color: var(--bg-void);
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* HERO */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/03_aerial_drone_twilight.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallax */
    z-index: -1;
    filter: brightness(0.4) contrast(1.1);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, var(--bg-void), transparent);
}

.hero-content {
    max-width: 900px;
    z-index: 1;
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s;
}

.hero-tagline {
    display: block;
    color: var(--accent-gold);
    font-size: 0.9rem;
    letter-spacing: 0.4em;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

/* FEATURES */
.feature-card {
    background: var(--bg-concrete);
    border: 1px solid var(--border-subtle);
    padding: 3rem;
    transition: all 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-gold);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--accent-gold);
    line-height: 1;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.feature-card h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

/* TRUST BADGES */
.trust-badges {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
    opacity: 0.7;
}

.badge {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
    overflow: hidden;
    transition: all 0.3s ease;
}

.badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: skewX(-25deg);
    animation: shine 8s infinite;
}

.badge:hover {
    border-color: var(--accent-gold);
    color: var(--text-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

@keyframes shine {
    0% {
        left: -100%;
    }

    10% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

/* FOOTER */
footer {
    padding: 6rem 0;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    opacity: 0.5;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

/* ANIMATIONS */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .nav {
        padding: 0 1rem;
    }

    .nav-links {
        display: none;
    }

    /* Simplified for now */
    h1 {
        font-size: 3rem;
    }

    .section {
        padding: 4rem 0;
    }
}

/* MASONRY GALLERY (Moved from facility.html) */
.masonry-grid {
    column-count: 2;
    column-gap: 2rem;
}

@media (min-width: 1000px) {
    .masonry-grid {
        column-count: 3;
    }
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 2rem;
    position: relative;
    background: var(--bg-concrete);
    border: 1px solid var(--border-subtle);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    animation: fadeUp 0.8s forwards;
    animation-delay: calc(var(--i, 0) * 0.1s);
    overflow: hidden;
}

.gallery-item:hover {
    border-color: var(--accent-gold);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.gallery-item img {
    width: 100%;
    display: block;
    border-bottom: 1px solid var(--border-subtle);
    filter: grayscale(20%) contrast(0.9);
    transition: filter 0.5s ease, transform 0.8s ease;
}

.gallery-item:hover img {
    filter: grayscale(0%) contrast(1.05);
    transform: scale(1.03);
}

.caption {
    padding: 1.5rem;
    background: rgba(18, 18, 18, 0.95);
    border-top: 1px solid var(--border-subtle);
}

.caption h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
    font-weight: 400;
}

.caption span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 0.5rem;
}

/* UTILITIES Refined */
.mt-3 {
    margin-top: 3rem;
}

.pad-2 {
    padding: 2rem;
}

.rounded {
    border-radius: 4px;
}

.img-contrast {
    width: 100%;
    display: block;
    filter: contrast(1.1);
}

.caption-text {
    padding-top: 1rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* MEGA FOOTER */
.mega-footer {
    background: var(--bg-void);
    border-top: 1px solid var(--border-subtle);
    padding: 6rem 0 4rem;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-col h5 {
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
}

.footer-col a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.8rem;
    transition: color 0.2s;
}

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

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

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

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

/* MEGA HEADER / DROPDOWNS */
.nav {
    overflow: visible !important;
    /* Allow dropdowns to spill out */
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    height: 100%;
}

.nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-item>a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

.nav-item>a:hover,
.nav-item>a.active {
    color: var(--text-primary);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-concrete);
    border: 1px solid var(--border-subtle);
    min-width: 220px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    border-radius: 4px;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-gold);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}