/* ============================================
   HELIUM AI — ENTERPRISE WORKFLOW DIAGRAM
   styles.css  (v2 — all 8 departments visible)
   ============================================ */

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

:root {
  --bg-deep:      #060B18;
  --bg-card:      #0D1526;
  --bg-card2:     #111B30;
  --border:       rgba(255,255,255,0.07);
  --text-primary: #F0F4FF;
  --text-muted:   #8A9BBE;
  --accent-cyan:  #22D3EE;
  --accent-blue:  #3B82F6;
  --hub-size:     170px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* subtle star field */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.22) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.14) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 25%, rgba(255,255,255,0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 80%, rgba(255,255,255,0.16) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 40%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 20% 90%, rgba(255,255,255,0.11) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 55%, rgba(255,255,255,0.15) 0%, transparent 100%);
  pointer-events: none; z-index: 0;
}

.page-wrapper {
  position: relative; z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

/* ══════════════════════════════
   HEADER
══════════════════════════════ */
.page-header { text-align: center; margin-bottom: 32px; }

.header-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(34,211,238,0.15), rgba(59,130,246,0.15));
  border: 1px solid rgba(34,211,238,0.3);
  color: var(--accent-cyan);
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 6px 18px; border-radius: 100px; margin-bottom: 20px;
}

.page-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800; line-height: 1.15;
  letter-spacing: -0.5px; margin-bottom: 16px; color: #fff;
}

.page-title .accent {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 1.05rem; color: var(--text-muted);
  max-width: 640px; margin: 0 auto; line-height: 1.7;
}

/* ══════════════════════════════
   STATS BANNER
══════════════════════════════ */
.dept-count-banner {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(34,211,238,0.06), rgba(59,130,246,0.06));
  border: 1px solid rgba(34,211,238,0.15);
  border-radius: 14px; padding: 14px 28px;
  margin-bottom: 48px;
}

.dept-count-num {
  font-size: 1.3rem; font-weight: 800;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dept-count-label { font-size: 0.82rem; color: var(--text-muted); }
.dept-divider { color: rgba(255,255,255,0.15); font-size: 1.2rem; }

/* ══════════════════════════════
   HUB GRID  — 5 columns, 3 rows
   col widths: card | spoke | card | spoke | card
   row heights: auto | hub-row | auto
══════════════════════════════ */
.hub-section { margin-bottom: 80px; }

.hub-grid {
  display: grid;
  grid-template-columns: 1fr 48px 1fr 48px 1fr;
  grid-template-rows: auto 220px auto;
  /* explicit placement via grid-area names */
  grid-template-areas:
    "r1c1  sv1  r1c3  sv2  r1c5"
    "r2c1  sh1  hub   sh2  r2c5"
    "r3c1  sv3  r3c3  sv4  r3c5";
  gap: 0;
  align-items: stretch;
}

/* ── assign every child to its named area ── */
[data-area="r1c1"] { grid-area: r1c1; }
[data-area="r1c3"] { grid-area: r1c3; }
[data-area="r1c5"] { grid-area: r1c5; }
[data-area="r2c1"] { grid-area: r2c1; }
[data-area="r2c5"] { grid-area: r2c5; }
[data-area="r3c1"] { grid-area: r3c1; }
[data-area="r3c3"] { grid-area: r3c3; }
[data-area="r3c5"] { grid-area: r3c5; }

.hub-cell        { grid-area: hub; display: flex; align-items: center; justify-content: center; }
.hub-spoke-left  { grid-area: sh1; }
.hub-spoke-right { grid-area: sh2; }

/* spoke cells that aren't explicitly named get auto-placed — give them their areas */
.hub-grid > .spoke-cell:nth-child(2)  { grid-area: sv1; }
.hub-grid > .spoke-cell:nth-child(4)  { grid-area: sv2; }
.hub-grid > .spoke-cell:nth-child(10) { grid-area: sv3; }
.hub-grid > .spoke-cell:nth-child(12) { grid-area: sv4; }

/* ── Department Cards ── */
.dept-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 18px 16px;
  margin: 8px;
  position: relative; overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex; flex-direction: column;
}

/* coloured top bar */
.dept-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--clr);
  border-radius: 16px 16px 0 0;
}

/* coloured border glow */
.dept-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 16px;
  border: 1px solid var(--clr);
  opacity: 0.2; pointer-events: none;
}

.dept-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 44px var(--glow);
}

/* Legal card — extra highlight so it's unmissable */
.legal-card {
  box-shadow: 0 0 0 1px rgba(239,68,68,0.3), 0 4px 20px rgba(239,68,68,0.15);
}
.legal-card::before { opacity: 0.35; }

.dept-icon { font-size: 1.7rem; margin-bottom: 8px; }

.dept-card h3 {
  font-size: 0.92rem; font-weight: 700;
  color: var(--clr); margin-bottom: 10px; letter-spacing: 0.2px;
}

.dept-card ul { list-style: none; margin-bottom: 12px; flex: 1; }

.dept-card ul li {
  font-size: 0.76rem; color: var(--text-muted);
  padding: 3px 0 3px 14px; position: relative; line-height: 1.5;
}

.dept-card ul li::before {
  content: '›'; position: absolute; left: 0;
  color: var(--clr); font-weight: 700;
}

.capability-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }

.capability-tags span {
  font-size: 0.63rem; font-weight: 600; letter-spacing: 0.3px;
  padding: 3px 8px; border-radius: 100px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--clr);
}

