/* ═══════════════════════════════════════════════════════════════
   MEOS · MAGISTERIAL ENERGY · DESIGN SYSTEM v4.0
   Palantir-grade aesthetic: telemetry, motion, institutional calm
   ═══════════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ──────────────────────────────────────────── */
:root {
  --void:       #050508;
  --abyss:      #08090f;
  --midnight:   #0D121E;
  --ledger:     #1C2433;
  --surface:    #232d3f;
  --fogstone:   #E2E8F0;
  --slatemist:  #A7B0C0;
  --dim:        #3d4658;

  --gold:       #C9A86A;
  --gold-2:     #b8913d;
  --gold-dim:   rgba(201,168,106,0.12);
  --gold-glow:  rgba(201,168,106,0.35);

  --cyan:       #3BC7D7;
  --cyan-2:     #22b8c9;
  --cyan-dim:   rgba(59,199,215,0.10);
  --cyan-glow:  rgba(59,199,215,0.35);

  --green:      #4ade80;
  --red:        #ef4444;
  --amber:      #f59e0b;

  --grid-line:  rgba(255,255,255,0.035);
  --border:     rgba(255,255,255,0.07);

  --font-display: 'Syne', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;
}

/* ─── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--void);
  color: var(--fogstone);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--void); }

/* ─── CUSTOM CURSOR ──────────────────────────────────────────── */
.meos-cursor-dot {
  width: 5px; height: 5px;
  background: var(--cyan);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
}

.meos-cursor-ring {
  width: 28px; height: 28px;
  border: 1px solid rgba(59,199,215,0.45);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease,
              border-color 0.25s ease, border-width 0.25s ease;
}

.meos-cursor-ring.hover {
  width: 44px; height: 44px;
  border-color: rgba(201,168,106,0.55);
}

/* ─── NAVIGATION ─────────────────────────────────────────────── */
.meos-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  height: 76px;
  background: rgba(5,5,8,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.meos-nav__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.meos-nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.meos-nav__emblem {
  width: 30px; height: 30px;
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.meos-nav__emblem::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(201,168,106,0.25);
  border-radius: 50%;
  animation: spin-slow 14s linear infinite;
}

.meos-nav__emblem-core {
  width: 7px; height: 7px;
  background: var(--cyan);
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

.meos-nav__wordmark {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: white;
}

.meos-nav__wordmark span { color: var(--gold); }

.meos-nav__links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.meos-nav__link {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--slatemist);
  text-decoration: none;
  position: relative;
  transition: color 0.25s ease;
}

.meos-nav__link::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--cyan);
  transition: width 0.3s ease;
}

.meos-nav__link:hover { color: var(--fogstone); }
.meos-nav__link:hover::after { width: 100%; }
.meos-nav__link--active {
  color: var(--fogstone);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
}

.meos-nav__right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.meos-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meos-status-dot {
  width: 7px; height: 7px;
  position: relative;
}

.meos-status-dot__ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(74,222,128,0.4);
  animation: ping-slow 2.5s ease-in-out infinite;
}

.meos-status-dot__core {
  position: absolute;
  inset: 1.5px;
  border-radius: 50%;
  background: var(--green);
}

.meos-status-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--slatemist);
  text-transform: uppercase;
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.meos-btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 22px;
  transition: all 0.3s ease;
  cursor: none;
}

.meos-btn--primary {
  background: var(--cyan);
  color: var(--void);
  font-weight: 600;
  border: 1px solid var(--cyan);
}

.meos-btn--primary:hover {
  background: white;
  border-color: white;
  box-shadow: 0 0 32px var(--cyan-glow);
}

.meos-btn--ghost {
  background: transparent;
  color: var(--cyan);
  border: 1px solid rgba(59,199,215,0.3);
}

.meos-btn--ghost:hover {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  color: var(--fogstone);
}

.meos-btn--gold-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(201,168,106,0.3);
}

.meos-btn--gold-ghost:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
}

/* ─── HUD TYPOGRAPHY ─────────────────────────────────────────── */
.meos-hud-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.65;
}

.meos-hud-value {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--slatemist);
  opacity: 0.6;
}

.meos-module-code {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
}

.meos-module-code--gold { color: var(--gold); }

/* ─── DISPLAY TYPOGRAPHY ─────────────────────────────────────── */
.meos-display {
  font-family: var(--font-display);
  font-weight: 700;      /* was 800 — reduced one step for calm authority */
  line-height: 1.05;
  color: white;
}

