/* Sytrep — site styles.
 *
 * The palette is not invented here. It is transcribed from design/tokens.toml
 * in the Sytrep repository, which is the single source the desktop client, the
 * terminal client and this site all render from. Three renderers, one
 * vocabulary: a privacy level that reads as "protected" on the site and
 * "warning" in the terminal would be worse than having no colour system.
 *
 * Two rules from design/README.md carry through to every component below:
 *
 *   1. The accent means "this responds to you". Amber is spent on interaction
 *      and focus, never on decoration.
 *   2. Colour is never the only carrier. Every privacy level is written out in
 *      words beside its swatch, and the cleartext profiles are struck out
 *      rather than dimmed.
 */

/* --- tokens --------------------------------------------------------------- */

/* Dark is the default rather than the system preference, because a visitor
   arriving with no preference set should see the product as it actually looks.
   The light values are the same tokens file's [ground.light]. */
:root {
  --base: #0e1116;
  --raised: #161a21;
  --overlay: #1e232c;
  --line: #2a3039;
  --line-soft: #1f242c;
  --text: #e8eaed;
  --dim: #9aa3af;
  --faint: #5d6673;

  --signal: #e3963c;
  --signal-bright: #f0ac5c;
  --signal-dim: #b0742c;
  --signal-wash: #3a2a14;

  --p-highest: #7da9c7;
  --p-high: #5c87a8;
  --p-medium: #41637f;
  --p-lowest: #8a6a3e;
  --p-none: #e5484d;

  --landed: #3e9a78;
  --waiting: #9aa3af;
  --moving: #e3963c;
  --lapsed: #6b7280;
  --failed: #e5484d;

  --glow: rgba(227, 150, 60, 0.14);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.35);

  --wrap: 1160px;
  --measure: 68ch;
  --radius: 10px;
  --radius-lg: 16px;

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "DejaVu Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    "DejaVu Sans Mono", Consolas, monospace;
}

:root[data-theme="light"] {
  --base: #f7f6f3;
  --raised: #ffffff;
  --overlay: #efeeea;
  --line: #dcdad4;
  --line-soft: #e6e4de;
  --text: #14181e;
  --dim: #4e5661;
  --faint: #828b96;

  --signal: #b0742c;
  --signal-bright: #e3963c;
  --signal-dim: #8a5a20;
  --signal-wash: #f6ecdd;

  --p-none: #c7373c;
  --landed: #2f7d60;
  --waiting: #828b96;
  --moving: #b0742c;
  --lapsed: #949ba5;
  --failed: #c7373c;

  --glow: rgba(176, 116, 44, 0.13);
  --shadow-soft: 0 10px 28px rgba(20, 24, 30, 0.09);
}

/* --- base ----------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.2s ease, color 0.2s ease;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--signal-bright);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  line-height: 1.14;
  margin: 0 0 0.5em;
  letter-spacing: -0.022em;
  font-weight: 650;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  letter-spacing: -0.032em;
}

h2 {
  font-size: clamp(1.65rem, 3.4vw, 2.3rem);
}

h3 {
  font-size: 1.16rem;
  letter-spacing: -0.012em;
}

h4 {
  font-size: 1rem;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

strong {
  font-weight: 620;
  color: var(--text);
}

code,
kbd,
samp {
  font-family: var(--mono);
  font-size: 0.87em;
}

code {
  background: var(--overlay);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  color: var(--signal-bright);
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--signal-wash);
  color: var(--text);
}

hr {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 44px 0;
}

/* --- layout --------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.narrow {
  max-width: 820px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--signal);
  color: #0e1116;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

.section {
  padding: 92px 0;
  border-top: 1px solid var(--line-soft);
}

.section-tight {
  padding: 60px 0;
}

.section-plain {
  border-top: none;
}

.section-head {
  max-width: 700px;
  margin-bottom: 48px;
}

.section-head p {
  color: var(--dim);
  font-size: 1.06rem;
  margin-bottom: 0;
}

.section-head p + p {
  margin-top: 0.8em;
}

/* --- small type ----------------------------------------------------------- */

/* Monospace micro-labels. The clients use mono for anything read character by
   character — safety numbers, airtime figures — and the habit carries here. */
.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 16px;
}

.lede {
  font-size: 1.16rem;
  color: var(--dim);
  max-width: var(--measure);
}

.muted {
  color: var(--dim);
}

