/* Landing page ("Night watch", 2026-11-23 redesign): one dark theme in the mark's colours.
   Tokens come from /static/shared/css/theme-a.css; shared controls, wordmark and footer live in /static/site/css/site.css.
   Motion contract (tests/test_web_motion.py): only transform and opacity ever transition or animate; every duration and delay is a token;
   no outline: 0/none; no decorative loops; all urls are same-origin /static/ paths. */

/* Pull the first night sky band cleanly behind the floating glass pill bar */
.landing .nw-story {
  position: relative;
  margin-top: -68px;
}

.landing .nw-story .stage {
  position: relative;
  isolation: isolate;
}

/* ---------- hero type & copy ---------- */
.hero-title {
  font-size: clamp(2.25rem, 4.2vw, 3.875rem);
  line-height: 1.04;
  color: var(--foreground);
}

.hero-title .line {
  display: block;
  white-space: nowrap;
}

.hero-title .w {
  display: inline-block;
}

.landing h2.d {
  font-size: clamp(1.875rem, 3.4vw, 2.875rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.nw-lead {
  margin-top: 16px;
  max-width: 54ch;
  color: var(--a-ink-step);
  font-size: 1.125rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.nw-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- icons ---------- */
.nw-ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nw-ic-s {
  width: 16px;
  height: 16px;
}

.nw-story .glyph,
.nw-proof .glyph {
  width: 12px;
  height: 12px;
  flex: none;
}

/* ---------- cards, chips, tiles, spotlight & border beam ---------- */
.nw-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #111112, var(--surface-1) 46%);
  box-shadow: 0 30px 60px -36px #000;
}

.nw-card::before {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.26), transparent);
  pointer-events: none;
}

.nw-tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: var(--a-hi);
  color: var(--a-ink-step);
}

.nw-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--a-r-pill);
  background: var(--surface-3);
  color: var(--a-ink-step);
  font: 600 12px/1 var(--a-font);
  letter-spacing: 0;
  white-space: nowrap;
}

.nw-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid;
  border-radius: var(--a-r-pill);
  font: 650 13px/1 var(--a-font);
  white-space: nowrap;
}

.nw-chip .glyph {
  width: 10px;
  height: 10px;
}

.nw-chip .nw-ic {
  width: 13px;
  height: 13px;
}

.c-up {
  color: var(--mint);
  background: rgba(81, 240, 168, 0.1);
  border-color: rgba(81, 240, 168, 0.28);
}

.c-partial {
  color: var(--partial);
  background: rgba(255, 120, 165, 0.1);
  border-color: rgba(255, 120, 165, 0.3);
}

.c-down {
  color: var(--fail-ink);
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.36);
}

.c-change {
  color: var(--info);
  background: rgba(95, 208, 255, 0.1);
  border-color: rgba(95, 208, 255, 0.28);
}

.c-warn {
  color: var(--warn);
  background: rgba(245, 196, 81, 0.1);
  border-color: rgba(245, 196, 81, 0.3);
}

/* Spotlight: follows pointer inside a card using opacity only */
.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(81, 240, 168, 0.075), transparent 70%);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-nw);
  pointer-events: none;
}

@media (hover: hover) {
  .spot:hover::after {
    opacity: 1;
  }
}

/* Border Beam: one GPU-composited lap of light round an edge (transform + opacity only), then gone */
.beam-ring {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.beam-ring::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220%;
  aspect-ratio: 1;
  margin: -110% 0 0 -110%;
  background: conic-gradient(from 0deg, transparent 0 72%, var(--beam, var(--mint)) 90%, transparent 100%);
  opacity: 0;
}

@keyframes nw-lap {
  0% {
    transform: rotate(20deg);
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: rotate(380deg);
    opacity: 0;
  }
}

/* ---------- the start form ---------- */
.start {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 8px;
  max-width: 500px;
  padding: 6px;
  border: 1px solid var(--field-edge);
  border-radius: 32px;
  background: var(--surface-1);
  box-shadow: var(--a-hi);
}

.nw-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-left: 14px;
  color: var(--muted-foreground);
  cursor: text;
}

.nw-field input {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 0;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-size: 16px;
}

.nw-field input:focus-visible {
  outline: 2px solid transparent;
}

.nw-field input::placeholder {
  color: var(--muted-foreground);
  opacity: 1;
}

.start .btn {
  height: 48px;
  padding: 0 22px;
  border-radius: var(--a-r-pill);
  font-size: 16px;
}

.start:focus-within {
  border-color: var(--mint);
  box-shadow: var(--a-hi), 0 0 0 4px rgba(81, 240, 168, 0.14);
}

.start:focus-within .nw-field .nw-ic {
  color: var(--mint);
}

