/* ============================================================
   ADAMS OMONDI — BASE STYLES
   Reset · Typography · Global element defaults
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body.no-scroll { overflow: hidden; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 6vw, 4.75rem); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.875rem, 4.4vw, 3rem); letter-spacing: -0.03em; }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.125rem, 2vw, 1.375rem); }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p { color: var(--text-secondary); }
p + p { margin-top: 1rem; }

strong, b { font-weight: 600; color: var(--text-primary); }
em, i { font-style: italic; }
small { font-size: 0.875rem; color: var(--text-muted); }

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--brand-primary-hover); }

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

ul, ol { list-style: none; }

hr {
  border: none;
  height: 1px;
  background: var(--border-default);
  margin: 2rem 0;
}

::selection {
  background: var(--brand-primary);
  color: var(--text-inverse);
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 5px;
  border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* 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;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  padding: 12px 20px;
  background: var(--brand-primary);
  color: var(--text-inverse);
  font-weight: 600;
  border-radius: 8px;
  z-index: 9999;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: 16px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Ensure the HTML `hidden` attribute always wins over component display rules */
[hidden] { display: none !important; }