/* =========================================================
   BASE - reset, typografia, utility, prístupnosť
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Jemné zrno cez celú stránku */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

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

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

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease);
}
.skip-link:focus-visible { transform: none; }

/* Zdieľané SVG definície - mimo layoutu, ale nie display:none (prechody by zmizli) */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Vodiace línie mriežky */
.guides {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
/* Línie sú odsadené do polovice okraja, aby sa nedotýkali obsahu */
.guides__inner {
  width: min(100% - var(--gutter), var(--container) + var(--gutter));
  height: 100%;
  border-inline: 1px solid rgba(255, 255, 255, 0.035);
}

/* Reveal pri scrolle (trieda .js pridáva main.js - bez JS je všetko viditeľné).
   Animácia (nie transition), aby nekolidovala s hover prechodmi kariet. */
.js [data-reveal]:not(.is-in) { opacity: 0; }
.js [data-reveal].is-in {
  animation: reveal 0.9s var(--ease) backwards;
  animation-delay: calc(var(--d, 0) * 110ms);
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(28px); }
}

/* Režim kontroly placeholderov: pridajte ?ph do URL */
.show-ph [data-ph] {
  outline: 1px dashed var(--accent) !important;
  outline-offset: 4px;
}
.show-ph [data-ph]::after {
  content: attr(data-ph);
  position: absolute;
  z-index: 5;
  top: -6px;
  left: 0;
  transform: translateY(-100%);
  padding: 2px 6px;
  font: 500 10px/1.4 var(--font-mono);
  color: var(--on-accent);
  background: var(--accent-fill);
  white-space: nowrap;
  pointer-events: none;
}

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