.start.bad {
  border-color: var(--fail);
  box-shadow: var(--a-hi), 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.note-err {
  grid-column: 1 / -1;
  padding: 6px 14px 8px;
  color: var(--fail-ink);
  font-size: 14px;
  font-weight: 500;
}

@media (hover: hover) {
  .start:hover:not(:focus-within):not(.bad) {
    border-color: #8a8a8a;
  }
}

@media (forced-colors: active) {
  .start:focus-within {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}

/* ---------- skies: stars and constellations (class renamed to .starfield to avoid retired class names) ---------- */
.starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}

.vault .starfield {
  inset: 0 auto auto auto;
  right: calc(var(--a-gutter) - 340px);
  width: 1160px;
  height: 640px;
}

.starfield .sd {
  fill: #fff;
}

.starfield .d1 {
  opacity: 0.3;
}

.starfield .d2 {
  opacity: 0.55;
}

.starfield .d3 {
  opacity: 0.9;
}

.starfield .cl {
  fill: none;
  stroke: rgba(240, 240, 240, 0.4);
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.starfield .cv {
  fill: #f4f4f4;
}

.starfield .cv.lit {
  fill: var(--mint);
}

.starfield .ch {
  fill: rgba(255, 255, 255, 0.09);
}

.starfield .ch.lit {
  fill: rgba(81, 240, 168, 0.14);
}

html.motion .starfield .tw {
  animation: nw-tw var(--t-twinkle) ease-in-out 1;
}

html.motion .starfield .tw:nth-of-type(4n) {
  animation-delay: var(--t-d1100);
}

html.motion .starfield .tw:nth-of-type(4n+1) {
  animation-delay: var(--t-d2300);
}

html.motion .starfield .tw:nth-of-type(4n+2) {
  animation-delay: var(--t-d500);
}

@keyframes nw-tw {
  50% {
    opacity: 0.25;
  }
}

/* ---------- the story: pinned stage whose six steps follow native scroll ---------- */
.ground {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(54% 46% at 74% 96%, rgba(81, 240, 168, 0.1), transparent 72%),
    radial-gradient(46% 38% at 16% 0%, rgba(255, 255, 255, 0.04), transparent 70%),
    linear-gradient(180deg, #000 0%, #040505 62%, #000 100%);
}

.ground::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/static/shared/img/grain.svg");
  opacity: 0.36;
}

.ground::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.7));
}

.ground .ribbon {
  inset: 76px 0 auto 0;
  height: 96px;
  -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent 52%);
  mask-image: linear-gradient(90deg, #000 30%, transparent 52%);
}

.stage-in {
  width: var(--a-wrap);
  margin-inline: auto;
  padding: 150px 0 0;
}

.copy {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 22px;
  max-width: 560px;
}

.nw-lede {
  max-width: 31em;
  color: var(--a-ink-step);
  font-size: 1.1875rem;
  line-height: 1.5;
  text-wrap: balance;
}

.copy .start {
  width: 100%;
  margin-top: 4px;
}

.nw-plan {
  max-width: 46ch;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.5;
  text-wrap: balance;
}

.show {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.vault {
  grid-area: 1 / 1;
  position: relative;
  z-index: 0;
  overflow: hidden;
  margin: -70px calc(-1 * var(--a-gutter)) 0;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 96%), linear-gradient(90deg, transparent, #000 72px);
  mask-image: linear-gradient(180deg, #000 62%, transparent 96%), linear-gradient(90deg, transparent, #000 72px);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  transition: opacity var(--t-slow) var(--ease-nw);
}

.nw-scene {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  padding-top: 6px;
}

.site {
  width: min(100%, 400px);
  padding: 14px 16px 6px;
  z-index: 2;
}

.site-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
}

.site-name {
  display: grid;
  min-width: 0;
  margin-right: auto;
}

.site-name b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.site-name small {
  color: var(--muted-foreground);
  font-size: 13px;
}

.nw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  border-top: 1px solid var(--a-line-soft);
  font-size: 13.5px;
}

.nw-row .k {
  color: var(--muted-foreground);
}

.swap {
  display: grid;
  justify-items: end;
  align-items: center;
}

.swap>* {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity var(--t-fast) var(--ease-nw);
}

.swap.v {
  font-weight: 600;
}

.v-up .glyph {
  color: var(--mint);
}

.v-partial {
  color: var(--partial);
}

.v-down {
  color: var(--fail-ink);
}

.v-change {
  color: var(--info);
}

.v-warn {
  color: var(--warn);
}

.v-quiet {
  color: var(--a-ink-step);
  font-weight: 500;
}

.strip {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  width: 152px;
  height: 14px;
}

.tk {
  border-radius: 2px;
  background: rgba(81, 240, 168, 0.5);
}

.strip .tk:nth-child(12) {
  background: var(--mint);
}

.tk.t-partial {
  background: var(--partial);
}

.tk.t-down {
  background: var(--fail);
}

