:root {
  color: #000;
  background: #fff;
  font-family: "Noto Sans Mono", monospace;
  line-height: 1.45;
  font-size: 16px;
  --button-gap: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: #000;
  background: #fff;
  overflow-x: hidden;
}

a {
  color: #000;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration-thickness: 2px;
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - clamp(22px, 4vw, 48px)));
  margin: 0 auto;
}

.site-header {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 2px solid #000;
  padding: 42px 0 30px;
}

.kicker,
.date {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 20px;
  font-size: clamp(2.5rem, 6vw, 6rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  max-width: 940px;
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.3rem);
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.intro {
  max-width: 680px;
  font-size: 1.25rem;
}

.handle {
  margin-bottom: 18px;
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.header-actions {
  display: inline-grid;
  gap: var(--button-gap);
  width: fit-content;
  max-width: 100%;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--button-gap);
}

.profile-links a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid #000;
  padding: 7px 10px;
  text-decoration: none;
  background: #fff;
}

.profile-links a:hover {
  color: #fff;
  background: #000;
}

.profile-links .button-primary,
nav .button-primary {
  color: #fff;
  background: #000;
  border-color: #000;
  font-weight: 700;
}

.profile-links .button-primary:hover,
nav .button-primary:hover {
  color: #000;
  background: #fff;
}

.profile-links .button-secondary,
nav .button-secondary {
  border-width: 2px;
  border-style: dashed;
  font-weight: 700;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--button-gap);
  margin-top: var(--button-gap);
  max-width: 100%;
}

.section-nav {
  margin-top: var(--button-gap);
}

#item-nav {
  margin-top: 14px;
}

.project-index {
  margin-top: var(--button-gap);
}

.project-index summary {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 12px;
  border: 2px dashed #000;
  padding: 7px 10px;
  color: #000;
  background: #fff;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
}

.project-index summary::-webkit-details-marker {
  display: none;
}

.project-index summary:hover {
  color: #fff;
  background: #000;
}

nav a {
  display: inline-flex;
  max-width: 100%;
  min-height: 38px;
  align-items: center;
  border: 1px solid #000;
  padding: 7px 10px;
  text-decoration: none;
  line-height: 1.2;
  background: #fff;
}

nav a:hover {
  color: #fff;
  background: #000;
}

.section-nav a {
  color: #000;
  background: #fff;
  border-color: #000;
  border-style: dashed;
  border-width: 2px;
  font-weight: 700;
}

.section-nav a:hover {
  color: #fff;
  background: #000;
}

.section-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--button-gap);
  margin-top: var(--button-gap);
}

.section-controls button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid #000;
  padding: 7px 10px;
  color: #000;
  background: #fff;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.section-controls button:first-child {
  color: #fff;
  background: #000;
}

.section-controls button:hover {
  color: #fff;
  background: #000;
}

.section-controls button:first-child:hover {
  color: #000;
  background: #fff;
}

.printer-callout {
  width: 100%;
  margin-top: 0;
}

.printer-callout a {
  display: inline-flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
  padding: 8px 12px;
  color: #000;
  background: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.printer-callout a:hover {
  color: #fff;
  background: #000;
}

#item-nav a {
  border-style: dashed;
  font-size: 0.92rem;
}

.site-section {
  padding: 56px 0 0;
  border-bottom: 0;
}

.site-section:not([open]) {
  padding-top: 40px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  margin-bottom: 0;
  padding: 18px 12px;
  border-top: 3px solid #000;
  border-bottom: 1px solid #000;
  cursor: pointer;
  list-style: none;
}

.site-section[open] > .section-heading {
  margin-bottom: 12px;
}

.section-heading::-webkit-details-marker,
.project-heading::-webkit-details-marker {
  display: none;
}

.section-heading h2 {
  min-width: 0;
  margin-bottom: 0;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
}

.toggle-label {
  flex: 0 0 auto;
  border: 1px solid #000;
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

details[open] > summary .toggle-label::before {
  content: "Collapse";
}

details:not([open]) > summary .toggle-label::before {
  content: "Open";
}

.about .section-heading,
.contact .section-heading {
  background: #000;
  color: #fff;
  border-top-color: #000;
  border-bottom-color: #000;
}

.about .toggle-label,
.contact .toggle-label {
  border-color: #fff;
}

.contact:not([open])::before,
.contact:not([open])::after {
  content: "";
  display: block;
  border-top: 3px solid #000;
}

.contact:not([open])::before {
  margin-bottom: 28px;
}

.contact:not([open])::after {
  margin-top: 28px;
}

.about-grid,
.contact-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid #000;
}