/* Hero h1: Inter 300 at measured scale. Override in page <style> if needed. */
.meos-display--hero {
  font-family: 'Inter', var(--font-display);
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: -0.02em;
}
.meos-display--xl   { font-size: clamp(1.6rem, 2.8vw, 2.5rem); font-weight: 700; }
.meos-display--lg   { font-size: clamp(1.3rem, 2.2vw, 2rem);   font-weight: 700; }
.meos-display--md   { font-size: clamp(1.1rem, 1.8vw, 1.6rem); font-weight: 700; }

.meos-stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1;
  color: white;
}

/* ─── BACKGROUNDS ────────────────────────────────────────────── */
.meos-bg-void     { background-color: var(--void); }
.meos-bg-abyss    { background-color: var(--abyss); }
.meos-bg-midnight { background-color: var(--midnight); }
.meos-bg-ledger   { background-color: var(--ledger); }

.meos-grid-bg {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 52px 52px;
}

.meos-grid-bg--fine {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ─── SCANLINE OVERLAY ───────────────────────────────────────── */
.meos-scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.06) 3px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 3;
}

/* ─── CORNER BRACKETS ────────────────────────────────────────── */
.meos-brackets {
  position: absolute;
  inset: 12px;
  pointer-events: none;
}

.meos-brackets::before,
.meos-brackets::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
}

.meos-brackets::before {
  top: 0; left: 0;
  border-top: 1px solid rgba(59,199,215,0.4);
  border-left: 1px solid rgba(59,199,215,0.4);
}

.meos-brackets::after {
  bottom: 0; right: 0;
  border-bottom: 1px solid rgba(59,199,215,0.4);
  border-right: 1px solid rgba(59,199,215,0.4);
}

.meos-brackets--gold::before { border-color: rgba(201,168,106,0.4); }
.meos-brackets--gold::after  { border-color: rgba(201,168,106,0.4); }

/* ─── CARDS ──────────────────────────────────────────────────── */
.meos-card {
  background: rgba(28,36,51,0.35);
  border: 1px solid var(--border);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.meos-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-dim), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.meos-card:hover {
  border-color: rgba(201,168,106,0.25);
  background: rgba(28,36,51,0.65);
  transform: translateY(-3px);
}

.meos-card:hover::before { opacity: 1; }

.meos-card--cyan::before {
  background: linear-gradient(135deg, var(--cyan-dim), transparent 60%);
}

.meos-card:hover.meos-card--cyan { border-color: rgba(59,199,215,0.25); }

/* ─── TELEMETRY TICKER STRIP ─────────────────────────────────── */
.meos-ticker {
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  border-top: 1px solid var(--border);
  background: rgba(5,5,8,0.85);
  padding: 0.6rem 0;
}

.meos-ticker__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2rem;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.07);
}

.meos-ticker__value {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
}

.meos-ticker__value--cyan { color: var(--cyan); }
.meos-ticker__value--dim  { color: var(--fogstone); }

/* ─── DIVIDERS ───────────────────────────────────────────────── */
.meos-divider {
  height: 1px;
  background: var(--border);
}

.meos-divider--gold {
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.35;
  height: 1px;
}

.meos-divider--cyan {
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.25;
  height: 1px;
}

/* ─── SCROLL REVEAL ANIMATIONS ───────────────────────────────── */
.meos-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.meos-reveal.is-visible { opacity: 1; transform: translateY(0); }

.meos-reveal--left {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}
.meos-reveal--left.is-visible { opacity: 1; transform: translateX(0); }

/* Declassify wipe — dark curtain slides off to reveal content */
.meos-declassify {
  position: relative;
}
.meos-declassify::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--void);
  transform-origin: left;
  transition: transform 1.1s cubic-bezier(0.77, 0, 0.175, 1);
  z-index: 5;
}
.meos-declassify.is-visible::after { transform: scaleX(0); transform-origin: right; }

/* ─── PHASE FLOW (approach/dealstream) ───────────────────────── */
.meos-phase-number {
  width: 48px; height: 48px;
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gold);
  position: relative;
  z-index: 2;
  background: var(--void);
  flex-shrink: 0;
}

.meos-phase-connector {
  position: absolute;
  left: 24px;
  top: 56px;
  bottom: -32px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(201,168,106,0.35), transparent);
}

/* ─── OUTPUT ARTIFACT ────────────────────────────────────────── */
.meos-artifact {
  background: var(--abyss);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--slatemist);
}

