:root {
  --bg: #07080a;
  --bg-raised: #0c0e12;
  --surface: #10131a;
  --surface-strong: #161b24;
  --line: rgba(196, 210, 230, 0.12);
  --line-strong: rgba(196, 210, 230, 0.26);
  --text: #eef2f7;
  --muted: #8793a3;
  --muted-dark: #556070;
  --steel: #6f8fad;
  --steel-soft: rgba(111, 143, 173, 0.14);
  --amber: #d4a84b;
  --amber-light: #f0d08a;
  --amber-soft: rgba(212, 168, 75, 0.14);
  --pressure: #e85d4c;
  --pressure-soft: rgba(232, 93, 76, 0.16);
  --relief: #5ec4a8;
  --relief-soft: rgba(94, 196, 168, 0.14);
  --brand-teal: #69c9c3;
  --mono: "IBM Plex Mono", "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --sans: "Instrument Sans", "PingFang SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.22, 0.82, 0.24, 1);
  --threshold: 71;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: var(--bg);
  background: var(--amber-light);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--amber-light);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  background:
    radial-gradient(circle at 12% 18%, rgba(111, 143, 173, 0.1), transparent 28rem),
    radial-gradient(circle at 88% 72%, rgba(232, 93, 76, 0.08), transparent 26rem),
    var(--bg);
}

.app-shell::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(160, 180, 210, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 180, 210, 0.035) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(180deg, black, transparent 85%);
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.18;
  transition: opacity 600ms ease, background 600ms ease;
}

.ambient-pressure {
  top: 8rem;
  left: -16rem;
  background: var(--steel);
}

.ambient-relief {
  right: -18rem;
  bottom: 4rem;
  background: var(--pressure);
}

body.is-building .ambient-pressure {
  opacity: 0.28;
  background: var(--amber);
}

body.is-relieved .ambient-relief {
  opacity: 0.32;
  background: var(--relief);
}

.grid-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 10, 0.72);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  width: fit-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line-strong);
  background: linear-gradient(145deg, #1a222c, #0d1117);
  color: var(--brand-teal);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-name span {
  color: var(--brand-teal);
}

.topbar-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-align: center;
}

.topbar-divider {
  opacity: 0.45;
}

.topbar-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--steel);
  box-shadow: 0 0 0 0 rgba(111, 143, 173, 0.4);
  transition: background 300ms ease;
}

body.is-building .status-dot {
  background: var(--amber);
}

body.is-relieved .status-dot {
  background: var(--relief);
  animation: pulse-dot 1.6s ease infinite;
}

.control-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.control-button[aria-pressed="true"] {
  border-color: var(--amber);
  color: var(--amber-light);
  background: var(--amber-soft);
}

.sound-icon {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 0.75rem;
}

.sound-icon i {
  display: block;
  width: 2px;
  background: currentColor;
}

.sound-icon i:nth-child(1) { height: 35%; }
.sound-icon i:nth-child(2) { height: 65%; }
.sound-icon i:nth-child(3) { height: 100%; }

.app-main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
}

.experience-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.eyebrow,
.simulation-stamp {
  margin: 0;
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.experience-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 2rem 2.5rem;
  align-items: start;
}

.terminal-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
}

.terminal-prefix {
  color: var(--steel);
}

.terminal-cursor {
  display: inline-block;
  width: 0.45rem;
  height: 1em;
  margin-left: 0.1rem;
  background: var(--amber);
  animation: blink 1s steps(1) infinite;
  vertical-align: text-bottom;
}

h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2.1rem, 4.2vw, 3.35rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h1 em {
  font-style: normal;
  color: var(--amber-light);
}

