/* ============================================================
   Mission Tech. Shared Tool Design System
   Import this in every interactive tool to keep consistency.
   <link rel="stylesheet" href="mission-tech-shared.css">
   ============================================================ */

/* Press Start 2P loaded globally for the 8-bit chrome (nav, tool
   headers, dividers, walker, footer). Body content typography stays
   on the existing serif + sans + mono stack so reading remains
   comfortable on path/lab pages. */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  /* Core palette, matches campaigns.html / index.html */
  --c-bg:          #100c22;
  --c-bg-2:        #160f2e;
  --c-panel:       rgba(18, 13, 40, 0.92);
  --c-panel-2:     rgba(24, 17, 50, 0.85);
  --c-text:        #f0ece6;
  --c-text-dim:    #a09ab0;
  --c-text-muted:  #8a7db5;
  --c-accent:      #e8864a;
  --c-accent-hover:#d4703a;
  --c-accent-soft: rgba(232, 134, 74, 0.18);
  --c-accent-glow: rgba(232, 134, 74, 0.35);
  --c-border:      rgba(255, 255, 255, 0.08);
  --c-border-vis:  rgba(255, 255, 255, 0.13);
  --c-green:       #7dd4a0;
  --c-lavender:    #9b8ec4;
  --c-cyan:        #50b0e0;
  --c-red:         #ff6b7a;

  /* Semantic layer colours */
  --c-l3:          #86efac;   /* Network    L3 - green */
  --c-l4:          #f9a8d4;   /* Transport  L4 - pink  */
  --c-l7:          #93c5fd;   /* App        L7 - blue  */

  /* Type */
  --f-serif: 'Instrument Serif', Georgia, serif;
  --f-sans:  'DM Sans', system-ui, sans-serif;
  --f-mono:  'DM Mono', 'JetBrains Mono', 'Courier New', monospace;

  /* Radius / motion */
  --r-sm: 6px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--f-sans);
  /* Two corner watermarks fixed on every page that loads this stylesheet:
     pixel Mt. Baker silhouette lower-right, cherry blossom cluster
     lower-left. Both have opacity baked into their SVG content. Arcade
     pages use independent stylesheets and are unaffected. */
  background:
    url('assets/cherry-accent-small.svg') left 1rem bottom 2rem / clamp(80px, 10vw, 140px) auto no-repeat fixed,
    url('assets/mt-baker-pixel.svg') right 1.5rem bottom 1.5rem / clamp(110px, 14vw, 180px) auto no-repeat fixed,
    var(--c-bg);
  color: var(--c-text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}
::selection { background: rgba(232, 134, 74, 0.25); }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; border-radius: 4px; }

/* ── Skip-to-content link ────────────────────────────────── */
.skip-link { position: absolute; top: -40px; left: 0; background: var(--c-accent); color: #1a1000; padding: 8px 16px; z-index: 10000; font-weight: 600; transition: top 0.2s; }
.skip-link:focus { top: 0; }

/* ── Visually hidden utility (for labels and skip-only headings) ── */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ── Navigation bar ─────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13, 9, 25, 0.97);
  border-bottom: 1px solid var(--c-border);
  padding: 0.85rem 0;
  backdrop-filter: blur(12px);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.65rem;
  font-size: 0.85rem; font-weight: 500;
  color: var(--c-text); text-decoration: none;
}
.nav-logo-mark {
  font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  color: var(--c-accent); border: 1px solid rgba(232, 134, 74, 0.28);
  padding: 0.25em 0.55em; border-radius: 5px; line-height: 1;
}
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
  font-size: 0.85rem; color: var(--c-text-dim);
  text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover { color: var(--c-text); }
.nav-links a.active { color: var(--c-accent); font-weight: 600; border-bottom: 2px solid var(--c-accent); padding-bottom: 2px; }
.nav-contact {
  display: inline-flex; align-items: center;
  padding: 0.45em 1.1em; font-size: 0.82rem; font-weight: 500;
  border: 1px solid rgba(232, 134, 74, 0.45); border-radius: 999px;
  color: var(--c-accent) !important; transition: all 0.2s var(--ease);
}
.nav-contact:hover { background: rgba(232, 134, 74, 0.1); border-color: var(--c-accent); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; padding: 10px;
  cursor: pointer; background: none; border: none;
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.nav-toggle span {
  display: block; width: 22px; height: 1.5px;
  background: var(--c-text); transition: transform 0.2s var(--ease);
}
.nav-toggle.open span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle.open span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(13, 9, 25, 0.98);
  flex-direction: column; align-items: center; justify-content: center; gap: 2.5rem;
  opacity: 0; pointer-events: none; transition: opacity 0.35s var(--ease);
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-family: var(--f-serif); font-size: 2rem;
  color: var(--c-text); text-decoration: none; transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--c-accent); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu { display: flex; }
  .nav-contact { display: none; }
}

