/* ==========================================================================
   Memofun — Base reset, fonts and global rules
   ========================================================================== */

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson-hyperlegible-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson-hyperlegible-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('../fonts/nunito-variable.woff2') format('woff2-variations');
  font-weight: 400 900;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--line-base);
  min-height: 100vh;
}

h1, h2, h3 { font-weight: var(--weight-strong); line-height: 1.25; margin: 0 0 var(--space-2); }
h1 { font-size: var(--text-title); }
h2 { font-size: var(--text-large); }
p { margin: 0 0 var(--space-2); }

a { color: var(--accent); }

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

/* ---------- Visible focus, never removed (SPEC.md accessibility rules) ---------- */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  z-index: 1000;
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 8px; }

/* ---------- Respect prefers-reduced-motion everywhere ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Screen-reader only text ---------- */
.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;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-2);
}

.hidden { display: none !important; }

/* Generic row/stack utilities (Apptonomia's .fila / .pila, translated). */
.row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