.lede {
  max-width: 34rem;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.scene-field {
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
}

.scene-legend {
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.scene-options {
  display: grid;
  gap: 0.55rem;
}

.scene-option {
  display: block;
  cursor: pointer;
}

.scene-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scene-option-body {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  background: rgba(16, 19, 26, 0.65);
  transition: border-color 200ms var(--ease-out), background 200ms ease, transform 200ms var(--ease-out);
}

.scene-option:hover .scene-option-body {
  border-color: var(--line-strong);
}

.scene-option input:checked + .scene-option-body {
  border-color: var(--amber);
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.scene-option.is-locked {
  opacity: 0.72;
  pointer-events: none;
}

.scene-code {
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.scene-title {
  font-size: 0.95rem;
  font-weight: 500;
}

.pressurize-hint {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.85rem;
  padding: 0.75rem 1.35rem;
  border: 1px solid var(--amber);
  background: linear-gradient(180deg, rgba(212, 168, 75, 0.28), rgba(212, 168, 75, 0.1));
  color: var(--amber-light);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 180ms var(--ease-out), background 180ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(212, 168, 75, 0.38), rgba(212, 168, 75, 0.14));
}

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

.text-button {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.text-button:hover {
  color: var(--text);
}

.gauge-stage {
  position: sticky;
  top: 1rem;
  padding: 1.25rem 1.25rem 1.4rem;
  border: 1px solid rgba(196, 210, 230, 0.16);
  background:
    radial-gradient(ellipse at 50% 18%, rgba(212, 168, 75, 0.08), transparent 55%),
    linear-gradient(165deg, rgba(24, 30, 40, 0.96), rgba(10, 12, 16, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 48px rgba(0, 0, 0, 0.28);
  transition: border-color 300ms ease, box-shadow 300ms ease;
}

.gauge-stage[data-band="releasing"] {
  border-color: rgba(94, 196, 168, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 36px rgba(94, 196, 168, 0.18),
    0 18px 48px rgba(0, 0, 0, 0.3);
}

.gauge-stage[data-band="relieved"] {
  border-color: rgba(94, 196, 168, 0.32);
}

.gauge-chrome {
  margin-bottom: 1.15rem;
}

.gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.gauge-head-label,
.gauge-head-state {
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.gauge-head-label {
  color: var(--muted);
}

.gauge-head-state {
  text-align: right;
}

.gauge-stage[data-band="releasing"] .gauge-head-state,
.gauge-stage[data-band="relieved"] .gauge-head-state {
  color: var(--relief);
}

.gauge-stage[data-band="holding"] .gauge-head-state {
  color: var(--pressure);
}

.gauge-ring {
  padding: 0;
}

.gauge-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: hidden;
}

.gauge-face {
  fill: url(#dialFace);
  stroke: rgba(196, 210, 230, 0.1);
  stroke-width: 1;
}

.gauge-track {
  stroke: rgba(196, 210, 230, 0.12);
  stroke-width: 13;
  stroke-linecap: round;
}

.gauge-fill {
  stroke: url(#arcGlow);
  stroke-width: 13;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  filter: drop-shadow(0 0 6px rgba(212, 168, 75, 0.25));
}

.tick-major {
  stroke: rgba(238, 242, 247, 0.42);
  stroke-width: 2;
}

.tick-minor {
  stroke: rgba(196, 210, 230, 0.2);
  stroke-width: 1.25;
}

.tick-label {
  fill: var(--muted-dark);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-anchor: middle;
}

.needle-group {
  transform-origin: 200px 190px;
  transform: rotate(-90deg);
  transition: transform 80ms linear;
}

.gauge-needle {
  fill: var(--text);
}

.gauge-hub-outer {
  fill: #121722;
  stroke: rgba(212, 168, 75, 0.55);
  stroke-width: 1.5;
}

.gauge-hub {
  fill: var(--amber-light);
}

.gauge-readout {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  width: fit-content;
  min-width: 8.5rem;
  margin: -0.1rem auto 0;
  padding: 0.7rem 1.2rem 0.65rem;
  border-top: 1px solid rgba(196, 210, 230, 0.16);
  border-bottom: 1px solid rgba(196, 210, 230, 0.16);
  background: rgba(8, 10, 14, 0.42);
}

.gauge-readout-label,
.gauge-readout-unit {
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}

.gauge-readout-value {
  font-family: var(--mono);
  font-size: 2.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--text);
  transition: color 220ms ease;
}

.gauge-stage[data-band="mid"] .gauge-readout-value {
  color: var(--amber-light);
}

.gauge-stage[data-band="high"] .gauge-readout-value {
  color: var(--pressure);
}

.gauge-stage[data-band="relieved"] .gauge-readout-value {
  color: var(--relief);
}

.gauge-stage[data-band="relieved"] .gauge-readout-unit {
  color: var(--relief);
}

.gauge-stage[data-band="holding"] .gauge-readout-value {
  color: var(--pressure);
  animation: peak-pulse 900ms ease-in-out infinite;
}

.gauge-stage[data-band="holding"] .gauge-readout-unit {
  color: var(--pressure);
}

.gauge-stage[data-band="releasing"] .gauge-readout-value,
.gauge-stage[data-band="releasing"] .gauge-readout-unit {
  color: var(--relief);
}

.gauge-stage[data-band="building"] .gauge-fill,
.gauge-stage[data-band="mid"] .gauge-fill {
  filter: drop-shadow(0 0 8px rgba(212, 168, 75, 0.35));
}

.gauge-stage[data-band="holding"] .gauge-fill {
  filter: drop-shadow(0 0 12px rgba(232, 93, 76, 0.55));
}

.gauge-stage[data-band="releasing"] .gauge-fill,
.gauge-stage[data-band="high"] .gauge-fill,
.gauge-stage[data-band="relieved"] .gauge-fill {
  filter: drop-shadow(0 0 10px rgba(232, 93, 76, 0.35));
}

.gauge-stage[data-band="releasing"] .gauge-fill {
  filter: drop-shadow(0 0 15px rgba(94, 196, 168, 0.58));
}

.valve-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.valve-row.is-focusing {
  align-items: center;
}

.valve-row.is-focusing .valve {
  transform: scale(0.76);
  opacity: 0.22;
  filter: saturate(0.45);
}

.valve-row.is-focusing .valve.is-releasing,
.valve-row.is-focusing .valve.is-open {
  z-index: 4;
  transform: scale(1.16);
  opacity: 1;
  filter: none;
}

.valve-row.is-focusing[data-focus="po"] .valve.is-releasing {
  animation: focus-po 3s ease-in-out both;
}

.valve-row.is-focusing[data-focus="inventory"] .valve.is-releasing {
  animation: focus-inventory 3s ease-in-out both;
}

.valve-row.is-focusing[data-focus="receivable"] .valve.is-releasing {
  animation: focus-receivable 3s ease-in-out both;
}

.valve-row.is-focusing .valve:not(.is-releasing):not(.is-open) {
  animation: focus-side 3s ease-out both;
}

.valve-row.is-focusing[data-focus="po"] .valve.is-open {
  transform: translateX(calc(100% + 0.65rem)) scale(1.16);
}

.valve-row.is-focusing[data-focus="inventory"] .valve.is-open {
  transform: scale(1.16);
}

.valve-row.is-focusing[data-focus="receivable"] .valve.is-open {
  transform: translateX(calc(-100% - 0.65rem)) scale(1.16);
}

.valve {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.45rem 0.75rem;
  border: 1px solid var(--line);
  background: rgba(8, 10, 14, 0.55);
  color: var(--muted);
  transition:
    border-color 280ms var(--ease-out),
    background 280ms ease,
    color 280ms ease,
    transform 280ms var(--ease-out),
    opacity 280ms ease;
}

.valve:disabled {
  cursor: default;
  opacity: 0.55;
}

.valve.is-target {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--text);
  opacity: 1;
}

.valve.is-target .valve-body {
  border-color: rgba(240, 208, 138, 0.72);
  animation: valve-target-pulse 1.35s ease-in-out infinite;
}

.valve.is-target .valve-handle {
  background: var(--amber-light);
}

.valve.is-open {
  border-color: var(--relief);
  background: var(--relief-soft);
  color: var(--text);
  transform: translateY(-2px);
  opacity: 1;
}

.valve.is-releasing {
  z-index: 2;
  border-color: var(--relief);
  background: var(--relief-soft);
  box-shadow: 0 0 24px rgba(94, 196, 168, 0.22);
}

.valve.is-releasing .valve-body {
  border-color: var(--relief);
  animation: valve-release-body 1.5s ease-out 1.5s both;
}

.valve.is-releasing::before {
  position: absolute;
  top: 4%;
  left: 50%;
  width: 0.34rem;
  height: 2.6rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(94, 196, 168, 0), rgba(94, 196, 168, 0.72));
  content: "";
  filter: blur(1px);
  transform: translateX(-50%);
  animation: relief-plume 1.5s ease-out 1.5s both;
}

.valve.is-releasing::after {
  position: absolute;
  top: 36%;
  left: 50%;
  width: 3.6rem;
  height: 3.6rem;
  border: 1px solid rgba(94, 196, 168, 0.65);
  border-radius: 50%;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.35);
  animation: relief-wave 1.5s ease-out 1.5s both;
}

.valve.is-standby {
  opacity: 0.42;
}

.valve.is-selected-note {
  border-color: var(--steel);
}

.valve-stem {
  width: 0.28rem;
  height: 0.7rem;
  background: rgba(196, 210, 230, 0.28);
}

.valve-body {
  position: relative;
  width: 2.4rem;
  height: 1.55rem;
  border: 1.5px solid rgba(196, 210, 230, 0.35);
  border-radius: 0.2rem 0.2rem 0.55rem 0.55rem;
  background: linear-gradient(180deg, #2a3340, #151a22);
}

.valve-body-gate {
  border-radius: 0.15rem;
}

.valve-body-return {
  border-radius: 0.85rem 0.85rem 0.35rem 0.35rem;
}

.valve-handle {
  position: absolute;
  top: -0.55rem;
  left: 50%;
  width: 1.35rem;
  height: 0.28rem;
  border-radius: 999px;
  background: var(--muted);
  transform: translateX(-50%) rotate(0deg);
  transform-origin: center;
  transition: transform 420ms var(--ease-out), background 280ms ease;
}

.valve.is-open .valve-handle {
  background: var(--relief);
  transform: translateX(-50%) rotate(90deg);
}

.valve-name {
  font-size: 0.92rem;
  font-weight: 600;
}

.valve-state {
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.valve.is-open .valve-state {
  color: var(--relief);
}

.valve-note {
  margin-top: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-left: 2px solid var(--steel);
  background: rgba(111, 143, 173, 0.08);
  animation: rise-in 320ms var(--ease-out);
}

.valve-note-title {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.valve-note-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 9, 0.72);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  width: min(100%, 26rem);
  padding: 1.75rem 1.5rem 1.45rem;
  border: 1px solid rgba(212, 168, 75, 0.35);
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 168, 75, 0.14), transparent 55%),
    linear-gradient(180deg, #171c26, #0d1016);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  text-align: center;
  animation: rise-in 360ms var(--ease-out);
}

.modal-kicker {
  margin: 0;
  color: var(--relief);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.modal-title {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 1.9rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--amber-light);
}

.modal-copy {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal-cta {
  width: 100%;
  margin-top: 0.25rem;
}

.modal-dismiss {
  margin-top: 0.35rem;
}

body.modal-open {
  overflow: hidden;
}

.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 2rem;
  color: var(--muted-dark);
  font-size: 0.78rem;
  line-height: 1.55;
}

.site-footer p {
  margin: 0;
  max-width: 48rem;
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94, 196, 168, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(94, 196, 168, 0); }
}

@keyframes valve-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 168, 75, 0); }
  50% { box-shadow: 0 0 14px 1px rgba(212, 168, 75, 0.28); }
}

@keyframes valve-target-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(212, 168, 75, 0);
  }
  50% {
    box-shadow: 0 0 18px 2px rgba(212, 168, 75, 0.3);
  }
}

