:root {
  --bg: #f5f5f2;
  --bg-2: #ecece8;
  --ink: #141414;
  --ink-soft: #47474a;
  --muted: #86868a;
  --line: #d8d8d3;
  --accent: #1f5c46;
  --card: rgba(0, 0, 0, 0.025);
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --type: "Courier Prime", "Courier New", Courier, monospace;
  --maxw: 1080px;
  --rail-w: 216px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
em { font-style: italic; }
::selection { background: var(--ink); color: var(--bg); }

.rail, main, .foot { position: relative; z-index: 2; }

/* ===== LEFT VERTICAL RAIL ===== */
.sb-label { font-family: var(--sans); font-size: 13px; letter-spacing: 0.1px; }
.rail {
  position: fixed; top: 0; left: 0; z-index: 50;
  width: var(--rail-w); height: 100vh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 32px 28px;
  background: transparent;
}
.rail-top { display: flex; flex-direction: column; gap: 10px; }
.rail-id {
  display: inline-block;
  color: var(--ink); font-family: var(--serif); font-weight: 500; font-size: 21px;
  letter-spacing: -0.2px; text-decoration: none; transition: color .2s;
}
.rail-id:hover { color: var(--accent); }
.rail-meta { display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.rail-meta span:first-child { color: var(--ink); }
.rail-role { font-size: 12px; }

.rail-nav { display: flex; flex-direction: column; gap: 2px; margin: auto 0; }
.rail-nav a {
  position: relative; display: block;
  color: var(--muted); text-decoration: none; padding: 4px 0 4px 18px;
  transition: color .2s, padding-left .2s;
}
.rail-nav a::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 0; height: 1px; background: var(--ink);
  transition: width .25s cubic-bezier(.2,.7,.2,1);
}
.rail-nav a:hover { color: var(--ink); }
.rail-nav a.active { color: var(--ink); }
.rail-nav a.active::before { width: 12px; }


/* ===== layout ===== */
main, .foot { margin-left: var(--rail-w); }
.hero, .section { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }
.section { padding-top: clamp(64px, 10vw, 128px); }

/* ===== HERO ===== */
.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 5vw, 64px); align-items: center;
  padding-top: clamp(48px, 8vw, 96px); padding-bottom: 24px;
}
.eyebrow {
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.1px;
  color: var(--muted); margin-bottom: 26px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 6.4vw, 78px); line-height: 0.98;
  letter-spacing: -1.5px; margin-bottom: 26px;
  font-variation-settings: "opsz" 72;
}
.lead { font-size: clamp(19px, 2.1vw, 23px); line-height: 1.45; color: var(--ink); max-width: 42ch; }
.inline-link { color: inherit; text-decoration: none; border-bottom: 1px solid var(--accent); transition: color .15s; }
.inline-link:hover { color: var(--accent); }
.hero-spec { margin-top: 32px; border-top: 1px solid var(--ink); font-family: var(--type); font-size: 13.5px; }
.hero-spec > div { display: flex; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.hero-spec dt { flex: none; width: 60px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; padding-top: 1px; }
.hero-spec dd { color: var(--ink); }
.hero-actions { display: flex; gap: 24px; margin-top: 30px; flex-wrap: wrap; }
.link-arrow {
  color: var(--ink); text-decoration: none; font-size: 14px;
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
  transition: color .15s, border-color .15s;
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }

/* B/W photo */
.hero-media { margin: 0; position: relative; }
.frame { position: relative; }
.frame img {
  width: 100%; object-fit: cover; aspect-ratio: 3/4; display: block;
  filter: grayscale(1) contrast(1.04);
  transition: filter .5s ease;
}
.frame:hover img { filter: grayscale(0) contrast(1.02); }
.hero-media figcaption { margin-top: 10px; color: var(--muted); font-family: var(--sans); font-size: 12.5px; text-align: left; }

/* ===== section shared ===== */
.kicker {
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  letter-spacing: 0.1px; margin-bottom: 14px;
  padding-top: 12px; border-top: 1px solid var(--ink);
  display: inline-block; min-width: 160px;
}
.section h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 4.4vw, 48px); line-height: 1.08;
  letter-spacing: -0.8px; margin-bottom: 18px; color: var(--ink);
}
.h-link { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); transition: color .15s, border-color .15s; }
.h-link:hover { color: var(--accent); border-color: var(--accent); }
.section-head { max-width: 620px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-intro, .contact-lead { font-size: 20px; color: var(--ink-soft); }

/* ===== ABOUT ===== */
.about .section-body { max-width: 700px; }
.about h2 { max-width: 14ch; }
.about p { margin-bottom: 16px; color: var(--ink-soft); font-size: 20px; }
.about strong { color: var(--ink); font-weight: 500; }
.about-personal { color: var(--ink) !important; font-style: italic; font-size: 22px !important; }
.facts { list-style: none; margin-top: 24px; border-top: 1px solid var(--ink); font-family: var(--type); font-size: 14px; }
.facts li { display: flex; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.facts span { flex: none; width: 72px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; padding-top: 1px; }

/* ===== CARDS ===== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.card {
  background: var(--bg); border-radius: 0;
  padding: 26px 24px 26px 0; transition: background .2s;
}
.card + .card { padding-left: 24px; }
.card:hover { background: var(--bg-2); }
.card-icon {
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  margin-bottom: 18px;
}
.card h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; color: var(--ink); }
.card h3 a { color: var(--muted); text-decoration: none; font-size: 15px; font-family: var(--sans); transition: color .15s; }
.card h3 a:hover { color: var(--accent); }
.card p { color: var(--ink-soft); font-size: 17px; margin-bottom: 16px; }
.metrics { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.metrics li { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); }

/* ===== TIMELINE ===== */
.timeline { list-style: none; }
.timeline li { display: grid; grid-template-columns: 140px 1fr; gap: 24px; padding: 26px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top-color: var(--ink); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.tl-mark { display: none; }
.tl-date { font-family: var(--sans); font-size: 13px; color: var(--muted); padding-top: 6px; }
.tl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.tl-body h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; color: var(--ink); }
.tl-org { color: var(--ink-soft); font-family: var(--sans); font-size: 14px; margin: 4px 0 10px; }
.tl-body p:last-child { color: var(--ink-soft); font-size: 17px; }

/* ===== EDUCATION ===== */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.edu-card { background: var(--bg); border-radius: 0; padding: 24px 24px 24px 0; transition: background .2s; }
.edu-card + .edu-card { padding-left: 24px; }
.edu-card:hover { background: var(--bg-2); }
.edu-year { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.edu-card h3 { font-family: var(--serif); font-weight: 500; font-size: 23px; margin: 10px 0 6px; color: var(--ink); }
.edu-card p { color: var(--ink-soft); font-size: 16px; }

/* ===== AWARDS ===== */
.award-list { list-style: none; }
.award-list li { display: grid; grid-template-columns: 70px 1fr auto; gap: 20px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); }
.award-list li:first-child { border-top-color: var(--ink); }
.award-list li:last-child { border-bottom: 1px solid var(--line); }
.aw-year { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.aw-name { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--ink); }
.aw-note { color: var(--ink-soft); font-family: var(--sans); font-size: 14px; text-align: right; }

/* ===== SKILLS ===== */
.skill-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.skill-col h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); color: var(--ink); }
.skill-tags { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); line-height: 1.8; }