/* ── Tool page header ─────────────────────────────────────── */
.tool-header { padding: 3.5rem 0 2rem; border-bottom: 1px solid var(--c-border); position: relative; overflow: hidden; }
.tool-header::before {
  content: ''; position: absolute; top: -40%; left: 20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(232,134,74,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.tool-eyebrow {
  font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.14em;
  color: var(--c-text-muted); text-transform: uppercase; margin-bottom: 1rem;
}
.tool-title {
  font-family: var(--f-serif); font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  font-weight: 400; letter-spacing: -0.025em; line-height: 1.08; margin-bottom: 0.75rem;
}
.tool-sub { font-size: 1rem; font-weight: 300; color: var(--c-text-dim); max-width: 580px; line-height: 1.7; }

/* ── Container ────────────────────────────────────────────── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 2rem; }

/* ── Tool panels ─────────────────────────────────────────── */
.mt-panel {
  background: var(--c-panel);
  border: 1px solid var(--c-border-vis);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}
.mt-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,134,74,0.25), transparent);
}
.mt-panel-label {
  font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--c-accent); margin-bottom: 1rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.mt-btn {
  background: var(--c-accent); color: var(--c-bg);
  border: none; padding: 0.7em 1.4em; border-radius: var(--r-sm);
  font-family: var(--f-sans); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s var(--ease);
}
.mt-btn:hover { background: var(--c-accent-hover); transform: translateY(-1px); }
.mt-btn-ghost {
  background: transparent; color: var(--c-text);
  border: 1px solid var(--c-border-vis);
  padding: 0.55em 1em; border-radius: var(--r-sm);
  font-family: var(--f-mono); font-size: 0.75rem;
  cursor: pointer; transition: all 0.2s var(--ease);
}
.mt-btn-ghost:hover { border-color: var(--c-accent); color: var(--c-accent); }
.mt-btn-ghost.off { opacity: 0.4; text-decoration: line-through; }

/* ── Inputs ──────────────────────────────────────────────── */
.mt-input {
  background: var(--c-bg-2); border: 1px solid var(--c-border-vis);
  color: var(--c-text); padding: 0.7em 1em; border-radius: var(--r-sm);
  font-family: var(--f-mono); font-size: 0.95rem; outline: none;
  transition: border-color 0.2s var(--ease);
}
.mt-input:focus { border-color: var(--c-accent); }