@keyframes focus-side {
  0% {
    opacity: 1;
    filter: saturate(1);
    transform: scale(1);
  }
  35%,
  100% {
    opacity: 0.22;
    filter: saturate(0.45);
    transform: scale(0.76);
  }
}

@keyframes focus-po {
  0% {
    transform: translateX(0) scale(1);
  }
  35% {
    transform: translateX(0) scale(1.16);
  }
  100% {
    transform: translateX(calc(100% + 0.65rem)) scale(1.16);
  }
}

@keyframes focus-inventory {
  0% {
    transform: scale(1);
  }
  35%,
  100% {
    transform: scale(1.16);
  }
}

@keyframes focus-receivable {
  0% {
    transform: translateX(0) scale(1);
  }
  35% {
    transform: translateX(0) scale(1.16);
  }
  100% {
    transform: translateX(calc(-100% - 0.65rem)) scale(1.16);
  }
}

@keyframes valve-release-body {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(94, 196, 168, 0);
  }
  20% {
    transform: scale(1.12);
    box-shadow: 0 0 22px rgba(94, 196, 168, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(94, 196, 168, 0.18);
  }
}

@keyframes relief-plume {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scaleY(0.25);
  }
  22% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -1.15rem) scaleY(1);
  }
}

@keyframes relief-wave {
  0% {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(0.35);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.35);
  }
}

@keyframes peak-pulse {
  0%, 100% { text-shadow: 0 0 0 rgba(232, 93, 76, 0); }
  50% { text-shadow: 0 0 16px rgba(232, 93, 76, 0.6); }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand controls"
      "center center";
  }

  .brand { grid-area: brand; }
  .topbar-center { grid-area: center; justify-content: flex-start; }
  .topbar-right { grid-area: controls; }

  .experience-grid {
    grid-template-columns: 1fr;
  }

  .gauge-stage {
    position: static;
  }
}

@media (max-width: 560px) {
  .app-main {
    width: min(1120px, calc(100% - 1.25rem));
    padding-top: 1rem;
  }

  .topbar {
    padding: 0.85rem 0.85rem;
  }

  .topbar-center span:last-child {
    display: none;
  }

  .control-button span:last-child {
    display: none;
  }

  h1 {
    font-size: 1.9rem;
  }

  .valve-row {
    gap: 0.4rem;
  }

  .valve {
    padding: 0.7rem 0.25rem 0.6rem;
  }

  .valve-name {
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .terminal-cursor,
  .status-dot,
  .valve.is-target .valve-body {
    animation: none;
  }

  .gauge-fill,
  .needle-group,
  .valve-handle {
    transition: none;
  }
}
