/* Barr Automation — shared styles
   Palette: control-cabinet gray, safety yellow, slate ink, LCD floor display. */
:root {
  --sheet: #FAFBFA;
  --panel: #EEF1EF;
  --cabinet: #D7DCD9;
  --ink: #1D2B33;
  --steel: #4C5A62;
  --rule: #C5CCC8;
  --yellow: #F5B700;
  --yellow-hover: #FFC629;

  --bezel: #2A3337;
  --lcd: #0E1C24;
  --lcd-line: #21394A;
  --lcd-text: #DCE8ED;
  --lcd-dim: #8AA3AE;
  --run: #3DDC84;
  --down: #FF5A4E;
  --setup: #FFB224;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--sheet);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }

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

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

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--yellow); color: var(--ink); padding: 10px 16px; font-weight: 700;
}
.skip:focus { left: 8px; }

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

/* ---------- Type ---------- */
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
h1 {
  font-size: clamp(2.375rem, 4.6vw, 3.625rem);
  line-height: 1.02;
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}
h2 {
  font-size: clamp(1.75rem, 3vw, 2.375rem);
  line-height: 1.1;
  font-weight: 750;
  font-stretch: 112.5%;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
h3 { font-size: 1.25rem; line-height: 1.25; font-weight: 700; margin: 0 0 6px; }
.intro { color: var(--steel); max-width: 40em; margin: 0 0 40px; font-size: 1.125rem; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px;
  border: 2px solid var(--ink); border-radius: 6px;
  background: var(--yellow); color: var(--ink);
  font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--yellow-hover); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(29, 43, 51, 0.07); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.textlink { font-weight: 600; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.textlink:hover { text-decoration-thickness: 2px; }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 251, 250, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 800; font-stretch: 125%;
  font-size: 1.125rem; letter-spacing: -0.01em; white-space: nowrap;
}
.brand svg { width: 13px; height: 26px; flex: none; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; color: var(--steel); }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.site-head .btn { min-height: 40px; padding: 8px 16px; font-size: 0.95rem; white-space: nowrap; }
@media (max-width: 400px) {
  .site-head .wrap { gap: 12px; }
  .brand { font-size: 1rem; }
  .site-head .btn { padding: 8px 12px; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .site-head .btn { margin-left: auto; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--cabinet);
  padding: clamp(48px, 7vw, 88px) 0 clamp(56px, 8vw, 96px);
  border-bottom: 1px solid #BFC6C2;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}
.lede { font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); max-width: 34em; margin: 0 0 32px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.reassure { margin: 20px 0 0; color: #3F4C53; font-size: 0.95rem; }
@media (max-width: 920px) { .hero .wrap { grid-template-columns: 1fr; } }

/* ---------- Floor display (hero visual) ---------- */
.board-wrap { margin: 0; }
.board {
  background: var(--lcd);
  color: var(--lcd-text);
  border: 12px solid var(--bezel);
  border-radius: 14px;
  padding: 16px 18px 18px;
  box-shadow: 0 24px 48px -24px rgba(14, 28, 36, 0.6), 0 2px 0 rgba(255, 255, 255, 0.35);
  font-stretch: 87.5%;
  font-size: 1rem;
}
.board-top {
  display: flex; justify-content: space-between; gap: 12px;
  color: var(--lcd-dim); font-size: 0.85rem;
  padding-bottom: 12px; border-bottom: 1px solid var(--lcd-line);
}
.board-oee {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 20px;
  padding: 14px 0; border-bottom: 1px solid var(--lcd-line);
}
.oee-big {
  font-size: 3.25rem; line-height: 0.9; font-weight: 700; font-stretch: 75%;
  font-variant-numeric: tabular-nums;
}
.oee-big + p { margin: 0; color: var(--lcd-dim); font-size: 0.85rem; line-height: 1.3; }
.apq { display: flex; gap: 16px; margin: 0 0 0 auto; }
.apq div { text-align: right; }
.apq dt { color: var(--lcd-dim); font-size: 0.75rem; }
.apq dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.machines { list-style: none; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--lcd-line); }
.m {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  column-gap: 12px; align-items: center;
  padding: 8px 6px;
}
.m + .m { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.led {
  grid-row: 1 / 3; width: 10px; height: 10px; border-radius: 50%;
  background: var(--run); box-shadow: 0 0 8px var(--run);
}
.m.down { background: rgba(255, 90, 78, 0.1); border-radius: 4px; }
.m.down .led { background: var(--down); box-shadow: 0 0 10px var(--down); }
.m.setup .led { background: var(--setup); box-shadow: 0 0 8px var(--setup); }
.m .name { grid-column: 2; font-weight: 600; line-height: 1.25; }
.m .state { grid-column: 2; font-size: 0.8rem; color: var(--lcd-dim); line-height: 1.3; }
.m.down .state { color: #FF9C94; }
.m.setup .state { color: #FFC970; }
.count {
  grid-column: 3; grid-row: 1 / 3; text-align: right;
  font-size: 1.5rem; line-height: 1.05; font-weight: 600; font-stretch: 75%;
  font-variant-numeric: tabular-nums;
}
.count small {
  display: block; font-size: 0.7rem; font-weight: 400; font-stretch: 100%;
  color: var(--lcd-dim);
}
.reasons { padding-top: 12px; }
.reasons > p { margin: 0 0 4px; color: var(--lcd-dim); font-size: 0.8rem; }
.reason {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px;
  font-size: 0.85rem; margin-top: 6px;
}
.reason span:last-of-type { font-variant-numeric: tabular-nums; color: var(--lcd-dim); }
.bar { grid-column: 1 / -1; height: 6px; margin-top: 3px; background: var(--lcd-line); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--setup); border-radius: 3px; }
.board-wrap figcaption { margin-top: 12px; color: #3F4C53; font-size: 0.875rem; }

@media (prefers-reduced-motion: no-preference) {
  .m.down .led { animation: blink 1.2s steps(1) infinite; }
}
@keyframes blink { 50% { opacity: 0.2; box-shadow: none; } }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
[id] { scroll-margin-top: 72px; }
.section.alt { background: var(--panel); }

/* Services as a rate sheet */
.offers { border-top: 3px solid var(--ink); }
.offer {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 16px 56px;
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
}
.price {
  font-size: 1.75rem; line-height: 1.15; font-weight: 750; font-stretch: 112.5%;
  font-variant-numeric: tabular-nums; margin: 6px 0 0;
}
.price span { display: block; font-size: 1rem; font-weight: 600; font-stretch: 100%; color: var(--steel); }
.pitch { margin: 10px 0 0; color: var(--steel); }
.offer-body p { max-width: 62ch; }
.checks { margin: 0 0 24px; padding-left: 1.15em; max-width: 62ch; }
.checks li { margin-bottom: 4px; }
.checks li::marker { color: var(--steel); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
@media (max-width: 760px) { .offer { grid-template-columns: 1fr; padding: 28px 0; } }

/* How a project runs: a real sequence, so it's numbered */
.steps {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px;
}
.steps li { border-top: 4px solid var(--ink); padding-top: 14px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block; margin-bottom: 8px;
  font-size: 2.25rem; line-height: 1; font-weight: 800; font-stretch: 75%;
}
.steps h3 { font-size: 1.0625rem; }
.steps p { margin: 0; color: var(--steel); font-size: 0.975rem; }
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; gap: 24px; } }

/* Tooling */
.tool-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.tool-cols ul { margin: 0 0 8px; padding-left: 1.15em; }
.tool-cols li { margin-bottom: 6px; }
.rates {
  margin: 0 0 24px; border: 2px solid var(--ink); border-radius: 6px; background: #fff;
}
.rates div { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 18px; }
.rates div + div { border-top: 1px solid var(--rule); }
.rates dt { font-weight: 600; }
.rates dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.rates dd small { display: block; font-weight: 400; color: var(--steel); font-size: 0.875rem; }
.small-note { color: var(--steel); font-size: 0.95rem; margin-top: 16px; }
@media (max-width: 820px) { .tool-cols { grid-template-columns: 1fr; gap: 32px; } }

/* Photo slots: each figure removes itself if its image file is missing */
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.photos:not(:has(figure)) { display: none; }
.photos figure, .work-item figure { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--panel); }
.photos img, .work-item img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .photos { grid-template-columns: 1fr 1fr; } }

/* Work */
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.work-item { border-top: 3px solid var(--ink); padding-top: 18px; }
.work-item figure { margin-bottom: 16px; }
.work-item p { color: var(--steel); margin: 0; }
@media (max-width: 820px) { .work-grid { grid-template-columns: 1fr; gap: 32px; } }

/* About */
.about-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.portrait {
  position: relative; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden;
  background: var(--ink); color: var(--yellow);
  display: grid; place-items: center;
  font-size: 3.5rem; font-weight: 800; font-stretch: 125%;
}
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.about-text { max-width: 64ch; }
.background { margin: 24px 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.background li { display: grid; grid-template-columns: 10rem 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.background li span:first-child { color: var(--steel); }
@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .portrait { width: 150px; font-size: 2.75rem; }
  .background li { grid-template-columns: 1fr; gap: 0; }
}

/* FAQ */
.faq-list { border-top: 3px solid var(--ink); max-width: 820px; }
.faq-list details { border-bottom: 1px solid var(--rule); }
.faq-list summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 20px 44px 20px 0; font-weight: 650; font-size: 1.125rem; line-height: 1.35;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; position: absolute; right: 8px; top: 50%;
  width: 16px; height: 16px; margin-top: -8px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat;
}
@media (prefers-reduced-motion: no-preference) { .faq-list summary::after { transition: transform 0.2s ease; } }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { color: var(--steel); max-width: 64ch; margin: -4px 0 22px; }

/* Contact */
.contact { background: var(--cabinet); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.95rem; }
.opt { font-weight: 400; color: #3F4C53; }
.form input, .form select, .form textarea {
  font: inherit; color: var(--ink); width: 100%;
  background: #fff; border: 2px solid #9AA6A0; border-radius: 6px;
  padding: 10px 12px; min-height: 48px;
}
.form textarea { min-height: 120px; resize: vertical; }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 1px; border-color: var(--ink);
}
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.status { margin: 0; font-weight: 600; }
.status.err { color: #8E1B12; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.direct { border-top: 3px solid var(--ink); padding-top: 18px; }
.direct h3 { font-size: 1.0625rem; margin-top: 22px; }
.direct h3:first-child { margin-top: 0; }
.direct p { margin: 0; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

/* Footer */
.site-foot { background: var(--ink); color: #C3CDD2; padding: 40px 0 44px; font-size: 0.95rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 48px; }
.site-foot .brand { color: #fff; margin-bottom: 6px; }
.site-foot p { margin: 0; max-width: 40ch; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: flex-start; }
.foot-links a { color: #fff; text-underline-offset: 4px; }
.site-foot :focus-visible { outline-color: var(--yellow); }

/* Terms page */
.doc { max-width: 720px; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
.doc h2 { font-size: 1.375rem; margin-top: 40px; font-stretch: 100%; }
.doc .updated { color: var(--steel); }
