:root {
  --bg: #f6f5f2;
  --text: #1c1917;
  --muted: #57534e;
  --faint: #78716c;
  --line: #e4e1db;
  --accent: #2a44a0;
  --accent-line: #c7d0ef;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --when: 112px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  line-height: 1.6;
}

a { color: inherit; }

/* Two soft color fields drifting slowly behind the page. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.backdrop::before,
.backdrop::after {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: drift 40s ease-in-out infinite alternate;
  will-change: transform;
}

.backdrop::before {
  top: -30vmax;
  left: -20vmax;
  background: radial-gradient(circle, #efe6da, transparent 65%);
}

.backdrop::after {
  bottom: -35vmax;
  right: -25vmax;
  background: radial-gradient(circle, #dfe5f7, transparent 65%);
  animation-delay: -20s;
}

@keyframes drift {
  to { transform: translate(6vmax, 4vmax) scale(1.08); }
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 72px 40px 96px;
}

/* Sections rise in one after another. */
.reveal {
  opacity: 0;
  animation: rise 0.8s var(--ease) forwards;
  animation-delay: calc(var(--i) * 80ms + 80ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

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

.intro {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}

.photo {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
  box-shadow: 0 0 0 5px #fff, 0 10px 30px -12px rgba(28, 25, 23, 0.35);
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.role {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
}

.headline {
  margin: 4px 0 0;
  font-size: 16px;
  color: var(--muted);
}

.meta {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--faint);
}

.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
  margin-top: 6px;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.lede {
  margin: 44px 0 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
}

/* --- Sections ---------------------------------------------------------------- */

section { margin-top: 64px; }

h2 {
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* One row per product: a large preview beside the story, so the list can grow. */
.projects {
  display: grid;
  gap: 40px;
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 50%) 1fr;
  gap: 32px;
  align-items: start;
  color: inherit;
  text-decoration: none;
}

.shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(28, 25, 23, 0.06), 0 18px 40px -24px rgba(28, 25, 23, 0.45);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.project h3 {
  font-size: 20px;
  letter-spacing: -0.015em;
  transition: color 0.35s var(--ease);
}

.arrow {
  display: inline-block;
  margin-left: 2px;
  font-weight: 400;
  color: var(--faint);
  transition: transform 0.35s var(--ease), color 0.35s var(--ease);
}

.kicker {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.project p:not(.kicker):not(.tags) {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.tags {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--faint);
}

/* Dated entries: experience, education, publications, organizations. */
.entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entries li {
  display: grid;
  grid-template-columns: var(--when) 1fr;
  gap: 20px;
  padding: 12px 0;
}

.entries li:first-child { padding-top: 0; }

.when {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  padding-top: 1px;
}

.org {
  font-weight: 500;
  color: var(--muted);
}

.entries p {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.entries h3 a {
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 4px;
  transition: color 0.3s var(--ease), text-decoration-color 0.3s var(--ease);
}

.skills {
  display: grid;
  grid-template-columns: var(--when) 1fr;
  gap: 10px 20px;
  margin: 0;
}

.skills dd {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

/* --- Interaction ------------------------------------------------------------- */

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

.links a:focus-visible,
.project:focus-visible h3,
.project:focus-visible .arrow,
.entries h3 a:focus-visible { color: var(--accent); }

/* Hover only where a pointer can hover, so effects don't stick after a tap. */
@media (hover: hover) {
  .links a:hover {
    transform: translateY(-2px);
    border-color: var(--accent-line);
    color: var(--accent);
  }

  .project:hover .shot {
    transform: translateY(-4px);
    box-shadow: 0 0 0 1px rgba(28, 25, 23, 0.06), 0 26px 50px -24px rgba(28, 25, 23, 0.5);
  }

  .project:hover h3 { color: var(--accent); }

  .project:hover .arrow {
    transform: translate(2px, -2px);
    color: var(--accent);
  }

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

/* --- Small screens ----------------------------------------------------------- */

@media (max-width: 760px) {
  .page { padding: 40px 20px 64px; }
  .intro { grid-template-columns: auto 1fr; gap: 20px; }
  .photo { width: 88px; height: 88px; }
  .links { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; margin-top: 0; }
  .lede { margin-top: 32px; font-size: 17px; }
  section { margin-top: 52px; }
  .projects { gap: 44px; }
  .project { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 480px) {
  .intro { grid-template-columns: 1fr; }
  .entries li, .skills { grid-template-columns: 1fr; gap: 2px; }
  .skills dd { margin-bottom: 10px; }
}

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