:root {
  --bg: #F8FBFC;
  --ink: #0A0E14;
  --glass: rgba(255,255,255,0.8);
  --border: rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.05), 0 10px 28px rgba(0,0,0,0.08);
  --cyan: #00CFE6;
  --mint: #00E0A2;
  font-family: 'Poppins', sans-serif;
}

.stackbox-map {
  background: var(--bg);
  padding: 5rem 4rem;
  display: flex;
  flex-direction: column; /* <<< NEU: Elemente untereinander */
  align-items: center;     /* zentriert die Headline */
  justify-content: center;
  text-align: center;      /* sorgt dafür, dass Text mittig bleibt */
}

/* === HEADER === */
.map-header {
  text-align: center;
  margin-bottom: 4rem;
  max-width: 900px;
}

.map-title {
  font-size: 2.4rem;
  font-weight: 600;
  color: #0A0E14;
  margin-bottom: 0.8rem;
}

.map-subtitle {
  font-size: 1.1rem;
  color: #3B3F44;
  line-height: 1.6;
  opacity: 0.9;
  margin: 0 auto;
  max-width: 700px;
}

/* === GRID === */
.map-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-auto-rows: 140px;
  gap: 1.4rem;
  justify-items: center;
  align-items: center;
}

/* === CARDS === */
.sys, .core {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.5rem;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  color: var(--ink);
  backdrop-filter: blur(12px) saturate(180%);
  transition: all 0.3s ease;
}

.sys img {
  width: 160px;               /* größer als das Stackbox-Logo (70px → zentriert kleiner) */
  height: 100px;
  object-fit: cover;
  opacity: 0.9;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.sys:hover, .core:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 224, 162, 0.45);
  box-shadow: 0 8px 24px rgba(0, 207, 230, 0.18), 0 6px 14px rgba(0, 224, 162, 0.12);
}

/* === STACKBOX CENTER (Dark Gradient Highlight, gleiche Größe wie andere) === */
.core.stackbox {
  background: linear-gradient(145deg, #0b1220 0%, #162033 100%);
  border: 1px solid rgba(0, 255, 180, 0.5);
  width: 100%;
  height: 100%; /* übernimmt gleiche Zeilenhöhe */
  padding: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;

  /* KEIN Scale mehr */
  transform: none;
  transition: all 0.4s ease;
}

.core.stackbox:hover {
  transform: translateY(-4px); /* nur leichtes Hover wie bei sys */
  box-shadow:
    0 0 35px rgba(0, 255, 180, 0.35),
    0 0 80px rgba(0, 207, 230, 0.25),
    inset 0 0 60px rgba(0, 224, 162, 0.25);
}

.core.stackbox img {
  width: 140px;
  filter: drop-shadow(0 0 12px rgba(0, 255, 200, 0.5)) brightness(1.2);
}

/* === POSITIONING (exactly like your sketch) === */

/* Row 1 (top 4 cards) */
.asset { grid-column: 2 / 4; grid-row: 1 / 2; }
.erp   { grid-column: 4 / 6; grid-row: 1 / 2; }
.crm   { grid-column: 6 / 8; grid-row: 1 / 2; }
.app   { grid-column: 8 / 10; grid-row: 1 / 2; }

/* Row 2 (middle 3 cards - centered under gaps) */
.cpms     { grid-column: 3 / 5; grid-row: 2 / 3; }
.stackbox { grid-column: 5 / 7; grid-row: 2 / 3; }
.msp      { grid-column: 7 / 9; grid-row: 2 / 3; }

/* Row 3 (bottom 4 cards - aligned under top row) */
.energy  { grid-column: 2 / 4; grid-row: 3 / 4; }
.ocpp    { grid-column: 4 / 6; grid-row: 3 / 4; }
.receipt { grid-column: 6 / 8; grid-row: 3 / 4; }
.your    { grid-column: 8 / 10; grid-row: 3 / 4; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .map-grid {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 100px;
  }
  .sys, .core {
    min-width: 120px;
  }
}

/* === STACKBOX BACKGROUND CORE === */
.stackbox-bg-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 520px;
  height: 520px;
  transform: translate(-50%, -50%);
  border-radius: 50%;

  /* Weicher, transparenter Gradient-Ring */
  background: radial-gradient(
    circle at center,
    rgba(0, 232, 255) 0%,   /* fast klar in der Mitte */
    rgba(0, 245, 181) 40%,  /* leicht mintfarbener Verlauf */
    rgba(0, 255, 136) 60%,  /* sanfter Emerald-Rand */
    rgba(0, 232, 255) 80%,  /* dezente Außenleuchte */
    transparent 100%
  );

  /* sichtbarer, feiner Rand */
  border: 5px solid rgba(0, 232, 255, 1);

  /* sanfte Tiefenwirkung */
  box-shadow:
    0 0 40px rgba(0, 232, 255, 0.15),
    inset 0 0 60px rgba(0, 245, 181, 0.12);

  opacity: 0.25; /* weicher Gesamteindruck */
  z-index: 0;
  pointer-events: none;
}

