/* ══════════════════════════════════════════
   CubeLabs — Shared Design System
   Font: Poppins (headings) + DM Sans (body)
   Theme: Deep Navy / Brand Blue
══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --bg:          #07091c;
  --bg2:         #0b0e24;
  --bg3:         #10142e;
  --bg4:         #141830;
  --blue-deep:   #1348a0;
  --blue-mid:    #1e72c8;
  --blue-lite:   #48a8e8;
  --blue-glow:   rgba(30,114,200,0.15);
  --blue-border: rgba(30,114,200,0.28);
  --text:        #edf2ff;
  --text2:       #7f94bb;
  --text3:       #424d6a;
  --border:      rgba(255,255,255,0.07);
  --radius:      3px;
  --radius-lg:   8px;
  --ff-head:     'Poppins', sans-serif;
  --ff-body:     'DM Sans', sans-serif;
  --ff-mono:     'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--blue-deep); border-radius: 3px; }

/* ── LAYOUT ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 48px; }
section { position: relative; overflow: hidden; }

/* ── GRID TEXTURE ── */
.grid-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(30,114,200,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,114,200,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: var(--ff-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--blue-lite);
  font-family: var(--ff-head);
}
.label::before {
  content: ''; display: block; width: 24px; height: 2px;
  background: var(--blue-mid); flex-shrink: 0;
}

.section-title {
  font-family: var(--ff-head);
  font-size: clamp(32px, 3.8vw, 52px);
  font-weight: 700; line-height: 1.15;
  letter-spacing: -0.025em;
  margin-top: 18px;
}
.section-sub {
  font-size: 17px; color: var(--text2); max-width: 580px;
  margin-top: 18px; font-weight: 300; line-height: 1.75;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue-mid));
  color: #fff; font-family: var(--ff-head);
  font-size: 14px; font-weight: 600;
  padding: 13px 28px; border-radius: var(--radius);
  text-decoration: none; border: none; cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}
.btn-primary:hover { opacity: 0.86; transform: translateY(-1px); }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text);
  font-family: var(--ff-head); font-size: 14px; font-weight: 600;
  padding: 13px 28px; border-radius: var(--radius);
  text-decoration: none; border: 1px solid var(--blue-border);
  transition: border-color 0.2s, color 0.2s;
  letter-spacing: 0.01em; cursor: pointer;
}
.btn-outline:hover { border-color: var(--blue-lite); color: var(--blue-lite); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--blue-lite);
  font-family: var(--ff-head); font-size: 14px; font-weight: 600;
  padding: 0; border: none; cursor: pointer; text-decoration: none;
  letter-spacing: 0.01em; transition: gap 0.2s;
}
.btn-ghost:hover { gap: 10px; }

/* ── TAGS ── */
.tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--blue-lite);
  background: rgba(72,168,232,0.08); border: 1px solid rgba(72,168,232,0.2);
  padding: 4px 10px; border-radius: 2px; font-family: var(--ff-head);
}
.tag-green { color: #4ade80; background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.2); }

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--blue-border);
  border-radius: var(--radius); padding: 8px 16px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.03em; color: var(--text2);
  font-family: var(--ff-head);
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; flex-shrink: 0; }

