/* --- MISSION SECTION: SCOPED VARIABLES --- */
.msn-section {
    /* Using color-mix to derive from your global --bg, --text, --brand */
    --msn-bg: var(--bg, #000);
    --msn-surface: color-mix(in srgb, var(--elev-1, #111) 60%, transparent);
    --msn-border: color-mix(in srgb, var(--text, #fff) 8%, transparent);
    --msn-border-highlight: color-mix(in srgb, var(--text, #fff) 15%, transparent);
    --msn-txt-main: var(--text, #fff);
    --msn-txt-mute: color-mix(in srgb, var(--text, #fff) 50%, transparent);
    --msn-accent: var(--brand, #3b82f6);
    --msn-accent-glow: color-mix(in srgb, var(--brand, #3b82f6) 40%, transparent);
    
    --easing: cubic-bezier(0.16, 1, 0.3, 1); /* Apple-style ease */
    
    position: relative;
    padding: clamp(6rem, 12vh, 10rem) 1.5rem;
    background: var(--msn-bg);
    overflow: hidden;
    color: var(--msn-txt-main);
}

/* --- AMBIENT ATMOSPHERE --- */
.msn-ambient-light {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 80%; height: 600px;
    background: radial-gradient(ellipse at center, var(--msn-accent-glow) 0%, transparent 60%);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
}

/* .msn-noise-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    z-index: 0;
    pointer-events: none;
} */

.msn-container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- TYPOGRAPHY --- */
.msn-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 5rem;
}

.msn-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--msn-accent);
    margin-bottom: 1.5rem;
}

.msn-pulse-dot {
    width: 6px; height: 6px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
    animation: msnPulse 2s infinite;
}

.msn-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.msn-gradient-text {
    background: linear-gradient(135deg, var(--msn-txt-main) 30%, var(--msn-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.msn-subtitle {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--msn-txt-mute);
}

/* --- THE GRID --- */
.msn-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 900px) {
    .msn-grid {
        grid-template-columns: 1fr 340px 1fr;
        grid-template-rows: repeat(2, 1fr);
        /* Layout Logic:
           [Card 1] [Center] [Card 3]
           [Card 2] [Center] [Card 4]
        */
    }
    .msn-center-node {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

/* --- CARDS (Apple Style) --- */
.msn-card {
    position: relative;
    background: var(--msn-surface);
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.4s var(--easing);
    
    /* The subtle border */
    box-shadow: inset 0 0 0 1px var(--msn-border);
}

.msn-card:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 0 0 1px var(--msn-border-highlight), 
                0 20px 40px -10px rgba(0,0,0,0.3);
}

/* Hover Spotlight Effect (via CSS radial gradient or JS) */
.msn-card-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.03), transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.msn-card:hover .msn-card-bg { opacity: 1; }

.msn-icon-box {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--msn-txt-main) 5%, transparent);
    display: flex; align-items: center; justify-content: center;
    color: var(--msn-txt-main);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.msn-card:hover .msn-icon-box {
    background: var(--msn-accent);
    color: #fff; /* Force white on accent */
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--msn-accent-glow);
}

.msn-card-txt h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.msn-card-txt p {
    font-size: 0.95rem;
    color: var(--msn-txt-mute);
    line-height: 1.5;
}





/* --- CENTER NODE VISUAL CENTRAL--- */
/* --- CENTER NODE: NEURAL CORE --- */
.msn-center-node {
    /* Local Variables */
    --node-size: 160px;
    --core-size: 70px;
    --node-color: var(--brand, #06b6d4);
    --node-glow: rgba(6, 182, 212, 0.4);
    
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    
    /* Card Glass Base */
    background: radial-gradient(circle at center, rgba(6,182,212,0.08) 0%, rgba(255,255,255,0.02) 60%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 32px;
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Background Ambient Flare */
.node-flare {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200%; height: 200%;
    background: radial-gradient(circle, var(--node-glow) 0%, transparent 60%);
    opacity: 0.1;
    pointer-events: none;
    animation: breathe 6s ease-in-out infinite;
}

/* --- THE NUCLEUS (Visual Container) --- */
.nucleus-wrapper {
    position: relative;
    width: var(--node-size);
    height: var(--node-size);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

/* 1. Orbit Rings */
.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--node-color);
    opacity: 0.3;
}

.outer-dashed {
    width: 100%; height: 100%;
    border-style: dashed;
    border-width: 1px;
    animation: spin 20s linear infinite;
}

.inner-solid {
    width: 75%; height: 75%;
    border: 1px solid rgba(255,255,255,0.1);
    border-top-color: var(--node-color);
    border-bottom-color: var(--node-color);
    animation: spinRev 12s linear infinite;
}

/* 2. Radar Sweep */
.radar-sweep {
    position: absolute;
    width: 90%; height: 90%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 70%, var(--node-glow));
    mask-image: radial-gradient(circle, transparent 55%, black 60%);
    -webkit-mask-image: radial-gradient(circle, transparent 55%, black 60%);
    animation: spin 4s linear infinite;
    opacity: 0.5;
}

/* 3. The 3D Core */
.core-module {
    position: relative;
    width: var(--core-size);
    height: var(--core-size);
    border-radius: 50%;
    
    /* 3D Sphere Gradient */
    background: radial-gradient(circle at 30% 30%, 
        var(--node-color) 0%, 
        #0e3c4a 100%);
    
    /* Glows */
    box-shadow: 
        0 0 30px var(--node-glow),
        inset 0 2px 5px rgba(255,255,255,0.4); /* Top rim light */
        
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    color: #fff;
}

/* Glossy Lens Reflection */
.core-glass-reflection {
    position: absolute;
    top: 5px; left: 10px;
    width: 40%; height: 20%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
    filter: blur(2px);
    pointer-events: none;
}

.core-icon svg {
    width: 32px; height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    animation: iconPulse 4s ease-in-out infinite;
}

/* 4. Satellites (Orbiting Dots) */
.satellite {
    position: absolute;
    top: 50%; left: 50%;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px #fff;
}

.sat-1 {
    margin-left: -3px; margin-top: -3px;
    animation: orbit1 8s linear infinite;
}
.sat-2 {
    margin-left: -2px; margin-top: -2px;
    width: 4px; height: 4px;
    background: var(--node-color);
    animation: orbit2 12s linear infinite reverse;
}

/* --- STATUS HUD --- */
/* --- Apple-Style Status Pill --- */

.apple-status-pill {
  /* Variables for easy theming */
  --pill-bg: rgba(20, 30, 40, 0.4); /* Dark transparency */
  --pill-border: rgba(255, 255, 255, 0.1);
  --pill-border-top: rgba(255, 255, 255, 0.15); /* Top light source */
  --pill-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);
  
  --success-color: #32d74b; /* Apple Human Interface Green */
  --text-primary: #ffffff;
  --text-secondary: rgba(235, 235, 245, 0.6); /* SF Grey */

  /* Layout & Box Model */
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px 10px 14px; /* Slight asymmetry for optical balance */
  border-radius: 999px; /* Full capsule shape */
  
  /* Material / Glassmorphism */
  background: var(--pill-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  
  /* Delicate Borders (Inner light logic) */
  border: 1px solid var(--pill-border);
  border-top-color: var(--pill-border-top);
  box-shadow: var(--pill-shadow);
  
  /* Interaction Props */
  cursor: default;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
}

/* Micro-interaction: Hover State */
.apple-status-pill:hover {
  background: rgba(40, 50, 60, 0.5);
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

/* --- Typography --- */
.status-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
}

.status-label {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em; /* Elegant spacing */
  color: var(--text-secondary);
}

.status-value {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 600; /* Semibold */
  color: var(--text-primary);
  letter-spacing: -0.01em; /* Tight tracking for modern feel */
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- The Living Signal (Animation) --- */
.signal-badge {
  position: relative;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The expanding wave */
.signal-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid var(--success-color);
  opacity: 0;
  z-index: 1;
  animation: radarPing 3s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* --- Keyframes --- */

/* Core breathing (Subtle glow intensity change) */
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px rgba(50, 215, 75, 0.4); }
  50% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 4px rgba(50, 215, 75, 0.2); }
}

/* Radar Wave (Physics-based expansion) */
@keyframes radarPing {
  0% {
    width: 8px;
    height: 8px;
    opacity: 0.8;
    border-width: 2px;
  }
  60% {
    opacity: 0;
  }
  100% {
    width: 32px;
    height: 32px;
    opacity: 0;
    border-width: 0px;
  }
}




/* --- KEYFRAMES --- */
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes spinRev { 100% { transform: rotate(-360deg); } }
@keyframes breathe { 0%, 100% { opacity: 0.1; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 0.2; transform: translate(-50%, -50%) scale(1.1); } }
@keyframes blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }
@keyframes iconPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.9); opacity: 0.8; } }

/* Orbit Math (Approximate for circular path) */
@keyframes orbit1 {
    from { transform: rotate(0deg) translateX(60px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(60px) rotate(-360deg); }
}
@keyframes orbit2 {
    from { transform: rotate(0deg) translateX(45px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(45px) rotate(-360deg); }
}


/* --- FOOTER METRICS --- */
/* --- MISSION FOOTER (Telemetry Console) --- */
.msn-footer {
    /* Scoped Variables */
    --msn-border: rgba(255, 255, 255, 0.08);
    --msn-txt-main: var(--text, #f0f9ff);
    --msn-txt-mute: var(--text-muted, #64748b);
    --msn-brand: var(--brand, #06b6d4);
    
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    margin-top: 5rem;
    padding-top: 3rem;
    
    /* Replaces standard border with a layout container for the gradient line */
    isolation: isolate;
}

/* "Laser Horizon" Top Border */
.msn-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--msn-border) 20%, 
        var(--msn-brand) 50%, 
        var(--msn-border) 80%, 
        transparent 100%
    );
    opacity: 0.5;
    box-shadow: 0 -1px 10px var(--msn-brand);
}

/* Metric Container */
.msn-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: default;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.msn-metric:hover {
    transform: translateY(-3px);
}

/* The Number (Big Data) */
.msn-metric .num {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    color: var(--msn-txt-main);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    
    /* Metallic Text Gradient */
    background: linear-gradient(180deg, #fff 10%, var(--msn-txt-mute) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
    transition: all 0.3s ease;
}

.msn-metric:hover .num {
    background: linear-gradient(180deg, #fff 0%, var(--msn-brand) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px var(--msn-brand));
}

.msn-metric .num small {
    font-size: 0.5em;
    font-weight: 500;
    color: var(--msn-txt-mute);
    vertical-align: super;
}

/* Label Wrapper (Aligns dot and text) */
.lbl-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}

.msn-metric:hover .lbl-wrapper {
    background: rgba(6,182,212,0.1);
    border-color: rgba(6,182,212,0.2);
}

/* The Label Text */
.msn-metric .lbl {
    font-size: 0.75rem;
    font-family: var(--font-mono, monospace);
    color: var(--msn-txt-mute);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    transition: color 0.3s ease;
}

.msn-metric:hover .lbl {
    color: var(--msn-brand);
}

/* Status Dots */
.status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #22c55e; /* Green for Uptime */
    box-shadow: 0 0 5px #22c55e;
    animation: pulse 2s infinite;
}

.status-dot.static {
    background: var(--msn-brand); /* Blue for ISO */
    box-shadow: none;
    animation: none;
}

.status-dot.eco {
    background: #10b981; /* Teal for Eco */
    box-shadow: none;
}

/* Vertical Separator */
.msn-sep {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, 
        transparent, 
        var(--msn-border), 
        transparent
    );
}

/* --- ANIMATIONS --- */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .msn-sep {
        height: 1px;
        background: linear-gradient(to right, transparent, var(--msn-border), transparent);
    }
    
    .msn-footer::before { width: 100%; }
}




/* --- ANIMATION KEYFRAMES --- */
@keyframes msnPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }
@keyframes msnSpin { 100% { transform: rotate(360deg); } }
@keyframes msnBreathe { 0%, 100% { transform: scale(1); box-shadow: 0 0 30px var(--msn-accent-glow); } 50% { transform: scale(1.1); box-shadow: 0 0 50px var(--msn-accent-glow); } }

/* --- MOBILE TWEAKS --- */
@media (max-width: 768px) {
    .msn-grid { gap: 1rem; }
    .msn-footer { gap: 1.5rem; }
    .msn-sep { height: 20px; }
    .msn-metric .num { font-size: 1.25rem; }
}