/* =====================================================
   MAPLE LEAF FLEET / CELESTIAL FEDERATION OF RA
   FINAL VISUAL POLISH PASS
===================================================== */

/* =========================
   RESET
========================= */

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

/* =========================
   BODY
========================= */

body {
  background:
    radial-gradient(circle at top left, rgba(212,175,55,0.08), transparent 32%),
    radial-gradient(circle at bottom right, rgba(74,163,255,0.08), transparent 28%),
    linear-gradient(180deg, #09111f 0%, #111d33 48%, #162845 100%);
  color: #ffffff;
  font-family: 'Rajdhani', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* subtle ambient glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent, rgba(255, 215, 120, 0.035), transparent);
  pointer-events: none;
  z-index: 0;
  animation: ambientSweep 8s linear infinite;
}

@keyframes ambientSweep {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* =========================
   GLOBAL LAYER CONTROL
========================= */

header,
.panel,
.transporter-overlay,
.gate-overlay,
.viewer,
.tx-overlay,
.wormhole,
.vortex-screen {
  position: relative;
  z-index: 2;
}

/* =========================
   FINAL HEADER LOGO FIX
========================= */

.site-logo,
.logo,
.home-logo,
.about-logo,
.allies-logo-top {
  height: 84px !important;
  width: auto !important;
  max-width: none !important;
  display: block;
}

@media (max-width: 1024px) {
  .site-logo,
  .logo,
  .home-logo,
  .about-logo,
  .allies-logo-top {
    height: 72px !important;
    width: auto !important;
  }
}

@media (max-width: 768px) {
  .site-logo,
  .logo,
  .home-logo,
  .about-logo,
  .allies-logo-top {
    height: 78px !important;
    width: auto !important;
  }
}

/* =========================
   HEADER
========================= */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  background: rgba(8, 14, 27, 0.86);
  border-bottom: 3px solid #d4af37;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.header-brand,
.home-header-brand,
.about-header-brand,
.allies-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-text,
.home-brand-text,
.about-brand-text,
.allies-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.fleet-name,
.home-brand-text .fleet-name,
.about-brand-text .fleet-name,
.allies-brand-text .fleet-name {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  color: #f1d98a;
  letter-spacing: 0.4px;
  text-shadow: 0 0 10px rgba(212,175,55,0.28);
}

.ra-name,
.home-brand-text .ra-name,
.about-brand-text .ra-name,
.allies-brand-text .ra-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  color: #f7fbff;
  letter-spacing: 1.2px;
}

/* =========================
   NAV
========================= */

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

nav a {
  color: #f1d98a;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  padding: 4px 2px;
  transition: 0.18s ease;
}

nav a:hover {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(212,175,55,0.5);
}

/* =========================
   MAIN PANEL
========================= */

.panel {
  max-width: 1120px;
  margin: 32px auto;
  padding: 24px;
}

/* =========================
   TYPOGRAPHY
========================= */

h1 {
  font-family: 'Cinzel', serif;
  font-size: 34px;
  color: #f1d98a;
  margin-bottom: 16px;
  text-shadow: 0 0 12px rgba(212,175,55,0.28);
  letter-spacing: 0.4px;
}

h2 {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: #f1d98a;
  margin-bottom: 12px;
}

p {
  font-size: 18px;
  line-height: 1.78;
  color: #f8fbff;
}

/* =========================
   DIVIDER
========================= */

.divider {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, #d4af37, #ffcc66, #4aa3ff);
  margin: 14px 0 26px;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(212,175,55,0.18);
}

/* =========================
   CARD / BOX SYSTEM
========================= */

