/* ==========================================================================
   Ubuntu Chemicals — reset, elements, primitives
   ========================================================================== */

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

/* Components below set display on elements we also toggle with [hidden],
   so [hidden] has to win. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  /* Keeps 100vh-ish measurements honest on mobile browsers with a
     collapsing toolbar. */
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  /* Clears the mobile action bar, which is fixed to the bottom. */
  padding-bottom: calc(var(--mbar-h) + var(--safe-b));
  -webkit-tap-highlight-color: transparent;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tr-display);
  line-height: var(--lh-snug);
  text-wrap: balance;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* figure/blockquote carry a 40px UA side margin that quietly breaks
   full-bleed media. dl/dd carry block margins for the same reason. */
figure, blockquote, dl, dd, fieldset { margin: 0; }
fieldset { padding: 0; border: 0; }

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

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button { background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-1);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

::selection {
  background: var(--u-navy-700);
  color: #fff;
}

/* --------------------------------------------------------------- layout --- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: var(--wrap-narrow); }
.wrap--flush { padding-inline: 0; }

.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(48px, 6vw, 88px); }
.section--top-0 { padding-top: 0; }
.section--bottom-0 { padding-bottom: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--sp-5);
}

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

/* Skip link ---------------------------------------------------------------- */
.skip {
  position: absolute;
  left: var(--sp-4);
  top: -80px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-2);
  transition: top var(--dur-1) var(--ease-out);
}
.skip:focus { top: var(--sp-4); }

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

/* ------------------------------------------------------------ typography --- */

/* The expanded width axis is applied in one place, to the display sizes only.
   Add a class here rather than setting font-variation-settings ad hoc. */
.display-1,
.display-2,
.h2,
.hero__title,
.pagehead__title,
.pdp__title,
.division__title,
.sector__t,
.statstrip__num,
.step__n,
.ctaband__t,
.footer__ctat,
.footer__wordmark,
.loader__word {
  font-variation-settings: 'wdth' var(--wdth-display);
}

.display-1 {
  font-size: var(--fs-display-1);
  line-height: var(--lh-tight);
  font-weight: 800;
}

.display-2 {
  font-size: var(--fs-display-2);
  line-height: 1.02;
  font-weight: 800;
}

.h2 { font-size: var(--fs-h2); font-weight: 700; }
.h3 { font-size: var(--fs-h3); font-weight: 700; letter-spacing: -0.018em; }
.h4 { font-size: var(--fs-h4); font-weight: 600; letter-spacing: -0.005em; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
}

.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }

.accent { color: var(--accent); }
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* Eyebrow: index numeral + rule + label. Used to open every major section. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--sp-5);
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
  flex: none;
}

.eyebrow__idx { color: var(--accent); font-weight: 600; }

.on-dark .eyebrow { color: var(--on-dark-3); }

/* A hairline that carries the division colour. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--ink-2);
}

.tag::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--tag-colour, var(--accent));
  flex: none;
}

[data-division='chemicals']  { --tag-colour: var(--div-chemicals); }
[data-division='janitorial'] { --tag-colour: var(--div-janitorial); }
[data-division='washroom']   { --tag-colour: var(--div-washroom); }

/* ---------------------------------------------------------------- dark --- */

.on-dark {
  background: var(--u-navy-800);
  color: var(--on-dark);
}
.on-dark .muted,
.on-dark .lead { color: var(--on-dark-2); }
.on-dark .dim { color: var(--on-dark-3); }
.on-dark hr { border-color: var(--line-dark); }
.on-dark ::selection { background: var(--u-green-500); color: #061024; }

/* --------------------------------------------------------------- motion --- */

/* Scoped to .js so that content is never stranded at opacity 0 when the
   script fails to load. The class is set by an inline script in <head>. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
}
