/* ==========================================================================
   Reset y cimientos
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* el header fijo arriba y la barra del pedido abajo no pueden tapar
     aquello a lo que el navegador salta (anclas, campos enfocados) */
  scroll-padding-top: calc(var(--header-h) + 12px);
  scroll-padding-bottom: calc(var(--dock-h) + var(--safe-b) + 16px);
  overflow-x: clip;
  /* el hueco de la barra de scroll queda reservado siempre: al abrir un panel
     el `body` pasa a `position: fixed` y, sin esto, la página entera daba un
     tirón lateral de varios píxeles al abrir y otro al cerrar */
  scrollbar-gutter: stable;
}

@supports not (overflow: clip) {
  html { overflow-x: hidden; }
}

body {
  min-height: 100svh;
  overflow-x: clip;
  background: var(--ink);
  color: var(--on-dark);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--dock-h) + var(--safe-b));
}

@supports not (overflow: clip) {
  body { overflow-x: hidden; }
}

body[data-locked] {
  position: fixed;
  inset-inline: 0;
  width: 100%;
  overflow: hidden;
}

/* `hidden` tiene que ganarle a cualquier `display` de componente */
[hidden] { display: none !important; }

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

img { height: auto; }

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

button { background: none; border: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
  font-variation-settings: 'SOFT' 20, 'WONK' 0;
}

p { text-wrap: pretty; }

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

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--sunset);
  color: oklch(0.99 0 0);
}

/* Barra de scroll discreta en superficies oscuras */
@supports (scrollbar-color: red blue) {
  html { scrollbar-color: var(--navy-600) var(--ink); }
}

/* ---- utilidades ---- */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 8px;
  translate: -50% -160%;
  z-index: var(--z-toast);
  background: var(--gold);
  color: oklch(0.20 0.05 262);
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-pill);
  transition: translate var(--t-mid) var(--ease);
}
.skip-link:focus-visible { translate: -50% 0; }

.stack > * + * { margin-top: var(--stack, 1rem); }

.nowrap { white-space: nowrap; }

.tnum { font-variant-numeric: tabular-nums; }

/* Aparición al hacer scroll */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity var(--t-slow) var(--ease),
    transform var(--t-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