.faint {
  color: var(--faint);
  font-size: 0.9rem;
}

.mono {
  font-family: var(--mono);
}

.wordmark {
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --- header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--base) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.08rem;
  flex: none;
}

.brand:hover {
  text-decoration: none;
}

.brand svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.main-nav a {
  color: var(--dim);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 3px 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.main-nav a[aria-current="page"] {
  border-bottom-color: var(--signal);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--dim);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--signal-dim);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

/* The toggle shows the state you would move to, not the one you are in, so the
   glyphs swap with the theme rather than staying put. */
.icon-btn .sun {
  display: none;
}

:root[data-theme="light"] .icon-btn .sun {
  display: block;
}

:root[data-theme="light"] .icon-btn .moon {
  display: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--raised);
    border-bottom: 1px solid var(--line);
    padding: 6px 24px 16px;
    box-shadow: var(--shadow-soft);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 13px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .main-nav a[aria-current="page"] {
    border-bottom-color: var(--line-soft);
    color: var(--signal-bright);
  }
}

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease, color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--signal);
  color: #0e1116;
}

.btn-primary:hover {
  background: var(--signal-bright);
}

.btn-secondary {
  background: var(--overlay);
  color: var(--text);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--signal-dim);
  background: color-mix(in srgb, var(--overlay) 80%, var(--signal-wash));
}

.btn-ghost {
  padding-left: 0;
  padding-right: 0;
  color: var(--signal-bright);
}

.btn-ghost:hover {
  transform: none;
  text-decoration: underline;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- hero ----------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 96px 0 84px;
  overflow: hidden;
}

/* Two washes rather than one: a broad amber bloom for warmth, and a cool
   privacy-blue counterweight low and left, so the page does not read as one
   flat gradient. Both are pointer-transparent and purely atmospheric. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.hero::before {
  top: -34%;
  left: 52%;
  width: 1000px;
  height: 680px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--glow), transparent 66%);
}

.hero::after {
  top: 22%;
  left: -14%;
  width: 620px;
  height: 620px;
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--p-medium) 20%, transparent),
    transparent 62%
  );
  opacity: 0.55;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-inner {
  max-width: 820px;
}

.hero h1 {
  margin-bottom: 22px;
}

.hero h1 em {
  font-style: normal;
  color: var(--signal);
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--dim);
  max-width: 640px;
}

.hero-cta {
  margin: 32px 0 18px;
}

.hero-note {
  font-size: 0.9rem;
  color: var(--faint);
  margin: 0;
}

/* The three priorities, in order, as they are stated in the README. Rendered
   as a numbered rank because the order is the claim. */
.priorities {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  counter-reset: rank;
}

.priorities li {
  counter-increment: rank;
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 0.95rem;
  color: var(--dim);
}

.priorities li::before {
  content: counter(rank);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--signal);
  border: 1px solid var(--signal-dim);
  border-radius: 5px;
  padding: 1px 6px;
}

.priorities strong {
  color: var(--text);
  font-weight: 600;
}

/* --- status strip --------------------------------------------------------- */

/* Sits directly under the hero on purpose. A reader who takes one thing from
   this page should take what does and does not exist yet. */
.status-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--raised);
  padding: 26px 28px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 22px;
  align-items: start;
  box-shadow: var(--shadow-soft);
}

.status-strip .dot-label {
  align-self: center;
}

.status-strip p {
  margin: 0;
  color: var(--dim);
  font-size: 0.98rem;
  max-width: var(--measure);
}

.status-strip p + p {
  margin-top: 0.7em;
}

.status-strip .status-body {
  grid-column: 2;
}

@media (max-width: 620px) {
  .status-strip {
    grid-template-columns: 1fr;
  }

  .status-strip .status-body {
    grid-column: 1;
  }
}

/* A coloured dot always travels with its word. Colour is never the carrier. */
.dot-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

.dot-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--waiting);
  flex: none;
}

.dot-label.is-landed::before {
  background: var(--landed);
}

.dot-label.is-moving::before {
  background: var(--moving);
}

.dot-label.is-waiting::before {
  background: var(--waiting);
}

.dot-label.is-failed::before {
  background: var(--failed);
}

/* --- cards ---------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.card {
  background: var(--raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: var(--line);
  transform: translateY(-2px);
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  color: var(--dim);
  font-size: 0.97rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.card-tag {
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}

/* Feature list without cards — for grids where the prose is the point. */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px 34px;
}