/* ===================================
   STACKBOX HUB – Option A Prototype
   =================================== */

.stackbox-hub {
  background: #F7F9FA;
  padding: 5rem 0 6rem;
  overflow: hidden;
}

/* Two-column layout */
.hub-layout {
  display: flex;
  align-items: center;
  gap: 5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hub-visual-col {
  flex: 0 0 550px;   /* 1100 × 0.5 */
  height: 480px;     /* 960 × 0.5 */
  overflow: hidden;
}

.hub-text-col {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.hub-badge {
  display: inline-block;
  background: rgba(0, 207, 230, 0.08);
  border: 1px solid rgba(0, 207, 230, 0.3);
  color: #007A8C;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 1.2rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

.hub-title {
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 700;
  color: #0A0E14;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.hub-subtitle {
  font-size: 1.05rem;
  color: rgba(10, 14, 20, 0.6);
  line-height: 1.7;
  margin: 0 0 2rem;
}

.hub-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hub-features li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.95rem;
  color: rgba(10, 14, 20, 0.75);
  line-height: 1.4;
}

.hub-features li::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hyper-cyan);
  box-shadow: 0 0 6px rgba(0, 232, 255, 0.55);
}

.hub-quote {
  font-size: 1rem;
  font-style: italic;
  color: rgba(10, 14, 20, 0.55);
  border-left: 3px solid var(--neon-mint);
  padding-left: 1rem;
  margin: 0 0 2rem;
  line-height: 1.5;
}

.hub-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: #0A0E14;
  background: linear-gradient(90deg, var(--neon-mint), var(--hyper-cyan));
  border-radius: 999px;
  padding: 0.9rem 2rem;
  transition: all 0.25s ease;
}

.hub-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 232, 255, 0.3);
}

.hub-btn .arrow {
  transition: transform 0.2s ease;
}

.hub-btn:hover .arrow {
  transform: translateX(4px);
}

.hub-scaler {
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.hub-wrapper {
  position: relative;
  width: 1100px;
  height: 1060px;           /* center at y=530, radius 360, +170px buffer top/bottom */
  flex-shrink: 0;
  transform: scale(0.5);   /* default: 2-column, fits 550px left col */
  transform-origin: top center;
}

.hub-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hub-line {
  stroke: rgba(0, 180, 220, 0.28);
  stroke-width: 1.5;
  stroke-dasharray: 5 7;
}

/* Stackbox center card */
.hub-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 170px;
  height: 170px;
  background: linear-gradient(145deg, #0b1220, #162033);
  border: 1.5px solid rgba(0, 245, 181, 0.55);
  border-radius: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow:
    0 3px 0 rgba(0,245,181,0.15),
    0 6px 0 rgba(0,245,181,0.10),
    0 9px 0 rgba(0,245,181,0.06),
    0 12px 24px rgba(0,0,0,0.35),
    0 0 40px rgba(0, 232, 255, 0.20),
    inset 0 0 30px rgba(0, 224, 162, 0.08);
  z-index: 3;
}

.hub-center img {
  width: 130px;
  image-rendering: crisp-edges;
}

/* System nodes — kein Kartenrahmen, frei positioniert */
.hub-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  transition: transform 0.3s ease;
  z-index: 2;
  cursor: default;
}

