html:has(body.page-site) {
  min-height: 100%;
  min-height: 100svh;
}

body.page-site {
  min-height: 100%;
  min-height: 100svh;
  color: #000;
}

body.page-site:has(.home) {
  display: flex;
  flex-direction: column;
}

body.page-site .topbar {
  position: sticky;
  top: 0;
}

.home {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.home-inner,
.abstract-inner,
.writeup-inner {
  max-width: 52rem;
  margin: 0 auto;
}

.abstract p,
.writeup p {
  margin: 0 0 1.15em;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.65;
  color: #000;
}

.abstract p:last-child,
.writeup p:last-child {
  margin-bottom: 0;
}

.home-intro {
  --intro-extra: clamp(3.5rem, 16vw, 12rem);
  --intro-side: calc(var(--page-pad) + var(--intro-extra));
  --intro-min-h: clamp(22rem, 38vw, 30rem);
  --person-right: 71.0417%;
  --person-scale: 1;
  --person-reserve: calc(0.86 * var(--intro-min-h) * var(--person-scale));
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: var(--intro-min-h);
  background: #fff;
  padding: 40px var(--page-pad);
}

.home-intro::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--intro-side);
  z-index: 1;
  height: calc(100% * var(--person-scale));
  width: auto;
  aspect-ratio: 3840 / 1760;
  transform: translate(calc(100% - var(--person-right)), -50%);
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.41) 0%,
    rgba(255, 255, 255, 0.28) 8%,
    rgba(255, 255, 255, 0.12) 20%,
    transparent 30%
  );
}

.home-intro-portrait {
  position: absolute;
  top: 50%;
  right: var(--intro-side);
  left: auto;
  z-index: 0;
  height: calc(100% * var(--person-scale));
  width: auto;
  max-width: none;
  transform: translate(calc(100% - var(--person-right)), -50%);
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.18) 6%,
    rgba(0, 0, 0, 0.42) 12%,
    rgba(0, 0, 0, 0.72) 18%,
    rgba(0, 0, 0, 0.92) 24%,
    #000 30%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.18) 6%,
    rgba(0, 0, 0, 0.42) 12%,
    rgba(0, 0, 0, 0.72) 18%,
    rgba(0, 0, 0, 0.92) 24%,
    #000 30%
  );
}

.home-intro .home-inner {
  --home-hello-size: clamp(2.5rem, 7vw, 4.5rem);
  position: relative;
  z-index: 2;
  width: min(34rem, calc(100% - 2 * var(--intro-extra) - var(--person-reserve) - 1.25rem));
  max-width: 34rem;
  margin: 0 0 0 var(--intro-extra);
}

.home-intro .home-tagline {
  max-width: 28rem;
  /* Archivo's H sits inward of Work Sans's A; shift the subtitle to the stem. */
  margin-left: calc(0.065 * var(--home-hello-size));
}

@media (max-width: 960px) {
  .home-intro {
    --intro-extra: clamp(2rem, 10vw, 6rem);
  }

  .home-intro .home-inner {
    width: min(28rem, calc(100% - 2 * var(--intro-extra) - var(--person-reserve) - 1rem));
  }
}

@media (max-width: 720px) {
  .home-intro {
    --intro-extra: 0;
    --intro-min-h: 0;
    --person-scale: 1;
    --person-reserve: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
    padding: 28px var(--page-pad) 0;
  }

  .home-intro::after {
    content: none;
  }

  .home-intro .home-inner {
    width: auto;
    max-width: none;
    margin: 0 0 -1.15rem;
    text-align: center;
  }

  .home-intro .home-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .home-intro .home-tagline-break {
    display: block;
  }

  .home-intro-portrait {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    z-index: 0;
    display: block;
    width: calc(100% + 2 * var(--page-pad));
    max-width: none;
    height: 56vw;
    min-height: 12.5rem;
    max-height: 22rem;
    margin: 0 calc(-1 * var(--page-pad));
    transform: none;
    object-fit: cover;
    object-position: 71.0417% 0%;
    -webkit-mask-image: linear-gradient(
      180deg,
      transparent 0%,
      rgba(0, 0, 0, 0.28) 5%,
      rgba(0, 0, 0, 0.7) 10%,
      #000 14%
    );
    mask-image: linear-gradient(
      180deg,
      transparent 0%,
      rgba(0, 0, 0, 0.28) 5%,
      rgba(0, 0, 0, 0.7) 10%,
      #000 14%
    );
  }
}

.home-hello {
  margin: 0 0 0.5em;
  font-family: "Archivo", var(--font-head), sans-serif;
  font-size: var(--home-hello-size, clamp(2.5rem, 7vw, 4.5rem));
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: #000;
}

.home-tagline {
  margin: 0;
  max-width: 36rem;
  font-family: var(--font);
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  font-weight: 400;
  line-height: 1.5;
  color: #000;
}

.home-recent {
  flex: 1 1 auto;
  margin-top: 0;
  background: var(--bg);
  padding: 48px var(--page-pad) 48px;
}

.home-recent-title {
  margin: 0 0 22px;
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.2;
  color: #000;
}

.home-recent .project-card {
  margin-top: 0;
}

.home-footer {
  margin-top: auto;
  background: var(--bg);
  padding: 24px var(--page-pad) calc(28px + env(safe-area-inset-bottom, 0px));
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.35rem 1.75rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
}

.home-links a {
  color: #000;
  text-decoration: none;
}

.home-links a:hover,
.home-links a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.home-links a:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

.project-card {
  --thumb: 9.25rem;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  margin-top: 28px;
  padding: 0;
  min-height: var(--thumb);
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-card);
  box-shadow: 0 10px 40px rgba(30, 30, 31, 0.06);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    border-color 0.4s ease;
}

