/* ============================================================================
 * iShop · css/02-base.css — tipografía y la malla viva de fondo
 * ========================================================================== */

@layer base {

  html {
    scroll-behavior: smooth;
    scroll-padding-block-start: calc(var(--ui-alto-cabecera) + var(--space-6));
  }

  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: var(--step-0);
    line-height: var(--leading-text);
    letter-spacing: var(--tracking-text);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    position: relative;
    min-block-size: 100svb;
  }

  /* ======================================================================
   * LA MALLA VIVA
   * Tres radiales de color sobre el fondo oscuro. Va en un pseudo-elemento
   * fijo, no en el body: así el gradiente no se estira al crecer la página y
   * el vidrio de encima siempre tiene algo que velar.
   * ==================================================================== */
  body::before {
    content: '';
    position: fixed;
    inset: -20%;
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(38% 42% at 18% 12%, oklch(0.62 0.20 320 / 0.85), transparent 65%),
      radial-gradient(34% 38% at 86% 26%, oklch(0.70 0.17 210 / 0.75), transparent 62%),
      radial-gradient(42% 40% at 62% 92%, oklch(0.66 0.19 32 / 0.62), transparent 64%),
      radial-gradient(30% 34% at 8% 78%, oklch(0.60 0.18 268 / 0.55), transparent 60%);
    filter: blur(40px);
  }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-display);
    text-wrap: balance;
    color: var(--ink);
  }

  h1 { font-size: var(--step-6); }
  h2 { font-size: var(--step-4); }
  h3 { font-size: var(--step-2); letter-spacing: -0.02em; }

  h4 {
    font-size: var(--step-0);
    font-weight: 700;
    letter-spacing: -0.004em;
    line-height: 1.3;
  }

  p {
    text-wrap: pretty;
    max-inline-size: var(--measure);
    color: var(--ink-2);
  }

  strong { font-weight: 700; color: var(--ink); }

  a {
    color: inherit;
    text-decoration-color: color-mix(in oklab, var(--ink) 40%, transparent);
    text-underline-offset: 0.22em;
  }

  a:hover { text-decoration-color: var(--ink); }

  /* Sobre vidrio el anillo de foco tiene que llevar su propio halo, o se
     pierde contra el gradiente que hay debajo. */
  :focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
    border-radius: var(--radius-1);
    box-shadow: 0 0 0 6px rgb(0 0 0 / 0.25);
  }

  .cifra, time, [data-cifra] { font-variant-numeric: tabular-nums; }

  .mono {
    font-family: var(--font-mono);
    font-size: 0.92em;
    font-variant-numeric: tabular-nums;
  }

  .rotulo {
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
    line-height: 1;
  }

  .entradilla {
    font-size: var(--step-1);
    line-height: 1.5;
    color: var(--ink-2);
    max-inline-size: 44rem;
  }

  hr { border: 0; block-size: 1px; background: var(--line); margin: 0; }

  ::selection { background: var(--accent); color: var(--accent-ink); }

  .saltar-a-contenido {
    margin: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--ink);
    color: var(--ink-inv);
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: var(--step--1);
    text-decoration: none;
    box-shadow: var(--shadow-3);
  }
}