/* ── Tables ──────────────────────────────────────────────── */
.mt-table { width: 100%; border-collapse: collapse; font-family: var(--f-mono); font-size: 0.82rem; }
.mt-table th {
  text-align: left; padding: 0.7rem 0.6rem;
  color: var(--c-accent); border-bottom: 1px solid var(--c-border-vis);
  font-weight: 600; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.mt-table td {
  padding: 0.85rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: all 0.45s var(--ease);
}
.mt-table tr.fade td { opacity: 0.18; }
.mt-table tr.match td { background: var(--c-accent-soft); }
.mt-table tr.winner td {
  background: var(--c-accent); color: var(--c-bg); font-weight: 600;
  animation: mtPulse 1.4s ease-in-out infinite;
}
@keyframes mtPulse {
  0%, 100% { box-shadow: inset 0 0 0 0 var(--c-accent-glow); }
  50% { box-shadow: inset 0 0 24px 0 var(--c-accent-glow); }
}

/* ── Explanation box ─────────────────────────────────────── */
.mt-explain {
  margin-top: 1.25rem; padding: 1rem 1.2rem;
  background: var(--c-bg-2); border-left: 3px solid var(--c-accent);
  border-radius: var(--r-sm); font-size: 0.92rem; line-height: 1.65;
  min-height: 1.5em;
}
.mt-explain.err { border-left-color: var(--c-red); color: #ffc4ca; }
.mt-explain b { color: var(--c-accent); }

/* ── Packet (the shared visual element) ──────────────────── */
.mt-packet {
  position: absolute;
  width: 22px; height: 22px;
  pointer-events: none;
  z-index: 10;
  filter: drop-shadow(0 0 8px var(--c-accent-glow));
}
.mt-packet svg { width: 100%; height: 100%; display: block; }
@keyframes mtPacketPulse {
  0%, 100% { filter: drop-shadow(0 0 6px var(--c-accent-glow)); }
  50% { filter: drop-shadow(0 0 14px var(--c-accent)); }
}
.mt-packet.alive { animation: mtPacketPulse 0.8s ease-in-out infinite; }
.mt-packet.dropped svg { opacity: 0.5; filter: grayscale(0.7); }

/* ── Path arrows (used by routing-table, packet-journey, etc.) ── */
.mt-path-svg { position: absolute; inset: 0; pointer-events: none; }
.mt-path-line { stroke: var(--c-accent); stroke-width: 2.5; stroke-dasharray: 6 4; fill: none; }
.mt-path-line.dim { stroke: var(--c-text-muted); stroke-width: 1.5; opacity: 0.35; }

/* ── Tool walker (prev / next between tools) ────────────── */
.tool-walker {
  max-width: 1100px; margin: 2.5rem auto 0; padding: 1.25rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--c-border);
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.04em;
}
.tool-walker a {
  color: var(--c-text-dim); text-decoration: none; transition: color 0.2s;
  min-height: 44px; min-width: 44px; display: inline-flex; align-items: center;
  padding: 0 0.5rem;
}
.tool-walker a:hover { color: var(--c-accent); }
.tool-walker-hub { color: var(--c-text-muted) !important; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
@media (max-width: 768px) {
  .tool-walker { flex-direction: column; gap: 0.75rem; text-align: center; }
}

/* ── Footer link strip ───────────────────────────────────── */
.mt-footer-strip {
  margin-top: 1.5rem; padding: 2rem 0;
  border-top: 1px solid var(--c-border);
  text-align: center;
  font-family: var(--f-mono); font-size: 0.72rem;
  color: var(--c-text-muted); letter-spacing: 0.08em;
}
.mt-footer-strip a { color: var(--c-text-dim); text-decoration: none; transition: color 0.2s; }
.mt-footer-strip a:hover { color: var(--c-accent); }

/* ── Layer chip ──────────────────────────────────────────── */
.layer-chip {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  font-weight: 500;
  text-transform: uppercase;
  vertical-align: middle;
}
.layer-chip-l3 { background: rgba(134,239,172,0.12); color: var(--c-l3); }
.layer-chip-l4 { background: rgba(249,168,212,0.12); color: var(--c-l4); }
.layer-chip-l7 { background: rgba(147,197,253,0.12); color: var(--c-l7); }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 0 1.25rem; }
  .mt-panel { padding: 1.25rem; }
  .tool-header { padding: 2.5rem 0 1.5rem; }
}

/* ── What Just Happened (.wjh-) ─────────────────────────── */
.wjh-panel {
  display: none;
  margin-top: 1.25rem;
  padding: 1.15rem 1.35rem;
  background: linear-gradient(135deg, rgba(232,134,74,0.05), rgba(155,142,196,0.04));
  border: 1px solid rgba(232,134,74,0.22);
  border-left: 3px solid var(--c-accent, #e8864a);
  border-radius: 0 12px 12px 0;
  animation: wjhFadeIn 0.5s ease both;
}
.wjh-panel.visible { display: block; }
.wjh-label {
  font-family: var(--f-mono, 'DM Mono', monospace);
  font-size: 0.58rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232,134,74,0.7);
  margin-bottom: 0.55rem;
}
.wjh-text {
  font-size: 0.9rem; font-weight: 300;
  color: var(--c-text-dim, #a09ab0);
  line-height: 1.7;
}
.wjh-text b, .wjh-text strong {
  color: var(--c-text, #f0ece6);
  font-weight: 500;
}
@keyframes wjhFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wjh-panel { animation: none; }
}

/* ── Signal Path (.sp-) ──────────────────────────────────── */
.sp-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(8, 5, 20, 0.96);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(14px);
  overflow: hidden;
  height: 32px;
}
/* On pages with a Signal Path progress bar, push the sticky nav below it so
   the two do not collide at top:0. Falls back gracefully on browsers without
   :has() (Firefox <121) where they overlap as before. */
