/* ============================================================
   NANAI NANAI · base.css
   Reset moderno + tipografía + primitivas de layout + utilidades
   ============================================================ */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--color-text-dark);
  background: var(--color-bg-main);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

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

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

a { color: inherit; text-decoration: none; transition: var(--transition-fast); }

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

:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-titles);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  color: var(--color-text-dark);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }

p { max-width: 68ch; }

/* Overline · etiqueta de sección en mayúsculas espaciadas */
.overline {
  font-family: var(--font-body);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-brand-primary);
}

.lead {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
  line-height: var(--lh-body);
}

.muted { color: var(--color-text-muted); }
.soft  { color: var(--color-text-soft); }

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

.section { padding-block: var(--space-9); }
.section--tight { padding-block: var(--space-7); }
.section--sunken { background: var(--color-bg-sunken); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-7);
  max-width: 62ch;
}
.section-head--center {
  align-items: center;
  text-align: center;
  margin-inline: auto;
}

/* Rejilla utilitaria responsive de auto-ajuste */
.grid { display: grid; gap: var(--space-5); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ---------- Utilidades ---------- */
.stack > * + * { margin-top: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.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;
}

.divider { height: 1px; background: var(--color-line); border: 0; }

/* ---------- Responsive base ---------- */
@media (max-width: 900px) {
  h1 { font-size: var(--fs-2xl); }
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .section { padding-block: var(--space-7); }
}
@media (max-width: 560px) {
  :root { --container-pad: var(--space-4); }
  .grid--3, .grid--auto { grid-template-columns: 1fr; }
}
