/* Courier Prime — self-hosted, latin + latin-ext (for č, š, ž) */
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/courierprime-regular-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/courierprime-regular.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Courier Prime";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/courierprime-italic-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Courier Prime";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/courierprime-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/courierprime-bold-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/courierprime-bold.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #fcfcfa;
  --ink: #1a2238;
  --faded: #626d8a;
  --line: #dde2ee;
  --selection: #dce3f4;
}

/* dark "night ink" — explicit choice wins, system preference is the default */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1420;
    --ink: #d9e1f2;
    --faded: #8a96b4;
    --line: #26314c;
    --selection: #222c46;
  }
}
html[data-theme="dark"] {
  --paper: #0f1420;
  --ink: #d9e1f2;
  --faded: #8a96b4;
  --line: #26314c;
  --selection: #222c46;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Courier Prime", ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 1.0625rem;
  line-height: 1.75;
}

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

a { color: inherit; }

:focus-visible {
  outline: 2px dashed var(--faded);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.4em 0.8em;
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: none;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

.site-header,
main,
.site-footer {
  max-width: 44rem;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25em 1.25em;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 2rem;
  margin-bottom: 3.5rem;
}

.site-title {
  font-weight: 700;
  text-decoration: none;
}
.site-title:hover { text-decoration: underline; }

.site-nav {
  font-size: 0.85rem;
}
.site-nav a {
  text-decoration: none;
  margin-right: 0.9em;
}
.site-nav a:last-child { margin-right: 0; }
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.header-controls {
  display: flex;
  align-items: baseline;
  gap: 0.9em;
}

.lang-switch {
  font-size: 0.85rem;
  color: var(--faded);
}
.lang-switch button {
  font: inherit;
  background: none;
  border: 0;
  padding: 0 0.15em;
  color: var(--faded);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.lang-switch button:hover { color: var(--ink); text-decoration: underline; }
.lang-switch button[aria-pressed="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lang-switch button.is-unavailable {
  opacity: 0.35;
  cursor: default;
}
.lang-switch button.is-unavailable:hover { color: var(--faded); text-decoration: none; }

/* theme toggle — only visible once JS has picked a theme */
.theme-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--faded);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}
html[data-theme] .theme-toggle { display: inline-flex; }
.theme-toggle:hover { color: var(--ink); }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: none; }

main { padding-bottom: 4rem; }

h1 {
  font-size: 1.5rem;
  line-height: 1.35;
  margin: 0 0 0.6rem;
}

.tagline {
  margin: 0 0 2.5rem;
  color: var(--faded);
}

.contact { margin: 0 0 3rem; }

section { margin-bottom: 3rem; }

section > h2 {
  font-size: 1.1rem;
  margin: 0 0 1.25rem;
}

/* --- lists (posts, publications, projects) --- */
.entry-list,
.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.entry-list li { margin-bottom: 2rem; }
.plain-list li { margin-bottom: 0.75rem; }
.entry-list h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.5;
}
.entry-list h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}
/* links stay underlined (default) so they read as clickable */
.entry-list h2 a,
.entry-list h3 a {
  text-underline-offset: 3px;
}
.entry-list a:hover { color: var(--ink); }
.entry-list p { margin: 0.2rem 0 0; max-width: 65ch; }
.entry-list .desc { color: var(--faded); }
.meta {
  font-size: 0.8rem;
  color: var(--faded);
}
.tag {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 0.4em;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

/* --- article (blog post) --- */
article { margin-bottom: 3rem; }
article .meta { margin-bottom: 2.5rem; }
article p { margin: 0 0 1.35em; }
article blockquote {
  margin: 0 0 1.35em;
  padding-left: 1.1em;
  border-left: 3px solid var(--line);
  color: var(--faded);
  font-style: italic;
}

/* long-form elements from markdown */
article h2 {
  margin: 2.2em 0 0.6em;
  font-size: 1.2rem;
  line-height: 1.4;
}
article h3 {
  margin: 1.8em 0 0.5em;
  font-size: 1.05rem;
}
article ul,
article ol {
  margin: 0 0 1.35em;
  padding-left: 1.6em;
}
article li { margin-bottom: 0.4em; }
article hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 2.5em 0;
}
article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 1.35em;
}
article figure { margin: 0 0 1.35em; }
article figure img { margin-bottom: 0.4em; }
article figcaption {
  font-size: 0.8rem;
  color: var(--faded);
  text-align: center;
}
article iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  margin: 0 0 1.35em;
}
article pre {
  margin: 0 0 1.35em;
  padding: 0.9em 1em;
  border: 1px solid var(--line);
  overflow-x: auto;
}
article code {
  font-family: inherit;
  font-size: 0.9em;
}

/* copy-to-clipboard button on code blocks */
.copy-code {
  display: block;
  margin: -2.65em 0 1.35em auto;
  font: inherit;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: none;
  border: 1px solid var(--line);
  color: var(--faded);
  padding: 0.1em 0.5em;
  cursor: pointer;
}
.copy-code:hover { color: var(--ink); }

.pager {
  font-size: 0.85rem;
  color: var(--faded);
}
.pager span { display: block; }

.lang-notice {
  margin: 0 0 3rem;
  padding: 0.6em 0.9em;
  border: 1px dashed var(--line);
  font-size: 0.85rem;
  color: var(--faded);
}

.lang-label {
  display: none;
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faded);
}

/* --- cv --- */
.cv-timeline { position: relative; }
.cv-entry {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 2rem;
}
.cv-entry::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  translate: -50% 0;
  background: var(--line);
}
.cv-entry:first-child::before { top: 0.75rem; }
.cv-entry:last-child::before { bottom: auto; height: 1.75rem; }
.cv-entry-dot {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--ink);
  translate: -50% 0;
}
.cv-entry h3 {
  margin: 0;
  font-size: 1rem;
}
.cv-entry p { margin: 0.2rem 0 0; max-width: 65ch; }

/* --- language switching (JS sets data-lang on <html>) --- */
html[data-lang="sl"] .lang-en { display: none; }
html[data-lang="en"] .lang-sl { display: none; }

/* posts available in only one language are hidden from the
   index while reading in the other language */
html[data-lang="en"] .only-sl { display: none; }
html[data-lang="sl"] .only-en { display: none; }

/* without JS: show both versions, separated and labeled */
html.no-js .lang-label { display: block; }
html.no-js .tagline .lang-en::before,
html.no-js .entry-list .lang-en::before,
html.no-js .meta .lang-en::before,
html.no-js .plain-list .lang-en::before,
html.no-js .site-nav .lang-en::before,
html.no-js .site-footer .lang-en::before,
html.no-js .skip-link .lang-en::before { content: " / "; }
html.no-js article + article {
  margin-top: 3.5rem;
  padding-top: 3.5rem;
  border-top: 1px dashed var(--line);
}
/* without JS the theme toggle cannot work */
html.no-js .theme-toggle { display: none; }

.site-footer {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--line);
  color: var(--faded);
  font-size: 0.8rem;
}
.site-footer p { margin: 0; }

@media (min-width: 600px) {
  body { font-size: 1.125rem; }
}
