:root {
  color-scheme: dark;
  --background: #0b0e0d;
  --surface: #101512;
  --surface-raised: #131a16;
  --text: #e1e8e3;
  --muted: #9aa69e;
  --faint: #738077;
  --line: #29342d;
  --accent: #7ee0a1;
  --measure: 74rem;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", "Liberation Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  min-width: 300px;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.62;
}

::selection {
  color: var(--background);
  background: var(--accent);
}

a {
  color: inherit;
  text-underline-offset: .24em;
}

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

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

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: .75rem;
  left: .75rem;
  padding: .55rem .8rem;
  color: var(--background);
  background: var(--accent);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.site-header,
main {
  width: min(calc(100% - 3rem), var(--measure));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 4.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
}

.wordmark {
  font-weight: 700;
  text-decoration: none;
}

.wordmark span,
.placeholder strong span {
  color: var(--accent);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem 1.15rem;
  color: var(--muted);
}

.site-header nav a {
  display: inline-flex;
  text-decoration: none;
}

.site-header nav svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: currentColor;
}

.identity {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 1.4rem;
  align-items: center;
  max-width: 56rem;
  padding-block: clamp(3rem, 7vw, 5.25rem) clamp(1.5rem, 3vw, 2.25rem);
}

.identity img {
  width: 5rem;
  height: 5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  filter: grayscale(.75) contrast(1.04);
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.15rem);
  font-weight: 500;
  letter-spacing: -.065em;
  line-height: 1;
}

.tagline {
  margin: .8rem 0 0;
  color: var(--accent);
  font-size: .9rem;
}

.intro {
  max-width: 48rem;
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.work-section {
  padding-bottom: clamp(4rem, 8vw, 6.5rem);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.25rem);
}

.project-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.project-card:hover,
.project-card:focus-within {
  border-color: #435248;
  background: var(--surface-raised);
}

.project-card:hover {
  transform: translateY(-2px);
}

.project-visual {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #080b09;
}

.project-visual img,
.project-visual video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 160ms ease, transform 240ms ease;
}

.project-card:hover .project-visual img,
.project-card:hover .project-visual video {
  filter: saturate(1.08) contrast(1.03);
  transform: scale(1.012);
}

.project-visual--contain img {
  object-fit: contain;
}

.placeholder {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  padding: clamp(1rem, 3vw, 1.6rem);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    #0d120f;
  background-size: 28px 28px;
  color: var(--muted);
}

.placeholder::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, transparent 42%, rgba(126, 224, 161, .045));
}

.placeholder strong,
.placeholder small {
  position: relative;
}

.placeholder strong {
  align-self: center;
  justify-self: center;
  color: var(--text);
  font-size: clamp(1.45rem, 4vw, 2.65rem);
  font-weight: 500;
  letter-spacing: -.055em;
}

.placeholder small {
  justify-self: end;
  color: var(--faint);
  font-size: .65rem;
}

.project-copy {
  padding: clamp(1.2rem, 3vw, 1.65rem);
}

.project-kind {
  margin: 0 0 .55rem;
  color: var(--faint);
  font-size: .64rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.project-copy h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2.3vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.2;
}

.project-copy h3 a {
  text-decoration: none;
}

.project-copy h3 span {
  color: var(--accent);
  font-size: .68em;
}

.project-copy > p:last-child {
  margin: .85rem 0 0;
  color: var(--muted);
  font-size: .84rem;
}

code {
  color: var(--text);
  font-family: inherit;
}

.to-top {
  margin: 0;
  padding-block: clamp(3rem, 6vw, 4.5rem) 3rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: .72rem;
  text-align: center;
}

.to-top a {
  white-space: nowrap;
  text-decoration: none;
}

@media (max-width: 760px) {
  .site-header,
  main {
    width: min(calc(100% - 2rem), var(--measure));
  }

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

  .project-card:hover {
    transform: none;
  }
}

@media (max-width: 430px) {
  body {
    font-size: 15px;
  }

  .site-header {
    display: block;
    padding-block: .9rem;
  }

  .site-header nav {
    justify-content: flex-start;
    margin-top: .55rem;
  }

  .identity {
    grid-template-columns: 3.75rem minmax(0, 1fr);
    gap: 1rem;
    padding-block: 3.25rem;
  }

  .identity img {
    width: 3.75rem;
    height: 3.75rem;
  }

  h1 {
    font-size: clamp(1.85rem, 10vw, 2.5rem);
  }

  .tagline,
  .intro {
    font-size: .78rem;
  }
}

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

  .project-card,
  .project-visual img,
  .project-visual video {
    transition: none;
  }

  .project-card:hover {
    transform: none;
  }

  .project-visual img[src$=".gif"],
  .project-visual video {
    visibility: hidden;
  }

  .project-visual:has(img[src$=".gif"])::after,
  .project-visual:has(video)::after {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    content: "animation paused";
    color: var(--faint);
    font-size: .7rem;
  }
}
