:root {
  --concrete: #d9dde3;
  --ink: #14171c;
  --copper: #b87333;
  --copper-dark: #8a5524;
  --copper-hi: #d4a574;
  --soap: #3db8b0;
  --sheen: #c45a8c;
  --seal: #1f7a6b;
  --fail: #e85d04;
  --brass: #c49a5c;
  --brass-dark: #8a6a32;
}

@font-face {
  font-family: Sora;
  src: url("fonts/sora.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("fonts/work-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Code Pro";
  src: url("fonts/source-code-pro.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
html, body { margin: 0; padding: 0; }
body {
  font-family: "Work Sans", system-ui, sans-serif;
  background: var(--concrete);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--copper-dark); }
a:hover, a:focus-visible { color: var(--fail); }
code, .cmd code, .term code, .or code, .fit-body code, .t-sum code {
  font-family: "Source Code Pro", ui-monospace, monospace;
}
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--concrete); padding: .5rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* —— shop bar (no glass) —— */
.shop-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1.25rem;
  background: var(--concrete);
  border-bottom: 3px solid var(--copper);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  font-family: Sora, sans-serif; font-weight: 800;
  text-decoration: none; color: var(--ink); letter-spacing: .03em;
}
.shop-bar nav a {
  margin-left: 1.1rem; text-decoration: none; font-weight: 600; font-size: .92rem;
  color: var(--ink);
}
.shop-bar nav a:hover { color: var(--copper-dark); }

/* —— HERO: manifold fills first viewport; no marketing stack below —— */
.hero {
  position: relative;
  /* Manifold IS the first viewport — no empty concrete stack below */
  width: 100%;
  height: calc(100vh - 52px);
  height: calc(100dvh - 52px);
  max-height: 920px;
  min-height: 520px;
  display: flex; flex-direction: column;
  background: var(--concrete);
  overflow: hidden;
}
.shop-wall {
  position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 47px,
      color-mix(in srgb, var(--ink) 4%, transparent) 47px,
      color-mix(in srgb, var(--ink) 4%, transparent) 48px
    );
  opacity: .35;
}
.manifold {
  position: relative; z-index: 1;
  width: 100%;
  flex: 1 1 auto;
  height: 100%;
  min-height: 100%;
  display: block;
}
.manifold-desk {
  width: 100%;
  height: 100%;
  flex: 1;
}
.manifold-desk { display: block; }
.manifold-mob { display: none; }

.plate-h1 {
  font-family: Sora, sans-serif; font-weight: 800; font-size: 20px;
  fill: var(--ink); letter-spacing: .06em;
}
.plate-sub {
  font-family: "Work Sans", sans-serif; font-size: 10px; font-weight: 600;
  fill: var(--copper-dark); letter-spacing: .16em;
}
.m-plate { font-size: 16px; }
.m-plate-sub { font-size: 9px; letter-spacing: .1em; }
.j-badge {
  font-family: Sora, sans-serif; font-size: 9px; font-weight: 800;
  fill: #d9dde3; letter-spacing: .04em;
}
.gauge-lbl {
  font-family: "Source Code Pro", monospace; font-size: 12px; font-weight: 600; fill: var(--ink);
}
.gauge-state {
  font-family: "Source Code Pro", monospace; font-size: 11px; fill: var(--copper-dark);
}
.prop-lbl {
  font-family: Sora, sans-serif; font-size: 9px; font-weight: 800; fill: #fff; letter-spacing: .08em;
}
.leg-txt {
  font-family: "Work Sans", sans-serif; font-size: 13px; font-weight: 600; fill: var(--ink);
}
.stage-readout {
  font-family: Sora, sans-serif; font-size: 14px; font-weight: 600;
  fill: var(--copper-dark); letter-spacing: .08em;
}
.board-lede {
  font-family: Sora, sans-serif; font-weight: 800; font-size: 18px; fill: var(--ink);
}
.board-sub {
  font-family: "Work Sans", sans-serif; font-size: 12px; font-weight: 600; fill: var(--copper-dark);
}
.board-lede-sm {
  font-family: Sora, sans-serif; font-weight: 800; font-size: 11px; fill: var(--ink);
}

.replay {
  position: absolute; z-index: 3;
  right: 1rem; bottom: 1rem;
  font-family: Sora, sans-serif; font-weight: 600; font-size: .85rem;
  background: var(--copper); color: #fff; border: none;
  padding: .55rem 1rem; cursor: pointer; letter-spacing: .04em;
}
.replay:hover { background: var(--copper-dark); }
.replay:focus-visible { outline: 3px solid var(--fail); outline-offset: 2px; }

.needle, .needle-mob { transform-origin: 0 0; transform: rotate(-100deg); }

