/* MetalX Engineering Inc, insulation inspection plugs
   Native CSS, no framework. Trust-first industrial B2B.
   Dials: variance 5 / motion 3 / density 5. One accent (brand blue), 8px radius everywhere. */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f6f8;
  --surface: #fcfcfd;
  --surface-2: #eceef2;
  --text: #17191f;
  --muted: #4f5561;
  --line: #dfe2e8;
  --line-strong: #c9cdd6;
  --accent: #0f4c86;
  --accent-hover: #0c3f70;
  --accent-soft: #e4edf7;
  --on-accent: #f7f9fc;
  --focus: #0f4c86;
  --ok: #1f6b3a;
  --ok-soft: #e3f2e8;
  --err: #a12b2b;
  --err-soft: #f9e5e5;
  --shadow: 0 1px 2px rgba(23, 25, 31, 0.06), 0 8px 24px rgba(23, 25, 31, 0.06);
  --radius: 8px;
  --nav-h: 72px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;
    --surface: #171a22;
    --surface-2: #1d212b;
    --text: #e8eaf0;
    --muted: #a9b0bd;
    --line: #2a2f3a;
    --line-strong: #3a4050;
    --accent: #8ab4ff;
    --accent-hover: #a6c6ff;
    --accent-soft: #1b2a44;
    --on-accent: #f7f9fc;
    --focus: #8ab4ff;
    --ok: #7fd39a;
    --ok-soft: #14301f;
    --err: #ff9a9a;
    --err-soft: #3a1717;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #171a22;
  --surface-2: #1d212b;
  --text: #e8eaf0;
  --muted: #a9b0bd;
  --line: #2a2f3a;
  --line-strong: #3a4050;
  --accent: #8ab4ff;
  --accent-hover: #a6c6ff;
  --accent-soft: #1b2a44;
  --on-accent: #f7f9fc;
  --focus: #8ab4ff;
  --ok: #7fd39a;
  --ok-soft: #14301f;
  --err: #ff9a9a;
  --err-soft: #3a1717;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* Buttons keep a solid, readable fill in both modes */
:root { --btn-bg: #0f4c86; --btn-bg-hover: #0c3f70; --btn-text: #f7f9fc; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --btn-bg: #2f6bd0; --btn-bg-hover: #4079dc; --btn-text: #f7f9fc; }
}
:root[data-theme="dark"] { --btn-bg: #2f6bd0; --btn-bg-hover: #4079dc; --btn-text: #f7f9fc; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 1.3rem + 2.2vw, 2.8rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p, li, dd, td, th { max-width: 68ch; }
.muted { color: var(--muted); }
.lede { font-size: 1.125rem; color: var(--muted); max-width: 52ch; }
strong { font-weight: 600; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 12px; vertical-align: top; }
thead th { font-weight: 600; color: var(--muted); font-size: 0.85rem; border-bottom: 1px solid var(--line-strong); }
tbody tr + tr td { border-top: 1px solid var(--line); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.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; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--btn-bg); color: var(--btn-text); padding: 10px 14px; border-radius: var(--radius); z-index: 100; }
.skip-link:focus { top: 12px; }

/* Icons (Tabler outline, inlined) */
.ic { width: 1.25em; height: 1.25em; flex: 0 0 auto; vertical-align: -0.28em; }
.ic-lg { width: 28px; height: 28px; }