/* ===== CONTACT ===== */
.contact { padding-bottom: clamp(64px, 10vw, 128px); }
.contact-lead { max-width: 52ch; margin-bottom: 28px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.contact-links a {
  font-family: var(--serif); font-size: clamp(18px, 1.8vw, 21px); font-weight: 400;
  text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px;
  transition: border-color .2s, color .2s;
}
.contact-links a:hover { color: var(--accent); border-color: var(--accent); }

/* ===== FOOTER ===== */
.foot {
  max-width: var(--maxw); margin-right: auto;
  padding: 28px clamp(20px, 5vw, 56px) 40px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 32px;
  font-family: var(--sans); font-size: 13px; color: var(--muted);
}

/* ===== reveal ===== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ===== responsive ===== */
@media (max-width: 960px) {
  :root { --rail-w: 0px; }
  main, .foot { margin-left: 0; }
  .rail {
    position: sticky; top: 0; left: 0; width: 100%; height: auto;
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: 14px; padding: 10px clamp(16px, 4vw, 28px);
    border-right: none; border-bottom: 1px solid var(--line);
    background: rgba(245, 245, 242, 0.88);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .rail-top { flex-direction: row; align-items: center; gap: 10px; }
  .rail-nav { flex-direction: row; gap: 16px; overflow-x: auto; }
  .rail-nav a { padding: 0 0 3px; white-space: nowrap; border-bottom: 1px solid transparent; }
  .rail-nav a::before { display: none; }
  .rail-nav a.active { border-bottom-color: var(--ink); }
  .rail-meta { display: none; }
  .rail-nav { margin: 0; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-media { max-width: 380px; }
  .cards, .edu-grid, .skill-cols { grid-template-columns: 1fr; }
  .card, .edu-card { padding-left: 0 !important; }
}
@media (max-width: 620px) {
  .rail-nav a:nth-child(n+5) { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .award-list li { grid-template-columns: 54px 1fr; }
  .aw-note { grid-column: 2; text-align: left; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .tl-date { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
