/* ===========================================================
   Maciej Głowacki — academic website
   Clean, minimal academic style. Single stylesheet for all pages.
   =========================================================== */

:root {
  --accent: #ba481b;          /* RAL 2001 red orange — links, button, accents */
  --ochre: #ba481b;           /* RAL 2001 — CV download button */
  --ochre-dark: #9a3b16;      /* darker RAL 2001 — hover state */
  --ochre-text: #8e3514;      /* deep RAL 2001 — text/borders on white */
  --accent-soft: #e3ab93;     /* lightened RAL 2001 — horizontal rules */
  --grey-bar: #e6e6e6;        /* 10% black — nav bar and footer */
  --ink: #1c1c1c;             /* main text */
  --muted: #5c5c5c;           /* secondary text */
  --line: #e4e4e4;            /* hairlines */
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --max: 820px;               /* content column width */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  /* fluid body size: scales smoothly with the viewport between 16px and 18px */
  font-size: clamp(16px, 0.95rem + 0.25vw, 18px);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;            /* avoids ugly last-line breaks where supported */
}

/* ---------- Header / navigation ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--grey-bar);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.nav-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.2px;
}
.nav-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); font-weight: 600; }

/* ---------- Layout ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 24px 80px;
}
section { margin-bottom: 48px; }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 1.35rem + 1.6vw, 2.1rem); margin: 0 0 8px; }
h2 {
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.4rem);
  margin: 0 0 18px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent-soft);
}
h3 { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1rem); margin: 24px 0 6px; }

p { margin: 0 0 16px; }
a { color: var(--accent); }
a:hover { text-decoration: underline; }

.lead { font-size: 1.05rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------- Hero (home) ---------- */
.hero {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.hero-text { flex: 1 1 340px; }
.hero-photo {
  order: -1;                  /* desktop: photo sits to the left of the text */
  flex: 0 0 210px;
  width: 210px;
  height: 280px;              /* 3:4 portrait — matches the cropped photo, no cropping */
  border-radius: 6px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.subtitle { color: var(--muted); font-size: 1.05rem; margin-top: 0; }

.tags { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: 0.85rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--ochre);
  color: #fff;
  padding: 9px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
  margin: 6px 8px 6px 0;
}
.btn:hover { background: var(--ochre-dark); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ochre-text); border: 1px solid var(--ochre); }
.btn.ghost:hover { background: var(--accent-soft); }

/* ---------- Contact row ---------- */
.contact { font-size: 0.95rem; color: var(--muted); margin-top: 16px; }
.contact a { color: var(--accent); }

/* ---------- Lists (publications, talks, etc.) ---------- */
.pub-list { list-style: none; padding: 0; margin: 0; counter-reset: pub; }
.pub-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.pub-list li:last-child { border-bottom: none; }
.pub-authors { }
.pub-title { font-weight: 600; }
.pub-venue { font-style: italic; color: var(--muted); }
.pub-note { display: block; font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.star { color: var(--accent); font-weight: 700; }

.entry-list { list-style: none; padding: 0; margin: 0; }
.entry-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.entry-list li:last-child { border-bottom: none; }
.entry-list .when { color: var(--muted); white-space: nowrap; font-size: 0.9rem; }

.plain-list { padding-left: 1.1rem; }
.plain-list li { margin-bottom: 8px; }

/* ---------- Collapsible projects ---------- */
.project { border-bottom: 1px solid var(--line); }
.project:first-of-type { border-top: 1px solid var(--line); }
.project > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 32px 16px 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.project > summary::-webkit-details-marker { display: none; }
.proj-title { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; color: var(--ink); }
.proj-meta { color: var(--muted); font-size: 0.9rem; }
.project > summary:hover .proj-title { color: var(--accent); }
.project > summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 14px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent);
}
.project[open] > summary::after { content: "\2212"; }   /* minus sign when open */
.project > p { margin: 0 0 18px; padding-right: 4px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--grey-bar);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 28px 24px;
}
.site-footer a { color: var(--muted); }
.footer-links { margin: 0 0 6px; }
.footer-links a { color: var(--accent); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  main { padding: 32px 20px 60px; }
  .hero-photo { order: 0; flex-basis: 168px; width: 168px; height: 224px; }
  .entry-list li { flex-direction: column; gap: 2px; }
}