/* Buttons: one label per intent, one line, high contrast */
.btn {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 12px 20px; border-radius: var(--radius); font-weight: 600; font-size: 0.975rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; line-height: 1.2;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { background: var(--btn-bg-hover); color: var(--btn-text); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--text); color: var(--text); background: var(--surface); }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 24px; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 34px; width: auto; }
.brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo-light { display: none; }
  :root:not([data-theme="light"]) .brand .logo-dark { display: block; }
}
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.nav li { position: relative; }
.nav a, .nav button.sub-toggle {
  display: inline-flex; align-items: center; gap: 4px; padding: 10px 12px; border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.975rem; background: none; border: 0;
  font-family: inherit; cursor: pointer; line-height: 1.2;
}
.nav a:hover, .nav button.sub-toggle:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); }
.nav .sub { position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: none; flex-direction: column; gap: 2px; }
.nav li.open > .sub, .nav li:focus-within > .sub { display: flex; }
@media (hover: hover) { .nav li.has-sub:hover > .sub { display: flex; } }
.nav .sub a { display: block; padding: 10px 12px; font-weight: 500; }
.nav .sub a small { display: block; color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.nav a.nav-cta { margin-left: 8px; background: var(--btn-bg); color: var(--btn-text); font-weight: 600; padding: 10px 16px; }
.nav a.nav-cta:hover { background: var(--btn-bg-hover); color: var(--btn-text); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 8px; color: var(--text); cursor: pointer; }
.nav-toggle .ic { width: 22px; height: 22px; vertical-align: middle; }
.nav-toggle .ic-close { display: none; }
.nav-toggle[aria-expanded="true"] .ic-menu { display: none; }
.nav-toggle[aria-expanded="true"] .ic-close { display: inline; }

/* Sections */
main { display: block; }
.section { padding: 72px 0; }
.section-tint { background: var(--surface-2); }
.section-head { max-width: 64ch; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.section + .section:not(.section-tint) { border-top: 1px solid var(--line); }

/* Hero: asymmetric split, text left, real photo right */
.hero { padding: 48px 0 64px; }
.hero .container { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: 16px; }
.hero .lede { margin-bottom: 28px; }
.hero-media { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-media.contain img { aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }
.breadcrumb { font-size: 0.9rem; color: var(--muted); margin: 0 0 14px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: "/"; color: var(--line-strong); margin-right: 6px; }
.breadcrumb a { color: var(--muted); }

/* Bento: N products, N cells, every cell carries a photo */
.bento { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: auto auto; gap: 20px; }
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: transform 0.2s ease, border-color 0.2s ease; }
.tile:hover { transform: translateY(-2px); border-color: var(--line-strong); color: var(--text); }
.tile-lg { grid-row: 1 / span 2; }
.tile img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.tile-lg img { aspect-ratio: 4 / 3.4; flex: 1; }
.tile-body { padding: 20px 22px 22px; }
.tile-body h3 { margin-bottom: 6px; }
.tile-body p { color: var(--muted); margin: 0 0 12px; font-size: 0.975rem; }
.tile .more { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

/* Wide figure + grouped definition list */
.figure-wide { margin: 0 0 36px; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.figure-wide img { width: 100%; }
.figure-wide figcaption { padding: 12px 16px; font-size: 0.9rem; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); }
.parts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 40px; margin: 0; }
.parts > div { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.parts dt { font-weight: 600; grid-column: 2; }
.parts dd { margin: 0; color: var(--muted); grid-column: 2; }
.parts .num { grid-row: 1 / span 2; grid-column: 1; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }

/* Sizes: tiles, not a table */
.sizes { list-style: none; padding: 0; margin: 0 0 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.sizes li { min-width: 128px; flex: 1 1 128px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.sizes .in { display: block; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.sizes .mm { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.sizes li.custom { background: var(--accent-soft); border-color: transparent; }
.sizes li.custom .in { font-size: 1.1rem; line-height: 1.3; }

/* Spec clusters: grouped chunks with one soft divider each */
.spec-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.spec-group h3 { padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); margin-bottom: 8px; }
.spec-group dl { margin: 0; }
.spec-group dt { font-size: 0.85rem; color: var(--muted); margin-top: 12px; }
.spec-group dd { margin: 0; font-weight: 500; }

/* Split section (used once per page) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.split-media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.split-media.wide { background: #fff; }
.split-media.wide img { aspect-ratio: auto; object-fit: contain; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .ic { color: var(--accent); margin-top: 3px; }

/* Points: 2 x 2, no cards, icons from the library */
.points { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 48px; }
.point { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.point .ic-lg { color: var(--accent); }
.point h3 { font-size: 1.05rem; margin-bottom: 4px; }
.point p { margin: 0; color: var(--muted); }

/* FAQ: native accordion */
.faq { max-width: 800px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font-weight: 600; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--muted); transition: transform 0.2s ease; }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq details > div { padding: 0 0 20px; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }

/* Enquiry: form + contact panel */
.enquiry { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: start; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field { display: grid; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .hint { font-size: 0.85rem; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 11px 12px; transition: border-color 0.2s ease;
}
.field input::placeholder, .field textarea::placeholder { color: #5f6673; opacity: 1; }
:root[data-theme="dark"] .field input::placeholder, :root[data-theme="dark"] .field textarea::placeholder { color: #8b93a3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field input::placeholder, :root:not([data-theme="light"]) .field textarea::placeholder { color: #8b93a3; } }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.field textarea { min-height: 120px; resize: vertical; }
.field .error { display: none; font-size: 0.85rem; color: var(--err); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--err); }
.field.invalid .error { display: block; }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 4px; }
.form-foot .note { font-size: 0.875rem; color: var(--muted); margin: 0; }
.form-status { grid-column: 1 / -1; display: none; padding: 12px 14px; border-radius: var(--radius); font-weight: 500; }
.form-status.show { display: flex; gap: 10px; align-items: flex-start; }
.form-status.ok { background: var(--ok-soft); color: var(--ok); }
.form-status.err { background: var(--err-soft); color: var(--err); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-panel { display: grid; gap: 22px; }
.contact-panel .item { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.contact-panel .item .ic-lg { color: var(--accent); }
.contact-panel .item h3 { font-size: 1rem; margin-bottom: 2px; }
.contact-panel .item p { margin: 0; color: var(--muted); }
.contact-panel .item a { font-weight: 500; }

/* CTA band (product & about pages) */
.cta-band { background: var(--accent-soft); border-radius: var(--radius); padding: 32px; display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
.cta-band h2 { font-size: 1.4rem; margin: 0 0 4px; }
.cta-band p { margin: 0; color: var(--muted); }

/* Related products */
.related { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.related .tile img { aspect-ratio: 16 / 9; }

/* Prose blocks */
.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 48px; }
.two-col ul { margin: 0; padding-left: 20px; }
.two-col li { margin-bottom: 6px; }

/* Datasheet card */
.datasheet { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.datasheet img { border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.datasheet h3 { margin-bottom: 6px; }
.datasheet p { color: var(--muted); margin-bottom: 14px; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 56px 0 28px; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; margin-bottom: 36px; }
.site-footer h3 { font-size: 0.95rem; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer address { font-style: normal; color: var(--muted); }
.site-footer .brand img { height: 30px; margin-bottom: 12px; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; color: var(--muted); font-size: 0.875rem; }

/* Responsive collapse: every multi-column layout declares its fallback */
@media (max-width: 1023px) {
  .hero .container { gap: 32px; }
  .spec-groups { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: var(--nav-h); background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 12px 20px 20px; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav a, .nav button.sub-toggle { width: 100%; justify-content: space-between; padding: 12px; }
  .nav .sub { position: static; display: flex; min-width: 0; box-shadow: none; border: 0; padding: 0 0 6px 12px; background: transparent; }
  .nav .sub a { padding: 9px 12px; }
  .nav .nav-cta { margin: 10px 0 0; justify-content: center; }
  .nav button.sub-toggle { pointer-events: none; color: var(--muted); font-size: 0.85rem; padding-bottom: 4px; }
  .nav button.sub-toggle .ic { display: none; }
  .hero .container, .split, .enquiry, .bento, .related { grid-template-columns: 1fr; }
  .tile-lg { grid-row: auto; }
  .tile-lg img { aspect-ratio: 16 / 10; }
  .hero { padding: 32px 0 48px; }
  .section { padding: 56px 0; }
}
@media (max-width: 767px) {
  .container { padding: 0 16px; }
  .parts, .points, .two-col, .spec-groups, .form-grid, .footer-grid { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .form { padding: 20px; }
  .datasheet { grid-template-columns: 1fr; }
  .datasheet img { max-width: 220px; }
  .cta-band { padding: 24px; }
  .hero-media img { aspect-ratio: 4 / 3; }
  .split-media img { aspect-ratio: 4 / 3; }
  .brand img { height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
