/* ---------- Tokens ---------- */
:root {
  --paper: #f6f3ee;
  --paper-tint: #efebe3;
  --ink: #1a1815;
  --ink-soft: #4a463f;
  --muted: #6d675d;         /* darkened from #7d776d for WCAG AA contrast */
  --rule: #d9d3c7;
  --accent: #7b2d26;        /* oxblood */
  --accent-soft: #a8574e;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Tight", -apple-system, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-space: clamp(72px, 11vw, 140px);
  --grid-gap: clamp(32px, 6vw, 96px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(17px, 1.1vw + 12px, 19px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

h1, h2, h3, h4 { font-weight: 400; margin: 0; line-height: 1.15; }
p { margin: 0 0 1.1em; }

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

.placeholder { color: var(--muted); font-style: italic; }
.small { font-size: .85rem; }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.masthead__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.wordmark {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: .01em;
  text-decoration: none;
}

.nav { display: flex; gap: 2rem; }
.nav a, .nav-toggle {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
}
.nav-toggle { display: none; background: none; border: 0; padding: 8px 0; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { padding: clamp(80px, 14vw, 180px) 0 clamp(72px, 10vw, 128px); border-bottom: 1px solid var(--rule); }

.eyebrow {
  font-family: var(--sans);
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
}

.hero__title {
  font-size: clamp(2.8rem, 7.5vw, 6.2rem);
  font-weight: 300;
  letter-spacing: -.02em;
  line-height: 1.02;
  font-variation-settings: "opsz" 72;
}
.hero__title em { font-style: italic; color: var(--ink-soft); }

.hero__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  margin-top: clamp(40px, 6vw, 72px);
  max-width: 40rem;
  margin-left: auto;
}
.lede { font-size: 1.2em; line-height: 1.5; color: var(--ink-soft); margin: 0; }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li {
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .06em;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .35rem .8rem;
}

/* ---------- Sections ---------- */
.section { padding: var(--section-space) 0; border-bottom: 1px solid var(--rule); }
.section--tint { background: var(--paper-tint); }

.grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2.6fr);
  gap: var(--grid-gap);
}

.section__head { position: sticky; top: 96px; align-self: start; }
.section__num {
  display: block;
  font-family: var(--sans);
  font-size: .76rem;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: .75rem;
}
.section__head h2 {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  letter-spacing: -.01em;
}

.section__body { min-width: 0; }

.prose { max-width: 38rem; }
.prose p { color: var(--ink-soft); }
.lead-in { font-size: 1.35em; line-height: 1.4; color: var(--ink) !important; margin-bottom: 1em; }

.subhead {
  font-family: var(--sans);
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}
.subhead:not(:first-child) { margin-top: 4rem; }

/* ---------- Scholarship ---------- */
.paper { padding-bottom: 3.5rem; margin-bottom: 3.5rem; border-bottom: 1px solid var(--rule); max-width: 42rem; }
.paper:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

.paper__meta {
  font-family: var(--sans);
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.paper__title {
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  line-height: 1.22;
  margin-bottom: 1.4rem;
}
.paper p { color: var(--ink-soft); }

.paper__topics { list-style: none; padding: 0; margin: 1.6rem 0 1.2rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.paper__topics li {
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--accent);
}
.paper__topics li::before { content: "— "; color: var(--rule); }

.paper__note { font-style: italic; color: var(--muted) !important; font-size: .92rem; margin: 0; }

/* ---------- Experience ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }

.role {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 0 0 2.6rem;
}
.role__when {
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .02em;
  color: var(--muted);
  padding-top: .35rem;
}
.role h4 { font-size: 1.35rem; margin-bottom: .2rem; }
.role__org { font-style: italic; color: var(--accent); margin-bottom: .8rem; }
.role ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); }
.role li { margin-bottom: .4rem; padding-left: .2rem; }
.role li::marker { color: var(--rule); }

/* ---------- Resume ---------- */
.resume-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem; }
.resume-grid .subhead { margin-top: 0 !important; }

.facts { margin: 0; }
.facts dt { font-size: 1.15rem; margin-bottom: .2rem; }
.facts dd { margin: 0 0 1.6rem; color: var(--ink-soft); font-size: .95rem; }

.resume-cta { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.resume-cta p { margin: 0; }
.resume-cta__meta { color: var(--muted); }

.button {
  display: inline-block;
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  padding: 1rem 1.6rem;
  transition: background .2s;
}
.button:hover { background: var(--accent); color: var(--paper); }
.button--disabled { background: transparent; color: var(--muted); border: 1px solid var(--rule); pointer-events: none; }

/* ---------- Contact ---------- */
.section--contact { border-bottom: 0; }
.contact__lede { font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.3; max-width: 32rem; margin-bottom: 2.5rem; }

.contact-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); max-width: 36rem; }
.contact-list li {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.contact-list__label {
  font-family: var(--sans);
  font-size: .76rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-list a { font-size: 1.15rem; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #b9b2a6; }
.footer__inner {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding-top: 2rem; padding-bottom: 2rem;
  font-family: var(--sans); font-size: .78rem; letter-spacing: .06em;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .section__head { position: static; }
  .hero__body { margin-left: 0; }
  .resume-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: .5rem var(--gutter) 1rem;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .9rem 0; border-bottom: 1px solid var(--rule); }
  .nav a:last-child { border-bottom: 0; }

  .role { grid-template-columns: minmax(0, 1fr); gap: .4rem; }
  .role__when { padding-top: 0; }
  .contact-list li { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
}

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

/* Secondary interests: present but quieter than the core practice areas */
.tags li.tags__secondary { color: var(--muted); border-style: dashed; }

/* Skip link: hidden until focused with the keyboard */
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 20;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: .8rem; padding: .6rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--paper); }

/* ---------- About portrait ---------- */
.about__rail { position: sticky; top: 96px; align-self: start; }
.about__rail .section__head { position: static; }
/* Desktop: may extend into the column gap, up to 296px, always leaving 48px before the text */
.portrait { margin: 2.25rem 0 0; width: min(296px, calc(100% + var(--grid-gap) - 48px)); }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; background: var(--paper-tint); }

@media (max-width: 860px) {
  .about__rail { position: static; }
  .portrait { width: 100%; max-width: 320px; margin-top: 1.75rem; }
}
