/* ==========================================================================
   HeyABRI V5 · MEMORY ROUTES · "the page's quiet network"         routes.css
   ==========================================================================
   Companion to routes.js (see its header for the visual grammar and the
   truth rules). Every rule here is scoped to .rt-on (set by routes.js) or to
   .rt-* elements that only routes.js creates, so if the script does not run,
   this file changes nothing on the page. Remove both include tags to remove
   the feature.

   Layers sit at z-index -1 inside their host (an isolated section or a
   sticky stage): above the section background, below every piece of
   content. They are aria-hidden, inert and never take pointer events.
   Section layers are `inset: 0` (the host's padding box) so they can never
   add scrollable overflow to clipped sections such as #trust and #waitlist.
   The soft edges under the sticky header and at quiet seams are per-layer
   masks set by routes.js.
   ========================================================================== */
/* Hosts that are not already stacking contexts: keep each layer's z-index -1
   inside its own section (above the section background). */
.rt-on #how,
.rt-on #tonight { isolation: isolate; }

.rt-layer {
  position: absolute;
  z-index: -1;
  display: block;
  max-width: none;
  overflow: hidden;               /* nothing paints outside the layer box */
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.rt-layer.rt-fill { inset: 0; width: 100%; height: 100%; }

/* Tones: existing inks only. --rt-lead is the one stroke ink per tone (a
   resting line shows it at ~.56 opacity ≈ .40 alpha); --rt-trace is the
   persistent field a moment leaves behind (≤ .09 alpha). */
.rt-light  { --rt-lead: rgb(47 107 63 / .72);  --rt-trace: rgb(47 107 63 / .085); --rt-fill: var(--afternoon, #F7F4EE); }
.rt-golden { --rt-lead: rgb(122 84 46 / .68);  --rt-trace: rgb(122 84 46 / .09);  --rt-fill: var(--golden, #F4E4CE); }
.rt-dark   { --rt-lead: rgb(240 163 90 / .60); --rt-trace: rgb(240 163 90 / .09); --rt-fill: var(--evening, #16110E); }
.rt-night  { --rt-lead: rgb(240 163 90 / .60); --rt-trace: rgb(240 163 90 / .09); --rt-fill: var(--night, #0F0C0A); }

.rt-ghost {                       /* the trace: appears once a moment has been reached */
  fill: none;
  stroke: var(--rt-trace);
  stroke-width: 1;
  stroke-linejoin: miter;
  opacity: 0;
  transition: opacity 1200ms ease;
}

/* One ink per tone (the lead ink); a resting line is the same ink at lower
   opacity, set by routes.js. Colour and width never change at runtime, so a
   state change is a style-only update (no SVG re-layout per frame). */
.rt-route {
  fill: none;
  stroke: var(--rt-lead);
  stroke-width: 1;
  stroke-linejoin: miter;
  stroke-linecap: butt;
  opacity: 0;
  /* routes.js sets one dash = the visible [start, end] of the route (real px) */
  transition: stroke-dasharray 520ms cubic-bezier(.33, 0, .15, 1), stroke-dashoffset 520ms cubic-bezier(.33, 0, .15, 1), opacity 900ms ease;
}
.rt-route.rt-fine { stroke-width: .75; }
/* Planned / pending: a dotted path that never reads as a built line. The
   dots themselves are placed by routes.js (on pixel centres, via the dash
   array); this is only the fallback before the first paint. */
.rt-route.rt-dot {
  stroke-dasharray: 0 5;
  stroke-linecap: round;
  stroke-width: 1.4;
  transition: opacity 700ms ease;
}

/* How it works: the lead stroke draws once along its route and, on a step
   change, drains toward the block it served. No loops. */
.rt-lead {
  fill: none;
  stroke: var(--rt-lead);
  stroke-width: 1.25;
  stroke-linejoin: miter;
  stroke-linecap: butt;
  stroke-dashoffset: var(--len, 0);
  opacity: 0;
  transition: stroke-dashoffset 1000ms cubic-bezier(.45, 0, .2, 1), opacity 500ms ease;
}
.rt-lead.on { stroke-dashoffset: 0; opacity: 1; }
.rt-lead.drain { stroke-dashoffset: calc(var(--len, 0) * -1); opacity: 0; transition: stroke-dashoffset 1100ms cubic-bezier(.4, 0, .6, 1), opacity 1100ms ease-in; }
.rt-lead.reset { transition: none !important; stroke-dashoffset: var(--len, 0); opacity: 0; }

/* Stations. Open ring = a stop (filled with the section colour, so the line
   ends cleanly at it); jn = a junction; solid = only by "In the prototype". */
.rt-node {
  fill: var(--rt-fill);
  stroke: var(--rt-lead);
  stroke-width: 1;
  opacity: 0;
  transition: opacity 900ms ease;
}
.rt-node.rt-jn { stroke-width: .9; }
.rt-node.rt-solid { fill: var(--rt-lead); stroke: none; }

/* First paint after a (re)build: no transitions, so nothing re-draws. */
.rt-init .rt-route, .rt-init .rt-node, .rt-init .rt-lead, .rt-init .rt-ghost { transition: none !important; }

/* Reduced motion: drawn once, static, one calm opacity (set by routes.js);
   no drawing transitions, no lead strokes, no traces. */
@media (prefers-reduced-motion: reduce) {
  .rt-route, .rt-node, .rt-ghost { transition: none !important; }
  .rt-lead, .rt-ghost { display: none; }
}
@media (forced-colors: active) { .rt-layer { display: none !important; } }
@media print { .rt-layer { display: none !important; } }
