/* =========================================================================
   ZG Industrial Automation - design system v2 "MACHINED"
   Dark graphite + machined-steel neutrals, one amber accent, sharp geometry.
   Single stylesheet. No inline styles anywhere - the CSP forbids them.
   ========================================================================= */

/* ---------- Font ---------------------------------------------------------
   One variable woff2 covers weights 100-900, so the whole type scale costs a
   single request. font-display:swap keeps text visible during load.          */
@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/dmsans-latin-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

/* ---------- Tokens ------------------------------------------------------- */
:root {
  /* Graphite scale - page ground to raised panel */
  --bg-deep: #07090d;      /* footer, deepest bands              */
  --bg: #0c0f14;           /* page ground                        */
  --bg-panel: #10141b;     /* alternating sections               */
  --surface: #141924;      /* cards, tables, inputs              */
  --surface-2: #1a202c;    /* hover / raised surface             */

  /* Machined-steel neutrals - text */
  --steel-bright: #eef1f6; /* headings                           */
  --steel: #c3ccd8;        /* body text                          */
  --steel-dim: #8b96a5;    /* secondary text                     */
  --steel-faint: #5d6774;  /* metadata, disabled                 */

  /* Hairlines */
  --line: #212836;
  --line-2: #2d3546;

  /* The one accent - machined amber */
  --accent: #ffb224;
  --accent-2: #ffc95e;             /* hover                      */
  --accent-ink: #1a1204;           /* text on accent             */
  --accent-dim: rgba(255, 178, 36, 0.13);
  --accent-line: rgba(255, 178, 36, 0.35);

  --ok: #4ecb71;
  --err: #ff5d5d;
  --err-dim: rgba(255, 93, 93, 0.12);

  --mono: ui-monospace, 'Cascadia Code', Consolas, 'Roboto Mono', monospace;

  --measure: 66ch;
  --wrap: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 2px;

  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1: clamp(1.2rem, 1.11rem + 0.44vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.32rem + 0.9vw, 2.1rem);
  --step-3: clamp(1.9rem, 1.55rem + 1.75vw, 3.1rem);
  --step-4: clamp(2.3rem, 1.6rem + 3.4vw, 4.4rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Blueprint hairline grid, laid over dark bands at very low contrast */
  --grid-motif:
    repeating-linear-gradient(90deg, rgba(139, 150, 165, 0.05) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(139, 150, 165, 0.035) 0 1px, transparent 1px 96px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--steel);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--steel-bright);
}
p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }

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

/* ---------- Accessibility ------------------------------------------------ */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.85rem 1.4rem;
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout ------------------------------------------------------- */
.wrap { width: min(100% - (var(--gutter) * 2), var(--wrap)); margin-inline: auto; }

.section { padding-block: clamp(3.5rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

/* Alternating band: a slightly lifted graphite panel between hairlines. */
.section--paper {
  background: var(--bg-panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Deep band: near-black with the blueprint grid motif. */
.section--ink {
  background: var(--bg-deep);
  background-image: var(--grid-motif);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--steel);
}

/* Section eyebrow: a small technical readout label */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--accent);
  flex: none;
}
.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.22;
}

.lede {
  font-size: var(--step-1);
  color: var(--steel-dim);
  max-width: var(--measure);
  line-height: 1.5;
  margin-top: 0.9rem;
}

.prose { max-width: var(--measure); color: var(--steel-dim); }
.prose p + p { margin-top: 1rem; }
.prose strong { color: var(--steel-bright); }

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.7rem;
  font: inherit;
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
    color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 1em; height: 1em; flex: none; }

.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-2); box-shadow: 0 8px 28px -10px var(--accent-line); }

.btn--ghost { border-color: var(--line-2); color: var(--steel-bright); background: transparent; }
.btn--ghost:hover { border-color: var(--steel-dim); }

.btn[disabled], .btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

/* ---------- Header ------------------------------------------------------- */
.hdr {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 11, 15, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(14px);
}
/* Amber datum line along the very top - the one place the accent runs edge to edge. */
.hdr::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 38%, var(--line-2) 38.2%, var(--line-2) 100%);
}
.hdr__in { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; min-height: 84px; }

.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; flex: none; color: var(--steel-bright); }
.brand__mark { width: 42px; height: 42px; flex: none; }
.brand__text {
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1;
  white-space: nowrap;
}
.brand__zg { font-weight: 800; letter-spacing: -0.01em; }
.brand--lg .brand__mark { width: 52px; height: 52px; }
.brand--lg .brand__text { font-size: 1.25rem; }
.brand--light { color: var(--steel-bright); }

@media (max-width: 560px) {
  .brand__mark { width: 36px; height: 36px; }
  .brand__text { font-size: 0.92rem; }
  .hdr__in { min-height: 72px; }
}
@media (max-width: 380px) {
  .brand__text { font-size: 0; }
  .brand__zg { font-size: 1.15rem; }
}

.nav { display: flex; align-items: center; gap: 0.15rem; }
.nav a {
  position: relative;
  padding: 0.6rem 0.8rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--steel-dim);
  border-radius: var(--radius);
  transition: color 0.2s var(--ease);
  white-space: nowrap;
}
.nav a:hover { color: var(--steel-bright); }
.nav a[aria-current='page'] { color: var(--steel-bright); }
.nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0.8rem; right: 0.8rem; bottom: 0.25rem;
  height: 2px;
  background: var(--accent);
}

