:root {
    --primary: #ef4444;
    --primary-bright: #ff3333;
    --primary-glow: rgba(239, 68, 68, 0.2);
    --secondary: #94a3b8;
    --accent: #f59e0b;

    --bg-space: #02040a;
    --bg-hud: rgba(10, 15, 25, 0.7);
    --bg-hud-solid: #090d16;
    --border-hud: rgba(239, 68, 68, 0.25);
    
    --text-hud: #f8fafc;
    --text-hud-muted: #64748b;
    --text-hud-red: #f87171;

    --font-header: 'Orbitron', system-ui, -apple-system, sans-serif;
    --font-tech: 'Rajdhani', monospace, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    
    --transition-tech: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-space);
    background-image: 
        radial-gradient(at 0% 0%, rgba(15, 23, 42, 0.9) 0, transparent 60%),
        radial-gradient(at 100% 100%, rgba(20, 10, 10, 0.9) 0, transparent 60%),
        linear-gradient(rgba(2, 4, 10, 0.7), rgba(2, 4, 10, 0.95)),
        url('https://images.unsplash.com/photo-1506318137071-a8e063b4bec0?q=80&w=1920&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-hud);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Scanline HUD Overlays */
.hud-scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%);
    background-size: 100% 4px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.35;
}

.hud-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 40%, rgba(2, 4, 10, 0.9) 100%);
    z-index: 1;
    pointer-events: none;
}

.hud-content-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-space);
}
::-webkit-scrollbar-thumb {
    background: var(--border-hud);
    border: 1px solid var(--primary);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-header);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.text-gradient {
    background: linear-gradient(180deg, #ffffff 40%, #cbd5e1 60%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tech-motto {
    font-family: var(--font-header);
    font-size: 1.2rem;
    color: var(--text-hud);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--primary-glow);
    border-bottom: 1px solid var(--border-hud);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* HUD Header & Navbar */
.navbar {
    background: rgba(4, 6, 12, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-hud);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--primary-glow);
    padding: 1.25rem 0;
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    flex-direction: column;
}

.nav-brand a {
    font-family: var(--font-header);
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    text-decoration: none;
    color: #fff;
    text-shadow: 0 0 10px var(--primary-glow);
}

.brand-sub {
    font-family: var(--font-tech);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    color: var(--text-hud-muted);
}

.nav-hud-info {
    font-family: var(--font-tech);
    display: flex;
    gap: 2rem;
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.1em;
}

.hud-status-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blink-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--primary);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* HUD Panels & Brackets */
.hud-panel {
    background: var(--bg-hud);
    border: 1px solid var(--border-hud);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.5),
        inset 0 0 15px rgba(239, 68, 68, 0.05);
    padding: 2.5rem;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-tech);
}

/* Angular HUD Brackets */
.hud-panel::before, .hud-panel::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: var(--primary);
    border-style: solid;
    pointer-events: none;
}
.hud-panel::before {
    top: -1px;
    left: -1px;
    border-width: 2px 0 0 2px;
}
.hud-panel::after {
    bottom: -1px;
    right: -1px;
    border-width: 0 2px 2px 0;
}

/* Panel Header design */
.hud-panel-title-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid rgba(239, 68, 68, 0.15);
    padding-bottom: 0.75rem;
}

.hud-panel-title {
    font-size: 1.15rem;
    color: #fff;
    letter-spacing: 0.15em;
}

.hud-panel-icon {
    color: var(--primary);
    font-size: 1.1rem;
    text-shadow: 0 0 5px var(--primary);
}

/* HUD List style */
.hud-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.hud-list-item {
    font-family: var(--font-tech);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-hud);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: 0.05em;
    transition: var(--transition-tech);
}

.hud-list-item:hover {
    color: #fff;
    transform: translateX(4px);
}

.hud-marker-red {
    color: var(--primary);
    font-weight: 700;
    font-family: monospace;
}

.hud-marker-warning {
    color: var(--accent);
    font-size: 0.8rem;
}

/* Main layouts */
main {
    flex: 1;
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Hero Section */
.hero-sec {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
    min-height: 70vh;
    padding-bottom: 4rem;
}

.hero-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
}

.hero-badge-tag {
    font-family: var(--font-tech);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    border: 1px solid var(--border-hud);
    padding: 0.35rem 1rem;
    letter-spacing: 0.2em;
    background: rgba(239, 68, 68, 0.05);
}

.hero-main-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.05;
    font-weight: 900;
    text-shadow: 0 0 25px rgba(239, 68, 68, 0.15);
}

.hero-desc {
    font-size: 1.15rem;
    line-height: 1.7;
    color: #cbd5e1;
    font-weight: 300;
}

