@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #141312;
  --header: #1b1816;
  --ink: #f8f2ea;
  --muted: #d5c9be;
  --faint: #b5a79a;
  --line: #3c3430;
  --red: #e43224;
  --red-light: #f34b39;
  --red-button: #b6291e;
  --body: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}

img { display: block; max-width: 100%; }
a { color: var(--red-light); text-underline-offset: .2em; }
a:hover { color: var(--ink); }

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

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

.wrap {
  width: min(1160px, calc(100% - 88px));
  margin-inline: auto;
}

.skip {
  position: absolute;
  z-index: 5;
  inset: 12px auto auto 12px;
  transform: translateY(-200%);
  padding: 9px 13px;
  background: var(--ink);
  color: var(--page);
}

.skip:focus { transform: none; color: var(--page); }

.site-header {
  border-top: 3px solid var(--red);
  border-bottom: 1px solid var(--line);
  background: var(--header);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 75px;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.045em;
  text-decoration: none;
}

.monogram {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #963025;
  border-radius: 5px;
  background: #351a15;
  color: var(--red-light);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.06em;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(15px, 2.5vw, 32px);
}

.main-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.main-nav a[aria-current="page"] { color: var(--ink); }

.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 2px;
  width: 100%;
  height: 2px;
  background: var(--red);
}

.main-nav a:hover { color: var(--red-light); }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: start;
  min-height: clamp(400px, 43vw, 545px);
  padding-block: clamp(96px, 11vw, 154px) 100px;
}

.hero-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-backdrop img {
  position: absolute;
  inset: 0 0 0 auto;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 64%;
}

.hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 45%, var(--page) 100%),
    linear-gradient(90deg, rgba(20, 19, 18, .94) 2%, rgba(20, 19, 18, .67) 34%, rgba(20, 19, 18, .06) 73%);
}

.hero h1, .prose h1 {
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.07em;
}

.hero h1 { font-size: clamp(56px, 8.3vw, 112px); }
.accent { color: var(--red-light); }

.hero-copy > p {
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(18px, 2.25vw, 26px);
  line-height: 1.4;
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-backdrop {
      animation: fade-backdrop linear both;
      animation-timeline: scroll(root block);
      animation-range: 80px 520px;
    }

    @keyframes fade-backdrop {
      from { opacity: 1; }
      to { opacity: 0; }
    }
  }
}

.button, .text-link {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 45px;
  padding: 8px 15px;
  border-radius: 5px;
  background: var(--red-button);
  color: #fff7ed;
}

.button:hover { background: #c32d21; color: #fff7ed; }
.text-link span { margin-left: 4px; }

.home-content {
  display: grid;
  gap: clamp(36px, 5vw, 58px);
  max-width: 930px;
  margin: 10px 0 72px;
}

.project-section > h2 {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.055em;
  margin-bottom: 17px;
}

.project-list { margin: 0; padding: 0; list-style: none; }
.project-list li { border-top: 1px solid var(--line); }
.project-list li:last-child { border-bottom: 1px solid var(--line); }
.github-row { border-block: 1px solid var(--line); }

.project {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 8px 16px 0;
  text-decoration: none;
  color: var(--ink);
}

.project:hover { background: #231b16; }
.project:focus-visible { outline-offset: 0; }
.project img {
  border-radius: 23%;
  corner-shape: squircle;
}
.project :is(h2, h3) { font-size: 19px; line-height: 1.25; letter-spacing: -.023em; }
.project p { margin-top: 3px; color: var(--muted); line-height: 1.45; font-size: 14px; }
.project-host { display: block; margin-top: 4px; color: var(--faint); font-size: 12px; }
.project-arrow { color: var(--red-light); font-size: 20px; }

.interior { padding-block: clamp(48px, 7.5vw, 100px) clamp(58px, 9vw, 120px); }

.prose { max-width: 710px; }

.prose h1 {
  font-size: clamp(48px, 7vw, 86px);
  text-wrap: wrap;
  margin-bottom: 24px;
}

.prose .lede {
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 1.48;
  max-width: 48ch;
  color: var(--ink);
}

.prose h2 {
  font-weight: 700;
  letter-spacing: -.04em;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  margin: 36px 0 10px;
}

.prose p { max-width: 62ch; margin: 0 0 16px; color: var(--muted); }
.prose > p:last-child { margin-bottom: 0; }

.journal .rss-button { margin-top: 12px; }
.feed-help { font-size: 14px; }

.post-list-item {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.post-list-item h2 { margin: 5px 0 8px; }
.post-list-item p { margin-bottom: 0; }
.post-list-item time, .post-date { color: var(--faint); font-size: 14px; }
.back-link { display: inline-block; margin-bottom: 22px; }

.rss-icon {
  display: inline-block;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  background:
    radial-gradient(circle at 1.7px calc(100% - 1.7px), currentColor 1.5px, transparent 1.7px),
    radial-gradient(circle at 0 100%, transparent 5.4px, currentColor 5.6px 7px, transparent 7.2px),
    radial-gradient(circle at 0 100%, transparent 9.9px, currentColor 10.1px 11.5px, transparent 11.7px);
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  color: var(--faint);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 8px;
  font-size: 13px;
}

.footer-rss {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--muted);
}

.footer-rss:hover { color: var(--red-light); }

@media (min-width: 950px) {
  .hero-backdrop img {
    width: clamp(900px, 78%, 1400px);
    mask-image: linear-gradient(90deg, transparent, #000 27%);
  }

  .hero-backdrop::after {
    background:
      linear-gradient(to bottom, transparent 52%, var(--page) 100%),
      linear-gradient(90deg, var(--page) 1%, rgba(20, 19, 18, .63) 29%, transparent 65%);
  }
}

@media (max-width: 850px) {
  .wrap { width: calc(100% - 56px); }
}

@media (max-width: 670px) {
  .wrap { width: calc(100% - 32px); }

  .header-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 10px;
  }

  .main-nav { grid-row: 2; grid-column: 1 / -1; }
  .main-nav a[aria-current="page"]::after { bottom: 0; }

  .hero {
    min-height: 440px;
    padding-block: 55px 180px;
  }

  .hero h1 { font-size: clamp(48px, 11.2vw, 70px); }
  .hero-copy > p { margin-top: 10px; }

  .hero-backdrop img { object-position: 47% 62%; }

  .hero-backdrop::after {
    background:
      linear-gradient(to bottom, rgba(20, 19, 18, .78) 0%, rgba(20, 19, 18, .62) 24%, transparent 57%, var(--page) 100%),
      linear-gradient(90deg, rgba(20, 19, 18, .24), transparent 65%);
  }

  .home-content { margin: 0 0 48px; }
  .project { gap: 12px; }
  .project img { width: 49px; height: 49px; }
  .project :is(h2, h3) { font-size: 18px; }
}

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