.hdr__cta { flex: none; }
.hdr__cta .btn { padding: 0.75rem 1.3rem; }

.burger {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--steel-bright);
}
.burger svg { width: 20px; height: 20px; }
.burger__close { display: none; }
.burger[aria-expanded='true'] .burger__open { display: none; }
.burger[aria-expanded='true'] .burger__close { display: block; }

@media (max-width: 1080px) {
  .burger { display: inline-flex; }
  .hdr__cta { display: none; }
  .nav {
    position: fixed;
    inset: 86px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line-2);
    padding: 0.5rem var(--gutter) 1.5rem;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease), visibility 0.25s;
  }
  .nav[data-open='true'] { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav a { padding: 0.9rem 0; font-size: var(--step-0); border-bottom: 1px solid var(--line); }
  .nav a[aria-current='page']::after { left: 0; right: auto; width: 24px; bottom: 0.6rem; }
}
@media (max-width: 560px) {
  .nav { inset: 74px 0 auto 0; }
}

/* ---------- Translucent photo band --------------------------------------
   Hero treatment - a workshop photograph dimmed behind a graphite wash -
   generalised so any dark section can carry it. The ::after gradient
   guarantees text contrast no matter how bright the photograph is.          */
.band { position: relative; background: var(--bg-deep); color: var(--steel); overflow: hidden; isolation: isolate; }
.band__media { position: absolute; inset: 0; z-index: -1; }
.band__media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.38; }
.band__media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(7, 9, 13, 0.96) 0%, rgba(7, 9, 13, 0.78) 45%, rgba(7, 9, 13, 0.4) 100%);
}
.band--even .band__media img { opacity: 0.28; }
.band--even .band__media::after {
  background: linear-gradient(180deg, rgba(7, 9, 13, 0.92) 0%, rgba(7, 9, 13, 0.84) 100%);
}

/* ---------- Hero --------------------------------------------------------- */
.hero { position: relative; background: var(--bg-deep); overflow: hidden; }
.hero__in { position: relative; padding-block: clamp(4.5rem, 13vw, 9.5rem); }
.hero h1 { font-size: var(--step-4); max-width: 17ch; letter-spacing: -0.035em; }
.hero__sub { margin-top: 1.5rem; font-size: var(--step-1); color: var(--steel-dim); max-width: 46ch; line-height: 1.5; }

/* Technical stat strip under the hero */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border-top: 1px solid var(--line-2);
  margin-top: clamp(2.5rem, 6vw, 4rem);
}
.stats__i { padding: 1.6rem 1rem 0 0; position: relative; }
.stats__i::before {
  content: '';
  position: absolute;
  top: -1px; left: 0;
  width: 34px; height: 2px;
  background: var(--accent);
}
.stats__n {
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--steel-bright);
  font-variant-numeric: tabular-nums;
}
.stats__l { font-size: var(--step--1); color: var(--steel-faint); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.25rem; }

/* ---------- Cards / grids ------------------------------------------------ */
.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid--gap { margin-top: clamp(2rem, 5vw, 3.5rem); }

.split { display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } .split--wide { grid-template-columns: 1.15fr 1fr; } }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
/* Machined corner tick, top-right */
.card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 14px; height: 14px;
  border-left: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-panel);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: 0 22px 44px -26px rgba(0, 0, 0, 0.8);
}
.card:hover::after { border-color: var(--accent); background: var(--accent-dim); }

.card__media { background: var(--bg-panel); aspect-ratio: 4 / 3; border-bottom: 1px solid var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: contain; padding: 1.25rem; }
.card__media--photo { position: relative; background: var(--bg-deep); }
.card__media--photo img { object-fit: cover; padding: 0; opacity: 0.88; transition: transform 0.6s var(--ease), opacity 0.4s var(--ease); }
.card__media--photo::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 9, 13, 0) 45%, rgba(7, 9, 13, 0.65) 100%);
}
.card:hover .card__media--photo img { transform: scale(1.05); opacity: 1; }
.card__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.card__tag {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.card__t { font-size: var(--step-1); }
.card__d { color: var(--steel-dim); font-size: var(--step--1); line-height: 1.6; }
.card__link {
  margin-top: auto;
  padding-top: 0.9rem;
  font-weight: 700;
  font-size: var(--step--1);
  text-decoration: none;
  color: var(--steel-bright);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.card__link svg { width: 0.9em; height: 0.9em; color: var(--accent); transition: transform 0.25s var(--ease); }
.card:hover .card__link svg { transform: translateX(4px); }

/* Feature tile (why-choose-us) */
.tile { border-top: 2px solid var(--line-2); padding-top: 1.25rem; transition: border-color 0.3s var(--ease); }
.tile:hover { border-top-color: var(--accent); }
.tile__n {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tile__t { font-size: var(--step-1); margin: 0.5rem 0 0.6rem; }
.tile__t a { text-decoration: none; }
.tile__t a:hover { color: var(--accent); }
.tile__d { color: var(--steel-dim); font-size: var(--step--1); line-height: 1.65; }

/* ---------- Product detail ---------------------------------------------- */
.product { border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 6vw, 4rem); margin-top: clamp(2.5rem, 6vw, 4rem); scroll-margin-top: 96px; }
.product:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.product__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem 1.25rem; }
.product__model {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}
.product__t { font-size: var(--step-2); flex-basis: 100%; }
.product__claim { font-weight: 600; color: var(--steel-bright); margin-top: 0.75rem; }
.product__media { background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius); }
.product__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; padding: 1.5rem; }

