/* ==========================================================================
   base.css — Sanvi
   Tokens de diseno, reset, tipografia base, foco visible y utilidades.
   Se carga PRIMERO en las 4 paginas. No contiene componentes ni layout de
   secciones (eso vive en components.css y pages.css).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Espaciado — escala base 4px */
  --sp-2: 0.25rem;   /*  4px */
  --sp-3: 0.5rem;    /*  8px */
  --sp-4: 0.75rem;   /* 12px */
  --sp-5: 1rem;      /* 16px */
  --sp-6: 1.5rem;    /* 24px */
  --sp-7: 2rem;      /* 32px */
  --sp-8: 3rem;      /* 48px */
  --sp-9: 4.5rem;    /* 72px */

  /* Tipografia — tamanos (fluidos desde --fs-600 hacia arriba) */
  --fs-100: 0.75rem;
  --fs-200: 0.8125rem;
  --fs-300: 0.9375rem;
  --fs-400: 1rem;
  --fs-500: 1.125rem;
  --fs-600: clamp(1.25rem, 1.10rem + 0.60vw, 1.50rem);
  --fs-700: clamp(1.50rem, 1.25rem + 1.10vw, 2.00rem);
  --fs-800: clamp(2.00rem, 1.60rem + 1.80vw, 2.75rem);
  --fs-900: clamp(2.25rem, 1.70rem + 2.60vw, 3.50rem);

  /* Tipografia — familias */
  --font-display: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Color — turquesa (base de marca) */
  --c-teal-050: #F4FBFA;
  --c-teal-100: #DDF5F1;
  --c-teal-300: #2DD4BF;
  --c-teal-400: #14B8A6;
  --c-teal-500: #0F9B8E;
  --c-teal-900: #0B3B37;

  /* Color — coral (acento de accion, solo CTA) */
  --c-coral-500: #FF6B57;
  --c-coral-600: #E5533F;

  /* Color — superficies y texto */
  --c-surface: #FFFFFF;
  --c-line: #DCE7E6;
  --c-ink: #0B2A3A;
  --c-muted: #4A6B78;

  /* Radios */
  --r-md: 10px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* Sombra */
  --shadow-sm: 0 1px 2px rgba(11, 42, 58, 0.06), 0 6px 18px rgba(11, 42, 58, 0.06);

  /* Gradientes */
  --grad-soft: linear-gradient(180deg, #F4FBFA 0%, #FFFFFF 55%, #EAF7F5 100%);
  --grad-teal: linear-gradient(135deg, #0F9B8E 0%, #14B8A6 50%, #2DD4BF 100%);

  /* Layout */
  --container-max: 1120px;
  --section-y: clamp(3rem, 2rem + 4vw, 5.5rem);
}

/* --------------------------------------------------------------------------
   2. Reset / normalize
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ul, ol { margin: 0; }

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

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

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

button { cursor: pointer; }

table {
  border-collapse: collapse;
  width: 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;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   3. Tipografia base
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: var(--fs-400);
  line-height: 1.65;
  color: var(--c-ink);
  background-color: var(--c-teal-050);
  background-image: var(--grad-soft);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--c-ink);
  text-wrap: balance;
}

h1 { font-size: var(--fs-900); }
h2 { font-size: var(--fs-800); }
h3 { font-size: var(--fs-700); }
h4 { font-size: var(--fs-600); }
h5 { font-size: var(--fs-500); }
h6 { font-size: var(--fs-400); }

p { text-wrap: pretty; }

p + p { margin-top: var(--sp-5); }

small { font-size: var(--fs-200); }

strong { font-weight: 600; }

/* --------------------------------------------------------------------------
   4. Enlaces
   -------------------------------------------------------------------------- */
a {
  /* teal-500 da 3.44:1 sobre --c-surface/--c-teal-050 y falla el 4.5:1 de
     texto normal (WCAG AA, verificado con Lighthouse en la Tarea 9);
     teal-900 pasa amplio y sigue siendo turquesa de marca. */
  color: var(--c-teal-900);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-thickness 0.15s ease;
}

/* El color no cambia en hover (teal-900 ya es el que pasa WCAG AA, ver
   arriba); el afordance de hover es un subrayado mas grueso en su lugar. */
a:hover { text-decoration-thickness: 2px; }

/* --------------------------------------------------------------------------
   5. Foco visible — anillo turquesa
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--c-teal-500);
  outline-offset: 2px;
  border-radius: var(--r-md);
}

/* --------------------------------------------------------------------------
   6. Utilidades
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

@media (min-width: 40em) {
  .container { padding-inline: var(--sp-6); }
}

@media (min-width: 64em) {
  .container { padding-inline: var(--sp-7); }
}

.skip-link {
  position: fixed;
  left: var(--sp-5);
  top: var(--sp-5);
  z-index: 999;
  transform: translateY(-200%);
  padding: var(--sp-4) var(--sp-6);
  background: var(--c-surface);
  color: var(--c-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-300);
  text-decoration: none;
  border: 2px solid var(--c-teal-500);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