.mk {
  position: absolute;
  left: 0;
  top: -8px;
  width: calc((100% + 3px) / 12);
  height: calc(100% + 8px);
  opacity: 0;
  color: var(--info);
  transition: transform var(--t-slow) var(--ease-nw), opacity var(--t-med) var(--ease-nw);
}

.mk::after {
  content: "";
  position: absolute;
  left: calc(50% - 2px);
  top: 4px;
  bottom: -2px;
  width: 1px;
  background: var(--info);
}

.mk .glyph {
  position: absolute;
  left: calc(50% - 5.5px);
  top: -4px;
  width: 8px;
  height: 8px;
}

.port {
  position: absolute;
  left: calc(50% - 7px);
  bottom: -8px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--mint);
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 4px rgba(81, 240, 168, 0.12);
}

.port::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--mint);
  transition: transform var(--t-med) var(--ease-nw);
}

.coast {
  width: min(100%, 520px);
  height: auto;
  margin-top: -1px;
  overflow: visible;
}

.coast .rock {
  fill: #0b0c0c;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 0.8;
}

.coast .tower {
  stroke: rgba(255, 255, 255, 0.13);
  stroke-width: 0.8;
}

.coast .rim {
  fill: none;
  stroke: rgba(255, 255, 255, 0.34);
  stroke-width: 0.9;
  stroke-linecap: round;
}

.coast .band {
  fill: rgba(255, 255, 255, 0.08);
}

.coast .door {
  fill: #000;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 0.7;
}

.coast .fin {
  fill: none;
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 0.9;
  stroke-linecap: round;
}

.coast .win {
  fill: var(--mint);
  opacity: 0.55;
}

.coast .deck {
  fill: #1b1d1c;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 0.7;
}

.coast .room {
  fill: #020403;
  stroke: rgba(255, 255, 255, 0.34);
  stroke-width: 0.9;
}

.coast .cap {
  fill: #121413;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 0.8;
  stroke-linejoin: round;
}

.coast .lens {
  fill: var(--mint);
}

.coast .halo,
.coast .refl,
.coast .farglow,
.coast .win {
  transition: opacity var(--t-slow) var(--ease-nw);
}

.coast .ripple {
  fill: rgba(255, 255, 255, 0.07);
}

.coast .farlight rect {
  fill: #1d1f1e;
}

.coast .farlight circle {
  fill: var(--mint);
  opacity: 0.8;
}

.coast .b-up,
.coast .b-part,
.coast .b-fail,
.coast .flag {
  transition: opacity var(--t-slow) var(--ease-nw);
}

.coast .b-part,
.coast .b-fail,
.coast .flag {
  opacity: 0;
}

.coast .b-core {
  stroke: var(--mint);
  stroke-width: 1;
  stroke-opacity: 0.7;
  stroke-linecap: round;
}

.coast .b-dash {
  stroke-width: 1.2;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
}

.coast .b-dash.part {
  stroke: var(--partial);
}

.coast .b-dash.fail {
  stroke: var(--fail);
  stroke-opacity: 0.8;
}

.coast .f-part {
  stroke: var(--partial);
  fill: var(--partial);
}

.coast .f-part path {
  stroke: none;
}

.coast .f-part circle {
  fill: none;
}

.coast .f-fail {
  fill: var(--fail);
  stroke: #000;
  stroke-width: 1;
  paint-order: stroke;
}

.coast .pulse {
  fill: #d9ffec;
  opacity: 0;
}

html.motion .stage.go .pulse {
  animation: nw-travel var(--t-travel) var(--ease-nw-io) 2;
}

html.motion .stage.go .pulse2 {
  animation-delay: var(--t-d250);
}

html.motion .stage.go .pulse3 {
  animation-delay: var(--t-d500);
}

@keyframes nw-travel {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }

  14% {
    opacity: 0.95;
  }

  80% {
    opacity: 0.7;
  }

  100% {
    transform: translate(var(--dx), var(--dy));
    opacity: 0;
  }
}

/* what each step does to the scene */
.stage[data-step="2"] .bm1 .b-up,
.stage[data-step="3"] .b-up {
  opacity: 0;
}

.stage[data-step="2"] .bm1 .b-part,
.stage[data-step="3"] .b-fail {
  opacity: 1;
}

.stage[data-step="2"] .bc1 .f-part,
.stage[data-step="3"] .f-fail {
  opacity: 1;
}

.stage[data-step="2"] .bc1 .lens {
  fill: #5a3a45;
}

.stage[data-step="3"] .lens {
  fill: #2a2c2b;
}

.stage[data-step="2"] .bc1 .halo,
.stage[data-step="2"] .bc1 .refl,
.stage[data-step="3"] .halo,
.stage[data-step="3"] .refl,
.stage[data-step="3"] .farglow {
  opacity: 0;
}

.stage[data-step="2"] .bc1 .win,
.stage[data-step="3"] .win {
  opacity: 0;
}

