/* KRITIKAL — reset, typography, layout primitives */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--pit);
  color: var(--ink-invert);
  font-family: var(--body);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;      /* Archivo variable width — expanded, badge-like */
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-lg); letter-spacing: -0.01em; }
h4 { font-size: var(--t-md); font-stretch: 110%; }

p { margin: 0 0 var(--s-2); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

img, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--hivis);
  outline-offset: 3px;
}

::selection { background: var(--hivis); color: var(--on-accent); }

/* --- Layout primitives --- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: var(--wrap-narrow); }

/* Every section is a cabinet in the stack. The hairline at the top is the
   ply seam where one bin sits on the next. */
.cab {
  position: relative;
  padding-block: var(--s-7);
  border-top: 1px solid var(--edge-dark);
}

.cab--light {
  background: var(--cab);
  color: var(--ink);
  border-top-color: var(--edge-light);
}

.cab--dark { background: var(--warnex); }
.cab--pit  { background: var(--pit); }

/* Stencilled label down the left edge of each cabinet, the way a crate is
   marked up so you know what is inside without opening it. */
.cab__mark {
  position: absolute;
  top: var(--s-5);
  left: 0.75rem;
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  color: var(--ink-invert-2);
  opacity: 0.6;
  user-select: none;
  pointer-events: none;
}

.cab--light .cab__mark { color: var(--ink-soft); }

@media (max-width: 900px) {
  .cab__mark { display: none; }
  .cab { padding-block: var(--s-6); }
}

/* --- Type utilities --- */

.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 var(--s-2);
}

.lede {
  font-size: var(--t-md);
  max-width: 56ch;
  color: var(--ink-invert-2);
}

.cab--light .lede { color: var(--ink-soft); }

/* Hi-vis is too light to sit on the cabinet-grey surface at this size */
.cab--light .eyebrow { color: var(--hivis-ink); }

.mono {
  font-family: var(--mono);
  font-size: var(--t-sm);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0; left: 0;
  transform: translateY(-120%);
  background: var(--hivis);
  color: var(--chalk);
  padding: var(--s-1) var(--s-2);
  z-index: 100;
  font-family: var(--mono);
  font-size: var(--t-sm);
}
.skip-link:focus { transform: translateY(0); }

/* --- Motion --- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

@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;
  }
  .reveal { opacity: 1; transform: none; }
}
