@font-face {
  font-family: "Geist Serif";
  src: url("/fonts/GeistSerif.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f2f1ec;
  --fg: #171614;
  --muted: #5f5d57;
  --line: rgba(23, 22, 20, 0.12);
  --ink: #171614;
  --teal: #a4ced0;
  --peach: #edbb99;
  --grain-opacity: 0.35;
  --grain-blend: multiply;
  --serif: "Geist Serif", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0a;
    --fg: #ecebe6;
    --muted: #9c9a94;
    --line: rgba(236, 235, 230, 0.14);
    --grain-opacity: 0.18;
    --grain-blend: screen;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0a;
  --fg: #ecebe6;
  --muted: #9c9a94;
  --line: rgba(236, 235, 230, 0.14);
  --grain-opacity: 0.18;
  --grain-blend: screen;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Theme switch */
.theme { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.theme button {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 999px; cursor: pointer; background: transparent; color: var(--muted);
}
.theme button:hover { color: var(--fg); }
.theme button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* Hero */
.hero { display: flex; flex-direction: column; gap: 28px; padding: 180px 0 96px; }
.kicker, .label, .year, .card-meta {
  font-family: var(--mono); font-size: 12px; font-weight: 400;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.kicker, .label { margin: 0; color: var(--muted); }
h1 {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(64px, 11vw, 148px); line-height: 0.92; letter-spacing: -0.035em;
}
.lede { margin: 0; max-width: 680px; font-size: 19px; line-height: 1.5; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line); font-size: 14px;
}
.btn:hover { text-decoration: none; border-color: var(--fg); }
.btn-solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* Sections */
.sec {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px;
  padding: 56px 0; border-top: 1px solid var(--line);
}

/* Project cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto minmax(64px, 1fr) auto auto; gap: 0 16px; }
.card {
  display: grid; grid-row: span 4; grid-template-rows: subgrid;
  min-height: 280px; padding: 28px; border-radius: 6px; color: var(--ink);
  transition: transform 0.25s ease;
}
.card:hover { text-decoration: none; transform: translateY(-3px); }
.card-teal { background: var(--teal); }
.card-peach { background: var(--peach); }
.card > div { display: contents; }
.card .card-meta { grid-row: 1; display: flex; justify-content: space-between; letter-spacing: 0.04em; }
.card-title { grid-row: 3; margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; letter-spacing: -0.02em; }
.card p { grid-row: 4; margin: 0; max-width: 360px; font-size: 15px; line-height: 1.45; opacity: 0.8; }

/* Rows: experience + publications */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 24px;
  align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line);
}
.year { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.pub { font-family: var(--serif); font-size: 21px; line-height: 1.25; }
a.row:hover { text-decoration: none; }
a.row:hover .pub { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.profiles { display: flex; gap: 20px; margin: 16px 0 0; font-size: 14px; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; }
.skills h3 { margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: 22px; }
.skills p { margin: 0; font-size: 15px; }

/* Footer */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  padding: 24px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.foot { align-items: center; padding: 12px 0; position: relative; z-index: 1; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.foot nav a:hover { color: var(--fg); }
.outline {
  font-family: var(--serif); font-size: clamp(88px, 19vw, 280px);
  line-height: 0.8; letter-spacing: -0.04em; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px var(--fg); opacity: 0.35;
  padding-top: 24px; margin-bottom: -0.12em; user-select: none; pointer-events: none;
}

@media (max-width: 720px) {
  .hero { padding: 96px 0 64px; }
  .sec { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 40px 0; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .cards, .skills { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-rows: none; gap: 16px; }
  .card { grid-row: auto; grid-template-rows: auto minmax(40px, 1fr) auto auto; min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}