/* Spec table - deliberately dense and technical */
.spec { margin-top: 1.75rem; font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.spec caption { text-align: left; font-weight: 700; font-size: var(--step-0); padding-bottom: 0.75rem; letter-spacing: -0.01em; color: var(--steel-bright); }
.spec th, .spec td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec th { width: 42%; font-weight: 600; color: var(--steel-bright); background: var(--surface); }
.spec td { color: var(--steel-dim); }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
.spec tr:hover td { color: var(--steel); }
.spec-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-panel); }

.feat { margin-top: 1.75rem; list-style: none; display: grid; gap: 0.7rem; }
.feat li { position: relative; padding-left: 1.7rem; color: var(--steel-dim); font-size: var(--step--1); line-height: 1.6; }
.feat li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.62em;
  width: 9px; height: 2px;
  background: var(--accent);
}
.feat strong { color: var(--steel-bright); font-weight: 600; }
.feat--tight { margin-top: 0.9rem; gap: 0.45rem; }

/* Sub-heading inside a section */
.sub { font-size: var(--step-1); margin-bottom: 0.4rem; }
.sub--gap { margin-top: 2rem; }

/* Definition list for capabilities: term + one-line explanation */
.deflist { margin-top: 0.9rem; }
.deflist dt {
  font-weight: 600;
  font-size: var(--step-0);
  color: var(--steel-bright);
  padding-top: 0.85rem;
  margin-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.deflist dt:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.deflist dd { margin: 0.25rem 0 0; color: var(--steel-dim); font-size: var(--step--1); line-height: 1.6; }

/* Client roll */
.clients { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.6rem; margin-top: 1.75rem; }
.clients li {
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-2);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--steel);
  background: var(--surface);
  transition: border-color 0.25s var(--ease);
}
.clients li:hover { border-left-color: var(--accent); }

/* Footer strapline */
.ftr__tag {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Gallery ------------------------------------------------------ */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.85rem; }
.gal figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-deep);
  isolation: isolate;
}
.gal img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  opacity: 0.85;
  transition: transform 0.6s var(--ease), opacity 0.4s var(--ease);
}
.gal figure::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 9, 13, 0) 30%, rgba(7, 9, 13, 0.55) 62%, rgba(7, 9, 13, 0.94) 100%);
  transition: opacity 0.4s var(--ease);
}
.gal figure:hover img, .gal figure:focus-within img { transform: scale(1.05); opacity: 1; }

.gal figcaption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 1rem 1.15rem 1.05rem;
  color: var(--steel-bright);
}
.gal__t {
  display: block;
  font-weight: 700;
  font-size: var(--step-0);
  letter-spacing: -0.012em;
  line-height: 1.25;
}
.gal__t::before {
  content: '';
  display: block;
  width: 26px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 0.55rem;
  transform-origin: left center;
  transition: transform 0.4s var(--ease);
}
.gal figure:hover .gal__t::before, .gal figure:focus-within .gal__t::before { transform: scaleX(2.1); }
.gal__d {
  display: block;
  margin-top: 0.3rem;
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--steel-dim);
}

/* ---------- Lightbox ----------------------------------------------------- */
.gal__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  text-align: left;
}

.lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(4, 5, 8, 0.95);
}
.lb[data-open='true'] { display: flex; }
.lb__fig { margin: 0; max-width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 0.9rem; }
.lb__img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  animation: lbin 0.28s var(--ease);
}
@keyframes lbin { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.lb__cap { color: var(--steel-bright); max-width: 70ch; }
.lb__cap .gal__t { font-size: var(--step-1); }
.lb__cap .gal__d { color: var(--steel-dim); }
.lb__close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--steel-bright);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.lb__close:hover { border-color: var(--accent); background: var(--accent-dim); }
.lb__close svg { width: 22px; height: 22px; }
body[data-lb='open'] { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .lb__img { animation: none; }
}

/* ---------- Crossfading showcase ---------------------------------------- */
.showcase { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-deep); isolation: isolate; }
.showcase__stage { position: relative; aspect-ratio: 16 / 10; }
.showcase__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.showcase__slide[data-on='true'] { opacity: 1; }
.showcase__slide img { width: 100%; height: 100%; object-fit: cover; }
.showcase__stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 9, 13, 0.15) 0%, rgba(7, 9, 13, 0.2) 40%, rgba(7, 9, 13, 0.94) 100%);
}
.showcase__cap { position: absolute; inset: auto 0 0 0; z-index: 2; padding: 1.5rem 1.6rem 1.3rem; color: var(--steel-bright); }
.showcase__t { display: block; font-weight: 700; font-size: var(--step-1); letter-spacing: -0.02em; }
.showcase__d { display: block; margin-top: 0.35rem; font-size: var(--step--1); color: var(--steel-dim); max-width: 46ch; line-height: 1.55; }
.showcase__dots { display: flex; gap: 0.45rem; padding: 1rem 1.6rem 1.25rem; background: var(--bg-deep); border-top: 1px solid var(--line); }
.showcase__dot {
  width: 26px;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--line-2);
  cursor: pointer;
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.showcase__dot[aria-selected='true'] { background: var(--accent); transform: scaleY(1.6); }
.showcase__dot:hover { background: var(--steel-dim); }