.card,
.home-message-box,
.fleet-box,
.ally-box,
.doc-card,
.comm-panel,
.side-panel,
.home-status-panel,
.archive-panel,
.about-card,
.wildrose-box {
  background: linear-gradient(
    180deg,
    rgba(8, 16, 30, 0.76),
    rgba(16, 28, 50, 0.72)
  );
  border-left: 6px solid #d4af37;
  border-radius: 14px;
  padding: 24px;
  backdrop-filter: blur(8px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 10px 24px rgba(0,0,0,0.22);
}

.home-message-box p,
.fleet-box p,
.ally-box p,
.doc-card p,
.comm-panel p,
.side-panel p,
.home-status-panel p,
.archive-panel p,
.about-card p,
.wildrose-box p {
  margin-bottom: 14px;
}

.home-message-box p:last-child,
.fleet-box p:last-child,
.ally-box p:last-child,
.doc-card p:last-child,
.comm-panel p:last-child,
.side-panel p:last-child,
.home-status-panel p:last-child,
.archive-panel p:last-child,
.about-card p:last-child,
.wildrose-box p:last-child {
  margin-bottom: 0;
}

/* =========================
   GRID / LAYOUT HELPERS
========================= */

.dashboard,
.registry-grid,
.docs-grid,
.home-grid,
.fleet-layout,
.allies-layout,
.wildrose-layout,
.comm-layout,
.archive-layout {
  display: grid;
  gap: 20px;
}

.dashboard {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.registry-grid,
.docs-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin-top: 24px;
}

.home-grid,
.fleet-layout,
.allies-layout,
.wildrose-layout {
  grid-template-columns: 1fr;
}

.comm-layout,
.archive-layout {
  grid-template-columns: 260px 1fr;
}

/* =========================
   BUTTON SYSTEM
========================= */

button,
.registry-btn,
.lcars-btn,
.transmit-btn,
.unlock-btn,
.close-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #dcb84d, #d4af37);
  color: #0b0f1a;
  font-family: 'Cinzel', serif;
  font-weight: bold;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(212,175,55,0.35);
  transition: 0.18s ease-in-out;
}

button:hover,
.registry-btn:hover,
.lcars-btn:hover,
.transmit-btn:hover,
.unlock-btn:hover,
.close-btn:hover {
  background: linear-gradient(180deg, #ffe08a, #f5cd63);
  color: #000000;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 18px rgba(255,224,138,0.45);
}

/* =========================
   STATUS DOTS
========================= */

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: dotPulse 1.45s infinite;
  flex: 0 0 10px;
}

.dot-green {
  background: #2cff6b;
  box-shadow: 0 0 8px rgba(44,255,107,0.8);
}

.dot-blue {
  background: #4aa3ff;
  box-shadow: 0 0 8px rgba(74,163,255,0.8);
}

.dot-gold {
  background: #d4af37;
  box-shadow: 0 0 8px rgba(212,175,55,0.8);
}

.dot-amber {
  background: #ffcc66;
  box-shadow: 0 0 8px rgba(255,204,102,0.8);
}

@keyframes dotPulse {
  0% { transform: scale(0.85); opacity: 0.45; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.45; }
}

/* status pills */
.status-line,
.status-bar,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  font-size: 13px;
  font-family: 'Cinzel', serif;
  border-radius: 8px;
  color: #0b0f1a;
  background: #d4af37;
}

/* =========================
   FORM ELEMENTS
========================= */

label {
  display: block;
  margin-top: 10px;
  font-family: 'Cinzel', serif;
  color: #ffd98a;
  font-size: 14px;
}

input,
textarea {
  width: 100%;
  padding: 12px;
  margin-top: 5px;
  margin-bottom: 10px;
  background: #0f1a2e;
  border: 1px solid #d4af37;
  color: #ffffff;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

textarea {
  min-height: 160px;
  resize: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255,255,255,0.58);
}

/* =========================
   ALLY / IMAGE HANDLING
========================= */

.ally-logo {
  max-width: 110px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 14px;
  object-fit: contain;
}

.ally-name {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: #f0d27a;
  text-align: center;
  margin-bottom: 8px;
  text-shadow: 0 0 8px rgba(212,175,55,0.25);
}

.ally-text {
  font-size: 17px;
  color: #ffffff;
  line-height: 1.75;
  text-align: left;
  margin-top: 14px;
}

/* =========================
   OVERLAYS / VIEWERS
========================= */

.viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: none;
  flex-direction: column;
  z-index: 9998;
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #0f1a2e;
  border-bottom: 2px solid #d4af37;
}

.viewer-title {
  color: #d4af37;
  font-family: 'Cinzel', serif;
}

iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #ffffff;
}

.scan {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(212,175,55,0.10), transparent);
  animation: scanMove 1.25s linear infinite;
  pointer-events: none;
}

