/* ==========================================================================
   Background: blueprint grid behind the header, and the infrastructure
   sketches that draw themselves across the page (see sketches.js).
   ========================================================================== */

.blueprint {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 0;
  height: 46rem;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  animation: drift 90s linear infinite;
}

@keyframes drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 120px 120px, 120px 120px, 120px 120px, 120px 120px; }
}

/* Sketch layer ----------------------------------------------------------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.fly {
  --fly-opacity: 0.65;
  position: absolute;
  opacity: var(--fly-opacity);
  animation: life 11s linear forwards;
}

@keyframes life {
  0%, 80% { opacity: var(--fly-opacity); }
  100% { opacity: 0; }
}

/* Blueprint drawing style for every sketch SVG. */
.schematic {
  display: block;
  width: 100%;
  height: auto;
}

.schematic * {
  fill: none;
  stroke: var(--schem);
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.schematic text {
  fill: var(--schem);
  stroke: none;
  font-family: var(--body);
  font-size: 12px;
}

/* Dash-dot boundary lines (e.g. a VPC), faded in after the outline draws. */
.schematic .center { stroke-dasharray: 10 4 2 4; }

/* Outlines draw themselves via pathLength="1" on each shape. */
.schematic .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: sketch 3.6s 0.2s ease-in-out forwards;
}

@keyframes sketch { to { stroke-dashoffset: 0; } }

.fly text,
.fly .center {
  opacity: 0;
  animation: fade-in 800ms 2.6s forwards;
}

/* Responsive & motion ---------------------------------------------------- */

@media (max-width: 40rem) {
  .fly { --fly-opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .blueprint { animation: none; }
  .schematic .draw { animation: none; stroke-dashoffset: 0; }
}
