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

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(48rem 28rem at 0% -8%, var(--accent-soft), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 1rem/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, p, ul, dl { margin: 0; }

/* ---------- Layout ---------- */
.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-5) var(--gutter);
}

main { counter-reset: section; }

/* ---------- Header ---------- */
.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  animation: rise 0.6s ease-out both;
}

.hero__monogram {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font: 600 1.4rem/1 var(--font-sans);
  letter-spacing: -0.02em;
}

.hero__name {
  font: 600 clamp(1.75rem, 5vw, 2.25rem)/1.15 var(--font-sans);
  letter-spacing: -0.02em;
}

.hero__role {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
  margin-top: var(--space-2);
  font-size: 0.95rem;
}

.hero__title { color: var(--accent); font-weight: 500; }
.hero__location { color: var(--muted); }
.hero__location::before { content: "· "; }

.hero__links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pill {
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.pill:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 480px) {
  .hero__monogram { width: 3.5rem; height: 3.5rem; font-size: 1.15rem; }
}

/* ---------- Sections ---------- */
.section {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--line);
  animation: rise 0.6s ease-out both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.section__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.2rem;
}

.section__title::before {
  counter-increment: section;
  content: counter(section, decimal-leading-zero);
  display: block;
  margin-bottom: 0.15rem;
  font: 500 0.75rem/1.4 var(--font-mono);
  color: var(--accent);
}

.section__body {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

@media (min-width: 640px) {
  .section { grid-template-columns: 9rem 1fr; gap: var(--space-4); }
}

.lead { font-size: 1.075rem; }

/* ---------- Entry ---------- */
.entry__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 var(--space-3);
}

.entry__title { font-size: 1.02rem; font-weight: 600; }

.entry__period {
  font: 0.78rem/1.6 var(--font-mono);
  color: var(--muted);
  white-space: nowrap;
}

.entry__subtitle {
  color: var(--muted);
  font-size: 0.925rem;
}

.entry__details,
.bullets {
  margin-top: var(--space-2);
  padding-left: 1.1rem;
  display: grid;
  gap: var(--space-1);
}

.bullets { margin-top: 0; }

.entry__details li::marker,
.bullets li::marker { color: var(--accent); }

/* A single-detail entry (projects) reads better without a bullet. */
.entry__details:has(> li:only-child) { padding-left: 0; list-style: none; }

/* ---------- Variant: timeline ---------- */
.section--timeline .entry {
  position: relative;
  padding-left: 1.5rem;
}

.section--timeline .entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
}

.section--timeline .entry:first-child::before { background: var(--accent); }

.section--timeline .entry:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.25rem;
  bottom: calc(-1 * var(--space-4) + 0.25rem);
  width: 1px;
  background: var(--line);
}

/* ---------- Variant: cards ---------- */
.section--cards .section__body {
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-3);
}

.section--cards .entry {
  display: flex;
  flex-direction: column;
  padding: var(--space-3) 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.section--cards .entry:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.section--cards .entry__details { font-size: 0.925rem; color: var(--muted); flex: 1; }

/* ---------- Tags ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: var(--space-2);
  padding: 0;
  list-style: none;
}

.tag {
  font: 0.72rem/1.7 var(--font-mono);
  padding: 0 0.55rem;
  border-radius: 6px;
  background: var(--chip-bg);
  color: var(--muted);
}

/* ---------- Definition list ---------- */
.deflist {
  display: grid;
  grid-template-columns: minmax(7.5rem, max-content) 1fr;
  gap: var(--space-2) var(--space-3);
  align-items: baseline;
}

.deflist dt { font-weight: 600; font-size: 0.95rem; }
.deflist dd { margin: 0; color: var(--muted); }
.deflist .tags { margin-top: 0; }

@media (max-width: 480px) {
  .deflist { grid-template-columns: 1fr; gap: var(--space-1); }
  .deflist dd { margin-bottom: var(--space-2); }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font: 0.78rem/1.6 var(--font-mono);
  color: var(--muted);
}

/* ---------- Motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Print ---------- */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --text: #000; --muted: #444;
    --accent: #0f766e; --accent-soft: transparent; --chip-bg: #fff; --shadow: none;
  }
  body { background: #fff; }
  * { animation: none !important; }
  .page { padding: 0; max-width: none; }
  .section { break-inside: avoid; padding: var(--space-3) 0; }
  .tag { border: 1px solid var(--line); }
}
