/* Marvel portfolio: the workbench. Tokens mirror DESIGN.md. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2"), url("/fonts/bricolage.woff") format("woff");
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plexmono-500.woff2") format("woff2"), url("/fonts/plexmono-500.woff") format("woff");
  font-weight: 500;
  font-display: swap;
}

:root {
  --mat: #18513f;
  --mat-deep: #0f382b;
  --paper: #f2eee3;
  --ink: #16150f;
  --orange: #ff6b1a;
  --steel: #2a2d2e;
  --tape: #121212;
  --tape-text: #f4f1ea;
  --lamp: #ffd9a0;
  --muted-mat: #bfd3c7;
  --muted-paper: #55524a;
  --rule-paper: rgba(22, 21, 15, 0.16);

  --radius: 12px;
  --wrap: 1200px;
  --gutter: 24px;
  --section: clamp(88px, 11vw, 128px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --sans: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--mat-deep) var(--paper);
}

body {
  margin: 0;
  background: var(--mat);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--orange);
}

::selection { background: var(--orange); color: var(--ink); }

p, li, dd { text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
a, button { touch-action: manipulation; }
img, video { display: block; max-width: 100%; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: 16px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 40;
  background: var(--orange); color: var(--ink); padding: 10px 16px; border-radius: 8px; font-weight: 700;
}
.skip:focus { left: 16px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Grounds ---------- */
.mat {
  background-color: var(--mat);
  background-image:
    linear-gradient(rgba(214, 235, 222, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 235, 222, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(214, 235, 222, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 235, 222, 0.06) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  background-position: -1px -1px;
  color: var(--paper);
}
.paper { background: var(--paper); color: var(--ink); }

/* ---------- Type ---------- */
.display {
  margin: 0;
  font-weight: 800;
  font-stretch: 88%;
  font-variation-settings: "opsz" 96;
  font-size: clamp(2.6rem, 6.8vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.018em;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.display-md { font-size: clamp(2.4rem, 5.6vw, 4.6rem); }
.title {
  margin: 0 0 16px;
  font-weight: 800;
  font-stretch: 80%;
  font-variation-settings: "opsz" 72;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.heading {
  margin: 0;
  font-weight: 700;
  font-stretch: 85%;
  font-variation-settings: "opsz" 48;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* ---------- Label tape ---------- */
.tape {
  display: inline-block;
  padding: 5px 10px 4px;
  background: var(--tape);
  color: var(--tape-text);
  border-radius: 3px;
  font-weight: 700;
  font-stretch: 85%;
  font-size: 0.82rem;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18), 0 -1px 0 rgba(0, 0, 0, 0.6);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 2px 4px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; max-width: 100%;
  padding: 12px 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: inherit; font-weight: 700; font-size: 1.05rem; line-height: 1.2;
  text-align: center; text-decoration: none; overflow-wrap: anywhere;
  user-select: none; -webkit-user-select: none;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--orange); color: var(--ink); }
.btn-line { background: transparent; border-color: var(--paper); color: var(--paper); }
.btn-ink { background: var(--ink); color: var(--paper); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: #ff8440; }
  .btn-line:hover { background: var(--paper); color: var(--ink); }
  .btn-ink:hover { background: #33312a; }
}

/* ---------- Header ---------- */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 16px;
  padding: calc(30px + env(safe-area-inset-top, 0px)) calc(var(--gutter) + 18px) 16px;
}
.brand { text-decoration: none; }
.brand .tape { font-size: 0.95rem; transform: rotate(-2deg); }
.top nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.top nav a { font-weight: 600; font-size: 1rem; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .top nav a:hover { text-decoration: underline; } }

/* ---------- Robot arm overlay ---------- */
.arm {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 15;
  overflow: visible;
}
.arm[hidden] { display: none; }
.arm-shadow { opacity: 0.42; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  background-image:
    radial-gradient(70% 60% at 18% 18%, rgba(255, 217, 160, 0.20), rgba(255, 217, 160, 0) 70%),
    linear-gradient(135deg, transparent calc(50% - 0.5px), rgba(214, 235, 222, 0.12) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(rgba(214, 235, 222, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 235, 222, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(214, 235, 222, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 235, 222, 0.06) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  background-position: 0 0, 0 0, -1px -1px, -1px -1px, -1px -1px, -1px -1px;
}
.ruler {
  position: absolute; z-index: 1;
  font-family: var(--mono); font-size: 11px; line-height: 1; color: var(--muted-mat);
  pointer-events: none;
}
.ruler-x {
  top: 0; left: 0; right: 0; height: 22px;
  background:
    repeating-linear-gradient(90deg, rgba(214, 235, 222, 0.55) 0 1px, transparent 1px 80px) 0 0 / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, rgba(214, 235, 222, 0.35) 0 1px, transparent 1px 16px) 0 0 / 100% 6px no-repeat;
}
.ruler-y {
  top: 0; left: 0; bottom: 0; width: 22px;
  background:
    repeating-linear-gradient(180deg, rgba(214, 235, 222, 0.55) 0 1px, transparent 1px 80px) 0 0 / 12px 100% no-repeat,
    repeating-linear-gradient(180deg, rgba(214, 235, 222, 0.35) 0 1px, transparent 1px 16px) 0 0 / 6px 100% no-repeat;
}
.ruler span { position: absolute; }
.ruler-x span { top: 13px; transform: translateX(4px); }
.ruler-y span { left: 13px; transform: translateY(4px); }

.hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--wrap);
  margin: 0 auto;
  padding: 140px var(--gutter) calc(72px + env(safe-area-inset-bottom, 0px)) calc(var(--gutter) + 34px);
}
.hero .display { max-width: 13ch; }
.hero .lede {
  max-width: 34rem;
  margin: 24px 0 30px;
  font-size: 1.2rem; line-height: 1.55;
  color: var(--muted-mat);
}
.hint { margin: 22px 0 0; font-family: var(--mono); font-size: 12px; color: var(--muted-mat); }
.hint-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .hint-fine { display: none; }
  .hint-touch { display: inline; }
}

/* ---------- Bench ---------- */
.bench { padding: var(--section) 0; }
.bench-head { max-width: 40rem; margin-bottom: 56px; }
.bench-head p { margin: 0; color: var(--muted-mat); }

.parts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 56px 36px;
  align-items: start;
}
.part {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 0; margin: 0;
  background: none; border: 0;
  color: var(--paper);
  font: inherit; text-align: left;
  cursor: pointer;
  transform: rotate(var(--rot, 0deg));
  transition: transform 260ms var(--ease-out);
}
.part > .tape {
  position: absolute; z-index: 3;
  top: -12px; left: 18px;
  transform: rotate(var(--tape-rot, -2deg));
}
.part-line { display: block; font-size: 1rem; line-height: 1.45; color: var(--muted-mat); max-width: 34ch; }

/* Objects cast shadows from the lamp at top left */
.part-media, .receipt, .schematic, .motion-pair {
  display: block;
  border-radius: var(--radius);
  box-shadow: 6px 10px 18px rgba(5, 25, 18, 0.45), 1px 2px 3px rgba(5, 25, 18, 0.35);
  transition: box-shadow 260ms var(--ease-out);
}
.part-media { overflow: hidden; background: #0a0a0a; }
.part-media img { width: 100%; height: 100%; object-fit: cover; }
.part-media.portrait { aspect-ratio: 9 / 16; }
.part-media.landscape { aspect-ratio: 16 / 9; }
.part-media.phone {
  aspect-ratio: 585 / 1266;
  border: 9px solid #101010;
  border-radius: 34px;
  background: #101010;
}
.part-media.phone img { border-radius: 25px; object-position: top; }

.part.lift, .part:focus-visible {
  transform: rotate(0deg) translateY(-8px) scale(1.015);
}
.part.lift .part-media, .part.lift .receipt, .part.lift .schematic, .part.lift .motion-pair,
.part:focus-visible .part-media, .part:focus-visible .receipt, .part:focus-visible .schematic {
  box-shadow: 18px 28px 36px rgba(5, 25, 18, 0.5), 2px 4px 6px rgba(5, 25, 18, 0.3);
}
.part:focus-visible { outline-offset: 10px; border-radius: 14px; }

.part-pulse { grid-column: 1 / 3; grid-row: 1 / 3; --rot: -1.4deg; }
.part-nepa { grid-column: 3 / 5; grid-row: 1 / 3; --rot: 1deg; --tape-rot: 1.5deg; padding: 0 12%; }
.part-spectra { grid-column: 5 / 7; grid-row: 1; --rot: 2deg; }
.part-swarm { grid-column: 5 / 7; grid-row: 2; --rot: -1.6deg; --tape-rot: 2deg; }
.part-ysidra { grid-column: 1 / 4; grid-row: 3; --rot: -0.8deg; --tape-rot: -1deg; }
.part-spectra-app { grid-column: 4 / 7; grid-row: 3; --rot: 1.2deg; --tape-rot: -1.5deg; }
.part-motion { grid-column: 1 / 5; grid-row: 4; --rot: -1deg; --tape-rot: 2deg; }
.part-grid { grid-column: 5 / 7; grid-row: 4 / 6; --rot: 1.6deg; --tape-rot: -2deg; padding: 0 14%; }
.part-scripture { grid-column: 2 / 5; grid-row: 5; --rot: -0.6deg; --tape-rot: 1.5deg; }

/* Browser frame (SpectraXpress) */
.part-media.browser { background: #0b0b0c; border: 1px solid #2a2a2e; }
.browser-bar { display: flex; gap: 5px; align-items: center; height: 20px; padding: 0 9px; background: #1b1b1f; border-bottom: 1px solid #2a2a2e; }
.browser-bar i { width: 7px; height: 7px; border-radius: 50%; background: #3d3d44; }
.part-media.browser.light { background: #f4f3ef; border-color: #d9d6cc; }
.part-media.browser.light .browser-bar { background: #e8e6df; border-bottom-color: #d9d6cc; }
.part-media.browser.light .browser-bar i { background: #c7c3b8; }
.part-media.browser img { aspect-ratio: 16 / 10; height: auto; object-position: top; }

/* Map print (flood swarm) */
.part-media.map { background: #fbf8f0; padding: 8px; border-radius: 6px; aspect-ratio: auto; }
.part-media.map img { aspect-ratio: 832 / 616; height: auto; border-radius: 2px; }

/* Receipt */
.receipt {
  display: flex; flex-direction: column; gap: 6px;
  padding: 26px 22px 20px;
  background: #fbf8f0;
  color: var(--ink);
  font-family: var(--mono); font-size: 13px; line-height: 1.35;
  font-variant-numeric: tabular-nums;
  border-radius: 4px;
  -webkit-mask: radial-gradient(circle at 6px 100%, transparent 5px, #000 5.5px) 0 0 / 12px 100% repeat-x;
          mask: radial-gradient(circle at 6px 100%, transparent 5px, #000 5.5px) 0 0 / 12px 100% repeat-x;
}
.r-row { display: flex; justify-content: space-between; gap: 12px; }
.r-head { font-family: var(--sans); font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.r-total { margin-top: 6px; padding-top: 8px; border-top: 1px dashed rgba(22, 21, 15, 0.45); font-weight: 500; font-size: 15px; }
.r-note { margin-top: 8px; color: var(--muted-paper); font-size: 11px; }

/* Schematic */
.schematic {
  background:
    linear-gradient(rgba(22, 21, 15, 0.05) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, rgba(22, 21, 15, 0.05) 1px, transparent 1px) 0 0 / 20px 20px,
    #fbf8f0;
  padding: 26px 18px 14px;
  border-radius: 6px;
}
.schematic svg { display: block; width: 100%; height: auto; }
.schematic .wire path { fill: none; stroke: var(--orange); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.schematic .node rect { fill: #fbf8f0; stroke: var(--ink); stroke-width: 1.6; }
.schematic .node.core rect { fill: var(--ink); }
.schematic .node text { fill: var(--ink); font-family: var(--sans); font-weight: 700; font-size: 15px; text-anchor: middle; }
.schematic .node text.s { font-family: var(--mono); font-weight: 500; font-size: 10.5px; fill: var(--muted-paper); }
.schematic .node.core text { fill: var(--paper); }
.schematic .node.core text.s { fill: #c9c4b6; }

/* Motion pair */
.motion-pair {
  display: grid; grid-template-columns: 0.42fr 1fr; gap: 10px; align-items: end;
  padding: 10px; background: #0d0d0d; border-radius: var(--radius);
}
.motion-pair .part-media { box-shadow: none; border-radius: 6px; }

/* ---------- Parts bin ---------- */
.bin { padding: var(--section) 0; }
.bin-list { list-style: none; margin: 32px 0 0; padding: 0; }
.bin-list li {
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px;
  padding: 18px 0; border-top: 1px solid var(--rule-paper);
}
.bin-list li:last-child { border-bottom: 1px solid var(--rule-paper); }
.bin-list a { font-weight: 700; font-stretch: 90%; font-size: 1.2rem; text-decoration-color: rgba(22, 21, 15, 0.35); }
.bin-list span { color: var(--muted-paper); }
@media (hover: hover) and (pointer: fine) { .bin-list a:hover { text-decoration-color: var(--orange); } }

/* ---------- Robotics ---------- */
.robotics { padding: var(--section) 0; background-color: var(--mat-deep); }
.robo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.robo-copy p { margin: 0 0 18px; max-width: 38rem; color: #dfe9e2; }
.robo-left { display: flex; flex-direction: column; gap: 28px; }
.robo-mount {
  position: relative;
  min-height: 300px;
  border: 1.5px dashed rgba(214, 235, 222, 0.35);
  border-radius: var(--radius);
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 14px 16px;
}
.robo-mount span { font-family: var(--mono); font-size: 12px; color: var(--muted-mat); max-width: 18ch; text-align: right; }
.live { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--orange); font-size: 1.05rem; display: inline-block; min-width: 4.5ch; }
.specs { margin: 28px 0 0; border-top: 1px solid rgba(214, 235, 222, 0.22); }
.specs div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(214, 235, 222, 0.22); }
.specs dt { font-family: var(--mono); font-size: 13px; color: var(--muted-mat); padding-top: 3px; }
.specs dd { margin: 0; }

/* ---------- About ---------- */
.about { padding: var(--section) 0; }
.with-list { margin: 32px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.with-list dt { font-weight: 700; font-stretch: 85%; font-size: 1.25rem; margin-bottom: 6px; }
.with-list dd { margin: 0; color: var(--muted-paper); }
.title-sub { margin-top: 96px; }
.jobs { list-style: none; margin: 24px 0 0; padding: 0; }
.jobs li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; padding: 14px 0; border-top: 1px solid var(--rule-paper); }
.jobs .when { color: var(--muted-paper); font-variant-numeric: tabular-nums; }
.fine { margin: 28px 0 0; max-width: 70ch; color: var(--muted-paper); font-size: 1rem; }

/* ---------- Contact ---------- */
.contact { padding: var(--section) 0 calc(64px + env(safe-area-inset-bottom, 0px)); }
.contact .display { max-width: 11ch; }
.contact .lede { max-width: 36rem; margin: 22px 0 30px; font-size: 1.2rem; color: var(--muted-mat); }
.contact .links { display: flex; flex-wrap: wrap; gap: 28px; margin: 64px 0 0; padding-top: 24px; border-top: 1px solid rgba(214, 235, 222, 0.3); font-weight: 600; }

/* ---------- Project dialog ---------- */
.case {
  width: min(1040px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.case::backdrop { background: rgba(8, 28, 21, 0.72); }
.case[open] { animation: case-in 260ms var(--ease-out); }
@keyframes case-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.case-inner {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 40px; padding: 40px;
}
.case-media video, .case-media img {
  width: 100%; max-height: 70dvh; object-fit: contain;
  border-radius: 12px; background: #0b0b0b;
}
.case-media img { background: transparent; }
.media-note { margin: 10px 0 0; font-size: 0.9rem; color: var(--muted-paper); }
.case-copy .tape { margin-bottom: 18px; transform: rotate(-1.5deg); }
.case-copy .heading { margin-bottom: 14px; }
.case-copy p { margin: 0 0 14px; }
.facts { margin: 6px 0 18px; padding-left: 1.1em; }
.facts li { margin: 6px 0; }
.facts li::marker { color: var(--orange); }
.stack { font-family: var(--mono); font-size: 13px; color: var(--muted-paper); }
.case-links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 22px; margin-top: 22px !important; }
.case-links a:not(.btn) { font-weight: 600; }
.case-close {
  position: absolute; top: 14px; right: 14px;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(22, 21, 15, 0.08); color: var(--ink);
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.case-close:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .case-close:hover { background: rgba(22, 21, 15, 0.16); } }
.case-wide { grid-template-columns: minmax(0, 1fr); }
.case-wide .case-copy { max-width: 46rem; }
.case-wide .case-media video, .case-wide .case-media img { max-height: none; height: auto; }
.case-wide .case-media video { aspect-ratio: 1304 / 440; }
.shots { position: relative; padding-right: 16%; }
.shots img { display: block; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.shots .shot-phone {
  position: absolute; right: 0; bottom: -18px; width: 22%;
  border: 6px solid #101010; border-radius: 22px; background: #101010;
}
.case-wide-fig { margin: 0; }
.case-wide-fig img { width: 100%; height: auto; border-radius: 10px; }
.case-wide-fig figcaption { margin-top: 10px; font-size: 0.95rem; color: var(--muted-paper); max-width: 60ch; }
.case-copy .calc { margin-top: 26px; }
.robo-cta { margin: 6px 0 26px !important; }
.part-media.phone.dark { background: #0d0e0b; border-color: #0d0e0b; }
.phones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.phones img { border: 6px solid #101010; border-radius: 22px; background: #101010; height: auto; max-height: none; aspect-ratio: 585 / 1266; object-fit: cover; }
.studies { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: end; margin-top: 6px; }
.studies figure { margin: 0; }
.studies video { width: 100%; border-radius: 10px; background: #0b0b0b; }
.studies figcaption { margin-top: 6px; font-size: 0.9rem; color: var(--muted-paper); }
.schematic-lg { box-shadow: none; border: 1px solid var(--rule-paper); }

/* Pricing calculator */
.calc {
  padding: 24px; border-radius: 12px; background: #fbf8f0;
  border: 1px solid var(--rule-paper);
}
.calc-title { margin: 0 0 14px; font-weight: 700; font-size: 1.15rem; }
.calc label { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule-paper); font-size: 1rem; }
.calc-in { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 14px; color: var(--muted-paper); }
.calc input {
  width: 6.5em; padding: 8px 10px; border: 1.5px solid rgba(22, 21, 15, 0.3); border-radius: 8px;
  background: #fff; color: var(--ink); font: 500 16px/1.2 var(--mono); text-align: right;
}
.calc input:focus-visible { outline: 3px solid var(--orange); outline-offset: 1px; border-color: transparent; }
.calc-out { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 0; padding-top: 14px; border-top: 2px solid var(--ink); }
.calc-out b { font-family: var(--mono); font-size: 1.6rem; font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 999px) {
  .parts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 28px; }
  .part-pulse, .part-nepa, .part-spectra, .part-swarm, .part-ysidra, .part-spectra-app, .part-motion, .part-grid, .part-scripture { grid-column: auto; grid-row: auto; }
  .part-ysidra, .part-spectra-app, .part-motion, .part-scripture { grid-column: 1 / -1; }
  .part-grid { padding: 0 8%; }
  .part-nepa { padding: 0 8%; }
  .robo-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .robo-mount { min-height: 240px; }
  .with-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-inner { grid-template-columns: minmax(0, 1fr); padding: 28px 22px; gap: 24px; }
  .case-media video, .case-media img { max-height: 56dvh; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  body { font-size: 1.0625rem; }
  .top { padding-left: calc(var(--gutter) + 14px); padding-right: var(--gutter); }
  .top nav { gap: 8px 16px; }
  .top nav a[href="#about"] { display: none; }
  .hero-inner { padding: 120px var(--gutter) calc(56px + env(safe-area-inset-bottom, 0px)) calc(var(--gutter) + 22px); }
  .ruler-y span { display: none; }
  .parts { grid-template-columns: minmax(0, 1fr); }
  .part { --rot: 0deg !important; }
  .part-pulse { padding: 0 14%; }
  .part-nepa { padding: 0 18%; }
  .part-grid { padding: 0 18%; }
  .bin-list li, .jobs li, .specs div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .with-list { grid-template-columns: minmax(0, 1fr); }
  .btn { width: 100%; }
  .case { width: 100%; max-width: 100%; max-height: 100dvh; border-radius: 16px 16px 0 0; margin: auto 0 0; }
  .studies { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .part, .btn, .case-close, .part-media, .receipt, .schematic, .motion-pair { transition: none; }
  .btn:active, .case-close:active { transform: none; }
  .part.lift, .part:focus-visible { transform: rotate(var(--rot, 0deg)); }
  .case[open] { animation: none; }
}
