:root {
  --bg: #fbfaf8;
  --fg: #1a1817;
  --muted: #6b655f;
  --line: #e4dfd8;
  --chip: #f1eee9;
  --accent: #0077b6;
  --open: #1a7f37;
  --merged: #0077b6;
  --draft: #6b655f;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110;
    --fg: #ece8e3;
    --muted: #9b948c;
    --line: #2b2826;
    --chip: #1d1b19;
    --accent: #7cc8ff;
    --open: #3fb950;
    --merged: #7cc8ff;
    --draft: #9b948c;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121110;
  --fg: #ece8e3;
  --muted: #9b948c;
  --line: #2b2826;
  --chip: #1d1b19;
  --accent: #7cc8ff;
  --open: #3fb950;
  --merged: #7cc8ff;
  --draft: #9b948c;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.6 var(--mono);
  font-variant-ligatures: none;
  /* celý web malými písmeny, i data z githubu */
  text-transform: lowercase;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3.5rem 16px 2.5rem;
}

.accent { color: var(--accent); }
.dim, .muted { color: var(--muted); }

/* hlavička */

header.site { margin-bottom: 3rem; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.path {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* přepínač režimu: vlevo světlý, vpravo tmavý */

.theme-toggle {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  padding: 0;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.theme-toggle:hover { border-color: var(--accent); }

.theme-toggle:focus-visible { border-radius: 999px; }

.theme-toggle[hidden] { display: none; }

.theme-toggle .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  transition: transform .2s ease;
}

.theme-toggle[aria-checked="true"] .knob { transform: translateX(18px); }

.theme-toggle svg {
  grid-area: 1 / 1;
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.theme-toggle .i-moon {
  fill: currentColor;
  stroke: none;
}

.theme-toggle[aria-checked="true"] .i-sun,
.theme-toggle[aria-checked="false"] .i-moon { display: none; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle .knob { transition: none; }
}

h1 {
  margin: 0 0 .75rem;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.lede {
  margin: 0 0 1rem;
  max-width: 36rem;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  font-size: 13px;
}

.links a::after,
.ext::after {
  content: " ↗";
  color: var(--muted);
}

/* sekce */

section { margin-bottom: 3rem; }

h2 {
  margin: 0 0 .5rem;
  font-size: 15px;
  font-weight: 700;
}

.hash { color: var(--accent); }

.count {
  color: var(--muted);
  font-weight: 400;
}

.loading,
.empty {
  margin: 0;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

/* projekty */

.project {
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}

.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.project h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.project h3 a { text-decoration: none; }

.meta {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.project p.desc {
  margin: .35rem 0 .6rem;
  max-width: 38rem;
}

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 0 0 .75rem;
  padding: 0;
  list-style: none;
}

.topics li {
  padding: 0 .45rem;
  background: var(--chip);
  border-radius: 3px;
  color: var(--muted);
  font-size: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1.25rem;
  font-size: 13px;
}

.actions .primary {
  color: var(--accent);
  font-weight: 700;
}

.actions .when {
  margin-left: auto;
  color: var(--muted);
}

/* příspěvky */

.prs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pr {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0 .75rem;
  padding: .9rem 0;
  border-top: 1px solid var(--line);
}

.state {
  align-self: start;
  margin-top: .2rem;
  padding: 0 .4rem;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
  letter-spacing: .02em;
}

.state.open { color: var(--open); }
.state.merged { color: var(--merged); }
.state.draft,
.state.closed { color: var(--draft); }

.pr-repo {
  color: var(--muted);
  font-size: 13px;
}

.pr-title {
  display: block;
  margin: .1rem 0 .15rem;
}

.pr-when {
  color: var(--muted);
  font-size: 12px;
}

/* patička */

footer.site {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 520px) {
  .wrap { padding-top: 2rem; }
  h1 { font-size: 24px; }
  .project-head { flex-direction: column; gap: .1rem; }
  .actions .when { margin-left: 0; flex-basis: 100%; }
  .pr { grid-template-columns: 1fr; }
  .state { justify-self: start; margin: 0 0 .3rem; }
}