.about-grid p,
.contact-panel p {
  max-width: 720px;
}

.experience-item,
.award-item {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid #000;
}

.experience-item h3,
.award-item h3 {
  margin-bottom: 4px;
}

.org {
  margin-bottom: 0;
  font-size: 1rem;
}

ul {
  margin: 0;
  padding-left: 18px;
}

li + li {
  margin-top: 8px;
}

.project {
  padding: 60px 0 0;
  border-bottom: 2px solid #000;
}

.project-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 10px 0;
  border-top: 1px dashed #000;
  cursor: pointer;
  list-style: none;
}

.project-heading h2 {
  margin-bottom: 0;
}

.project .toggle-label {
  font-size: 0.7rem;
}

.project-heading p {
  max-width: 760px;
}

.entry {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(min(100%, 320px), 1.08fr);
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid #000;
}

.entry.compact {
  display: block;
}

blockquote {
  margin: 0 0 16px;
  padding-left: 16px;
  border-left: 3px solid #000;
  max-width: 760px;
  overflow-wrap: anywhere;
}

.repo-note {
  border-left-width: 1px;
}

.source-links {
  font-size: 0.92rem;
}

.email-line {
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 700;
}

.contact-links {
  align-content: start;
}

.quote-list {
  columns: 2 380px;
  column-gap: 28px;
  margin-bottom: 20px;
}

.quote-list blockquote {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.media-grid.single {
  grid-template-columns: 1fr;
}

figure {
  margin: 0;
}

figcaption {
  margin-top: 6px;
  font-size: 0.82rem;
}

img,
video {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid #000;
  background: #fff;
}

video {
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

video.lazy-video:not([src]) {
  background:
    linear-gradient(45deg, transparent 48%, #000 49%, #000 51%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, #000 49%, #000 51%, transparent 52%),
    #fff;
}

img {
  height: auto;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
}

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 36px 0 56px;
}

footer p {
  margin: 0;
}

.back-to-top {
  position: fixed;
  right: clamp(14px, 3vw, 34px);
  bottom: clamp(14px, 3vw, 34px);
  z-index: 20;
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
  color: #000;
  background: #fff;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 140ms ease, transform 140ms ease, color 140ms ease, background 140ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  color: #fff;
  background: #000;
}

@media (min-width: 1440px) {
  .site-header,
  main,
  footer {
    width: min(1320px, calc(100% - 72px));
  }

  .entry {
    grid-template-columns: minmax(0, 0.85fr) minmax(420px, 1.15fr);
  }
}

@media (max-width: 1040px) {
  .entry {
    grid-template-columns: minmax(0, 0.95fr) minmax(min(100%, 300px), 1.05fr);
    gap: 22px;
  }
}

@media (max-width: 820px) {
  .site-header,
  main,
  footer {
    width: min(100% - 22px, 1180px);
  }

  .site-header {
    padding-top: 36px;
  }

  .project {
    padding: 46px 0 0;
  }

  .experience,
  .projects-shell,
  .about,
  .awards,
  .contact {
    padding: 50px 0 0;
  }

  .about-grid,
  .contact-panel,
  .experience-item,
  .award-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 34px 0;
  }

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

  #item-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #item-nav a {
    width: 100%;
  }
}

@media (max-width: 560px) {
  :root {
    font-size: 15px;
  }

  .site-header {
    padding: 34px 0 24px;
  }

  h1 {
    font-size: clamp(2.5rem, 17vw, 4rem);
  }

  .section-heading h2 {
    font-size: clamp(2rem, 13vw, 3rem);
  }

  h2 {
    font-size: clamp(1.45rem, 8vw, 2rem);
  }

  .section-nav,
  #item-nav,
  .section-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .header-actions {
    width: 100%;
  }

  .project-index {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .project-index #item-nav {
    width: 100%;
  }

  .section-nav a,
  #item-nav a,
  .section-controls button,
  .profile-links a {
    width: 100%;
  }

  .project-index summary {
    width: auto;
  }

  .profile-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .site-header > .header-actions > .profile-links .button-secondary {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - var(--button-gap)) / 2);
  }

  .experience,
  .projects-shell,
  .project,
  .about,
  .awards,
  .contact {
    padding-top: 38px;
  }

  .site-section:not([open]) {
    padding-top: 28px;
  }

  .experience-item,
  .award-item,
  .about-grid,
  .contact-panel,
  .entry {
    padding: 24px 0;
  }

  blockquote {
    padding-left: 12px;
  }

  .project-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 360px) {
  .profile-links {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}
