/* Shared stylesheet for every page of the site. */

/* ---------- Tokens ---------- */
:root {
  --bg: #060914;
  --text: #e9edf6;
  --muted: #a7b1c8;
  --accent: #9cc2ff;
  --accent-strong: #c9dcff;
  --card: rgba(10, 14, 30, 0.62);
  --card-hover: rgba(22, 30, 58, 0.72);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.28);
  --radius: 16px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  /* dark veil over the Euclid image so the text stays readable */
  background-image:
    linear-gradient(180deg, rgba(6, 9, 20, 0.55) 0%, rgba(6, 9, 20, 0.8) 100%),
    url('../images/perseus.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-strong); }

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

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

/* ---------- Header / navigation (sub-pages) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(6, 9, 20, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s, background-color 0.2s;
}

.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.site-nav a[aria-current="page"] {
  color: var(--bg);
  background: var(--accent);
}

/* ---------- Page layout ---------- */
main.page {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) 1rem;
}

.page-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-bottom: 1.75rem;
  text-align: center;
}

.page-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 0.9rem auto 0;
  border-radius: 3px;
  background: var(--accent);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2.25rem);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.card + .card { margin-top: 1.5rem; }

/* ---------- Figures ---------- */
.figure {
  margin: 0 0 1.75rem;
}

.figure img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.figure--portrait img {
  width: auto;
  max-height: 480px;
  margin: 0 auto;
}

.figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
  text-align: center;
}

/* ---------- Avatar ---------- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 6px rgba(156, 194, 255, 0.18), 0 12px 40px rgba(0, 0, 0, 0.5);
}

.about-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.75rem;
}

.about-header .avatar { width: 160px; height: 160px; }

/* ---------- Homepage ---------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.hero .avatar { width: 168px; height: 168px; margin-bottom: 1.5rem; }

.hero h1 {
  font-size: clamp(2.4rem, 7vw, 3.75rem);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

.tagline {
  margin: 0.6rem 0 0;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text);
  opacity: 0.9;
}

.tagline--sub {
  margin-top: 0.2rem;
  font-size: 0.98rem;
  color: var(--muted);
}

.social-links {
  display: flex;
  gap: 0.75rem;
  margin: 1.75rem 0 2.25rem;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  transition: background-color 0.2s, transform 0.2s, border-color 0.2s;
}

.social-links a:hover {
  background: rgba(156, 194, 255, 0.2);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.social-links svg { width: 22px; height: 22px; fill: currentColor; }
.social-links svg.icon-outline { fill: none; }

.home-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  max-width: 820px;
}

.home-nav a {
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-weight: 500;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.home-nav a:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* ---------- Talks timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.timeline li:first-child { padding-top: 0; }
.timeline li:last-child { border-bottom: 0; padding-bottom: 0; }

.timeline time {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.timeline h3 { font-size: 1.05rem; font-family: var(--font-body); }

.meta {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.pill {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--accent);
  border: 1px solid rgba(156, 194, 255, 0.45);
  transition: background-color 0.2s, color 0.2s;
}

.pill:hover { background: var(--accent); color: var(--bg); }

/* ---------- Teaching ---------- */
.year {
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

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

.course-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

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

.course-list strong { font-weight: 600; }

.badge {
  flex-shrink: 0;
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--muted);
  opacity: 0.85;
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .site-header { flex-direction: column; gap: 0.5rem; }
  .site-nav { justify-content: center; }
  .site-nav a { padding: 0.3rem 0.65rem; font-size: 0.9rem; }

  .timeline li {
    grid-template-columns: 1fr auto;
    gap: 0.25rem 1rem;
  }
  .timeline time { grid-column: 1 / -1; }

  .course-list li { flex-direction: column; gap: 0.35rem; }
}
