:root {
  color-scheme: light;
  --background: #f4f1e9;
  --paper: #fffdfa;
  --ink: #151617;
  --muted: #5f6462;
  --faint: #cfd3cc;
  --rule: rgba(21, 22, 23, 0.16);
  --accent: #2f6f6a;
  --accent-strong: #164843;
  --rust: #9b4f3f;
  --measure: 72ch;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(21, 22, 23, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 22, 23, 0.028) 1px, transparent 1px),
    var(--background);
  background-size: 44px 44px, 44px 44px, auto;
  color: var(--ink);
  font-family: Avenir, "Avenir Next", "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent-strong);
  text-decoration-color: rgba(22, 72, 67, 0.32);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

:focus-visible {
  outline: 3px solid rgba(47, 111, 106, 0.42);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.site-footer,
main {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  color: var(--ink);
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.12rem;
  font-weight: 700;
  text-decoration: none;
}

.top-nav,
.site-footer nav,
.link-row,
.quiet-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.15rem;
}

.top-nav a,
.site-footer a,
.link-row a,
.quiet-links a {
  font-size: 0.92rem;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: end;
  padding: clamp(3.2rem, 8vw, 5.6rem) 0 clamp(2.8rem, 6vw, 4rem);
}

.intro-copy {
  max-width: 820px;
}

.eyebrow,
.section-kicker,
.panel-label,
.work-type,
.role-meta {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  line-height: 1.04;
  overflow-wrap: break-word;
}

h1 {
  max-width: 14.8ch;
  font-size: clamp(3.15rem, 6.2vw, 5.85rem);
  font-weight: 700;
  overflow-wrap: break-word;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
}

h3 {
  font-size: 1.35rem;
}

.role {
  max-width: var(--measure);
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: clamp(1.25rem, 2.5vw, 1.95rem);
  line-height: 1.25;
}

.summary {
  max-width: 68ch;
  margin: 2rem 0 0;
  color: var(--ink);
  font-size: clamp(1.08rem, 1.55vw, 1.32rem);
  line-height: 1.52;
  overflow-wrap: break-word;
}

.link-row {
  margin-top: 2.35rem;
}

.link-row a,
.quiet-links a {
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  border-bottom: 1px solid rgba(22, 72, 67, 0.3);
  text-decoration: none;
}

.signal-panel {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule);
  border-top: 4px solid var(--ink);
}

.signal-panel h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.signal-panel p:not(.panel-label) {
  margin: 1rem 0;
  color: var(--muted);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--rule);
  background: var(--rule);
}

.intro > *,
.metric-strip > *,
.github-activity > *,
.section-grid > *,
.chapter > *,
.work-grid > *,
.timeline > *,
.fit-grid > * {
  min-width: 0;
}

.metric-strip div {
  min-height: 7.75rem;
  padding: 1.2rem;
  background: rgba(255, 253, 250, 0.58);
}

.metric-strip strong,
.metric-strip span {
  display: block;
}

.metric-strip strong {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 1.05;
}

.metric-strip span {
  max-width: 18rem;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.github-activity {
  display: grid;
  grid-template-columns: minmax(220px, 0.28fr) minmax(0, 0.72fr);
  gap: clamp(1.4rem, 4vw, 3rem);
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--rule);
  background: rgba(255, 253, 250, 0.5);
  color: var(--ink);
  text-decoration: none;
}

.github-activity:hover {
  border-color: rgba(47, 111, 106, 0.44);
  color: var(--ink);
}

.github-copy strong,
.github-copy span {
  display: block;
}

.github-copy strong {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 1.05;
}

.github-copy span {
  max-width: 19rem;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.heatmap {
  min-width: 0;
}

.heat-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.heat-week {
  display: grid;
  grid-template-rows: repeat(7, 10px);
  gap: 4px;
}

.heat-cell {
  display: block;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(21, 22, 23, 0.08);
  border-radius: 2px;
}

.heat-cell.h0 {
  background: rgba(207, 211, 204, 0.46);
}

.heat-cell.h1 {
  background: rgba(47, 111, 106, 0.3);
}

.heat-cell.h2 {
  background: rgba(47, 111, 106, 0.52);
}

.heat-cell.h3 {
  background: rgba(47, 111, 106, 0.76);
}

.heat-cell.h4 {
  background: var(--accent-strong);
}

.heat-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 0.66fr);
  gap: clamp(2rem, 6vw, 5rem);
  padding: clamp(3.6rem, 8vw, 6rem) 0;
  border-top: 1px solid var(--rule);
}

.section-note {
  max-width: 28ch;
  color: var(--muted);
}

.chapter-list {
  display: grid;
  gap: 1.2rem;
}

