:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-hover: #f4f4f5;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #71717a;
  --focus: #2563eb;
  --radius: 14px;
}

:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b;
    --surface: #18181b;
    --surface-hover: #27272a;
    --border: #27272a;
    --text: #fafafa;
    --muted: #a1a1aa;
    --focus: #60a5fa;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #18181b;
  --surface-hover: #27272a;
  --border: #27272a;
  --text: #fafafa;
  --muted: #a1a1aa;
  --focus: #60a5fa;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  background: var(--surface-hover);
  /* Rámeček: silný okraj v barvě karet + tenká linka + jemný stín */
  border: 4px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border), 0 8px 24px rgba(0, 0, 0, 0.08);
}

h1 {
  margin: 20px 0 4px;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.links {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.links a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.links a:active { transform: scale(0.98); }

.links a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.links svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.links .label { flex: 1; text-align: left; }

.links .arrow {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 0.15s ease;
}

@media (hover: hover) {
  .links a:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
  }
  .links a:hover .arrow { transform: translate(2px, -2px); }
}

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.theme-toggle svg { width: 18px; height: 18px; }

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (hover: hover) {
  .theme-toggle:hover { background: var(--surface-hover); }
}

/* Ve světlém motivu ukazuje měsíc (přepni na tmavý), v tmavém slunce */
.icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

footer {
  margin-top: 48px;
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
}

footer a,
.consent a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

footer a:focus-visible,
.consent a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-button:focus-visible,
.consent button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Lišta se souhlasem s cookies */
.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  max-width: 440px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  font-size: 0.875rem;
  text-align: left;
}

.consent[hidden] { display: none; }

.consent p { margin: 0 0 14px; color: var(--muted); }
.consent strong { color: var(--text); font-weight: 600; }

.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Obě tlačítka záměrně stejně výrazná (požadavek ÚOOÚ) */
.consent button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-hover);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

@media (hover: hover) {
  .consent button:hover { border-color: var(--muted); }
}

/* Textová stránka (např. /soukromi) */
.prose {
  max-width: 680px;
  text-align: left;
  align-items: stretch;
}

.prose h1 { margin-top: 0; }

.prose h2 {
  margin: 36px 0 8px;
  font-size: 1.1rem;
  font-weight: 650;
}

.prose p,
.prose li { color: var(--text); }

.prose p { margin: 0 0 12px; }

.prose ul { margin: 0 0 12px; padding-left: 1.25em; }

.prose li { margin-bottom: 6px; }

.prose a { color: var(--focus); text-underline-offset: 2px; }

.prose .lead { color: var(--muted); }

.prose .back {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--muted);
  text-decoration: none;
}

.prose .back:hover { color: var(--text); }

.prose table {
  width: 100%;
  margin: 0 0 12px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.prose th,
.prose td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th { font-weight: 600; }

.table-wrap { overflow-x: auto; }

/* Tablety a desktopy: trochu větší měřítko */
@media (min-width: 768px) {
  .avatar { width: 112px; height: 112px; }
  h1 { font-size: 1.75rem; }
  .tagline { font-size: 1rem; }
  .links { margin-top: 40px; }
  .links a { min-height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