.stage[data-step="2"] .bm1 .pulse,
.stage[data-step="3"] .pulse {
  display: none;
}

.stage[data-step="2"] .port {
  border-color: var(--partial);
  box-shadow: 0 0 0 4px rgba(255, 120, 165, 0.12);
}

.stage[data-step="2"] .port::after {
  background: var(--partial);
  transform: scale(0.7);
}

.stage[data-step="3"] .port {
  border-color: var(--fail);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.stage[data-step="3"] .port::after {
  background: var(--fail);
  transform: scale(0.45);
}

.stage[data-step="3"] .vault {
  opacity: 0.34;
}

/* the phone: quiet until there is something to say */
.side {
  display: none;
  position: relative;
  z-index: 1;
}

html.scrub .side {
  display: grid;
  align-items: start;
}

.phone {
  position: relative;
  width: 100%;
  height: min(100%, 448px);
  padding: 15px 10px 14px;
  overflow: hidden;
  border: 1px solid #323335;
  border-radius: 34px;
  background: linear-gradient(180deg, #0d0d0e, #060606 58%);
  box-shadow: inset 0 0 0 4px #000, inset 0 0 0 5px rgba(255, 255, 255, 0.05), inset 0 6px 0 -4px rgba(255, 255, 255, 0.1), 0 34px 60px -34px #000;
}

.ph-top {
  display: grid;
  justify-items: center;
  padding: 2px 0 10px;
}

.ph-top::before {
  content: "";
  width: 50px;
  height: 6px;
  border-radius: 3px;
  background: #1b1c1d;
  box-shadow: inset 0 1px 0 #000;
  margin-bottom: 20px;
}

.ph-clock {
  display: inline-flex;
  font-size: 38px;
  font-weight: 460;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums;
  font-feature-settings: "zero" 0, "tnum" 0;
}

.ph-clock .dg {
  display: inline-block;
  min-width: 0.5em;
  text-align: center;
}

.ph-clock .colon {
  width: 0.3em;
  text-align: center;
  transform: translateY(-0.06em);
}

.ph-quiet {
  margin-top: 14px;
  color: var(--muted-foreground);
  font-size: 12.5px;
  line-height: 1.3;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-nw);
}

.stage[data-step="0"] .ph-quiet,
.stage[data-step="1"] .ph-quiet,
.stage[data-step="2"] .ph-quiet {
  opacity: 1;
  transition: opacity var(--t-med) var(--ease-nw) var(--t-d160);
}

.ph-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: -20px;
}

.nw-note {
  position: relative;
  grid-column: 1;
  padding: 10px 11px 11px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #151516, #101011);
  box-shadow: var(--a-hi);
  font-size: 12.5px;
  line-height: 1.38;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--t-fast) var(--ease-nw), transform var(--t-fast) var(--ease-nw);
}

.n-down {
  grid-row: 1;
}

.n-up {
  grid-row: 2;
}

.n-sec {
  grid-row: 1 / span 2;
  align-self: start;
}

.stage[data-step="3"] .n-down,
.stage[data-step="4"] .n-down,
.stage[data-step="4"] .n-up,
.stage[data-step="5"] .n-sec {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: opacity var(--t-med) var(--ease-nw) var(--t-d150), transform var(--t-slow) var(--ease-nw) var(--t-d150);
}

.stage[data-step="4"] .n-up {
  transition-delay: var(--t-d260), var(--t-d260);
}

.note-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.note-head b {
  color: var(--a-ink-step);
  font-weight: 600;
}

.note-head time {
  margin-left: auto;
}

.mark-s {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 4px;
}

.note-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.28em;
  margin-top: 7px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.note-title>span {
  white-space: nowrap;
}

.ev {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--a-line-soft);
  color: var(--a-ink-step);
  font-size: 12px;
}

.ev li {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.ev .glyph {
  width: 9px;
  height: 9px;
  margin: 4px 2px 0;
}

.ev .nw-ic {
  width: 13px;
  height: 13px;
  margin-top: 2px;
}

.g-down {
  color: var(--fail-ink);
}

.g-change {
  color: var(--info);
}

.g-up {
  color: var(--mint);
}

.g-warn {
  color: var(--warn);
}

.n-down .beam-ring {
  --beam: var(--fail-ink);
}

.n-sec .beam-ring {
  --beam: var(--warn);
}

html.motion .stage[data-step="3"] .n-down .beam-ring,
html.motion .stage[data-step="5"] .n-sec .beam-ring {
  opacity: 1;
}

html.motion .stage[data-step="3"] .n-down .beam-ring::before,
html.motion .stage[data-step="5"] .n-sec .beam-ring::before {
  animation: nw-lap var(--t-lap) linear var(--t-d350) 1 both;
}

/* progress rail: six stops and a line that fills with the scroll */
.nw-rail {
  position: relative;
  display: none;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
}

html.scrub .nw-rail {
  display: flex;
}

.rail-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  border-radius: 1px;
  background: var(--border);
  overflow: hidden;
}