body:has(.sp-header) .nav { top: 32px; }
.sp-header-inner {
  position: relative;
  max-width: 720px; margin: 0 auto;
  height: 32px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
}
.sp-line {
  position: absolute;
  left: 2.5rem; right: 2.5rem; top: 50%;
  height: 1px;
  background: linear-gradient(90deg, rgba(232,134,74,0.35) 0%, rgba(232,134,74,0.18) 50%, rgba(255,255,255,0.08) 100%);
  z-index: 0;
}
.sp-dots { position: relative; z-index: 1; display: flex; justify-content: space-between; flex: 1; align-items: center; }
.sp-dot {
  position: relative;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--c-bg); border: 1.5px solid rgba(255,255,255,0.18);
  transition: all 0.25s var(--ease);
  text-decoration: none;
  display: block;
}
/* Invisible 44x44 hit area, centered on the visible dot, for WCAG 2.5.5 touch-target AAA. */
.sp-dot::before {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px;
}
.sp-dot:hover { transform: scale(1.25); border-color: var(--c-accent); }
.sp-dot.done { background: rgba(232,134,74,0.6); border-color: rgba(232,134,74,0.7); }
.sp-dot.completed { background: #6ee7b7; border-color: #6ee7b7; }
.sp-dot.completed::after {
  content: '\2713'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); font-size: 7px; font-weight: 700;
  color: #0d0919; line-height: 1;
}
.sp-dot.completed:hover { border-color: #6ee7b7; }
.sp-dot.completed.current { background: #6ee7b7; border-color: #6ee7b7; box-shadow: 0 0 0 4px rgba(110,231,183,0.18), 0 0 14px rgba(110,231,183,0.5); }
.sp-dot.completed.current::after { font-size: 9px; }
.sp-dot.current {
  width: 14px; height: 14px;
  background: var(--c-accent);
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(232,134,74,0.18), 0 0 14px rgba(232,134,74,0.6);
}
.sp-dot.future { background: var(--c-bg); }
.sp-dot.soon { border-style: dashed; border-color: rgba(232,134,74,0.5); }
.sp-tip {
  position: absolute; top: 22px; left: 50%;
  transform: translateX(-50%) translateY(4px);
  font-family: var(--f-mono); font-size: 0.62rem;
  white-space: nowrap; color: var(--c-text);
  background: #0b0720; border: 1px solid var(--c-border-vis);
  padding: 0.25rem 0.55rem; border-radius: 4px;
  opacity: 0; pointer-events: none;
  transition: all 0.2s var(--ease);
}
.sp-dot:hover .sp-tip { opacity: 1; transform: translateX(-50%) translateY(0); }

.sp-intro {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--c-text-dim);
  line-height: 1.6;
  max-width: 640px;
  margin: 0.6rem auto 1.5rem;
  text-align: center;
}

.sp-handoff {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 1.5rem;
  align-items: center;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}
.sp-handoff-back a {
  font-family: var(--f-mono); font-size: 0.78rem;
  color: var(--c-text-dim); text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.45rem;
  transition: color 0.2s;
}
.sp-handoff-back a:hover { color: var(--c-accent); }
.sp-back-empty { font-family: var(--f-mono); font-size: 0.72rem; color: var(--c-text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.sp-handoff-outro {
  font-family: var(--f-serif); font-style: italic;
  font-size: 1.08rem; line-height: 1.55;
  color: var(--c-text); text-align: center;
}
.sp-handoff-next { text-align: right; }
.sp-next-btn { display: inline-block; text-decoration: none; }
.sp-next-btn.sp-next-soon {
  background: transparent;
  color: var(--c-text-dim);
  border: 1px dashed rgba(232,134,74,0.55);
  font-weight: 500;
}
.sp-next-btn.sp-next-soon:hover { background: rgba(232,134,74,0.08); color: var(--c-accent); }

/* Signal Path overview page (signal-path.html) */
.sp-spine-map { position: relative; padding: 2rem 0 1rem 2.75rem; }
.sp-spine-map::before {
  content: '';
  position: absolute;
  left: 1.3rem; top: 0; bottom: 0;
  width: 0;
  border-left: 2px dashed rgba(232,134,74,0.4);
}
.sp-spine-stop { position: relative; margin-bottom: 1.5rem; }
.sp-spine-stop::before {
  content: '';
  position: absolute;
  left: -1.7rem; top: 1.6rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--c-bg);
  border: 2px solid var(--c-accent);
}
.sp-spine-stop.soon::before { border-style: dashed; }
.sp-spine-stop.here::before { background: var(--c-accent); box-shadow: 0 0 0 4px rgba(232,134,74,0.2); }
.sp-stop-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: center; }
.sp-stop-num { font-family: var(--f-serif); font-size: 2.2rem; color: var(--c-accent); line-height: 1; min-width: 2.2rem; }
.sp-stop-body .sp-stop-title { font-family: var(--f-serif); font-size: 1.5rem; margin-bottom: 0.25rem; }
.sp-stop-body .sp-stop-intro { font-family: var(--f-serif); font-style: italic; color: var(--c-text-dim); font-size: 0.98rem; line-height: 1.55; }
.sp-stop-badge {
  display: inline-block; margin-top: 0.35rem;
  font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 0.2em 0.55em; border-radius: 4px;
}
.sp-stop-badge.live { background: rgba(125,212,160,0.1); color: var(--c-green); }
.sp-stop-badge.soon { background: rgba(232,134,74,0.1); color: var(--c-accent); border: 1px dashed rgba(232,134,74,0.5); }
.sp-stop-here-label {
  display: inline-block; margin-left: 0.5rem;
  font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--c-accent);
}
.sp-stop-cta { text-align: right; }
.sp-side {
  margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid var(--c-border);
}
.sp-side-title {
  font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--c-text-muted); margin-bottom: 1rem;
}
.sp-side-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sp-side-card {
  background: var(--c-panel-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  text-decoration: none; display: block;
  transition: border-color 0.2s var(--ease);
}
.sp-side-card:hover { border-color: var(--c-accent); }
.sp-side-card-title { font-family: var(--f-serif); font-size: 1.15rem; margin-bottom: 0.25rem; color: var(--c-text); }
.sp-side-card-desc { font-size: 0.85rem; color: var(--c-text-dim); font-style: italic; }

/* Signal Path banner on tools/index */
.sp-banner {
  display: block;
  margin: 0 auto 2rem;
  max-width: 1100px;
  padding: 1.1rem 1.5rem;
  border: 1px solid rgba(232,134,74,0.35);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(232,134,74,0.08), rgba(155,142,196,0.05));
  text-decoration: none; color: var(--c-text);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transition: all 0.25s var(--ease);
}
.sp-banner:hover { border-color: var(--c-accent); transform: translateY(-1px); }

