:root {
  --bg: #f3f1ec;
  --surface: #ebe8e1;
  --ink: #141414;
  --muted: #6b6a66;
  --line: #d6d2c9;
  --accent: #ff4a1c;
  --accent-ink: #ffffff;
  --sans: "Inter Tight", system-ui, -apple-system, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111110;
    --surface: #1a1a18;
    --ink: #eeece6;
    --muted: #8f8d86;
    --line: #2c2b28;
    --accent: #ff5a2e;
    --accent-ink: #111110;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111110;
  --surface: #1a1a18;
  --ink: #eeece6;
  --muted: #8f8d86;
  --line: #2c2b28;
  --accent: #ff5a2e;
  --accent-ink: #111110;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--accent-ink); }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; text-transform: uppercase; }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); font-weight: 400; }

/* Top bar */
.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px var(--gutter);
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(10px);
}
.bar .brand { font-weight: 700; letter-spacing: -.02em; font-size: 15px; }
.bar .brand em { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 17px; }
.bar nav { display: flex; gap: 20px; align-items: center; }
.bar nav a { position: relative; }
.bar nav a[aria-current="page"]::after,
.bar nav a:hover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.live { display: inline-flex; align-items: center; gap: 8px; }
.live .dot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.wrap { padding: 0 var(--gutter); max-width: 1440px; margin: 0 auto; }

/* Landing */
.hero { text-align: center; padding: clamp(32px, 8vh, 96px) 0 clamp(32px, 6vh, 72px); }
.hero .kicker { margin-bottom: 20px; }
.name { line-height: .86; letter-spacing: -.045em; }
.name .a { display: block; font-weight: 800; font-size: clamp(64px, 15vw, 220px); }
.name .b { display: block; font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -.02em; font-size: clamp(60px, 14vw, 210px); }
.hero p.lede { max-width: 30ch; margin: 28px auto 0; font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); }