.rail-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--a-mint-deep), var(--mint));
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

.stop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-foreground);
  font-size: 12.5px;
}

.stop b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stop .glyph,
.stop .nw-ic {
  width: 9px;
  height: 9px;
  opacity: 0.55;
  transition: transform var(--t-med) var(--ease-nw), opacity var(--t-fast) var(--ease-nw);
}

.stop .nw-ic {
  width: 12px;
  height: 12px;
}

@media (max-width: 360px) {
  .nw-rail {
    gap: 4px;
  }

  .stop {
    gap: 3px;
    font-size: 11px;
  }

  .stop .glyph {
    width: 7px;
    height: 7px;
  }

  .stop .nw-ic {
    width: 10px;
    height: 10px;
  }
}

.s-up .glyph {
  color: var(--mint);
}

.s-change .glyph {
  color: var(--info);
}

.s-partial .glyph {
  color: var(--partial);
}

.s-down .glyph {
  color: var(--fail-ink);
}

.s-warn .nw-ic,
.s-warn .glyph {
  color: var(--warn);
}

.nw-steps {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.nw-step {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-1);
}

.when {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 22px;
  line-height: 1;
}

.when .glyph {
  width: 11px;
  height: 11px;
}

.when .nw-ic {
  width: 16px;
  height: 16px;
}

.say h3 {
  font-size: 1.25rem;
  line-height: 1.16;
  letter-spacing: -0.022em;
}

.say p {
  margin-top: 6px;
  color: var(--a-ink-step);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}

.mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--a-line-soft);
}

.mini .mk {
  opacity: 1;
}

.eg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 14px;
  color: var(--muted-foreground);
  font-size: 13px;
}

.nw-hint {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--a-ink-step);
}

html.scrub .nw-hint {
  display: inline-flex;
  transition: opacity var(--t-med) var(--ease-nw);
}

html.scrub .stage:not([data-step="0"]) .nw-hint {
  opacity: 0;
}

/* scroll mode: one caption at a time, handed over cleanly */
html.scrub .nw-steps {
  margin-top: 16px;
  gap: 0;
}

html.scrub .nw-step {
  grid-area: 1 / 1;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0;
  padding: 0;
  border: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--t-fast) var(--ease-nw), transform var(--t-fast) var(--ease-nw);
}

html.scrub .when {
  display: none;
}

html.scrub .say h3 {
  font-size: 1.375rem;
}

html.scrub .mini {
  display: none;
}

html.scrub .show-track {
  height: calc(100svh + 290svh);
}

html.scrub .show {
  position: sticky;
  top: 0;
  height: 100svh;
  padding-top: 82px;
}

@media (max-width: 1099px) {
  html.scrub .coast {
    max-height: clamp(132px, calc(100svh - 560px), 190px);
  }

  html.scrub .side {
    display: block;
    grid-area: 1 / 1;
    align-self: end;
    z-index: 3;
    height: var(--ch, 150px);
  }

  .phone {
    position: absolute;
    inset: 0;
    height: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .ph-top {
    display: none;
  }

  .ph-list {
    display: block;
    margin: 0;
  }

  .phone .nw-note {
    position: absolute;
    left: 0;
    right: 0;
    top: 18px;
  }

  .phone .n-up {
    top: auto;
    bottom: 4px;
    box-shadow: var(--a-hi), 0 -16px 28px -10px #000;
  }

  .stage[data-step="4"] .n-down {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity var(--t-fast) var(--ease-nw), transform var(--t-fast) var(--ease-nw);
  }

  .coast {
    transition: opacity var(--t-med) var(--ease-nw);
  }

  .stage[data-step="3"] .coast,
  .stage[data-step="5"] .coast {
    opacity: 0;
  }

  .show {
    max-width: 560px;
    margin-inline: auto;
  }

  html.scrub .show {
    align-content: center;
    padding-bottom: 24px;
  }

  .show-track {
    margin-top: 40px;
  }

  .ground .ribbon {
    inset: 72px 0 auto 0;
    height: 64px;
    -webkit-mask-image: none;
    mask-image: none;
  }

  html:not(.scrub) .show-track {
    margin-top: 72px;
  }
}

/* wide screens: the whole first screen is the stage; copy left, the night right */
@media (min-width: 1100px) {
  html.scrub .nw-story {
    height: calc(100svh + 300vh);
  }

  html.scrub .nw-story .stage {
    position: sticky;
    top: 0;
    height: 100svh;
    min-height: 620px;
    overflow: hidden;
  }

  .stage-in {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 48px;
    align-items: center;
    padding: 84px 0 20px;
  }

  html.scrub .stage-in {
    height: 100%;
  }

  html:not(.scrub) .stage-in {
    align-items: start;
    padding: 200px 0 60px;
  }

  html:not(.scrub) .copy {
    position: sticky;
    top: 200px;
  }

  html.scrub .show-track {
    display: contents;
    height: auto;
  }

  html.scrub .show {
    position: relative;
    height: auto;
    padding-top: 0;
    grid-template-columns: minmax(0, 1fr) 216px;
    grid-template-rows: none;
    column-gap: 20px;
  }

  .vault {
    grid-area: 1 / 1 / 2 / 3;
    margin: -96px calc(-1 * max(var(--a-gutter), (100vw - 1240px) / 2)) 0 -60px;
  }

  .vault .starfield {
    right: calc(max(var(--a-gutter), (100vw - 1240px) / 2) - 340px);
  }

  html.scrub .side {
    grid-area: 1 / 2;
    margin: 0;
    min-height: 0;
    padding-top: 6px;
  }

  .nw-rail,
  .nw-steps,
  .eg {
    grid-column: 1 / -1;
  }

  html.scrub .eg {
    order: 0;
  }

  html:not(.scrub) .nw-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html.scrub .coast {
    max-height: max(140px, calc(100svh - 470px));
  }
}

@media (min-width: 1100px) and (max-height: 779px) {
  .ground .ribbon {
    display: none;
  }

  html.scrub .stage-in {
    padding-top: 76px;
  }

  html.scrub .nw-hint {
    display: none;
  }

  .copy {
    gap: 18px;
  }
}

@media (min-width: 1100px) and (max-width: 1279px) {
  .site-head .nw-tile {
    display: none;
  }

  html:not(.scrub) .mini .strip {
    width: 132px;
  }
}

/* ---------- Night Watch sections (What it watches, Proof, Close) ---------- */
.nw-sec {
  position: relative;
  isolation: isolate;
  padding: 128px 0 0;
}

.nw-sec::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("/static/shared/img/grain.svg");
  opacity: 0.34;
}

