/* =====================================================
   base.css — Reset, body, tipografía global, utilidades
   ===================================================== */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800;900&family=Inter:wght@400;450;500;600;700&display=swap");
@import "./tokens.css";

/* --------------------------------------------------
   Box model + Reset
-------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-normal);
  line-height: var(--leading-body);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --------------------------------------------------
   Skip to content (accesibilidad)
-------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-6);
  background: var(--brand-600);
  color: #fff;
  font-weight: var(--weight-semibold);
  font-size: var(--text-small);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
  z-index: var(--z-toast);
  transition: top var(--duration-fast) var(--ease-out);
}
.skip-link:focus {
  top: 0;
}

/* --------------------------------------------------
   Tipografía base
-------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  font-weight: var(--weight-bold);
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-h1);
  font-weight: var(--weight-extrabold);
}
h2 {
  font-size: var(--text-h2);
}
h3 {
  font-size: var(--text-h3);
}
h4 {
  font-size: var(--text-h4);
}
h5 {
  font-size: var(--text-body-lg);
}
h6 {
  font-size: var(--text-body);
}

p {
  line-height: var(--leading-body);
  color: var(--text-secondary);
  max-width: 70ch;
}

p + p {
  margin-top: var(--space-4);
}

a {
  color: var(--brand-600);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover {
  color: var(--brand-700);
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

strong {
  font-weight: var(--weight-semibold);
  color: var(--text);
}
em {
  font-style: italic;
}

ul,
ol {
  padding-left: var(--space-6);
  color: var(--text-secondary);
}
li {
  line-height: var(--leading-relaxed);
}
li + li {
  margin-top: var(--space-1);
}

/* --------------------------------------------------
   Imágenes y media
-------------------------------------------------- */
img,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  object-fit: cover;
}

/* --------------------------------------------------
   Formularios base
-------------------------------------------------- */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

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

.container--wide {
  max-width: var(--container-wide);
}
.container--narrow {
  max-width: var(--container-narrow);
}

/* --------------------------------------------------
   Layout: Sección
-------------------------------------------------- */
.section {
  padding-block: var(--section-v);
}

.section--dark {
  background: var(--brand-950);
  color: var(--text-inverse);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--text-inverse);
}
.section--dark p {
  color: rgba(255, 255, 255, 0.72);
}

.section--subtle {
  background: var(--surface-subtle);
}
.section--white {
  background: var(--surface);
}

/* --------------------------------------------------
   Utilidades de texto
-------------------------------------------------- */
.text-display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
}

.text-lead {
  font-size: var(--text-lead);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 60ch;
}

.text-label {
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-muted {
  color: var(--text-tertiary);
}
.text-center {
  text-align: center;
}
.text-inverse {
  color: var(--text-inverse);
}

/* --------------------------------------------------
   Utilidades de layout
-------------------------------------------------- */
.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;
}

.flex {
  display: flex;
}
.grid {
  display: grid;
}
.hidden {
  display: none;
}

.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-4 {
  gap: var(--space-4);
}
.gap-6 {
  gap: var(--space-6);
}
.gap-8 {
  gap: var(--space-8);
}

/* --------------------------------------------------
   Divider
-------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin-block: var(--space-8);
}

/* --------------------------------------------------
   Sección header (eyebrow + title + lead)
-------------------------------------------------- */
.section-header {
  margin-bottom: var(--space-12);
}

.section-header--centered {
  text-align: center;
}

.section-header--centered p,
.section-header--centered .text-lead {
  margin-inline: auto;
}

.eyebrow {
  display: inline-block;
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: var(--space-3);
}

.section--dark .eyebrow {
  color: var(--accent-300);
}

/* --------------------------------------------------
   Scrollbar custom (webkit)
-------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* --------------------------------------------------
   Selection
-------------------------------------------------- */
::selection {
  background: var(--brand-100);
  color: var(--brand-900);
}
