/* ==========================================================================
   CARVISEG S.A.C. — Base, Tipografía, Grilla y Superficies del Navegador
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* Lenis gestiona el desplazamiento suave */
  background-color: var(--navy-950);
  color: var(--ink-dark);
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: clip;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--ink-dark);
  background-color: var(--surface-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* Superficies del navegador alineadas a la marca */
::selection {
  background-color: var(--accent-blue);
  color: var(--ink-light);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--navy-950);
}

::-webkit-scrollbar-thumb {
  background: var(--navy-700);
  border-radius: var(--radius-pill);
  border: 2px solid var(--navy-950);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-silver);
}

/* Foco visible accesible */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

.theme-dark :focus-visible,
.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--accent-blue-darkbg);
}

/* Enlace de salto para teclado */
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--gutter);
  z-index: 120;
  padding: 0.75rem 1.25rem;
  background-color: var(--navy-900);
  color: var(--ink-light);
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent-blue-darkbg);
  border-radius: var(--radius-sm);
  transition: top var(--dur-ui) var(--ease-out);
}

.skip-link:focus {
  top: 1rem;
}

/* Jerarquía tipográfica */
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p {
  margin: 0;
  max-width: 66ch;
}

a {
  color: inherit;
  text-underline-offset: 0.24em;
}

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

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

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

/* Utilidades de lectura e índice tabular */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

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

/* Contenedor y grilla de 12 columnas */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.section {
  position: relative;
  padding-block: var(--section-py);
}

.theme-dark {
  background-color: var(--navy-900);
  color: var(--ink-light);
}

.theme-deep {
  background-color: var(--navy-950);
  color: var(--ink-light);
}

.theme-warm {
  background-color: var(--surface-warm);
  color: var(--ink-dark);
}

.theme-paper {
  background-color: var(--surface-paper);
  color: var(--ink-dark);
}

/* Títulos utilitarios */
.display-hero {
  font-size: var(--text-hero);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.display-h1 {
  font-size: var(--text-h1);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.display-h2 {
  font-size: var(--text-h2);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.display-h3 {
  font-size: var(--text-h3);
  line-height: 1.24;
  letter-spacing: -0.02em;
}

.lead-copy {
  font-size: var(--text-lead);
  line-height: 1.55;
}

.section-kicker {
  display: inline-block;
  margin-bottom: 1rem;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-blue);
}

.theme-dark .section-kicker,
.theme-deep .section-kicker {
  color: var(--accent-blue-darkbg);
}

/* Marcadores claros de contenido pendiente */
.pending-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px dashed var(--accent-silver);
  border-radius: var(--radius-xs);
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--ink-dark-muted);
  background-color: rgba(141, 153, 174, 0.08);
}

.theme-dark .pending-note,
.theme-deep .pending-note {
  color: var(--ink-light-muted);
  border-color: var(--line-dark-strong);
  background-color: rgba(141, 153, 174, 0.12);
}

/* Reveal helper para animación por máscara de línea */
.line-mask {
  overflow: hidden;
  display: block;
}

.line-mask > span {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