.feature h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.feature h3::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--signal);
  flex: none;
  transform: translateY(-1px);
}

.feature p {
  color: var(--dim);
  font-size: 0.97rem;
  margin: 0;
}

.feature p + p {
  margin-top: 0.7em;
}

/* --- bearer spectrum ------------------------------------------------------ */

/* A log-scale range plot, one row per bearer. The axis is the argument: these
   are not variations on a theme, they are four orders of magnitude apart, and
   the delivery layer has to hold all of them at once.
   Bar geometry comes from inline --x/--w custom properties in the markup so
   the positions stay next to the numbers they encode. */
.spectrum {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--raised);
  padding: 26px 28px 20px;
  box-shadow: var(--shadow-soft);
}

.spectrum-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
}

.spectrum-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.spectrum-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  align-items: center;
  gap: 16px;
  padding: 7px 0;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.spectrum-row:hover {
  background: var(--overlay);
}

.spectrum-name {
  font-size: 0.9rem;
  font-weight: 550;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spectrum-track {
  position: relative;
  height: 22px;
}

/* The decade rules sit behind every bar, drawn once on the container rather
   than per row, so they line up exactly with the axis labels. */
.spectrum-body {
  position: relative;
}

.spectrum-body::before {
  content: "";
  position: absolute;
  inset: 0 0 0 148px;
  /* One rule per decade, offset so they land on the labelled ticks rather than
     between them. Eight decades across the track, 12.5% each. */
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent 6.25%,
    var(--line-soft) 6.25%,
    var(--line-soft) calc(6.25% + 1px),
    transparent calc(6.25% + 1px),
    transparent 12.5%
  );
  pointer-events: none;
}

.spectrum-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: calc(var(--x) * 1%);
  width: calc(var(--w) * 1%);
  min-width: 9px;
  height: 9px;
  border-radius: 4px;
  background: var(--p-high);
}

.spectrum-bar.p-highest {
  background: var(--p-highest);
}
.spectrum-bar.p-high {
  background: var(--p-high);
}
.spectrum-bar.p-medium {
  background: var(--p-medium);
}
.spectrum-bar.p-lowest {
  background: var(--p-lowest);
}

/* Cleartext leaves the ramp rather than sitting at the bottom of it: hollow,
   struck through, and joined by the word CLEAR in the label. Rendering a
   Part 97 profile as merely one step less private would be a lie told in
   colour. */
.spectrum-bar.p-none {
  background: none;
  border: 1px solid var(--p-none);
  height: 11px;
}

.spectrum-bar.p-none::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--p-none);
}

.spectrum-value {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: calc((var(--x) + var(--w)) * 1%);
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
  white-space: nowrap;
}

/* Past roughly two-thirds across there is no room to the right, so the label
   goes inside-left of the bar's end instead. */
.spectrum-value.flip {
  left: auto;
  right: calc((100 - var(--x)) * 1%);
  margin-left: 0;
  margin-right: 10px;
}

.spectrum-axis {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.spectrum-ticks {
  position: relative;
  height: 16px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
}

.spectrum-ticks span {
  position: absolute;
  left: calc(var(--x) * 1%);
  transform: translateX(-50%);
  white-space: nowrap;
}

.spectrum-ticks span:first-child {
  transform: none;
}

.spectrum-ticks span:last-child {
  left: auto;
  right: 0;
  transform: none;
}

.spectrum-foot {
  margin: 14px 0 0;
  font-size: 0.86rem;
  color: var(--faint);
}

@media (max-width: 720px) {
  .spectrum {
    padding: 22px 18px 16px;
  }

  .spectrum-row,
  .spectrum-axis {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .spectrum-name {
    text-align: left;
  }

  .spectrum-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .spectrum-body::before {
    inset: 0;
  }

  /* No column to the right of a full-width track, so every value label goes
     inside. */
  .spectrum-value {
    position: static;
    transform: none;
    display: block;
    margin: 5px 0 0;
  }

  .spectrum-track {
    height: 16px;
  }
}

/* --- privacy ramp --------------------------------------------------------- */

.ramp {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ramp li {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--raised);
  padding: 16px 18px;
}

.ramp .swatch {
  display: block;
  height: 34px;
  border-radius: 6px;
  background: var(--p-high);
  margin-bottom: 12px;
}

.ramp .swatch.p-highest {
  background: var(--p-highest);
}
.ramp .swatch.p-high {
  background: var(--p-high);
}
.ramp .swatch.p-medium {
  background: var(--p-medium);
}
.ramp .swatch.p-lowest {
  background: var(--p-lowest);
}

/* Struck out, not dimmed — the same treatment the clients give it. */
.ramp .swatch.p-none {
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 5px,
    color-mix(in srgb, var(--p-none) 45%, transparent) 5px,
    color-mix(in srgb, var(--p-none) 45%, transparent) 6px
  );
  border: 1px solid var(--p-none);
  position: relative;
}

.ramp .swatch.p-none::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--p-none);
}

