/* Page frame: masthead, the live-topology hero, and the colophon. */

/* ── masthead ─────────────────────────────────────────────────────── */
.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  height: 64px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; }
.wordmark__mark {
  display: grid; place-items: center;
  width: 27px; height: 27px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--amber-ink);
  background: var(--amber);
  border-radius: var(--r-sm);
}
.wordmark__name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }

.nav { display: flex; gap: 2px; margin-left: auto; }
.nav__link {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 7px 11px;
  border-radius: var(--r-sm);
  color: var(--ink-mute);
  transition: color 0.16s ease, background 0.16s ease;
}
.nav__link:hover { color: var(--ink); background: var(--bg-raise); }
.nav__addr { font-size: 10px; color: var(--amber-lo); }
.nav__name { font-size: 14px; }
.nav__link:hover .nav__addr { color: var(--amber); }

.masthead__readout { display: inline-flex; align-items: baseline; gap: 8px; }
.readout__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--ink-mute); }

/* ── hero ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: calc(100svh - 64px);
  overflow: hidden;
}
.hero__field { position: absolute; inset: 0; z-index: 0; }
.hero__field .topo-wrap, .hero__field .topo { width: 100%; height: 100%; }

/* scrim that lifts the headline out of the graph, lower-left */
.hero::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(150% 125% at 4% 118%, var(--bg) 22%, color-mix(in srgb, var(--bg) 84%, transparent) 42%, transparent 66%),
    linear-gradient(0deg, color-mix(in srgb, var(--bg) 80%, transparent), transparent 26%);
}

.hero__frame {
  position: absolute;
  top: 34px; left: var(--gutter); right: var(--gutter);
  z-index: 2;
  display: flex; justify-content: space-between; gap: 16px;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
}
.hero__status { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-dim); }
.hero__loc { text-align: right; }

