/* beTcs Asia-Pacific — site styles
   Layout: test-report rigour. Mono labels like instrument readouts, condensed
   display type, one red band per page, hairline rules instead of boxes. */
:root {
  --paper: #ffffff;
  --ink: #1b1b1b;
  --ink-2: #3a3a3a;
  --muted: #5e5a55;
  --rule: #dcd8d1;
  --panel: #f3f1ed;
  --red: #d22f25;
  --red-text: #b4241b;
  --on-red: #ffffff;
  --plate: #ffffff;
  --focus: #1b1b1b;
  --ok: #2e7d32;
  --display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141312; --ink: #eeeae4; --ink-2: #d2cdc5; --muted: #a59f96;
    --rule: #393632; --panel: #1f1d1b; --red: #d22f25; --red-text: #f2786c;
    --on-red: #ffffff; --plate: #f3f1ed; --focus: #eeeae4; --ok: #7cc47f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141312; --ink: #eeeae4; --ink-2: #d2cdc5; --muted: #a59f96;
  --rule: #393632; --panel: #1f1d1b; --red: #d22f25; --red-text: #f2786c;
  --on-red: #ffffff; --plate: #f3f1ed; --focus: #eeeae4; --ok: #7cc47f; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.05; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.2vw, 3.9rem); font-weight: 750; font-stretch: 78%; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); font-weight: 750; font-stretch: 80%; }
h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 50; }

.label {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--red-text);
}
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.86rem; }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--paper); border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding-block: 18px; }
.brand img { height: 68px; width: auto; }
.site-header.scrolled .wrap { padding-block: 0; }
.site-header.scrolled .brand img { height: 40px; }
@media (max-width: 760px) { .brand img { height: 52px; } .site-header .wrap { padding-block: 12px; } }
.nav-toggle {
  display: none; font: inherit; font-family: var(--mono); font-size: 0.85rem; font-weight: 600;
  background: none; color: var(--ink); border: 1px solid var(--rule); padding: 8px 12px; cursor: pointer;
}
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 10px 12px; color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: 0.95rem;
}
.site-nav a:hover { color: var(--red-text); }
.site-nav a[aria-current="page"] { color: var(--red-text); box-shadow: inset 0 -2px 0 var(--red); }
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px 20px 16px; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .site-nav a[aria-current="page"] { box-shadow: none; }
}

/* Sections */
.section { padding-block: clamp(48px, 7vw, 88px); }
.section + .section { padding-top: 0; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; max-width: 68ch; }
.rule-top { border-top: 1px solid var(--ink); padding-top: 16px; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 12px 20px; font-weight: 700; font-size: 1rem; text-decoration: none;
  border: 2px solid var(--red); background: var(--red); color: var(--on-red); cursor: pointer; font-family: var(--body);
}
.btn:hover { background: #b4241b; border-color: #b4241b; color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

/* Hero */
.hero { padding-block: clamp(32px, 5vw, 64px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hero figure { margin: 0; position: relative; }
.hero figure img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; object-position: 50% 62%; }
.page-hero .wrap { grid-template-columns: minmax(0, 1fr); }
.page-hero .hero-text { max-width: 760px; }
figcaption, .cap {
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin-top: 8px;
}
.hero figcaption { position: absolute; left: 0; bottom: 0; margin: 0; background: #1b1b1b; color: #fff; padding: 6px 10px; }
@media (max-width: 820px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } .hero figure img { aspect-ratio: 4 / 3; } }

/* Stat band */
.band { background: var(--red); color: var(--on-red); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding-block: 28px; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat b { font-family: var(--display); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 750; font-stretch: 80%; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.95rem; line-height: 1.4; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Grids */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); }
.split > * { min-width: 0; }
@media (max-width: 820px) { .split { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 14px; }

.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ticks li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 14px; align-items: start; }
.ticks li::before { content: ""; width: 8px; height: 8px; background: var(--red); margin-top: 0.62em; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.steps > li { counter-increment: step; display: flex; flex-direction: column; gap: 10px; border-top: 2px solid var(--red); padding-top: 14px; min-width: 0; }
.steps > li::before { content: "0" counter(step); font-family: var(--mono); font-size: 0.85rem; font-weight: 600; color: var(--red-text); }
.steps ul { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
@media (max-width: 820px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* Service tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; }
.tile { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--rule); padding-top: 16px; min-width: 0; }
.tile .std { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.tile a.more { font-weight: 700; text-decoration: none; margin-top: 4px; }
@media (max-width: 760px) { .tiles { grid-template-columns: minmax(0, 1fr); } }

/* Case studies */
.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.case { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.case img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.case dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 0.92rem; }
.case dt { color: var(--muted); }
.case dd { margin: 0; }
.case .challenge { border-top: 1px solid var(--rule); padding-top: 12px; color: var(--ink-2); }
@media (max-width: 900px) { .cases { grid-template-columns: minmax(0, 1fr); } .case img { aspect-ratio: 16 / 9; } }

/* Panels */
.panel { background: var(--panel); }
.feature { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 0; background: var(--panel); }
.feature img { width: 100%; height: 100%; object-fit: cover; min-height: 260px; }
.feature .body { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; gap: 14px; justify-content: center; min-width: 0; }
@media (max-width: 820px) { .feature { grid-template-columns: minmax(0, 1fr); } }

/* Clients */
.plate { background: var(--plate); border: 1px solid var(--rule); padding: clamp(20px, 3vw, 32px); }
.logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 24px 28px; align-items: center; }
.logos img { width: 100%; height: 40px; object-fit: contain; filter: grayscale(1); opacity: 0.85; }

/* Lists of projects / labs */
.regions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; }
.regions > div { min-width: 0; }
.regions h3 { margin-bottom: 10px; }
.regions ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.regions li { padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 0.95rem; }
@media (max-width: 760px) { .regions { grid-template-columns: minmax(0, 1fr); } }

.labs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.labs li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.labs b { font-weight: 600; }
.labs span { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
@media (max-width: 760px) { .labs { grid-template-columns: minmax(0, 1fr); } }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); }
th { font-family: var(--mono); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--ink); }
td.code { font-family: var(--mono); font-size: 0.86rem; white-space: nowrap; }

