/* ============================================
   KOMPAS4 — Base Styles
   Reset, typography, global elements
   ============================================ */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-relaxed);
  color: var(--gray-900);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── Page Transition ─────────────────────── */
body.menu-open {
  overflow: hidden;
}

/* ─── Images ────────────────────────────────  */
img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ─── Typography ─────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: clamp(2.25rem, 5.5vw, 4rem); font-weight: var(--weight-extrabold); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: var(--weight-semibold); }
h4 { font-size: clamp(1.1rem, 1.8vw, 1.3rem); font-weight: var(--weight-semibold); }

p {
  max-width: 68ch;
}

a {
  color: var(--blue-600);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover {
  color: var(--blue-700);
}

ul, ol {
  list-style: none;
}

/* ─── Container ──────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.container--narrow {
  max-width: 800px;
}

.container--medium {
  max-width: 1024px;
}

/* ─── Sections ───────────────────────────── */
.section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
}

.section--sm {
  padding-top: var(--section-py-sm);
  padding-bottom: var(--section-py-sm);
}

/* Section colour variants */
.section--dark {
  background-color: var(--navy-900);
  color: var(--white);
}

.section--medium {
  background-color: var(--navy-800);
  color: var(--white);
}

.section--light {
  background-color: var(--gray-50);
  color: var(--gray-900);
}

.section--white {
  background-color: var(--white);
  color: var(--gray-900);
}

/* ─── Section Headers ─────────────────────── */
.section-header {
  margin-bottom: var(--s12);
}

.section-header--center {
  text-align: center;
}

.section-header--center p {
  margin-left: auto;
  margin-right: auto;
}

.section-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--blue-400);
  margin-bottom: var(--s4);
}

.section-title {
  margin-bottom: var(--s5);
  color: inherit;
}

.section-subtitle {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary-dark);
}

.section--light .section-subtitle,
.section--white .section-subtitle {
  color: var(--text-secondary-light);
}

.section--light .section-eyebrow,
.section--white .section-eyebrow {
  color: var(--blue-600);
}

/* ─── Grid Utilities ─────────────────────── */
.grid {
  display: grid;
  gap: var(--s8);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
}

/* ─── Flex Utilities ─────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-2 { gap: var(--s2); }
.gap-4 { gap: var(--s4); }
.gap-6 { gap: var(--s6); }
.gap-8 { gap: var(--s8); }

/* ─── Text Utilities ─────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }

.text-sm    { font-size: var(--text-sm); }
.text-lg    { font-size: var(--text-lg); }
.text-xl    { font-size: var(--text-xl); }
.text-2xl   { font-size: var(--text-2xl); }

.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

.text-muted-dark  { color: var(--gray-400); }
.text-muted-light { color: var(--gray-600); }

/* ─── Visually Hidden (accessibility) ────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─── Divider ─────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: var(--s12) 0;
}

.section--dark .divider,
.section--medium .divider {
  border-color: var(--navy-600);
}

/* ─── Focus Styles ───────────────────────── */
:focus-visible {
  outline: 2px solid var(--blue-400);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ─── Selection ──────────────────────────── */
::selection {
  background: var(--blue-100);
  color: var(--navy-900);
}

/* ─── Scrollbar ──────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}
