:root {
  --paper: #F4F5F7;
  --ink: #17191F;
  --ink-soft: #565B66;
  --thread: #C8323C;
  --blue: #2F5DA8;
  --rule: #D9DCE2;
  --card: #FFFFFF;

  --display: "Archivo", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
}
a { color: var(--blue); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--thread); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.top {
  display: flex; justify-content: space-between; align-items: baseline; padding: 1.25rem 0; gap: 1rem; flex-wrap: wrap;
  /* Stays at the top while scrolling */
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  /* Stretch the background and bottom line to the full window width */
  box-shadow: 0 0 0 100vmax var(--paper), 0 1px 0 100vmax var(--rule);
  clip-path: inset(0 -100vmax -1px);
}
/* Leave room for the sticky header when jumping to a #section */
[id] { scroll-margin-top: 5rem; }
.top .who { font-family: var(--display); font-weight: 700; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 1.25rem; font-family: var(--display); font-size: .95rem; }
.top nav a { color: var(--ink-soft); text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--thread); }
.top nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--thread); }

/* Page titles (Projects, About) */
.page-head { padding: 2.5rem 0 2rem; }
.page-head h1 {
  font-family: var(--display); font-weight: 800; font-stretch: 112%;
  font-size: clamp(2.5rem, 6vw, 4rem); line-height: .95; letter-spacing: -.03em; margin: 0 0 1rem;
}
.page-head p { margin: 0; max-width: 52ch; font-size: 1.15rem; color: var(--ink-soft); }

/* Home hero */
.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center;
  padding: 2rem 0 4rem;
}
.hero h1 {
  font-family: var(--display); font-weight: 800; font-stretch: 112%;
  font-size: clamp(3rem, 8vw, 5.75rem); line-height: .92; letter-spacing: -.03em;
  margin: 0 0 1.5rem;
}
.hero p { margin: 0 0 1.5rem; max-width: 34ch; font-size: 1.2rem; color: var(--ink-soft); }
.hero .actions { display: flex; gap: 1.25rem; flex-wrap: wrap; font-family: var(--display); font-weight: 700; }
.button {
  display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none;
  padding: .6rem 1.1rem; border-radius: 6px;
}
.button:hover { background: var(--thread); }
.hero .actions a:not(.button) { padding: .6rem 0; }
.loom { margin: 0; aspect-ratio: 1; width: 100%; max-width: 30rem; justify-self: end; }
.loom canvas { width: 100%; height: 100%; display: block; }
.loom figcaption { font-size: .85rem; color: var(--ink-soft); text-align: center; margin-top: .25rem; }
.replay {
  font: inherit; font-size: .85rem; background: none; border: 0; padding: 0;
  color: var(--blue); text-decoration: underline; text-underline-offset: .18em; cursor: pointer;
}

.reveal-email {
  font: inherit; font-weight: 700; color: var(--blue); cursor: pointer;
  background: var(--card); border: 1px solid var(--rule); border-radius: 6px;
  padding: .2rem .7rem;
}
.reveal-email:hover { border-color: var(--blue); }

/* Sections */
section { padding: 3.5rem 0; border-top: 1px solid var(--rule); }
section > h2 {
  font-family: var(--display); font-weight: 700;
  font-size: 2rem; letter-spacing: -.015em; margin: 0 0 1.5rem;
}
.section-foot { margin: 1.5rem 0 0; font-family: var(--display); font-weight: 700; }

/* Project cards */
.group + .group { margin-top: 3rem; }
.group-title {
  font-family: var(--display); font-weight: 500; font-size: 1.15rem; color: var(--ink-soft);
  margin: 0 0 1rem;
}
.project {
  display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.75rem;
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1.25rem;
}
.project + .project { margin-top: 1.25rem; }
.thumb { border-radius: 6px; overflow: hidden; background: var(--paper); aspect-ratio: 4 / 3; }
.thumb svg, .thumb img, .thumb canvas { width: 100%; height: 100%; display: block; object-fit: cover; }
.project h3 {
  font-family: var(--display); font-weight: 700; font-size: 1.4rem; line-height: 1.2;
  margin: .25rem 0 .5rem;
}
.project p { margin: 0 0 .75rem; max-width: 60ch; }
.tools { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .9rem; padding: 0; list-style: none; }
.tools li { font-size: .85rem; background: var(--paper); border-radius: 999px; padding: .15rem .65rem; color: var(--ink-soft); }
.project .link { font-weight: 700; }
.project.next { background: transparent; border-style: dashed; grid-template-columns: 1fr; }
.project.next p { margin: 0; color: var(--ink-soft); }

/* Compact cards on the home page */
.featured { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.25rem; }
.mini {
  display: block; background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1rem; color: inherit; text-decoration: none;
}
.mini:hover { border-color: var(--ink-soft); }
.mini .thumb { margin-bottom: .9rem; }
.mini h4 { font-family: var(--display); font-weight: 700; font-size: 1.2rem; margin: 0 0 .25rem; }
.mini p { margin: 0; color: var(--ink-soft); }

/* Home page: Hardware on the left, Software on the right */
[data-projects="mini"] {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem;
  align-items: start;
}
[data-projects="mini"] .group + .group { margin-top: 0; }
[data-projects="mini"] .featured { grid-template-columns: 1fr; }

/* About page */
.prose { max-width: 62ch; }
.prose p:first-child { margin-top: 0; }
.facts { display: grid; grid-template-columns: 9rem 1fr; gap: .6rem 1.5rem; margin: 0; max-width: 46rem; }
.facts dt { font-family: var(--display); font-weight: 700; }
.facts dd { margin: 0; }

footer { padding: 2rem 0 3rem; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: .9rem; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-bottom: 2.5rem; }
  .loom { justify-self: center; max-width: 22rem; }
  .project { grid-template-columns: 1fr; gap: 1rem; }
  .featured { grid-template-columns: 1fr; }
  [data-projects="mini"] { grid-template-columns: 1fr; gap: 0; }
  [data-projects="mini"] .group + .group { margin-top: 3rem; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: .9rem; }
}