@keyframes scanMove {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.hidden {
  display: none;
}

/* =========================
   MISC HELPERS
========================= */

.glow {
  text-shadow: 0 0 10px #d4af37;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
  }

  .header-brand,
  .home-header-brand,
  .about-header-brand,
  .allies-header-brand {
    flex-direction: column;
    text-align: center;
  }

  .site-logo,
  .logo,
  .home-logo,
  .about-logo,
  .allies-logo-top {
    width: clamp(100px, 35vw, 160px);
  }

  .fleet-name,
  .home-brand-text .fleet-name,
  .about-brand-text .fleet-name,
  .allies-brand-text .fleet-name {
    font-size: 20px;
  }

  .ra-name,
  .home-brand-text .ra-name,
  .about-brand-text .ra-name,
  .allies-brand-text .ra-name {
    font-size: 14px;
  }

  nav {
    justify-content: center;
  }

  .panel {
    padding: 16px;
    margin: 20px auto;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 20px;
  }

  p {
    font-size: 17px;
  }

  .dashboard,
  .registry-grid,
  .docs-grid,
  .home-grid,
  .fleet-layout,
  .allies-layout,
  .wildrose-layout {
    grid-template-columns: 1fr;
  }

  .comm-layout,
  .archive-layout {
    grid-template-columns: 1fr;
  }

  .ally-logo {
    max-width: 85px;
  }
}
/* expo logo styling */
.mission-logo {
  display:block;
  margin:6px auto 12px auto;
  max-width:120px;
  height:auto;
  opacity:0.85;
  transition:0.2s ease-in-out;
}

.mission-logo:hover {
  opacity:1;
  transform:scale(1.05);
}

/* =========================
   ALLIES PAGE ENHANCEMENTS
========================= */

.allies-layout {
  display:grid;
  grid-template-columns:1fr;
  gap:20px;
  margin-top:20px;
}

.ally-box {
  position:relative;
  overflow:hidden;
}

.ally-box::before {
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(
    120deg,
    transparent,
    rgba(212,175,55,0.08),
    transparent
  );
  transform:translateX(-120%);
  animation:networkScan 6s infinite;
  pointer-events:none;
}

@keyframes networkScan {
  0% { transform:translateX(-120%); }
  45% { transform:translateX(120%); }
  100% { transform:translateX(120%); }
}

.ally-logo {
  display:block;
  max-width:95px;
  height:auto;
  margin:0 auto 14px;
  object-fit:contain;
}

.ally-name {
  font-family:'Cinzel', serif;
  font-size:24px;
  color:#f0d27a;
  text-align:center;
  margin-bottom:6px;
  text-shadow:0 0 8px rgba(212,175,55,0.35);
}

.ally-status {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:#b8c7d9;
  margin-bottom:12px;
  letter-spacing:1px;
  font-family:'Rajdhani', sans-serif;
}

.ally-status .status-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#2cff6b;
  box-shadow:0 0 8px rgba(44,255,107,0.8);
  animation:pulse 1.4s infinite;
}

.status-line {
  display:inline-flex;
  align-items:center;
  gap:10px;
  margin:8px 0 14px;
  padding:7px 12px;
  font-size:13px;
  font-family:'Cinzel', serif;
  border-radius:8px;
  color:#0b0f1a;
  background:#d4af37;
}

.status-line .status-dot {
  width:10px;
  height:10px;
  border-radius:50%;
  animation:pulse 1.5s infinite;
}

.status-charity .status-dot {
  background:#2cff6b;
}

.status-ally .status-dot {
  background:#4aa3ff;
}

.status-open .status-dot {
  background:#ffcc66;
}

.ally-text {
  font-size:18px;
  line-height:1.8;
  margin-bottom:14px;
  color:#ffffff;
}

.ally-text strong {
  display:block;
  margin-top:10px;
  color:#d4af37;
  letter-spacing:1px;
  text-transform:uppercase;
  font-size:14px;
}

.ally-box:hover {
  box-shadow:
    0 0 12px rgba(212,175,55,0.35),
    0 0 30px rgba(74,163,255,0.15);
  transition: all 0.3s ease;
}

/* =========================
   TRANSPORTER EFFECT
========================= */

.transporter-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: radial-gradient(circle at center, rgba(74,163,255,0.18), rgba(0,0,0,0.96));
  z-index: 9999;
  overflow: hidden;
}

.transporter-overlay.active {
  display: flex;
}

.beam-field {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: stretch;
  opacity: 0.95;
  z-index: 1;
}

.beam {
  width: 18px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(74,163,255,0.55),
    rgba(255,255,255,0.95),
    rgba(74,163,255,0.55),
    rgba(255,255,255,0)
  );
  filter: blur(1px);
  animation: beamPulse 0.9s infinite alternate;
}

.beam:nth-child(2) { animation-delay: 0.15s; }
.beam:nth-child(3) { animation-delay: 0.3s; }
.beam:nth-child(4) { animation-delay: 0.45s; }
.beam:nth-child(5) { animation-delay: 0.6s; }
.beam:nth-child(6) { animation-delay: 0.75s; }

