/* v1 - The Engine Room */

.svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

body {
  --cog-column-width: 220px;
  --cog-gauge-gap: 24px; /* extra inset so gear teeth do not overlap gauges */
  --gauge-face-size: 220px;
  --gauge-card-padding: 16px;
  --gauge-card-width: calc(var(--gauge-face-size) + 2 * var(--gauge-card-padding));
  background:
    radial-gradient(ellipse at 30% 20%, #2a2620 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, #221a14 0%, transparent 55%),
    var(--bg-grey);
  /* position:relative makes body the containing block for .pipe-layer so it
     can size to the full 250vh document instead of just the viewport. */
  position: relative;
  min-height: 250vh;
  overflow-x: hidden;
}

.page-main {
  padding: 0;
}

/* --- Cog columns (viewport-pinned side framing) ------------------------ */
.cog-column {
  position: fixed;
  top: 0;
  width: var(--cog-column-width);
  height: 100vh;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}
.cog-column-left { left: 0; }
.cog-column-right { right: 0; }
.cog-column svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  /* No drop-shadow — it created dark tick-like fringes at gear teeth. */
}

/* --- Gauges hub (centered between cog columns) ------------------------- */
.gauges-hub {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 100px calc(var(--cog-column-width) + var(--cog-gauge-gap)) 80px;
  overflow: visible;
}

/* Page-spanning pipe layer — sits above the cog columns but below the gauges hub
   so the vertical drop pipes can stretch from the manifold all the way to the
   bottom of the 250vh body. */
.pipe-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

.gauge-pipe-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.gauges {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 40px 48px;
  width: 100%;
  max-width: 100%;
}

.gauge {
  position: relative;
  flex: 0 0 var(--gauge-card-width);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-primary);
  padding: var(--gauge-card-padding);
  transition: transform 0.3s ease;
}
.gauge:hover { transform: translateY(-6px); }

.gauge-face {
  position: relative;
  width: var(--gauge-face-size);
  height: var(--gauge-face-size);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #1a1612 0%, #0d0a07 70%),
    radial-gradient(circle at 30% 30%, #2a2218 0%, transparent 50%);
  box-shadow:
    inset 0 0 0 8px var(--brass),
    inset 0 0 0 12px var(--brass-dark),
    inset 0 0 0 14px var(--brass-light),
    inset 0 6px 18px rgba(0, 0, 0, 0.9),
    0 8px 24px rgba(0, 0, 0, 0.8),
    0 0 0 2px #2a1f10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-face svg {
  position: absolute;
  inset: 14px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
}

.gauge-needle {
  transform-box: view-box;
  transform-origin: 100px 100px;
}

.gauge-rim-glow {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  box-shadow:
    inset 0 0 8px 1px rgba(255, 122, 24, 0.25),
    inset 0 0 18px 4px rgba(255, 181, 107, 0.12),
    inset 0 0 28px 8px rgba(255, 122, 24, 0.06);
  z-index: 1;
}

.gauge.is-hovered .gauge-rim-glow {
  opacity: 1;
}

.gauge-glyph {
  position: absolute;
  top: calc(74% - 1lh);
  left: 50%;
  transform: translateX(-50%);
  max-width: 58%;
  font-family: var(--font-display);
  font-size: clamp(0.65rem, 2.8vw, 0.95rem);
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-align: center;
  color: var(--gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

/* --- Smokestacks ------------------------------------------------------- */
.smokestacks {
  position: fixed;
  bottom: 0;
  right: 0;
  width: max(32vw, calc(var(--stack-a-inset) + 2 * var(--stack-width) + var(--stack-gap)));
  min-width: calc(var(--stack-a-inset) + 2 * var(--stack-width) + var(--stack-gap));
  height: 32vh;
  z-index: 10;
  pointer-events: none;
  --stack-width: 110px;
  --stack-gap: 40px; /* edge-to-edge space between pipes; tweak here */
  --stack-a-inset: 48px; /* distance from viewport right to stack A; tweak here */
}
.stack {
  position: absolute;
  bottom: 0;
  width: var(--stack-width);
}
.stack-a { right: var(--stack-a-inset); height: 32vh; }
.stack-b {
  right: calc(var(--stack-a-inset) + var(--stack-width) + var(--stack-gap));
  height: 24vh;
}

.pipe-shaft {
  position: absolute;
  bottom: -40px;
  left: 0;
  right: 0;
  top: 40px;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 56px,
      rgba(0, 0, 0, 0.45) 56px,
      rgba(0, 0, 0, 0.45) 58px,
      transparent 58px,
      transparent 60px
    ),
    linear-gradient(90deg, #2a1f10, var(--brass), #1a120a);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.55),
    0 -4px 18px rgba(0, 0, 0, 0.7);
}
.pipe-shaft::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    108deg,
    transparent 38%,
    rgba(255, 230, 180, var(--pipe-sheen, 0.15)) 48%,
    rgba(255, 245, 220, calc(var(--pipe-sheen, 0.15) * 1.2)) 50%,
    rgba(255, 230, 180, var(--pipe-sheen, 0.15)) 52%,
    transparent 62%
  );
  pointer-events: none;
}
.pipe-shaft--patina::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(58, 104, 88, 0.45) 0%, transparent 45%),
    radial-gradient(ellipse at 70% 65%, rgba(42, 88, 80, 0.35) 0%, transparent 40%),
    repeating-linear-gradient(175deg, transparent 0, transparent 18px, rgba(30, 60, 50, 0.12) 18px, rgba(30, 60, 50, 0.12) 20px);
  pointer-events: none;
  mix-blend-mode: multiply;
}
.pipe-shaft--rust::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(182deg, transparent 10%, rgba(139, 69, 19, 0.35) 35%, transparent 55%),
    linear-gradient(178deg, transparent 45%, rgba(107, 56, 40, 0.3) 60%, transparent 80%);
  pointer-events: none;
}
.pipe-shaft--soot::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0, 0, 0, 0.55) 0%, transparent 55%),
    linear-gradient(180deg, rgba(10, 8, 5, 0.4) 0%, transparent 40%);
  pointer-events: none;
}

