/* ==========================================================================
   Base — reset-level element styles and typography
   ========================================================================== */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--etw-header-height) + 16px); }

body {
  font-family: var(--etw-font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--etw-text);
  background: var(--etw-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--etw-font-heading);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--etw-heading);
}
h1, .h1 { font-size: clamp(2rem, 4.5vw + .5rem, 3.5rem); font-weight: 700; letter-spacing: -.02em; }
h2, .h2 { font-size: clamp(1.6rem, 2.5vw + .6rem, 2.35rem); }
h3, .h3 { font-size: clamp(1.25rem, 1.2vw + .9rem, 1.6rem); }
h4, .h4 { font-size: 1.2rem; }
h5, .h5 { font-size: 1.05rem; }

p { margin-bottom: 1rem; }
.lead { font-size: clamp(1.05rem, .6vw + .95rem, 1.25rem); color: var(--etw-text-muted); font-weight: 400; }
.text-muted, .text-secondary { color: var(--etw-text-muted) !important; }

a { color: var(--etw-link); text-decoration: none; transition: color var(--etw-transition); }
a:hover { color: var(--etw-link-hover); }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--etw-cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--etw-cyan); color: var(--etw-navy); }

/* Skip link for keyboard / screen-reader users */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 2000;
  background: var(--etw-surface); color: var(--etw-heading);
  padding: .6rem 1rem; border-radius: var(--etw-radius-sm); box-shadow: var(--etw-shadow);
  font-weight: 600; transition: top var(--etw-transition);
}
.skip-link:focus { top: 1rem; }

/* Smooth theme switch: class is added by js/theme-init.js for ~300ms while toggling (never on first paint). */
html.theme-transition, html.theme-transition *, html.theme-transition *::before, html.theme-transition *::after {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease, fill .25s ease !important;
}

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