.project-card-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 20px 20px;
}

.project-card-media {
  flex: 0 0 var(--thumb);
  width: var(--thumb);
  align-self: stretch;
  overflow: hidden;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
}

.project-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  transform: scale(1);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 18px 44px rgba(30, 30, 31, 0.12),
    0 0 28px 8px rgba(51, 23, 104, 0.16);
}

.project-card:hover .project-card-media img,
.project-card:focus-visible .project-card-media img {
  transform: scale(1.08);
}

.project-card:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

.project-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #000;
}

.project-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.hero {
  position: relative;
  overflow: hidden;
  height: calc(100svh - var(--topbar-h));
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px var(--page-pad);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url("/gradient_light_2_grain.jpg") center 16% / cover no-repeat;
  pointer-events: none;
  z-index: 0;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  width: min(100%, 72rem);
}

.hero-title {
  margin: 0;
  font-family: "Archivo", var(--font-head), sans-serif;
  font-size: clamp(2.65rem, 8.2vw, 6.2rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: 0.01em;
  color: #000;
  text-align: center;
  white-space: nowrap;
}

.hero-sub {
  margin: 0;
  max-width: 46rem;
  font-family: var(--font);
  font-size: clamp(0.98rem, 1.55vw, 1.22rem);
  font-weight: 400;
  line-height: 1.5;
  color: #000;
  text-align: center;
}

.hero-nowrap {
  white-space: nowrap;
}

.hero-letter {
  color: #000;
  transition: color 0.7s ease;
  --letter-delay: 0s;
}

.hero-letter.is-violet {
  --letter-color: var(--violet);
}

.hero-letter.is-lavender {
  --letter-color: var(--lavender);
}

.hero-letter.is-red {
  --letter-color: var(--red);
}

.hero-letter.is-ash {
  --letter-color: var(--ash);
}

.hero-copy.is-playing .hero-letter,
.letter-copy.is-playing .hero-letter {
  animation: hero-letter-pulse 2.4s ease-in-out infinite;
  animation-delay: var(--letter-delay);
  animation-fill-mode: both;
}

@keyframes hero-letter-pulse {
  0%,
  100% {
    color: #000;
  }
  50% {
    color: var(--letter-color);
  }
}

.abstract {
  background: var(--bg);
  padding: 48px var(--page-pad) 56px;
}

.topbar .pill-demo {
  margin-top: 0;
  margin-left: auto;
  pointer-events: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .brand {
    font-size: 15px;
  }

  .brand-name {
    letter-spacing: 0.08em;
  }

  .topbar .pill-demo {
    font-size: 0.78rem;
    padding: 8px 14px;
  }
}

@media (max-width: 420px) {
  .brand {
    font-size: 13px;
  }

  .brand-name {
    letter-spacing: 0.05em;
  }

  .topbar .pill-demo {
    font-size: 0.72rem;
    padding: 7px 12px;
  }
}

.pill-demo {
  display: inline-block;
  margin-top: 22px;
  padding: 10px 22px;
  background: var(--violet);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 0 0 0 rgba(51, 23, 104, 0);
  transition: box-shadow 0.32s ease;
}

.pill-demo:hover,
.pill-demo:focus-visible {
  box-shadow:
    0 0 24px 6px rgba(51, 23, 104, 0.32),
    0 0 48px 16px rgba(51, 23, 104, 0.14);
}

.pill-demo:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

.writeup {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  padding: 56px var(--page-pad) 88px;
}

.writeup-title {
  margin: 0 0 0.25em;
  font-family: var(--font);
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  color: #000;
}

.writeup-date {
  display: block;
  margin: 0 0 1.15em;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.4;
  color: #000;
}

.writeup h3 {
  margin: 1.7em 0 0.55em;
  font-family: var(--font);
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.3;
  color: #000;
}

.writeup-table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.4em 0 1.3em;
}

.writeup-table.is-scaled {
  overflow: hidden;
}

.writeup table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  table-layout: auto;
  border-collapse: collapse;
  margin: 0;
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.45;
  color: #000;
  transform-origin: top left;
}

.writeup th,
.writeup td {
  display: table-cell;
  text-align: left;
  padding: 0.5em 0.65em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  vertical-align: bottom;
}

.writeup th:first-child,
.writeup td:first-child {
  padding-left: 0;
}

.writeup th:last-child,
.writeup td:last-child {
  padding-right: 0;
}

.writeup th {
  font-weight: 600;
  line-height: 1.25;
}

.writeup td.cost,
.writeup th.cost {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.writeup td.cost {
  white-space: nowrap;
}

.writeup caption {
  caption-side: bottom;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0.45em 0 0;
  color: #000;
}

.writeup .eq {
  text-align: center;
  overflow-x: auto;
  margin: 1.05em 0 1.25em;
  padding: 0.15em 0;
  font-size: 1.04rem;
  line-height: 1.85;
}

.writeup h3,
.writeup .eq,
.writeup figure {
  scroll-margin-top: 5.5rem;
}

.writeup figure {
  margin: 1.15em 0 1.5em;
}

.writeup figcaption {
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0.5em 0 0;
}

.writeup .arch-svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .pill-demo,
  .project-card,
  .project-card-media img {
    transition: none;
  }

  .project-card:hover,
  .project-card:focus-visible,
  .project-card:hover .project-card-media img,
  .project-card:focus-visible .project-card-media img {
    transform: none;
  }

  .hero-bg {
    transform: none !important;
  }

  .hero-letter,
  .hero-copy.is-playing .hero-letter,
  .letter-copy.is-playing .hero-letter {
    animation: none;
    color: #000;
    transition: none;
  }
}