@media (prefers-reduced-motion: reduce) {
  .showcase__slide { transition: none; }
}

/* ---------- Contact ------------------------------------------------------ */
.contact-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1.1fr; } }

.detail { border-top: 1px solid var(--line); padding: 1.15rem 0; display: flex; gap: 1rem; align-items: flex-start; }
.detail:first-of-type { border-top: 0; }
.detail svg { width: 20px; height: 20px; flex: none; margin-top: 0.28rem; color: var(--accent); }
.detail__l { font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel-faint); }
.detail__v { font-weight: 600; margin-top: 0.15rem; color: var(--steel-bright); }
.detail__v a { text-decoration: none; }
.detail__v a:hover { color: var(--accent); }

/* ---------- Forms -------------------------------------------------------- */
.field { display: grid; gap: 0.4rem; margin-bottom: 1.1rem; }
.field label { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.04em; color: var(--steel-bright); }
.field .req { color: var(--accent); }
.field input, .field textarea, .field select {
  font: inherit;
  font-size: var(--step-0);
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--steel-bright);
  width: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--steel-faint); }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--steel-dim) 50%),
    linear-gradient(135deg, var(--steel-dim) 50%, transparent 50%);
  background-position: calc(100% - 1.3rem) 1.25em, calc(100% - 1rem) 1.25em;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.field textarea { min-height: 150px; resize: vertical; }
.field__err { font-size: var(--step--1); color: var(--err); min-height: 1.2em; }
.field input[aria-invalid='true'], .field textarea[aria-invalid='true'], .field select[aria-invalid='true'] {
  border-color: var(--err);
  background: var(--err-dim);
}

.fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; }
.fieldset legend { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.04em; color: var(--steel-bright); padding: 0; margin-bottom: 0.5rem; }
.radio-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-pill span {
  display: inline-block;
  padding: 0.55rem 1rem;
  font-size: var(--step--1);
  font-weight: 600;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--steel-dim);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.radio-pill input:checked + span { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.radio-pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.form-note { font-size: var(--step--1); color: var(--steel-dim); margin-top: 1rem; line-height: 1.6; }
.form-note a { color: var(--steel); }

.form-narrow { max-width: 560px; margin-top: 1.5rem; }

/* ---------- Footer ------------------------------------------------------- */
.ftr {
  background: var(--bg-deep);
  background-image: var(--grid-motif);
  border-top: 1px solid var(--line);
  color: var(--steel-bright);
  padding-block: clamp(3rem, 7vw, 5rem) 2rem;
}
.ftr__grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ftr__logo img { width: 190px; height: auto; }
.ftr__blurb { color: var(--steel-dim); font-size: var(--step--1); margin-top: 1rem; max-width: 34ch; line-height: 1.7; }
.ftr h3 { font-size: var(--step--1); letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel-bright); margin-bottom: 1rem; }
.ftr ul { list-style: none; display: grid; gap: 0.55rem; }
.ftr a { color: var(--steel-dim); text-decoration: none; font-size: var(--step--1); transition: color 0.2s var(--ease); }
.ftr a:hover { color: var(--accent-2); }
.ftr__social { display: flex; gap: 0.6rem; margin-top: 1.25rem; }
.ftr__social a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--steel-dim);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.ftr__social a:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.ftr__social svg { width: 18px; height: 18px; }
.ftr__base {
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between;
  font-size: var(--step--1); color: var(--steel-faint);
}

/* ---------- Breadcrumb / page head -------------------------------------- */
.phead { background: var(--bg-deep); color: var(--steel); padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2.5rem, 6vw, 4rem); }
.phead h1 { font-size: var(--step-3); max-width: 22ch; }
.phead .lede { margin-top: 1.1rem; }
.crumb { font-family: var(--mono); font-size: var(--step--1); color: var(--steel-faint); margin-bottom: 1rem; letter-spacing: 0.06em; text-transform: uppercase; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--accent-2); }

/* ---------- Image placeholder (LQIP host) -------------------------------- */
.ph { background-color: var(--surface); }

/* =========================================================================
   CNC SECTION COMPONENTS
   ========================================================================= */

/* ---------- Machine park -------------------------------------------------
   Rendered at build time from data/machines.json by {{machines}}.           */
.mpark {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  margin-top: clamp(2rem, 5vw, 3rem);
}
.mpark__cat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.35rem;
  position: relative;
  transition: border-color 0.3s var(--ease);
}
.mpark__cat::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 34px; height: 2px;
  background: var(--accent);
}
.mpark__cat:hover { border-color: var(--line-2); }
.mpark__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin-bottom: 0.9rem; }
.mpark__code {
  flex-basis: 100%;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}
.mpark__t { font-size: var(--step-1); letter-spacing: -0.015em; }
.mpark__count { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--steel-faint); letter-spacing: 0.08em; text-transform: uppercase; }
.mpark__list { list-style: none; display: grid; }
.mpark__m {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
}
.mpark__m:first-child { border-top: 0; }
.mpark__name { font-family: var(--mono); font-weight: 700; color: var(--steel-bright); letter-spacing: 0.02em; white-space: nowrap; }
.mpark__desc { color: var(--steel-dim); text-align: right; }

