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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-total) + 1rem);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 0.9375rem/1.5 var(--font-ui);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Když je otevřený panel nebo dialog, stránka pod ním se neposouvá. */
html.locked,
html.locked body {
  overflow: hidden;
}

main {
  flex: 1;
  width: 100%;
  max-width: 96rem;
  margin: 0 auto;
  padding: 2rem var(--page-right) 4rem var(--page-left);
  outline: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

svg {
  display: block;
  flex: none;
}

:focus {
  outline: none;
}
:focus-visible {
  box-shadow: var(--focus);
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--navy-soft);
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

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

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}

.noscript {
  padding: 2rem var(--page-x);
  text-align: center;
}

/* Ikony z jedné sady, jedna velikost a tloušťka tahu. */
.icon {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Jediný vstupní pohyb: krátké vynoření obsahu po načtení. */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}
.rise {
  animation: rise var(--slow) var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 50ms);
}

@media (prefers-reduced-motion: reduce) {
  .rise {
    animation: none;
  }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