.nw-watch {
  background: radial-gradient(50% 30% at 82% 8%, rgba(81, 240, 168, 0.055), transparent 70%);
}

.nw-proof {
  background: radial-gradient(46% 30% at 12% 18%, rgba(255, 255, 255, 0.03), transparent 70%);
}

.nw-sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  align-items: end;
  margin-bottom: 44px;
}

.sec-sky {
  position: relative;
  height: 220px;
}

.band-sky {
  display: none;
  position: relative;
  height: 84px;
}

.nw-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 48px;
}

.rl-t {
  display: grid;
  gap: 3px;
}

.rl-t>b {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.012em;
  color: var(--foreground);
}

.rl-t>span {
  color: var(--a-ink-step);
  font-size: 15px;
  line-height: 1.45;
}

.nw-after {
  margin-top: 28px;
}

.panels {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.nw-panel {
  padding: 22px 22px 20px;
}

.nw-panel>figcaption,
.nw-panel>header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 17px;
}

.nw-panel b {
  font-weight: 650;
  letter-spacing: -0.012em;
}

.plot-box {
  position: relative;
}

.plot {
  width: 100%;
  height: auto;
  overflow: visible;
  cursor: crosshair;
  touch-action: pan-y;
}

.plot .grid {
  stroke: rgba(255, 255, 255, 0.065);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.plot .grid-base {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.plot .y-lbl {
  fill: var(--muted-foreground);
  font: 500 10.5px/1 var(--a-font);
  font-variant-numeric: tabular-nums;
}

.plot .ser-area {
  opacity: 0.9;
}

.plot .ser {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.plot .ser1 {
  stroke: var(--mint);
  stroke-width: 2.25;
}

.plot .ser2 {
  stroke: var(--info);
  stroke-width: 1.75;
  stroke-opacity: 0.92;
}

.plot .ser3 {
  stroke: #a5b4fc;
  stroke-width: 1.5;
  stroke-opacity: 0.78;
  stroke-dasharray: 4 3.5;
}

.plot .dot.ser1 {
  fill: var(--mint);
  stroke: #0a0a0a;
  stroke-width: 1.5;
}

.plot .dot.ser2 {
  fill: var(--info);
  stroke: #0a0a0a;
  stroke-width: 1.5;
}

.plot .dot.ser3 {
  fill: #a5b4fc;
  stroke: #0a0a0a;
  stroke-width: 1.5;
}

.plot .dot-halo {
  fill: var(--mint);
  opacity: 0.22;
}

.plot .outage {
  stroke: none;
}

.plot .outage-edge {
  stroke: var(--fail);
  stroke-width: 1.5;
  stroke-opacity: 0.85;
  vector-effect: non-scaling-stroke;
}

.plot .outage-side {
  stroke: rgba(239, 68, 68, 0.32);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.plot .outage-pill-bg {
  fill: rgba(20, 8, 10, 0.88);
  stroke: rgba(239, 68, 68, 0.42);
  stroke-width: 1;
}

.plot .outage-pill-dot {
  fill: var(--fail);
}

.plot .outage-pill-txt {
  fill: #fecaca;
  font: 600 11px/1 var(--a-font);
  font-variant-numeric: tabular-nums;
}

.plot .chg {
  stroke: var(--info);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
  stroke-opacity: 0.75;
  vector-effect: non-scaling-stroke;
}

.plot .chg-pill-bg {
  fill: rgba(7, 22, 32, 0.92);
  stroke: rgba(95, 208, 255, 0.42);
  stroke-width: 1;
}

.plot .chg-d {
  fill: var(--info);
}

.plot .chg-txt {
  fill: #bae6fd;
  font: 600 10.5px/1 var(--a-font);
  font-variant-numeric: tabular-nums;
}

.plot .cross {
  stroke: rgba(255, 255, 255, 0.36);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-nw);
}

.plot .hover-pt {
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-nw);
  pointer-events: none;
}

.chart.on .cross,
.chart.on .hover-pt.is-live {
  opacity: 1;
}

.x-axis {
  position: relative;
  height: 22px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.x-axis span {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
}

.x0 {
  left: 13.57%;
}

.x1 {
  left: 37.86%;
}

.x2 {
  left: 62.14%;
}

.x3 {
  left: 86.43%;
}

.readout {
  min-height: 3em;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--a-line-soft);
  color: var(--a-ink-step);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 1100px) {
  .readout {
    min-height: 1.5em;
  }
}

.key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 8px;
  color: var(--a-ink-step);
  font-size: 13px;
}

.key li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.key .k-reg {
  gap: 5px;
}

.key .k-reg .sw:last-of-type {
  margin-right: 3px;
}

.sw {
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: var(--mint);
  border: 0;
}

.sw2 {
  background: var(--info);
}

.sw3 {
  width: 14px;
  height: 0;
  background: none;
  border-top: 2px dashed #a5b4fc;
  border-radius: 0;
}

.k-change .glyph {
  color: var(--info);
}

.k-down .glyph {
  color: var(--fail-ink);
}

.why {
  display: flex;
  flex-direction: column;
}

.why dl {
  display: grid;
  margin-bottom: 16px;
}

.why dl>div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  padding: 18px 0;
  border-top: 1px solid var(--a-line-soft);
  font-size: 15px;
  line-height: 1.45;
}

