@font-face {
  font-family: "Courier Prime";
  src: url("fonts/courier-prime-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("fonts/courier-prime-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("fonts/courier-prime-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Afacad";
  src: url("fonts/afacad-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #282828;
  --text: #ebdbb2;
  --accent: #fabd2f;
  --secondary: #83a598;
  --muted: #928374;
  --mono: "Courier Prime", "Courier New", Courier, monospace;
  --logo: "Afacad", system-ui, sans-serif;
  --width: 50rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--text);
  text-underline-offset: 0.2em;
}
a:hover {
  color: var(--accent);
}
a:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.25;
}
h1 {
  font-size: 1.6rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
}
h2 {
  font-size: 1.6rem;
  color: var(--accent);
  margin: 0 0 1.5rem;
}
h3 {
  font-size: 1.1rem;
  margin: 0 0 0.4rem;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 10;
  padding: 0.4rem 0.8rem;
  background: var(--accent);
  color: var(--bg);
}
.skip:focus {
  top: 0.5rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem max(1rem, calc((100% - var(--width)) / 2 + 1rem));
  background: var(--bg);
  border-bottom: 1px solid var(--muted);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
}
.logo img {
  width: 3.5rem;
  height: 3.5rem;
}
.logo-text {
  font-family: var(--logo);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
}
.logo:hover {
  color: var(--accent);
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
nav a {
  text-decoration: none;
}
nav a:hover {
  text-decoration: underline;
}

@media (min-width: 40rem) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 5;
  }
}

main {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 1rem;
}

section {
  padding: 3.5rem 0 1rem;
  border-bottom: 1px solid var(--muted);
}
section:last-child {
  border-bottom: 0;
}

.hello {
  margin: 0 0 0.5rem;
}
.lead {
  margin: 0 0 2rem;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--accent);
}

.about-grid {
  display: grid;
  gap: 1.5rem;
}
.about-grid p:first-child {
  margin-top: 0;
}
.about-grid p:last-child {
  margin-bottom: 0;
}
.portrait {
  width: 100%;
  max-width: 20rem;
  margin: 0 auto;
  border: 1px solid var(--muted);
}

@media (min-width: 44rem) {
  .about-grid {
    grid-template-columns: 1fr 20rem;
    gap: 2.5rem;
    align-items: center;
  }
}

.skills {
  display: grid;
  gap: 1.25rem;
  margin: 0;
}
.skills dt,
.hello {
  font-weight: 700;
  color: var(--accent);
}
.skills dd {
  margin: 0.2rem 0 0;
}

@media (min-width: 44rem) {
  .skills > div {
    display: grid;
    grid-template-columns: 11rem 1fr;
    gap: 1rem;
  }
  .skills dd {
    margin: 0;
  }
}

.intro {
  margin: -0.75rem 0 1.5rem;
}

.project {
  display: grid;
  gap: 1rem 1.5rem;
  padding: 1.5rem 0;
}
.project:first-of-type {
  padding-top: 0;
}
.project img {
  width: 100%;
  max-width: 14rem;
  margin: 0 auto;
  border: 1px solid var(--muted);
}
.project p {
  margin: 0 0 0.6rem;
}
.project .role {
  color: var(--secondary);
  font-style: italic;
}
.project .link a::after {
  content: " →";
}

@media (min-width: 40rem) {
  .project {
    grid-template-columns: 14rem 1fr;
    align-items: start;
  }
}

.email {
  font-size: 1.2rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}
.button:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.site-footer {
  width: min(100% - 2rem, var(--width) - 2rem);
  margin: 2rem auto 0;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--muted);
  font-size: 0.9rem;
}
.site-footer p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.site-footer a {
  margin-left: auto;
}

.legal h2 {
  font-size: 1.1rem;
  margin: 2rem 0 0.5rem;
}
