/* ==========================================================================
   ZÁKLAD — reset, typografie, layoutové primitivy
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-graphite);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: var(--lh-body);
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--f-display);
  font-stretch: var(--fs-display);
  font-weight: 500;
  line-height: var(--lh-head);
  letter-spacing: var(--ls-head);
  text-wrap: balance;
}

h1 { font-size: var(--t-3xl); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); }
h2 { font-size: var(--t-2xl); letter-spacing: var(--ls-tight); }
h3 { font-size: var(--t-lg); }
h4 { font-size: var(--t-md); }

p { margin: 0 0 var(--s-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration-color: var(--c-line-strong);
  text-underline-offset: 0.22em;
  text-decoration-thickness: var(--hair);
  transition: color var(--dur-fast) var(--ease),
              text-decoration-color var(--dur-fast) var(--ease);
}
a:hover { color: var(--c-accent); text-decoration-color: var(--c-accent); }

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

ul, ol { margin: 0 0 var(--s-4); padding-left: var(--s-5); }
li { margin-bottom: var(--s-2); }
li:last-child { margin-bottom: 0; }

hr {
  border: 0;
  border-top: var(--hair) solid var(--c-line);
  margin: var(--s-7) 0;
}

strong { font-weight: 600; }

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

/* Jednotný focus. Grafit má proti papíru 13.6:1, takže je vidět všude. */
:focus-visible {
  outline: 2px solid var(--c-graphite);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* --- Pomocné třídy -------------------------------------------------------- */

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

.skip {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: calc(var(--z-menu) + 10);
  padding: var(--s-3) var(--s-5);
  background: var(--c-graphite);
  color: var(--c-paper);
  font-size: var(--t-sm);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease);
}
.skip:focus { transform: translateY(0); color: var(--c-paper); }

/* --- Kontejnery ----------------------------------------------------------
   Čtyři šířky záměrně. Střídají se, aby stránky nedýchaly všude stejně.    */

.wrap      { width: 100%; max-width: var(--w-page);   margin-inline: auto; padding-inline: var(--gutter); }
.wrap--full{ max-width: var(--w-full); }
.wrap--nar { max-width: var(--w-narrow); }
.wrap--txt { max-width: calc(var(--w-text) + 2 * var(--gutter)); }

/* --- Sekce ---------------------------------------------------------------- */

.sect        { padding-block: var(--sect-base); }
.sect--tight { padding-block: var(--sect-tight); }
.sect--airy  { padding-block: var(--sect-airy); }
.sect--deep  { background: var(--c-paper-deep); }
.sect--dark  { background: var(--c-graphite); color: var(--c-paper); }

.sect--dark a { color: var(--c-paper); }
.sect--dark a:hover { color: var(--c-accent-soft); text-decoration-color: var(--c-accent-soft); }

/* Vlasová linka mezi sekcemi. Hlavní vizuální motiv, drží celý web pohromadě. */
.sect--ruled { border-top: var(--hair) solid var(--c-line); }

/* --- Text ----------------------------------------------------------------- */

.lead {
  font-size: var(--t-md);
  line-height: var(--lh-lead);
  color: var(--c-muted);
  max-width: var(--w-text);
}

.prose { max-width: var(--w-text); }
.prose h2 { margin-top: var(--s-7); margin-bottom: var(--s-4); }
.prose h3 { margin-top: var(--s-6); margin-bottom: var(--s-3); }
.prose > *:first-child { margin-top: 0; }
