:root {
  --bg: #f4efe6;
  --bg-soft: #ebe4d8;
  --surface: #fbf8f2;
  --ink: #182522;
  --muted: #65716b;
  --line: #d6cdbf;
  --accent: #0d6b61;
  --accent-soft: #dcece7;
  --accent-ink: #08473f;
  --warm: #b45f3c;
  --shadow: 0 20px 60px rgba(30, 42, 38, 0.08);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Noto Serif SC", "Songti SC", serif;
  --sans: "Avenir Next", "Segoe UI", "Noto Sans SC", "PingFang SC", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
}

[data-theme="dark"] {
  --bg: #111816;
  --bg-soft: #17201d;
  --surface: #1a2421;
  --ink: #e8eee9;
  --muted: #9aa8a0;
  --line: #2f3d38;
  --accent: #75c7b8;
  --accent-soft: #1f3530;
  --accent-ink: #b9e6dc;
  --warm: #e09a76;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(13, 107, 97, 0.08), transparent 34rem),
    radial-gradient(circle at 88% 18%, rgba(180, 95, 60, 0.06), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

a:hover { color: var(--accent); }

.shell {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 4px;
}
.skip-link:focus { top: 12px; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
}

.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.brand-dot { color: var(--warm); }

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  position: relative;
  color: var(--muted);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -6px;
  height: 1px;
  background: var(--accent);
  transition: right 180ms ease;
}

.nav a:hover { color: var(--ink); }
.nav a:hover::after { right: 0; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Hero */

.hero-copy, .hero-card, .section-head > *, .work-body, .note, .contact-card {
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: clamp(40px, 7vw, 96px);
  align-items: end;
  padding: clamp(72px, 10vw, 132px) 0 clamp(56px, 8vw, 92px);
}

.eyebrow {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}

h1, h2, h3, p, a, dd, dt {
  overflow-wrap: break-word;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0;
  font-size: clamp(3.4rem, 8vw, 6.6rem);
  line-height: 0.92;
}

h1 em {
  color: var(--accent);
  font-weight: 400;
}

.lede {
  max-width: 38rem;
  margin: 30px 0 0;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--muted);
}

.lede strong { color: var(--ink); font-weight: 600; }

.hero-meta {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.sep { margin: 0 8px; color: var(--line); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover { transform: translateY(-1px); }

.button-primary {
  background: var(--ink);
  color: var(--bg);
}
.button-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.button-ghost { color: var(--ink); }
.button-ghost:hover { border-color: var(--accent); }

.hero-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: linear-gradient(160deg, var(--surface), color-mix(in srgb, var(--surface) 82%, var(--accent-soft)));
  box-shadow: var(--shadow);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  pointer-events: none;
}

.card-kicker {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--warm);
}

.hero-card h2 {
  margin: 16px 0 10px;
  font-size: 1.7rem;
  line-height: 1.15;
}

.hero-card p { color: var(--muted); font-size: 0.92rem; }

.signal-list {
  margin: 24px 0;
  border-top: 1px solid var(--line);
}

.signal-list div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}

.signal-list dt { color: var(--muted); }
.signal-list dd {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  text-align: right;
  overflow-wrap: anywhere;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.text-link {
  display: inline-flex;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
}

/* Sections */

.section {
  padding: clamp(64px, 8vw, 104px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 48px;
}

.section-head .eyebrow { grid-column: 1 / -1; margin-bottom: -8px; }

.section-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
}

.section-intro {
  margin: 0;
  color: var(--muted);
  max-width: 34rem;
  justify-self: end;
}

/* Research */

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.research-card {
  padding: 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  transition: background 180ms ease;
}

.research-card:hover { background: var(--surface); }

.card-index {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--warm);
}

.research-card h3 {
  margin: 30px 0 12px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.research-card p { color: var(--muted); font-size: 0.9rem; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}

.tags span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
}

/* Work */

.work-list { border-top: 1px solid var(--line); }

.work-item {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 28px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.work-year {
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.work-body h3 {
  margin: 0 0 10px;
  font-size: 1.55rem;
  line-height: 1.2;
}

.work-type {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  vertical-align: middle;
  text-transform: uppercase;
}

.work-body p {
  max-width: 46rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.work-links a { color: var(--accent); border-bottom: 1px solid currentColor; }
.muted { color: var(--muted); }

/* Publications */

.empty-state {
  padding: 36px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
}

.empty-state p {
  max-width: 42rem;
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.15rem;
}

/* Notes */

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.note {
  padding: 26px;
  border-top: 2px solid var(--accent);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.note-date {
  margin: 0 0 26px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--warm);
}

.note h3 { margin: 0 0 10px; font-size: 1.25rem; }
.note p:last-child { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* Contact */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 48px;
  align-items: start;
}

.contact h2 { margin: 0 0 16px; font-size: clamp(2.2rem, 4vw, 3.6rem); }

.contact-card {
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.contact-card a {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.contact-card a:hover { color: var(--accent); }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-inner p { margin: 0; }

/* Small screens */

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero-card { width: 100%; max-width: 560px; }
  .section-head { grid-template-columns: 1fr; }
  .section-intro { justify-self: start; }
  .research-grid { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 32px, 1120px); }
  .nav { display: none; }
  .header-inner { min-height: 64px; }
  .hero { padding-top: 54px; }
  .work-item { grid-template-columns: 1fr; gap: 8px; }
  .work-year { padding-top: 0; }
  h1 { font-size: clamp(2.7rem, 12.5vw, 4rem); }
  .hero-meta { overflow-wrap: anywhere; }
}

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