.hero__headline {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(40px, 7vh, 84px);
  z-index: 2;
  max-width: min(900px, 92vw);
  pointer-events: none;
}
.hero__headline a { pointer-events: auto; }
.hero__line {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  /* sized so the longest word ("INFRASTRUCTURE") fits on one line at every
     width down to ~320px — never breaks mid-word */
  font-size: clamp(1.6rem, 8.4vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero__line--amber { color: var(--amber); }
.hero__lede {
  margin-top: 22px;
  max-width: 44ch;
  color: var(--ink-dim);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.55;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero__hint {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(22px, 6vh, 44px);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  pointer-events: none;
}

/* ── topology svg ─────────────────────────────────────────────────── */
.topo { display: block; }
/* ?still capture mode: reveal everything instantly (no delayed fades to miss) */
.topo.is-still .topo__edge,
.topo.is-still .topo__node,
.topo.is-still .topo__proof { opacity: 1 !important; transition: none !important; }
.topo__grid line { stroke: var(--grid); stroke-width: 1; }

.topo__edge {
  stroke: var(--edge);
  stroke-width: 1;
  fill: none;   /* required for the bowed <path> edges in portrait */
  opacity: 0;
  transition: opacity 0.8s var(--ease), stroke 0.22s ease;
}
.topo.is-in .topo__edge { opacity: 1; }
.topo__edge.is-flow { stroke: color-mix(in srgb, var(--edge) 70%, var(--amber) 30%); }
.topo__edge.is-lit { stroke: var(--amber); stroke-width: 1.6; }
.topo.is-lifted .topo__edge:not(.is-lit) { opacity: 0.16; }

.topo__pulse { fill: var(--amber); }

.topo__node {
  opacity: 0;
  transition: opacity 0.7s var(--ease);
  cursor: default;
}
.topo__node[role="link"] { cursor: pointer; }
.topo.is-in .topo__node { opacity: 1; }
.topo.is-lifted .topo__node.is-dim { opacity: 0.22; }
.topo.is-lifted .topo__node.is-lit { opacity: 1; }
.topo__node:focus { outline: none; }

.topo__marker {
  fill: var(--panel);
  stroke: var(--ink-mute);
  stroke-width: 1.5;
  transition: stroke 0.2s ease, fill 0.2s ease;
}
.topo__node.is-accent .topo__marker { fill: var(--amber); stroke: var(--amber); }
.topo__node:hover .topo__marker,
.topo__node:focus .topo__marker,
.topo__node.is-lit .topo__marker { stroke: var(--amber); }

.topo__ring {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.topo__node:hover .topo__ring,
.topo__node:focus .topo__ring { opacity: 0.5; }

/* Labels carry a dark knockout halo (paint-order stroke) so they stay legible
   over edges, other labels, and the headline. */
.topo__addr {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--ink-mute);
  text-anchor: end;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.topo__label {
  font-family: var(--font-mono);
  font-size: 12px;
  fill: var(--ink-dim);
  dominant-baseline: middle;
  transition: fill 0.2s ease;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.topo__node:hover .topo__label,
.topo__node:focus .topo__label,
.topo__node.is-lit .topo__label { fill: var(--ink); }
.topo__node.is-accent .topo__label { fill: var(--ink); }

/* proof readout tied to the signing node */
.topo__proof { opacity: 0; transition: opacity 0.8s var(--ease) 0.5s; }
.topo.is-in .topo__proof { opacity: 1; }
.topo__lead { fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-dasharray: 2.5 3.5; opacity: 0.9; }
/* The proof sits in the clear top strip — no knockout halo, so the amber
   stays fully saturated (the loudest accent on the page). */
.topo__proof-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.02em;
  fill: var(--amber);
}
.topo__proof-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  fill: var(--ink-dim);
  text-transform: uppercase;
}

/* spec callout */
.topo__callout { opacity: 0; transition: opacity 0.18s ease; pointer-events: none; }
.topo.has-callout .topo__callout { opacity: 1; }
.topo__callout-box { fill: color-mix(in srgb, var(--panel) 96%, black); stroke: var(--line-2); stroke-width: 1; }
.topo__callout-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  fill: var(--ink);
}
.topo__callout-spec { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-dim); }

/* ── colophon ─────────────────────────────────────────────────────── */
.colophon {
  border-top: 1px solid var(--line);
  padding: 34px var(--gutter) 56px;
  max-width: var(--content);
  margin: 0 auto;
}
.colophon__row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--ink-dim); font-size: 14px; }
.colophon__mark {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--amber); border: 1px solid var(--line-2); border-radius: var(--r-sm);
}
.colophon__links { display: flex; gap: 18px; margin-left: auto; }
.colophon__links a { color: var(--ink-mute); transition: color 0.16s ease; }
.colophon__links a:hover { color: var(--amber); }
.colophon__meta {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 18px;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute);
}
.colophon__meta a { color: var(--ink-dim); }
.colophon__meta a:hover { color: var(--amber); }
.colophon__sig { color: var(--amber-lo); letter-spacing: 0.1em; }

/* ── responsive ───────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .nav { display: none; }
  .hero__hint { display: none; }
  .hero__loc { display: none; }        /* would collide with the status pill */
  .topo__proof { display: none; }      /* no room for the readout at phone width */

  /* Flow layout with the pitch first: headline → status → graph, so the
     graph is its own block below the headline and they can never overlap
     (the desktop overlay is what caused the collision). */
  .hero { display: flex; flex-direction: column; min-height: calc(100svh - 64px); overflow: visible; }
  .hero::after { display: none; }      /* no overlay, so no scrim needed */
  .hero__headline {
    order: 1;
    position: relative; inset: auto;
    left: auto; right: auto; bottom: auto;
    max-width: none;
    margin: 12px var(--gutter) 14px;
  }
  .hero__frame { order: 2; position: relative; inset: auto; padding: 0 var(--gutter) 8px; }
  /* flex-basis 0 is load-bearing: the SVG's viewBox gives it an intrinsic
     height, and `auto` basis would let that balloon the field and push the
     rest off-screen. Basis 0 makes the field height come purely from the
     flex distribution, so the graph scales to fit whatever's left. */
  .hero__field { order: 3; position: relative; inset: auto; flex: 1 1 0; min-height: 0; overflow: hidden; }

  /* portrait list: bigger labels (smaller viewBox), addresses dropped */
  .topo__label { font-size: 17px; }
  .topo__addr { display: none; }
}
