/* ============================================================
   Jakub Vrabel — functionalist / terminal-minimal design
   Light + monospace, with dark toggle.
   ============================================================ */

:root {
  --bg:        #ffffff;   /* true white             */
  --bg-soft:   #efeee9;   /* subtle blocks          */
  --fg:        #1b1b18;   /* near-black ink         */
  --fg-muted:  #6b6a62;   /* secondary text         */
  --rule:      #dddcd3;   /* hairlines              */
  --grain-opacity: 0.13;
  --grain-blend:   multiply;
  --accent:    #45648f;   /* washed navy accent     */
  --accent-d:  #324c70;
  --sel:       #dde6f3;   /* selection bg           */
}

html[data-theme="dark"] {
  --bg:        #26272b;   /* washed-out dark grey   */
  --bg-soft:   #303137;
  --fg:        #e4e3dc;
  --fg-muted:  #9b9a92;
  --rule:      #41434a;
  --grain-opacity: 0.12;
  --grain-blend:   overlay;
  --accent:    #8fb0dc;   /* soft sky-navy          */
  --accent-d:  #aac6ea;
  --sel:       #25344a;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "SFMono-Regular", "JetBrains Mono", "Cascadia Code",
               Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* film-grain / speckle texture overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.6rem 1.4rem 4rem;
}

/* ---------- header / nav ---------- */

.site-head { margin-bottom: 2.2rem; }

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

.brand {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}
.brand .prompt { color: var(--accent); }

.theme-toggle {
  font: inherit;
  font-size: 0.78rem;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.18rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

nav.menu {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  font-size: 1.05rem;
}
nav.menu a {
  color: var(--fg-muted);
  text-decoration: none;
  position: relative;
}
nav.menu a:hover { color: var(--accent); }
nav.menu a.active { color: var(--fg); }
nav.menu a.active::before { content: "› "; color: var(--accent); }

/* ---------- typography ---------- */

h1.page-title {
  font-size: 1.5rem;
  margin: 0 0 1.4rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--fg-muted);
  margin: 2.4rem 0 1rem;
  font-weight: 700;
}
h2::before { content: "## "; color: var(--accent); }

h3 { font-size: 1rem; margin: 0 0 0.3rem; }

p { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
    text-decoration-thickness: 1.5px; text-decoration-color: var(--accent);
    transition: color .12s, text-decoration-color .12s, background .12s; }
a:hover { color: var(--accent-d); text-decoration-color: var(--accent-d);
    background: var(--sel); }

strong { font-weight: 700; }

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

ul { padding-left: 1.2rem; margin: 0 0 1rem; }
li { margin: 0.15rem 0; }
ul ul { margin: 0.15rem 0; }

.muted { color: var(--fg-muted); }
.note  { color: var(--fg-muted); font-size: 0.86rem; font-style: italic; margin-bottom: 1.8rem; }

/* ---------- intro / bio ---------- */

.intro {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.4rem;
}
.portrait { flex-shrink: 0; width: 150px; }
.intro img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: 3px;
  display: block;
}
.socials {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  line-height: 1.15;
}
.socials li::before { content: "→ "; color: var(--accent); }
.socials a { color: var(--fg-muted); text-decoration: none; }
.socials a:hover { color: var(--accent); background: transparent; }
.intro .tagline { font-size: 0.9rem; color: var(--fg-muted); margin-top: 0.2rem; }

/* ---------- news ---------- */

.news li { margin: 0.45rem 0; list-style: none; }
.news { padding-left: 0; }
.news .date {
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.5rem;
}

/* ---------- project rows ---------- */

.project {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-top: 1px dotted var(--rule);
}
.project:first-of-type { border-top: 0; }
.project img {
  width: 220px;
  height: 135px;
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: 3px;
  flex-shrink: 0;
  filter: grayscale(18%);
  transition: filter .2s;
}
.project:hover img { filter: grayscale(0%); }
.project .body p { margin: 0.25rem 0 0.4rem; font-size: 0.92rem; color: var(--fg-muted); }
.project .links { font-size: 0.85rem; }
.project .links a { color: var(--accent); text-decoration: none; }
.project .links a:hover { text-decoration: underline; }
.project .links .sep { color: var(--rule); margin: 0 0.35rem; }

/* ---------- listing (events / teaching) ---------- */

.entry {
  padding: 0.9rem 0;
  border-top: 1px dotted var(--rule);
}
.entry:first-child { border-top: 0; }
.entry .meta { font-size: 0.82rem; color: var(--fg-muted); margin-top: 0.15rem; }
.entry .meta .tag {
  display: inline-block;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0 0.4rem;
  margin-right: 0.5rem;
  color: var(--fg-muted);
}
.entry p { font-size: 0.92rem; margin: 0.4rem 0 0.3rem; }

/* compact events tree */
.tree { padding-left: 0; list-style: none; }
.tree > li { margin: 0.5rem 0; }
.tree .year { font-weight: 700; color: var(--accent); }
.tree ul { list-style: none; padding-left: 1.3rem; border-left: 1px solid var(--rule); margin-left: 0.3rem; }
.tree ul li::before { content: "– "; color: var(--fg-muted); }

/* ---------- buttons / cta ---------- */

.btn {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 3px;
  font-size: 0.9rem;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--accent); color: var(--bg); }

/* ---------- footer ---------- */

footer.site-foot {
  margin-top: 3.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--fg-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
}
footer.site-foot a { color: var(--fg-muted); text-decoration: none; }
footer.site-foot a:hover { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 540px) {
  .intro { flex-direction: column; }
  .project { flex-direction: column; }
  .project img, .intro img { width: 100%; height: auto; }
}
