/* miloslavpavelka.com - static, no build step. The only script is js/theme.js (dark-mode toggle).
   Visual language follows the CV: Inter, a single navy accent, thin rules. */

/* Light is the default. Dark applies when the system asks for it, unless the visitor chose light with
   the toggle (data-theme="light"), or when the visitor chose dark (data-theme="dark"). */
:root {
  color-scheme: light;
  --ink: #1c2430;
  --muted: #566173;
  --faint: #8a94a3;
  --rule: #dde2e8;
  --accent: #1f4e79;
  --accent-soft: #eef3f8;
  --paper: #ffffff;
  --side: #f8fafc;
  --focus: #1f6fb5;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #e6eaf0;
    --muted: #a3adbb;
    --faint: #748094;
    --rule: #2a3340;
    --accent: #7fb2e0;
    --accent-soft: #19232f;
    --paper: #0f1722;
    --side: #141d29;
    --focus: #7fb2e0;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6eaf0;
  --muted: #a3adbb;
  --faint: #748094;
  --rule: #2a3340;
  --accent: #7fb2e0;
  --accent-soft: #19232f;
  --paper: #0f1722;
  --side: #141d29;
  --focus: #7fb2e0;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 "Inter", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--paper);
  padding: 8px 14px; z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

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

/* ---------- Layout: sidebar + page ---------- */

.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh; overflow-y: auto;
  padding: 36px 28px;
  background: var(--side);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column;
}

.brand {
  display: block; margin-bottom: 32px;
  font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--accent); }

.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a {
  display: flex; align-items: baseline; gap: 6px;
  padding: 8px 12px; margin: 0 -12px;
  border-radius: 6px;
  color: var(--ink); font-size: 0.97rem;
}
.nav a:hover { background: var(--accent-soft); text-decoration: none; color: var(--accent); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.nav .group-label {
  margin: 28px 0 6px;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint);
}

/* "Opens in a new tab" marker: a plain arrow character, so it also works unstyled */
.ext { font-size: 0.85em; color: var(--faint); }
.nav a:hover .ext { color: var(--accent); }

/* Dark-mode switch at the bottom of the sidebar (hidden until theme.js has run) */
.theme-toggle {
  margin: auto -12px 0;
  padding: 8px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 0; border-radius: 6px; background: none;
  font: inherit; font-size: 0.97rem; color: var(--ink);
  text-align: left; cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--accent-soft); color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.switch {
  position: relative; flex: none;
  width: 36px; height: 20px; border-radius: 10px;
  background: var(--faint);
  transition: background .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper);
  transition: transform .15s;
}
.theme-toggle[aria-checked="true"] .switch { background: var(--accent); }
.theme-toggle[aria-checked="true"] .switch::after { transform: translateX(16px); }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }

.page { padding: 0 48px; }
.page-inner { max-width: 760px; margin: 0 auto; }

/* ---------- Intro ---------- */

.hero { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; padding: 72px 0 40px; }

.portrait {
  width: 152px; height: 152px;
  border-radius: 50%;
  object-fit: cover; display: block;
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.title-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 20px; }
.badge { display: block; flex: none; }
.badge img { display: block; width: 92px; height: 92px; }

/* The badge image is transparent and made for light backgrounds. In dark mode it gets a light plate
   instead of a colour filter, so the issuer's artwork keeps its real colours. The plate is drawn with
   box-shadow so it does not change the layout. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge img { background: #fff; border-radius: 10px; box-shadow: 0 0 0 6px #fff; }
}
:root[data-theme="dark"] .badge img { background: #fff; border-radius: 10px; box-shadow: 0 0 0 6px #fff; }

h1 { margin: 0; font-size: 2.5rem; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }

.headline { margin: 8px 0 0; font-size: 1.25rem; font-weight: 500; color: var(--accent); }

.links {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  list-style: none; margin: 20px 0 0; padding: 0;
  font-size: 0.95rem;
}

/* ---------- Sections ---------- */

section { padding: 40px 0 0; }
section:last-of-type { padding-bottom: 64px; }

h2 {
  display: flex; align-items: center; gap: 16px;
  margin: 0 0 24px;
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

h3 { margin: 0 0 4px; font-size: 1.1rem; line-height: 1.35; font-weight: 600; }

p { margin: 0 0 12px; }

.values { display: grid; gap: 28px; }
.values p { margin: 0; color: var(--muted); }

.skills { display: grid; grid-template-columns: 11em 1fr; gap: 10px 24px; margin: 0; font-size: 0.95rem; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--muted); }

ul.plain { margin: 0; padding-left: 1.2em; }
ul.plain li { margin: 0 0 8px; }
ul.plain li::marker { color: var(--faint); }

footer { border-top: 1px solid var(--rule); padding: 22px 0 40px; font-size: 0.88rem; color: var(--muted); }

/* ---------- Small screens: sidebar becomes a top bar ---------- */

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; overflow: visible;
    padding: 18px 18px 14px;
    border-right: 0; border-bottom: 1px solid var(--rule);
  }
  .brand { margin-bottom: 12px; }
  .theme-toggle { margin: 8px 0 0; padding: 7px 12px; width: fit-content; }
  .nav ul { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
  .nav a { margin: 0; padding: 7px 12px; }
  .nav .group-label { margin: 0 4px 0 12px; }
  .nav .group-label + ul, .nav li.group { display: contents; }
  .page { padding: 0 18px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; gap: 22px; padding: 36px 0 28px; }
  .portrait { width: 120px; height: 120px; }
  .badge img { width: 72px; height: 72px; }
  h1 { font-size: 2.1rem; }
  .skills { grid-template-columns: 1fr; gap: 2px; }
  .skills dd { margin-bottom: 12px; }
}

@media print {
  .sidebar, .skip, .theme-toggle { display: none; }
  .layout { display: block; }
}
