/* AdaptiveGraph — estilos compartidos (hero + /demo/graph) */

.ag-shell {
  position: relative;
}

.ag-canvas,
.ag-canvas svg,
.ag-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.ag-node__label {
  fill: rgba(12, 16, 24, 0.9);
  font-size: 3.1px;
  font-weight: 700;
  font-family: inherit;
  pointer-events: none;
}

.ag-node__label--hub {
  font-size: 3.4px;
}

.ag-node__sub {
  fill: rgba(58, 69, 88, 0.72);
  font-size: 2.15px;
  font-family: inherit;
  pointer-events: none;
}

.ag-node__core--pulse {
  animation: ag-pulse 3s ease-in-out infinite;
}

.ag-edge {
  stroke: rgba(21, 28, 42, 0.14);
  stroke-width: 0.28;
  fill: none;
}

.ag-edge--path {
  stroke: rgba(243, 128, 32, 0.45);
  stroke-width: 0.48;
  stroke-dasharray: 1.1 0.85;
}

.ag-edge--spoke {
  stroke: rgba(26, 107, 99, 0.22);
  stroke-width: 0.22;
}

.ag-edge--key {
  stroke: rgba(243, 128, 32, 0.42);
  stroke-width: 0.32;
}

.ag-node__hit {
  touch-action: none;
  cursor: grab;
}

.is-dragging .ag-node__hit {
  cursor: grabbing;
}

@keyframes ag-pulse {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.72; }
}

/* Info card */
.ag-card {
  position: absolute;
  right: 16px;
  top: 52px;
  z-index: 8;
  width: min(300px, calc(100% - 28px));
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(12px);
  animation: ag-card-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ag-card[hidden] {
  display: none !important;
}

@keyframes ag-card-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.ag-card__close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

.ag-card__eyebrow {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f38020;
}

.ag-card__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  padding-right: 20px;
}

.ag-card__desc {
  margin: 0 0 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #475569;
}

.ag-card__meta {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.ag-card__meta li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(243, 128, 32, 0.06);
}

.ag-card__meta strong {
  color: #334155;
}

.ag-card__meta span {
  color: #0f172a;
  font-weight: 650;
  text-align: right;
}

.ag-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  background: #f38020;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(243, 128, 32, 0.28);
}

.ag-card__link:hover {
  filter: brightness(1.05);
}

[data-theme="dark"] .ag-node__label,
[data-theme="dark"] .ag-node__label--hub {
  fill: rgba(248, 250, 252, 0.94);
}

[data-theme="dark"] .ag-node__sub {
  fill: rgba(203, 213, 225, 0.75);
}

[data-theme="dark"] .ag-edge {
  stroke: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .ag-card {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .ag-card__title {
  color: #f8fafc;
}

[data-theme="dark"] .ag-card__desc {
  color: #94a3b8;
}

[data-theme="dark"] .ag-card__meta li {
  background: rgba(243, 128, 32, 0.12);
}

[data-theme="dark"] .ag-card__meta strong {
  color: #cbd5e1;
}

[data-theme="dark"] .ag-card__meta span {
  color: #f8fafc;
}

/* Demo page */
.ag-demo-page {
  margin: 0;
  min-height: 100vh;
  background: #0b1220;
  color: #e2e8f0;
}

.ag-demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ag-demo-bar p {
  margin: 0;
  flex: 1;
  font-size: 0.86rem;
  color: #94a3b8;
}

.ag-demo-bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ag-demo-main {
  width: min(1100px, calc(100% - 32px));
  margin: 20px auto 40px;
}

.ag-demo-lead {
  font-size: 0.95rem;
  color: #94a3b8;
  max-width: 52rem;
  line-height: 1.5;
}

.ag-demo-shell {
  margin-top: 12px;
  min-height: 520px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.65);
}

.ag-demo-shell .ag-canvas,
.ag-demo-shell .ag-svg {
  min-height: 460px;
}

.ag-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

@media (max-width: 720px) {
  .ag-card {
    right: 10px;
    left: 10px;
    width: auto;
    top: auto;
    bottom: 12px;
  }
}
