/* =============================================
   CHAINWATCH – Global Design System
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --navy: #0B1F3F;
  --navy-mid: #122a52;
  --navy-light: #183563;
  --bg-main: #ffffff;
  --bg-alt: #f8fafc;
  --panel: #ffffff;
  --panel-alt: #f1f5f9;
  --border: rgba(11, 31, 63, 0.1);
  --border-glow: rgba(0, 191, 166, 0.4);
  --blue: #00BFA6;
  --blue-dark: #009c87;
  --blue-light: #33ccbb;
  --cyan: #00BFA6;
  --green: #10b981;
  --yellow: #FFD700;
  --red: #ef4444;
  --purple: #8b5cf6;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --white: #ffffff;
  --black: #000000;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-blue: 0 0 40px rgba(0, 191, 166, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--navy-mid);
}

::-webkit-scrollbar-thumb {
  background: var(--blue);
  border-radius: 3px;
}

/* ── TYPOGRAPHY ── */
h1,
h2,
h3,
h4,
h5 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
}

h4 {
  font-size: 1.1rem;
}

p {
  color: var(--text-muted);
}

a {
  color: var(--blue-light);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--cyan);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.text-cyan {
  color: var(--cyan);
}

.text-blue {
  color: var(--blue-light);
}

.text-green {
  color: var(--green);
}

.text-yellow {
  color: var(--yellow);
}

.text-red {
  color: var(--red);
}

.text-muted {
  color: var(--text-muted);
}

/* ── DARK/LIGHT INVERSIONS ── */
.bg-navy {
  background: var(--navy);
  color: var(--white);
}

.bg-navy h1,
.bg-navy h2,
.bg-navy h3,
.bg-navy h4 {
  color: var(--white);
}

.bg-navy p {
  color: #cbd5e1;
}

.bg-navy .text-muted {
  color: #94a3b8;
}

