/* Colors, fonts and spacing: change these and the whole site follows. */
:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #555555;
  --accent: #1f7a4d;
  --accent-soft: #e3f3ea;
  --code-bg: #f3f6f4;
  --line: #9aa59e;
  --heading: Lato, Arial, Helvetica, sans-serif;
  --sans: Lato, Arial, Helvetica, sans-serif;
  --mono: Consolas, "Courier New", monospace;
  --section-gap: 4rem;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1a14;
  --text: #e4efe6;
  --muted: #93aa9a;
  --accent: #6fcf97;
  --accent-soft: #1b3326;
  --code-bg: #15261c;
  --line: #3f5a49;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1a14;
    --text: #e4efe6;
    --muted: #93aa9a;
    --accent: #6fcf97;
    --accent-soft: #1b3326;
    --code-bg: #15261c;
    --line: #3f5a49;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--heading);
  line-height: 1.2;
  font-weight: 700;
}

h2 {
  font-size: 1.75rem;
}

p {
  margin: 0 0 1rem;
}

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

a:hover {
  background: var(--accent-soft);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* dark mode button, top right */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--text);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: 400 0.9375rem var(--sans);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* page layout: sidebar on the left, content on the right (wide screens) */
.page {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

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

/* sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 3.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: block;
  color: var(--text);
  font-family: var(--heading);
  line-height: 1.1;
  text-decoration: none;
}

.brand::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-top: 1.25rem;
  background: var(--accent);
}

.hey {
  display: block;
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 400;
}

.name {
  display: block;
  color: var(--accent);
  font-size: clamp(3.5rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand:hover {
  background: none;
}

.role {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 400;
}

.tagline {
  max-width: 20rem;
  color: var(--muted);
}

.sidebar nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.sidebar nav a {
  display: inline-block;
  padding: 0.4rem 0;
  color: var(--text);
  font-weight: 400;
  text-decoration: none;
}

.sidebar nav a:hover,
.sidebar nav a[aria-current] {
  color: var(--accent);
  background: none;
  text-decoration: underline;
}

.sidebar nav a[aria-current] {
  font-weight: 700;
}

.resume-link {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-weight: 700;
  text-decoration: none;
}

.resume-link:hover {
  background: var(--accent);
  color: var(--bg);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: inline-block;
  padding: 0.3rem 0;
  font-weight: 400;
}

@media (min-width: 62rem) {
  .layout {
    grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
    gap: 2rem;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 4rem 2rem 3rem 0;
    border-bottom: 0;
    overflow-y: auto;
  }

  .sidebar::after {
    content: "";
    position: absolute;
    top: 4rem;
    right: 0;
    bottom: 3rem;
    width: 1px;
    background: var(--line);
  }

  .sidebar nav ul {
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 2.5rem;
  }
}

/* content */
.content {
  padding-bottom: 3rem;
}

main {
  padding-top: 1.5rem;
}

@media (min-width: 62rem) {
  main {
    padding-top: 4rem;
  }
}

main > section {
  margin-top: var(--section-gap);
  padding-top: 1.5rem;
  border-top: 1px solid var(--text);
}

main > :first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

main > section > h2 {
  margin-bottom: 1.25rem;
}

.prose {
  max-width: none;
}

.summary {
  max-width: 40rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.25rem;
}

.page-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
}

/* project list and post list */
.post-item {
  margin: 0;
  padding: 0 0 1.75rem;
}

.post-item + .post-item {
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.post-item h3 {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

.project-note {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.1rem 0.5rem;
  background: var(--accent-soft);
}

.tech,
.meta {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9375rem;
}

/* label and value rows (stack) */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0 2rem;
  margin: 0;
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}

.facts dt {
  font-weight: 700;
}

.facts dt:nth-last-of-type(1),
.facts dd:last-of-type {
  border-bottom: 1px solid var(--line);
}

/* blog post */
.post .meta {
  margin: 1rem 0 0;
}

.post .prose {
  margin-top: 2rem;
  max-width: 44rem;
}

.prose h2 {
  margin: 2.5rem 0 0.75rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.prose pre {
  margin: 0 0 1rem;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--code-bg);
  font: 0.9375rem/1.6 var(--mono);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.9375em;
}

.back {
  margin-bottom: 1.5rem;
}

/* footer */
.site-footer {
  margin-top: var(--section-gap);
  padding-top: 1.5rem;
  border-top: 1px solid var(--text);
  color: var(--muted);
  font-size: 0.9375rem;
}

@media (max-width: 30rem) {
  .facts {
    grid-template-columns: 1fr;
  }

  .facts dt {
    padding-bottom: 0;
  }

  .facts dd {
    padding-top: 0.15rem;
    border-top: 0;
  }
}

/* section heading with a link on the right */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
}

.section-head a {
  font-weight: 400;
}

/* project cards on the home page */
.cards {
  display: grid;
  gap: 1rem;
}

.card {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}

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

.card .meta {
  margin: 0;
}

.card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.card p {
  margin: 0 0 0.75rem;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.5rem;
}

.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.card-foot .tech {
  margin: 0;
}

/* full project list page */
.project-row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

.project-row:last-of-type {
  border-bottom: 1px solid var(--line);
}

.project-row .meta {
  margin: 0.35rem 0 0;
}

.project-row h3 {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

@media (max-width: 40rem) {
  .project-row {
    grid-template-columns: 1fr;
  }
}