:root {
  --paper: #f7f4ed;
  --surface: #fffdf8;
  --ink: #172019;
  --muted: #657066;
  --accent: #1e6447;
  --accent-soft: #dceadf;
  --line: #d9ddd5;
  --warm: #b96a3c;
  --shadow: 0 18px 45px rgba(31, 48, 37, 0.08);
  --sans: "DM Sans", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
}
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--warm); }
img { max-width: 100%; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 8px 12px; background: white; }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(247,244,237,.92); border-bottom: 1px solid rgba(217,221,213,.9); backdrop-filter: blur(14px); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-name { display: flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; color: white; background: var(--accent); font-family: var(--serif); font-size: 16px; }
.site-nav { display: flex; align-items: center; gap: 5px; }
.site-nav a { padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; text-decoration: none; }
.site-nav a:hover, .site-nav a.active { color: var(--accent); background: var(--accent-soft); }
.nav-toggle { display: none; padding: 8px; border: 0; background: transparent; }
.nav-toggle span:not(.sr-only) { display: block; width: 23px; height: 2px; margin: 5px; background: var(--ink); }

.site-main { min-height: calc(100vh - 164px); }
.page { width: min(850px, calc(100% - 40px)); margin: 0 auto; padding: 74px 0 90px; }
.page-wide { width: min(1040px, calc(100% - 40px)); }
.eyebrow { margin: 0 0 10px; color: var(--warm); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; }
h1 { margin: 0 0 22px; font-size: clamp(46px, 7vw, 76px); letter-spacing: -.025em; }
h2 { margin: 52px 0 18px; font-size: clamp(31px, 4vw, 43px); }
h3 { margin: 34px 0 12px; font-size: 27px; }
.lede { max-width: 720px; margin: 0; color: var(--muted); font-family: var(--serif); font-size: clamp(22px, 3vw, 29px); line-height: 1.42; }
.rule { width: 54px; height: 3px; margin: 34px 0; border: 0; background: var(--warm); }

.hero { display: grid; grid-template-columns: 1fr 280px; gap: clamp(45px, 8vw, 100px); align-items: center; padding-top: 86px; }
.portrait-wrap { position: relative; }
.portrait-wrap::before { content: ""; position: absolute; inset: 22px -18px -18px 22px; border: 1px solid var(--warm); border-radius: 150px 150px 16px 16px; }
.portrait { position: relative; display: block; aspect-ratio: 4/5; width: 100%; object-fit: cover; object-position: center top; border-radius: 150px 150px 16px 16px; filter: saturate(.86); }
.portrait { object-position: 30% center; }
.bio { margin-top: 66px; columns: 2; column-gap: 56px; }
.bio p:first-child { margin-top: 0; }
.contact-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-weight: 500; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 34px; }
.card { padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.card h2, .card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.meta { color: var(--muted); font-size: 14px; }
.project-card { display: block; padding: 0; overflow: hidden; color: var(--ink); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.project-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: 0 22px 52px rgba(31, 48, 37, 0.13); }
.project-preview { display: block; width: 100%; aspect-ratio: 3/2; object-fit: cover; border-bottom: 1px solid var(--line); }
.project-preview-document { object-position: center top; }
.project-copy { display: flex; flex-direction: column; align-items: flex-start; padding: 24px 28px 28px; }
.project-title { margin: 5px 0 9px; font-family: var(--serif); font-size: 28px; line-height: 1.12; }
.project-copy .text-link { margin-top: 18px; color: var(--accent); }
.text-link { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; text-decoration: none; }
.text-link::after { content: "→"; transition: transform .2s; }
.text-link:hover::after { transform: translateX(4px); }

.section-block { padding: 8px 0 24px; border-top: 1px solid var(--line); }
.exposition-section { margin-top: 62px; }
.exposition-section.section-block { margin-top: 72px; }
.exposition-section h2 { margin-top: 0; }
.section-subtitle { max-width: 680px; margin-top: -8px; color: var(--muted); font-family: var(--serif); font-size: 21px; }
.event-list { padding: 0; list-style: none; }
.event { display: grid; grid-template-columns: 125px 1fr; gap: 22px; padding: 25px 0; border-bottom: 1px solid var(--line); }
.event-date { color: var(--warm); font-size: 14px; font-weight: 600; }
.event h3 { margin: 0 0 5px; font-family: var(--sans); font-size: 18px; font-weight: 600; line-height: 1.4; }
.event p { margin: 0; color: var(--muted); }

.document-frame { width: 100%; height: min(78vh, 900px); margin-top: 30px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.button { display: inline-flex; align-items: center; padding: 10px 16px; border-radius: 8px; color: white; background: var(--accent); font-weight: 600; text-decoration: none; }
.button:hover { color: white; background: #154c35; }
.cv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
.social-button { gap: 8px; color: var(--accent); border: 1px solid var(--accent); background: transparent; }
.social-button:hover { color: white; }
.social-button svg { width: 19px; height: 19px; fill: currentColor; }

.coursework .accordion { position: relative; width: 100%; margin: 8px 0 0; padding: 17px 52px 17px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font: 500 16px/1.45 var(--sans); text-align: left; cursor: pointer; transition: border-color .2s, background .2s; }
.coursework .accordion::after { content: "+"; position: absolute; right: 19px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 24px; font-weight: 400; }
.coursework .accordion.active { border-radius: 10px 10px 0 0; border-color: #9db7a7; background: var(--accent-soft); }
.coursework .accordion.active::after { content: "−"; }
.coursework .panel { display: none; padding: 18px 20px; border: 1px solid #9db7a7; border-top: 0; border-radius: 0 0 10px 10px; background: var(--surface); }
.coursework .panel p:first-child { margin-top: 0; }
.coursework .panel pre { margin-bottom: 0; white-space: pre-wrap; font: 14px/1.6 var(--sans); color: var(--muted); }
.coursework ul { padding-left: 22px; }
.coursework .section-intro { margin-top: -8px; color: var(--muted); font-family: var(--serif); font-size: 21px; }

.slideshow-title { margin: 58px auto 22px; max-width: 680px; text-align: center; }
.slideshow { position: relative; margin: 0 0 66px; }
.slideshow-stage { position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: 16px; background: #e7e3da; box-shadow: var(--shadow); }
.slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; visibility: hidden; transition: opacity 1.1s ease, visibility 1.1s; }
.slide.active { opacity: 1; visibility: visible; }
.slideshow-controls { display: flex; justify-content: center; gap: 9px; margin-top: 15px; }
.slide-dot { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: #aeb7af; cursor: pointer; transition: transform .2s, background .2s; }
.slide-dot:hover { transform: scale(1.25); }
.slide-dot.active { background: var(--accent); }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-inner { min-height: 86px; display: flex; justify-content: space-between; align-items: center; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 69px; left: 20px; right: 20px; display: none; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
  .site-nav.open { display: grid; }
  .site-nav a { font-size: 16px; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .page { padding-top: 54px; }
  .hero { grid-template-columns: 1fr; padding-top: 55px; }
  .portrait-wrap { width: min(260px, 80%); margin: 0 auto; order: -1; }
  .bio { margin-top: 52px; columns: auto; }
  .cards { grid-template-columns: 1fr; }
  .event { grid-template-columns: 1fr; gap: 6px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide { transition: none; }
}
