/* B&B TechnoSolutions — industrial workholding
   WCAG 2.2 AA: contrast, focus, motion, semantics supported in HTML */

:root {
  --bg: #161414;
  --bg-2: #1c1919;
  --bg-3: #221e1e;
  --bg-4: #2a2525;
  --line: #3a3333;
  --line-2: #5a5050;
  --red: #c8102e;
  --red-hover: #e31b3a;
  --red-deep: #8e0b20;
  --text: #f3efeb;
  --muted: #c9c0b8;
  --steel: #a39890;
  --paper: #efe8df;
  --white: #ffffff;
  --focus: #ffd166;
  --ok: #3dd68c;
  --err: #ff6b6b;
  --font: "Barlow", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --mono: "Roboto Mono", "Consolas", "Courier New", monospace;
  --max: 1120px;
  --header-h: 4.25rem;
  --radius: 0;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #ffb4bc;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--white);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 1000;
  background: var(--focus);
  color: #111;
  font-weight: 700;
  padding: 0.65rem 1rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

.wrap {
  width: min(var(--max), calc(100% - 1.5rem));
  margin-inline: auto;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 0.75rem;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--white);
  min-height: 44px;
  min-width: 0;
  flex: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.brand img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  object-fit: contain;
  background: transparent;
}

.brand-tag {
  font-size: 0.8rem;
  color: var(--muted);
}

.nav-toggle {
  display: none;
  min-width: 48px;
  min-height: 48px;
  flex-shrink: 0;
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line-2);
  font: inherit;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
}

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.7rem;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: 0.04em;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--white);
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--red);
}

.nav-cta {
  background: var(--red);
  color: var(--white) !important;
  margin-left: 0.5rem;
  padding-inline: 0.95rem !important;
}

.nav-cta:hover {
  background: var(--red-hover);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #1a1616;
    border-bottom: 1px solid var(--line);
    z-index: 60;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    padding: 0.5rem 1rem 1rem;
  }

  .site-nav a {
    min-height: 48px;
    font-size: 1.2rem;
  }

  .nav-cta {
    margin: 0.35rem 0 0;
    justify-content: center;
  }
}

/* Hero */
.hero {
  padding: 2.75rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
}

.kicker {
  color: var(--steel);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.12;
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.05rem, 4.2vw, 3.15rem);
  max-width: 18ch;
}

h2 {
  font-size: clamp(1.55rem, 2.6vw, 2rem);
}

h3 {
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}

.lede {
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0 0 1.4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 2.75rem;
  align-items: center;
}

.hero-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0;
}

.hero-panel img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--paper);
}

.hero-caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  color: var(--steel);
  background: var(--bg-3);
  border-top: 1px solid var(--line);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.55rem 1.15rem;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-hover);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: var(--line-2);
}

.btn-ghost:hover {
  border-color: var(--white);
  color: var(--white);
}

.guarantee {
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
  background: var(--bg-2);
}

.guarantee p {
  margin: 0;
  max-width: 48rem;
  color: var(--text);
}

.guarantee strong {
  color: var(--white);
  font-weight: 600;
}

/* Sections */
section {
  padding: 3rem 0;
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 40rem;
}

