/* Entry artwork shares the image area, leaving all navigation in its own layer. */
.network-opening {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.opening-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.opening-portrait {
  display: none;
}

.opening-strand,
.opening-crossings,
.desk-evidence,
.desk-plate-corners {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.opening-strand {
  --strand-colour: #ffcf86;
  --point-colour: #fff1c9;
  --passage-time: 7.8s;
  --lag: -2.9s;
}

.strand-fork {
  --strand-colour: #c0dbca;
  --point-colour: #e5f7e7;
  --passage-time: 6.8s;
  --lag: -1.1s;
}

.strand-return {
  --strand-colour: #edb67b;
  --passage-time: 9.6s;
  --lag: -6.4s;
}

.opening-strand path,
.opening-crossings,
.desk-evidence path,
.desk-plate-corners path {
  vector-effect: non-scaling-stroke;
}

.strand-bed {
  stroke: var(--strand-colour);
  stroke-width: .9;
  opacity: .64;
}

.strand-light,
.strand-traveller {
  animation: opening-current var(--passage-time) linear var(--lag) infinite;
}

.strand-light {
  stroke: var(--strand-colour);
  stroke-width: 1.8;
  stroke-dasharray: 3.25 96.75;
  opacity: .86;
}

.strand-traveller {
  stroke: var(--point-colour);
  stroke-width: 3.6;
  stroke-dasharray: .16 99.84;
  animation-name: opening-leading-point;
}

.opening-crossings {
  stroke: #dccea1;
  stroke-width: .75;
  opacity: .44;
}

.junction-centre {
  fill: #ffe2a7;
}

.junction-bloom {
  fill: #f4c47d;
  opacity: .17;
  animation: opening-halo 5.1s ease-in-out var(--lag) infinite;
}

.opening-pollen {
  fill: #ffe1a3;
  opacity: .58;
  animation: opening-air var(--life) ease-in-out var(--lag) infinite;
}

@keyframes opening-current {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -100; }
}

@keyframes opening-leading-point {
  from { stroke-dashoffset: -3.15; }
  to { stroke-dashoffset: -103.15; }
}

@keyframes opening-halo {
  0%, 100% { opacity: .13; }
  48% { opacity: .35; }
}

@keyframes opening-air {
  0% { opacity: 0; transform: translate(0, 3px); }
  26% { opacity: .81; }
  78% { opacity: .59; }
  100% { opacity: 0; transform: translate(var(--drift), var(--lift)); }
}

/* Match the fitted photograph, including its 58% / 47% crop at every ratio.
   The fallback still centres the overlay on browsers without container units. */
.desk-opening-art {
  container-type: size;
}

.desk-registered {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  --cast-x: 24px;
  --cast-y: -22px;
  --cast-scale: 1;
}

@supports (width: 1cqw) {
  .desk-registered {
    inset: auto;
    left: 58%;
    top: 47%;
    width: max(100cqw, 150cqh);
    height: max(100cqh, 66.666667cqw);
    transform: translate(-58%, -47%);
  }
}

.desk-evidence-tie {
  stroke: #f6ce94;
  stroke-width: 1.1;
  opacity: .6;
  animation: desk-read-marks 8s ease-in-out infinite;
}

.evidence-second {
  animation-delay: -2.2s;
}

.desk-evidence-trace {
  stroke: #ffdea4;
  stroke-width: 1.8;
  stroke-dasharray: 16 84;
  animation: opening-current 4.7s linear -.4s infinite;
}

.reading-centre {
  fill: #fff0ca;
}

.reading-halo {
  fill: #ffae58;
  opacity: .25;
  animation: reading-halo 3.8s ease-in-out infinite;
}

.reading-ring {
  fill: none;
  stroke: #ffda98;
  stroke-width: .9;
  transform-origin: 0 0;
  animation: reading-aperture 3.8s ease-out -.65s infinite;
}

.desk-projection {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: desk-focus-pull 13.5s cubic-bezier(.32, 0, .24, 1) infinite;
}

.desk-plate-corners {
  stroke: #f2d3a2;
  opacity: .69;
  stroke-width: .95;
}

@keyframes reading-halo {
  0%, 100% { opacity: .18; }
  45% { opacity: .50; }
}

@keyframes reading-aperture {
  0% { opacity: .65; transform: scale(.65); }
  75%, 100% { opacity: 0; transform: scale(2.05); }
}

@keyframes desk-read-marks {
  0%, 100% { opacity: .35; }
  30% { opacity: .78; }
  63% { opacity: .32; }
}

@keyframes desk-focus-pull {
  0%, 5% { opacity: 0; transform: translate(0, 0) scale(.26); }
  14% { opacity: .72; }
  31% { opacity: .99; transform: translate(var(--cast-x), var(--cast-y)) scale(var(--cast-scale)); }
  49% { opacity: .99; }
  65% { opacity: 0; transform: translate(var(--cast-x), var(--cast-y)) scale(calc(var(--cast-scale) + .045)); }
  100% { opacity: 0; transform: translate(0, 0) scale(.26); }
}

@media (max-width: 650px) {
  .opening-wide { display: none; }
  .opening-portrait { display: block; }
  .opening-portrait .strand-bed { opacity: .73; }
  .opening-portrait .strand-light { stroke-width: 1.55; }
  .opening-portrait .strand-traveller { stroke-width: 2.85; }
  .opening-portrait .strand-return {
    --strand-colour: #c9d9b5;
    --point-colour: #fff1c5;
  }
  .desk-registered {
    --cast-x: -67px;
    --cast-y: -26px;
    --cast-scale: .91;
  }
}

@media (max-height: 485px) and (orientation: landscape) {
  .desk-registered {
    --cast-y: -5px;
    --cast-scale: .82;
  }
}

body:is(.motion-paused, .film-suspended, .film-inspecting) .network-opening * {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce), (scripting: none) {
  .network-opening * { animation: none !important; }
  .desk-projection { opacity: 0; }
  .opening-pollen { opacity: .34; }
  .strand-light, .strand-traveller { opacity: 0; }
}