/* ── IMAGE PLACEHOLDER ── */
.img-placeholder {
  position: relative; overflow: hidden;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
}
.img-placeholder::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(30,114,200,0.04) 0px, rgba(30,114,200,0.04) 1px,
    transparent 1px, transparent 12px
  );
}
.img-placeholder-label {
  position: relative; z-index: 1;
  font-family: var(--ff-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.06em; color: var(--text3); text-transform: uppercase;
  background: var(--bg2); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 2px;
}
.img-placeholder-icon { position: relative; z-index: 1; opacity: 0.15; }
.img-placeholder-icon svg { width: 40px; height: 40px; stroke: var(--blue-lite); fill: none; stroke-width: 1; }

/* ── CODE WINDOW ── */
.code-window {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.code-window-header {
  background: var(--bg3); padding: 12px 20px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-r { background: #ff5f56; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #27c93f; }
.code-window-title { font-family: var(--ff-mono); font-size: 12px; color: var(--text3); margin-left: 6px; flex: 1; }
.code-window-lang {
  font-family: var(--ff-head); font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--blue-lite); background: var(--blue-glow);
  border: 1px solid var(--blue-border); padding: 3px 8px; border-radius: 2px;
}
.code-window-body {
  padding: 24px 28px; overflow-x: auto;
  font-family: var(--ff-mono); font-size: 13px; line-height: 1.85;
}
.code-window-body pre { white-space: pre-wrap; }
.c-comment { color: #424d6a; }
.c-key   { color: #48a8e8; }
.c-str   { color: #7ec8a4; }
.c-num   { color: #f9c26a; }
.c-fn    { color: #c9a0dc; }
.c-p     { color: var(--text2); }
.c-kw    { color: #ff9f7a; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(7,9,28,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  height: 68px;
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 48px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 34px; }
.nav-links { display: flex; align-items: center; gap: 0; list-style: none; }
.nav-links a {
  color: var(--text2); font-size: 13px; font-weight: 500;
  text-decoration: none; letter-spacing: 0em;
  font-family: var(--ff-head); padding: 8px 10px;
  transition: color 0.2s; border-radius: 3px;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .nav-links a { font-size: 12px; padding: 8px 8px; }
  .nav-cta { padding: 8px 14px !important; font-size: 12px !important; }
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--blue-lite); }
.nav-cta {
  background: var(--blue-mid) !important;
  color: #fff !important;
  padding: 9px 20px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  margin-left: 8px;
  transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--blue-lite) !important; color: #fff !important; }

/* ── TICKER ── */
.ticker-wrap {
  background: var(--bg3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 13px 0; overflow: hidden;
}
.ticker {
  display: flex; gap: 60px; white-space: nowrap;
  animation: ticker 35s linear infinite;
}
.ticker-item {
  font-family: var(--ff-head);
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text3);
  display: flex; align-items: center; gap: 12px;
}
.ticker-sep { color: var(--blue-mid); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── FOOTER ── */
footer {
  background: var(--bg3); border-top: 1px solid var(--border);
  padding: 72px 0 36px;
}
.footer-grid {
  display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr;
  gap: 64px; margin-bottom: 56px;
}
.footer-logo { height: 30px; margin-bottom: 20px; display: block; }
.footer-tagline { font-size: 14px; color: var(--text3); line-height: 1.75; max-width: 260px; font-weight: 300; margin-bottom: 24px; }
.footer-col-title {
  font-family: var(--ff-head); font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text); margin-bottom: 20px;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 11px; }
.footer-links a { font-size: 14px; color: var(--text3); text-decoration: none; transition: color 0.2s; font-weight: 300; }
.footer-links a:hover { color: var(--blue-lite); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.footer-copy { font-size: 13px; color: var(--text3); font-weight: 300; }
.footer-loc { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text3); font-weight: 300; }
.footer-loc svg { width: 13px; height: 13px; stroke: var(--text3); fill: none; stroke-width: 1.5; }

/* ── ICON BOX ── */
.icon-box {
  width: 48px; height: 48px;
  background: var(--blue-glow); border: 1px solid var(--blue-border);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-box svg { width: 22px; height: 22px; stroke: var(--blue-lite); stroke-width: 1.5; fill: none; }
.icon-box-sm { width: 36px; height: 36px; }
.icon-box-sm svg { width: 16px; height: 16px; }

/* ── STAT ── */
.stat-num {
  font-family: var(--ff-head); font-size: 48px; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-lite));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 12px; color: var(--text3); margin-top: 8px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--ff-head); }

/* ── CTA STRIP ── */
.cta-strip {
  background: linear-gradient(135deg, var(--blue-deep) 0%, #0f52a8 50%, var(--blue-mid) 100%);
  padding: 80px 0; position: relative; overflow: hidden;
}
.cta-strip::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 20px);
}
.cta-strip-inner { position: relative; z-index: 1; text-align: center; }
.cta-strip h2 {
  font-family: var(--ff-head); font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 700; color: #fff; margin-bottom: 16px; letter-spacing: -0.02em;
}
.cta-strip p { font-size: 17px; color: rgba(255,255,255,0.72); margin-bottom: 36px; font-weight: 300; }
.btn-white {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--blue-deep);
  font-family: var(--ff-head); font-size: 14px; font-weight: 700;
  padding: 14px 32px; border-radius: var(--radius);
  text-decoration: none; transition: opacity 0.2s;
}
.btn-white:hover { opacity: 0.9; }

/* ── SCROLL REVEAL ── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.65s cubic-bezier(0.22,1,0.36,1), transform 0.65s cubic-bezier(0.22,1,0.36,1); }
.reveal.visible { opacity: 1; transform: none; }

/* ── PAGE HERO ── */
.page-hero {
  padding: 140px 0 100px;
  background: var(--bg);
  position: relative; overflow: hidden;
}
.page-hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 70% at 50% 0%, rgba(19,72,160,0.28) 0%, transparent 70%);
}
.page-hero-title {
  font-family: var(--ff-head);
  font-size: clamp(42px, 5.5vw, 76px);
  font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.1; margin-top: 20px; margin-bottom: 24px;
}
.page-hero-sub {
  font-size: 18px; color: var(--text2); font-weight: 300;
  line-height: 1.75; max-width: 640px;
}

/* ── FORM ── */
.form-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 8px;
  font-family: var(--ff-head);
}
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 16px; font-family: var(--ff-body); font-size: 15px;
  color: var(--text); outline: none; transition: border-color 0.2s; -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--blue-mid); }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f94bb' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; cursor: pointer;
}
.form-textarea { min-height: 140px; resize: vertical; }
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-success {
  display: none; text-align: center; padding: 40px;
  background: rgba(74,222,128,0.07); border: 1px solid rgba(74,222,128,0.25);
  border-radius: var(--radius-lg);
}
.form-success h3 { font-family: var(--ff-head); font-size: 22px; color: #4ade80; margin-bottom: 10px; }
.form-success p { color: var(--text2); font-size: 15px; font-weight: 300; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); }

