/* =========================
   Custom Font Declaration
========================= */
@font-face {
  font-family: 'CustomMono'; /* Give your font a name */
  src: url('assets/fonts/UAV-OSD-Sans-Mono.ttf') format('ttf'); /* Path to your font file */
  /* You can add more formats for older browsers if needed, e.g., woff, ttf */
  font-weight: normal;
  font-style: normal;
}

/* =========================
   Global Styles & Variables
========================= */
:root {
    --accent-color: #29eaff; /* Initial accent color (top of page) */
    --text-color: #fafae5;
    --text-color-muted: #fafae580;
    --bg-color: #000;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'CustomMono', monospace;
    margin: 0;
    overflow-x: hidden;
}

.hidden {
    display: none;
}

/* =========================
   Boot Sequence Styles
========================= */
#boot-sequence {
    position: fixed;
    inset: 0;
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: opacity 0.5s ease-out;
}

#boot-sequence.finished {
    opacity: 0;
    pointer-events: none; /* Allows clicking through it during fade-out */
}

/* Shared style for all scramble text elements */
.scramble-text,
.scramble-on-scroll {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    filter: drop-shadow(0 0 4px var(--accent-color));
    color: var(--accent-color);
}



/* =========================
   Header HUD
========================= */
#hud-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    border-bottom: 1px solid rgba(70, 232, 58, 0.25);
    z-index: 50;
    font-size: 10px;
    letter-spacing: 0.18em;
    overflow: hidden;
    height: 48px;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#hud-header:hover {
    height: 60px;
}

/* Target scramble text ONLY inside the header's center and diagnostics divs */
.header-center .scramble-text,
.diagnostics-content .scramble-text {
    font-size: 9px;
    letter-spacing: 0.18em;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 48px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-indicator {
    width: 8px;
    height: 8px;
    border-radius: 2px; /* A squircle */
    background-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
    animation: pulse 2s infinite;
}

.live-text {
    color: var(--accent-color);
}

.os-text {
    color: var(--text-color-muted);
}

.header-center {
    flex-grow: 1;
    text-align: center;
    color: var(--text-color);
}

.status-orb {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(70, 232, 58, 0.38);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 6px var(--accent-color);
    animation: rotate 8s linear infinite;
}

.status-orb-inner {
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

.diagnostics-content {
    text-align: center;
    padding-bottom: 4px;
    /* This text will be a different color */
    --accent-color: #29eaff; 
}

/* Keyframe Animations */
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =========================
   Neuron Background Styles
========================= */
#neuron-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

/* =========================
   Main Content & Hero
========================= */
.h-screen { height: 100vh; }
.relative { position: relative; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.z-30 { z-index: 30; }
.overflow-hidden { overflow: hidden; }

.hero-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
}

.data-feed {
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    max-width: 384px;
    border: 1px solid rgba(70, 232, 58, 0.18);
}

/* =========================
   Parallax Dot Fields
========================= */
.parallax-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 15;
    will-change: transform; /* Performance hint for the browser */
}

.dot-field {
    background-image: radial-gradient(circle, var(--accent-color) 2px, transparent 2px);
}

.layer-1 {
    opacity: 0.22;
    background-size: 40px 40px;
}
.layer-2 {
    opacity: 0.18;
    background-size: 60px 60px;
}
.layer-3 {
    opacity: 0.15;
    background-size: 80px 80px;
}

/* =========================
   Floating Numbers Field
========================= */
#floating-numbers-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
}

.number-cluster {
    position: absolute;
    font-family: 'CustomMono', monospace;
    color: var(--text-color-muted);
    font-size: 9px;
    /* The original had a slight blur and glow */
    filter: drop-shadow(0 0 8px var(--accent-color)) blur(1.5px);
    will-change: transform, opacity; /* Performance hint */
}

.number-cluster-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.number-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.number-symbol {
    display: flex;
    gap: 2px;
}

.symbol-pip {
    width: 3px;
    height: 3px;
    background-color: var(--accent-color);
}


/* =========================
   Content Sections & Grid
========================= */
.content-section {
    position: relative;
    z-index: 30;
    padding: 12rem 0;
    display: flex;
    justify-content: center;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem; /* 80px */
}

.section-header h2 {
    font-size: 1.25rem; /* text-xl */
}