.bg-navy .card {
  background: var(--navy-mid);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.bg-navy .panel {
  background: var(--navy-mid);
  border-color: rgba(255, 255, 255, 0.1);
}

.bg-navy input,
.bg-navy textarea,
.bg-navy select {
  background: rgba(0, 0, 0, 0.2) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ── LAYOUT ── */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-sm {
  padding: 48px 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media(max-width:900px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width:600px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.gap-24 {
  gap: 24px;
}

.gap-32 {
  gap: 32px;
}

/* ── NAVIGATION ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 70px;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.nav-logo span {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
}

.nav-logo span em {
  color: var(--cyan);
  font-style: normal;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  background: rgba(59, 130, 246, 0.12);
}

.nav-cta {
  padding: 8px 20px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
}

.nav-cta:hover {
  background: var(--blue-dark);
  color: #fff;
  transform: translateY(-1px);
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.4rem;
}

@media(max-width:900px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--navy-mid);
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-hamburger {
    display: block;
  }
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--blue-light);
  border: 1.5px solid var(--blue);
}

.btn-secondary:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue-light);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue-light);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1rem;
}

/* ── BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-light);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-yellow {
  background: rgba(180, 130, 0, 0.12);
  color: #a07000;
  border: 1px solid rgba(180, 130, 0, 0.3);
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-purple {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-cyan {
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

/* ── CARDS & PANELS ── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-blue);
  transform: translateY(-2px);
}

.card-dark {
  background: var(--panel-alt);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ── STAT CARDS ── */
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  margin: 4px 0;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-change {
  font-size: 0.78rem;
  color: var(--green);
  margin-top: 4px;
}

/* ── SECTION HEADERS ── */
.section-title {
  margin-bottom: 48px;
}

.section-title .overline {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  margin-bottom: 12px;
}

.section-title h2 {
  color: var(--navy);
}

.section-title p {
  max-width: 560px;
  margin-top: 12px;
}

.section-title.centered {
  text-align: center;
}

.section-title.centered p {
  margin: 12px auto 0;
}

/* ── FORMS ── */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

input,
textarea,
select {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--navy);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select option {
  background: var(--bg-main);
  color: var(--navy);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ── TABLE ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--navy);
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-align: left;
}

td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
  color: var(--navy);
}

tr:hover td {
  background: rgba(59, 130, 246, 0.04);
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: radial-gradient(ellipse 120% 80% at 50% -10%, rgba(59, 130, 246, 0.18) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 90% 60%, rgba(34, 211, 238, 0.08) 0%, transparent 60%),
    var(--navy);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
}

.page-hero {
  padding: 120px 0 64px;
  background: radial-gradient(ellipse 100% 60% at 50% -10%, rgba(59, 130, 246, 0.14) 0%, transparent 60%),
    var(--navy);
}

.page-hero h1 {
  color: var(--white);
}

/* ── GRADIENT TEXT ── */
.gradient-text {
  background: linear-gradient(135deg, var(--blue-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── RISK INDICATORS ── */
.risk-low {
  color: var(--green);
}

.risk-medium {
  color: var(--yellow);
}

.risk-high {
  color: var(--red);
}

.risk-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.risk-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

/* ── GLOW EFFECTS ── */
.glow-blue {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.glow-cyan {
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.3);
}

.glow-green {
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

/* ── STEP INDICATOR ── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step {
  display: flex;
  gap: 20px;
  position: relative;
  padding-bottom: 32px;
}

.step:last-child {
  padding-bottom: 0;
}

.step-num {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  z-index: 1;
}

.step::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--blue), transparent);
}

.step:last-child::before {
  display: none;
}

.step-content h4 {
  color: var(--navy);
  margin-bottom: 6px;
}

.step-content p {
  font-size: 0.875rem;
}

/* ── CHART CONTAINERS ── */
.chart-container {
  position: relative;
  width: 100%;
}

/* ── TERMINAL / CODE BLOCK ── */
.terminal {
  background: #050d1a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #7dd3fc;
  line-height: 1.7;
  overflow-x: auto;
}

.terminal .prompt {
  color: var(--cyan);
}

.terminal .output {
  color: var(--text-muted);
}

/* ── TOOLTIP ── */
.tooltip {
  position: relative;
}

.tooltip .tip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  white-space: nowrap;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.tooltip:hover .tip {
  opacity: 1;
}

/* ── UTILITY ── */
.mt-8 {
  margin-top: 8px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mt-32 {
  margin-top: 32px;
}

.mt-48 {
  margin-top: 48px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.mb-32 {
  margin-bottom: 32px;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 40px 0;
}

/* ── ALERT BOX ── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--blue-light);
}

.alert-warning {
  background: rgba(180, 130, 0, 0.08);
  border: 1px solid rgba(180, 130, 0, 0.3);
  color: #7a5500;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--red);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--green);
}

/* ── ANIMATE ON SCROLL ── */
.aos {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.aos.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── FOOTER ── */
footer {
  background: var(--panel-alt);
  border-top: 1px solid var(--border);
  padding: 60px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

@media(max-width:900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media(max-width:600px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand p {
  font-size: 0.875rem;
  margin-top: 12px;
  max-width: 280px;
}

.footer-col h5 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--blue-light);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ── PROGRESS / PULSE ANIMATION ── */
@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.4
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

@keyframes scanline {
  0% {
    top: -5%
  }

  100% {
    top: 105%
  }
}

.pulse {
  animation: pulse 2s infinite;
}

.spin {
  animation: spin 1.5s linear infinite;
}

/* Padding top compensation for fixed nav */
.page-content {
  padding-top: 70px;
}


/* ── FLOATING CTA ── */
.floating-cta-wrap {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-cta {
  background: var(--teal, #00BFA6);
  color: #fff !important;
  font-weight: 700;
  font-size: 1rem;
  padding: 16px 28px;
  border-radius: 40px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 20px rgba(0, 191, 166, 0.6);
  transition: all var(--transition);
  animation: floatBounce 3s ease-in-out infinite;
}

.floating-cta:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 0 30px rgba(0, 191, 166, 0.8), 0 0 60px rgba(0, 191, 166, 0.4);
  background: #009c87;
}

@keyframes floatBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}
/* === GLOBAL LIGHT-THEME VISIBILITY FIXES ===
h1, h2, h3, h4, h5, h6 { color: var(--navy); }
.hero h1, .hero h2, .hero h3, .hero h4, .page-hero h1, .page-hero h2,.bg-navy h1, .bg-navy h2, .bg-navy h3, .bg-navy h4, nav h1, nav h2, nav h3, footer h4 { color: #ffffff; }
.card h3, .card h4, .card h5, .panel h3, .panel h4, .panel h5, .stat-card h3, .stat-card h4 { color: var(--navy) !important; }
.a-nav-item:hover, .a-nav-item.active, .db-nav-item:hover, .db-nav-item.active { color: #ffffff !important; background: rgba(0, 191, 166, 0.25) !important; }
.bg-navy input, .bg-navy select, .bg-navy textarea { background: rgba(0,0,0,0.25) !important; color: #ffffff !important; border-color: rgba(255,255,255,0.15) !important; }
footer .footer-col h5 { color: var(--navy) !important; }

