:root {
  --bg: #fcfcfd; 
  --card-bg: #ffffff;
  --card-border: #e2e8f0; 
  --text-main: #0f172a; 
  --text-muted: #64748b; 
  --accent: #2563eb; 
  --accent-soft: #eff6ff;
  --font-main: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 24px 60px; /* Reduced top padding for mobile via media query later */
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.nav-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #000;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.nav-cta {
  background: #0f172a;
  color: #fff !important;
  padding: 6px 12px;
  border-radius: 6px;
}

/* --- Hero --- */
.hero { margin-bottom: 48px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 20px;
  border: 1px solid var(--card-border);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.hero h1 {
  font-size: clamp(2rem, 8vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.1;
  margin-bottom: 20px;
  color: #000;
}

.text-gradient { color: var(--accent); }

.hero-subtext {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 720px;
  margin-bottom: 28px;
}

.tag-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: #fff;
  border: 1px solid var(--card-border);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

/* --- Bento Grid --- */
.bento-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 24px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  display: block;
}

.card h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 16px; color: #000; }
.card-description { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

/* --- Pipeline Visual --- */
.pipeline-visual {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
}

.node {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 8px;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  background: #fff;
  font-weight: 600;
}

.connector {
  flex-grow: 1;
  height: 1px;
  background: var(--card-border);
  margin: 0 6px;
}

/* --- KPI Grid --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-item {
  background: #fdfdfd;
  padding: 12px;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
}

.kpi-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.kpi-value { font-weight: 700; font-size: 12px; color: var(--text-main); display: block; margin-top: 4px; }

/* --- Capability List --- */
.capability-list { list-style: none; }
.capability-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: var(--text-muted);
}

.check {
  width: 14px; height: 14px;
  background: var(--accent-soft);
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Buttons --- */
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s;
}
.btn-primary { background: var(--text-main); color: #fff; }
.btn-secondary { border: 1px solid var(--card-border); color: var(--text-main); background: #fff; }

/* --- Footer --- */
.main-footer {
  margin-top: 60px;
  padding: 32px 0;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   MOBILE FIXES (SCREEN WIDTH < 768px)
   ========================================================================== */

@media (max-width: 768px) {
  
  /* 1. Reduce padding for tighter mobile feel */
  .container {
    padding: 80px 16px 40px;
  }

  /* 2. Fix Navbar: Hide name or stack if links overflow */
  .brand-name { font-size: 14px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 12px; }

  /* 3. Hero: Prevent word breaks and reduce spacing */
  .hero h1 {
    font-size: 2.2rem; /* Static size for consistency */
    letter-spacing: -0.04em;
  }
  .hero-subtext { font-size: 1rem; }

  /* 4. Bento Grid: Collapse into 1 column */
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* 5. Pipeline Visual: Wrap nodes so they don't squash */
  .pipeline-visual {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .connector { display: none; } /* Connectors look bad when wrapping */
  .node { flex: 1 1 40%; text-align: center; } /* 2 per row on mobile */

  /* 6. KPI Grid: Collapse into 1 or 2 columns */
  .kpi-grid {
    grid-template-columns: 1fr; /* Stacked is safest for readability */
    gap: 8px;
  }

  /* 7. Case Study Content (Systems Page) */
  .case-content-grid {
    grid-template-columns: 1fr; /* Stack sidebar under main content */
    gap: 24px;
  }
  .case-study-header {
    flex-direction: column;
    gap: 16px;
  }
  .header-action { width: 100%; }
  .header-action .btn { width: 100%; text-align: center; }

  /* 8. Footer: Stack links */
  .main-footer {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
  }
  .footer-right a { margin: 0 10px; }

  /* 9. Decision Block (About Page) */
  .decision-block {
    padding: 20px;
  }
}

/* Extra Small (iPhone SE / small phones) */
@media (max-width: 380px) {
  .brand-name { display: none; } /* Only show dot/logo to save space */
  .hero h1 { font-size: 1.8rem; }
  .btn { width: 100%; text-align: center; }
}
