/* Varijabla theme — light/dark, responsive, no JS required */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f5f7;
  --bg-card: #ffffff;
  --border: #e2e5ea;
  --text: #1c2230;
  --muted: #5b6472;
  --accent: #4f46e5;
  --accent-contrast: #ffffff;
  --accent-soft: #eef0fe;
  --code-bg: #f4f5f7;
  --shadow: 0 1px 3px rgba(20, 24, 40, 0.08);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161c;
    --bg-soft: #1b1e27;
    --bg-card: #1b1e27;
    --border: #2c3040;
    --text: #e7e9ee;
    --muted: #9aa2b1;
    --accent: #8b93f8;
    --accent-contrast: #14161c;
    --accent-soft: #23263a;
    --code-bg: #22252f;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container.narrow { max-width: 760px; }

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  flex-wrap: wrap;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand-mark { width: 30px; height: 30px; }
.brand-bg { fill: var(--accent); }
.brand-v {
  fill: none;
  stroke: var(--accent-contrast);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.site-nav > a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.97rem;
}
.site-nav > a:hover { color: var(--accent); text-decoration: none; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.3rem;
}

.lang {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  color: var(--muted);
}
.lang.current {
  background: var(--accent);
  color: var(--accent-contrast);
}
a.lang:hover { text-decoration: none; color: var(--accent); }

/* Mobile nav (checkbox toggle, no JS) */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; }

@media (max-width: 720px) {
  .nav-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
  }
  .nav-toggle-label span,
  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    display: block;
    background: var(--text);
    height: 2px;
    width: 22px;
    border-radius: 2px;
    position: relative;
  }
  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    content: "";
    position: absolute;
  }
  .nav-toggle-label span::before { top: -7px; }
  .nav-toggle-label span::after { top: 7px; }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.75rem 0 1rem;
  }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .lang-switch { margin-left: 0; }
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(180deg, var(--accent-soft), var(--bg));
  padding: 4.5rem 0 3.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 22ch;
}

.hero .lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 58ch;
  margin: 0 0 1.75rem;
}

.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.btn.primary:hover { opacity: 0.9; color: var(--accent-contrast); }

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

.section { padding: 3rem 0; }

.section h1 { font-size: 2rem; margin: 0 0 1rem; }
.section h2 { font-size: 1.5rem; margin: 0 0 1.25rem; }

.intro { max-width: 66ch; margin-bottom: 1.5rem; }

/* ---------- Project cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.25rem;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-head { display: flex; align-items: center; gap: 0.6rem; }
.card-icon { font-size: 1.4rem; line-height: 1; }
.card-head h3 { margin: 0; font-size: 1.1rem; }

.card-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
}

.status {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  margin-left: auto;
}

/* ---------- News ---------- */

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-list li {
  display: flex;
  gap: 1.25rem;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.news-list time {
  flex: 0 0 7.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.news-title { font-weight: 600; font-size: 1.05rem; }
.news-list p { margin: 0.25rem 0 0; font-size: 0.92rem; }

@media (max-width: 560px) {
  .news-list li { flex-direction: column; gap: 0.15rem; }
  .news-list time { flex-basis: auto; }
}

.more { font-weight: 600; }

.article-header { margin-bottom: 1.5rem; }
.article-header h1 { margin-bottom: 0.25rem; }
.article-footer { margin-top: 2.5rem; }

/* ---------- Prose (markdown content) ---------- */

.prose { font-size: 1rem; }

.prose h2 {
  font-size: 1.4rem;
  margin: 2.25rem 0 0.75rem;
  padding-top: 0.5rem;
}
.prose h3 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }
.prose p { margin: 0.75rem 0; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.3rem 0; }

.prose blockquote {
  margin: 1.25rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  border-radius: 5px;
  padding: 0.12em 0.35em;
}

.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  line-height: 1.5;
}
.prose pre code { background: none; padding: 0; font-size: 0.85rem; }
.prose .highlight pre { border: none; margin: 0; }
.prose .highlight {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0;
  overflow: hidden;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.25rem 0;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.prose th { background: var(--bg-soft); font-weight: 600; white-space: nowrap; }

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Admonitions (markdown `!!! note`) */
.prose .admonition {
  margin: 1.25rem 0;
  padding: 0.75rem 1.15rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-size: 0.95rem;
}
.prose .admonition-title {
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--accent);
}

/* ---------- Docs layout ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 2.5rem;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.docs-sidebar-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0.25rem 0 0.75rem;
}

.docs-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  position: sticky;
  top: 80px;
}

.docs-sidebar nav a {
  color: var(--text);
  font-size: 0.93rem;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border-left: 2px solid transparent;
}
.docs-sidebar nav a:hover {
  background: var(--bg-soft);
  text-decoration: none;
}
.docs-sidebar nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.docs-content h1 { margin: 0 0 1rem; font-size: 1.9rem; }

@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .docs-sidebar nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .docs-sidebar nav a { border: 1px solid var(--border); }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  margin-top: 3rem;
  padding: 2.25rem 0 1.5rem;
  font-size: 0.93rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-inner p { margin: 0.2rem 0; }

.copyright {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.copyright p { margin: 0; }

/* ---------- Pygments (codehilite) ---------- */

.highlight .c, .highlight .c1, .highlight .cm { color: #6a737d; font-style: italic; }
.highlight .k, .highlight .kn, .highlight .kd { color: #d73a49; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd { color: #22863a; }
.highlight .m, .highlight .mi, .highlight .mf { color: #005cc5; }
.highlight .n, .highlight .nn { color: inherit; }
.highlight .nf, .highlight .nc { color: #6f42c1; }
.highlight .o, .highlight .ow { color: #d73a49; }
.highlight .nb { color: #005cc5; }

@media (prefers-color-scheme: dark) {
  .highlight .c, .highlight .c1, .highlight .cm { color: #8b949e; }
  .highlight .k, .highlight .kn, .highlight .kd { color: #ff7b72; }
  .highlight .s, .highlight .s1, .highlight .s2, .highlight .sd { color: #7ee787; }
  .highlight .m, .highlight .mi, .highlight .mf { color: #79c0ff; }
  .highlight .nf, .highlight .nc { color: #d2a8ff; }
  .highlight .o, .highlight .ow { color: #ff7b72; }
  .highlight .nb { color: #79c0ff; }
}
