/* Entirely fictional industrial excess. The host supplies the animation clock. */
.surge-section {
  position: relative;
  margin-top: 44px;
  border-block: 1px solid #829d6944;
  background: #14201b;
  overflow: hidden;
  isolation: isolate;
  --surge-energy: 0;
}
.surge-section:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 55%, #42673740, transparent 65%),
    repeating-linear-gradient(90deg, #b6d79b05 0 1px, transparent 1px 64px);
}
.surge-inner {
  padding-block: 44px 26px;
}
.surge-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  position: relative;
  z-index: 1;
}
.surge-title > .mono {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #a4ba91;
}
.surge-title h2 {
  font-size: clamp(54px, 7.5vw, 104px);
  line-height: 0.93;
  letter-spacing: -0.075em;
  margin-top: 23px;
  font-weight: 500;
}
.surge-title h2 em {
  font-family: Georgia, serif;
  font-weight: 400;
  color: var(--lime);
}
.surge-title > p {
  font-size: 12px;
  color: #acbaa7;
  max-width: 370px;
  line-height: 1.7;
  margin-top: 22px;
}
.surge-main-control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  text-align: right;
}
.surge-trigger {
  font-size: 15px;
  min-height: 68px;
  padding: 20px 30px;
  box-shadow:
    0 0 0 7px #dffb940b,
    0 0 0 8px #dffb9422;
  position: relative;
}
.surge-trigger:active {
  transform: translateY(3px);
}
.surge-main-control > .mono {
  font-size: 9px;
  line-height: 1.8;
  color: #a0b48e;
}
.surge-instruments {
  height: 400px;
  position: relative;
  margin-top: 8px;
}
#pressure-reactor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.reactor-caption {
  position: absolute;
  top: 20px;
  inset-inline: 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: #93aa82;
}
#reactor-certificate {
  border: 1px solid #dffb9466;
  padding: 7px 12px;
  transform: rotate(5deg);
  color: var(--lime);
}
.load-chart-wrap {
  position: absolute;
  height: 165px;
  inset-inline: 0;
  bottom: 0;
  opacity: 0.65;
}
#load-chart {
  height: 100%;
  width: 100%;
}
.chart-legend {
  position: absolute;
  right: 14px;
  bottom: 23px;
  display: flex;
  gap: 20px;
  font-size: 9px;
  color: #bfcdb2;
  z-index: 1;
}
.chart-legend span {
  display: flex;
  gap: 6px;
  align-items: center;
}
.chart-legend i {
  width: 12px;
  height: 2px;
  background: var(--lime);
}
.chart-legend span:nth-child(2) i {
  background: var(--pink);
}
.chart-legend span:nth-child(3) i {
  background: #90c7b5;
}
.surge-readout {
  position: absolute;
  top: 92px;
  left: 0;
  width: 180px;
  z-index: 2;
  background: linear-gradient(90deg, #14201bf5, #14201b00);
  padding: 8px 20px 8px 0;
}
.surge-readout > .mono {
  font-size: 9px;
  color: #9eb38d;
}
.surge-readout > strong {
  font:
    400 76px/1.2 "Space Grotesk",
    sans-serif;
  letter-spacing: -0.07em;
  display: block;
  color: var(--lime);
}
.surge-readout > strong small {
  font:
    11px "DM Sans",
    sans-serif;
  letter-spacing: 0;
  margin-left: 6px;
  color: #abc29b;
}
.surge-readout dl {
  display: grid;
  gap: 13px;
  margin: 15px 0 0;
}
.surge-readout dl > div {
  display: grid;
  gap: 5px;
}
.surge-readout dt {
  font-size: 9px;
  color: #829d76;
}
.surge-readout dd {
  font-size: 10px;
  color: #d0e0c3;
  margin: 0;
}
.surge-bottom {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 19px;
  position: relative;
  z-index: 2;
}
.surge-state {
  color: var(--lime);
  font-size: 10px;
  line-height: 1.5;
}
.surge-bottom > .mono {
  font-size: 8px;
  color: #9bb18b;
  max-width: 310px;
  line-height: 1.7;
  text-align: right;
}
.surge-section[data-active="true"] {
  border-color: #dffb9488;
}
.surge-section[data-active="true"] .surge-trigger {
  background: var(--pink);
}
/* A screen-sized stage; controls always sit above it and stay still. */
.surge-fx {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}
.surge-fx canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}
.surge-wash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 85%, #172b1a, #09140b 75%);
}
.surge-theatre {
  position: absolute;
  inset: 0;
  z-index: 3;
  color: #edf2df;
}
.theatre-header {
  position: absolute;
  inset: 24px 30px auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: #b6c49f;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.theatre-copy {
  position: absolute;
  left: 6%;
  top: 12%;
  max-width: 88%;
}
.theatre-copy > .mono {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #aebf95;
  display: block;
  margin-bottom: 18px;
}
.theatre-copy > strong {
  display: block;
  font:
    500 clamp(55px, 9vw, 140px) / 0.85 "Space Grotesk",
    sans-serif;
  letter-spacing: -0.075em;
  text-shadow: 0 4px 35px #0b170e;
}
.theatre-copy > strong em {
  font-family: Georgia, serif;
  font-weight: 400;
  color: var(--lime);
}
.theatre-copy > p {
  font-size: 13px;
  line-height: 1.7;
  margin-top: 20px;
  color: #c7d5bb;
  max-width: 340px;
}
.theatre-reading {
  position: absolute;
  right: 6%;
  top: 14%;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.theatre-reading > .mono {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: #c2d1ac;
  max-width: 180px;
  line-height: 1.7;
}
.theatre-reading > strong {
  font:
    400 clamp(65px, 10vw, 140px) / 1 "Space Grotesk",
    sans-serif;
  letter-spacing: -0.085em;
  color: #dffb94;
  text-shadow: 0 2px 25px #0b170e;
}
.theatre-notice {
  position: absolute;
  left: 6%;
  bottom: 185px;
  font-size: 10px;
  color: #c4d2b2;
  max-width: 180px;
  line-height: 1.8;
}
body[data-surge="priming"] .surge-wash,
body[data-surge="rising"] .surge-wash,
body[data-surge="loaded"] .surge-wash,
body[data-surge="peak"] .surge-wash,
body[data-surge="aftercare"] .surge-wash,
body[data-surge="aftermath"] .surge-wash {
  opacity: 1;
}
body[data-surge="peak"] .theatre-copy > strong em,
body[data-surge="peak"] .theatre-reading > strong {
  color: var(--pink);
}
body[data-surge="peak"] .theatre-copy > strong {
  transform: rotate(-2deg);
}
body[data-surge="peak"] .status-dot {
  box-shadow: 0 0 15px #f1b7cf;
}
/* Progressive, low-amplitude page recoil; no flashing or camera shake. */
body[data-surge="loaded"] .telemetry {
  transform: scale(0.985);
  transition: transform 0.8s;
}
body[data-surge="peak"] .telemetry {
  transform: scale(1.018);
  transition: transform 0.45s;
}
.surge-pilot {
  position: fixed;
  z-index: 25;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1000px, calc(100% - 36px));
  border: 1px solid #dffb9488;
  background: #122119fa;
  box-shadow:
    0 12px 70px #0009,
    0 0 70px #dffb9410;
  border-radius: 12px;
  color: #e9f1de;
  overflow: hidden;
}
.surge-pilot-main {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 22px;
}
.surge-pilot-title {
  flex: 1;
  min-width: 0;
}
.surge-pilot-title > .mono {
  display: block;
  font-size: 8px;
  color: #a6b997;
  line-height: 1.5;
  margin-bottom: 6px;
}
.surge-pilot-title strong {
  font:
    500 19px/1.2 "Space Grotesk",
    sans-serif;
  letter-spacing: -0.03em;
  color: var(--lime);
  display: block;
}
.surge-pilot-rate {
  font:
    400 35px/1 "Space Grotesk",
    sans-serif;
  letter-spacing: -0.06em;
  white-space: nowrap;
}
.surge-pilot-rate small {
  font:
    10px "DM Sans",
    sans-serif;
  letter-spacing: 0;
  color: #abbd9c;
  margin-left: 5px;
}
.surge-pilot-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.surge-pilot-controls button {
  font-size: 10px;
  min-height: 44px;
  padding: 11px 13px;
  white-space: nowrap;
  color: #e0ecd3;
  border-color: #91ae7655;
}
.surge-pilot-controls .surge-boost {
  background: var(--lime);
  color: #172315;
  border-color: var(--lime);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-radius: 7px;
  min-width: 120px;
}
.surge-boost span {
  font: 9px monospace;
  opacity: 0.65;
}
.surge-boost:active {
  transform: scale(0.95);
}
.surge-pilot-controls button:disabled {
  opacity: 0.5;
  cursor: default;
}
.surge-pilot-track {
  height: 4px;
  background: #94ae7122;
}
.surge-pilot-track > span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--pink);
}
.surge-aftermath {
  position: fixed;
  z-index: 24;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(700px, calc(100% - 32px));
  background: #17251bfa;
  border: 1px solid #a6be8066;
  border-radius: 12px;
  box-shadow: 0 10px 60px #0006;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px 25px;
  color: #e6efdb;
}
.surge-aftermath .mono {
  font-size: 8px;
  color: #a3b98d;
  letter-spacing: 0.07em;
}
.surge-aftermath strong {
  font:
    500 30px/1.2 "Space Grotesk",
    sans-serif;
  letter-spacing: -0.055em;
  display: block;
  margin: 7px 0;
}
.surge-aftermath p {
  font-size: 11px;
  color: #b7c7a8;
  line-height: 1.6;
}
.surge-aftermath button {
  margin-left: auto;
  min-height: 46px;
  color: var(--lime);
  font-size: 11px;
  white-space: nowrap;
}
.aftermath-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: auto;
}
.aftermath-controls button {
  width: 100%;
  margin-left: 0;
}
.aftermath-controls button[aria-disabled="true"] {
  opacity: 0.7;
  cursor: wait;
}
.cleanup-wipe {
  position: fixed;
  inset: 0;
  z-index: 26;
  pointer-events: none;
  overflow: hidden;
}
.cleanup-towel {
  position: absolute;
  top: -40px;
  left: 0;
  transform: translate3d(-100%, 0, 0);
  will-change: transform;
  z-index: 26;
  width: clamp(240px, 46vw, 650px);
  height: calc(100% + 80px);
  pointer-events: none;
  overflow: hidden;
  color: #243e35;
  border: 12px solid #c4d7b1;
  border-radius: 20px;
  background: repeating-linear-gradient(0deg, #dfebce 0 2px, #d5e3c3 2px 4px);
  box-shadow:
    inset 10px 0 26px #fff8,
    inset -15px 0 20px #5a775633,
    14px 0 45px #0008;
}
.cleanup-towel:before,
.cleanup-towel:after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  background: repeating-linear-gradient(
    0deg,
    #a6bc93 0 3px,
    transparent 3px 6px
  );
}
.cleanup-towel:before {
  left: 6px;
}
.cleanup-towel:after {
  right: 6px;
}
.towel-stripe {
  position: absolute;
  inset: 0 12%;
  border-inline: 12px double #809c76;
}
.towel-label {
  position: absolute;
  top: 40%;
  left: 18%;
  right: 18%;
  text-align: center;
  transform: rotate(-5deg);
}
.towel-label > span {
  font: 11px monospace;
  letter-spacing: 0.22em;
}
.towel-label strong {
  display: block;
  font:
    700 clamp(28px, 4vw, 62px) / 0.95 "Space Grotesk",
    sans-serif;
  letter-spacing: -0.06em;
  margin: 18px 0;
}
.towel-label small {
  font: 9px/1.8 monospace;
  letter-spacing: 0.03em;
}
.towel-tag {
  position: absolute;
  bottom: 13%;
  right: 0;
  writing-mode: vertical-rl;
  background: #f7f5e6;
  padding: 12px 8px;
  font-size: 8px;
  box-shadow: 0 2px 6px #0002;
}
body[data-pumping="true"] .toast {
  bottom: 150px;
}
body.surge-still .surge-wash {
  transition: none;
}
body.surge-still .site-shell,
body.surge-still .telemetry,
body.surge-still .theatre-copy > strong {
  transform: none;
  transition: none;
  filter: none;
}
@media (min-width: 1400px) {
  .theatre-copy {
    top: 14%;
  }
  .theatre-reading {
    right: 10%;
    top: 16%;
  }
}
@media (max-width: 850px) {
  .surge-instruments {
    height: 370px;
  }
  .surge-readout {
    top: 95px;
    width: 170px;
  }
  .surge-readout > strong {
    font-size: 60px;
  }
  .surge-pilot-main {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 15px 18px;
  }
  .surge-pilot-controls {
    grid-column: 1/-1;
    justify-content: space-between;
  }
  .surge-pilot-controls .surge-boost {
    flex: 1;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }
  .theatre-notice {
    bottom: 205px;
  }
}
@media (max-width: 600px) {
  .surge-inner {
    padding-block: 34px 24px;
  }
  .surge-heading {
    display: block;
  }
  .surge-title h2 {
    font-size: clamp(52px, 12vw, 74px);
    margin-top: 20px;
  }
  .surge-title > .mono {
    font-size: 8px;
    line-height: 1.7;
  }
  .surge-title > p {
    font-size: 12px;
    max-width: 310px;
  }
  .surge-main-control {
    margin-top: 28px;
    align-items: flex-start;
    text-align: left;
    flex-direction: row;
    gap: 20px;
    align-items: center;
  }
  .surge-trigger {
    font-size: 12px;
    min-height: 56px;
    padding: 15px 22px;
    flex-shrink: 0;
  }
  .surge-main-control > .mono {
    font-size: 8px;
  }
  .surge-instruments {
    height: 390px;
    margin-top: 20px;
  }
  .reactor-caption {
    font-size: 8px;
    top: 10px;
    gap: 14px;
  }
  #reactor-certificate {
    font-size: 7px;
    max-width: 130px;
    align-self: start;
  }
  .surge-readout {
    top: 60px;
    width: auto;
  }
  .surge-readout > strong {
    font-size: 49px;
  }
  .surge-readout > .mono {
    font-size: 8px;
  }
  .surge-readout dl {
    display: none;
  }
  #pressure-reactor {
    top: 30px;
    height: 340px;
  }
  .load-chart-wrap {
    height: 135px;
    bottom: 0;
  }
  .chart-legend {
    font-size: 8px;
    gap: 12px;
    left: 33px;
  }
  .surge-bottom {
    display: block;
  }
  .surge-state {
    font-size: 9px;
  }
  .surge-bottom > .mono {
    font-size: 8px;
    text-align: left;
    display: block;
    margin-top: 10px;
  }
  .theatre-header {
    inset: 20px 18px auto;
    font-size: 8px;
    line-height: 1.8;
  }
  .theatre-header > span:first-child {
    max-width: 190px;
  }
  .theatre-copy {
    top: 13%;
    left: 6%;
    max-width: 90%;
  }
  .theatre-copy > .mono {
    font-size: 8px;
    letter-spacing: 0.07em;
    max-width: 260px;
    margin-bottom: 14px;
  }
  .theatre-copy > strong {
    font-size: clamp(52px, 12.5vw, 77px);
    line-height: 0.91;
  }
  .theatre-copy > p {
    font-size: 11px;
    max-width: 250px;
    margin-top: 15px;
  }
  .theatre-reading {
    top: 6%;
    right: 6%;
  }
  .theatre-reading > .mono {
    font-size: 7px;
    max-width: 130px;
  }
  .theatre-reading > strong {
    font-size: 54px;
  }
  .theatre-notice {
    display: none;
  }
  .surge-pilot {
    bottom: 12px;
    width: calc(100% - 24px);
  }
  .surge-pilot-main {
    padding: 13px 14px;
    gap: 12px;
  }
  .surge-pilot-title > .mono {
    font-size: 7px;
  }
  .surge-pilot-title strong {
    font-size: 15px;
  }
  .surge-pilot-rate {
    font-size: 28px;
  }
  .surge-pilot-rate small {
    font-size: 8px;
  }
  .surge-pilot-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
  .surge-pilot-controls .surge-boost {
    flex: 1 1 100%;
    font-size: 12px;
    min-height: 44px;
  }
  .surge-pilot-controls button {
    font-size: 9px;
    min-height: 38px;
    padding: 9px 12px;
    flex: 1;
  }
  .surge-aftermath {
    padding: 14px 18px;
    display: block;
    bottom: 12px;
  }
  .surge-aftermath strong {
    font-size: 23px;
    margin: 4px 0;
  }
  .surge-aftermath p {
    margin: 4px 0;
  }
  .aftermath-controls {
    flex-direction: row;
    margin-top: 12px;
  }
  .aftermath-controls button {
    flex: 1;
    margin: 0;
    min-height: 38px;
  }
  body[data-pumping="true"] .toast {
    bottom: 230px;
  }
}
@media (max-height: 650px) and (min-width: 601px) {
  .theatre-copy {
    top: 12%;
  }
  .theatre-copy > strong {
    font-size: 65px;
  }
  .theatre-copy > p {
    font-size: 11px;
    margin-top: 12px;
  }
  .theatre-reading {
    top: 16%;
  }
  .theatre-reading > strong {
    font-size: 75px;
  }
  .theatre-notice {
    bottom: 140px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .surge-wash,
  .telemetry {
    transition: none !important;
  }
  .site-shell,
  .telemetry,
  .theatre-copy > strong {
    transform: none !important;
  }
}
.surge-still:before {
  transition: none;
}
body.motion-paused .surge-wash {
  transition: none;
}

/* The hardware, readings and chart occupy separate tracks. */
.surge-instruments {
  display:grid;
  grid-template-columns:190px minmax(0,1fr);
  grid-template-rows:48px 360px 110px;
  column-gap:28px;
  height:auto;
}
.reactor-caption { position:relative; inset:auto; grid-column:1 / -1; grid-row:1; align-items:center; }
#pressure-reactor { position:relative; inset:auto; grid-column:2; grid-row:2; height:360px; width:100%; }
.surge-readout { position:relative; inset:auto; grid-column:1; grid-row:2; align-self:center; width:auto; }
.load-chart-wrap { position:relative; inset:auto; grid-column:1 / -1; grid-row:3; height:110px; border-top:1px solid #dffb9420; }
@media(max-width:650px) {
  .surge-instruments { grid-template-columns:1fr; grid-template-rows:48px 100px 310px 100px; gap:0; }
  .reactor-caption { grid-column:1; }
  .surge-readout { grid-column:1; grid-row:2; }
  #pressure-reactor { grid-column:1; grid-row:3; height:310px; }
  .load-chart-wrap { grid-column:1; grid-row:4; height:100px; }
}