.ramp .level {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 5px;
}

.ramp p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--dim);
}

/* --- tables --------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--raised);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.93rem;
  min-width: 620px;
}

th,
td {
  text-align: left;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

th {
  background: var(--overlay);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

td {
  color: var(--dim);
}

td:first-child {
  color: var(--text);
  font-weight: 550;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: color-mix(in srgb, var(--overlay) 55%, transparent);
}

.num {
  font-family: var(--mono);
  font-size: 0.86rem;
}

/* Privacy level inside a table cell: swatch plus word, never the swatch
   alone. */
.plevel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text);
}

.plevel::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--p-high);
  flex: none;
}

.plevel.p-highest::before {
  background: var(--p-highest);
}
.plevel.p-high::before {
  background: var(--p-high);
}
.plevel.p-medium::before {
  background: var(--p-medium);
}
.plevel.p-lowest::before {
  background: var(--p-lowest);
}

.plevel.p-none {
  color: var(--p-none);
}

.plevel.p-none::before {
  background: none;
  border: 1px solid var(--p-none);
  box-shadow: inset 0 0 0 1px transparent;
  background-image: linear-gradient(
    to bottom right,
    transparent 45%,
    var(--p-none) 45%,
    var(--p-none) 55%,
    transparent 55%
  );
}

/* --- notice / callout ----------------------------------------------------- */

.notice {
  background: var(--raised);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--signal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 22px 26px;
}

.notice h3 {
  font-size: 1.03rem;
  margin-bottom: 8px;
}

.notice p {
  color: var(--dim);
  font-size: 0.97rem;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice-warn {
  border-left-color: var(--p-none);
}

.notice-quiet {
  border-left-color: var(--line);
}

/* --- scope lists (threat model) ------------------------------------------- */

.scope {
  list-style: none;
  margin: 0;
  padding: 0;
}

.scope li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 14px;
  color: var(--dim);
  font-size: 0.98rem;
}

.scope li strong {
  color: var(--text);
}

.scope li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.6;
}

.scope-in li::before {
  content: "+";
  color: var(--landed);
}

.scope-out li::before {
  content: "−";
  color: var(--failed);
}

/* --- steps / flow --------------------------------------------------------- */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 30px;
}

.steps li {
  counter-increment: step;
  padding-top: 48px;
  position: relative;
  color: var(--dim);
  font-size: 0.96rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--signal-dim);
  border-radius: 9px;
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.steps strong {
  display: block;
  color: var(--text);
  font-size: 1.04rem;
  margin-bottom: 5px;
}

/* A message crossing bearers, drawn as the hops it actually takes. */
.hops {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hops li {
  flex: 1 1 190px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--raised);
  padding: 16px 18px;
  position: relative;
}

.hops li + li::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 12px;
  border-top: 1px dashed var(--line);
}

.hops .hop-when {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  display: block;
  margin-bottom: 6px;
}

.hops .hop-what {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.hops p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--dim);
}

/* --- layer stack ---------------------------------------------------------- */

/* Nine rows, top of the stack first, with the accent bar fading as it
   descends — the reader's eye should travel down the way a message does. */
.stack {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--raised);
}

.stack li {
  display: grid;
  grid-template-columns: 54px 148px 1fr;
  align-items: baseline;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  transition: background 0.15s ease;
}

.stack li:last-child {
  border-bottom: none;
}

.stack li:hover {
  background: var(--overlay);
}

/* The bar is one element per row rather than a gradient on the container, so
   each row keeps its own step as rows reflow on a narrow screen. */
.stack li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--signal);
}

