:root {
    /* Refined Quantum Gold Palette */
    --golden: #FFD700;           /* More amber, less "banana" yellow */
    --golden-dark: #C5A000;
    --golden-glow: rgba(255, 215, 0, 0.15);
    --golden-special: #FCD667;
    
    /* Deep Tech Neutrals */
    --jet: #1A1A1A;              /* Deep Navy-Grey for card headers */
    --floor-color: #0D0D0D;      /* Very deep blue-black for high-end feel */
    --surface-light: #242424;    /* Card bodies */
    --text: #E5E5E5;             /* Crisp white text */
    --text-muted: #888888;       /* Slate grey for descriptions */
    --the-black: #080808;

    --selection: rgba(255, 184, 0, 0.2);
    --input-bg: #1A1A1A;
    --button: #D97706;
    --button-active: #FFB800;
    --focus-golden: rgba(255, 215, 0, 0.5);
}

@font-face {
    font-family: "QuantumCortex";
    src: url("fonts/PTSerif-Regular.ttf") format('truetype');
    font-weight: normal;
}

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

body {
    margin: 0;
    padding: 0;
    background-color: var(--floor-color);
    color: var(--text);
    font-family: 'QuantumCortex', serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}


body {
    --sans: 'Inter', system-ui, -apple-system, sans-serif;
    --serif: 'QuantumCortex', serif;
}

nav ul li a {
    font-family: var(--sans); /* Clean and techy */
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.9rem;
}

h1, h2, h3 {
    font-family: var(--serif); /* High-end and established */
}

/* Video Background Overlay */
video {
    object-fit: cover;
    width: 100%;
    height: 100vh;
    z-index: -2;
    position: absolute;
    top: 0;
    filter: brightness(0.4); /* Darkens video so text is readable */
}

header {
    height: 100vh;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

header h1 {
    font-size: clamp(36px, 8vw, 64px);
    color: var(--text);
    margin: 0;
    letter-spacing: -1px;
}

.read-the-docs {
    color: var(--golden);
    font-style: italic;
    font-size: 1.2rem;
}

nav {
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    /*background-color: rgba(2, 6, 23, 0.8);*/
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav ul {
    display: inline-flex;
    list-style: none;
    justify-content: center;
    gap: 2rem;
    width: 100%;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14pt;
    font-weight: 500;
    transition: 0.3s;
}

nav ul li a:hover, nav ul .active a {
    color: var(--golden);
}

nav ul .active a {
    border-bottom: 2px solid var(--golden);
    padding-bottom: 5px;
}

@media only screen AND (max-width: 700px) {
    ul li a {
        font-size: 12pt;
    }
}

#quantum-cortex {
    visibility: visible;
    opacity: 0;
    transition: opacity 0.4s ease;
    margin: 0;
    margin-left: 1rem;
    color: var(--golden);
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
}

@media only screen AND (max-width: 850px) {
    nav p {
        display: none;
    }
}

/* Sections */
section {
    padding: 100px 5%;
    min-height: auto;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text);
    text-align: center;
}

/* Cards - The "Corrected" Look */
.cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--surface-light);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-head img {
    margin-top: 1rem;
    max-width: 100%;
    max-height: 100px;     /* Limits image height so it doesn't push the card title */
    object-fit: contain;   /* Ensures image stays within bounds without stretching */
    margin-bottom: 0.5rem;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: var(--golden-dark);
}

.card-head {
    background-color: var(--jet);
    padding: 1.5rem;
    height: 180px;         /* Fixed height for all headers */
    display: flex;         /* Use flexbox to center content */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;      /* Prevents oversized images from leaking out */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-head i {
    color: var(--golden);
    font-size: 6rem;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.card-title {
    color: var(--golden);
    margin-top: 1rem;
    font-size: 20px;
    white-space: nowrap;
}

.card-text {
    padding: 2rem;
    color: var(--text-muted);
    font-size: 1rem;
    text-align: left;
}

/* About Section */
.about-text {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    color: var(--text-muted);
    text-align: center;
    font-size: 1.1rem;
}

/* Forms - Gold Glow */
form { max-width: 600px; margin: 0 auto; }

input, textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid #333;
    color: var(--text);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

textarea:focus, input:focus {
    outline: none;
    border-color: var(--golden);
    box-shadow: 0 0 15px var(--golden-glow);
}

input[type=submit] {
    background-color: var(--golden);
    color: var(--floor-color);
    font-weight: bold;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: 0.3s;
}

input[type=submit]:hover {
    background-color: var(--golden-special);
    transform: scale(1.02);
}

footer {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: var(--the-black);
}

.logo-img {
    height: 10em;
    padding: 1.1em;
}

.logo {
    height: 10em;
    will-change: filter;
    transition: filter 300ms;
}

#navbar {
    background-color: transparent;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background-color: var(--the-black); /* Your #0D0D0D color */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

#navbar.scrolled #quantum-cortex {
    opacity: 1;
}

/* 1. Hide Toggle on Desktop */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--golden);
    font-size: 1.5rem;
    cursor: pointer;
}

/* 2. Mobile Styles (Under 850px) */
@media only screen and (max-width: 850px) {
    .mobile-menu-toggle {
        display: block; /* Show hamburger only on mobile */
    }

    .nav-menu {
        display: none; /* Hide links by default */
        flex-direction: column;
        position: absolute;
        top: 100%; /* Sits right below the navbar */
        left: 0;
        width: 100%;
        background-color: var(--the-black);
        padding: 1rem 0;
        border-bottom: 2px solid var(--golden-dark);
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }

    /* When menu is toggled open */
    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        margin: 1rem 0;
        text-align: center;
    }
}