:root { --accent: #b0451f; --accent-dark: #903919; --band: #f2ebe0; --rule: #e7ddce; --muted: #6b6255; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #faf7f2;
  color: #262019;
  font-family: 'Work Sans', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
h1, h2, h3 { font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif; margin: 0; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
main:focus, section:focus { outline: none; }
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 30;
  background: var(--accent); color: #fff8f0; font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: 3px;
}
.skip-link:focus { top: 12px; color: #fff8f0; }
.wide { max-width: 1040px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }

/* Rail layout: labels in a left margin column, content on the right */
.rail { display: grid; grid-template-columns: 180px minmax(0, 1fr); column-gap: 48px; }
.rail-label {
  font-size: 22px; font-weight: 600; color: #201a14; line-height: 1.3;
}
.section-title { font-size: 26px; font-weight: 600; color: #201a14; margin-bottom: 8px; }

/* Nav */
nav.site-nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250,247,242,0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1040px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
}
.nav-sections { display: flex; align-items: center; gap: 24px; }
.nav-sections a.section-link { font-size: 14px; color: #5c5346; font-weight: 500; white-space: nowrap; }
.nav-sections a.section-link:hover { color: #262019; }
.nav-resume { margin-left: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  padding: 10px 18px; border-radius: 3px;
  border: 1px solid var(--accent);
}
.btn-solid { background: var(--accent); color: #fff8f0; }
.btn-solid:hover { background: var(--accent-dark); color: #fff8f0; border-color: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: rgba(176, 69, 31, 0.1); }
.btn svg { width: 15px; height: 15px; flex: none; }

/* Hero */
.hero { padding-top: 80px; padding-bottom: 56px; }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px; display: block;
}
.hero h1 { font-size: clamp(38px, 6vw, 60px); line-height: 1.05; font-weight: 600; color: #201a14; }
.hero .role {
  font-family: 'Work Sans', sans-serif; font-size: clamp(16px, 2.4vw, 19px); font-weight: 500;
  color: #5c5346; margin-top: 14px;
}
.hero .tagline { font-size: 17px; line-height: 1.65; color: #40382c; max-width: 680px; margin-top: 24px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; }
.contact-icons { display: flex; align-items: center; gap: 18px; margin-left: 4px; }
.icon-link { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: #5c5346; }
.icon-link:hover { color: var(--accent); }
.icon-link svg { width: 17px; height: 17px; flex: none; }

/* Tinted bands */
.band { background: var(--band); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

/* Stats */
.stats { padding-top: 40px; padding-bottom: 40px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; grid-column: 1 / -1; }
.stat-num {
  font-family: 'Source Serif 4', serif; font-size: clamp(26px, 3.4vw, 34px); font-weight: 600;
  color: var(--accent); line-height: 1.1;
}
.stat-unit { font-size: 0.55em; font-weight: 500; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* Sections */
section { padding: 56px 0 24px; scroll-margin-top: 72px; }

.about-lede {
  font-family: 'Source Serif 4', serif; font-size: 21px; font-weight: 600; line-height: 1.45;
  color: #201a14; max-width: 720px; margin-bottom: 24px;
}
.about-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.mini-label, .skill-group-label, .next-label {
  font-family: 'Work Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.mini-label { margin-bottom: 8px; }
.about-text { font-size: 15.5px; line-height: 1.7; color: #3a3226; }

/* Experience */
.role-entry { padding: 24px 0; border-top: 1px solid var(--rule); }
.section-title + .role-entry { border-top: none; }
.role-dates {
  font-size: 13.5px; font-weight: 500; color: var(--muted); padding-top: 3px;
  font-variant-numeric: tabular-nums;
}
.role-title { font-family: 'Work Sans', 'Segoe UI', system-ui, sans-serif; font-size: 18px; font-weight: 600; color: #201a14; }
.role-company { font-size: 15px; color: var(--accent); font-weight: 600; margin-top: 3px; }
.role-narrative { margin: 12px 0 0; font-size: 15.5px; line-height: 1.7; color: #40382c; max-width: 720px; }
.role-narrative strong { font-weight: 600; color: #201a14; }
.role-stack { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.role-stack-label { font-weight: 600; color: #5c5346; }

/* Earlier career */
.earlier-list { list-style: none; margin: 0; padding: 0; }
.earlier-list li { padding: 14px 0; border-top: 1px solid var(--rule); }
.earlier-list li:first-child { border-top: none; padding-top: 2px; }
.earlier-title { font-size: 15.5px; font-weight: 600; color: #201a14; }
.earlier-company { font-size: 14.5px; font-weight: 600; color: var(--accent); margin-left: 6px; }
.earlier-line { font-size: 14.5px; line-height: 1.6; color: #40382c; margin-top: 4px; }

/* Skills */
.skill-group { padding: 14px 0; align-items: baseline; }
.skill-group-label { line-height: 1.5; }
.tag-grid { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.tag {
  font-size: 13.5px; font-weight: 500; color: #40382c; background: #fffdf9;
  border: 1px solid #ddd0ba; padding: 7px 13px;
}

/* Closing CTA */
.closing { padding: 56px 28px 56px; }
.closing-lede {
  font-family: 'Source Serif 4', serif; font-size: clamp(22px, 3vw, 28px); font-weight: 600;
  line-height: 1.3; color: #201a14; max-width: 640px;
}
.next-grid { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 24px; margin: 28px 0 0; }
.next-item dd { margin: 0; }
.next-label { margin-bottom: 6px; }
.next-value { font-size: 15px; line-height: 1.55; color: #262019; }

/* Footer */
footer { padding: 32px 0 40px; }
.footer-grid { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.footer-note { font-size: 14px; color: #5c5346; line-height: 1.6; }
.copyright { font-size: 12.5px; color: #766c5e; margin-top: 16px; }

@media (max-width: 760px) {
  .rail { grid-template-columns: 1fr; row-gap: 10px; }
  .about-cols { grid-template-columns: 1fr; gap: 24px; }
  .next-grid { grid-template-columns: 1fr; gap: 18px; }
  .rail-label { font-size: 24px; margin-bottom: 14px; }
  .role-dates { padding-top: 0; }
  .skill-group { row-gap: 8px; }
}

@media (max-width: 640px) {
  .wide { padding-left: 20px; padding-right: 20px; }
  .closing { padding: 44px 20px; }
  .nav-inner { padding: 10px 20px; gap: 10px; justify-content: space-between; }
  .nav-sections {
    flex: 1; min-width: 0; gap: 18px; overflow-x: auto; scrollbar-width: none;
    padding: 8px 0; scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .nav-sections::-webkit-scrollbar { display: none; }
  .nav-sections a.section-link { font-size: 13.5px; scroll-snap-align: start; }
  .nav-sections a.section-link:last-child { padding-right: 24px; }
  .nav-resume { flex: none; margin-left: 0; padding: 9px 14px; font-size: 13px; }
  .hero { padding-top: 56px; padding-bottom: 40px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  section { padding: 48px 0 28px; }
  .earlier-company { display: block; margin-left: 0; margin-top: 2px; }
}

/* 404 page */
body.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.error-page .wrap { padding: 28px; max-width: 460px; }
.error-page h1 {
  font-size: clamp(32px, 6vw, 44px);
  font-weight: 600;
  color: #201a14;
  margin: 0 0 14px;
}
.error-page p { font-size: 16px; line-height: 1.6; color: #5c5346; margin: 0 0 28px; }
.error-page .wrap a {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600;
  padding: 10px 20px; border-radius: 3px;
  background: var(--accent); color: #fff8f0;
}
.error-page .wrap a:hover { background: var(--accent-dark); color: #fff8f0; }