.hero-right {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.logo-container-glow {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(440px, 90vw);
    height: min(440px, 90vw);
    margin: 0 auto;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2) 0%, transparent 70%);
}

.logo-badge-img {
    max-width: 80%;
    width: 340px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 12px rgba(239, 68, 68, 0.3));
    z-index: 3;
}

/* Button systems */
.btn-hud-pulse {
    font-family: var(--font-header);
    background: linear-gradient(185deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.2) 100%);
    border: 1px solid var(--primary);
    color: #fff;
    padding: 1.15rem 2.5rem;
    font-size: 1.05rem;
    letter-spacing: 0.2em;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    transition: var(--transition-tech);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

.btn-hud-pulse:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 25px var(--primary);
    transform: translateY(-2px);
}

.btn-hud-secondary {
    font-family: var(--font-header);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--secondary);
    padding: 1.15rem 2.25rem;
    font-size: 0.95rem;
    letter-spacing: 0.15em;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition-tech);
}

.btn-hud-secondary:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

/* Admiral Directive / Quote Section */
.directive-section {
    margin-bottom: 5rem;
}

.quote-panel {
    border-left: 3px solid var(--primary);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.04) 0%, transparent 100%);
    padding: 2rem 3rem;
}

.quote-text {
    font-family: var(--font-header);
    font-size: 1.5rem;
    line-height: 1.5;
    font-style: italic;
    color: #f1f5f9;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.quote-author {
    font-family: var(--font-tech);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

/* Operations & Pillars grid */
.ops-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 5rem;
}

.pillars-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

a.pillar-hud-card {
    color: inherit;
    text-decoration: none;
}

.pillar-hud-card {
    background: rgba(11, 15, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    transition: var(--transition-tech);
    cursor: pointer;
}

.pillar-hud-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 3px;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition-tech);
}

