:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5d6470;
  --rule: #e4e1da;
  --accent: #2f5d8a;
  --accent-soft: #e8eff6;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1c1f23;
    --text: #e6e4df;
    --muted: #a0a6ae;
    --rule: #2e3238;
    --accent: #8fb6dc;
    --accent-soft: #22303d;
  }
}

* { box-sizing: border-box; }
sup { line-height: 0; vertical-align: baseline; position: relative; top: -0.45em; font-size: 0.75em; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 0.75rem; padding-bottom: 0.75rem; flex-wrap: wrap;
}
.name { font-family: var(--sans); font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
nav a { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--accent); }

/* Hero */
.hero { padding: 3.5rem 0 1.5rem; }
.hero h1 { font-size: 2.6rem; line-height: 1.15; margin: 0 0 0.35rem; font-weight: 600; letter-spacing: -0.015em; }
.tagline { font-family: var(--sans); font-size: 0.95rem; color: var(--muted); margin: 0 0 1.5rem; }
.hero-head { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.hero-head .tagline { margin-bottom: 0; }
.portrait { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--rule); }
.hero-links { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.5rem; }
.button {
  font-family: var(--sans); font-size: 0.9rem; font-weight: 500;
  padding: 0.5rem 1rem; border-radius: 6px; text-decoration: none;
  background: var(--accent); color: var(--bg); border: 1px solid var(--accent);
}
.button.ghost { background: transparent; color: var(--accent); }
.button:hover { opacity: 0.9; }

/* Sections */
section { padding: 2rem 0; border-top: 1px solid var(--rule); }
.hero { border-top: none; }
h2 { font-family: var(--sans); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin: 0 0 1.25rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.2rem; font-weight: 600; line-height: 1.35; }
h3.group { font-family: var(--sans); font-size: 0.95rem; color: var(--text); margin: 1.5rem 0 0.75rem; }
h3.group:first-of-type { margin-top: 0; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1.4rem 1.5rem; margin-bottom: 1rem;
}
.card p { margin: 0.6rem 0; }
.meta { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin-top: 0 !important; }
.status { font-style: italic; color: var(--muted); }
.tags { list-style: none; padding: 0; margin: 0.9rem 0 0; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tags li { font-family: var(--sans); font-size: 0.78rem; background: var(--accent-soft); color: var(--accent); padding: 0.15rem 0.6rem; border-radius: 999px; }
.files { padding-left: 1.1rem; margin: 0.6rem 0 0; }
.files .sub { color: var(--muted); font-size: 0.95rem; }
.links { font-family: var(--sans); font-size: 0.9rem; }
.learn h4 { font-family: var(--sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin: 1.1rem 0 0.4rem; }
.learn ul { margin: 0; padding-left: 1.1rem; }
.learn li { margin: 0.3rem 0; font-size: 1rem; }
figure { margin: 1rem 0 0.5rem; }
figure img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
figcaption { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 0.6rem 0; }
.timeline .row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.timeline .date { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.timeline .where { font-style: italic; color: var(--muted); font-size: 1rem; }
.timeline p { margin: 0.25rem 0 0; }

/* Skills */
.skills { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.5rem; margin: 0; }
.skills dt { font-family: var(--sans); font-size: 0.9rem; font-weight: 600; padding-top: 0.15rem; }
.skills dd { margin: 0; }

.site-footer { color: var(--muted); font-family: var(--sans); font-size: 0.85rem; padding-bottom: 2rem; }
.site-footer .wrap > p { border-top: 1px solid var(--rule); padding-top: 1.5rem; margin: 0; }

@media (max-width: 560px) {
  body { font-size: 1.02rem; }
  .hero { padding-top: 2.25rem; }
  .hero h1 { font-size: 2.1rem; }
  .hero-head { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .portrait { width: 112px; height: 112px; }
  .card { padding: 1.1rem 1.1rem; }
  .skills { grid-template-columns: 1fr; gap: 0.1rem; }
  .skills dd { margin-bottom: 0.6rem; }
  nav { gap: 0.85rem; }
}
