:root {
  --ink: #12323a;
  --muted: #6d8588;
  --green: #29f07e;
  --green-2: #a6ff69;
  --paper: #eaf0ef;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: #dbe6e5;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button { font: inherit; }

.experience {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #d7e3e2;
}

.stage {
  --mx: 0px;
  --my: 0px;
  position: relative;
  isolation: isolate;
  width: 100vw;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(20,72,66,.055) 1px, transparent 1px),
    linear-gradient(rgba(20,72,66,.055) 1px, transparent 1px),
    radial-gradient(circle at 50% 48%, rgba(255,255,255,.95) 0 12%, rgba(239,245,244,.76) 35%, transparent 67%),
    linear-gradient(145deg, #d3dfde 0%, #f4f7f6 46%, #dce8e6 100%);
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.stage::before,
.stage::after {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: -2;
  pointer-events: none;
}

.stage::before {
  opacity: .3;
  background: repeating-linear-gradient(115deg, transparent 0 84px, rgba(255,255,255,.7) 85px 87px, transparent 88px 172px);
  transform: translate3d(calc(var(--mx) * -.3), calc(var(--my) * -.3), 0);
}

.stage::after {
  box-shadow: inset 0 0 160px rgba(15,55,57,.13), inset 0 0 22px rgba(255,255,255,.7);
}

.ambient {
  position: absolute;
  z-index: -1;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .34;
  pointer-events: none;
}

.ambient-a { left: -20vw; top: -20vw; background: #9db1ae; }
.ambient-b { right: -22vw; bottom: -20vw; background: #c4f8d4; }

.grain {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

.scanline {
  position: absolute;
  z-index: 19;
  left: 0;
  right: 0;
  height: 17%;
  pointer-events: none;
  opacity: .22;
  background: linear-gradient(180deg, transparent, rgba(111,255,157,.32), transparent);
  animation: scan 7s linear infinite;
}

.particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.particles i {
  position: absolute;
  display: block;
  min-width: 1px;
  min-height: 1px;
  background: #47ef74;
  box-shadow: 0 0 8px rgba(45,255,115,.7);
  animation: particle-flicker 2.4s steps(1) infinite;
}
.particles i:nth-child(3n) { background: #fff; box-shadow: none; }
.particles i:nth-child(5n) { transform: rotate(90deg); }

.hud {
  position: absolute;
  z-index: 30;
  top: 22px;
  left: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
}

.hud-title { display: flex; align-items: center; gap: 8px; }
.hud-title em { color: #39b665; font-style: normal; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: live 1.2s ease-in-out infinite; }

.hud-status {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
  color: #658084;
}
.hud-status b { color: #159250; }
.hud-status span { padding-left: 10px; border-left: 1px solid rgba(21,63,66,.22); }

.pause-button {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 82px;
  padding: 9px 12px;
  border: 1px solid rgba(34,83,79,.16);
  border-radius: 999px;
  color: #2d5253;
  background: rgba(255,255,255,.48);
  backdrop-filter: blur(10px);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(26,59,57,.08);
}
.pause-button:hover { background: #fff; transform: translateY(-1px); }
.pause-symbol { width: 9px; height: 9px; border-left: 3px solid #1aa85b; border-right: 3px solid #1aa85b; }
.play-symbol { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid #1aa85b; }

.diagram {
  position: absolute;
  z-index: 3;
  width: min(94vw, 88vh, 980px);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate3d(calc(-50% + var(--mx) * .12), calc(-50% + var(--my) * .12), 0);
  transition: transform .12s ease-out;
}

.wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wires path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cable-shadow { stroke: rgba(32,61,61,.2); stroke-width: 38; filter: url(#cableBlur); transform: translateY(12px); }
.cable-shell { stroke: #cad6d5; stroke-width: 28; }
.cable-core { stroke: #e5eceb; stroke-width: 20; }
.cable-ribs { stroke: #9db0af; stroke-width: 29; stroke-dasharray: 1 20; opacity: .55; }
.energy-path {
  stroke: #5cff8e;
  stroke-width: 3;
  stroke-dasharray: 3 31;
  opacity: .8;
  filter: url(#greenGlow);
  animation: energy 2.4s linear infinite;
  animation-delay: var(--path-delay);
}
.reverse .energy-path { animation-direction: reverse; }

.source-layer { position: absolute; inset: 0; }
.source-card {
  --lift: 0px;
  position: absolute;
  width: 22%;
  height: 8.8%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: card-arrive .8s cubic-bezier(.2,.8,.2,1) both, card-float 4s ease-in-out infinite;
  animation-delay: var(--card-delay), calc(var(--card-delay) + .8s);
}
.source-card:hover { --lift: -7px; z-index: 5; }
.card-stack,
.card-face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(51,105,97,.17);
  border-radius: 14px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card-stack { background: #ced9d7; box-shadow: 0 10px 18px rgba(25,55,53,.19); }
.stack-two { transform: translateY(calc(13px + var(--lift))); border-color: rgba(42,244,112,.7); }
.stack-one { transform: translateY(calc(7px + var(--lift))); background: #dce5e3; }
.card-face {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: #31a762;
  background: linear-gradient(145deg, rgba(251,253,252,.95), rgba(218,228,226,.92));
  box-shadow: inset 0 1px 1px white, 0 8px 20px rgba(23,60,57,.13);
  transform: translateY(var(--lift));
  overflow: hidden;
}
.source-card:hover .card-face { box-shadow: inset 0 1px 1px white, 0 12px 30px rgba(23,60,57,.2), 0 0 0 1px rgba(47,250,116,.45); }
.card-face::after { content: ""; position: absolute; inset: 0; transform: translateX(-110%) skewX(-24deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: sheen 5s ease-in-out infinite; animation-delay: var(--card-delay); }
.card-face > b { font-size: clamp(8px, 1.15vw, 14px); letter-spacing: .04em; white-space: nowrap; }
.source-icon { position: relative; display: grid; place-items: center; width: 31px; height: 31px; flex: none; border: 1px solid #3bad6b; border-radius: 3px; color: #2ca761; box-shadow: 0 3px 0 #b3c6bd; }
.app-icon i { font-size: 16px; font-style: normal; font-weight: 800; }
.browser-icon b { position: absolute; top: 0; left: 3px; font-size: 7px; line-height: 7px; letter-spacing: 0; }
.browser-icon i { width: 21px; height: 13px; border: 1px solid currentColor; margin-top: 6px; }
.database-icon { border: 0; box-shadow: none; gap: 2px; }
.database-icon i { width: 24px; height: 6px; border: 1px solid currentColor; border-radius: 50%; box-shadow: 0 2px 0 rgba(36,152,85,.18); }
.box-icon { border-radius: 1px; }
.box-icon::before { content: "⌄"; font-size: 20px; margin-top: -5px; }
.box-icon i { position: absolute; left: 5px; right: 5px; bottom: 6px; border-bottom: 1px solid currentColor; }
.signal { margin-left: auto; display: flex; align-items: end; gap: 2px; }
.signal i { width: 2px; background: #51df80; animation: signal 1.2s ease-in-out infinite; }
.signal i:nth-child(1) { height: 4px; }
.signal i:nth-child(2) { height: 7px; animation-delay: .14s; }
.signal i:nth-child(3) { height: 10px; animation-delay: .28s; }

.hub {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 49%;
  width: 21%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  transform: translate(-50%, -50%);
  cursor: pointer;
  filter: drop-shadow(0 25px 18px rgba(12,57,53,.24));
}
.hub-shadow,
.hub-rim,
.hub-light,
.hub-core { position: absolute; border-radius: 50%; }
.hub-shadow { inset: 4% -3% -8% 4%; background: #173f42; box-shadow: 12px 15px 0 #0d2d32; }
.hub-rim { inset: 0; background: linear-gradient(145deg, #baff7b 0%, #24f47b 46%, #087062 100%); box-shadow: inset 0 -9px 15px rgba(4,65,54,.5), 0 0 28px rgba(39,255,119,.28); animation: hub-breathe 2.6s ease-in-out infinite; }
.hub-light { inset: 5%; background: #daf0e6; box-shadow: inset 0 5px 10px #fff, inset 0 -6px 14px #7a9c99; }
.hub-core { inset: 10%; overflow: hidden; background: radial-gradient(circle at 45% 35%, #0b5364 0%, #043d4d 50%, #022d39 100%); box-shadow: inset 0 0 22px rgba(0,8,12,.7); }
.hub-core::before { content: ""; position: absolute; inset: -30%; background: conic-gradient(transparent, rgba(72,255,146,.18), transparent 30%); animation: rotate 4s linear infinite; }
.hub-mark { position: absolute; inset: 27% 20%; display: flex; align-items: center; filter: drop-shadow(3px 5px 2px rgba(0,0,0,.4)); }
.hub-mark i { display: block; width: 52%; height: 58%; background: #061f2b; clip-path: polygon(0 0, 63% 0, 100% 50%, 63% 100%, 0 100%, 38% 50%); }
.hub-mark i + i { margin-left: -12%; }
.hub-orbit { position: absolute; pointer-events: none; border-radius: 50%; border: 1px solid rgba(43,238,121,.34); }
.orbit-one { inset: -8%; border-left-color: transparent; animation: rotate 4.5s linear infinite; }
.orbit-two { inset: -15%; border-color: transparent; border-top-color: rgba(46,236,121,.2); border-bottom-color: rgba(46,236,121,.3); animation: rotate 7s linear reverse infinite; }
.hub:hover { transform: translate(-50%, -50%) scale(1.04); }

.integration-grid {
  position: absolute;
  z-index: 7;
  left: 8%;
  right: 8%;
  top: 76%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2.4% 3%;
}
.integration {
  position: relative;
  aspect-ratio: 1.25;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: tile-in .65s cubic-bezier(.18,.75,.3,1.2) both;
  animation-delay: calc(.6s + var(--tile-delay));
}
.tile-stack,
.tile-face,
.tile-light { position: absolute; inset: 0; border-radius: 12px; transition: transform .2s ease, box-shadow .2s ease; }
.tile-stack { transform: translateY(10px); background: #c3d0ce; border: 1px solid #40eb78; box-shadow: 0 11px 14px rgba(26,63,58,.18); }
.tile-face { display: grid; place-items: center; background: linear-gradient(150deg, #f7faf9, #dce6e4); border: 1px solid rgba(44,89,84,.13); box-shadow: inset 0 1px 2px white; }
.tile-face b { color: var(--brand); font-family: Arial, sans-serif; font-size: clamp(17px, 2.8vw, 35px); line-height: 1; filter: drop-shadow(0 2px 1px rgba(12,45,41,.12)); }
.tile-light { inset: auto 13% -5px; height: 3px; border-radius: 999px; background: #4fff83; box-shadow: 0 0 10px #52ff86; animation: tile-light 1.9s ease-in-out infinite; animation-delay: var(--tile-delay); }
.integration:hover { z-index: 3; }
.integration:hover .tile-face { transform: translateY(-7px) rotateX(5deg); box-shadow: inset 0 1px 2px white, 0 15px 25px rgba(26,63,58,.17), 0 0 0 1px #51ec82; }
.integration:hover .tile-stack { transform: translateY(13px); }

.legend {
  position: absolute;
  z-index: 25;
  left: 28px;
  right: 28px;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #688184;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .17em;
}
.legend span { display: flex; align-items: center; gap: 7px; }
.legend-pulse { width: 15px; height: 2px; background: #33ed78; box-shadow: 0 0 8px #36ee78; animation: live 1.2s ease-in-out infinite; }

.is-paused *, .is-paused *::before, .is-paused *::after { animation-play-state: paused !important; }

@keyframes energy { to { stroke-dashoffset: -68; } }
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(690%); } }
@keyframes live { 50% { opacity: .35; transform: scale(.75); } }
@keyframes signal { 50% { opacity: .25; transform: scaleY(.65); } }
@keyframes particle-flicker { 0%, 42%, 100% { opacity: .1; } 15%, 55% { opacity: .9; } 16%, 54% { opacity: .2; } }
@keyframes sheen { 0%, 70% { transform: translateX(-120%) skewX(-24deg); } 87%, 100% { transform: translateX(135%) skewX(-24deg); } }
@keyframes hub-breathe { 50% { box-shadow: inset 0 -9px 15px rgba(4,65,54,.5), 0 0 42px rgba(39,255,119,.46); } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes tile-light { 50% { opacity: .35; transform: scaleX(.7); } }
@keyframes card-arrive { from { opacity: 0; transform: translateY(-22px) scale(.92); } }
@keyframes card-float { 50% { transform: translateY(-3px); } }
@keyframes tile-in { from { opacity: 0; transform: translateY(24px) scale(.82); } }

@media (max-aspect-ratio: 4/5) {
  .diagram { width: min(112vw, 79vh); }
  .hud-status { display: none; }
  .hud { top: 16px; left: 16px; right: 16px; }
  .legend { left: 16px; right: 16px; bottom: 14px; }
  .legend span:nth-child(2) { display: none; }
}

@media (max-width: 620px) {
  .source-card { width: 25%; }
  .source-card:nth-child(1) { left: 1% !important; }
  .source-card:nth-child(4) { left: 74% !important; }
  .card-face { padding: 6px; gap: 4px; }
  .source-icon { width: 24px; height: 24px; }
  .signal { display: none; }
  .integration-grid { left: 3%; right: 3%; gap: 5% 2%; }
  .tile-stack, .tile-face, .tile-light { border-radius: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .diagram { transition: none; }
}
