/* ==========================================================================
   Modern CSS Reset — normalized, accessible, mobile-first defaults
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h, 74px); /* anchored sections land flush beneath the fixed header (height measured in JS) */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-base);
  background-image: url("../assets/images/paper-texture.png");
  background-repeat: repeat;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overflow-wrap: break-word; /* never let a long word (e.g. email) force a sideways scroll */
}

html { overflow-x: clip; }

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* Enforce the hidden attribute over any author display rule (e.g. flex/grid). */
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--color-yellow);
  color: var(--color-ink);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-2);
}
::-webkit-scrollbar-thumb {
  background: rgba(26, 26, 24, 0.22);
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-bg-2);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-yellow-deep);
}

/* Skip-link for keyboard users */
.skip-link {
  position: absolute;
  left: -999px;
  top: var(--space-4);
  z-index: var(--z-overlay);
  padding: var(--space-3) var(--space-5);
  background: var(--color-ink);
  color: var(--color-surface);
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.skip-link:focus {
  left: var(--space-4);
}

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