@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/montserrat-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/montserrat-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/montserrat-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --paper: #f5f2eb;
  --ink: #202a24;
  --brand-red: #dd0000;
  --line: #c5c8bc;
  --font: "Montserrat", system-ui, sans-serif;
  --title-min: 1.625rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.65 var(--font);
}

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

a:focus-visible {
  outline: 3px solid #9a6429;
  outline-offset: 5px;
}

h1, h2, h3 {
  margin: 0;
  font: 600 1em/1.12 var(--font);
}

p, figure {
  margin: 0;
}

.wrap {
  width: min(1280px, 90%);
  margin-inline: auto;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.home-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
}

.home-header .top {
  padding-block: .75rem;
}

.home-header nav {
  gap: .65rem;
}

html:has(.home-header) {
  scroll-padding-top: 5rem;
}

@media (max-width: 600px) {
  .home-header .top {
    gap: .5rem .75rem;
    padding-block: .5rem;
  }

  .home-header .brand {
    width: min(8rem, 45%);
  }

  html:has(.home-header) {
    scroll-padding-top: 3.5rem;
  }
}

nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.4rem);
}

nav a {
  font-weight: 500;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

.profile-intro {
  display: grid;
  gap: 1.3rem;
  padding: clamp(2.6rem, 4vw, 3.5rem) 0;
}

.profile-intro h1 {
  font-size: min(calc(clamp(var(--title-min), 2.5vw, 2.5rem) * .9409), 3.7vw);
  line-height: 1.2;
  letter-spacing: -.025em;
}

.profile-contact-copy {
  max-width: 52ch;
}

.profile-about {
  max-width: 65ch;
  font-size: 1.05rem;
}

.profile-about p + p {
  margin-top: .85rem;
}

.profile-section {
  scroll-margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 clamp(2.4rem, 5vw, 4.5rem);
}

.profile-section h2 {
  margin-bottom: 1.35rem;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
}

.portfolio-entry {
  display: block;
  width: min(100%, 62rem);
  text-decoration: none;
}

.portfolio-entry img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.portfolio-caption {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .55rem 1.5rem;
  padding-top: .9rem;
}

.portfolio-caption h3 {
  font-size: clamp(1.1rem, 1.55vw, 1.375rem);
  line-height: 1.3;
}

.portfolio-entry:hover h3 {
  text-decoration: underline;
}

.profile-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem 1.5rem;
}

.profile-contact h2 {
  margin: 0;
}

.profile-footer, .project-footer .wrap {
  display: flex;
  justify-content: flex-end;
  padding: 1.5rem 0;
}

.profile-footer {
  border-top: 1px solid var(--line);
}

@media (max-width: 680px) {
  .profile-intro {
    container-type: inline-size;
  }

  .profile-intro h1 {
    font-size: min(calc(var(--title-min) * .9409), 4.45cqi);
    font-weight: 700;
  }

  .profile-about {
    max-width: 52ch;
    font-size: 1.03rem;
  }

  .profile-about-break {
    display: none;
  }
}

.profile-intro h1,
.profile-about strong,
.project-code {
  color: var(--brand-red);
}

.project-status {
  color: #4c5b4b;
  font-size: .88rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.project-heading {
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(1.8rem, 4vw, 3rem);
}

.project-heading h1 {
  margin: .6rem 0 1rem;
  font-size: clamp(var(--title-min), 2.8vw, 2.45rem);
  line-height: 1.2;
  letter-spacing: -.025em;
}

.project-heading > p:last-child {
  max-width: 58ch;
}

.project-figure {
  display: block;
  background: transparent;
}

.project-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.project-figure figcaption {
  color: #445044;
  padding: .7rem 0;
  font-size: .875rem;
}

.project-cover img {
  max-height: 680px;
  object-fit: cover;
  object-position: center 60%;
}

.project-notes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  margin-top: clamp(2.5rem, 7vw, 5.5rem);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.project-story h2 {
  margin-bottom: .7rem;
  font-size: clamp(1.25rem, 1.9vw, 1.6rem);
}

.project-story section + section {
  margin-top: 1.6rem;
}

.project-footer {
  border-top: 1px solid var(--line);
}

@media (max-width: 740px) {
  .project-notes {
    grid-template-columns: 1fr;
  }
}

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

.brand {
  display: block;
  width: clamp(9rem, 17vw, 12rem);
  flex-shrink: 0;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.profile-contact address {
  font-style: normal;
}

.profile-contact dl {
  margin: 1.25rem 0 0;
}

.profile-contact dl > div {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: .4rem .75rem;
  padding: .45rem 0;
  border-top: 1px solid var(--line);
}

.profile-contact dt {
  font-weight: 650;
}

.profile-contact dd {
  margin: 0;
}

.profile-contact dd a {
  overflow-wrap: anywhere;
  text-decoration: none;
}

.profile-contact dd a:hover {
  color: #526a47;
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 1rem 1.5rem;
  margin: 0 0 2rem;
}

.project-facts > div {
  border-top: 1px solid var(--line);
  padding-top: .75rem;
}

.project-facts dt {
  font-weight: 650;
}

.project-facts dd {
  margin: .2rem 0 0;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-gallery-cover {
  grid-column: 1 / -1;
}

.project-source {
  margin: 1.25rem 0 2.5rem;
}

.project-source a {
  font-weight: 600;
  text-decoration: none;
}

.project-source a:hover,
.project-footer a {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .project-gallery {
    grid-template-columns: 1fr;
  }
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem 1.5rem;
}

.portfolio-grid .portfolio-caption {
  align-items: start;
  flex-direction: column;
  gap: .4rem;
}

@media (max-width: 900px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}
