/* ==========================================================================
   spr.css — TorqueFusion Special Purpose Robots
   ---------------------------------------------------------------------------
   The stage is built to take video. Layers, back to front:

     1  .spr__video    your footage, optional, fills the stage
     2  .spr__grid     a faint reference grid
     3  .spr__svg      the live drawing, drawn by spr.js

   With no video the stage is just the drawing on the page background. Add a
   video and the drawing becomes a telemetry overlay on top of real footage —
   no other change needed.
   ========================================================================== */

.spr {
  display: grid;
  gap: 1px;
  background: var(--steel-dim);
  border: 1px solid var(--steel-dim);
}

.spr__item {
  display: grid;
  grid-template-columns: 1.25fr .95fr;
  gap: 48px;
  align-items: stretch;
  padding: 54px;
  background: var(--void);
  transition: background .5s var(--ease);
}
.spr__item:hover { background: var(--graphite); }
.spr__item--flip { grid-template-columns: .95fr 1.25fr; }
.spr__item--flip .spr__stage { order: 2; }

/* ------------------------------------------------------------------ STAGE */
/* the stage fills the row height; the drawing letterboxes inside it, so the
   two columns stay level however long the description runs */
.spr__stage {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--steel-dim);
  background: #05060700;
  overflow: hidden;
  isolation: isolate;
}

/* 1 — video layer */
.spr__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: .55;              /* keeps the overlay legible over footage */
  filter: grayscale(.35) contrast(1.05);
}

/* 2 — reference grid */
.spr__grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--steel-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--steel-dim) 1px, transparent 1px);
  background-size: 45px 45px;
  opacity: .5;
  -webkit-mask-image: radial-gradient(ellipse 78% 72% at 50% 46%, #000 34%, transparent 82%);
  mask-image: radial-gradient(ellipse 78% 72% at 50% 46%, #000 34%, transparent 82%);
}

/* 3 — the live drawing */
.spr__svg {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: block;
}

/* corner ticks so the stage reads as a viewport */
.spr__stage::before,
.spr__stage::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--page, var(--ice));
  z-index: 4;
  opacity: .8;
  pointer-events: none;
}
.spr__stage::before { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.spr__stage::after { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

/* ------------------------------------------------------------ LINE WEIGHTS */
.spr__svg .s-h   { fill: none; stroke: var(--white); stroke-width: 2; }
.spr__svg .s-l   { fill: none; stroke: var(--white); stroke-width: 1.4; opacity: .6; }
.spr__svg .s-f   { fill: none; stroke: var(--white); stroke-width: 1;   opacity: .34; }
.spr__svg .s-arm { fill: none; stroke: var(--white); stroke-width: 3; stroke-linecap: round; }

.spr__svg .s-ground { stroke: var(--ice); stroke-width: 1.4; opacity: .65; }
.spr__svg .s-hatch  { stroke: var(--ice); stroke-width: 1;   opacity: .3; }
.spr__svg .s-dim    { fill: none; stroke: var(--sage); stroke-width: 1; opacity: .6; }
.spr__svg .s-c      { stroke: var(--sage); stroke-width: .9; opacity: .35;
                      stroke-dasharray: 14 4 3 4; fill: none; }
.spr__svg .s-env    { fill: none; stroke: var(--sage); stroke-width: 1; opacity: .3;
                      stroke-dasharray: 6 6; }
.spr__svg .s-joint  { fill: var(--void); stroke: var(--rust-lt); stroke-width: 2.2; }
.spr__svg .s-fix    { fill: none; stroke: var(--ice); stroke-width: 1.4; opacity: .55; }
.spr__svg .s-part   { fill: none; stroke: var(--sage); stroke-width: 2; }

/* the same function colour code the actuator drawings use */
.spr__svg .fn-fx  * { stroke: var(--ice); }
.spr__svg .fn-in  * { stroke: var(--rust-lt); }
.spr__svg .fn-out * { stroke: var(--sage); }

.spr__svg .s-read {
  font-family: var(--f-mono); font-size: 17px; font-weight: 500;
  letter-spacing: .1em; fill: var(--white);
}
.spr__svg .s-lab {
  font-family: var(--f-mono); font-size: 10.5px;
  letter-spacing: .2em; fill: var(--mist-dim);
}

/* ------------------------------------------------------------------- BODY */
.spr__code {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .22em;
  color: var(--page, var(--ice)); display: block; margin-bottom: 14px;
}
.spr__name {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 2.7vw, 2.3rem);
  font-weight: 800; line-height: 1.03; letter-spacing: -.025em;
  text-transform: uppercase; color: var(--white); margin: 0 0 18px;
}
.spr__name em {
  font-style: normal; color: transparent;
  -webkit-text-stroke: 1.4px var(--page, var(--ice));
}
.spr__lede { font-size: 15px; line-height: 1.72; color: var(--mist); }

.spr__specs {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--steel-dim); border: 1px solid var(--steel-dim);
  margin: 26px 0 0; list-style: none; padding: 0;
}
.spr__specs li {
  background: var(--void); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 5px;
}
.spr__specs b {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--mist-dim); font-weight: 500;
}
.spr__specs span { font-size: 13px; color: var(--white); }

