/*
 * Essex SDS Hub — base: fonts, reset, typography, layout primitives
 */

@font-face {
  font-family: "GT America";
  src: url("../assets/fonts/GT-America-Standard-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "GT America";
  src: url("../assets/fonts/GT-America-Standard-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "GT America Mono";
  src: url("../assets/fonts/GT-America-Mono-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "GT America Mono";
  src: url("../assets/fonts/GT-America-Mono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
:root[data-simplified="true"] {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 300;
  font-size: clamp(14px, 1.25vw, 20px);      /* XS 16 @1280 */
  line-height: 1.125;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-locked {
  overflow: hidden;
}

h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0;
}
ul, ol {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
img, svg, video {
  display: block;
  max-width: 100%;
}
input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Typography (Text styles, desktop values @1280) ----------
   Sizes scale with the viewport (clamp min ≈ phone, max ≈ 1920).
   Line-heights are the Figma line-height / size ratios. */
.t-title { font-weight: 500; font-size: clamp(40px, 5.625vw, 100px);  line-height: 0.9722222; letter-spacing: -0.03em; }  /* 72/70 -3% */
.t-h1    { font-weight: 500; font-size: clamp(36px, 4.375vw, 76px);   line-height: 0.8928571; letter-spacing: -0.03em; }  /* 56/50 -3% (H1/data numbers) */
.t-menu  { font-weight: 500; font-size: clamp(28px, 3.125vw, 54px);   line-height: 1.05;  letter-spacing: -0.02em; }  /* 40/42 -2% */
.t-h2    { font-weight: 500; font-size: clamp(22px, 2.5vw, 42px);     line-height: 1.0625; letter-spacing: -0.03em; } /* 32/34 -3% */
.t-quote { font-weight: 300; font-size: clamp(22px, 2.5vw, 42px);     line-height: 1.0625; letter-spacing: -0.03em; } /* 32/34 Light */
.t-h3    { font-weight: 500; font-size: clamp(20px, 1.875vw, 32px);   line-height: 1.0833333; letter-spacing: -0.03em; }  /* 24/26 -3% */
.t-s     { font-weight: 300; font-size: clamp(17px, 1.5625vw, 26px);  line-height: 1.2;   letter-spacing: -0.02em; }  /* 20/24 -2% */
.t-s21   { font-weight: 300; font-size: clamp(17px, 1.640625vw, 27px); line-height: 1.1428571; letter-spacing: -0.03em; } /* 21/24 -3% (Our plan) */
.t-xs    { font-weight: 300; font-size: clamp(14px, 1.25vw, 20px);    line-height: 1.125; letter-spacing: -0.015em; } /* 16/18 */
.t-spec  { font-weight: 500; font-size: clamp(11px, 0.9375vw, 15px);  line-height: 1.1666667; letter-spacing: -0.015em; } /* 12/14 */
.t-mono  { font-family: var(--font-mono); font-weight: 300; font-size: 12px; line-height: 12px; letter-spacing: 0; text-transform: uppercase; }
.t-medium { font-weight: 500; }
.t-light  { font-weight: 300; }
.t-muted  { color: var(--fg-muted); }

.link-u {
  text-decoration: underline;
  text-underline-position: from-font;
}
.link-u:hover {
  color: var(--accent-text);
}
/* Health & Wellbeing cross-link — lime, only ever on dark surfaces */
.link-hwb {
  color: var(--link-hwb);
}
.link-hwb:hover {
  text-decoration: underline;
}
:root[data-theme="contrast"] .link-hwb {
  color: #fff;
  text-decoration: underline;
}

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
}
.pad {
  padding-inline: var(--margin);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 8px 12px;
  border-radius: 2px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  translate: 0 -200%;
  transition: translate 0.2s;
}
.skip-link:focus {
  translate: 0 0;
}

/* ---------- Simplified: no motion ---------- */
:root[data-simplified="true"] *,
:root[data-simplified="true"] *::before,
:root[data-simplified="true"] *::after {
  animation: none !important;
  transition: none !important;
}