/* The same park, rendered from the live machine-type list instead of the
   build-time snapshot: one card per TYPE, no model numbers. */
.mpark--types { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.mpark--types .mpark__head { margin-bottom: 0; }
.mtype__d { margin-top: 0.65rem; font-size: var(--step--1); line-height: 1.6; color: var(--steel-dim); }

/* ---------- Process explainer ------------------------------------------- */
.steps { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: clamp(2rem, 5vw, 3rem); counter-reset: step; }
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.6rem;
}
.step::before {
  counter-increment: step;
  content: '0' counter(step);
  display: block;
  font-family: var(--mono);
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.step__t { font-size: var(--step-1); margin-bottom: 0.5rem; }
.step__d { color: var(--steel-dim); font-size: var(--step--1); line-height: 1.6; }
@media (min-width: 1000px) {
  .step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%; right: -0.75rem;
    width: 0.5rem; height: 2px;
    background: var(--line-2);
  }
}

/* ---------- Tolerance table / materials ---------------------------------- */
.tol { display: grid; gap: 0.6rem; margin-top: 1.5rem; }
.tol__row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
}
.tol__band { font-family: var(--mono); font-weight: 700; color: var(--steel-bright); font-size: var(--step-0); white-space: nowrap; }
.tol__d { color: var(--steel-dim); font-size: var(--step--1); line-height: 1.6; }

.mats { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.6rem; margin-top: 1.5rem; }
.mats li {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--steel);
  position: relative;
  padding-left: 1.9rem;
}
.mats li::before {
  content: '';
  position: absolute;
  left: 0.9rem; top: 50%;
  width: 8px; height: 8px;
  margin-top: -4px;
  border: 2px solid var(--accent);
  border-radius: 50%;
}

/* ---------- FAQ ---------------------------------------------------------- */
.faq { margin-top: clamp(1.5rem, 4vw, 2.5rem); max-width: 62rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0.25rem;
  font-weight: 600;
  font-size: var(--step-0);
  color: var(--steel-bright);
  transition: color 0.2s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--accent);
  flex: none;
  width: 1.5rem;
  text-align: center;
  transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent-2); }
.faq .faq__a { padding: 0 0.25rem 1.25rem; color: var(--steel-dim); font-size: var(--step--1); line-height: 1.7; max-width: var(--measure); }
.faq .faq__a a { color: var(--steel); }

/* ---------- Notices / status banners ------------------------------------- */
.notice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--step--1);
  color: var(--steel);
  line-height: 1.6;
}
.notice--err { border-left-color: var(--err); background: var(--err-dim); }
.notice a { color: var(--steel-bright); }

/* ---------- Chat order form ---------------------------------------------- */
/* minmax(0, …) rather than a bare auto/fr track: an auto track grows to its
   content's max-content width, and one text input inside the chat composer is
   enough to push the whole column past a 375px phone. */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 2.5rem); align-items: start; }
@media (min-width: 980px) {
  .order-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .order-side { position: sticky; top: 110px; }
}

.chat {
  position: relative; /* anchors the drag-and-drop overlay */
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat__bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.chat__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.chat__dot--off { background: var(--steel-faint); }
.chat__title { font-weight: 700; font-size: var(--step--1); color: var(--steel-bright); letter-spacing: 0.04em; text-transform: uppercase; }
.chat__sub { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--steel-faint); letter-spacing: 0.08em; }

/* Progress hint: what the engineers still need, ticked off as the chat fills
   the order in. A hint, never a gate - nothing here blocks sending. */
.prog {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  padding: 0.6rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
}
.prog__lead {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel-faint);
}
.prog__steps { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; }
.prog__step {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--steel-faint);
  transition: color 0.3s var(--ease);
}
/* The marker is drawn, not written: an empty ring that fills in, with a tick
   cut from two borders (no glyph, so no font-coverage surprises). JS keeps an
   aria-label in step for anyone who cannot see it. */
.prog__step::before {
  content: '';
  width: 13px;
  height: 13px;
  flex: none;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.prog__step::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 50%;
  width: 3.5px;
  height: 7px;
  margin-top: -5px;
  border: solid var(--bg-panel);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.prog__step.is-done { color: var(--steel-bright); }
.prog__step.is-done::before { border-color: var(--ok); background: var(--ok); }
.prog__step.is-done::after { opacity: 1; }
.prog.is-complete .prog__lead { color: var(--ok); }

.chat__log {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 320px;
  max-height: min(58vh, 560px);
  overflow-y: auto;
  scroll-behavior: smooth;
}

.msg { max-width: 88%; display: grid; gap: 0.3rem; }
.msg__who { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel-faint); }
.msg__body {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-size: var(--step--1);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.msg--ai { align-self: flex-start; }
.msg--ai .msg__body { background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--accent); color: var(--steel); }
.msg--me { align-self: flex-end; text-align: right; }
.msg--me .msg__body { background: var(--surface-2); border: 1px solid var(--line-2); color: var(--steel-bright); text-align: left; }
.msg--sys { align-self: center; max-width: 100%; }
.msg--sys .msg__body { background: transparent; border: 1px dashed var(--line-2); color: var(--steel-faint); font-size: 0.78rem; text-align: center; }
.msg--err .msg__body { border-left: 2px solid var(--err); background: var(--err-dim); color: var(--steel); }

