@font-face {
  font-family: "Roboto Mono";
  src: url("fonts/RobotoMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  src: url("fonts/RobotoMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #222225;
  --foreground: #e8e9ed;
  --accent: #62c4ff;
  --muted: #a3abba;
  font-family: "Roboto Mono", Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
  font-size: 16px;
  line-height: 1.6;
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #f4f5f6;
  --foreground: #1f252c;
  --accent: #095f91;
  --muted: #4a5665;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--foreground);
  background: var(--background);
}

.page {
  max-width: 960px;
  min-height: 100vh;
  margin-inline: auto;
  padding: 0 20px 72px;
}

.contact-page {
  display: flex;
  flex-direction: column;
}

a,
.text-button,
.accent {
  color: var(--accent);
}

a {
  text-decoration: none;
}

a:hover,
.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

button {
  padding: 0;
  border: 0;
  font: inherit;
  background: none;
  cursor: pointer;
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  z-index: 1;
  top: 8px;
  padding: 6px 8px;
  background: var(--background);
  transform: translateY(-150%);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 30px;
  padding-block: 20px;
}

.prompt {
  overflow-wrap: anywhere;
}

.cursor {
  display: inline-block;
  width: 1ch;
  height: 1em;
  margin-inline-start: 0.2ch;
  vertical-align: -0.12em;
  background: var(--accent);
  animation: cursor-blink 1s ease infinite;
}

@keyframes cursor-blink {
  0%, 100% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }
}

.site-header ul,
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 30px;
}

.site-header nav a {
  color: var(--muted);
}

section,
footer {
  scroll-margin-top: 16px;
}

.terminal-title {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  font: inherit;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.terminal-rule {
  position: absolute;
  inset: auto 0 -8px;
  height: 16px;
  overflow: hidden;
  color: var(--foreground);
  line-height: 16px;
  white-space: nowrap;
  pointer-events: none;
}

.hero,
.projects,
.latest-posts,
.about-content,
.contact-content,
.blog-index,
.project-index,
.article-content {
  padding-top: 20px;
}

.section-heading,
.entries article > .terminal-title {
  margin-bottom: 20px;
}

p,
figure {
  margin: 0;
}

.hero > p,
.entries article > p,
.article-content p,
dialog p {
  overflow-wrap: anywhere;
}

.projects {
  margin-top: 3.2rem;
}

.entries {
  display: grid;
  gap: 1.6rem;
  margin-top: 2.85rem;
}

.blog-index > .entries {
  margin-top: 4.4rem;
}

.project-filters {
  margin-top: 2.85rem;
}

.project-filters input {
  display: block;
  width: 100%;
  padding: 6px;
  border: 1px solid var(--muted);
  border-radius: 4px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
}

.project-filters input::placeholder {
  color: var(--muted);
}

.project-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 1rem;
}

.project-categories button {
  padding: 4px 12px;
  border: 1px solid var(--foreground);
  border-radius: 4px;
  color: var(--foreground);
}

.project-categories button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--background);
}

.project-index .entries,
.project-status:not(.visually-hidden) {
  margin-top: 2rem;
}

.project-status {
  color: var(--muted);
}

.more-projects {
  display: inline-block;
}

.more-projects,
.latest-posts {
  margin-top: 1.6rem;
}

.about-content > .section-heading,
.contact-content > .section-heading {
  margin-bottom: 2.85rem;
}

:is(.about-content, .article-content) > section {
  display: grid;
  gap: 1.6rem;
}

.about-content section + section,
.article-content > section {
  margin-top: 1.6rem;
}

:is(.about-content, .article-content) section :is(h2, h3) {
  margin: 0;
  font: inherit;
  font-weight: 700;
}

.project-note {
  margin-top: 2rem;
  font-size: 0.85rem;
}

.university-modules summary {
  width: fit-content;
  cursor: pointer;
}

.university-modules ul {
  margin-block: 0.8rem 0;
  padding-inline-start: 1.5rem;
}

.about-note,
.about-gallery figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6rem;
}

.about-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.about-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.about-gallery figcaption {
  margin-top: 12px;
  text-align: center;
}

.contact-content {
  flex: 1;
}

.contact-links {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
}

.contact-links li {
  display: grid;
  grid-template-columns: 1ch 1.15rem minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: start;
  justify-items: start;
  overflow-wrap: anywhere;
}

.contact-separator {
  color: var(--foreground);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-top: 6.25rem;
  padding-top: 12px;
  border-top: 1px solid var(--muted);
}

.footer-links {
  min-width: 0;
  overflow-wrap: anywhere;
}

.footer-links li + li {
  margin-top: 4px;
}

.footer-email {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, max-content) auto;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
}

.copy-email {
  position: relative;
  width: 24px;
  height: 24px;
  color: var(--accent);
  opacity: 0;
  pointer-events: none;
}

.copy-email::before,
.copy-email::after {
  position: absolute;
  width: 9px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 2px;
  content: "";
}

.copy-email::before {
  top: 4px;
  left: 5px;
}

.copy-email::after {
  top: 7px;
  left: 8px;
  background: var(--background);
}

.footer-email:hover .copy-email,
.footer-email a:focus-visible + .copy-email,
.copy-email:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .copy-email {
    opacity: 1;
    pointer-events: auto;
  }
}

.copy-email-feedback {
  position: absolute;
  z-index: 1;
  inset-block-end: calc(100% + 4px);
  inset-inline-end: 0;
  width: max-content;
  max-width: 100%;
  color: var(--foreground);
  background: var(--background);
  font-size: 0.8rem;
  line-height: 1.4;
  pointer-events: none;
}

.copy-email-feedback:not(:empty) {
  padding: 4px 6px;
  border: 1px solid var(--muted);
  border-radius: 4px;
}

.theme-toggle {
  display: grid;
  width: 24px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--foreground);
}

dialog {
  width: min(100% - 40px, 38rem);
  max-height: calc(100% - 40px);
  padding: 24px;
  border: 1px solid var(--muted);
  background: var(--background);
  color: var(--foreground);
}

dialog p + p,
dialog form {
  margin-top: 1rem;
}

dialog::backdrop {
  background: rgb(0 0 0 / 60%);
}

@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header ul {
    column-gap: clamp(12px, 4vw, 24px);
  }

  .projects {
    margin-top: 2.6rem;
  }

  .entries {
    margin-top: 2.4rem;
  }

  .blog-index > .entries {
    margin-top: 3.2rem;
  }

  .about-gallery {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .site-footer {
    margin-top: 4.5rem;
  }
}

@media (max-width: 360px) {
  .page {
    padding-inline: 16px;
  }

  .site-header ul {
    column-gap: 8px;
    font-size: 15px;
  }
}