.meos-artifact span { color: var(--gold); }
.meos-artifact span.cyan { color: var(--cyan); }
.meos-artifact span.green { color: var(--green); }

/* ─── FORM ELEMENTS ──────────────────────────────────────────── */
.meos-input {
  width: 100%;
  background: rgba(22,27,40,0.9);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--fogstone);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}

.meos-input:focus {
  border-color: var(--cyan);
  background: rgba(28,36,51,0.9);
  box-shadow: 0 0 0 3px rgba(59,199,215,0.07), 0 0 20px rgba(59,199,215,0.05);
}

.meos-input::placeholder { color: var(--dim); opacity: 0.7; }

.meos-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slatemist);
  margin-bottom: 0.5rem;
  font-family: var(--font-body);
}

/* ─── TELEMETRY PANEL ────────────────────────────────────────── */
.meos-telem-panel {
  background: var(--abyss);
  border: 1px solid var(--border);
  padding: 1.5rem;
  position: relative;
}

/* ─── LAYOUT UTILITIES ───────────────────────────────────────── */
.meos-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.meos-section {
  padding: 6rem 0;
}

.meos-section--xl {
  padding: 8rem 0;
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.meos-footer {
  background: var(--void);
  border-top: 1px solid var(--border);
  padding: 5rem 0 2.5rem;
}

.meos-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.meos-footer__col-title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 1.25rem;
}

.meos-footer__link {
  display: block;
  color: var(--slatemist);
  text-decoration: none;
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
  transition: color 0.2s ease;
}

.meos-footer__link:hover { color: var(--cyan); }

.meos-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 2rem;
}

.meos-footer__legal {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--dim);
  letter-spacing: 0.06em;
}

/* ─── KEYFRAMES ──────────────────────────────────────────────── */
@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

@keyframes ping-slow {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%       { transform: scale(2.2); opacity: 0; }
}

@keyframes blink-cursor {
  50% { opacity: 0; }
}

@keyframes scroll-fade {
  0%, 100% { opacity: 0.2; }
  50%       { opacity: 0.8; }
}

@keyframes data-tick {
  0%   { opacity: 0; transform: translateY(3px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .meos-nav__links { display: none; }
  .meos-footer__grid { grid-template-columns: 1fr; gap: 2rem; }
  .meos-display--hero { font-size: 1.9rem; }
}

/* ═══════════════════════════════════════════════════════════════
   VIDEO HERO CAROUSEL — Palantir-grade drone footage background
   ═══════════════════════════════════════════════════════════════ */

/* Container: sits directly inside .hero, absolute fill */
.hero-video-carousel {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* Each clip: full-cover, fade in/out via .is-active */
.hero-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 2.8s ease-in-out;
  will-change: opacity;
  /* Ensure no controls / browser chrome */
  pointer-events: none;
}

.hero-vid.is-active { opacity: 1; }

/* Dark overlay — lighter than canvas approach so video breathes */
.hero-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to right,  rgba(5,5,8,0.72) 35%, rgba(5,5,8,0.28) 75%, rgba(5,5,8,0.12) 100%),
    linear-gradient(to top,    rgba(5,5,8,0.85) 0%,  rgba(5,5,8,0) 40%),
    linear-gradient(to bottom, rgba(5,5,8,0.55) 0%,  rgba(5,5,8,0) 25%);
}

/* Canvas fallback — shows through when no video is loaded */
.hero-canvas-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;   /* behind video carousel */
}

/* Scene label — bottom-left subtle indicator (optional) */
.hero-scene-label {
  position: absolute;
  bottom: 5.5rem;
  left: max(2rem, calc((100vw - 1280px) / 2));
  z-index: 4;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  transition: opacity 0.6s ease;
}

/* Progress dots */
.hero-video-dots {
  position: absolute;
  bottom: 5.5rem;
  right: max(2rem, calc((100vw - 1280px) / 2));
  z-index: 4;
  display: flex;
  gap: 6px;
  align-items: center;
}

.hero-video-dot {
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,0.2);
  transition: background 0.4s ease, width 0.4s ease;
  cursor: none;
}

.hero-video-dot.is-active {
  background: var(--gold);
  width: 32px;
}

/* Loading state — shown before first video plays */
.hero-video-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--void);
  transition: opacity 1.2s ease;
}

.hero-video-loading.is-hidden { opacity: 0; pointer-events: none; }