/* Typewriter: caret blinks only while a reply is being revealed, and the whole
   message is a click target that completes it instantly. */
.msg--typing { cursor: pointer; }
.msg__caret {
  display: inline-block;
  width: 0.45em;
  height: 1.02em;
  margin-left: 0.06em;
  vertical-align: -0.18em;
  background: var(--accent);
  animation: caret 1.05s steps(1, end) infinite;
}
@keyframes caret { 0%, 48% { opacity: 1; } 49%, 100% { opacity: 0; } }

/* While typing we drive scrollTop every frame - smooth scrolling would lag
   behind the text and read as the panel fighting the reader. */
.chat__log.is-typing { scroll-behavior: auto; }

/* Attachment chips in the transcript */
.msg--files { align-self: flex-end; }
.msg--files .msg__who { text-align: right; }
.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.45rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.76rem;
  color: var(--steel);
}
.chip svg { width: 0.95rem; height: 0.95rem; flex: none; color: var(--accent); }
.chip__n { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip__s { flex: none; color: var(--steel-faint); }

/* In-chat registration card ------------------------------------------------
   A form that lives inside the transcript, so the details are asked for where
   the visitor already is. It is one item in the message flow, not a modal:
   nothing behind it is blocked and the conversation continues under it.      */
.regcard {
  align-self: stretch;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.1rem;
}
.regcard__head { display: flex; align-items: center; gap: 0.55rem; }
.regcard__head svg { width: 1.15rem; height: 1.15rem; flex: none; color: var(--accent); }
.regcard__t {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--steel-bright);
}
.regcard__lead { margin-top: 0.5rem; font-size: 0.78rem; line-height: 1.6; color: var(--steel-dim); }

.regcard__grid {
  display: grid;
  gap: 0.7rem 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 0.9rem;
}
.regfield { display: grid; gap: 0.3rem; align-content: start; min-width: 0; }
/* The phone helper text spells out four formats - give it room to breathe
   rather than wrapping it into a column two words wide. */
.regfield--phone { grid-column: 1 / -1; }
.regfield label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel-dim);
}
.regfield .req { color: var(--accent); }
.regfield input {
  font: inherit;
  font-size: 0.84rem;
  width: 100%;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--steel-bright);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.regfield input::placeholder { color: var(--steel-faint); }
.regfield input:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-dim); }
.regfield input[aria-invalid='true'] { border-color: var(--err); background: var(--err-dim); }
.regfield__help { font-family: var(--mono); font-size: 0.66rem; line-height: 1.7; color: var(--steel-faint); overflow-wrap: break-word; }
.regfield__err:not(:empty) { font-size: 0.72rem; line-height: 1.5; color: var(--err); }

.regcard__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; margin-top: 1rem; }
.regcard__save {
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.6rem 1.4rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.regcard__save:hover { background: var(--accent-2); }
.regcard__save:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.regcard__save[disabled] { opacity: 0.45; cursor: not-allowed; }
.regcard__status:not(:empty) { font-size: 0.76rem; line-height: 1.5; color: var(--steel-dim); }

/* What replaces the card once the customer is on file. */
.regdone {
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--ok);
  border-radius: var(--radius);
}
.regdone svg { width: 1.1rem; height: 1.1rem; flex: none; color: var(--ok); margin-top: 0.1rem; }
.regdone__t { font-size: 0.82rem; line-height: 1.5; color: var(--steel-bright); }
.regdone__s { margin-top: 0.2rem; font-family: var(--mono); font-size: 0.72rem; color: var(--steel-faint); }

/* Typing indicator */
.typing { display: inline-flex; gap: 5px; padding: 0.9rem 1rem; align-items: center; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--steel-dim); animation: tblink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes tblink { 0%, 70%, 100% { opacity: 0.25; transform: none; } 35% { opacity: 1; transform: translateY(-3px); } }