.stack li:nth-child(1)::before { opacity: 1; }
.stack li:nth-child(2)::before { opacity: 0.9; }
.stack li:nth-child(3)::before { opacity: 0.8; }
.stack li:nth-child(4)::before { opacity: 0.7; }
.stack li:nth-child(5)::before { opacity: 0.6; }
.stack li:nth-child(6)::before { opacity: 0.5; }
.stack li:nth-child(7)::before { opacity: 0.4; }
.stack li:nth-child(8)::before { opacity: 0.3; }
.stack li:nth-child(9)::before { opacity: 0.2; }

.stack-id {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--signal);
  letter-spacing: 0.06em;
}

.stack-name {
  font-weight: 600;
  font-size: 0.97rem;
}

.stack-what {
  color: var(--dim);
  font-size: 0.93rem;
}

@media (max-width: 680px) {
  .stack li {
    grid-template-columns: 46px 1fr;
    row-gap: 2px;
  }

  .stack-what {
    grid-column: 2;
  }
}

/* --- milestones ----------------------------------------------------------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  border-left: 1px solid var(--line);
}

.timeline li {
  position: relative;
  padding: 0 0 30px 34px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--base);
  border: 2px solid var(--line);
}

.timeline li.is-done::before {
  border-color: var(--landed);
  background: var(--landed);
}

.timeline li.is-now::before {
  border-color: var(--moving);
  background: var(--moving);
}

.timeline h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.timeline p {
  margin: 0;
  color: var(--dim);
  font-size: 0.96rem;
}

.timeline .tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  display: block;
  margin-bottom: 4px;
}

/* --- code ----------------------------------------------------------------- */

pre {
  background: var(--raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--dim);
  margin: 0 0 1em;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

pre .c {
  color: var(--faint);
}

pre .k {
  color: var(--signal-bright);
}

/* --- faq ------------------------------------------------------------------ */

.faq details {
  border-bottom: 1px solid var(--line-soft);
}

.faq summary {
  cursor: pointer;
  padding: 18px 36px 18px 0;
  font-weight: 600;
  position: relative;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--signal);
  border-bottom: 1.5px solid var(--signal);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.18s ease;
}

.faq details[open] summary::after {
  transform: translateY(-20%) rotate(-135deg);
}

.faq details > *:not(summary) {
  color: var(--dim);
  font-size: 0.97rem;
  padding-right: 36px;
}

.faq details p:last-child {
  padding-bottom: 18px;
}

/* --- page head (interior pages) ------------------------------------------- */

.page-head {
  position: relative;
  padding: 74px 0 40px;
  overflow: hidden;
}

.page-head::before {
  content: "";
  position: absolute;
  top: -60%;
  left: 40%;
  width: 760px;
  height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--glow), transparent 68%);
  pointer-events: none;
}

.page-head > * {
  position: relative;
}

.page-head h1 {
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  margin-bottom: 14px;
}

.page-head .lede {
  margin-bottom: 0;
}

/* --- prose (documentation-style pages) ------------------------------------ */

.prose h2 {
  font-size: 1.4rem;
  margin: 54px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.prose h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.prose h3 {
  font-size: 1.06rem;
  margin: 30px 0 8px;
}

.prose p,
.prose li {
  color: var(--dim);
}

.prose ul,
.prose ol {
  padding-left: 22px;
  margin: 0 0 1em;
}

.prose li {
  margin-bottom: 8px;
}

/* --- reveal on scroll ----------------------------------------------------- */

/* Applied by main.js only; with the script blocked nothing is ever hidden. */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.shown {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --- footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--base) 92%, #000);
  padding: 56px 0 32px;
  font-size: 0.93rem;
}

:root[data-theme="light"] .site-footer {
  background: var(--overlay);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.7fr repeat(3, 1fr);
  gap: 36px;
  margin-bottom: 40px;
}

.footer-brand .brand {
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--faint);
  max-width: 320px;
  font-size: 0.9rem;
  margin: 0;
}

.footer-col h4 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
  font-weight: 500;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 9px;
}

.footer-col a {
  color: var(--dim);
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  border-top: 1px solid var(--line-soft);
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  justify-content: space-between;
  color: var(--faint);
  font-size: 0.86rem;
}

.footer-bottom p {
  margin: 0;
  max-width: 660px;
}

@media (max-width: 780px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .section {
    padding: 64px 0;
  }

  .hero {
    padding: 64px 0 52px;
  }

  .hero-cta .btn {
    width: 100%;
  }
}
