
:root {
  --ink: #14201c;
  --ink-soft: #2a3a34;
  --paper: #faf7f0;
  --paper-deep: #efe8d8;
  --accent: #5c4a32;
  --accent-soft: #f0e8d4;
  --line: rgba(20, 32, 28, 0.1);
  --shadow: 0 24px 60px rgba(20, 32, 28, 0.06);
  --display: "DM Sans", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --ui: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  /* Flat paper — no mid-page gradient band */
  background: var(--paper);
  font-family: var(--body);
  line-height: 1.65;
  font-size: 1.05rem;
}
h1, h2, h3, .brand, .page-title h1, .section-label, .hero .hi, .project h2 {
  font-family: var(--display);
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
.wrap { width: min(1100px, calc(100% - 2.5rem)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(250, 247, 240, 0.9);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; flex-wrap: nowrap; align-items: baseline; justify-content: space-between;
  gap: 1rem 1.75rem; padding: 2.15rem 0 2rem;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(1.8rem, 3.4vw, 2.85rem);
  line-height: 1;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
}
.brand .brand-name {
  display: block;
  line-height: 1;
  font: inherit;
}
.brand .brand-deg {
  display: block;
  font-family: var(--ui);
  font-size: clamp(0.92rem, 1.4vw, 1.12rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink-soft);
  line-height: 1;
}
.nav-links {
  display: flex; flex-wrap: nowrap; gap: 0.65rem 1.9rem;
  font-family: var(--ui);
  font-size: clamp(0.78rem, 1.1vw, 0.92rem);
  letter-spacing: 0.07em;
  align-items: baseline; justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}
.nav-links a {
  color: var(--ink-soft); text-decoration: none; text-transform: uppercase; font-weight: 600;
  white-space: nowrap;
  line-height: 1;
  display: inline-block;
  position: relative;
  z-index: 2;
  padding: 0.15rem 0;
}
.nav-links a[aria-current="page"], .nav-links a:hover { color: var(--ink); }
@media (max-width: 900px) {
  .nav { flex-wrap: wrap; align-items: center; }
  .nav-links { flex-wrap: wrap; justify-content: flex-start; width: 100%; }
}
main { padding-bottom: 3.5rem; }
.page-title { margin: 2.5rem 0 1.5rem; padding: 0; border: 0; background: none; box-shadow: none; }
.page-title h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.015em;
  text-transform: none;
  line-height: 1.15;
}
.hero {
  padding: 3.5rem 0 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(200px, 0.75fr);
  gap: 2rem;
  align-items: end;
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; }
  .cta-row { justify-content: center; }
  .portrait { margin: 0 auto; }
}
.hero .hi {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--ink);
  letter-spacing: 0.015em;
}
.hero p {
  margin: 0 0 0.85rem;
  color: var(--ink-soft);
  max-width: 36rem;
  font-size: 1.15rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.35rem; }