/* Primary banner: Signal Path I - visually dominant */
.sp-banner--primary {
  padding: 1.5rem 2rem;
  border-width: 1.5px;
  box-shadow: 0 0 18px rgba(232,134,74,0.12), 0 0 4px rgba(232,134,74,0.08);
  background: linear-gradient(135deg, rgba(232,134,74,0.12), rgba(155,142,196,0.06));
}
.sp-banner--primary:hover {
  box-shadow: 0 0 24px rgba(232,134,74,0.2), 0 0 6px rgba(232,134,74,0.12);
}
.sp-banner--primary .sp-banner-text { font-size: 1.2rem; }

/* Secondary banner: Lab - clearly subordinate */
.sp-banner--secondary {
  padding: 0.85rem 1.3rem;
  border-color: rgba(155,142,196,0.18);
  background: linear-gradient(135deg, rgba(155,142,196,0.05), transparent);
  opacity: 0.85;
}
.sp-banner--secondary:hover {
  border-color: var(--c-lavender);
  opacity: 1;
}
.sp-banner--secondary .sp-banner-text { font-size: 0.95rem; }
.sp-banner--secondary .sp-banner-cta { font-size: 0.72rem; }

.sp-banner-label {
  font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--c-accent); margin-bottom: 0.3rem;
}
.sp-banner-text { font-family: var(--f-serif); font-size: 1.1rem; line-height: 1.4; color: var(--c-text); }
.sp-banner-cta { font-family: var(--f-mono); font-size: 0.78rem; color: var(--c-accent); white-space: nowrap; }

