/* ---------------------------------------------------------------------------
   Ludwig Ward — personal site
   Minimal, typographic design. One stylesheet, no framework.
   --------------------------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0066cc;
  --accent-hover: #0a4a91;
  --border: #e3e3e8;
  --surface: #f5f5f7;
  --max-width: 720px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

main {
  padding: 56px 0 72px;
}

section + section {
  margin-top: 56px;
}

/* ----- Navbar ------------------------------------------------------------ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-nav .brand {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.15s ease;
}

.site-nav a.nav-link:hover,
.site-nav a.nav-link.active {
  color: var(--text);
}

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

h1,
h2,
h3,
h4 {
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: 40px;
  margin: 0 0 8px;
}

h2 {
  font-size: 28px;
  margin: 48px 0 12px;
}

h3 {
  font-size: 21px;
  margin: 32px 0 8px;
}

p {
  margin: 0 0 16px;
}

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

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

.lead {
  font-size: 19px;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ----- Home: about ------------------------------------------------------- */

.about {
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
}

.about img.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.about .about-text {
  flex: 1 1 320px;
}

.about h1 {
  margin-bottom: 4px;
}

.about .role {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 16px;
}

/* ----- Blog list --------------------------------------------------------- */

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

.post-list li {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:first-child {
  padding-top: 8px;
}

.post-list h3 {
  margin: 0 0 4px;
}

.post-list h3 a {
  color: var(--text);
}

.post-list h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-list .date {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.post-list p {
  margin: 0;
  color: var(--muted);
}

/* ----- Article (single blog post) ---------------------------------------- */

.back-link {
  display: inline-block;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 24px;
}

.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

article .post-date {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 32px;
}

article ul {
  padding-left: 22px;
}

article li {
  margin-bottom: 8px;
}

article code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 5px;
}

article pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.5;
}

article pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* ----- Generic content lists (publications) ------------------------------ */

.linklist {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
}

.linklist li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.linklist .meta {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

/* ----- Résumé ------------------------------------------------------------ */

.resume-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.resume-head h1 {
  margin-bottom: 2px;
}

.resume .role {
  font-size: 18px;
  color: var(--muted);
  margin: 0;
}

.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  white-space: nowrap;
}

.btn:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.resume .entry {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.resume .entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.resume .position {
  font-weight: 600;
  font-size: 17px;
}

.resume .date {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.resume .org {
  color: var(--muted);
  margin: 2px 0 8px;
}

.resume .entry p:last-child {
  margin-bottom: 0;
}

.resume .skills {
  columns: 2;
  column-gap: 32px;
  padding-left: 20px;
}

@media (max-width: 600px) {
  .resume .skills {
    columns: 1;
  }
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  font-size: 14px;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: none;
}

/* ----- Responsive -------------------------------------------------------- */

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }
  h1 {
    font-size: 32px;
  }
  h2 {
    font-size: 24px;
  }
  main {
    padding: 40px 0 56px;
  }
  .about {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  .site-nav ul {
    gap: 18px;
  }
}