.chat__composer {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.chat__input {
  flex: 1;
  font: inherit;
  font-size: var(--step--1);
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--steel-bright);
  min-width: 0;
}
.chat__input::placeholder { color: var(--steel-faint); }
.chat__input:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-dim); }
.chat__send {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 1.2rem;
  font: inherit;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.chat__send:hover { background: var(--accent-2); }
.chat__send[disabled] { opacity: 0.45; cursor: not-allowed; }
.chat__send svg { width: 1em; height: 1em; }

/* Upload affordance in words. The paperclip stays in the composer for people
   who know the glyph; this is for everyone else. */
.chat__ease {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
  padding: 0.75rem 1.15rem 0;
  background: var(--surface);
}
.chat__attach {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.45rem 0.8rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--steel);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.chat__attach svg { width: 1rem; height: 1rem; flex: none; color: var(--accent); }
.chat__attach:hover { color: var(--steel-bright); border-color: var(--accent-line); background: var(--accent-dim); }
.chat__attach:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.chat__types { font-family: var(--mono); font-size: 0.68rem; line-height: 1.7; color: var(--steel-faint); }

.chat__hint { padding: 0.5rem 1.15rem 0.9rem; background: var(--surface); font-size: 0.75rem; color: var(--steel-faint); line-height: 1.6; }

/* Quick-reply starter chips under the composer */
.qr {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0.15rem;
  background: var(--surface);
}
.qr__chip {
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg-panel);
  color: var(--steel);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.qr__chip:hover { color: var(--accent); border-color: var(--accent-line); background: var(--surface-2); }
.qr__chip:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* Paperclip: attach without leaving the conversation */
.chat__clip {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--steel-dim);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.chat__clip:hover { color: var(--accent); border-color: var(--accent-line); }
.chat__clip[disabled] { opacity: 0.45; cursor: not-allowed; }
.chat__clip svg { width: 1.15rem; height: 1.15rem; }

/* The close control exists only for the phone's locked chat. */
.chat__close { display: none; }

/* ── Phone chat: one clean column ─────────────────────────────────────────
   Small screens drop everything that is not the conversation: no starter
   chips, no upload-affordance row, no fine print. The composer compacts to
   clip / wide input / round arrow-send. Focusing the input locks the card to
   the whole viewport (chat--locked); with interactive-widget=resizes-content
   in the page's viewport meta, 100dvh ends at the keyboard's top edge, so the
   chat sits exactly between keyboard and top until the X closes it. */
@media (max-width: 700px) {
  /* The progress strip ("Still needed - Part / Quantity / Contact") is a
     desktop luxury; on a phone it ate a row the conversation needed. The
     assistant asks for whatever is missing anyway. */
  .qr, .chat__ease, .chat__hint, .prog { display: none !important; }

  .chat__composer { gap: 0.45rem; padding: 0.6rem; }
  /* 16px: anything smaller makes phone browsers zoom the page on focus. */
  .chat__input { font-size: 16px; padding: 0.65rem 0.85rem; }
  .chat__send {
    width: 2.7rem; height: 2.7rem; padding: 0;
    border-radius: 50%;
  }
  .chat__send-txt { display: none; }
  .chat__send svg { width: 1.2rem; height: 1.2rem; }
  .chat__clip { width: 2.7rem; height: 2.7rem; padding: 0; flex: none; }
  .chat__clip svg { width: 1.05rem; height: 1.05rem; }

  .chat--locked {
    position: fixed;
    inset: 0;
    z-index: 120;   /* above the sticky site header (z 100) */
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  /* Maximised: the transcript takes every pixel between the title bar and the
     composer, so the phone shows the chat and the keyboard and nothing else. */
  .chat--locked .chat__log { flex: 1 1 auto; min-height: 0; max-height: none; padding: 0.9rem 0.9rem 0.6rem; }
  .chat--locked .chat__sub { display: none; }
  .chat--locked .chat__bar { padding: 0.55rem 0.9rem; }
  .chat--locked .chat__close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.1rem; height: 2.1rem; margin-left: auto; padding: 0;
    border: 1px solid var(--line-2); border-radius: 50%;
    background: none; color: var(--steel-bright); cursor: pointer;
  }
  .chat--locked .chat__close svg { width: 1rem; height: 1rem; }
  body.chat-lock { overflow: hidden; }
}

/* Drag-and-drop overlay across the whole chat panel */
.chat__drop {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(7, 9, 13, 0.93);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* the panel underneath stays the drop target */
  transition: opacity 0.15s var(--ease), visibility 0.15s var(--ease);
}
.chat__drop.is-on { opacity: 1; visibility: visible; }
.chat__drop-in { display: grid; justify-items: center; gap: 0.45rem; text-align: center; }
.chat__drop-in svg { width: 2.1rem; height: 2.1rem; color: var(--accent); }
.chat__drop-in strong { font-size: var(--step-1); color: var(--steel-bright); }
.chat__drop-types { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--steel-dim); line-height: 1.8; }