/* ── Arcade interstitial card ─────────────────────────────
   Shared between Signal Path I hub, Signal Path III hub, and the
   homepage arcade-bridge strip. Lavender-tinted promo of the 8-bit
   arcade surface. One class, three sites. */
.sp-arcade-card {
  max-width: 640px;
  margin: 2.5rem auto 0;
  padding: 1.6rem 1.75rem;
  border: 1px solid rgba(155,142,196,0.32);
  background: linear-gradient(180deg, rgba(18,13,40,0.55), rgba(12,12,30,0.35));
  border-radius: var(--r-md);
  text-align: center;
}
.sp-arcade-eyebrow {
  font-family: var(--f-mono); font-size: 0.68rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--c-text-muted); margin-bottom: 0.7rem;
}
.sp-arcade-title {
  font-family: var(--f-serif); font-size: 1.15rem;
  color: var(--c-lavender); font-style: italic;
  line-height: 1.4; margin-bottom: 0.4rem;
}
.sp-arcade-body {
  font-size: 0.88rem; color: var(--c-text-dim);
  line-height: 1.55; margin-bottom: 1.2rem;
}
.sp-arcade-cta {
  display: inline-block;
  font-family: var(--f-mono); font-size: 0.82rem;
  letter-spacing: 0.16em; color: var(--c-accent);
  text-decoration: none; border-bottom: 1px solid var(--c-accent);
  padding: 0.3em 0; transition: color 0.2s;
}
.sp-arcade-cta:hover { color: var(--c-accent-hover); }

@media (max-width: 768px) {
  .sp-header-inner { padding: 0 1rem; }
  .sp-line { left: 1.5rem; right: 1.5rem; }
  .sp-handoff { grid-template-columns: 1fr; gap: 0.9rem; }
  .sp-handoff-back, .sp-handoff-next { text-align: center; }
  .sp-handoff-next { text-align: center; }
  .sp-stop-card { grid-template-columns: 1fr; gap: 0.5rem; }
  .sp-stop-cta { text-align: left; }
  .sp-side-grid { grid-template-columns: 1fr; }
  .sp-banner { flex-direction: column; align-items: flex-start; }
}

/* ============ 8-BIT SITE CHROME ============
   Site-wide 8-bit framing for nav, tool-header, tool-walker, and
   footer. Applies to every page that loads this stylesheet. Arcade
   pages use their own stylesheets and are unaffected. Body content
   typography (.mt-panel internals, paragraphs, form inputs) is
   intentionally untouched so reading stays comfortable. */

/* Body atmosphere: warm gradient + faint scanlines layered over the
   existing dark indigo. Fixed-position so it stays put as the page
   scrolls. The homepage's inline body::before takes precedence on
   index.html (later in source order). */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232,134,74,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(155,142,196,0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 90% 30%, rgba(232,134,74,0.035) 0%, transparent 40%);
  mix-blend-mode: screen;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.05) 3px,
    rgba(0,0,0,0.05) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

/* Lift content above the atmosphere. */
.nav, main, section, .panorama, .mt-footer-strip, footer, .tool-walker {
  position: relative;
  z-index: 2;
}

/* Nav: pixel logo mark, sharper everything, stepped border. */
.nav {
  border-bottom: 2px solid rgba(232,134,74,0.32);
  background: rgba(13, 9, 25, 0.92);
}
.nav-logo {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav-logo-mark {
  border-radius: 0 !important;
  border-width: 1px !important;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.55rem !important;
  letter-spacing: 0.14em !important;
}
.nav-links a {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav-links a.active {
  border-bottom: 2px solid var(--c-accent);
}
.nav-contact {
  border-radius: 0 !important;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.55rem !important;
  letter-spacing: 0.14em !important;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.55);
  transition: transform 0.16s steps(2, end), box-shadow 0.16s steps(2, end);
}
.nav-contact:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(232,134,74,0.55);
}

/* Mobile menu links: punkier caps treatment. */
.mobile-menu a {
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 1.1rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
}

/* Tool-header (page hero on every path/lab/tool/courses page): pixel
   title with chunky shadow stack. eyebrow + sub stay readable. */