.choose { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.choice {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  padding: clamp(24px, 4vw, 48px) var(--gutter); min-height: 340px;
  border-right: 1px solid var(--line); overflow: hidden; isolation: isolate;
  transition: color .35s ease;
}
.choice:last-child { border-right: 0; }
.choice::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink);
  transform: translateY(101%); transition: transform .5s cubic-bezier(.7, 0, .2, 1);
}
.choice:hover, .choice:focus-visible { color: var(--bg); outline: none; }
.choice:hover::before, .choice:focus-visible::before { transform: translateY(0); }
.choice:hover .muted, .choice:focus-visible .muted { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.choice .top { display: flex; justify-content: space-between; }
.choice h2 { font-size: clamp(40px, 6vw, 88px); line-height: .95; letter-spacing: -.04em; font-weight: 700; }
.choice h2 em { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.choice p { max-width: 36ch; margin-top: 14px; }
.arrow { width: 44px; height: 44px; border: 1px solid currentColor; border-radius: 50%; display: grid; place-items: center; transition: transform .35s ease, background .35s; }
.choice:hover .arrow { transform: rotate(-45deg); background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

footer.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 24px var(--gutter); border-top: 1px solid var(--line);
}
footer.foot a:hover { color: var(--accent); }

/* Page header */
.page-head { padding: clamp(40px, 8vh, 96px) 0 clamp(32px, 6vh, 64px); display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: end; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(52px, 9vw, 140px); line-height: .9; letter-spacing: -.045em; font-weight: 800; }
.page-head h1 em { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; }
.page-head .side { display: grid; gap: 16px; }
.page-head .side p { font-size: 17px; max-width: 42ch; }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 14px; background: transparent; color: inherit; cursor: pointer; font-family: inherit;
  transition: background .2s, color .2s, border-color .2s;
}
.pill:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill.solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pill.solid:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill svg { width: 14px; height: 14px; }

/* Sections */
section.block { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: clamp(40px, 7vh, 80px) 0; border-bottom: 1px solid var(--line); }
section.block > .label { padding-top: 6px; }
.summary { font-size: clamp(22px, 2.6vw, 34px); line-height: 1.25; letter-spacing: -.02em; max-width: 30ch; }
.summary em { font-family: var(--serif); font-style: italic; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 40px; }
.stat { background: var(--bg); padding: 22px 20px; }
.stat b { display: block; font-size: clamp(32px, 4vw, 52px); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.stat span { display: block; margin-top: 10px; color: var(--muted); font-size: 14px; }

/* Experience timeline */
.jobs { list-style: none; }
.job { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.job:first-child { border-top: 0; padding-top: 0; }
.job .when { padding-top: 6px; }
.job .when .loc { display: block; margin-top: 6px; color: var(--muted); }
.job h3 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.03em; line-height: 1.1; font-weight: 700; }
.job h3 em { font-family: var(--serif); font-weight: 400; font-style: italic; color: var(--muted); }
.job ul { margin-top: 14px; padding-left: 0; list-style: none; display: grid; gap: 6px; max-width: 70ch; }
.job li { position: relative; padding-left: 20px; }
.job li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 1px; background: var(--muted); }
.tag { display: inline-block; margin-left: 10px; vertical-align: middle; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }

/* Work grid */
.work { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card { background: var(--bg); padding: 26px 24px 28px; display: grid; gap: 12px; align-content: start; transition: background .25s; }
.card:hover { background: var(--surface); }
.card .meta { display: flex; justify-content: space-between; gap: 12px; }
.card h4 { font-size: 22px; letter-spacing: -.025em; line-height: 1.15; font-weight: 700; }
.card p { color: var(--muted); font-size: 15px; }

/* Projects index */
.index { list-style: none; }
.index-head, .proj {
  display: grid; grid-template-columns: 56px 1.3fr 1.6fr 160px 44px; gap: 24px; align-items: center;
}
.index-head { padding: 0 0 14px; border-bottom: 1px solid var(--line); }
.proj { position: relative; padding: 30px 0; border-bottom: 1px solid var(--line); isolation: isolate; }
.proj::before {
  content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1); z-index: -1; background: var(--surface);
  opacity: 0; transition: opacity .25s;
}
.proj:hover::before { opacity: 1; }
.proj .title { font-size: clamp(28px, 3.6vw, 52px); letter-spacing: -.04em; line-height: 1; font-weight: 700; }
.proj .title small { display: block; margin-top: 10px; font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: .02em; color: var(--muted); text-transform: none; }
.proj p { color: var(--muted); max-width: 46ch; }
.proj:hover .arrow { transform: rotate(-45deg); background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.status { display: inline-flex; align-items: center; gap: 8px; }
.status.soon .dot { background: var(--muted); animation: none; }
.proj.child .title { padding-left: 28px; position: relative; }
.proj.child .title::before { content: "↳"; position: absolute; left: 0; font-weight: 400; color: var(--muted); font-size: .6em; top: .2em; }

.note { padding: clamp(40px, 7vh, 80px) 0; display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
.note p { font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -.02em; line-height: 1.3; max-width: 34ch; }
.note p em { font-family: var(--serif); font-style: italic; }

/* Theme toggle */
.theme-btn { background: none; border: 1px solid var(--line); color: inherit; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.theme-btn:hover { border-color: var(--ink); }
.theme-btn svg { width: 14px; height: 14px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); animation: rise .8s cubic-bezier(.2, .7, .2, 1) forwards; }
.reveal.d1 { animation-delay: .08s; } .reveal.d2 { animation-delay: .16s; } .reveal.d3 { animation-delay: .24s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .choice::before, .arrow { transition: none; }
}

@media (max-width: 860px) {
  .choose { grid-template-columns: 1fr; }
  .choice { border-right: 0; border-bottom: 1px solid var(--line); min-height: 240px; }
  .page-head { grid-template-columns: 1fr; }
  section.block, .note { grid-template-columns: 1fr; gap: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .job { grid-template-columns: 1fr; gap: 10px; }
  .work { grid-template-columns: 1fr; }
  .index-head { display: none; }
  .proj { grid-template-columns: 1fr 44px; gap: 12px 16px; }
  .proj .num { display: none; }
  .proj .title { grid-column: 1 / -1; }
  .proj p { grid-column: 1 / -1; }
  .proj .status { grid-column: 1; }
  .proj .arrow { grid-column: 2; grid-row: 3; }
  .bar nav .hide-sm { display: none; }
}

@media print {
  :root { --bg: #fff; --ink: #000; --muted: #555; --line: #ddd; --accent: #000; --accent-ink: #fff; }
  .bar, footer.foot, .no-print { display: none !important; }
  .reveal { animation: none; opacity: 1; transform: none; }
  body { font-size: 11pt; }
  .page-head { padding: 0 0 16px; }
  .page-head h1 { font-size: 44pt; }
  section.block { padding: 18px 0; grid-template-columns: 120px 1fr; break-inside: auto; }
  .job { grid-template-columns: 140px 1fr; padding: 12px 0; break-inside: avoid; }
  .card { break-inside: avoid; padding: 12px; }
  .summary { font-size: 15pt; max-width: none; }
  .stats { margin-top: 16px; }
}