/* —— spine —— */
.pipe-spine {
  height: 28px; position: relative;
  background: linear-gradient(180deg, #e0b07a 0%, #b87333 45%, #6e3f18 100%);
  border-top: 2px solid #8a5524; border-bottom: 2px solid #5c3714;
}
.pipe-spine::before {
  content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 6px;
  background: linear-gradient(180deg, #f0d4b0, transparent); opacity: .55;
}

/* —— bays —— */
.bay {
  max-width: 920px; margin: 0 auto; padding: 2.25rem 1.25rem 1.5rem;
  position: relative;
}
.clamp-row {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1rem; padding-top: .25rem;
}
.u-bolt {
  width: 22px; height: 28px; flex-shrink: 0;
  border: 3px solid var(--copper-dark); border-radius: 3px 3px 6px 6px;
  background: linear-gradient(180deg, #e0b07a, var(--copper) 55%, var(--copper-dark));
  box-shadow: inset 0 2px 0 #f0d4b0;
  position: relative;
}
.u-bolt::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: -10px; height: 10px;
  border: 3px solid var(--copper-dark); border-bottom: none; border-radius: 10px 10px 0 0;
}
.bay-tag {
  font-family: Sora, sans-serif; font-weight: 800; font-size: .72rem;
  letter-spacing: .14em; color: var(--copper-dark);
  border-bottom: 3px solid var(--copper); padding-bottom: .35rem; flex: 1;
}
.bay-h {
  font-family: Sora, sans-serif; font-weight: 800; font-size: 1.35rem;
  margin: 0 0 .5rem; letter-spacing: .02em;
}
.bay-lede { margin: 0 0 1.25rem; max-width: 40rem; }

/* hang tag = install — commands wrap, never clip */
.hang-tag {
  position: relative;
  background: linear-gradient(180deg, #e2c078, var(--brass) 40%, #a87e3e);
  border: 3px solid var(--copper-dark);
  padding: 2rem 1.25rem 1.5rem;
  max-width: 640px;
  box-shadow: 6px 8px 0 color-mix(in srgb, var(--ink) 12%, transparent);
}
.tag-eye {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--concrete); border: 4px solid var(--copper-dark);
  box-shadow: inset 0 0 0 5px var(--brass);
}
.hang-tag h2 {
  font-family: Sora, sans-serif; font-weight: 800; font-size: 1.15rem;
  margin: 0 0 1rem; text-align: center; letter-spacing: .04em;
}
.hang-tag .cmd {
  background: var(--ink); color: var(--concrete);
  padding: 1rem 1.1rem; margin: 0;
  border-left: 4px solid var(--copper);
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: .78rem; line-height: 1.5;
}
.hang-tag .cmd code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.hang-tag .cmd-go { margin-top: .35rem; font-size: .72rem; word-break: break-all; overflow-wrap: anywhere; }
.hang-tag .copy {
  display: block; margin: .55rem 0 0 auto;
  font-family: Sora, sans-serif; font-weight: 600; font-size: .78rem;
  background: var(--copper-dark); color: #fff; border: none;
  padding: .4rem .85rem; cursor: pointer; letter-spacing: .06em;
}
.hang-tag .copy:hover { background: var(--ink); }
.hang-tag .copy:focus-visible { outline: 3px solid var(--fail); outline-offset: 2px; }
.or { font-size: .9rem; color: color-mix(in srgb, var(--ink) 78%, transparent); margin: .85rem 0 .35rem; text-align: center; }
.hint { font-size: .88rem; margin: .75rem 0 0; }

/* joint fittings — SEAL dry vs OPEN bubbling */
.joint-manifold {
  display: flex; flex-wrap: wrap; gap: 0;
  border: 4px solid var(--copper-dark);
  background: linear-gradient(180deg, #e0b07a 0%, var(--copper) 40%, var(--copper-dark) 100%);
  padding: 14px 8px 18px;
  position: relative;
}
.joint-manifold::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: 6px; height: 5px;
  background: linear-gradient(180deg, #f0d4b0, transparent); opacity: .5; pointer-events: none;
}
.fitting {
  flex: 1 1 140px; min-width: 140px; max-width: 100%;
  appearance: none; border: none; cursor: pointer; text-align: left;
  background: transparent; color: var(--ink);
  padding: .85rem .7rem .7rem; position: relative;
  border-right: 2px solid color-mix(in srgb, var(--copper-dark) 55%, transparent);
}
.fitting:last-child { border-right: none; }
.fitting .nut {
  display: block; width: 36px; height: 36px; margin: 0 auto .55rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0b07a, var(--copper-dark));
  box-shadow: inset 0 0 0 6px var(--fail), 0 0 0 3px #6e3f18;
  position: relative;
}
.fitting.seal .nut {
  box-shadow: inset 0 0 0 6px var(--seal), 0 0 0 3px #6e3f18;
}
.fitting .bubbles-mini {
  position: absolute; left: 50%; top: 4px; width: 10px; height: 10px;
  margin-left: 10px; border-radius: 50%;
  border: 1.5px solid var(--soap);
  background: color-mix(in srgb, var(--soap) 35%, transparent);
  opacity: .85;
  box-shadow:
    8px -10px 0 -2px color-mix(in srgb, var(--sheen) 50%, var(--soap)),
    -4px -16px 0 -3px color-mix(in srgb, var(--soap) 40%, transparent);
}
.fitting.seal .bubbles-mini { display: none; }
.fitting .fit-id {
  display: block; font-family: "Source Code Pro", monospace; font-weight: 600;
  font-size: .72rem; text-align: center; color: #fff;
  text-shadow: 0 1px 0 #5c3714;
}
.fitting .fit-state {
  display: block; font-family: Sora, sans-serif; font-weight: 800;
  font-size: .62rem; letter-spacing: .1em; text-align: center;
  color: #ffe8d6; margin: .2rem 0 .45rem;
}
.fitting.seal .fit-state { color: #d4f5ef; }
.fitting .fit-body {
  display: none; font-size: .82rem; line-height: 1.4;
  background: var(--concrete); color: var(--ink);
  padding: .65rem .7rem; margin-top: .4rem;
  border: 2px solid var(--copper-dark);
}
.fitting[aria-expanded="true"] .fit-body { display: block; }
.fitting.leak:hover .nut, .fitting.leak:focus-visible .nut {
  box-shadow: inset 0 0 0 6px var(--fail), 0 0 0 4px #14171c;
}
.fitting.seal:hover .nut, .fitting.seal:focus-visible .nut {
  box-shadow: inset 0 0 0 6px var(--seal), 0 0 0 4px #14171c;
}
.fitting:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; z-index: 1; }
.fineprint {
  font-size: .9rem; color: color-mix(in srgb, var(--ink) 72%, transparent); margin: 1rem 0 0;
}

/* clipboard — term wraps, no mid-word clip */
.clipboard {
  background: #ebe6dc;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  padding: 2.5rem 1.25rem 1.25rem;
  position: relative;
  max-width: 720px;
  box-shadow: 4px 6px 0 color-mix(in srgb, var(--ink) 10%, transparent);
}
.clip-metal {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  width: 88px; height: 28px; border-radius: 4px;
  background: linear-gradient(180deg, #c8ccd2, #8a9098 60%, #5a6068);
  border: 2px solid #4a5058;
}
.clip-metal::after {
  content: ""; position: absolute; left: 50%; top: 6px; transform: translateX(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: #3a4048; box-shadow: inset 0 0 0 3px #6a7078;
}
.wo-head {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
  font-family: Sora, sans-serif; font-weight: 700; font-size: .78rem;
  letter-spacing: .06em; margin-bottom: .85rem;
  color: var(--copper-dark);
}
.wo-stamp {
  margin-left: auto; color: var(--fail); border: 2px solid var(--fail);
  padding: .2rem .55rem; letter-spacing: .12em; font-weight: 800;
  transform: rotate(-4deg);
}
.term {
  background: var(--ink); color: #cfd3d8;
  padding: 1.1rem 1.15rem; margin: 0;
  border-top: 3px solid var(--copper);
  font-size: .78rem; line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.term code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.term .fail { color: #e85d04; font-weight: 600; }
.term .ok { color: #3db8b0; }
.term .b { color: #fff; font-weight: 600; }
.demo {
  display: block; margin: 1rem auto 0; max-width: 100%; height: auto;
  border: 2px solid var(--copper-dark);
}

.ticket-rack {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0;
  border-left: 6px solid var(--copper);
  background: linear-gradient(90deg, color-mix(in srgb, var(--copper) 18%, var(--concrete)), var(--concrete) 28px);
}
.ticket {
  border-bottom: 1px dashed color-mix(in srgb, var(--copper-dark) 35%, transparent);
}
.ticket a {
  display: grid; grid-template-columns: minmax(9rem, 12rem) 1fr;
  gap: .75rem; align-items: baseline;
  padding: .7rem 1rem .7rem 1.25rem;
  text-decoration: none; color: var(--ink);
  position: relative;
}
.ticket a::before {
  content: ""; position: absolute; left: -9px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brass); border: 2px solid var(--copper-dark);
}
.ticket a:hover { background: color-mix(in srgb, var(--copper) 10%, transparent); }
.t-id {
  font-family: "Source Code Pro", monospace; font-weight: 600; font-size: .82rem;
  color: var(--copper-dark);
}
.t-sum { font-size: .95rem; }

.shop-foot {
  text-align: center; padding: 2.5rem 1rem 3rem;
  border-top: 3px solid var(--copper); margin-top: 1.5rem;
}
.shop-foot .dim {
  color: color-mix(in srgb, var(--ink) 55%, transparent); font-size: .9rem;
}

/* —— mobile: vertical bay, never crop —— */
@media (max-width: 720px) {
  .manifold-desk { display: none; }
  .manifold-mob { display: block; }
  .hero {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
  }
  .manifold-mob {
    height: auto;
    width: 100%;
    max-height: none;
  }
  .fitting { flex: 1 1 100%; border-right: none; border-bottom: 2px solid color-mix(in srgb, var(--copper-dark) 45%, transparent); }
  .fitting:last-child { border-bottom: none; }
  .ticket a { grid-template-columns: 1fr; gap: .2rem; }
  .shop-bar nav a:nth-child(1), .shop-bar nav a:nth-child(2) { display: none; }
  .hang-tag .cmd { font-size: .72rem; }
  .replay { right: .75rem; bottom: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .needle, .needle-mob { transform: rotate(42deg) !important; }
  .fitting .bubbles-mini { animation: none; }
}