/* ── Spoke Cells ── */
.spoke-cell {
  display: flex; align-items: center; justify-content: center;
}

/* vertical spokes (rows 1 & 3 connectors) */
.spoke-v {
  width: 2px; height: 100%;
  background: linear-gradient(180deg,
    rgba(34,211,238,0.15) 0%,
    rgba(34,211,238,0.7) 50%,
    rgba(34,211,238,0.15) 100%);
  border-radius: 2px;
  position: relative;
}

.spoke-v::before, .spoke-v::after {
  content: '';
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}
.spoke-v::before { top: 0; }
.spoke-v::after  { bottom: 0; }

/* horizontal spokes (row 2 hub connectors) */
.spoke-h {
  height: 2px; width: 100%;
  background: linear-gradient(90deg,
    rgba(34,211,238,0.15) 0%,
    rgba(34,211,238,0.7) 50%,
    rgba(34,211,238,0.15) 100%);
  border-radius: 2px;
  position: relative;
}

.spoke-h::before, .spoke-h::after {
  content: '';
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}
.spoke-h::before { left: 0; }
.spoke-h::after  { right: 0; }

/* ── Central Hub ── */
.central-hub {
  width: var(--hub-size); height: var(--hub-size);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

.hub-glow {
  position: absolute; inset: -30px; border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,0.22) 0%, transparent 70%);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.12); }
}

.hub-inner {
  width: var(--hub-size); height: var(--hub-size);
  border-radius: 50%;
  background: linear-gradient(135deg, #0D1F3C, #0A1628);
  border: 2px solid rgba(34,211,238,0.55);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative; z-index: 2;
  box-shadow: 0 0 32px rgba(34,211,238,0.28), inset 0 0 20px rgba(34,211,238,0.06);
}

.hub-logo {
  font-size: 2rem; margin-bottom: 4px;
  filter: drop-shadow(0 0 8px rgba(34,211,238,0.9));
}

.hub-name {
  font-size: 0.68rem; font-weight: 800;
  letter-spacing: 2.5px; color: var(--accent-cyan); text-transform: uppercase;
}

.hub-url { font-size: 0.58rem; color: var(--text-muted); margin-top: 2px; }

.hub-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(34,211,238,0.14);
  animation: spin-ring linear infinite;
}

.ring1 { width: 120%; height: 120%; animation-duration: 8s; }
.ring2 { width: 142%; height: 142%; animation-duration: 14s; animation-direction: reverse; }
.ring3 { width: 168%; height: 168%; animation-duration: 20s; border-style: dashed; }

@keyframes spin-ring {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ══════════════════════════════
   CAPABILITIES SECTION
══════════════════════════════ */
.capabilities-section { margin-bottom: 72px; }

.section-title {
  font-size: 1.4rem; font-weight: 700;
  text-align: center; margin-bottom: 32px; color: #fff;
}

.section-title::after {
  content: ''; display: block;
  width: 48px; height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 2px; margin: 10px auto 0;
}

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.cap-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 16px; text-align: center;
  transition: transform 0.25s, box-shadow 0.25s;
}

.cap-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(34,211,238,0.12);
  border-color: rgba(34,211,238,0.25);
}

.cap-icon  { font-size: 1.8rem; margin-bottom: 10px; }
.cap-name  { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.cap-desc  { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }

/* ══════════════════════════════
   FLOW SECTION
══════════════════════════════ */
.flow-section { margin-bottom: 64px; }

.flow-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: wrap;
}

.flow-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 24px 18px; text-align: center;
  flex: 1; min-width: 140px; max-width: 200px;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s;
}

.flow-step:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(59,130,246,0.15);
}

.step-num {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000; font-size: 0.6rem; font-weight: 800;
  padding: 2px 8px; border-radius: 100px; letter-spacing: 1px;
}

.step-icon  { font-size: 1.6rem; margin-bottom: 8px; margin-top: 4px; }
.step-title { font-size: 0.82rem; font-weight: 700; color: var(--accent-cyan); margin-bottom: 6px; }
.step-desc  { font-size: 0.7rem; color: var(--text-muted); line-height: 1.5; }

.flow-arrow {
  font-size: 1.4rem; color: rgba(34,211,238,0.5);
  padding: 0 4px; flex-shrink: 0;
}

/* ══════════════════════════════
   FOOTER
══════════════════════════════ */
.page-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 24px; padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-muted);
}

.footer-url { color: var(--accent-cyan); font-weight: 600; }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 960px) {
  .hub-grid {
    display: flex; flex-direction: column;
    align-items: stretch; gap: 0;
  }

  .spoke-cell { height: 32px; }

  .spoke-v {
    width: 2px; height: 100%;
    margin: 0 auto;
  }

  .spoke-h {
    height: 2px; width: 60px;
    margin: 0 auto;
  }

  .hub-cell {
    padding: 16px 0;
    display: flex; justify-content: center;
  }

  .hub-spoke-left, .hub-spoke-right { height: 32px; }

  .dept-card { margin: 6px 0; }
}

@media (max-width: 600px) {
  .page-wrapper { padding: 32px 16px 48px; }
  .capabilities-grid { grid-template-columns: repeat(2, 1fr); }
  .page-footer { flex-direction: column; gap: 8px; text-align: center; }
  .dept-count-banner { gap: 8px; }
}