/* Accessible static baseline */
@font-face {
  font-family: 'Host Grotesk';
  src: url('../assets/fonts/host-grotesk-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  min-width: 0;
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* Section themes provide a complete static baseline before motion enhancement. */
.theme-light {
  --color-bg: var(--mav-white);
  --color-surface: #EEF2F5;
  --color-text: var(--mav-black);
  --color-text-dim: #526176;
  --color-border: rgba(8, 15, 21, 0.16);
  background-color: var(--color-bg);
  color: var(--color-text);
}

.theme-dark {
  --color-bg: var(--mav-black);
  --color-surface: #0E1520;
  --color-text: var(--mav-white);
  --color-text-dim: var(--slate-grey);
  --color-border: rgba(120, 138, 163, 0.15);
  background-color: var(--color-bg);
  color: var(--color-text);
}

[hidden] { display: none !important; }

main, section, footer { min-width: 0; }

section[id] { scroll-margin-top: 76px; }

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

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

button, select { touch-action: manipulation; }

::selection {
  background-color: var(--color-accent);
  color: var(--mav-white);
}

::-webkit-scrollbar {
  width: 8px;
  background-color: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover { background-color: var(--color-text-dim); }

:focus-visible {
  outline: 2px solid var(--amber-flame);
  outline-offset: 3px;
}

.theme-light :focus-visible,
.nav-on-light :focus-visible {
  outline-color: var(--stormy-teal);
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: 1.1;
  color: var(--color-text);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); line-height: 1.2; }
h3 { font-size: var(--fs-h3); line-height: 1.3; }

p {
  font-size: var(--fs-body);
  color: var(--color-text-dim);
  max-width: 70ch;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration: underline; }
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: var(--space-md);
}

.section-padding,
.section-spacing {
  padding-block: 4rem;
}

svg:not(:root) { overflow: hidden; }

@media (max-width: 768px) {
  .section-padding,
  .section-spacing { padding-block: 2.5rem; }
}

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