:root {
  --paper: #f4efe4;
  --paper-raised: #fbf7ee;
  --ink: #1c1915;
  --ink-soft: #3f382f;
  --muted: #6a6156;
  --rule: #d9cfc0;
  --rule-strong: #b9ab96;
  --accent: #6e2a28;
  --accent-hover: #541f1d;
  --accent-wash: #efe0d8;
  --sidebar: #231f1b;
  --sidebar-ink: #f4efe4;
  --sidebar-muted: #c4b8a6;
  --focus: #8a3d2a;
  --shadow: 0 12px 40px rgba(28, 25, 21, 0.08);
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --measure: 46rem;
  --rail: 17.5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #fffdf8 0%, transparent 50%),
    var(--paper);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible,
.site-nav a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 20;
  padding: 0.4rem 0.7rem;
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus {
  top: 0.75rem;
}

.layout {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-height: 100vh;
  padding: 2.25rem 1.6rem 2rem;
  background: var(--sidebar);
  color: var(--sidebar-ink);
}

.monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  border: 1px solid #8d7d68;
  color: var(--sidebar-ink);
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.monogram:hover {
  color: #fff;
  border-color: #e8dcc8;
}

.rail-identity h1,
.rail-identity .name {
  margin: 0.7rem 0 0.15rem;
  font-family: var(--font-display);
  font-size: 2.15rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.rail-identity p {
  margin: 0;
  color: var(--sidebar-muted);
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-nav a {
  padding: 0.35rem 0;
  color: var(--sidebar-ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: #8d7d68;
}

.site-nav a[aria-current="page"] {
  font-weight: 600;
}

.rail-contact {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--sidebar-muted);
  font-size: 0.92rem;
}

.rail-contact a {
  color: #eadfd0;
  text-decoration: none;
}

.rail-contact a:hover {
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid #8d7d68;
  background: transparent;
  color: var(--sidebar-ink);
  font: inherit;
  font-size: 0.92rem;
  text-decoration: none;
}

.btn:hover {
  background: #2e2923;
  color: #fff;
}

.btn-paper {
  border-color: var(--rule-strong);
  background: var(--paper-raised);
  color: var(--ink);
}

.btn-paper:hover {
  background: var(--accent-wash);
  color: var(--accent-hover);
}

.content {
  padding: 2.5rem clamp(1.25rem, 4vw, 4.5rem) 4rem;
}

.page-head {
  max-width: var(--measure);
  margin-bottom: 2.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.kicker {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-head h1,
.page-head h2.page-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  font-weight: 600;
  line-height: 1.1;
}

.lede {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.15rem;
}

.section {
  max-width: var(--measure);
  margin: 0 0 2.5rem;
}

.section h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
}

.section h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
}

.meta {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.prose p,
.section p {
  margin: 0 0 0.9rem;
}

.prose p:last-child,
.section p:last-child {
  margin-bottom: 0;
}

ul.clean {
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.clean li {
  position: relative;
  margin: 0 0 0.65rem;
  padding-left: 1.1rem;
}

ul.clean li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.42rem;
  height: 1px;
  background: var(--accent);
}

.card-grid,
.stat-grid,
.skill-grid {
  display: grid;
  gap: 1rem;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: var(--measure);
  margin-bottom: 2.25rem;
}

.skill-grid {
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}

.card,
.stat,
.skill-card,
.job,
.project {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.card,
.skill-card,
.project {
  margin-bottom: 1.15rem;
  padding: 1.15rem 1.2rem 1.2rem;
}

.project:last-child {
  margin-bottom: 0;
}

.stat {
  padding: 1rem 1.1rem;
}

.card h3,
.project h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.card p,
.project p,
.skill-card p {
  margin: 0;
  color: var(--ink-soft);
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.job {
  margin-bottom: 1.15rem;
  padding: 1.25rem 1.3rem 1.15rem;
}

.job-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1.25rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
}

.job-head h3 {
  margin: 0;
}

.dates {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.tag {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--rule);
  background: #f3ece1;
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.availability {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.35rem 0.7rem;
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
}

.degree + .degree {
  margin-top: 1.25rem;
}

.page-footer {
  max-width: var(--measure);
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 880px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .rail {
    position: relative;
    min-height: 0;
    padding: 1.25rem 1.15rem 1.35rem;
  }

  .rail-identity .name {
    font-size: 1.8rem;
  }

  .site-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.15rem 1rem;
  }

  .rail-contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
    margin-top: 0.4rem;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 1.6rem 1.15rem 3rem;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
    font-size: 11pt;
  }

  .skip-link,
  .rail,
  .no-print {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .content {
    padding: 0;
  }

  .card,
  .stat,
  .skill-card,
  .job,
  .project {
    box-shadow: none;
    break-inside: avoid;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .page-head,
  .job-head,
  .page-footer {
    border-color: #ccc;
  }
}
