@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url(fonts/barlow-condensed-800.woff2) format("woff2"); }

:root {
  --bg: #121417;
  --bg-2: #181b1f;
  --panel: #1c1f24;
  --line: #2c3037;
  --ink: #ece9e2;
  --dim: #9ca1a8;
  --yellow: #ffcc00;
  --red: #e5322d;
  --amber: #ff9a1f;
  --green: #3ddc6a;
  --cyan: #59b8d9;
  --paper: #ece7da;
  --paper-ink: #191714;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hazard: repeating-linear-gradient(-45deg, var(--yellow) 0 16px, #111 16px 32px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px) 0 0 / 100% 32px,
    radial-gradient(1200px 700px at 70% -10%, #1f242b 0, transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 400 18px/1.55 var(--body);
}
a { color: var(--yellow); }
code { font: .9em var(--mono); background: rgba(255,255,255,.07); padding: .05em .35em; border-radius: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--yellow); color: #000; padding: 8px 12px; z-index: 50; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- HMI bar ---------- */
.hmi-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: rgba(10,11,13,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  font: 600 13px/1 var(--mono); letter-spacing: .06em;
}
.brand { color: var(--ink); text-decoration: none; font: 800 22px/1 var(--display); letter-spacing: .04em; }
.brand span { color: var(--yellow); }
.bar-cells { display: flex; gap: 8px; flex-wrap: nowrap; }
.cell { padding: 7px 10px; border: 1px solid var(--line); background: #0d0f11; color: var(--dim); white-space: nowrap; }
#clock { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar-sign { background: var(--yellow); border-color: var(--yellow); color: #000; font-weight: 700; text-decoration: none; }
.bar-sign:hover { background: #fff; border-color: #fff; }
.state { display: inline-flex; align-items: center; gap: 8px; color: var(--green); border-color: rgba(61,220,106,.4); }
.state i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.6s ease-in-out infinite; }
body.faulted .state { color: var(--red); border-color: rgba(229,50,45,.6); }
body.faulted .state i { background: var(--red); box-shadow: 0 0 12px var(--red); animation: flash .5s steps(1) infinite; }
body.stopped .state { color: var(--amber); border-color: rgba(255,154,31,.5); }
body.stopped .state i { background: var(--amber); box-shadow: none; animation: none; }

/* ---------- fault banner ---------- */
.fault-banner {
  position: fixed; top: 49px; left: 0; right: 0; z-index: 25; /* over the page, so nothing under it jumps */
  background: repeating-linear-gradient(-45deg, #b5150f 0 22px, #8d0f0a 22px 44px);
  border-bottom: 3px solid #000;
  animation: alarm-bg 1s steps(1) infinite;
}
.fault-inner {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px 24px;
  max-width: 1200px; margin: 0 auto; padding: 12px clamp(16px, 4vw, 40px);
  color: #fff;
}
.fault-inner p { margin: 0; }
.fault-title { font: 800 26px/1 var(--display); letter-spacing: .05em; }
.nw { white-space: nowrap; }
.fault-text { font-weight: 600; }
.fault-timer { font: 600 15px/1 var(--mono); background: rgba(0,0,0,.35); padding: 8px 10px; }
.fault-timer span { font-variant-numeric: tabular-nums; }
.reset {
  position: relative; overflow: hidden;
  border: 2px solid #fff; background: #111; color: #fff;
  padding: 10px 18px; font: 800 18px/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
}
.reset .fill { position: absolute; inset: 0; background: var(--yellow); transform: scaleX(var(--p, 0)); transform-origin: left; }
.reset .label { position: relative; mix-blend-mode: difference; }

/* ---------- hero ---------- */
main { overflow-x: clip; }
.hero {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) clamp(16px, 4vw, 40px) 40px;
}
.eyebrow { margin: 0 0 14px; font: 600 14px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
h1 {
  margin: 0; padding-bottom: .2em; font: 800 clamp(76px, 15vw, 196px)/.84 var(--display);
  text-transform: uppercase; letter-spacing: -.01em;
}
h1 em { font-style: normal; color: var(--yellow); position: relative; white-space: nowrap; }
h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.1em; height: .1em;
  background: var(--hazard);
}
.lede { max-width: 40ch; margin: 18px 0 0; font-size: clamp(19px, 2.1vw, 23px); line-height: 1.45; color: #d6d3cc; }

.hero-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center;
  margin-top: clamp(36px, 5vw, 56px);
}
.rung-card {
  margin: 0; background: #0c1210; border: 1px solid #23302a; border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);
  overflow: hidden;
}
.rung-head {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 14px; border-bottom: 1px solid #23302a; background: #0f1714;
  font: 600 12px/1.2 var(--mono); letter-spacing: .05em; color: #7e9488;
}
.mode { color: var(--green); }
.rung-card[data-state="fault"] .mode { color: var(--red); }
.rung-card[data-state="stopped"] .mode { color: var(--amber); }
.rung { display: block; width: 100%; height: auto; padding: 6px 8px 0; }
.rung text { font: 600 12.5px var(--mono); fill: #9fb3a8; text-anchor: middle; }
.rung .cmt { fill: #5fae7a; font-style: italic; text-anchor: start; font-weight: 400; }
.rung .rnum { fill: #56665e; text-anchor: start; font-weight: 400; }
.rung .rail { stroke: #5d6e66; stroke-width: 4; }
.rung .wire, .rung .contact line, .rung .coil path { stroke: #3c4a43; stroke-width: 3; fill: none; stroke-linecap: square; }
.rung .contact line { stroke-width: 3.5; }
.rung .wire.on { stroke: var(--green); stroke-dasharray: 10 6; animation: flow .7s linear infinite; filter: drop-shadow(0 0 3px rgba(61,220,106,.7)); }
.rung .contact.on line, .rung .coil.on path { stroke: var(--green); filter: drop-shadow(0 0 3px rgba(61,220,106,.7)); }
.rung .contact.on { }
.rung .contact.on::after { content: ""; }
.rung .contact.hl rect { fill: rgba(61,220,106,.16); }
.rung .coil.on text, .rung .contact.on text { fill: var(--green); }
.rung .contact.bad line, .rung .contact.bad text { stroke: var(--red); fill: var(--red); }
.rung .contact.bad text { stroke: none; }
.rung-card figcaption {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  padding: 10px 14px 12px; border-top: 1px solid #23302a;
  font: 500 13px/1.35 var(--mono); color: #8ea398;
}
.uptime { color: var(--ink); font-variant-numeric: tabular-nums; }

.controls { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 220px; }
.estop {
  width: 200px; height: 200px; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 50%; filter: drop-shadow(0 14px 22px rgba(0,0,0,.55));
}
.estop svg { width: 100%; height: 100%; display: block; overflow: visible; }
.estop .estop-ring { font: 800 19px var(--display); letter-spacing: .16em; fill: #111; }
.estop .mushroom { transition: transform .12s ease; transform-origin: 100px 100px; }
.estop:hover .mushroom { transform: scale(1.025); }
.estop:active .mushroom, .estop[aria-pressed="true"] .mushroom { transform: translateY(5px) scale(.94); }
.estop[aria-pressed="true"] .mushroom circle { filter: brightness(.82); }
.estop.nope { animation: shake .35s ease; }
.ctl-side { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.start {
  min-width: 120px; padding: 12px 22px; cursor: pointer;
  border: 3px solid #0b3d1b; border-radius: 6px;
  background: linear-gradient(#2fc95b, #1b9a40); color: #052410;
  font: 800 20px/1 var(--display); letter-spacing: .12em;
  box-shadow: 0 5px 0 #0b3d1b, 0 10px 18px rgba(0,0,0,.4);
}
.start:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #0b3d1b; }
.start:disabled { cursor: not-allowed; background: #2a3a2f; color: #5f7466; border-color: #1d2a21; box-shadow: 0 5px 0 #141c16; }
.start.ready { animation: glow 1.1s ease-in-out infinite; }
.ctl-hint { margin: 0; min-height: 2.6em; font: 500 14px/1.3 var(--mono); color: var(--dim); text-align: center; max-width: 220px; }

.cues { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 44px; }
.scroll-cue {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font: 600 14px/1 var(--mono); letter-spacing: .05em;
  border: 1px solid var(--line); padding: 10px 14px; background: var(--panel);
}
.scroll-cue:hover { border-color: var(--red); }
.sign-cue { background: var(--yellow); border-color: var(--yellow); color: #000; font-weight: 700; }
.sign-cue:hover { background: #fff; border-color: #fff; }
.sign-cue span:empty { display: none; }
.blink-dot { width: 10px; height: 10px; background: var(--red); border-radius: 50%; animation: flash 1s steps(1) infinite; }

/* ---------- sections ---------- */
section { scroll-margin-top: 64px; }
.alarms, .sim, .age, .share { max-width: 1200px; margin: 0 auto; padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 40px) 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; border-bottom: 3px solid var(--ink); padding-bottom: 10px; }
h2 { margin: 0; font: 800 clamp(44px, 6.5vw, 76px)/.9 var(--display); text-transform: uppercase; }
.section-sub { color: var(--dim); max-width: 60ch; margin: 16px 0 26px; }

/* ---------- alarms ---------- */
.alarm-stats { display: flex; gap: 8px; align-items: center; font: 600 13px/1 var(--mono); letter-spacing: .06em; }
.alarm-stats > span { padding: 9px 10px; border: 1px solid var(--line); background: var(--panel); color: var(--dim); }
.alarm-stats b { color: var(--red); margin-left: 4px; }
.ack-all { padding: 9px 12px; border: 1px solid var(--line); background: #111; color: #5b6067; font: 600 13px/1 var(--mono); letter-spacing: .06em; cursor: not-allowed; }

.alarm-table { border: 1px solid var(--line); background: #0e1013; }
.alarm-cols, .alarm-row {
  display: grid; grid-template-columns: 70px 150px minmax(180px, 250px) minmax(0, 1fr) 28px;
  gap: 16px; align-items: center;
}
.alarm-cols { padding: 9px 14px; font: 600 11.5px/1 var(--mono); letter-spacing: .12em; color: #6c727a; border-bottom: 1px solid var(--line); background: #0a0c0e; }
.alarm-cols::after { content: ""; }
.alarm { border-bottom: 1px solid #23272d; }
.alarm:last-child { border-bottom: 0; }
.alarm-row {
  width: 100%; padding: 13px 14px; text-align: left; cursor: pointer;
  background: transparent; border: 0; border-left: 4px solid transparent;
}
.alarm-row:hover { background: #161a1f; }
.alarm[data-pri="crit"] .alarm-row { border-left-color: var(--red); }
.alarm[data-pri="high"] .alarm-row { border-left-color: var(--amber); }
.alarm[data-pri="med"] .alarm-row { border-left-color: var(--yellow); }
.alarm[data-pri="low"] .alarm-row { border-left-color: var(--cyan); }
.pri { display: inline-block; text-align: center; padding: 5px 0; font: 800 13px/1 var(--mono); letter-spacing: .06em; color: #000; border-radius: 2px; }
.alarm[data-pri="crit"] .pri { background: var(--red); color: #fff; animation: chip 1s steps(1) infinite; }
.alarm[data-pri="high"] .pri { background: var(--amber); animation: chip 1.4s steps(1) infinite; }
.alarm[data-pri="med"] .pri { background: var(--yellow); }
.alarm[data-pri="low"] .pri { background: var(--cyan); }
.time { font: 500 13.5px/1.2 var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; }
.tag { font: 600 13.5px/1.2 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.msg { font-size: 18px; font-weight: 600; line-height: 1.3; }
.chev { width: 12px; height: 12px; border-right: 2px solid var(--dim); border-bottom: 2px solid var(--dim); transform: rotate(45deg) translate(-3px, -3px); transition: transform .15s; justify-self: center; }
.alarm-row[aria-expanded="true"] { background: #161a1f; }
.alarm-row[aria-expanded="true"] .chev { transform: rotate(225deg) translate(-3px, -3px); }
.alarm-body { padding: 4px 56px 22px 254px; background: #161a1f; }
.alarm-body:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; justify-items: start; animation: open .18s ease; }
.rant { margin: 0; font-size: 20px; line-height: 1.5; color: #f3f0ea; max-width: 62ch; }
.receipt {
  margin: 0; max-width: 62ch; padding: 12px 14px 12px 16px;
  border-left: 3px solid var(--yellow); background: rgba(255,204,0,.06);
  color: #cfccc4; font-size: 16.5px;
}
.receipt b { display: block; margin-bottom: 4px; font: 700 11.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--yellow); }
.ack {
  padding: 8px 16px; border: 1px solid #4a4f57; background: #0d0f12; cursor: pointer;
  font: 700 13px/1 var(--mono); letter-spacing: .1em;
}
.ack:hover { border-color: var(--ink); }
.ack-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ack-msg { font: 500 14px/1.4 var(--mono); color: var(--red); }

/* ---------- simulator ---------- */
.term { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #07090a; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: #1a1d21; border-bottom: 1px solid var(--line); font: 600 12px/1 var(--mono); color: var(--dim); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3f46; }
.term-bar span { margin-left: 8px; }
.term-log { list-style: none; margin: 0; padding: 16px 18px; min-height: 300px; font: 500 15px/1.65 var(--mono); color: #c9d1c9; }
.term-log li { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-log li::before { content: "> "; color: #55605a; }
.term-log .ok { color: var(--green); }
.term-log .warn { color: var(--amber); }
.term-log .err { color: #ff5a52; }
.term-log .cmd { color: var(--ink); }
.term-log .cursor::after { content: "\2588"; animation: flash 1s steps(1) infinite; margin-left: 2px; }
.sim-go {
  margin-top: 18px; max-width: 100%; padding: 14px 20px; cursor: pointer; text-align: left;
  border: 2px solid var(--yellow); background: transparent; color: var(--yellow);
  font: 700 15px/1.3 var(--mono); overflow-wrap: anywhere;
}
.sim-go:hover:not(:disabled) { background: var(--yellow); color: #000; }
.sim-go:disabled { opacity: .45; cursor: progress; }

/* ---------- age ---------- */
.age-pick { display: block; margin-top: 26px; }
.age-pick > span:first-child { display: block; color: var(--dim); margin-bottom: 10px; }
.age-row { display: flex; align-items: center; gap: 18px; }
.age-row output { font: 800 44px/1 var(--display); color: var(--yellow); min-width: 3ch; font-variant-numeric: tabular-nums; }
input[type="range"] { flex: 1; max-width: 640px; height: 30px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; background: var(--hazard); border-radius: 0; }
input[type="range"]::-moz-range-track { height: 8px; background: var(--hazard); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; background: var(--ink); border: 3px solid #000; border-radius: 3px; }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; background: var(--ink); border: 3px solid #000; border-radius: 3px; }
.age-big { margin: 30px 0 6px; font: 800 clamp(40px, 6vw, 72px)/1 var(--display); text-transform: uppercase; }
.age-big #age-years { color: var(--yellow); font-variant-numeric: tabular-nums; }
.age-zero { display: block; color: var(--red); font-size: .55em; margin-top: 8px; letter-spacing: .02em; }
.age-lead { color: var(--dim); margin: 22px 0 8px; }
.age-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.age-list li { background: var(--bg-2); padding: 14px 16px; font-weight: 600; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.age-list b { display: block; font: 700 13px/1 var(--mono); color: var(--yellow); margin-bottom: 6px; letter-spacing: .08em; }
.age-list li.new { animation: open .25s ease; }
.age-tail { font: 800 clamp(28px, 3.6vw, 40px)/1.1 var(--display); text-transform: uppercase; margin: 24px 0 0; }

/* ---------- serious (paper datasheet) ---------- */
.serious { padding: clamp(64px, 9vw, 112px) clamp(16px, 4vw, 40px) 0; }
.sheet {
  position: relative; max-width: 1120px; margin: 0 auto;
  background: var(--paper); color: var(--paper-ink);
  padding: clamp(28px, 5vw, 60px);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: var(--hazard); }
.sheet h2 { margin-top: 10px; }
.sheet h3 { margin: 30px 0 8px; font: 800 26px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.sheet p { margin: 0; max-width: 56ch; }
.sheet code { background: rgba(0,0,0,.08); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 48px; }
.stamp {
  position: absolute; right: clamp(16px, 4vw, 48px); top: clamp(24px, 4vw, 44px);
  margin: 0; padding: 8px 14px; border: 4px solid #c3261f; color: #c3261f; border-radius: 6px;
  font: 800 22px/1 var(--display); letter-spacing: .08em; text-align: center;
  transform: rotate(8deg); opacity: .8;
}
.wants { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.wants li { padding: 14px 0 14px 34px; border-top: 1px solid rgba(0,0,0,.15); position: relative; }
.wants li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 16px; height: 16px; border: 2.5px solid var(--paper-ink); border-radius: 2px; }
.wants li::after { content: ""; position: absolute; left: 7px; top: 21px; width: 6px; height: 11px; border-right: 3px solid #c3261f; border-bottom: 3px solid #c3261f; transform: rotate(40deg); }
.wants b { font-weight: 600; }

/* ---------- the petition ---------- */
.petition { max-width: 1200px; margin: 0 auto; padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 40px) 0; }
.pet-doc {
  position: relative; background: var(--paper); color: var(--paper-ink); padding: clamp(28px, 5vw, 56px);
  border-top: 14px solid var(--red); box-shadow: 0 30px 80px rgba(0,0,0,.5);
  background-image: linear-gradient(rgba(0,0,0,.045) 1px, transparent 1px); background-size: 100% 34px;
}
.pet-kicker { margin: 0 0 12px; font: 700 13px/1 var(--mono); letter-spacing: .2em; color: #8a8478; }
.pet-to { margin: 22px 0 6px; font-weight: 600; }
.pet-text { margin: 0; max-width: 64ch; font-size: 19px; }
.pet-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin: 30px 0 18px; }
.pet-count b { font: 800 clamp(64px, 9vw, 104px)/.85 var(--display); color: var(--red); font-variant-numeric: tabular-nums; }
.pet-count span { font: 800 clamp(24px, 3vw, 32px)/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.pet-form { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 14px; align-items: end; position: relative; }
.pet-field { display: grid; gap: 8px; font: 700 13px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.pet-field select {
  min-height: 56px; width: 100%; padding: 0 40px 0 14px; border: 2px solid var(--paper-ink); border-radius: 0; color: var(--paper-ink);
  background: #fbf8f1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23191714' stroke-width='2.5'/%3E%3C/svg%3E") no-repeat right 14px center;
  font: 600 17px/1.2 var(--body); letter-spacing: 0; text-transform: none; -webkit-appearance: none; appearance: none; text-overflow: ellipsis;
}
.pet-field select:focus { outline: 3px solid var(--red); outline-offset: 2px; }
.btn.btn-sign { min-height: 56px; padding: 0 34px; background: var(--red); border-color: var(--red); color: #fff; font-size: 24px; }
.btn.btn-sign:hover { background: var(--paper-ink); border-color: var(--paper-ink); color: #fff; }
.btn.btn-sign:disabled { opacity: .6; cursor: progress; }
.pet-msg { min-height: 1.4em; margin: 14px 0 0; font: 600 17px/1.4 var(--body); }
.pet-msg.err { color: #c3261f; }
.pet-msg b { color: #c3261f; }
.pet-doc.signed .pet-form { display: none; }
.pet-doc.signed .pet-msg { font: 800 clamp(26px, 3.4vw, 36px)/1.15 var(--display); text-transform: uppercase; }
.pet-doc.signed .pet-msg a { display: inline-block; margin-top: 6px; font: 600 18px/1.3 var(--body); text-transform: none; color: var(--paper-ink); }
.pet-tally { margin-top: 30px; }
.pet-doc .pet-tally h3 { margin: 0 0 12px; font: 800 26px/1.1 var(--display); text-transform: uppercase; }
.pet-tally ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 760px; }
.pet-tally li { display: grid; grid-template-columns: minmax(0, 260px) 1fr 52px; gap: 14px; align-items: center; font: 700 13.5px/1.2 var(--mono); }
.pet-tally li span:first-child { overflow-wrap: anywhere; }
.pet-tally i { display: block; height: 16px; background: var(--red); width: var(--w); min-width: 3px; transition: width .6s ease; }
.pet-tally li em { font-style: normal; text-align: right; color: #6d675c; }
.pet-fine { margin: 26px 0 0; font-size: 14.5px; color: #6d675c; max-width: 70ch; }
.pet-fine a { color: var(--paper-ink); }

/* ---------- join the movement (inside the petition) ---------- */
.join { scroll-margin-top: 70px; margin-top: 34px; background: var(--bg); color: var(--ink); padding: clamp(22px, 4vw, 36px); border-left: 8px solid var(--yellow); }
.pet-doc .join h3 { margin: 0 0 8px; font: 800 clamp(30px, 4vw, 42px)/1 var(--display); text-transform: uppercase; color: var(--yellow); }
.pet-doc .join-lead { margin: 0 0 20px; max-width: 62ch; }
.join .signup { margin: 0; padding: 0; border: 0; }
.join .su-row { max-width: 820px; align-items: end; }
.signup .su-field { display: grid; margin: 0; gap: 8px; font: 700 13px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.su-name { flex: 1 1 180px; }
.su-mail { flex: 2 1 260px; }
.su-field input { width: 100%; }
.pet-doc .join .su-msg { color: var(--dim); }
.pet-doc .join .su-msg.ok { color: var(--green); }
.pet-doc .join .su-msg.err { color: var(--red); }
.pet-doc .join .su-fine { color: var(--dim); }
.fix-join { margin: 22px 0 0; }
.fix-join a { color: var(--yellow); }
.pet-doc.signed .pet-msg a + a { margin-left: 12px; }

/* ---------- the way out: PLCcode.ai ---------- */
.fix { scroll-margin-top: 70px; margin-top: 38px; background: var(--bg); color: var(--ink); padding: clamp(22px, 4vw, 36px); border-left: 8px solid var(--yellow); }
.sheet .fix h3 { margin: 0 0 10px; color: var(--yellow); }
.sheet .fix-lead { max-width: 62ch; margin-bottom: 22px; }
.fix-lead b { font-weight: 600; color: #fff; }
.btn.btn-go { background: var(--yellow); border-color: var(--yellow); color: #000; }
.btn.btn-go:hover { background: #fff; border-color: #fff; }
.btn.btn-go:disabled { opacity: .6; cursor: progress; }
.signup { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); position: relative; }
.signup label { display: block; font-weight: 600; margin-bottom: 12px; }
.su-row { display: flex; flex-wrap: wrap; gap: 10px; max-width: 640px; }
.su-row input {
  min-width: 0; min-height: 52px; padding: 0 16px; border: 2px solid var(--line); border-radius: 0;
  background: #0b0c0e; color: var(--ink); font: 600 18px/1 var(--mono); -webkit-appearance: none; appearance: none;
}
.su-row input::placeholder { color: #5d636b; }
.su-row input:focus { border-color: var(--yellow); outline: none; }
.su-row .btn { min-height: 52px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sheet .su-msg { min-height: 1.55em; margin-top: 12px; font: 600 15px/1.4 var(--mono); color: var(--dim); }
.su-msg.ok { color: var(--green); }
.su-msg.err { color: var(--red); }
.sheet .su-fine { margin-top: 4px; font-size: 14.5px; color: var(--dim); }
.age-list li.now { background: #221d08; box-shadow: inset 4px 0 0 var(--yellow); }
.age-list li.now a { color: var(--yellow); white-space: nowrap; }

/* ---------- share + foot ---------- */
.share { text-align: left; padding-bottom: 20px; }
.share h2 { border-bottom: 3px solid var(--ink); padding-bottom: 10px; }
.share p { color: var(--dim); margin: 16px 0 22px; }
.share-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; padding: 14px 22px; border: 2px solid var(--ink); background: transparent; color: var(--ink);
  text-decoration: none; cursor: pointer; font: 800 19px/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
}
.btn:hover { background: var(--yellow); border-color: var(--yellow); color: #000; }
.foot { max-width: 1200px; margin: 64px auto 0; padding: 26px clamp(16px, 4vw, 40px) 48px; border-top: 1px solid var(--line); color: #7d838b; font-size: 14.5px; }
.foot p { margin: 0 0 8px; max-width: 80ch; }
.foot a { color: var(--ink); }

/* ---------- the opening stage: a 3D cabinet (js/plc3d.js) behind the headline ---------- */
.stage {
  position: relative; height: calc(100svh - 49px); min-height: 600px; max-height: 1100px; overflow: hidden;
  background: radial-gradient(1100px 700px at 74% 46%, #1b1f25 0, #0b0c0e 72%);
}
#plc3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; opacity: 0; transition: opacity 1.4s ease; }
.has3d #plc3d { opacity: 1; }
.stage-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11,12,14,.93) 0%, rgba(11,12,14,.72) 28%, rgba(11,12,14,0) 52%),
    linear-gradient(0deg, var(--bg) 0%, rgba(18,20,23,0) 16%);
}
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stage-copy {
  position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; pointer-events: none;
  padding: clamp(56px, 13vh, 150px) clamp(16px, 4vw, 40px) 0;
}
.stage-copy a { pointer-events: auto; }
.stage h1 { font-size: clamp(84px, 12.6vw, 212px); padding-bottom: 0; }
.stage h1 > span { display: block; animation: rise 1s cubic-bezier(.16,.84,.2,1) both; }
.stage h1 > span:first-child { margin-bottom: .16em; }
.stage h1 > span + span { animation-delay: .14s; }
.stage h1 em::after { transform-origin: left; animation: draw .7s .75s cubic-bezier(.7,0,.2,1) both; }
.stage .eyebrow { animation: fade .8s .1s both; }
.stage .lede { max-width: 33ch; animation: fade .9s .45s both; }
.stage .cues { animation: fade .9s .65s both; }
@keyframes rise { from { transform: translateY(.42em); opacity: 0; clip-path: inset(0 0 100% 0); } to { transform: none; opacity: 1; clip-path: inset(0 0 -20% 0); } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* the label that points at the next button on the 3D station; js/plc3d.js moves it */
.stage-hint { position: absolute; left: 0; top: 0; z-index: 3; margin: 0; pointer-events: none; opacity: 0; transition: opacity .35s; }
.stage-hint.on { opacity: 1; }
.stage-hint::before {
  content: ""; position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--yellow); animation: ping 1.5s cubic-bezier(.2,.7,.1,1) infinite;
}
.stage-hint::after { content: ""; position: absolute; right: 18px; bottom: 18px; width: 40px; height: 2px; background: var(--yellow); transform-origin: right center; transform: rotate(40deg); }
.stage-hint b {
  position: absolute; right: 52px; bottom: 40px; white-space: nowrap; color: #000; background: var(--yellow);
  font: 800 22px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; padding: 9px 13px 8px;
}
@keyframes ping { from { transform: scale(.55); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

@media (max-aspect-ratio: 115/100) {
  /* text, then the cabinet (it dollies in as the page scrolls), then the links at the bottom of the stage */
  .stage { height: max(calc(100svh - 45px), 860px); min-height: 0; max-height: none; }
  .stage-copy { height: 100%; display: flex; flex-direction: column; padding-bottom: 26px; }
  .stage .cues { margin-top: auto; }
  .stage-hint b { right: 44px; bottom: -17px; }
  .stage-hint::after { right: 12px; bottom: 0; width: 28px; transform: none; }
  .stage-shade { background: linear-gradient(180deg, rgba(11,12,14,.94) 0%, rgba(11,12,14,.7) 36%, rgba(11,12,14,0) 58%), linear-gradient(0deg, var(--bg) 0%, rgba(18,20,23,0) 14%); }
  .stage-copy { padding-top: clamp(28px, 6vh, 64px); }
  .stage h1 { font-size: clamp(72px, 21vw, 150px); }
  .stage .lede { font-size: 18px; max-width: 30ch; }
}
.no3d #plc3d, .no3d .stage-hint { display: none; }
.no3d .stage { height: auto; min-height: 0; max-height: none; padding-bottom: clamp(48px, 7vw, 88px); }
.section-note { margin: 0; color: var(--dim); font: 600 14px/1.3 var(--mono); letter-spacing: .04em; }

/* ---------- motion on the way down: app.js marks [data-reveal] pending, then live as it scrolls in ---------- */
[data-reveal].pending { opacity: 0; transform: translateY(28px); }
[data-reveal].live { animation: reveal .8s cubic-bezier(.16,.84,.2,1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.section-head.live h2 { animation: wipe .9s .05s cubic-bezier(.7,0,.2,1) both; }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 -5% -10% 0); } }
.alarm-table[data-reveal].pending, .alarm-table[data-reveal].live { opacity: 1; transform: none; animation: none; }
.alarm-table.pending .alarm { opacity: 0; }
.alarm-table.live .alarm { animation: alarm-in .6s steps(1) both, alarm-slide .5s cubic-bezier(.16,.84,.2,1) both; animation-delay: calc(var(--i, 0) * 80ms + .15s); }
@keyframes alarm-in { 0% { opacity: 0; } 18% { opacity: 1; } 30% { opacity: .2; } 46% { opacity: 1; } 58% { opacity: .55; } 70%, 100% { opacity: 1; } }
@keyframes alarm-slide { from { transform: translateX(-22px); } to { transform: none; } }

/* the stamp that lands when someone signs */
.pet-stamp {
  position: absolute; right: clamp(14px, 4vw, 52px); top: clamp(26px, 4vw, 54px); margin: 0; pointer-events: none;
  font: 800 clamp(40px, 6vw, 74px)/1 var(--display); letter-spacing: .06em; color: #c3261f;
  border: 6px solid currentColor; padding: 6px 18px 2px; transform: rotate(-9deg); opacity: .82; mix-blend-mode: multiply;
}
.pet-stamp.slam { animation: slam .42s cubic-bezier(.3,1.4,.4,1) both; }
@keyframes slam { from { transform: rotate(-9deg) scale(2.8); opacity: 0; } 55% { opacity: .9; } to { transform: rotate(-9deg) scale(1); opacity: .82; } }

/* ---------- faulted page ---------- */
body.faulted .stage h1 em { color: var(--red); }
body.faulted .stage h1 em::after { background: repeating-linear-gradient(-45deg, var(--red) 0 16px, #111 16px 32px); }

/* ---------- motion ---------- */
@keyframes flow { to { stroke-dashoffset: -16; } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes flash { 50% { opacity: .25; } }
@keyframes chip { 50% { filter: brightness(.6); } }
@keyframes alarm-bg { 50% { filter: brightness(.82); } }
@keyframes glow { 50% { box-shadow: 0 5px 0 #0b3d1b, 0 0 26px rgba(61,220,106,.75); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes open { from { opacity: 0; transform: translateY(-4px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rung .wire.on { stroke-dasharray: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .alarm-cols { display: none; }
  .alarm-row { grid-template-columns: 62px auto minmax(0, 1fr) 24px; grid-template-areas: "pri time tag chev" "msg msg msg msg"; gap: 8px 12px; }
  .pri { grid-area: pri; } .time { grid-area: time; } .tag { grid-area: tag; } .msg { grid-area: msg; } .chev { grid-area: chev; }
  .alarm-body { padding: 4px 18px 22px 18px; }
}
@media (max-width: 820px) {
  .hero-panel { grid-template-columns: 1fr; }
  .controls { flex-direction: row; width: auto; justify-content: center; gap: 22px; }
  .estop { width: 156px; height: 156px; }
  .ctl-side { align-items: flex-start; }
  .ctl-hint { text-align: left; }
  .cols, .wants { grid-template-columns: 1fr; }
  .stamp { position: static; display: inline-block; margin-bottom: 18px; }
  .fault-inner { grid-template-columns: 1fr auto; }
  .fault-text { grid-column: 1 / -1; order: 3; }
  .fault-timer { order: 2; }
  .reset { order: 4; grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .hide-sm { display: none; }
  .brand { font-size: 19px; }
  .cell { padding: 6px 8px; font-size: 12px; }
  .alarm-stats > span:first-child { display: none; }
  #clock { display: none; }
  .pet-kicker { letter-spacing: .12em; }
  .rung text { font-size: 19px; }
  .rung .cmt { font-size: 17px; }
  .rung .rnum { font-size: 11px; }
  .rung-head { font-size: 11px; }
  .alarm-row { grid-template-columns: 62px minmax(0, 1fr) 24px; grid-template-areas: "pri time chev" "tag tag tag" "msg msg msg"; gap: 6px 12px; }
  .msg { font-size: 17px; }
  .rant { font-size: 18px; }
  .term-log { font-size: 13.5px; min-height: 380px; padding: 14px; }
  .fault-banner { top: 45px; }
  .fault-title { font-size: 22px; }
  .fix { margin-left: calc(-1 * clamp(28px, 5vw, 60px)); margin-right: calc(-1 * clamp(28px, 5vw, 60px)); }
  .fix > .btn, .su-row .btn { width: 100%; text-align: center; }
  .pet-doc { display: flex; flex-direction: column; }
  .pet-kicker { order: 1; } .pet-doc h2 { order: 2; } .pet-count { order: 3; margin-top: 20px; } .pet-form { order: 4; }
  .pet-msg { order: 5; } .pet-to { order: 6; } .pet-text { order: 7; } .pet-tally { order: 8; } .pet-fine { order: 9; }
  .join { order: 10; margin-left: calc(-1 * clamp(28px, 5vw, 60px)); margin-right: calc(-1 * clamp(28px, 5vw, 60px)); }
  .su-name, .su-mail { flex-basis: 100%; }
  .pet-form { grid-template-columns: 1fr; }
  .pet-form .btn-sign { width: 100%; }
  .pet-tally li { grid-template-columns: 1fr 44px; }
  .pet-tally li span:first-child { grid-column: 1 / -1; }
  .pet-text { font-size: 18px; }
}

@media (max-width: 820px) and (min-width: 641px) {
  .pet-form { grid-template-columns: 1fr 1fr; }
  .pet-form .btn-sign { grid-column: 1 / -1; }
}

/* The bar has room for LINE 3 and OPERATOR only on a wide screen; below that they give way to SIGN THE PETITION. */
@media (max-width: 980px) {
  .hmi-bar .cell.hide-sm { display: none; }
}