.grid-container {
    width: 100%;
    max-width: 1152px; /* max-w-6xl */
    padding: 0 32px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

/* Responsive Grid for smaller screens */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Wrapper for the card links to remove default styling */
.card-link-wrapper {
    color: inherit;
    text-decoration: none;
    display: block; /* Ensures the link takes up the full space of the card */
    transition: transform 0.2s ease-out;
}

.card-link-wrapper:hover {
    transform: translateY(-5px); /* Add a subtle lift effect on hover */
}

/* =========================
   Framed Image Cards
========================= */
.framed-card {
    position: relative;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(70, 232, 58, 0.18);
}

.framed-card::before, .framed-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}
/* Inner border effects */
.framed-card::before {
    inset: 7px;
    border: 1px solid rgba(70, 232, 58, 0.31);
}
.framed-card::after {
    border: 1px solid rgba(255, 255, 255, 0.1);
    mix-blend-mode: lighten;
}

/* The corner brackets effect (Corrected) */
.corner-frame::before, .corner-frame::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: var(--accent-color);
    border-style: solid;
    box-shadow: 0 0 8px var(--accent-color);
}
/* Top-Left corner */
.corner-frame::before { top: 0; left: 0; border-width: 1px 0 0 1px; } 
/* Top-Right corner */
.corner-frame::after { top: 0; right: 0; border-width: 1px 1px 0 0; }

/* We need a separate element for the bottom corners because of stacking context */
.framed-card .card-content::before, .framed-card .card-content::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: var(--accent-color);
    border-style: solid;
    box-shadow: 0 0 8px var(--accent-color);
    z-index: 5; /* Ensure they draw over the image */
}
/* Bottom-Left corner */
.framed-card .card-content::before { bottom: 0; left: 0; border-width: 0 0 1px 1px; } 
/* Bottom-Right corner */
.framed-card .card-content::after { bottom: 0; right: 0; border-width: 0 1px 1px 0; }


.framed-card img {
    width: 100%;
    height: 192px; /* h-48 */
    object-fit: cover;
    opacity: 0.85;
    transition: transform 0.7s ease-out;
}

.framed-card:hover img {
    transform: scale(1.05);
}

.card-content {
    position: relative;
    z-index: 10;
    padding: 24px;
    text-align: center; /* This will center the h3 and p */
}

.card-content h3 {
    font-size: 1.125rem; /* text-lg */
    text-transform: uppercase;
    margin: 0 0 8px 0;
}

.card-content p {
    font-size: 0.875rem; /* text-sm */
    color: var(--text-color-muted);
    margin: 0;
    /* We need to override the global scramble style for this element */
    letter-spacing: normal;
    text-transform: none;
}

/* =========================
   Video Scape Section
========================= */
#video-scape-section {
    position: relative;
    height: 250vh; /* Creates the scrollable area for the parallax effect */
    margin: 15rem 0; /* Adds space before and after the section */
    overflow: hidden; /* Ensures sticky content doesn't overflow */
}

.scape-background-img {
    position: sticky;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    opacity: 0.5;
}

#scape-bg-1 {
    z-index: 1; /* Sits on top of the second image */
}

#scape-bg-2 {
    z-index: 0; /* Sits below the first image */
    margin-top: -100vh; /* Pulls it up to occupy the same space */
}

.video-panel {
    position: absolute;
    width: 360px;
    height: 203px;
    z-index: 5; /* Sit above the background images */
    will-change: transform; /* Performance hint for the browser */
}

/* Specific positions for each panel within the 250vh container */
#video-panel-1 {
    top: 20%; /* 20% down from the top of the 250vh container */
    left: 15%;
}

#video-panel-2 {
    top: 55%;
    right: 18%;
}

#video-panel-3 {
    top: 80%;
    left: 30%;
}

.video-panel video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1; /* Override default image opacity in cards */
}


/* =========================
   Footer
========================= */
#page-footer {
    position: relative;
    z-index: 30;
    padding: 8rem 0;
    margin-top: 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #020202;
    border-top: 1px solid rgba(70, 232, 58, 0.18);
}

.footer-line {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-color-muted);
    letter-spacing: 0.25em;
}

/* =========================
   Responsive Adjustments
========================= */

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .video-panel {
        width: 280px;
        height: 158px;
    }
    #video-panel-1 { left: 5%; }
    #video-panel-2 { right: 5%; }
    #video-panel-3 { left: 10%; top: 85%; }

    #video-scape-section {
        height: 200vh; /* Shorter scroll distance on mobile */
        margin: 8rem 0;
    }
}