/* =========================================================
   Base: reset, type roles, layout primitives, motion helpers
   Uses tokens.css only.
   ========================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }   /* never scroll sideways, whatever a section measures (clip keeps position: sticky working) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--color-accent); color: var(--ink); }
img, video { display: block; max-width: 100%; }
img { height: auto; }                             /* width/height attributes give the shape; CSS gives the size */
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
h1, h2, h3, h4 { font-weight: inherit; }
ul, ol { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

/* ---------- Scrollbar: slim, rounded, on a clear track ---------- */
::-webkit-scrollbar { width: var(--scrollbar-size); height: var(--scrollbar-size); }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); background-clip: padding-box; border: 2px solid transparent; border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-hover); }
::-webkit-scrollbar-corner { background: transparent; }
/* browsers without the styles above (Firefox) take the standard properties instead */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }
}

.skip { position: fixed; top: -100px; inset-inline-start: var(--space-4); z-index: var(--z-skip); padding: var(--space-2) var(--space-4); background: var(--color-primary); color: var(--color-on-primary); border-radius: var(--radius-sm); }
.skip:focus { top: var(--space-4); }

/* =========================================================
   Type roles — one class per role; components add colour/width only
   ========================================================= */
.t-display-xl { font-size: var(--fs-display-xl); font-weight: var(--fw-semibold); line-height: var(--lh-heading); letter-spacing: var(--tracking-display); }
.t-display    { font-size: var(--fs-display);    font-weight: var(--fw-semibold); line-height: var(--lh-display); letter-spacing: var(--tracking-display); }
.t-h1         { font-size: var(--fs-h1);         font-weight: var(--fw-medium);   line-height: var(--lh-heading); letter-spacing: var(--tracking-heading); }
.t-h2         { font-size: var(--fs-h2);         font-weight: var(--fw-medium);   line-height: var(--lh-heading); letter-spacing: var(--tracking-heading); }
.t-h3         { font-size: var(--fs-h3);         font-weight: var(--fw-medium);   line-height: var(--lh-statement); letter-spacing: var(--tracking-heading); }
.t-h4         { font-size: var(--fs-h4);         font-weight: var(--fw-medium);   line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); }
.t-h5         { font-size: var(--fs-h5);         font-weight: var(--fw-semibold); line-height: var(--lh-snug); letter-spacing: var(--tracking-body); }
.t-lead       { font-size: var(--fs-lead);       font-weight: var(--fw-regular);  line-height: var(--lh-lead); letter-spacing: var(--tracking-body); }
.t-body-lg    { font-size: var(--fs-body-lg);    font-weight: var(--fw-medium);   line-height: var(--lh-body); }
.t-body       { font-size: var(--fs-body);       font-weight: var(--fw-regular);  line-height: var(--lh-body); letter-spacing: var(--tracking-body); }
.t-body-sm    { font-size: var(--fs-body-sm);    font-weight: var(--fw-regular);  line-height: var(--lh-body); letter-spacing: var(--tracking-body); }
.t-label      { font-size: var(--fs-label);      font-weight: var(--fw-semibold); line-height: var(--lh-lead); }
.t-caption    { font-size: var(--fs-caption);    font-weight: var(--fw-semibold); line-height: var(--lh-lead); }
.t-micro      { font-size: var(--fs-micro);      font-weight: var(--fw-semibold); line-height: var(--lh-lead); }

.text-muted  { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); }
.measure     { max-width: 34rem; }                /* comfortable reading width for body copy */

/* =========================================================
   Layout primitives
   ========================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

/* Two equal page columns: the grid every section aligns to */
.split { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--grid-gap); }

/* Rows of equal cards (mission, values, principles) */
.card-grid { display: grid; gap: var(--card-gap); }
.card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Section shell: background from the theme, one vertical rhythm */
.section { position: relative; background: var(--color-bg); padding-block: var(--section-y); }
.section--alt { background: var(--color-bg-alt); }
.section--ruled { border-top: 1px solid var(--color-border); }
.section--compact { padding-block: var(--section-y-sm); }
.section--flush-top { padding-top: 0; scroll-margin-top: var(--section-y); }   /* menu links still land with the usual space above */
.section--flush-bottom { padding-bottom: 0; }

/* Section head
   default  — eyebrow in the left column, title (+ intro) in the right
   --stack  — eyebrow above the title, full width
   --row    — title block left, controls right (dark chapters) */
.section-head {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--grid-gap); align-items: start;
  margin-bottom: var(--section-head-gap);
}
.section-head > .eyebrow { padding-top: var(--space-2); }
.section-head__main { display: flex; flex-direction: column; gap: var(--space-6); align-items: flex-start; }
.section-head--stack { grid-template-columns: minmax(0, 1fr); row-gap: var(--stack-gap); }
.section-head--stack > .eyebrow { padding-top: 0; }
.section-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); }
.section-head--row .section-head__main { gap: var(--space-4); }

@media (max-width: 991px) {
  .split, .section-head, .card-grid--3 { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-6); }
  .card-grid--3 { row-gap: var(--card-gap); }
  .split > :empty { display: none; }
  .section-head > .eyebrow { padding-top: 0; }
  .section-head--row { flex-wrap: wrap; }
}

/* =========================================================
   Motion helpers (populated by main.js)
   ========================================================= */
.line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }   /* masked headline line */
.line > span { display: block; will-change: transform; }
.sw { display: inline-block; }
.js [data-split] { visibility: hidden; }        /* until split; head script reveals it if main.js never runs */
.js [data-words]:not(.is-split), .js [data-words] .w { opacity: .16; }   /* dimmed words, lit one by one on scroll */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