.btn {
  font-family: var(--ui);
  display: inline-flex; align-items: center;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--ink);
  color: var(--paper);
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
}
.btn:hover { background: var(--accent); color: var(--paper); text-decoration: none !important; }
.portrait {
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  aspect-ratio: 4/5;
  background: var(--paper-deep);
  max-width: 260px;
  width: 100%;
  margin-left: auto;
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block;
}
.section-label {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.45rem;
  margin: 2.35rem 0 0.85rem;
  padding-bottom: 0;
  border-bottom: 0;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.section-label.caps {
  font-family: var(--display);
  font-size: 1.15rem; /* match .job h3 (e.g. Senior Software Engineer) */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-top: 2.75rem;
}
.job { padding: 1.1rem 0; margin: 0; border-bottom: 1px solid var(--line); }
.job:last-of-type { border-bottom: 0; }
.job h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  color: var(--ink);
  font-weight: 600;
  font-family: var(--display);
  letter-spacing: 0.015em;
}
.job .meta { color: var(--ink-soft); font-size: 0.95rem; margin: 0; font-family: var(--ui); }
.job p { color: var(--ink-soft); }
.project {
  padding: 1.75rem 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.project:last-child { border-bottom: 0; }
.project h2 {
  margin: 0 0 0.75rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.015em;
}
.project h2 a { color: inherit; text-decoration: none; }
.project p { margin: 0 0 0.85rem; color: var(--ink-soft); }
.slideshow {
  margin: 1.1rem auto 1.35rem;
  max-width: 904px;
}
.slideshow-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 904 / 447;
  overflow: hidden;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  box-shadow: var(--shadow);
}
.slideshow-viewport img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 300ms ease;
  background: rgba(255,255,255,0.55);
  pointer-events: none;
  z-index: 0;
}
.slideshow-viewport img.is-active {
  opacity: 1;
  z-index: 1;
}
.slideshow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(243, 239, 230, 0.9);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.slideshow-btn svg { width: 18px; height: 34px; display: block; fill: currentColor; pointer-events: none; }
.slideshow-btn.prev { left: 6px; }
.slideshow-btn.next { right: 6px; }
.slideshow-btn:hover { background: var(--paper-deep); }
.slideshow-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0 0.1rem;
  position: relative;
  z-index: 5;
}
.slideshow-dots button {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(20, 32, 28, 0.25);
  cursor: pointer;
}
.slideshow-dots button[aria-current="true"] {
  background: var(--ink);
  width: 11px;
  height: 11px;
}
.pub {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 0.95rem 1.25rem;
  align-items: start;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}
.pub.no-thumb { grid-template-columns: 1fr; }
.pub-thumb {
  width: 170px;
  height: 128px;
  border-radius: 0.35rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.65);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.pub-body { min-width: 0; }
.pub h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  line-height: 1.35;
  font-family: var(--ui);
  font-weight: 600;
  color: var(--ink);
}
.pub .venue { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 0.55rem; }
@media (max-width: 560px) {
  /* Phone-only layout polish — desktop rules above stay untouched. */
  .wrap { width: min(1100px, calc(100% - 2rem)); }
  .nav {
    padding: 1.35rem 0 1.2rem;
    gap: 0.85rem;
  }
  .brand { font-size: 1.7rem; }
  .brand .brand-deg { font-size: 0.92rem; }
  .nav-links {
    display: grid;
    grid-template-columns: max-content max-content;
    column-gap: 1.05rem;
    row-gap: 0.95rem;
    justify-content: start;
    width: 100%;
    font-size: 0.8rem;
    letter-spacing: 0.055em;
  }
  .page-title { margin: 1.45rem 0 1.05rem; }
  .page-title h1 { font-size: 1.55rem; }
  .hero {
    padding: 1.75rem 0 1.75rem;
    gap: 1.35rem;
  }
  .hero .hi { font-size: 1.75rem; }
  .hero p { font-size: 1.05rem; }
  .cta-row { justify-content: center; }
  .portrait {
    margin-left: auto;
    margin-right: auto;
    max-width: 220px;
  }
  .section-label { margin-top: 1.85rem; font-size: 1.25rem; }
  .section-label.caps { margin-top: 2rem; font-size: 1.05rem; }
  .project h2 { font-size: 1.25rem; }
  .pub {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1.25rem 0;
  }
  .pub-thumb {
    width: 188px;
    height: 142px;
    margin-left: auto;
    margin-right: auto;
  }
  .chip {
    padding: 0.42rem 0.9rem;
    font-size: 0.88rem;
  }
  .slideshow-btn { width: 38px; height: 38px; }
  .slideshow-btn.prev { left: 4px; }
  .slideshow-btn.next { right: 4px; }
}
.links { display: flex; flex-wrap: wrap; gap: 0.5rem; font-family: var(--ui); font-size: 0.85rem; }
.chip {
  display: inline-flex; align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 0;
  background: var(--accent-soft);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.88rem;
  font-family: var(--ui);
}
.chip:hover { background: var(--ink); color: var(--paper); }
.site-footer { display: none; }
.pill-list { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.75rem 0 1.1rem; }
.pill {
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--ui);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.7);
  color: var(--ink);
}
ul.plain { margin: 0.45rem 0 1.1rem 1.15rem; padding: 0; color: var(--ink-soft); }
ul.plain li { margin: 0.3rem 0; }