.pipe-patina-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 30%, rgba(58, 120, 100, 0.5) 0%, transparent 35%),
    radial-gradient(circle at 75% 55%, rgba(45, 90, 80, 0.4) 0%, transparent 30%);
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.pipe-rust-streak {
  position: absolute;
  bottom: 5%;
  width: 28%;
  background: linear-gradient(180deg, transparent, rgba(139, 69, 19, 0.55) 30%, rgba(90, 40, 20, 0.4) 100%);
  border-radius: 2px;
  pointer-events: none;
}

.pipe-soot--heavy {
  height: 45px;
  background: radial-gradient(ellipse at 50% 100%, rgba(5, 4, 3, 0.9) 0%, rgba(15, 12, 10, 0.5) 50%, transparent 75%);
}

.stack-details {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.pipe-flange {
  position: absolute;
  background: linear-gradient(180deg, var(--brass-light), var(--brass-dark));
  border-radius: 4px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 220, 160, 0.25);
}
.flange-riveted::before,
.flange-riveted::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2px;
  border-radius: 50%;
  background: #1a120a;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.8);
}
.flange-riveted::before { left: 12%; }
.flange-riveted::after { right: 12%; }

.rivet-row {
  position: absolute;
  left: 4px;
  right: 4px;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
}
.rivet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8a7858, #1a120a);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.stack[data-pipe-texture="soot-blackened"] .rivet,
.stack[data-pipe-texture="weathered-iron"] .rivet {
  background: radial-gradient(circle at 35% 30%, #4a4440, #0a0805);
}
.stack[data-pipe-texture="verdigris-patina"] .rivet {
  background: radial-gradient(circle at 35% 30%, #4a7868, #1a2820);
}
.stack[data-pipe-texture="mirror-copper-pipe"] .rivet,
.stack[data-pipe-texture="polished-brass"] .rivet {
  background: radial-gradient(circle at 35% 30%, #c9a070, #2a2010);
}

.pipe-ladder {
  position: absolute;
  right: -6px;
  top: 15%;
  bottom: 20%;
  width: 10px;
  border-left: 2px solid var(--brass-dark);
  border-right: 2px solid #3a2a14;
}
.ladder-rung {
  position: absolute;
  left: -4px;
  right: -4px;
  height: 2px;
  background: var(--brass);
  opacity: 0.85;
}

.pipe-valve {
  position: absolute;
  width: 28px;
  height: 28px;
}
.valve-wheel {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--copper);
  background:
    repeating-conic-gradient(from 0deg, var(--brass) 0 12deg, #3a2a14 12deg 24deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
.valve-stem {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 14px;
  margin-left: -2px;
  background: var(--brass-dark);
}

.pipe-mini-gauge {
  position: absolute;
  width: 22px;
  height: 22px;
}
.mini-gauge-face {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #1a1612;
  border: 2px solid var(--brass);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9);
}
.mini-gauge-needle {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 2px;
  height: 40%;
  margin-left: -1px;
  background: #ff7a18;
  transform-origin: bottom center;
  transform: rotate(35deg);
}

.pipe-plaque {
  position: absolute;
  left: -4px;
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: #1a120a;
  border: 1px solid var(--brass-dark);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.pipe-rust {
  position: absolute;
  width: 35%;
  background: linear-gradient(180deg, transparent, #5a3020 40%, #3a2010 100%);
  border-radius: 2px;
  pointer-events: none;
}

.condenser-bundle {
  position: absolute;
  left: -20px;
  width: 50px;
  height: 40px;
}
.condenser-pipe {
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 100%;
  background: linear-gradient(90deg, #3a2a14, var(--copper), #3a2a14);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.pipe-soot {
  position: absolute;
  top: 12px;
  left: 10%;
  right: 10%;
  height: 30px;
  background: radial-gradient(ellipse at 50% 100%, rgba(20, 15, 10, 0.7) 0%, transparent 70%);
  pointer-events: none;
}

.pipe-cap {
  position: absolute;
  top: 0;
  left: -16px;
  right: -16px;
  height: 56px;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.6) 0%, transparent 60%),
    linear-gradient(90deg, #2a1f10, var(--brass-light), var(--brass), #1a120a);
  border-top-left-radius: 80px 30px;
  border-top-right-radius: 80px 30px;
  box-shadow:
    inset 0 -6px 14px rgba(0, 0, 0, 0.7),
    0 -2px 10px rgba(0, 0, 0, 0.7);
}
.pipe-cap::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 78%;
  height: 22px;
  background:
    radial-gradient(ellipse at 50% 30%, #000 0%, #0a0805 70%, #1a120a 100%);
  border-radius: 50%;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.95);
}
/* Center of the dark pipe mouth (aligned with .pipe-cap::before opening) */
.pipe-cap .puff-origin {
  position: absolute;
  top: 17px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
}

/* --- WebGL fluid steam (full viewport — not clipped to pipe box) ------- */
.steam-fluid-layer {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
}
.steam-fluid {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.76;
}

.page-footer {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 24px 0 100px;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
}

/* --- Coming-soon status plaque (gauge click, no URL) ------------------- */
.coming-soon-banner {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 28px 16px;
  min-width: 280px;
  max-width: calc(100vw - 48px);
  text-align: center;
  color: var(--text-primary);
  background:
    radial-gradient(ellipse at 50% 0%, #2a2218 0%, transparent 55%),
    #1a120a;
  border: 1px solid var(--brass-dark);
  border-radius: var(--plaque-radius);
  box-shadow: var(--shadow-deep), var(--shadow-brass);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}
.coming-soon-banner.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  box-shadow: var(--shadow-deep), var(--shadow-brass), 0 0 20px rgba(255, 122, 24, 0.12);
}
.coming-soon-banner[hidden] {
  display: none;
}
.coming-soon-banner__label {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
}
.coming-soon-banner__message {
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}
.coming-soon-banner::after {
  content: "";
  display: block;
  width: 70%;
  height: 2px;
  margin-top: 8px;
  background: linear-gradient(90deg, transparent, var(--brass), var(--gold), var(--brass), transparent);
}

@media (prefers-reduced-motion: reduce) {
  .coming-soon-banner {
    transform: translate(-50%, 0);
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
  }
  .coming-soon-banner.is-visible {
    transform: translate(-50%, 0);
  }
}

@media (max-width: 900px) {
  body {
    --cog-column-width: 180px;
  }
}

@media (max-width: 720px) {
  body {
    --cog-column-width: 140px;
    --gauge-face-size: min(
      220px,
      calc(100vw - 2 * (var(--cog-column-width) + var(--cog-gauge-gap)) - 8px)
    );
  }
  .cog-column {
    opacity: 0.55;
  }
  .gauges-hub {
    padding-top: 88px;
  }
}