/* Per-file upload progress, sitting between transcript and composer */
.uptray {
  list-style: none;
  display: grid;
  gap: 0.55rem;
  padding: 0.8rem 1rem 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.up { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; font-size: 0.78rem; }
.up__n { flex: 1 1 8rem; min-width: 0; font-family: var(--mono); color: var(--steel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up__s { flex: none; color: var(--steel-faint); }
.up__st { flex: none; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel-dim); }
.up__bar {
  flex: 1 0 100%;
  width: 100%;
  height: 3px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: var(--line-2);
  color: var(--accent);
}
.up__bar::-webkit-progress-bar { background: var(--line-2); }
.up__bar::-webkit-progress-value { background: var(--accent); }
.up__bar::-moz-progress-bar { background: var(--accent); }
.up--err .up__st { color: var(--err); }
.up--err .up__bar::-webkit-progress-value { background: var(--err); }
.up--err .up__bar::-moz-progress-bar { background: var(--err); }
.up__retry {
  font: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--err);
  border-radius: var(--radius);
  background: transparent;
  color: var(--err);
  cursor: pointer;
}
.up__retry:hover { background: var(--err-dim); }

/* Drop zone + file chips */
.drop {
  margin-top: 1rem;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 1.15rem;
  text-align: center;
  font-size: var(--step--1);
  color: var(--steel-dim);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.drop:hover, .drop:focus-visible { border-color: var(--steel-dim); }
.drop.is-over { border-color: var(--accent); background: var(--accent-dim); color: var(--steel-bright); }
.drop strong { color: var(--steel-bright); }
.drop__meta { display: block; margin-top: 0.3rem; font-size: 0.74rem; color: var(--steel-faint); line-height: 1.6; }

.files { list-style: none; display: grid; gap: 0.45rem; margin-top: 0.75rem; }
.files li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--steel);
}
.files .file__name { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .file__size { color: var(--steel-faint); flex: none; }
.files .file__st { margin-left: auto; flex: none; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.files .file__st--up { color: var(--steel-faint); }
.files .file__st--ok { color: var(--ok); }
.files .file__st--err { color: var(--err); }

/* Collected order fields panel */
.osum {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.osum__head {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--steel-bright);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.osum__head svg { width: 1.1em; height: 1.1em; color: var(--accent); }
.osum__list { list-style: none; padding: 0.5rem 1.15rem 0.9rem; display: grid; }
.osum__row {
  display: grid;
  grid-template-columns: minmax(90px, 40%) 1fr;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  align-items: baseline;
}
.osum__row:first-child { border-top: 0; }
.osum__l { color: var(--steel-faint); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.7rem; font-family: var(--mono); }
.osum__v { color: var(--steel-faint); overflow-wrap: break-word; }
.osum__v:empty::after, .osum__v[data-empty='true']::after { content: '\2014'; color: var(--steel-faint); }
.osum__row.is-set .osum__v { color: var(--steel-bright); font-weight: 600; }
.osum__row.is-set .osum__l { color: var(--accent); }
.osum__note { padding: 0.75rem 1.15rem 1rem; font-size: 0.75rem; color: var(--steel-faint); border-top: 1px solid var(--line); line-height: 1.6; }

/* Done / tracking panel */
.done {
  text-align: center;
  padding: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 4vw, 2.5rem);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.done__badge {
  width: 64px; height: 64px;
  margin: 0 auto 1.25rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--ok);
  border-radius: 50%;
  color: var(--ok);
}
.done__badge svg { width: 30px; height: 30px; }
.done h2, .done h3 { font-size: var(--step-2); }
.done p { margin-top: 0.75rem; color: var(--steel-dim); max-width: 52ch; margin-inline: auto; }
.done .btn-row { justify-content: center; }
.done__link {
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--steel-dim);
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
}
.done__link a { color: var(--accent-2); }

/* Loading splash for app pages */
.app-loading { display: grid; place-items: center; gap: 1rem; padding: clamp(3rem, 8vw, 5rem) 1rem; text-align: center; color: var(--steel-dim); }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--line-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

[hidden] { display: none !important; }

/* ---------- Tracking timeline -------------------------------------------- */
.torder { margin-bottom: 1.5rem; }
.torder__ref { font-family: var(--mono); color: var(--accent); font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase; }
.torder__meta { margin-top: 0.4rem; color: var(--steel-dim); font-size: var(--step--1); }

.tl { list-style: none; display: grid; margin-top: clamp(1.5rem, 4vw, 2rem); }
.tl__i { position: relative; padding: 0 0 1.9rem 2.6rem; }
.tl__i:last-child { padding-bottom: 0; }
/* Connector */
.tl__i::before {
  content: '';
  position: absolute;
  left: 10px; top: 26px; bottom: 4px;
  width: 2px;
  background: var(--line-2);
}
.tl__i:last-child::before { display: none; }
/* Node */
.tl__i::after {
  content: '';
  position: absolute;
  left: 2px; top: 3px;
  width: 14px; height: 14px;
  border: 3px solid var(--line-2);
  border-radius: 50%;
  background: var(--bg);
}
.tl__i.is-done::after { border-color: var(--accent); background: var(--accent); }
.tl__i.is-done::before { background: var(--accent-line); }
.tl__i.is-now::after { border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 4px var(--accent-dim); }
.tl__t { font-weight: 700; color: var(--steel-faint); font-size: var(--step-0); letter-spacing: 0.02em; }
.tl__i.is-done .tl__t, .tl__i.is-now .tl__t { color: var(--steel-bright); }
.tl__d { margin-top: 0.2rem; color: var(--steel-dim); font-size: var(--step--1); line-height: 1.6; max-width: 52ch; }
.tl__at { display: block; margin-top: 0.2rem; font-family: var(--mono); font-size: 0.72rem; color: var(--steel-faint); letter-spacing: 0.06em; }

/* Final price panel */
.price {
  margin-top: clamp(1.5rem, 4vw, 2rem);
  padding: 1.5rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}
.price__l { font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel-dim); }
.price__v { font-size: var(--step-2); font-weight: 700; color: var(--steel-bright); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.price .btn { margin-left: auto; }
@media (max-width: 560px) { .price .btn { margin-left: 0; flex-basis: 100%; } }

/* Accept-the-quote panel */
.accept {
  margin-top: clamp(1rem, 3vw, 1.4rem);
  padding: 1.4rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
.accept__lead { color: var(--steel); font-size: var(--step--1); line-height: 1.6; max-width: 60ch; }
.accept .btn { margin-top: 1rem; }
.accept__note { margin-top: 1rem; color: var(--steel-dim); font-size: var(--step--1); line-height: 1.6; }
.accept__note--err { color: var(--err); }

/* ---------- Motion ------------------------------------------------------- */
.rise { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.rise.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html, .chat__log { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .rise { opacity: 1; transform: none; }
  .btn:hover, .card:hover, .gal figure:hover img { transform: none; }
}

/* ---------- Print -------------------------------------------------------- */
@media print {
  .hdr, .ftr, .btn-row, .burger, .chat__composer, .chat__drop, .uptray, .drop { display: none; }
  body { color: #000; background: #fff; }
  .section { padding-block: 1rem; }
}