/* Cards */
.grid-3,
.product-grid {
  display: grid;
  gap: 1.15rem;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.product-grid {
  grid-template-columns: repeat(3, 1fr);
}

.card,
.product-card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.card {
  padding: 1.15rem 1.2rem 1.25rem;
}

.card h3,
.product-card h3 {
  margin-bottom: 0.35rem;
}

.card p,
.product-card p {
  color: var(--muted);
  margin: 0;
}

.product-card:hover {
  border-color: var(--line-2);
}

.product-card:hover h3 {
  color: var(--white);
}

.product-card .thumb {
  background: var(--paper);
  padding: 0.85rem;
  aspect-ratio: 1;
  border-bottom: 1px solid var(--line);
}

.product-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-body {
  padding: 0.95rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.product-code {
  font-size: 0.82rem;
  color: #ffb4bc;
}

.product-cta {
  margin-top: auto;
  padding-top: 0.7rem;
  color: var(--white);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.clients {
  background: var(--bg-2);
  border-block: 1px solid var(--line);
  padding: 2rem 0;
}

.clients p {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
}

.prose {
  max-width: 42rem;
}

.prose p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.page-banner {
  padding: 2.2rem 0 1.6rem;
  border-bottom: 1px solid var(--line);
}

.page-banner h1 {
  max-width: none;
}

/* Product detail */
.detail {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  align-items: start;
}

.detail-media {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.detail h2,
.contact-aside h2 {
  font-size: 1.25rem;
}

.detail-media img {
  width: 100%;
  object-fit: contain;
  max-height: 520px;
  margin-inline: auto;
}

.drawing {
  margin-top: 1rem;
  background: var(--white);
  padding: 0.75rem;
  border: 1px solid var(--line);
}

.meta-list {
  list-style: none;
  margin: 1.2rem 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.meta-list li {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}

.meta-list dt,
.meta-list .label {
  color: var(--steel);
  font-size: 0.92rem;
}

.materials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.2rem 0 1.6rem;
}

.materials article {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
}

.materials h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  color: var(--white);
}

.materials p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.feature-list {
  margin: 0 0 1.4rem;
  padding: 0 0 0 1.15rem;
}

.feature-list li {
  padding: 0.2rem 0;
}

/* Tables */
.table-block {
  margin: 2.5rem 0 1rem;
}

.table-block h2 {
  font-size: 1.8rem;
}

.table-note {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 0.8rem;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  background: var(--bg-3);
  max-width: 100%;
}

.table-hint {
  display: none;
  margin: 0 0 0.5rem;
  color: var(--steel);
  font-size: 0.95rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.9rem;
  min-width: 640px;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  background: var(--bg-3);
  z-index: 1;
  box-shadow: 1px 0 0 var(--line);
}

thead th:first-child {
  background: var(--bg-4);
  z-index: 2;
}

.table-scroll:focus {
  outline-offset: 0;
}

caption {
  text-align: left;
  font-family: var(--font);
  font-weight: 700;
  padding: 0.85rem 1rem;
  background: var(--bg-4);
  caption-side: top;
}

th,
td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

thead th {
  background: var(--bg-4);
  color: var(--text);
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Forms */
.form-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 2rem;
}

.form-card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 1.4rem;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.req {
  color: #ffb4bc;
}

.hint {
  display: block;
  color: var(--steel);
  font-size: 0.92rem;
  font-weight: 400;
  margin-top: 0.2rem;
}

.field {
  margin-bottom: 1rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  border-radius: var(--radius);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.field-error {
  color: var(--err);
  font-size: 0.95rem;
  margin: 0.3rem 0 0;
  min-height: 1.2em;
}

.form-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  display: none;
}

.form-status.is-ok {
  display: block;
  border-color: var(--ok);
  color: #b7f5d4;
}

.form-status.is-err {
  display: block;
  border-color: var(--err);
  color: #ffd0d0;
}

.contact-aside h2 {
  font-size: 2.2rem;
}

.contact-aside p {
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #120f0f;
  padding: 2rem 0 1.2rem;
  margin-top: 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
}

.site-footer h2 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  min-height: 36px;
  align-items: center;
}

.site-footer a:hover {
  color: var(--white);
}

.legal {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--steel);
  font-size: 0.95rem;
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .hero-grid,
  .detail,
  .form-layout,
  .product-grid,
  .footer-grid,
  .materials,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .hero-grid > div {
    order: -1;
  }

  .hero-panel img {
    aspect-ratio: 16 / 10;
    max-height: 240px;
    width: 100%;
  }

  .hero-caption {
    flex-direction: column;
    gap: 0.15rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .detail-media {
    position: static;
  }

  .detail-media img {
    max-height: 280px;
  }

  .meta-list li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .actions .btn {
    flex: 1 1 12rem;
  }

  .table-hint {
    display: block;
  }

  .contact-aside h2 {
    font-size: 1.4rem;
  }

  .table-block h2 {
    font-size: 1.4rem;
  }

  section {
    padding: 2rem 0;
  }

  .hero {
    padding: 1.5rem 0 1.4rem;
  }
}

@media (max-width: 640px) {
  h1 {
    max-width: none;
    font-size: 2rem;
    line-height: 1.15;
  }

  h2 {
    font-size: 1.45rem;
  }

  h3 {
    font-size: 1.2rem;
    font-family: var(--font);
    letter-spacing: 0;
  }

  .lede {
    font-size: 1.08rem;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand-name {
    font-size: 1.05rem;
    white-space: normal;
  }

  .brand-tag {
    display: none;
  }

  .actions {
    flex-direction: column;
  }

  .actions .btn {
    width: 100%;
    min-height: 52px;
    font-size: 1.2rem;
  }

  .form-card {
    padding: 1rem;
  }

  input,
  select,
  textarea {
    font-size: 1.05rem;
  }

  th,
  td {
    padding: 0.7rem 0.8rem;
    font-size: 0.95rem;
  }
}

@media (prefers-contrast: more) {
  body,
  .site-header,
  .card,
  .product-card,
  .form-card,
  .table-scroll {
    background: #000;
  }

  a {
    color: #fff;
    text-decoration: underline;
  }

  .btn-primary {
    background: #ff2a2a;
  }
}
