/* ==========================================================================
   ISIB Design System v2 — Base, section system & utilities
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text-default);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

img, picture, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

h1, h2, h3, h4 {
  color: var(--text-strong);
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
  overflow-wrap: break-word;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

::selection { background: var(--c-brand-200); color: var(--c-brand-900); }

@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;
  }
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.55); }
.section--subtle { background: var(--bg-subtle); }
.section--dark {
  background:
    radial-gradient(900px 420px at 12% -20%, rgba(26, 102, 214, 0.22), transparent 60%),
    linear-gradient(165deg, var(--c-deep-900), var(--c-deep-950));
  color: var(--text-on-dark-muted);
}
.section--dark h2, .section--dark h3 { color: #fff; }

/* ---------- Section header pattern ---------- */
.section-head {
  max-width: 44rem;
  margin-inline: auto;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
  text-align: center;
}
.section-head--start { margin-inline: 0; text-align: start; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--c-brand-700);
  background: var(--c-brand-50);
  border: 1px solid var(--c-brand-100);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}
.eyebrow::before {
  content: "";
  width: 0.45rem; height: 0.45rem;
  border-radius: 50%;
  background: var(--c-brand-500);
}
.section--dark .eyebrow {
  color: var(--c-brand-200);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-on-dark);
}
.section--dark .eyebrow::before { background: var(--c-brand-300); }

.section-title { font-size: var(--fs-2xl); }
.section-sub {
  margin-top: var(--space-2);
  font-size: var(--fs-base);
  color: var(--text-muted);
  line-height: var(--lh-normal);
  max-width: 40rem;
}
.section--dark .section-sub { color: var(--text-on-dark-muted); }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.visually-hidden {
  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; inset-inline-start: 1rem; top: -100px;
  background: var(--c-brand-700); color: #fff;
  padding: 0.7rem 1.1rem; border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
  z-index: var(--z-toast);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 1rem; }

/* Reveal-on-scroll (progressive enhancement — visible without JS) */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }
