/* Urban Machine
   Layout: a fixed WebGL machine fills the screen; story panels ride over it on the left like
   setup sheets, each one stage of a real machining cycle; DRO readout bottom-right.
   One deliberate dark look: a shop at night, aluminum-white type, tower-light amber. */
:root {
  color-scheme: dark;
  --bg: #0d1013;
  --bg-raised: #14181c;
  --panel: rgba(12, 15, 18, 0.84);
  --line: #2a3138;
  --line-strong: #3a434b;
  --fg: #e8ecef;
  --muted: #9aa5ae;
  --accent: #f2a93b;
  --accent-hover: #ffbd5a;
  --accent-ink: #1a1206;
  --ok: #4fd083;
  --error: #ff7a6b;

  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --header-h: 68px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.6 var(--font-body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.98;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2.7rem, 5.6vw, 5rem); }
h1 span { display: block; color: var(--muted); font-size: 0.5em; letter-spacing: 0.04em; margin-top: 0.35em; }
h2 { font-size: clamp(2.1rem, 3.6vw, 3.2rem); }
h3 { font-size: 1.35rem; letter-spacing: 0.03em; }
p { margin: 0; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- header + the always-visible quote button ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--gutter-r) 0 var(--gutter-l);
  display: flex; align-items: center; gap: 28px;
  background: linear-gradient(to bottom, rgba(13, 16, 19, 0.85), rgba(13, 16, 19, 0));
  transition: background-color 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.is-scrolled .site-header { background: rgba(13, 16, 19, 0.92); border-bottom-color: var(--line); backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.site-nav { display: flex; gap: 22px; }
.site-nav a {
  font: 600 0.95rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.08em;
  text-decoration: none; color: var(--muted); padding: 8px 0;
}
.site-nav a:hover { color: var(--fg); }

.quote-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink);
  font: 700 1.15rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 15px 24px; text-decoration: none;
  box-shadow: 0 6px 24px rgba(242, 169, 59, 0.25);
  transition: background-color 0.2s, transform 0.2s;
}
.quote-btn::after { content: "→"; font-family: var(--font-body); font-weight: 600; }
.quote-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
/* Once past the hero the button drops a little lower and pulses once in a while. */
.quote-live .quote-btn { transform: translateY(6px); }
.quote-live .quote-btn:hover { transform: translateY(5px); }
.quote-live .quote-btn::before {
  content: ""; position: absolute; inset: -2px; border: 2px solid var(--accent);
  animation: pulse 3.2s ease-out infinite; pointer-events: none;
}
@keyframes pulse {
  0%, 60% { opacity: 0; transform: scale(1); }
  70% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.18, 1.5); }
}

/* ---------- 3D layer ---------- */
#machine {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0;
  display: block; opacity: 0; transition: opacity 0.9s ease;
}
.scene-ready #machine { opacity: 1; }
.scene-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 68% 52%, rgba(242, 169, 59, 0.09), transparent 70%),
    radial-gradient(40% 40% at 70% 45%, rgba(150, 170, 190, 0.08), transparent 70%),
    var(--bg);
}

/* ---------- DRO ---------- */
.dro {
  position: fixed; z-index: 10;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 248px;
  background: rgba(8, 11, 14, 0.86);
  border: 1px solid var(--line-strong);
  font: 500 0.82rem/1.35 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}
