/* ===================================================
   OPENBUTTERFLY — Global Design System
   =================================================== */

:root {
  /* Palette — Dark Mode (default) */
  --bg-0: #080c10;
  --bg-1: #0d1117;
  --bg-2: #141b25;
  --bg-3: #1c2535;
  --bg-card: #111720;
  --border: rgba(255,255,255,0.07);
  --border-hi: rgba(255,255,255,0.14);
  --text-0: #f0f6ff;
  --text-1: #9db4cc;
  --text-2: #5a7a99;

  /* Brand / Environment Colors */
  --green: #22c55e;
  --green-glow: rgba(34,197,94,0.2);
  --blue: #38bdf8;
  --blue-glow: rgba(56,189,248,0.15);
  --amber: #f59e0b;
  --red: #ef4444;
  --teal: #2dd4bf;

  /* Severity */
  --critical: #ef4444;
  --warning: #f59e0b;
  --ok: #22c55e;
  --info: #38bdf8;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Mono', monospace;
  --font-serif: 'Instrument Serif', serif;

  /* Spacing */
  --nav-h: 64px;
  --radius: 12px;
  --radius-sm: 6px;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-glow-green: 0 0 24px rgba(34,197,94,0.15);
}

/* Light mode */
body.light {
  --bg-0: #f5f7fa;
  --bg-1: #ffffff;
  --bg-2: #edf2f7;
  --bg-3: #e2eaf4;
  --bg-card: #ffffff;
  --border: rgba(0,0,0,0.08);
  --border-hi: rgba(0,0,0,0.14);
  --text-0: #0a1929;
  --text-1: #3a5068;
  --text-2: #8aa3bc;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-2); }

/* ─── NAVBAR ─── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(8,12,16,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  transition: background 0.3s;
}

body.light .navbar {
  background: rgba(255,255,255,0.88);
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

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

.logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.5px;
}

.logo-text em {
  font-style: normal;
  color: var(--green);
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-1);
  font-size: 13px;
  letter-spacing: 0.3px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link:hover { color: var(--text-0); background: var(--bg-3); }
.nav-link.active { color: var(--green); background: var(--green-glow); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--green);
  padding: 4px 10px;
  border: 1px solid var(--green);
  border-radius: 20px;
  background: var(--green-glow);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-anim 1.4s ease-in-out infinite;
}

@keyframes pulse-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  cursor: pointer;
  padding: 6px 12px;
  font-size: 16px;
  transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--green); color: var(--green); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--text-1);
  border-radius: 2px;
  transition: all 0.2s;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  gap: 4px;
}
.mobile-menu a {
  padding: 10px 0;
  color: var(--text-1);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu.open { display: flex; }

/* ─── TICKER ─── */
.ticker-bar {
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
}

.ticker-inner {
  display: flex;
  gap: 0;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
}

.ticker-inner span {
  padding: 0 40px;
  font-size: 12px;
  color: var(--text-1);
  border-right: 1px solid var(--border);
}

.ticker-inner span strong { color: var(--text-0); }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ─── BUTTONS ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--green);
  color: #000;
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-green);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--text-0);
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border-hi);
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); background: var(--green-glow); }

/* ─── PANELS ─── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}
.panel:hover { border-color: var(--border-hi); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.3px;
}

.badge-source {
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg-3);
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ─── ALERT FEED ─── */
.alert-feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border-left: 3px solid transparent;
}

.feed-item.critical { border-left-color: var(--critical); }
.feed-item.warning { border-left-color: var(--warning); }
.feed-item.ok { border-left-color: var(--ok); }

.feed-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.feed-content { flex: 1; }
.feed-content strong { font-weight: 600; color: var(--text-0); display: block; margin-bottom: 4px; }
.feed-content p, .feed-content div { font-size: 12px; color: var(--text-1); }
.feed-meta { font-size: 11px; color: var(--text-2); margin-top: 4px; }

/* ─── TAGS ─── */
.brief-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--bg-3);
  color: var(--text-1);
  border: 1px solid var(--border);
}

/* ─── SEVERITY BADGES ─── */
.brief-severity {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 8px;
}
.brief-severity.critical { background: rgba(239,68,68,0.15); color: var(--critical); }
.brief-severity.warning { background: rgba(245,158,11,0.15); color: var(--amber); }
.brief-severity.ok { background: rgba(34,197,94,0.15); color: var(--green); }

/* ─── SOURCES STRIP ─── */
.sources-strip {
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}
.sources-strip h3 {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 20px;
}
.sources-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}
.source-logo {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 1px;
  transition: all 0.2s;
}
.source-logo:hover { border-color: var(--green); color: var(--green); background: var(--green-glow); }

/* ─── FOOTER ─── */
.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: 48px 24px 24px;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  margin-bottom: 32px;
}
.footer-brand p {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 10px;
  line-height: 1.8;
}
.footer-links {
  display: flex;
  gap: 48px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 4px;
}
.footer-col a {
  font-size: 13px;
  color: var(--text-1);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--green); }
.footer-bottom {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-2);
  flex-wrap: wrap;
  gap: 8px;
}

/* ─── UTILITY ─── */
.mt-3 { margin-top: 16px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
  .nav-inner { padding: 0 16px; gap: 16px; }
  .live-badge span:last-child { display: none; }
}
