/* ═══════════════════════════════════════════════════════════════════════════
   SweepR — Secure Routing Visualiser
   Owns everything inside #shieldMount. Every rule is scoped to .shield-* so it
   cannot leak into the rest of bridge.html, which is full of existing markup.
   Design tokens come from :root in bridge.html — do not hardcode a new palette.
   ═══════════════════════════════════════════════════════════════════════════ */

.shield-section{margin-top:74px;scroll-margin-top:110px}

/* ── Heading block ── */
.shield-head{text-align:center;max-width:66ch;margin:0 auto 34px}
.shield-kicker{
  display:inline-flex;align-items:center;gap:10px;padding:6px 14px;border-radius:999px;
  background:rgba(255,255,255,.04);border:1px solid var(--line);
  font-size:10.5px;font-weight:800;letter-spacing:.18em;text-transform:uppercase;color:var(--cyan);
}
.shield-live-pill{
  display:none;align-items:center;gap:7px;padding:4px 10px;margin-left:2px;border-radius:999px;
  background:rgba(52,224,176,.13);border:1px solid rgba(52,224,176,.4);color:var(--mint);
  font-size:9.5px;font-weight:800;letter-spacing:.16em;
}
.shield-section.is-live .shield-live-pill{display:inline-flex}
.shield-live-dot{
  width:6px;height:6px;border-radius:50%;background:var(--mint);
  box-shadow:0 0 0 0 rgba(52,224,176,.6);animation:shield-pulse 2s infinite;
}
@keyframes shield-pulse{70%{box-shadow:0 0 0 8px rgba(52,224,176,0)}100%{box-shadow:0 0 0 0 rgba(52,224,176,0)}}
.shield-title{
  margin:16px 0 11px;font-family:'Space Grotesk','Inter',sans-serif;
  font-size:clamp(26px,3.7vw,42px);line-height:1.08;font-weight:700;letter-spacing:-.036em;
}
.shield-title em{
  font-style:normal;background:var(--grad);-webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;
}
.shield-sub{color:var(--muted);font-size:15px;line-height:1.68}

/* ── Outer glass frame ── */
.shield-frame{
  position:relative;padding:28px 26px 26px;border-radius:var(--r-xl);
  background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.02));
  backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);
  border:1px solid var(--line);box-shadow:var(--shadow);
}
.shield-frame::before{
  content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background:var(--grad);opacity:.3;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;
  mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask-composite:exclude;pointer-events:none;
}

/* ── The rail: five nodes, an animated track and a travelling packet ── */
.shield-rail{position:relative;padding:8px 0 4px}
.shield-track{
  position:absolute;left:10%;right:10%;top:35px;height:2px;border-radius:2px;
  background:linear-gradient(90deg,rgba(255,255,255,.07),rgba(255,255,255,.14),rgba(255,255,255,.07));
  overflow:visible;
}
/* JS only ever sets --shield-progress (0 → 1) on .shield-rail; the horizontal and
   vertical layouts each read it on whichever axis they use. */
.shield-track-fill{
  position:absolute;left:0;top:0;bottom:0;border-radius:2px;
  width:calc(var(--shield-progress,0) * 100%);
  background:var(--grad);box-shadow:0 0 14px rgba(139,92,246,.6);
  transition:width 1.1s var(--ease),height 1.1s var(--ease);
}
.shield-packet{
  position:absolute;top:50%;left:calc(var(--shield-progress,0) * 100%);
  width:13px;height:13px;margin:-6.5px 0 0 -6.5px;border-radius:50%;
  transition:left 1.1s var(--ease),top 1.1s var(--ease);
  background:#fff;box-shadow:0 0 0 4px rgba(255,255,255,.12),0 0 22px 5px rgba(232,121,249,.8);
}
.shield-packet::after{
  content:'';position:absolute;inset:-9px;border-radius:50%;border:1px solid rgba(255,255,255,.35);
  animation:shield-ripple 1.8s var(--ease) infinite;
}
@keyframes shield-ripple{0%{transform:scale(.5);opacity:.9}100%{transform:scale(1.9);opacity:0}}