/* ── CHECK LIST ── */
.check-list { list-style: none; }
.check-list li {
  display: flex; align-items: flex-start; gap: 14px;
  font-size: 15px; color: var(--text2); padding: 11px 0;
  border-bottom: 1px solid var(--border); font-weight: 300; line-height: 1.6;
}
.check-list li::before {
  content: ''; width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2348a8e8' stroke-width='2'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ── FOOTER LEGAL LINKS ── */
.footer-legal-links {
  display: flex; align-items: center; gap: 12px;
}
.footer-legal-links a {
  font-size: 13px; color: var(--text3); text-decoration: none;
  font-weight: 300; transition: color 0.2s;
}
.footer-legal-links a:hover { color: var(--blue-lite); }

/* ── MOBILE NAV BURGER ── */
.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; padding: 8px;
  flex-shrink: 0;
}
.nav-burger span {
  display: block; width: 18px; height: 2px;
  background: var(--text2); border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE DRAWER ── */
/* Hidden entirely above 768px — only activated inside the media query */
.nav-drawer { display: none; }
.nav-drawer-links {
  list-style: none; padding: 24px 0;
}
.nav-drawer-links li { border-bottom: 1px solid var(--border); }
.nav-drawer-links a {
  display: block; padding: 18px 32px;
  font-family: var(--ff-head); font-size: 16px; font-weight: 600;
  color: var(--text2); text-decoration: none; transition: color 0.2s, background 0.2s;
  letter-spacing: 0.01em;
}
.nav-drawer-links a:hover,
.nav-drawer-links a.active { color: var(--text); background: rgba(30,114,200,0.08); }
.nav-drawer-cta {
  color: var(--blue-lite) !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .container { padding: 0 32px; }
  .nav-inner  { padding: 0 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 768px) {
  .container  { padding: 0 20px; }
  .nav-inner  { padding: 0 20px; }
  .nav-links  { display: none; }
  .nav-burger { display: flex; }
  .nav-drawer {
    display: block;
    position: fixed; top: 68px; left: 0; right: 0; bottom: 0;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    z-index: 199;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22,1,0.36,1);
    pointer-events: none;
  }
  .nav-drawer.open {
    transform: translateX(0);
    pointer-events: auto;
  }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .form-row   { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-title { letter-spacing: -0.02em; }
  .page-hero  { padding: 110px 0 64px; }
  .page-hero-title { letter-spacing: -0.025em; }
  .cta-strip  { padding: 56px 0; }
}

/* ═══════════ AQUAMORPHIC LAYER (matches smppcube.com) ═══════════ */
:root { --aqua: #38d6c4; --aqua-glow: rgba(56,214,196,0.12); }

/* soft pill buttons with glass depth */
body .btn-primary {
  border-radius: 100px;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue-mid) 62%, #22a0b4);
  box-shadow: 0 10px 28px -10px rgba(30,114,200,0.55), inset 0 1px 0 rgba(255,255,255,0.2);
}
body .btn-outline { border-radius: 100px; background: rgba(255,255,255,0.03); backdrop-filter: blur(8px); }
body .btn-white { border-radius: 100px; box-shadow: 0 10px 28px -12px rgba(0,0,0,0.4); }
body .nav-cta { border-radius: 100px !important; }
body .plan-cta { border-radius: 100px; }
body .badge { border-radius: 100px; background: rgba(16,20,46,0.55); backdrop-filter: blur(8px); }
body .tag { border-radius: 100px; }
body .icon-box { border-radius: 13px; }

/* glassier chrome */
nav { background: rgba(7,9,28,0.72); }
body .code-window {
  border-radius: 18px;
  background: rgba(11,14,36,0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 28px 64px -28px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.05);
}
body .form-input, body .form-select, body .form-textarea { border-radius: 12px; background: rgba(7,9,28,0.55); }

/* aqua-tinted glow + gradients */
.page-hero-glow {
  background:
    radial-gradient(ellipse 70% 70% at 50% 0%, rgba(19,72,160,0.30) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 82% 18%, var(--aqua-glow), transparent 70%);
}
body .stat-num {
  background: linear-gradient(135deg, var(--blue-mid), var(--aqua));
  -webkit-background-clip: text; background-clip: text;
}
body .cta-strip { background: linear-gradient(135deg, var(--blue-deep) 0%, #0f52a8 45%, #17869c 100%); }

/* rounded glass tiles with breathing room */
body .services-preview-grid, body .why-grid, body .process-steps, body .tech-grid,
body .sol-features-grid, body .use-cases-grid, body .features-grid,
body .plans-grid, body .how-grid, body .faq-grid, body .partner-cards,
body .expertise-grid, body .info-cards { gap: 14px; }
body .sp-card, body .why-card, body .process-step, body .tech-card, body .sol-feat,
body .use-case-card, body .feat-card, body .plan-card, body .how-step, body .faq-item,
body .partner-card, body .exp-card, body .info-card {
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
body .specs-grid { gap: 10px; }
body .spec-row { border-radius: 12px; }
body .stats-bar { border-radius: 16px; }
body .dash-mockup, body .dashboard-frame, body .hero-window, body .contact-form-wrapper { border-radius: 20px; }
body .contact-form-wrapper { background: rgba(11,14,36,0.7); backdrop-filter: blur(12px); }

/* ══════════════════════════════════════════════════════════════════════════
   DIAGRAMS — explanatory SVG figures (added 2026)
   Palette and motion follow the tokens above. Every animation is disabled
   under prefers-reduced-motion, and every figure carries a caption so it
   still communicates when motion is off.
   ══════════════════════════════════════════════════════════════════════════ */
.diagram-section { background: var(--bg2); }
.diagram-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(19,72,160,0.06), rgba(7,9,28,0));
  padding: 34px 30px 22px;
  margin-top: 34px;
  position: relative;
  overflow: hidden;
}
.diagram-wrap::before {
  content: ""; position: absolute; inset: -40% 30% auto; height: 220px;
  background: radial-gradient(closest-side, var(--blue-glow), transparent 70%);
  pointer-events: none;
}
.diagram-wrap svg { display: block; width: 100%; height: auto; position: relative; z-index: 1; }
.diagram-caption {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text3);
  border-top: 1px solid var(--border); margin-top: 20px; padding-top: 14px;
}
.diagram-legend {
  display: flex; flex-wrap: wrap; gap: 20px; margin-top: 16px;
  font-family: var(--ff-mono); font-size: 11px; color: var(--text2);
}
.diagram-legend span { display: inline-flex; align-items: center; gap: 7px; }
.diagram-legend i { width: 10px; height: 2px; border-radius: 2px; display: inline-block; }

/* SVG type roles */
.dg-node    { fill: var(--bg3); stroke: var(--blue-border); stroke-width: 1; }
.dg-node-hi { fill: rgba(19,72,160,0.22); stroke: var(--blue-lite); stroke-width: 1.2; }
.dg-title   { fill: var(--text); font-family: var(--ff-head); font-weight: 600; font-size: 13px; }
.dg-sub     { fill: var(--text2); font-family: var(--ff-mono); font-size: 9.5px; }
.dg-tag     { fill: var(--blue-lite); font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: .1em; }
.dg-line    { stroke: var(--blue-border); stroke-width: 1.4; fill: none; }
.dg-line-lo { stroke: rgba(127,148,187,0.28); stroke-width: 1.2; fill: none; stroke-dasharray: 4 4; }

/* motion */
@keyframes dg-travel  { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes dg-pulse   { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes dg-dash    { to { stroke-dashoffset: -16; } }
@keyframes dg-grow    { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.dg-packet { offset-rotate: 0deg; animation: dg-travel 4.5s cubic-bezier(.5,0,.5,1) infinite; }
.dg-flow   { stroke-dasharray: 6 10; animation: dg-dash 1.1s linear infinite; }
.dg-blink  { animation: dg-pulse 2.6s ease-in-out infinite; }
.dg-bar    { transform-origin: left center; animation: dg-grow 1.1s cubic-bezier(.22,1,.36,1) forwards; }

@media (prefers-reduced-motion: reduce) {
  .dg-packet, .dg-flow, .dg-blink, .dg-bar { animation: none !important; }
  .dg-bar { transform: none; }
}
@media (max-width: 720px) {
  .diagram-wrap { padding: 22px 16px 16px; }
  .diagram-legend { gap: 12px; font-size: 10px; }
}
