/* ============================================================
   HOPE DESIGN SYSTEM — reset.css
   v1.4 · May 2026
   Requires: tokens.css (loaded first)
   ============================================================ */

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

/* ----------------------------------------------------------
   HTML / BODY
   ---------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  /* Prevent horizontal scroll/overflow.
     hidden is the widely-supported fallback; clip is preferred because
     it does not create a scroll container (so position:sticky keeps
     working). Browsers that support clip ignore the hidden line above. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--color-text-1);
  background-color: var(--color-bg);
  transition:
    background-color var(--duration-slower) var(--ease-out),
    color            var(--duration-slower) var(--ease-out);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent any rogue element from creating horizontal scroll.
     hidden is the fallback; clip is preferred (doesn't break sticky). */
  overflow-x: hidden;
  overflow-x: clip;
  /* Disable text selection globally */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Restore selection for readable content and form fields */
p, h1, h2, h3, h4, h5, h6,
li, td, th, dt, dd,
blockquote, pre, code,
figcaption, label, span, a,
input, textarea, select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ----------------------------------------------------------
   BASE ELEMENTS
   ---------------------------------------------------------- */
img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
}
a:hover { color: var(--color-link-hover); }
a:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

ul, ol { list-style: none; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: inherit;
  line-height: inherit;
}

p { max-width: 70ch; }

/* ----------------------------------------------------------
   ACCESSIBILITY
   ---------------------------------------------------------- */

/* Skip link — visible on focus only */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-modal);
  background-color: var(--color-bg);
  color: var(--color-text-1);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: var(--border-strong);
  transition: top var(--duration-normal) var(--ease-out);
}
.skip-link:focus {
  top: var(--space-4);
}

/* Visually hidden — accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ----------------------------------------------------------
   TYPOGRAPHY UTILITIES
   ---------------------------------------------------------- */
.text-display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.text-h1 {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.text-h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.text-h3 {
  font-family: var(--font-body);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.4;
}

.text-body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.75;
}

.text-body-sm {
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  line-height: 1.6;
}

.text-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.text-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-body-sm);
}

/* Text colors */
.text-primary   { color: var(--color-text-1); }
.text-secondary { color: var(--color-text-2); }
.text-tertiary  { color: var(--color-text-3); }
.text-solar     { color: var(--color-solar);  }
.text-ancora    { color: var(--color-ancora); }

/* ----------------------------------------------------------
   ENTRANCE ANIMATIONS
   ---------------------------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.animate-in            { animation: fadeUp var(--duration-slower) var(--ease-out) both; }
.animate-in--delay-1   { animation-delay: 80ms;  }
.animate-in--delay-2   { animation-delay: 160ms; }
.animate-in--delay-3   { animation-delay: 240ms; }
.animate-in--delay-4   { animation-delay: 320ms; }
