/* ==========================================================================
   MAAC SOLUTIONS — BASE / RESET / TYPOGRAPHY
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-5));
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  color: var(--text-primary);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; background-color: var(--surface-sunken); }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul, ol { list-style: none; padding: 0; }

/* ---- HEADINGS ----------------------------------------------------------- */
h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  text-wrap: balance;
}
.display {
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--tracking-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: 600; }

.lead { font-size: var(--fs-lead); line-height: var(--lh-loose); color: var(--text-secondary); text-wrap: pretty; }
.prose { max-width: var(--prose-max); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }

/* ---- STENCIL LABEL — container marking. Section eyebrows, spec labels. -- */
.stencil {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-stencil);
  text-transform: uppercase;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.stencil::before {
  content: "";
  width: 26px;
  height: var(--stroke-mid);
  background: var(--navy-700);
  flex: none;
}
.stencil--plain::before { display: none; }
.stencil--on-dark { color: var(--text-on-dark-dim); }

/* technical data: SKUs, dimensions, prices — tabular, always mono */
.mono, .spec-value, .price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .22em; }
a:hover { text-decoration-color: currentColor; }

/* ---- FOCUS — visible, never removed ------------------------------------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: var(--stroke-mid) solid var(--navy-700);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; top: 0; left: 0;
  transform: translateY(-120%);
  z-index: var(--z-toast);
  background: var(--ink); color: var(--white);
  padding: var(--space-3) var(--space-5);
  font-weight: 600; text-decoration: none;
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

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

/* ---- LAYOUT PRIMITIVES --------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--wide { max-width: var(--wide-max); }
.section { padding-block: var(--section-y); position: relative; }
.section--dark {
  background: var(--ink);
  color: var(--text-on-dark);
}
.section--dark h2, .section--dark h3, .section--dark .display { color: var(--text-on-dark); }
.section--dark .lead { color: var(--text-on-dark-dim); }
.section--sunken { background: var(--surface-sunken); }

.section-head {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  max-width: 62ch;
}
.section-head--split {
  max-width: none;
  grid-template-columns: 1fr;
  align-items: end;
}
@media (min-width: 900px) {
  .section-head--split { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: var(--space-7); }
  .section-head--split .section-head__aside { justify-self: end; text-align: right; }
}

/* ---- CORRUGATION — the container wall rib, used as a ground texture ------
   Real corrugation is a trapezoidal wave. Kept at very low contrast so it
   reads as material, never as pattern.                                     */
.corrugated {
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 10px,
    color-mix(in srgb, currentColor 4%, transparent) 10px 11px,
    color-mix(in srgb, currentColor 7%, transparent) 11px 13px,
    color-mix(in srgb, currentColor 4%, transparent) 13px 14px,
    transparent 14px 34px
  );
}

/* ---- CORNER CASTING — ISO corner fitting bracket ------------------------- */
.corner-marks { position: relative; }
.corner-marks::before, .corner-marks::after {
  content: ""; position: absolute; width: 13px; height: 13px;
  border: var(--stroke-mid) solid var(--navy-700); pointer-events: none;
}
.corner-marks::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.corner-marks::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ---- MOTION — every reveal degrades to a static, complete layout -------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-reveal) var(--ease-steel),
              transform var(--dur-reveal) var(--ease-steel);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* Author-level display rules (e.g. .product-card{display:flex}) outrank the UA
   [hidden] rule, so toggling el.hidden would not actually hide the element. */
[hidden] { display: none !important; }