.spr__use { margin-top: 24px; border-top: 1px solid var(--steel-dim); padding-top: 18px; }
.spr__use-h {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--page, var(--ice));
  display: block; margin-bottom: 11px;
}
.spr__use ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.spr__use li { display: flex; gap: 11px; font-size: 13.5px; color: var(--mist); }
.spr__use li::before {
  content: ""; width: 5px; height: 5px; margin-top: 7px; flex: none;
  background: var(--page, var(--ice)); transform: rotate(45deg);
}

/* -------------------------------------------------------------- RESPONSIVE */
@media (max-width: 1000px) {
  .spr__item,
  .spr__item--flip { grid-template-columns: 1fr; gap: 34px; padding: 40px 26px; }
  .spr__stage { min-height: 0; aspect-ratio: 900 / 520; }
  .spr__item--flip .spr__stage { order: 0; }
}
@media (max-width: 560px) {
  .spr__item { padding: 32px 20px; }
  .spr__specs { grid-template-columns: 1fr; }
  .spr__svg .s-read { font-size: 22px; }
  .spr__svg .s-lab { font-size: 14px; }
}

/* ==========================================================================
   ENQUIRY DEEP LINK
   Every "request a quote" / "talk to engineering" button lands on the form
   itself. The nav is fixed, so the target needs clearance or the heading
   hides underneath it.
   ========================================================================== */
#enquiry, #ivision, #spr, #tf60, #tf80 {
  scroll-margin-top: calc(var(--nav-h, 84px) + 34px);
}
@media (max-width: 900px) {
  #enquiry, #ivision, #spr, #tf60, #tf80 { scroll-margin-top: 92px; }
}

/* ==========================================================================
   HERO STATS — a closed frame
   It was a top rule with dividers hanging off it and no right or bottom edge,
   so it read as an unfinished box. Now it is a proper three-cell panel that
   closes on every side, matching the card grids elsewhere on the site.
   ========================================================================== */
.hero__stats {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--steel-dim);
  border: 1px solid var(--steel-dim);
  margin-top: 44px;
}
.hero__stat {
  background: var(--void);
  padding: 20px 20px 18px !important;
  margin: 0 !important;
  border: 0 !important;
  min-width: 0;
  transition: background .35s var(--ease);
}
.hero__stat:hover { background: var(--graphite); }
.hero__stat > b { font-size: 1.6rem; }
.hero__stat > span { line-height: 1.5; }

@media (max-width: 620px) {
  .hero__stats { grid-template-columns: 1fr 1fr; }
  /* the odd cell out spans the full width so the panel still closes square */
  .hero__stat:last-child { grid-column: 1 / -1; }
}

/* ==========================================================================
   RESPONSIVE CONTAINMENT
   The robot decals are placed at percentage offsets with fixed pixel widths,
   so on a narrow screen one sat 177px past the right edge and gave the whole
   document a horizontal scrollbar. overflow-x: clip contains them without
   creating a scroll container, so sticky and fixed positioning are unaffected.
   ========================================================================== */
[data-decal] { overflow-x: clip; }

@media (max-width: 900px) {
  /* and scale them down so they read as watermarks, not obstructions */
  .decal { width: min(38vw, 190px) !important; }
}
@media (max-width: 560px) {
  .decal { width: min(44vw, 150px) !important; opacity: .06; }
}

/* ==========================================================================
   MOBILE ALIGNMENT
   ========================================================================== */
@media (max-width: 620px) {
  /* buttons were ragged because each sized to its own label */
  .btn-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .btn-row .btn { width: 100%; justify-content: center; text-align: center; }
  .cta-block .btn-row { justify-content: stretch; }

  /* keep the section heads on one consistent left edge */
  .sec-head { gap: 20px; }
  .sec-head .lead { max-width: 100%; }

  /* spec tables were running their values into the labels */
  .spec td:first-child { width: 52%; font-size: 9.5px; }
  .spec td:last-child  { font-size: 12px; }

  /* footer columns evenly spaced rather than stacked at random gaps */
  .footer__grid { gap: 34px; }
  .footer__bottom { flex-direction: column; gap: 8px; text-align: left; }
}

/* an eyebrow with no text still drew its rule, leaving a dash floating above
   the headline — hidden by script when the label is empty */
.eyebrow.is-blank { display: none; }

/* ==========================================================================
   FOOTER CONTACT ICONS
   ========================================================================== */
.footer__links a { display: inline-flex; align-items: center; gap: 10px; }
.ficon {
  width: 15px; height: 15px;
  flex: none;
  fill: currentColor;
  opacity: .62;
  transition: opacity .25s var(--ease), color .25s var(--ease);
}
.footer__links a:hover .ficon { opacity: 1; color: var(--page, var(--ice)); }
/* the underline sweep would otherwise run under the icon too */
.footer__links a { background-position: 25px 100%; }

/* the contact list icons were sitting flush against their text */
.checklist a { display: inline-flex; align-items: center; gap: 9px; }
.checklist a .ficon { opacity: .7; }

/* ==========================================================================
   ENQUIRY FORM — status line and spam trap
   ========================================================================== */
.hp {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.form__status {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.6;
  min-height: 1px;
  padding-left: 16px;
  border-left: 2px solid transparent;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.form__status.is-wait { color: var(--mist); border-left-color: var(--steel); }
.form__status.is-ok   { color: var(--sage); border-left-color: var(--sage); }
.form__status.is-err  { color: var(--rust-lt); border-left-color: var(--rust-lt); }
.form button[type=submit][disabled] { opacity: .55; cursor: default; }