.why dl>div:last-child {
  border-bottom: 1px solid var(--a-line-soft);
}

.why dt {
  color: var(--muted-foreground);
  font-size: 14px;
}

.conf {
  position: relative;
  top: -1px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  color: var(--muted-foreground);
  font-size: 13px;
  white-space: nowrap;
}

.conf i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--a-ink-step);
}

.conf i.o {
  background: none;
  box-shadow: inset 0 0 0 1px var(--muted-foreground);
  margin-right: 3px;
}

.why blockquote {
  margin-top: auto;
  padding: 4px 0 4px 16px;
  border-left: 2px solid var(--a-mint-deep);
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.55;
}

.why blockquote span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-foreground);
  font-size: 13px;
}

/* ---------- the close: the mark is the lamp ---------- */
.nw-close {
  padding: 110px 0 120px;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(50% 44% at 50% 100%, rgba(81, 240, 168, 0.08), transparent 72%);
}

.close-sky {
  position: relative;
  height: 250px;
}

.close-in {
  display: grid;
  justify-items: center;
  margin-top: -112px;
}

.lamp {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 118px;
}

.lamp-mark {
  position: relative;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 34px rgba(81, 240, 168, 0.2);
}

.lamp-line {
  position: absolute;
  left: 50%;
  top: 36px;
  width: min(560px, 86vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(81, 240, 168, 0.85) 30%, rgba(81, 240, 168, 0.85) 70%, transparent);
  transform: translateX(-50%);
}

