:root {
  --bg: #F7F7F5;
  --ink: #111111;
  --muted: #5c5c5c;
  --grid: #B8B8B8;
  --line: #dcdcd8;
  --surface: #FFFFFF;
  --accent: #2F3BFF;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
  --gutter: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
em { font-style: italic; }

.dots {
  position: fixed; inset: 0; z-index: -1;
  background-image: radial-gradient(var(--grid) 1px, transparent 1.2px);
  background-size: 28px 28px;
  opacity: .45;
}

.container { max-width: 1320px; margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(80px, 12vw, 160px); border-top: 1px solid var(--line); }

.mono, .label, dt, .when, .num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.label { color: var(--muted); margin-bottom: 28px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav__brand { font-weight: 500; }
.nav__links { display: flex; gap: clamp(14px, 3vw, 32px); font-size: 14px; }
.nav__links a { position: relative; padding-block: 2px; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--accent); transition: width .25s;
}
.nav__links a:hover::after, .nav__links a.active::after { width: 100%; }
.nav__links a.active { color: var(--accent); }

/* Side rail */
.rail {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 14px; z-index: 5;
  font-family: var(--mono); font-size: 11px; color: var(--grid);
}
.rail span { transition: color .25s, transform .25s; }
.rail span.active { color: var(--accent); transform: translateX(-4px); }

/* Type */
.display {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 8vw, 104px);
  line-height: .98; letter-spacing: -.02em;
  max-width: 14ch;
}
.display em, .statement em { color: var(--accent); }
.mark {
  display: inline-block; width: .22em; height: .22em; margin-right: .18em;
  background: var(--accent); vertical-align: .55em;
}
.title { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5vw, 60px); line-height: 1.05; margin-bottom: 64px; }
.statement { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.6vw, 58px); line-height: 1.08; letter-spacing: -.01em; margin-bottom: 32px; }
.lede { font-size: clamp(17px, 1.6vw, 20px); max-width: 52ch; margin-top: 32px; }
.body { max-width: 58ch; color: #333; }
.meta { margin-top: 20px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  padding: 14px 22px; border: 1px solid var(--ink); border-radius: 999px;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: var(--accent); color: #fff; }

/* Hero */
.hero {
  position: relative;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: end;
  min-height: calc(100vh - 62px); padding-block: clamp(48px, 8vw, 96px);
}
.hero__text { grid-column: 1 / span 8; }
.photo { grid-column: 10 / span 3; margin: 0; }
.photo__ph {
  position: relative; aspect-ratio: 4 / 5; display: grid; place-items: center; text-align: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  background-image: repeating-linear-gradient(45deg, transparent 0 10px, #f0f0ed 10px 11px);
}
.photo__ph img, .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo__corner { position: absolute; width: 14px; height: 14px; border: 1px solid var(--accent); }
.photo__corner--tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.photo__corner--br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.photo figcaption { margin-top: 10px; color: var(--muted); }
.plus { position: absolute; font-family: var(--mono); color: var(--grid); font-size: 18px; }
.plus--tl { top: 24px; left: calc(var(--gutter) - 8px); }

/* About */
.about { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.about__main { grid-column: 1 / span 7; }
.facts { grid-column: 9 / span 4; align-self: end; }
.facts div { padding-block: 14px; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); margin-bottom: 4px; }
.facts dd { font-size: 15px; }

/* Work */
.project { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; margin-bottom: clamp(64px, 9vw, 120px); align-items: end; }
.project__img {
  grid-column: 1 / span 8; aspect-ratio: 16 / 10; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  background-image: repeating-linear-gradient(45deg, transparent 0 10px, #f0f0ed 10px 11px);
  transition: border-color .25s;
}
.project:hover .project__img { border-color: var(--accent); }
.project__img img { width: 100%; height: 100%; object-fit: cover; }
.project__info { grid-column: 9 / span 4; }
.project--flip .project__img { grid-column: 5 / span 8; order: 2; }
.project--flip .project__info { grid-column: 1 / span 4; order: 1; }
.num { color: var(--accent); margin-bottom: 16px; }
.project__desc { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; margin-bottom: 24px; }
.project__meta div { padding-block: 10px; border-top: 1px solid var(--line); }
.project__meta dt { color: var(--muted); }
.project__meta dd { font-size: 14px; }
.link { display: inline-block; margin-top: 22px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid currentColor; padding-bottom: 2px; transition: color .2s, transform .2s; }
.link:hover { color: var(--accent); transform: translateX(4px); }

/* Experience */
.caps { margin-bottom: 96px; }
.caps li { display: grid; grid-template-columns: 80px 1fr; gap: 24px; padding-block: 28px; border-top: 1px solid var(--line); transition: padding-left .25s; }
.caps li:hover { padding-left: 12px; }
.caps li:hover .mono { color: var(--accent); }
.caps li:last-child { border-bottom: 1px solid var(--line); }
.caps h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3vw, 40px); line-height: 1.1; }
.caps p { color: var(--muted); max-width: 60ch; margin-top: 6px; }

.timeline { margin-bottom: 96px; }
.timeline > li { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding-block: 32px; border-top: 1px solid var(--line); }
.when { color: var(--muted); padding-top: 6px; }
.timeline h3 { font-size: 20px; font-weight: 500; margin-bottom: 12px; }
.timeline h3 span { color: var(--muted); font-weight: 400; }
.timeline ul li { position: relative; padding-left: 20px; margin-bottom: 8px; font-size: 15px; color: #333; max-width: 70ch; }
.timeline ul li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; background: var(--accent); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-family: var(--mono); font-size: 12px; padding: 8px 12px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, color .2s; }
.chips li:hover { border-color: var(--accent); color: var(--accent); }
.edu li { padding-block: 14px; border-top: 1px solid var(--line); }
.edu b { display: block; font-weight: 500; }
.edu span { font-size: 14px; color: var(--muted); }

/* Contact */
.contact .display { max-width: 12ch; }
.links { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 56px; font-family: var(--mono); font-size: 13px; }
.links a { border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.links a:hover { color: var(--accent); border-color: var(--accent); }

.footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 32px; border-top: 1px solid var(--line); color: var(--muted); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .status i { animation: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .rail { display: none; }
  .hero { display: flex; flex-direction: column-reverse; align-items: stretch; min-height: 0; }
  .photo { max-width: 220px; }
  .about, .project { display: block; }
  .facts { margin-top: 48px; }
  .project__img { margin-bottom: 24px; }
  .cols { grid-template-columns: 1fr; }
  .timeline > li { grid-template-columns: 1fr; gap: 8px; }
  .caps li { grid-template-columns: 48px 1fr; }
}
@media (max-width: 520px) {
  .nav__links a:not(.nav__cta) { display: none; }
}