@keyframes beamPulse {
  0% {
    opacity: 0.25;
    transform: scaleY(0.95);
  }

  100% {
    opacity: 1;
    transform: scaleY(1.03);
  }
}

.transport-core {
  width: 140px;
  height: 260px;
  border-radius: 80px;
  background: radial-gradient(circle at center, rgba(255,255,255,0.45), rgba(74,163,255,0.12), transparent 70%);
  z-index: 2;
  animation: corePulse 1.2s infinite alternate;
}

@keyframes corePulse {
  0% {
    transform: scale(0.96);
    opacity: 0.55;
  }

  100% {
    transform: scale(1.03);
    opacity: 1;
  }
}

.transporter-text {
  font-family: 'Cinzel', serif;
  color: #f0d27a;
  font-size: 24px;
  text-shadow: 0 0 12px rgba(212,175,55,0.6);
  z-index: 3;
  margin-top: 20px;
  text-align: center;
}

.ops-meta-stack{
  display:flex;
  flex-direction:column;
  gap:6px;
  letter-spacing:1px;
}

.ops-meta-stack div{
  white-space:nowrap;
}
/* =====================================================
   SITE-WIDE BALANCED READABILITY & PANEL FINISH
   Approved scale: body 13–14px, nav 12px,
   section headings 20–26px, page titles 28–36px.
   Responsive overrides are intentionally conservative.
===================================================== */
:root {
  --mlf-body-size: 14px;
  --mlf-nav-size: 12px;
  --mlf-panel-max: 1440px;
}

body { font-size: var(--mlf-body-size); }
p, li, dd, dt, label, input, textarea, select, button {
  font-size: var(--mlf-body-size);
  line-height: 1.58;
}
nav { gap: clamp(8px, 1vw, 14px); }
nav a { font-size: var(--mlf-nav-size); line-height: 1.4; }
.panel {
  width: min(calc(100% - 36px), var(--mlf-panel-max));
  max-width: var(--mlf-panel-max);
  padding: clamp(18px, 2.2vw, 30px);
}
h1 { font-size: clamp(28px, 2.4vw, 36px); line-height: 1.18; }
h2, .section-title { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.25; }
h3 { font-size: clamp(17px, 1.35vw, 21px); line-height: 1.3; }

/* Restrained gold shimmer on content panels; no layout or hover movement. */
.card, .home-message-box, .fleet-box, .ally-box, .doc-card,
.comm-panel, .side-panel, .home-status-panel, .archive-panel,
.about-card, .wildrose-box, .panel-card, .lcp-card, .market-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.card::after, .home-message-box::after, .fleet-box::after,
.ally-box::after, .doc-card::after, .comm-panel::after,
.side-panel::after, .home-status-panel::after, .archive-panel::after,
.about-card::after, .wildrose-box::after, .panel-card::after,
.lcp-card::after, .market-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(112deg, transparent 0%, transparent 42%, rgba(255,220,120,.055) 50%, transparent 58%, transparent 100%);
  background-size: 240% 100%;
  animation: mlfPanelShimmer 12s ease-in-out infinite;
}
@keyframes mlfPanelShimmer {
  0%, 68%, 100% { background-position: 120% 0; }
  35% { background-position: -120% 0; }
}

/* More usable width on desktop while keeping consistent gutters. */
@media (min-width: 1500px) {
  .panel { width: min(calc(100% - 64px), 1440px); }
}
@media (max-width: 768px) {
  .panel { width: calc(100% - 24px); padding: 16px; margin: 16px auto; }
  p, li, dd, dt, label, input, textarea, select, button { font-size: 13px; }
  nav { gap: 7px 11px; }
  nav a { font-size: 12px; }
  h1 { font-size: clamp(28px, 7vw, 32px); }
  h2, .section-title { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, .card::after, .home-message-box::after, .fleet-box::after,
  .ally-box::after, .doc-card::after, .comm-panel::after,
  .side-panel::after, .home-status-panel::after, .archive-panel::after,
  .about-card::after, .wildrose-box::after, .panel-card::after,
  .lcp-card::after, .market-card::after { animation: none !important; }
}

.card > *, .home-message-box > *, .fleet-box > *, .ally-box > *, .doc-card > *,
.comm-panel > *, .side-panel > *, .home-status-panel > *, .archive-panel > *,
.about-card > *, .wildrose-box > *, .panel-card > *, .lcp-card > *, .market-card > * {
  position: relative;
  z-index: 1;
}
