/* Jannis Bulian — bulian.org
   Minimal, dependency-free stylesheet. */

/* ---------- Design tokens ---------- */

:root {
  --bg: #fdfdfc;
  --surface: #f4f4f1;
  --text: #1b1b19;
  --text-muted: #6b6b66;
  --border: #e2e2dd;
  --accent: #1f5f8b;
  --accent-hover: #113f5e;

  --measure: 34rem;
  --gutter: clamp(1.5rem, 5vw, 3rem);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14140f;
    --surface: #1e1e19;
    --text: #e6e5df;
    --text-muted: #9b9a92;
    --border: #2e2e28;
    --accent: #8fc2e3;
    --accent-hover: #b7dcf3;
  }
}

/* ---------- Reset & base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Links ---------- */

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

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

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

/* ---------- Layout ---------- */

.page {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding: 0 var(--gutter) 5rem;
}

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

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 2.5rem 0 1.25rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.site-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

a.site-title:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.9375rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent);
}

.nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

/* ---------- Typography ---------- */

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 600;
}

h1 {
  font-size: 1.75rem;
  margin: 0 0 0.35rem;
}

h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 3.5rem 0 1rem;
}

p {
  margin: 0 0 1.15rem;
  text-wrap: pretty;
}

.lede {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ---------- Intro ---------- */

.intro {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.portrait {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}

@media (max-width: 34rem) {
  .intro {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .portrait {
    width: 6rem;
    height: 6rem;
  }
}

/* ---------- Inline link row ---------- */

.link-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
}

/* ---------- Lists ---------- */

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

.stack > li {
  margin-bottom: 1.5rem;
}

.stack > li:last-child {
  margin-bottom: 0;
}

.entry-title {
  display: block;
  font-weight: 500;
  color: var(--text);
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.entry-title:hover {
  color: var(--accent);
}

.entry-meta {
  display: block;
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.entry-venue {
  display: block;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Year-grouped list: year sits in the left gutter on wide screens. */

.year-group {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.5rem;
  margin-bottom: 2.25rem;
}

.year-label {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  margin: 0;
  padding-top: 0.3rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

@media (max-width: 34rem) {
  .year-group {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .year-label {
    padding-top: 0;
  }
}

/* Simple bulleted list (teaching). */

.course-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
}

.course-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.course-list li:last-child {
  border-bottom: 0;
}

.course-term {
  margin-left: auto;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.site-footer {
  margin-top: 4.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}