.tool-header {
  border-bottom: 2px solid rgba(232,134,74,0.28);
}
.tool-eyebrow {
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.6rem !important;
  letter-spacing: 0.18em !important;
  color: var(--c-accent) !important;
}
.tool-title {
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: clamp(1.2rem, 3.4vw, 2.1rem) !important;
  font-weight: 400 !important;
  letter-spacing: 0.03em !important;
  line-height: 1.35 !important;
  text-transform: uppercase;
  text-shadow:
    2px 2px 0 #000,
    4px 4px 0 rgba(232,134,74,0.45);
  margin-bottom: 1.1rem !important;
}
/* Tool sub stays readable: kept on serif/sans, just tighten contrast. */
.tool-sub {
  font-size: 1rem !important;
  line-height: 1.7 !important;
  color: rgba(240,236,230,0.78) !important;
}

/* page-hero variant (used by some pages instead of .tool-header). */
.page-hero {
  border-bottom: 2px solid rgba(232,134,74,0.28);
}
.page-title {
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: clamp(1.2rem, 3.4vw, 2.1rem) !important;
  font-weight: 400 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000, 4px 4px 0 rgba(232,134,74,0.45);
}
.page-sub {
  font-size: 1rem !important;
  line-height: 1.7 !important;
  color: rgba(240,236,230,0.78) !important;
}

/* mt-panel border: keep the soft top accent but sharpen the corners
   slightly. Content typography untouched. */
.mt-panel {
  border-radius: 8px;
  border-width: 1px;
  border-color: rgba(232,134,74,0.18);
}
.mt-panel-label {
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.5rem !important;
  letter-spacing: 0.16em !important;
}

/* Tool-walker: 8-bit footer between tool pages. */
.tool-walker {
  border-top: 2px dashed rgba(232,134,74,0.32);
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.55rem !important;
  letter-spacing: 0.14em !important;
}
.tool-walker a {
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.55rem !important;
}
.tool-walker-hub {
  font-size: 0.5rem !important;
  letter-spacing: 0.16em !important;
}

/* Footer strip: pixel-typed credits line. */
.mt-footer-strip {
  border-top: 2px solid rgba(232,134,74,0.28);
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.55rem !important;
  letter-spacing: 0.16em !important;
  padding: 2.5rem 0;
  position: relative;
}
.mt-footer-strip::before {
  /* Whisper of cherry-blossom branch above the footer strip. Different
     region of the source than the hero band and dark divider use. */
  content: '';
  position: absolute;
  top: -2px; left: 0; right: 0;
  height: 44px;
  background-image: url('assets/cherry-blossoms-source.svg');
  background-size: 280% auto;
  background-position: 30% 70%;
  background-repeat: no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

/* Buttons used inside tool pages: 8-bit treatment. */
.mt-btn {
  border-radius: 0 !important;
  font-family: var(--f-mono) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.55);
  transition: transform 0.16s steps(2, end), box-shadow 0.16s steps(2, end);
}
.mt-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(232,134,74,0.55);
}
.mt-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 transparent;
}

/* Layer chips: sharper. */
.layer-chip {
  border-radius: 0 !important;
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.5rem !important;
  letter-spacing: 0.12em !important;
}

/* Reading-friendly content. Used on tool/path/lab pages where long
   text appears. Generous line-height, max-width, comfortable size.
   Apply by adding .mt-reading to any text container. Keeps the
   8-bit chrome but makes paragraphs comfortable to read. */
.mt-reading {
  max-width: 68ch;
  font-size: 1.05rem;
  line-height: 1.78;
  color: rgba(240,236,230,0.92);
}
.mt-reading p { margin-bottom: 1.25em; }
.mt-reading h2, .mt-reading h3 {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2.4em;
  margin-bottom: 0.9em;
  text-shadow: 2px 2px 0 #000;
}
.mt-reading h2 { font-size: 1.05rem; }
.mt-reading h3 { font-size: 0.85rem; }
.mt-reading code {
  font-family: var(--f-mono);
  background: rgba(232,134,74,0.08);
  border: 1px solid rgba(232,134,74,0.22);
  padding: 0.12em 0.4em;
  font-size: 0.92em;
  color: var(--c-accent);
}
.mt-reading pre {
  background: rgba(12,12,30,0.7);
  border: 2px solid rgba(232,134,74,0.32);
  padding: 1rem 1.2rem;
  margin: 1.5em 0;
  overflow-x: auto;
  font-family: var(--f-mono);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* Tool-page explainer box: 8-bit treatment. Cascades to every tool
   page via the shared .mt-explain class. */
.mt-explain {
  border-radius: 0 !important;
  border-left-width: 4px !important;
  border-top: 1px solid rgba(232, 134, 74, 0.18);
  border-right: 1px solid rgba(232, 134, 74, 0.12);
  border-bottom: 1px solid rgba(232, 134, 74, 0.18);
  font-size: 0.95rem !important;
  line-height: 1.72 !important;
}
.mt-explain b {
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.78em !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase;
}

/* What Just Happened panels: 8-bit chrome. */
.wjh-panel {
  border-radius: 0 !important;
  border: 2px solid rgba(232, 134, 74, 0.32) !important;
  border-left-width: 5px !important;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, rgba(232, 134, 74, 0.06), rgba(155, 142, 196, 0.05)) !important;
}