.chapter {
  display: grid;
  grid-template-columns: minmax(9rem, 0.28fr) minmax(0, 0.72fr);
  gap: clamp(1rem, 3vw, 2rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.chapter span {
  color: var(--rust);
  font-size: 0.82rem;
  font-weight: 800;
}

.chapter p {
  grid-column: 2;
  max-width: var(--measure);
  margin: 0.7rem 0 0;
  color: var(--muted);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.work-card {
  display: block;
  min-height: 13rem;
  padding: 1.05rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.54);
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 140ms ease,
    background-color 140ms ease;
}

.work-card:hover {
  border-color: rgba(47, 111, 106, 0.34);
  background: rgba(255, 253, 250, 0.72);
}

.work-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  gap: 1.5rem;
  min-height: 11rem;
  border-top: 4px solid var(--accent);
}

.work-card h3 {
  color: var(--ink);
  text-decoration: none;
}

.work-card:hover h3 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.work-card p:not(.work-type) {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.fit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.fit-grid article {
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.fit-grid p,
.timeline p,
.closing-copy p,
.resume-section p,
.resume-section li,
.skill-columns p {
  max-width: var(--measure);
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline article {
  display: grid;
  grid-template-columns: minmax(10rem, 0.28fr) minmax(0, 0.72fr);
  gap: clamp(1rem, 3vw, 2rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.timeline span {
  color: var(--rust);
  font-size: 0.82rem;
  font-weight: 800;
}

.timeline h3 {
  font-size: 1.7rem;
}

.timeline p {
  grid-column: 2;
  margin: -0.45rem 0 0;
}

.timeline strong {
  color: var(--ink);
}

.closing-section {
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.resume-page {
  max-width: 960px;
}

.resume-hero {
  padding: clamp(3.5rem, 9vw, 6rem) 0 3rem;
}

.resume-hero h1 {
  font-size: clamp(3.5rem, 9vw, 6.5rem);
}

.resume-section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
}

.resume-section ul {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.resume-role {
  display: grid;
  grid-template-columns: minmax(12rem, 0.35fr) minmax(0, 0.65fr);
  gap: 1.5rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--rule);
}

.resume-role + .resume-role {
  margin-top: 1.25rem;
}

.resume-role p {
  margin: 0;
}

.role-meta {
  margin-top: 0.35rem;
}

.compact-list {
  columns: 2;
  column-gap: 2rem;
}

.compact-list li {
  break-inside: avoid;
  margin-bottom: 0.5rem;
}

.skill-columns {
  display: grid;
  gap: 0.8rem;
}

@media (max-width: 860px) {
  .intro,
  .section-grid,
  .chapter,
  .github-activity,
  .timeline article,
  .resume-role {
    grid-template-columns: 1fr;
  }

  .chapter p,
  .timeline p {
    grid-column: auto;
    margin-top: 0.7rem;
  }

  .work-grid,
  .fit-grid,
  .compact-list {
    columns: auto;
    grid-template-columns: 1fr;
  }

  .work-card.featured {
    grid-column: auto;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 16px;
  }

  .site-header,
  .site-footer,
  main {
    width: min(100% - 28px, 1180px);
  }

  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro {
    padding-top: 3.6rem;
  }

  h1 {
    max-width: 9.8ch;
    font-size: clamp(2.6rem, 10vw, 3.15rem);
  }

  .summary,
  .signal-panel p:not(.panel-label) {
    max-width: 32ch;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric-strip div {
    min-height: auto;
  }

  .section-grid,
  .chapter-list,
  .chapter,
  .github-activity,
  .work-grid,
  .work-card,
  .work-card.featured,
  .timeline,
  .timeline article {
    width: 100%;
    max-width: calc(100vw - 28px);
    overflow-x: hidden;
  }

  .chapter h3,
  .work-card h3,
  .work-card p,
  .timeline h3,
  .timeline p,
  .github-copy strong,
  .github-copy span {
    max-width: calc(100vw - 28px);
    overflow-wrap: anywhere;
  }

  .work-card h3 {
    max-width: calc(100vw - 64px);
  }

  .work-card p:not(.work-type) {
    max-width: 28ch;
  }

  .work-grid,
  .work-card,
  .work-card.featured {
    display: block;
  }

  .work-card + .work-card {
    margin-top: 1rem;
  }

  .chapter h3 {
    max-width: 18ch;
  }

  .chapter p {
    max-width: 34ch;
    overflow-wrap: anywhere;
  }
}

@media print {
  html,
  body {
    background: #fff !important;
    color: #000;
    font-size: 11pt;
  }

  main,
  .resume-page,
  .resume-body {
    background: #fff !important;
  }

  .site-header,
  .site-footer,
  .signal-panel,
  .metric-strip {
    display: none;
  }

  main,
  .resume-page {
    width: 100%;
    max-width: none;
  }

  .resume-hero,
  .resume-section {
    padding: 0.45in 0 0;
  }

  a {
    color: #000;
  }
}