.hub-node:hover {
  transform: translate(-50%, calc(-50% - 6px));
}

.hub-node:hover .hub-node-icon {
  transform: perspective(600px) rotateX(-14deg);
  box-shadow:
    0 4px 0 #e0e0e0,
    0 8px 0 #d4d4d4,
    0 12px 0 #c8c8c8,
    0 16px 0 #bcbcbc,
    0 22px 32px rgba(0,0,0,0.20);
}

.hub-node-icon {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 24px;
  padding: 20px;
  transform: perspective(600px) rotateX(-10deg);
  box-shadow:
    0 3px 0 #e2e2e2,
    0 6px 0 #d8d8d8,
    0 9px 0 #cecece,
    0 12px 0 #c4c4c4,
    0 16px 24px rgba(0,0,0,0.16);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hub-node-icon svg,
.hub-node-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hub-node-icon i {
  font-size: 5.2rem;
  color: #1e293b;
  line-height: 1;
}

.hub-node span:not(.hub-node-vendor) {
  font-size: 2.2rem;
  font-weight: 700;
  color: #0A0E14;
  text-align: center;
  line-height: 1.2;
}

.hub-node-vendor {
  font-size: 1.5rem;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Node positions — center (550,530), radius 360px, 6 nodes at 60° starting -90° */
.hub-node.asset    { top: 170px; left: 550px; }
.hub-node.finance  { top: 350px; left: 862px; }
.hub-node.cpms     { top: 710px; left: 862px; }
.hub-node.custom   { top: 890px; left: 550px; }
.hub-node.crm      { top: 710px; left: 238px; }
.hub-node.field    { top: 350px; left: 238px; }

/* Labels oben für obere Nodes (asset, finance, field) */
.hub-node.asset,
.hub-node.finance,
.hub-node.field    { flex-direction: column-reverse; }

/* 2-column responsive — shrink left col + hub proportionally */
.hub-visual-col { flex: 0 0 550px; height: 530px; } /* 1060×0.5 */

@media (max-width: 1200px) {
  .hub-visual-col { flex-basis: 466px; height: 466px; } /* 1060×0.44 */
  .hub-wrapper    { transform: scale(0.44); }
}
@media (max-width: 1050px) {
  .hub-layout     { gap: 3rem; }
  .hub-visual-col { flex-basis: 424px; height: 424px; } /* 1060×0.4 */
  .hub-wrapper    { transform: scale(0.4); }
}

/* Single-column — hub stacks above text */
@media (max-width: 900px) {
  .hub-layout {
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
  }
  .hub-text-col {
    text-align: center;
    width: 100%;
    max-width: 680px;
  }
  .hub-visual-col { flex: none; width: 100%; height: 816px; } /* 1060×0.77 */
  .hub-wrapper    { transform: scale(0.77); }
}
@media (max-width: 715px) {
  .hub-visual-col { height: 594px; } /* 1060×0.56 */
  .hub-wrapper    { transform: scale(0.56); }
}
@media (max-width: 572px) {
  .hub-visual-col { height: 477px; } /* 1060×0.45 */
  .hub-wrapper    { transform: scale(0.45); }
}
@media (max-width: 440px) {
  .hub-visual-col { height: 371px; } /* 1060×0.35 */
  .hub-wrapper    { transform: scale(0.35); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hub-svg circle { display: none; }
}