/* Stratum — base.
   Reset, element defaults, and the plane vocabulary every other sheet builds on.
   No colour or size is written literally here; everything reads a token printed
   by inc/tokens.php. */

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

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

body {
  margin: 0;
  background: var(--stx-substrate);
  color: var(--stx-fg);
  font-family: var(--stx-font-body);
  font-size: var(--stx-fs-md);
  line-height: var(--stx-line-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

a:hover { text-decoration-color: currentColor; }

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

/* ---------------------------------------------------------------- headings */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--stx-font-display);
  font-weight: var(--stx-weight-display);
  letter-spacing: var(--stx-track-display);
  line-height: 1.03;
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: var(--stx-fs-3xl); }
h2 { font-size: var(--stx-fs-2xl); }
h3 { font-size: var(--stx-fs-xl); }
h4 { font-size: var(--stx-fs-lg); }

p { margin: 0 0 1.1em; }

/* Utility type — kickers, meta, figures. Monospaced by default because a
   markets publication prints a lot of numbers, and figures that do not shift
   width as they update are easier to read down a column. */

.stx-kicker,
.stx-meta,
.stx-byline,
.stx-sechead__eyebrow,
.stx-archhead__eyebrow,
.stx-strip {
  font-family: var(--stx-font-utility);
  font-size: var(--stx-fs-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.4;
}

.stx-kicker {
  display: inline-block;
  color: var(--stx-z3);
  text-decoration: none;
  margin-bottom: .5rem;
}

.stx-kicker:hover { color: var(--stx-z1); }

.stx-meta,
.stx-byline { color: var(--stx-fg-dim); }

.stx-meta__link,
.stx-byline__author { color: var(--stx-fg-mid); text-decoration: none; }
.stx-meta__link:hover,
.stx-byline__author:hover { color: var(--stx-z1); }

.stx-meta__sep,
.stx-byline__sep { margin: 0 .5em; opacity: .5; }

/* ------------------------------------------------------------------ planes */
/* A plane is the theme's unit of elevation. Plane 1 is nearest the reader.
   Sections, cards and widgets all pick a plane rather than a background colour,
   which is what keeps the depth reading consistent when the palette changes. */

.stx-plane { background: var(--stx-plane1); }
.stx-plane--1 { background: var(--stx-plane1); }
.stx-plane--2 { background: var(--stx-plane2); }
.stx-plane--3 { background: var(--stx-plane3); }

.stx-plane--pad {
  padding: clamp(1.1rem, 2.4vw, 1.8rem);
  border-radius: var(--stx-radius);
  border: 1px solid var(--stx-hairline);
}

/* ---------------------------------------------------------------- wrappers */

.stx-wrap {
  width: min(100% - 2.4rem, var(--stx-container));
  margin-inline: auto;
}

.stx-main { display: block; min-height: 40vh; }

.stx-section { padding-block: var(--stx-gap-section); }

/* A run of sections on the same plane would read as one long block, so
   consecutive same-plane sections lose the doubled padding between them. */
.stx-section + .stx-section.stx-plane--1 { padding-top: 0; }
.stx-plane--2 + .stx-plane--2.stx-section,
.stx-plane--3 + .stx-plane--3.stx-section { padding-top: 0; }

/* ------------------------------------------------------------ accessibility */

.screen-reader-text {
  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;
  border: 0;
}

.stx-skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 999;
  padding: .7rem 1rem;
  background: var(--stx-z1);
  color: var(--stx-substrate);
  border-radius: var(--stx-radius-sm);
  font-family: var(--stx-font-utility);
  font-size: var(--stx-fs-xs);
  text-transform: uppercase;
  letter-spacing: .08em;
  text-decoration: none;
  transition: top .2s ease;
}

.stx-skip:focus { top: 1rem; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--stx-z1);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --------------------------------------------------------------- selection */

::selection {
  background: color-mix(in srgb, var(--stx-z1) 40%, transparent);
  color: var(--stx-fg);
}

/* ----------------------------------------------------------------- figures */

.stx-img { width: 100%; height: 100%; object-fit: cover; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