/* Service detail */
.service { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.service > * { min-width: 0; }
.service img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.service.tall img { aspect-ratio: 3 / 4; max-height: 520px; }
@media (max-width: 820px) { .service { grid-template-columns: minmax(0, 1fr); } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-family: var(--mono); font-size: 0.8rem; border: 1px solid var(--rule); padding: 3px 8px; }

/* Accreditation */
.nata { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 32px; align-items: start; }
.nata img { width: 140px; background: #fff; padding: 8px; }
@media (max-width: 600px) { .nata { grid-template-columns: minmax(0, 1fr); } }
.facts { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; }
.facts dt { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); padding-top: 3px; }
.facts dd { margin: 0; }
@media (max-width: 520px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; } .facts dd { margin-bottom: 10px; } }

/* Contact */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field input, .field textarea, .field select {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--muted); padding: 12px; width: 100%; min-height: 48px;
}
.field textarea { min-height: 160px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.form-status { grid-column: 1 / -1; font-weight: 600; min-height: 1.6em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--red-text); }
@media (max-width: 600px) { .form { grid-template-columns: minmax(0, 1fr); } }
.email-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.email-line .addr { font-family: var(--mono); font-size: 1.05rem; user-select: all; }

/* CTA + footer */
.cta { background: var(--red); color: var(--on-red); }
.cta .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; padding-block: 40px; }
.cta h2 { max-width: 22ch; }
.cta p { max-width: 52ch; margin-top: 8px; }
.cta .btn { background: #fff; color: #1b1b1b; border-color: #fff; }
.cta .btn:hover { background: #1b1b1b; color: #fff; border-color: #1b1b1b; }
.site-footer { border-top: 1px solid var(--rule); padding-block: 36px 48px; font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 48px; align-items: start; }
.site-footer .wrap > img { grid-column: 1 / -1; }
.site-footer img { height: 34px; width: auto; }
.site-footer .lines > * { overflow-wrap: anywhere; }
.site-footer .lines { display: flex; flex-direction: column; gap: 4px; }
.site-footer .mono { color: var(--ink); }
.site-footer a { color: var(--ink); }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: no-preference) {
  .btn, .site-nav a { transition: background-color .15s, color .15s, border-color .15s; }
  .brand img { transition: height .25s ease; }
  .site-header .wrap { transition: padding .25s ease; }
}

/* Project gallery */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 20px; }
.gallery li { min-width: 0; }
.gallery a { display: flex; flex-direction: column; gap: 8px; color: var(--ink); text-decoration: none; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--panel); }
.gallery span { font-size: 0.9rem; line-height: 1.35; }
.gallery a:hover span { color: var(--red-text); }
.gallery a:hover img { opacity: 0.88; }

.viewer { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 12, 12, 0.96); color: #fff; }
.viewer::backdrop { background: rgba(12, 12, 12, 0.96); }
.viewer[open] { display: flex; align-items: center; justify-content: center; }
.viewer figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 72px 72px; max-width: 100%; max-height: 100%; }
.viewer img { max-width: 100%; max-height: calc(100vh - 160px); width: auto; height: auto; object-fit: contain; }
.viewer figcaption { font-family: var(--body); font-size: 1rem; color: #fff; text-align: center; max-width: 70ch; }
.v-btn { position: absolute; background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.3); width: 48px; height: 48px; font-size: 28px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.v-btn:hover { background: var(--red); border-color: var(--red); }
.v-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.v-close { top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; }
.v-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.v-next { right: 12px; top: 50%; transform: translateY(-50%); }
.v-count { position: absolute; top: calc(28px + env(safe-area-inset-top, 0px)); left: 20px; margin: 0; color: rgba(255,255,255,0.75); }
@media (max-width: 600px) {
  .viewer figure { padding: 64px 8px 80px; }
  .v-prev, .v-next { top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: none; }
  .v-prev { left: calc(50% - 60px); } .v-next { right: calc(50% - 60px); }
}

.impact-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 32px; }
.impact-photos figure { margin: 0; min-width: 0; }
.impact-photos img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
@media (max-width: 700px) { .impact-photos { grid-template-columns: minmax(0, 1fr); } }