.pillar-hud-card:hover {
    background: rgba(239, 68, 68, 0.03);
    border-color: rgba(239, 68, 68, 0.25);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.pillar-hud-card:hover::before {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.pillar-icon-box {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--secondary);
    transition: var(--transition-tech);
}

.pillar-hud-card:hover .pillar-icon-box {
    color: var(--primary);
    border-color: var(--border-hud);
    background: rgba(239, 68, 68, 0.05);
}

.pillar-info h3 {
    font-size: 1.05rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
    color: #fff;
}

.pillar-info p {
    font-family: var(--font-tech);
    font-size: 0.95rem;
    color: var(--text-hud-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Requirements & Offers Section */
.terms-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 5rem;
}

/* Call to action & Footer */
.enlist-banner {
    text-align: center;
    padding: 5rem 3rem;
    background: linear-gradient(180deg, rgba(11, 15, 26, 0.4) 0%, rgba(239, 68, 68, 0.02) 100%);
    border: 1px solid rgba(239, 68, 68, 0.15);
    margin-bottom: 4rem;
}

.banner-slogan {
    font-family: var(--font-header);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: 1.5rem;
    color: #fff;
    letter-spacing: 0.1em;
}

.banner-desc {
    font-family: var(--font-tech);
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: var(--primary);
    margin-bottom: 3rem;
    text-transform: uppercase;
    font-weight: 700;
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.hud-panel-bottom {
    background: rgba(2, 4, 10, 0.9);
    border-top: 1px solid var(--border-hud);
    padding: 2rem 0;
    font-family: var(--font-tech);
    color: var(--text-hud-muted);
    font-size: 0.9rem;
    letter-spacing: 0.15em;
}

/* Responsive grid layouts */
@media (max-width: 1024px) {
    .hero-sec {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .hero-left {
        align-items: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .ops-section {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .terms-section {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 640px) {
    .hero-actions {
        flex-direction: column;
    }
    
    .quote-panel {
        padding: 1.5rem;
    }
    
    .quote-text {
        font-size: 1.25rem;
    }
}

/* Anchor button resets and form controls */
a.btn-hud-pulse, a.btn-hud-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-align: center;
}

/* Enlist Form styling */
.hud-form-group {
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.hud-form-label {
    font-family: var(--font-tech);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.hud-form-control {
    width: 100%;
    background: rgba(4, 6, 12, 0.7);
    border: 1px solid var(--border-hud);
    color: #fff;
    padding: 0.9rem 1.25rem;
    font-family: var(--font-tech);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    border-radius: 0;
    transition: var(--transition-tech);
}

.hud-form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    background: rgba(4, 6, 12, 0.95);
}

.hud-select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23ef4444' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.hud-textarea {
    resize: vertical;
    min-height: 120px;
}

.hud-validation-message {
    font-family: var(--font-tech);
    font-size: 0.9rem;
    color: var(--primary-bright);
    margin-top: 0.35rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Intro Cutscene Styles */
.intro-cutscene-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #02040a;
    z-index: 10000;
    overflow: hidden;
    transition: opacity 0.6s ease-in-out;
}

.intro-cutscene-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.intro-formation-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -550px;
    width: 600px;
    height: 450px;
    animation: fly-up-formation 2.0s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.3s;
}

.formation-ship {
    position: absolute;
    width: 200px;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ship-lead {
    top: 0;
    left: 50%;
    transform: translateX(-50%) scale(1.25);
    z-index: 5;
}

.ship-left {
    top: 140px;
    left: 30px;
    transform: scale(0.95);
    z-index: 4;
}

.ship-right {
    top: 140px;
    right: 30px;
    transform: scale(0.95);
    z-index: 4;
}

.intro-ship-img {
    width: 160px;
    height: auto;
    transform: rotate(90deg); /* Rotate nose upward */
    z-index: 2;
    filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.2));
}

/* Glowing red engine trails */
.thruster-trail {
    position: absolute;
    width: 3px;
    height: 350px;
    background: linear-gradient(to top, rgba(239, 68, 68, 0) 0%, rgba(239, 68, 68, 0.6) 50%, #ff3333 100%);
    box-shadow: 0 0 8px #ef4444, 0 0 15px #ef4444;
    z-index: 1;
    opacity: 0.9;
    top: 105px; /* Position trailing lines closer behind thrusters */
}

.trail-left {
    left: 32%;
}

.trail-right {
    right: 32%;
}

.trail-center {
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 280px;
    opacity: 0.7;
}

@keyframes fly-up-formation {
    0% {
        bottom: -550px;
    }
    100% {
        bottom: 120vh;
    }
}

/* Delayed logo reveal and holographic boot */
.logo-badge-img-fade {
    opacity: 0;
    animation: logo-reveal-fade 1.6s ease-out forwards;
    animation-delay: 1.9s;
}

@keyframes logo-reveal-fade {
    from {
        opacity: 0;
        transform: scale(0.9);
        filter: drop-shadow(0 0 0 rgba(239, 68, 68, 0));
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 25px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 12px rgba(239, 68, 68, 0.35));
    }
}

/* Hero Left slide-in transition */
.hero-left-fade {
    opacity: 0;
    transform: translateX(-35px);
    animation: hero-left-boot 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 2.0s;
}

@keyframes hero-left-boot {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* HUD Target rings and brackets */
.hud-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(239, 68, 68, 0.2);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
}

.ring-outer {
    width: 95%;
    height: 95%;
    border-style: dashed;
    animation: hud-ring-reveal 1.5s ease-out forwards, rotate-clockwise 40s linear infinite;
    animation-delay: 1.8s, 3.0s;
}

.ring-inner {
    width: 80%;
    height: 80%;
    border: 1.5px double var(--border-hud);
    box-shadow: inset 0 0 15px rgba(239, 68, 68, 0.08);
    animation: hud-ring-reveal 1.5s ease-out forwards, rotate-counter-clockwise 30s linear infinite;
    animation-delay: 1.8s, 3.0s;
}

@keyframes hud-ring-reveal {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 0.7;
        transform: scale(1);
    }
}

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

@keyframes rotate-counter-clockwise {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

/* Custom Searchable Dropdown */
.hud-select-wrapper {
    position: relative;
    width: 100%;
}

.hud-select-search-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23ef4444' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem !important;
}

.hud-select-search-input:focus-visible,
.hud-select-search-input:focus {
    cursor: text;
    background-image: none !important; /* remove arrow when searching */
}

.hud-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: var(--bg-hud-solid);
    border: 1px solid var(--primary);
    box-shadow: 0 5px 25px var(--primary-glow);
    z-index: 1000;
    margin-top: 2px;
    display: none;
    font-family: var(--font-tech);
}

.hud-select-dropdown.open {
    display: block;
}

.hud-select-option {
    padding: 0.6rem 1.25rem;
    color: var(--text-hud);
    cursor: pointer;
    transition: var(--transition-tech);
    border-bottom: 1px solid rgba(239, 68, 68, 0.05);
    font-size: 1rem;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.hud-select-option:last-child {
    border-bottom: none;
}

.hud-select-option:hover,
.hud-select-option.highlighted {
    background: rgba(239, 68, 68, 0.15);
    color: #fff;
    border-left: 3px solid var(--primary);
    padding-left: calc(1.25rem - 3px);
}

.hud-select-option.selected {
    background: rgba(239, 68, 68, 0.25);
    color: var(--primary-bright);
    border-left: 3px solid var(--primary-bright);
    padding-left: calc(1.25rem - 3px);
}

.hud-select-no-results {
    padding: 0.6rem 1.25rem;
    color: var(--text-hud-muted);
    font-style: italic;
    font-size: 0.95rem;
    text-align: center;
}