.lamp-cone {
  position: absolute;
  left: 50%;
  top: 36px;
  width: min(560px, 86vw);
  height: 150px;
  background: linear-gradient(180deg, rgba(81, 240, 168, 0.3), rgba(81, 240, 168, 0.06) 55%, transparent 92%);
  clip-path: polygon(8% 0, 92% 0, 74% 100%, 26% 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 30%, #000 70%, transparent 96%);
  mask-image: linear-gradient(90deg, transparent 4%, #000 30%, #000 70%, transparent 96%);
  transform: translateX(-50%);
}

.nw-close .nw-lead {
  margin-inline: auto;
  max-width: 44ch;
}

.nw-close .start {
  width: min(100%, 500px);
  margin-top: 28px;
  text-align: left;
}

.nw-close .nw-plan {
  margin-top: 14px;
  max-width: none;
}

.landing .close-line {
  font-size: clamp(2.5rem, 5.6vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.036em;
}

/* ---------- motion: one-shot arrivals (transform and opacity only, all durations are tokens) ---------- */
html.motion .hero-title .w {
  opacity: 0.01;
  transform: translateY(0.28em);
  animation: nw-word var(--t-word) var(--ease-nw) forwards;
}

html.motion .hero-title .line:nth-child(1) .w:nth-child(2) {
  animation-delay: var(--t-d60);
}

html.motion .hero-title .line:nth-child(1) .w:nth-child(3) {
  animation-delay: var(--t-d120);
}

html.motion .hero-title .line:nth-child(1) .w:nth-child(4) {
  animation-delay: var(--t-d180);
}

html.motion .hero-title .line:nth-child(2) .w:nth-child(1) {
  animation-delay: var(--t-d270);
}

html.motion .hero-title .line:nth-child(2) .w:nth-child(2) {
  animation-delay: var(--t-d330);
}

html.motion .hero-title .line:nth-child(2) .w:nth-child(3) {
  animation-delay: var(--t-d390);
}

@keyframes nw-word {
  to {
    opacity: 1;
    transform: none;
  }
}

html.motion .copy> :not(.hero-title) {
  animation: nw-rise var(--t-rise) var(--ease-nw) both;
  animation-delay: var(--t-d420);
}

html.motion .copy>.start {
  animation-delay: var(--t-d500);
}

html.motion .copy>.nw-plan {
  animation-delay: var(--t-d570);
}

html.motion .copy>.btn-quiet {
  animation-delay: var(--t-d640);
}

html.motion .show {
  animation: nw-fade var(--t-fade) var(--ease-nw) var(--t-d240) both;
}

@keyframes nw-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes nw-fade {
  from {
    opacity: 0;
  }
}

html.motion .rv {
  opacity: 0;
  transform: translateY(14px);
}

html.motion .rv.in,
html.motion .rv:focus-within {
  opacity: 1;
  transform: none;
  transition: opacity var(--t-rv-op) var(--ease-nw), transform var(--t-rv-mv) var(--ease-nw);
}

html.motion .lamp.rv .lamp-cone {
  opacity: 0;
  transform: translateX(-50%) scaleX(0.5);
  transform-origin: 50% 0;
}

html.motion .lamp.rv.in .lamp-cone {
  opacity: 1;
  transform: translateX(-50%);
  transition: opacity var(--t-lamp-op) var(--ease-nw) var(--t-d200), transform var(--t-lamp-mv) var(--ease-nw) var(--t-d200);
}

html.motion .lamp.rv .lamp-line {
  opacity: 0;
  transform: translateX(-50%) scaleX(0.2);
}

html.motion .lamp.rv.in .lamp-line {
  opacity: 1;
  transform: translateX(-50%);
  transition: opacity var(--t-line-op) var(--ease-nw), transform var(--t-line-mv) var(--ease-nw);
}

/* ---------- narrower screens ---------- */
@media (max-width: 899px) {
  .nw-sec {
    padding-top: 96px;
  }

  .nw-sec-head {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 32px;
  }

  .sec-sky {
    display: none;
  }

  .band-sky {
    display: block;
  }

  .nw-rows,
  .panels {
    grid-template-columns: 1fr;
  }

  .nw-close {
    padding-top: 80px;
  }

  .why blockquote {
    margin-top: 16px;
  }
}

@media (max-width: 599px) {
  .stage-in {
    padding-top: 142px;
  }

  .copy {
    gap: 18px;
  }

  .nw-lede {
    font-size: 1.0625rem;
  }

  .start {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .start .btn {
    width: 100%;
  }

  .nw-field input {
    height: 46px;
  }

  .copy .btn-quiet {
    width: 100%;
  }

  .nw-after .btn-quiet {
    width: auto;
  }

  .nw-lead {
    font-size: 1.03125rem;
  }

  .nw-panel {
    padding: 18px 16px 16px;
  }

  .why dl>div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .rowlink {
    gap: 14px;
    padding-inline: 2px;
  }

  .when {
    font-size: 24px;
  }

  html.scrub .say h3 {
    font-size: 1.1875rem;
  }

  .site {
    padding-inline: 14px;
  }

  .strip {
    width: 132px;
  }
}

@media (max-width: 420px) {
  .site-head .nw-tile {
    display: none;
  }
}

@media (max-width: 359px) {
  .site-name b {
    white-space: normal;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.2;
  }

  .hero-title {
    font-size: 1.9375rem;
  }

  .strip {
    width: 112px;
  }
}

@media (prefers-reduced-motion: reduce) {

  html.motion .hero-title .w,
  html.motion .rv {
    opacity: 1;
    transform: none;
  }
}

:root[data-motion="off"] .hero-title .w,
:root[data-motion="off"] .rv {
  opacity: 1;
  transform: none;
}

@media print {

  .ground,
  .vault,
  .sec-sky,
  .band-sky,
  .close-sky {
    display: none;
  }

  .landing .nw-story {
    margin-top: 0;
  }
}