/* Aruy · Base: reinicio, tipografía, foco y utilidades */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
  background: var(--c-surface);
  overscroll-behavior: none;
}

body {
  margin: 0;
  height: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--c-on-surface);
  background: var(--c-surface);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
}

h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--c-primary); text-underline-offset: .18em; }
[hidden] { display: none !important; }
:target { scroll-margin-top: 80px; }

/* Tipografía (escala M3 en rem) */
.t-display  { font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1.12; letter-spacing: -.02em; font-variation-settings: "opsz" 72; }
.t-headline { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.2; letter-spacing: -.012em; font-variation-settings: "opsz" 48; }
.t-title-l  { font-family: var(--font-display); font-weight: 650; font-size: 1.25rem; line-height: 1.3; letter-spacing: -.006em; font-variation-settings: "opsz" 28; }
.t-title-m  { font-weight: 700; font-size: 1rem; line-height: 1.35; }
.t-body-l   { font-size: 1rem; line-height: 1.55; }
.t-body-m   { font-size: .9375rem; line-height: 1.5; }
.t-label-l  { font-weight: 700; font-size: .875rem; line-height: 1.3; letter-spacing: .01em; }
.t-label-m  { font-weight: 600; font-size: .875rem; line-height: 1.3; }
.muted      { color: var(--c-on-surface-variant); }
.measure    { max-width: 60ch; }
.nowrap     { white-space: nowrap; }
.clamp-1, .clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.clamp-1 { -webkit-line-clamp: 1; line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }

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

/* Foco visible (teclado, interruptores y TalkBack con teclado) */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--r-s);
}
h1:focus-visible, main:focus-visible, [tabindex="-1"]:focus-visible { outline: none; }

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 1000;
  background: var(--c-primary); color: var(--c-on-primary);
  padding: 12px 18px; border-radius: var(--r-m); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: calc(12px + var(--safe-t)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important;
}

/* Iconos (sprite SVG) */
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-s { width: 18px; height: 18px; }
.ic-l { width: 32px; height: 32px; }
.ic-xl { width: 48px; height: 48px; }
.ic-fill { fill: currentColor; stroke: none; }
