/* ==========================================================================
   MILEX d.o.o. — BASE
   Reset, element defaults, typography scale, layout containers, utilities.
   No component lives here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ol, ul {
  margin: 0;
  padding: 0;
}

ul[class],
ol[class] { list-style: none; }

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

img { height: auto; }

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

button {
  background: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

a { color: inherit; }

/* Square corners are a brand rule, not a suggestion. */
* { border-radius: var(--radius); }

/* --------------------------------------------------------------------------
   2. Document
   -------------------------------------------------------------------------- */

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Full-bleed decorative bands are clipped by their own sections, but this
     guards against any sub-pixel rounding producing a horizontal scrollbar. */
  overflow-x: clip;
}

/* --------------------------------------------------------------------------
   3. Typography
   Line-height is a universal 1.7 — the single most recognisable trait of the
   reference site's type. Only buttons opt out.
   -------------------------------------------------------------------------- */

h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh);
}

h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: var(--lh);
}

h1 { font-size: var(--fs-h1-page-fluid); }
h2 { font-size: var(--fs-h2-fluid); }
h3 { font-size: var(--fs-h3-fluid); }

p { line-height: var(--lh); }

strong, b { font-weight: 700; }

a {
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

/* --------------------------------------------------------------------------
   4. Focus
   Visible on every interactive element, on light and dark backgrounds alike.
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--milex-blue-light);
  outline-offset: 2px;
}

/* On dark surfaces the navy ring disappears — lift it to paper. */
.u-on-dark :focus-visible,
.c-footer :focus-visible,
.c-preloader :focus-visible {
  outline-color: var(--paper-soft);
}

/* --------------------------------------------------------------------------
   5. Layout
   -------------------------------------------------------------------------- */

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

/* Vertical rhythm between the homepage's major sections. */
.l-section { padding-block: var(--space-section); }
.l-section--tight { padding-block: var(--space-section-tight); }
.l-section--flush-top { padding-top: 0; }

/* A section that hosts a full-bleed decorative band. The band is a child
   positioned against these edges, so no 100vw arithmetic is needed and no
   scrollbar can ever be provoked. */
.l-bleed-host {
  position: relative;
  isolation: isolate;
}

.l-bleed-host > .l-container { position: relative; z-index: 1; }

/* The band itself. Sub-classes set its top/bottom offsets. */
.l-band {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 0;
  background: var(--milex-blue-100);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   6. Utilities
   -------------------------------------------------------------------------- */

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

/* Skip link — visible only once focused. */
.u-skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: calc(var(--z-preloader) + 1);
  padding: 14px 24px;
  background: var(--milex-blue);
  color: var(--paper);
  font-weight: 600;
  font-size: var(--fs-btn);
  text-transform: uppercase;
  letter-spacing: var(--tracking-btn);
  transform: translateY(-120%);
  transition: transform var(--t-fast) var(--ease);
}

.u-skip-link:focus-visible { transform: translateY(0); }

.u-no-scroll { overflow: hidden; }

/* --------------------------------------------------------------------------
   7. Motion preferences
   Every transition in this codebase is timed with one of the --t-* tokens and
   every keyframe animation is registered on .u-animated. Collapsing the tokens
   here therefore disarms all motion site-wide without a single !important.
   -------------------------------------------------------------------------- */

.u-animated { animation-play-state: running; }

@media (prefers-reduced-motion: reduce) {
  :root {
    --t-fast:  .001ms;
    --t-media: .001ms;
    --t-slow:  .001ms;
    --t-hero:  .001ms;
  }

  html { scroll-behavior: auto; }

  .u-animated {
    animation: none;
    animation-play-state: paused;
  }
}