.shield-nodes{position:relative;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.shield-node{
  display:flex;flex-direction:column;align-items:center;gap:11px;
  background:none;border:none;padding:0;cursor:pointer;text-align:center;
}
.shield-dot{
  position:relative;width:54px;height:54px;flex-shrink:0;border-radius:18px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(10,12,22,.92);border:1px solid var(--line-2);color:var(--faint);
  transition:all .45s var(--ease);
}
.shield-dot svg{width:22px;height:22px}
.shield-node-text{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:0}
.shield-node-label{
  font-size:11.5px;font-weight:700;letter-spacing:.04em;color:var(--faint);
  transition:color .45s var(--ease);
}
.shield-node-step{
  font-size:9px;font-weight:800;letter-spacing:.2em;color:rgba(226,232,255,.22);
  font-variant-numeric:tabular-nums;transition:color .45s var(--ease);
}
.shield-node:hover .shield-dot{border-color:rgba(255,255,255,.3);transform:translateY(-2px)}
.shield-node:hover .shield-node-label{color:var(--muted)}

/* Stages the packet has already cleared */
.shield-node.is-done .shield-dot{border-color:rgba(255,255,255,.22);color:rgba(226,232,255,.5);background:rgba(16,19,32,.92)}
.shield-node.is-done .shield-node-label{color:var(--muted)}

/* The stage the packet is sitting on */
.shield-node.is-active .shield-dot{
  color:#fff;border-color:transparent;background:var(--grad);
  box-shadow:0 12px 34px rgba(139,92,246,.45),0 0 0 6px rgba(139,92,246,.12);
  transform:translateY(-3px) scale(1.06);
}
.shield-node.is-active .shield-node-label{color:var(--ink)}
.shield-node.is-active .shield-node-step{color:var(--cyan)}

/* Tone accents per stage */
.shield-node.is-active[data-tone="cyan"] .shield-dot{background:linear-gradient(135deg,#22d3ee,#5eead4);box-shadow:0 12px 34px rgba(34,211,238,.42),0 0 0 6px rgba(34,211,238,.12)}
.shield-node.is-active[data-tone="magenta"] .shield-dot{background:linear-gradient(135deg,#8b5cf6,#e879f9);box-shadow:0 12px 40px rgba(232,121,249,.5),0 0 0 6px rgba(232,121,249,.14)}
.shield-node.is-active[data-tone="mint"] .shield-dot{background:linear-gradient(135deg,#34e0b0,#22d3ee);box-shadow:0 12px 34px rgba(52,224,176,.42),0 0 0 6px rgba(52,224,176,.12)}

/* A hop that this route does not actually use */
.shield-node.is-bypassed .shield-dot{
  border-style:dashed;border-color:rgba(251,113,133,.45);color:rgba(251,113,133,.75);
  background:rgba(251,113,133,.06);
}
.shield-node.is-bypassed .shield-node-label{color:rgba(251,113,133,.8)}
.shield-node.is-bypassed.is-active .shield-dot{background:rgba(251,113,133,.14);box-shadow:0 10px 30px rgba(251,113,133,.25)}

/* ── Lower half: stage detail + exposure meter + observer console ── */
.shield-lower{display:grid;grid-template-columns:minmax(0,1fr) 322px;gap:20px;margin-top:30px}

.shield-detail{
  position:relative;padding:24px 24px 22px;border-radius:var(--r-lg);
  background:rgba(255,255,255,.028);border:1px solid var(--line);min-height:214px;
}
.shield-detail-step{
  display:inline-flex;align-items:center;gap:9px;
  font-family:'Space Grotesk','Inter',sans-serif;font-size:11px;font-weight:700;
  letter-spacing:.2em;text-transform:uppercase;color:var(--cyan);
}
.shield-detail-step b{
  font-size:26px;font-weight:700;letter-spacing:-.02em;line-height:1;
  background:var(--grad);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
}
.shield-detail-title{
  margin:13px 0 10px;font-family:'Space Grotesk','Inter',sans-serif;
  font-size:24px;font-weight:700;letter-spacing:-.028em;line-height:1.16;
}
.shield-detail-desc{color:var(--muted);font-size:14.4px;line-height:1.7;max-width:62ch}
.shield-detail-meta{
  display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;padding-top:15px;border-top:1px solid var(--line);
}
.shield-chip{
  display:inline-flex;align-items:center;gap:7px;padding:7px 12px;border-radius:11px;
  background:var(--glass-2);border:1px solid var(--line);
  font-size:11.5px;font-weight:650;color:var(--muted);
}
.shield-chip svg{width:13px;height:13px;color:var(--cyan)}
.shield-chip.is-warn{border-color:rgba(251,113,133,.34);background:rgba(251,113,133,.08);color:rgba(254,205,211,.9)}
.shield-chip.is-warn svg{color:var(--rose)}
.shield-chip img{width:15px;height:15px;border-radius:50%;object-fit:cover;background:rgba(255,255,255,.08)}

/* Cross-fade whenever the active stage changes */
.shield-fade{animation:shield-in .5s var(--ease) both}
@keyframes shield-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}

.shield-side{display:flex;flex-direction:column;gap:20px}

/* Exposure meter */
.shield-meter{
  position:relative;padding:20px;border-radius:var(--r-lg);
  background:rgba(255,255,255,.028);border:1px solid var(--line);text-align:center;
}
.shield-meter-label{
  font-size:9.5px;font-weight:800;letter-spacing:.2em;text-transform:uppercase;color:var(--faint);
}
.shield-gauge{position:relative;width:158px;height:158px;margin:12px auto 0}
.shield-gauge svg{width:100%;height:100%;transform:rotate(-90deg)}
.shield-gauge-bg{fill:none;stroke:rgba(255,255,255,.07);stroke-width:9}
.shield-gauge-arc{
  fill:none;stroke:var(--mint);stroke-width:9;stroke-linecap:round;
  transition:stroke .6s var(--ease),stroke-dashoffset 1.1s var(--ease);
  transition:stroke-dashoffset 1.1s var(--ease);
}
.shield-gauge-val{
  position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
}
.shield-gauge-num{
  font-family:'Space Grotesk','Inter',sans-serif;font-size:38px;font-weight:700;letter-spacing:-.04em;
  line-height:1;font-variant-numeric:tabular-nums;
}
.shield-gauge-num small{font-size:17px;font-weight:600;opacity:.6;margin-left:1px}
/* Below the ring, never inside it: "Fully identifiable" is wider than the
   circle and its end letters used to sit on the stroke, unreadable. */
.shield-gauge-state{margin-top:11px;font-size:10px;font-weight:800;letter-spacing:.17em;text-transform:uppercase;color:var(--faint);white-space:nowrap}
.shield-meter.is-clear .shield-gauge-num{color:var(--mint)}
.shield-meter.is-clear .shield-gauge-state{color:var(--mint)}
.shield-meter.is-warn .shield-gauge-num{color:var(--amber)}
.shield-meter.is-warn .shield-gauge-state{color:var(--amber)}
.shield-meter.is-hot .shield-gauge-num{color:var(--rose)}
.shield-meter.is-hot .shield-gauge-state{color:var(--rose)}

/* Observer console */
.shield-console{
  flex:1;padding:16px 16px 14px;border-radius:var(--r-lg);
  background:rgba(4,5,11,.7);border:1px solid var(--line-2);overflow:hidden;
}
.shield-console-bar{display:flex;align-items:center;gap:8px;margin-bottom:13px}
.shield-console-lights{display:flex;gap:5px}
.shield-console-lights i{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.14)}
.shield-console-lights i:first-child{background:rgba(251,113,133,.6)}
.shield-console-lights i:nth-child(2){background:rgba(251,191,36,.6)}
.shield-console-title{
  font-size:9.5px;font-weight:800;letter-spacing:.16em;text-transform:uppercase;color:var(--faint);
}
.shield-console-body{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:11.5px;line-height:1.95;color:rgba(226,232,255,.62);
  font-variant-numeric:tabular-nums;word-break:break-word;
}
.shield-console-line{display:block;opacity:0;animation:shield-type .42s var(--ease) both}
.shield-console-line:nth-child(1){animation-delay:.05s}
.shield-console-line:nth-child(2){animation-delay:.19s}
.shield-console-line:nth-child(3){animation-delay:.33s}
.shield-console-line:nth-child(4){animation-delay:.47s}
@keyframes shield-type{from{opacity:0;transform:translateX(-5px)}to{opacity:1;transform:none}}
.shield-console-key{color:rgba(226,232,255,.34);white-space:pre}
.shield-console-hot{color:var(--rose)}
.shield-console-ok{color:var(--mint)}
.shield-console-dim{color:rgba(226,232,255,.28)}
.shield-caret{
  display:inline-block;width:7px;height:13px;margin-left:3px;vertical-align:-2px;
  background:var(--cyan);animation:shield-blink 1.1s steps(2,start) infinite;
}
@keyframes shield-blink{50%{opacity:0}}

/* ── Responsive ───────────────────────────────────────────────────────────
   Three steps down from the desktop layout:
     ≤1040px  the meter + console drop under the stage detail (text first)
     ≤860px   the five-step rail becomes a vertical timeline, one full-width
              tap target per step, and the side column stacks
     ≤480px   phone sizing: smaller frame padding, clamped type, wrapping
              console lines so no value can push the page sideways
   ──────────────────────────────────────────────────────────────────────── */
@media (max-width:1040px){
  .shield-lower{grid-template-columns:minmax(0,1fr)}
  .shield-side{flex-direction:row}
  .shield-meter{flex:0 0 250px}
  .shield-console{flex:1;min-width:0}
}
@media (max-width:860px){
  .shield-section{margin-top:52px}
  .shield-head{margin-bottom:26px}
  .shield-frame{padding:20px 15px 18px;border-radius:24px}
  .shield-side{flex-direction:column}
  .shield-meter{flex:none}
  .shield-detail{padding:19px 17px;min-height:0}
  .shield-detail-title{font-size:20px}
  .shield-detail-desc{font-size:13.6px}

  /* The rail becomes a vertical timeline. The track is pinned to the centre of
     the first and last dot (rail padding 8px + node padding 2px + half of the
     46px dot), so the travelling packet lands exactly on a node. */
  .shield-track{left:22px;right:auto;top:33px;bottom:29px;width:2px;height:auto}
  .shield-track-fill{left:0;right:0;top:0;bottom:auto;width:auto;height:calc(var(--shield-progress,0) * 100%)}
  .shield-packet{top:calc(var(--shield-progress,0) * 100%);left:50%;margin-left:-6.5px}
  .shield-nodes{grid-template-columns:minmax(0,1fr);gap:12px}
  /* Each step is a full-width row, ≥50px tall: comfortably tappable. */
  .shield-node{
    flex-direction:row;align-items:center;gap:14px;text-align:left;
    min-height:44px;padding:2px 0;
  }
  .shield-dot{width:46px;height:46px;border-radius:15px}
  .shield-dot svg{width:19px;height:19px}
  .shield-node-text{align-items:flex-start;gap:2px}
  .shield-node-label{font-size:12.5px}
  .shield-node-step{font-size:10px;letter-spacing:.18em}
  /* Touch devices keep :hover stuck after a tap; the lift would sit there. */
  .shield-node:hover:not(.is-active) .shield-dot{transform:none}
}
@media (max-width:480px){
  .shield-section{margin-top:44px}
  .shield-head{margin-bottom:22px}
  .shield-kicker{flex-wrap:wrap;justify-content:center;padding:6px 12px;letter-spacing:.14em}
  .shield-title{font-size:clamp(23px,6.4vw,26px)}
  .shield-sub{font-size:14px;line-height:1.62}
  .shield-frame{padding:16px 12px 15px;border-radius:22px}
  .shield-detail{padding:16px 14px}
  .shield-detail-title{font-size:18.5px}
  .shield-detail-desc{font-size:13.4px}
  .shield-detail-meta{gap:7px;margin-top:14px;padding-top:13px}
  /* A chip can never be wider than the panel, and its text breaks if it has to. */
  .shield-chip{max-width:100%;padding:8px 11px;font-size:12px;overflow-wrap:anywhere}
  .shield-meter{padding:16px 14px}
  .shield-meter-label{font-size:10.5px;letter-spacing:.16em}
  .shield-gauge{width:132px;height:132px}
  .shield-gauge-num{font-size:32px}
  .shield-gauge-state{font-size:10.5px;letter-spacing:.14em}
  .shield-console{padding:14px 13px 12px}
  .shield-console-title{font-size:10.5px;letter-spacing:.13em}
  .shield-console-body{font-size:12px;line-height:1.85}
  /* Key stays on its own fixed column; the value wraps under itself instead of
     running past the card edge. */
  .shield-console-line{display:flex;align-items:flex-start;gap:2px}
  .shield-console-key{flex:none}
  .shield-console-line>span+span{min-width:0;overflow-wrap:anywhere}
}
@media (prefers-reduced-motion:reduce){
  .shield-packet,.shield-packet::after,.shield-live-dot,.shield-caret{animation:none}
  .shield-packet{display:none}
  .shield-fade,.shield-console-line{animation:none;opacity:1}
}
