:root {
  --bg: #f7f7f5;
  --bg-alt: #ffffff;
  --text: #15171a;
  --muted: #5a5f66;
  --border: #e4e4e1;
  --accent: #1d6f5c;
  --accent-2: #b4452a;
  --chip: #eef0ee;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111315;
    --bg-alt: #17191c;
    --text: #edeef0;
    --muted: #9a9fa6;
    --border: #2a2d31;
    --accent: #58c9ac;
    --accent-2: #e2825f;
    --chip: #1f2225;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111315;
  --bg-alt: #17191c;
  --text: #edeef0;
  --muted: #9a9fa6;
  --border: #2a2d31;
  --accent: #58c9ac;
  --accent-2: #e2825f;
  --chip: #1f2225;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

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

  * {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.55;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 11;
}

nav.wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  font-weight: 700;
  letter-spacing: .02em;
}

.navlinks {
  display: flex;
  gap: 22px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.navlinks a {
  color: var(--muted);
}

.navlinks a:hover {
  color: var(--text);
  text-decoration: none;
}

.themebtn {
  border: 1px solid var(--border);
  background: none;
  color: var(--text);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

#navtoggle {
  display: none;
}

section {
  padding: 56px 0;
}

section+section {
  border-top: 1px solid var(--border);
}

h1 {
  font-size: 2.6rem;
  margin: .2em 0 .1em;
  line-height: 1.1;
  animation: fadeUp .7s ease both;
}

h2.kicker {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}

h3 {
  font-size: 1.1rem;
  margin: 0 0 2px;
}

.role {
  font-size: 1.25rem;
  color: var(--muted);
  margin: 0 0 16px;
  animation: fadeUp .7s ease .1s both;
}

.tagline {
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.05rem;
  animation: fadeUp .7s ease .2s both;
}

.linkrow {
  display: flex;
  gap: 16px;
  margin-top: 22px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  flex-wrap: wrap;
  animation: fadeUp .7s ease .3s both;
}

.linkrow a {
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 6px;
  color: var(--text);
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}

.linkrow a:hover {
  transform: translateY(-2px);
}

.linkrow a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  background: var(--chip);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12.5px;
  font-family: ui-monospace, monospace;
  color: var(--muted);
  transition: transform .15s ease, border-color .15s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.skillgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.skillcat h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.job {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.job:first-of-type {
  border-top: none;
  padding-top: 0;
}

.job time {
  color: var(--muted);
  font-size: 13px;
  font-family: ui-monospace, monospace;
}

.job .org {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.job ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text);
}

.job li {
  margin-bottom: 4px;
  font-size: 14.5px;
}

.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  background: var(--bg-alt);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.card h3 a {
  color: var(--text);
}

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

.card p {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 10px;
}

.card .chips {
  margin-top: 8px;
}

.card .stack {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--accent-2);
}

.edu {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  padding: 16px 0;
}

.edu+.edu {
  border-top: 1px solid var(--border);
}

footer {
  padding: 40px 24px 60px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

footer a {
  color: var(--muted);
}

@media (max-width:680px) {
  .navlinks {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .2s ease;
  }

  .navlinks a {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    color: var(--text);
  }

  #navtoggle:checked~.navlinks {
    max-height: 300px;
  }

  .navbtn {
    display: block;
    border: 1px solid var(--border);
    background: none;
    color: var(--text);
    border-radius: 6px;
    padding: 6px 10px;
    font-family: inherit;
    cursor: pointer;
  }

  .job,
  .edu {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }
}

.navbtn {
  display: none;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}