:root {
  --paper: #e9eef5;
  --ink: #0e1a3a;
  --muted: #4b5878;
  --accent: #2d3bff;
  --line: #9aa6c4;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1a3a;
    --ink: #e9eef5;
    --muted: #a3afcf;
    --accent: #8a95ff;
    --line: #3b4a78;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 4rem);
  width: 100%;
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem);
}

.wordmark {
  margin: 0;
  font-size: clamp(3.25rem, 11vw, 9rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.status {
  margin: clamp(1rem, 2.5vw, 2rem) 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
  font-weight: 500;
  color: var(--muted);
}
.status::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
}

.net { width: 100%; height: auto; max-height: 70svh; }
.edges path { stroke: var(--line); stroke-width: 2; }
.nodes circle { fill: var(--ink); }
.nodes .hub { fill: var(--accent); }

/* One orchestrated load sequence: lines draw, then nodes appear */
@media (prefers-reduced-motion: no-preference) {
  .edges path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 1.1s cubic-bezier(.6, 0, .2, 1) forwards;
  }
  .edges path:nth-child(2) { animation-delay: .15s; }
  .edges path:nth-child(3) { animation-delay: .3s; }
  .edges path:nth-child(4) { animation-delay: .3s; }
  .edges path:nth-child(5) { animation-delay: .45s; }
  .edges path:nth-child(6) { animation-delay: .6s; }

  .nodes circle {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: pop .5s ease-out forwards;
    animation-delay: 1.1s;
  }
  .nodes .hub { animation-delay: .9s; }
  .status::before { animation: blink 2.4s ease-in-out 1.8s infinite; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
@keyframes blink { 50% { opacity: .25; } }

.foot {
  padding: 1rem clamp(1.5rem, 5vw, 4rem) 1.5rem;
  max-width: 78rem;
  width: 100%;
  margin: 0 auto;
  color: var(--muted);
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

@media (max-width: 720px) {
  .stage { grid-template-columns: 1fr; align-content: center; }
  .net { max-width: 22rem; }
}