.scene-ready .dro { opacity: 1; transform: none; }
.past-story .dro { opacity: 0; transform: translateY(8px); }
.dro-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  letter-spacing: 0.06em; font-size: 0.74rem; color: var(--muted);
}
.dro-lamp { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dro-lamp[data-state="green"] { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dro-axes { margin: 0; padding: 8px 12px 4px; display: grid; gap: 1px; }
.dro-axes div { display: flex; justify-content: space-between; }
.dro-axes dt { color: var(--accent); }
.dro-axes dd { margin: 0; }
.dro-sf { display: flex; justify-content: space-between; padding: 2px 12px 8px; color: var(--muted); }
.dro-sf b { color: var(--fg); font-weight: 500; }
.dro-line {
  padding: 7px 12px; border-top: 1px solid var(--line);
  color: var(--ok); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dro-bar { height: 3px; background: var(--line); }
.dro-bar span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* ---------- story stages ---------- */
main { position: relative; z-index: 1; }
.stage {
  position: relative;
  min-height: 160vh;
  padding: 18vh var(--gutter-r) 0 max(var(--gutter-l), 5vw);
}
.stage--hero { padding-top: calc(var(--header-h) + 10vh); }
.stage--flow { min-height: 0; padding-bottom: 24vh; }
.panel {
  position: sticky; top: 18vh;
  width: min(500px, 42vw);
  display: grid; gap: 18px;
  padding: 26px 28px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.panel--hero { top: calc(var(--header-h) + 10vh); width: min(620px, 46vw); background: rgba(12, 15, 18, 0.55); }
.panel--wide { position: relative; top: 0; width: min(860px, 100%); }
.panel-op {
  display: flex; justify-content: space-between; gap: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
  font: 500 0.78rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.panel-op span:first-child { color: var(--accent); }
.panel p { color: #c9d0d6; max-width: 62ch; }
.panel .lead { font-size: 1.15rem; color: var(--fg); }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 22px; text-decoration: none; cursor: pointer; border: 0;
  font: 700 1.05rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.08em;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:disabled { opacity: 0.6; cursor: progress; }
.btn--ghost { border: 1px solid var(--line-strong); color: var(--fg); background: transparent; }
.btn--ghost:hover { border-color: var(--fg); }
.btn--big { padding: 18px 30px; font-size: 1.2rem; }
.scroll-hint {
  font: 500 0.78rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
}
.scroll-hint::after { content: ""; width: 1px; height: 28px; background: linear-gradient(var(--accent), transparent); }

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 22px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.62em; width: 10px; height: 2px; background: var(--accent);
}

.specs { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.specs div { padding: 12px 0 0; display: grid; gap: 2px; }
.specs dt { font: 500 0.72rem/1.2 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.specs dd { margin: 0; font: 600 1.35rem/1.15 var(--font-display); letter-spacing: 0.02em; }

.big-figure { display: grid; gap: 4px; }
.big-figure span {
  font: 700 clamp(3.6rem, 7vw, 6rem)/0.9 var(--font-display);
  color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.big-figure small { font: 500 0.8rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--line-strong); font: 700 1.1rem/1 var(--font-display); letter-spacing: 0.06em;
}
.badge em { font: 500 0.7rem/1 var(--font-mono); font-style: normal; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }

.industries { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.industries > div { min-width: 0; display: grid; gap: 6px; align-content: start; padding-top: 12px; border-top: 1px solid var(--line); }
.industries p { font-size: 0.95rem; }

.table-wrap { overflow-x: auto; }
.equip { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.equip th, .equip td { text-align: left; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.equip thead th { font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.equip tbody th { font: 700 1.2rem/1.1 var(--font-display); letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; }
.equip td { color: #c9d0d6; }
.qty { color: var(--accent); }
.sub { margin-top: 6px; }
.materials { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 22px; }
.materials li { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 600; }
.materials span { font: 500 0.78rem/1.3 var(--font-mono); color: var(--muted); font-weight: 500; }
.note { color: var(--muted) !important; }

/* ---------- opaque sections after the story ---------- */
.after { position: relative; z-index: 2; background: var(--bg); border-top: 1px solid var(--line); }
.wrap { width: min(1180px, 100%); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.wrap--narrow { width: min(860px, 100%); }
.block { padding-block: clamp(64px, 10vw, 120px); }
.block h2 { margin-bottom: 28px; }
.eyebrow { font: 500 0.8rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }

details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
  font: 600 1.3rem/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font: 400 1.6rem/1 var(--font-body); color: var(--accent); }
details[open] summary::after { content: "−"; }
details p { padding: 0 0 22px; color: #c9d0d6; max-width: 68ch; }

.block--quote { background: var(--bg-raised); border-top: 1px solid var(--line); }
.quote-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.quote-intro { display: grid; gap: 16px; }
.quote-intro h2 { margin: 0; font-size: clamp(2.4rem, 4.4vw, 3.8rem); }
.quote-intro > p { color: #c9d0d6; }
.contact { margin: 12px 0 0; display: grid; gap: 0; }
.contact div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.contact dt { font: 500 0.75rem/1.6 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.contact dd { margin: 0; }
.contact a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.contact a:hover { border-color: var(--accent); }

.quote-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field--pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field--pair > div { display: grid; gap: 6px; min-width: 0; }
label { font: 500 0.78rem/1.2 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
label span { color: var(--accent); }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], textarea, input[type="file"] {
  width: 100%; min-width: 0;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 0;
  padding: 12px 14px; font: 400 1rem/1.4 var(--font-body);
}
input[type="file"] { padding: 10px; }
input[type="file"]::file-selector-button {
  margin-right: 12px; border: 0; background: var(--line-strong); color: var(--fg);
  padding: 8px 14px; font: 600 0.9rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
textarea { resize: vertical; min-height: 140px; }
.hint { font-size: 0.88rem; color: var(--muted); }
.field--check { display: flex; align-items: flex-start; gap: 12px; }
.field--check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.field--check label { font: 400 0.98rem/1.4 var(--font-body); text-transform: none; letter-spacing: 0; color: var(--fg); }
.controlled-note { border: 1px solid var(--accent); padding: 12px 14px; font-size: 0.95rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.status { font-size: 0.98rem; }
.status[data-kind="ok"] { color: var(--ok); }
.status[data-kind="error"] { color: var(--error); }
.status[data-kind="info"] { color: var(--muted); }

.site-footer { padding-block: 48px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer-grid p + p { margin-top: 6px; }
.footer-brand { font: 700 1.4rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--fg); }
.copyright { margin-top: 32px; font-size: 0.85rem; }

/* ---------- no WebGL: the page still reads as a strong static page ---------- */
.no-webgl .stage { min-height: 0; padding-block: 12vh 0; }
.no-webgl .panel { position: relative; top: 0; }
.no-webgl main { padding-bottom: 12vh; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .site-nav { display: none; }
}
@media (max-width: 959px) {
  :root { --header-h: 60px; }
  .quote-btn { padding: 12px 16px; font-size: 1rem; }
  .stage { min-height: 0; padding: 62vh var(--gutter-r) 22vh var(--gutter-l); }
  .stage--hero { padding-top: calc(var(--header-h) + 46vh); }
  .panel, .panel--hero { position: relative; top: 0; width: 100%; padding: 22px 20px 24px; background: var(--panel); }
  .dro { display: none; }
  .quote-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .quote-form { grid-template-columns: 1fr; }
  .industries { grid-template-columns: 1fr; }
  .specs dd { font-size: 1.15rem; }
  .equip tbody th { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- customer names (text wordmarks, no logos) ---------- */
.clients-strip { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.clients-label { font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted) !important; }
.clients-names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.clients-names li {
  font: 600 1.05rem/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg);
}
.clients-names li + li::before { content: "·"; color: var(--accent); margin: 0 10px; }

.block--clients { border-bottom: 1px solid var(--line); }
/* flex so a short last row stretches to fill instead of leaving an empty cell */
.client-wall {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.client-wall li {
  flex: 1 1 30%; min-width: 0;
  display: grid; place-items: center; text-align: center; min-height: 120px; padding: 20px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font: 700 clamp(1.4rem, 2.6vw, 2.1rem)/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); transition: color 0.2s, background-color 0.2s;
}
.client-wall li:hover { color: var(--fg); background: var(--bg-raised); }
.client-note { margin-top: 20px; color: var(--muted); }
@media (max-width: 560px) {
  .client-wall li { flex-basis: 50%; min-height: 88px; }
}

/* ---------- original logo lockup: the UM mark and the "URBAN MACHINE" lettering are both cropped
   from the owner's logo.png (1000x1000; mark bbox 251-758 x 217-690, lettering 189-807 x 717-762).
   Black background blends into the dark header. ---------- */
.brand-logo, .brand-word { position: relative; display: block; overflow: hidden; flex: none; }
.brand-logo img, .brand-word img { position: absolute; max-width: none; mix-blend-mode: lighten; }
.brand-logo { width: 43px; height: 40px; }
.brand-logo img { width: 84.4px; height: 84.4px; left: -21.2px; top: -18.3px; }
.brand-word { width: 229px; height: 17px; }
.brand-word img { width: 369.6px; height: 369.6px; left: -69.9px; top: -265px; }
@media (max-width: 959px) {
  .brand-logo { width: 37px; height: 34px; }
  .brand-logo img { width: 71.7px; height: 71.7px; left: -18px; top: -15.6px; }
  .brand-word { width: 175px; height: 13px; }
  .brand-word img { width: 282.6px; height: 282.6px; left: -53.4px; top: -202.6px; }
}
@media (max-width: 560px) { .brand-word { display: none; } }