/* Story intro / outro: lesson-page reading typography. The .sp-intro
   sits under tool titles on every Signal Path tool page; the
   .sp-handoff-outro sits between prev and next links at the bottom.
   Both are dynamically populated by signal-path.js. Bumping size,
   line-height, and contrast so they read like a tutorial paragraph,
   not a caption. */
.sp-intro {
  font-size: 1.12rem !important;
  line-height: 1.78 !important;
  color: rgba(240, 236, 230, 0.86) !important;
  max-width: 64ch !important;
  margin: 1rem auto 2rem !important;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--c-accent);
  background: rgba(232, 134, 74, 0.04);
  text-align: left !important;
}
.sp-handoff-outro {
  font-size: 1.05rem !important;
  line-height: 1.7 !important;
  color: rgba(240, 236, 230, 0.88) !important;
}

/* Detail card on flow-style tool pages (firewalls, load-balancers, bgp).
   These pages share the .detail-card / .detail-title / .card-tag
   pattern. Pixel-up the title, sharpen the card chrome. */
.detail-card {
  border-radius: 0 !important;
  border-width: 2px !important;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.detail-title {
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.85rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.04em !important;
  line-height: 1.4 !important;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000;
}
.detail-sub {
  font-size: 0.95rem !important;
  line-height: 1.7 !important;
  color: rgba(240, 236, 230, 0.84) !important;
}
.card-tag {
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.5rem !important;
  letter-spacing: 0.16em !important;
  color: var(--c-accent) !important;
  text-transform: uppercase;
}

/* Flow-page 8-bit chrome (firewalls, load-balancers, similar). Both
   pages define identical .action-btn / .status-pill / .actor-* CSS.
   These overrides cascade to both with one shared edit. */
.action-btn {
  border-radius: 0 !important;
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.55rem !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  transition: transform 0.16s steps(2, end), box-shadow 0.16s steps(2, end), background 0.16s var(--ease), color 0.16s var(--ease) !important;
  padding: 0.7em 1.1em !important;
}
.action-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(232, 134, 74, 0.55);
}
.action-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 transparent;
}
.status-pill {
  border-radius: 0 !important;
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.5rem !important;
  letter-spacing: 0.14em !important;
}
.actor-role {
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.5rem !important;
  letter-spacing: 0.16em !important;
  color: var(--c-accent) !important;
}
.actor-name {
  font-family: var(--f-mono) !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase;
}
.wjh-label {
  font-family: 'Press Start 2P', 'Courier New', monospace !important;
  font-size: 0.5rem !important;
  letter-spacing: 0.18em !important;
  color: var(--c-accent) !important;
  opacity: 1 !important;
}
.wjh-text {
  font-size: 0.95rem !important;
  line-height: 1.72 !important;
}

/* Mobile tightening for 8-bit chrome. */
@media (max-width: 700px) {
  .nav-logo { font-size: 0.52rem; letter-spacing: 0.1em; }
  .tool-title, .page-title {
    font-size: clamp(0.95rem, 5.5vw, 1.4rem) !important;
    letter-spacing: 0.02em !important;
    text-shadow: 1px 1px 0 #000, 2px 2px 0 rgba(232,134,74,0.45) !important;
  }
  .tool-eyebrow { letter-spacing: 0.12em !important; }
  .wjh-panel { padding: 0.95rem 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-contact, .mt-btn { transition: none; }
}
/* ============ END 8-BIT SITE CHROME ============ */

