:root {
  --ink: #1d1b17;
  --muted: #625c50;
  --paper: #f3eadc;
  --paper-light: #fff8ec;
  --paper-deep: #e4d5c0;
  --line: rgba(51, 43, 31, 0.17);
  --line-strong: rgba(48, 39, 27, 0.31);
  --green: #122b22;
  --green-2: #1e3a2f;
  --orange: #ef5b1f;
  --orange-deep: #d94814;
  --shadow: 0 24px 54px rgba(35, 26, 14, 0.16);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SF Mono", Consolas, "Liberation Mono", monospace;
  --hand: "Bradley Hand", "Segoe Print", "Marker Felt", cursive;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    linear-gradient(rgba(83, 65, 37, 0.042) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 65, 37, 0.032) 1px, transparent 1px),
    var(--paper);
  background-size: 38px 38px, 38px 38px, auto;
}

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

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
figure,
dl,
ol {
  margin: 0;
}

button,
input {
  font: inherit;
}

.site-header {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(170px, 260px) 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 18px clamp(22px, 4vw, 64px);
  background: var(--green);
  color: #fff7ea;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}


.brand,
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.brand img {
  width: 188px;
  max-height: 42px;
  filter: brightness(0) invert(1);
}

.footer-brand img {
  width: 188px;
  max-height: 42px;
  filter: brightness(0);
}

.nav {
  display: flex;
  justify-content: center;
  gap: clamp(15px, 2.8vw, 40px);
  color: #fff7ea;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  position: relative;
  justify-content: center;
  min-width: 44px;
  padding: 9px 0;
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 2px;
  background: var(--orange);
}

.header-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 0 19px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-cta,
.button-orange {
  background: var(--orange);
  color: #fffaf0;
  border: 1px solid var(--orange-deep);
  box-shadow: 0 11px 24px rgba(239, 91, 31, 0.2);
}

.button-outline {
  color: #fff8e8;
  border: 1px solid rgba(255, 248, 232, 0.72);
}

.header-cta::after,
.button::after {
  content: "->";
  margin-left: 10px;
}

.nav a,
.header-cta,
.button,
.filter-button,
.project-card,
.project-card img,
.project-card > a {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.nav a:focus-visible,
.header-cta:focus-visible,
.button:focus-visible,
.filter-button:focus-visible,
.project-card > a:focus-visible {
  outline: 3px solid rgba(239, 91, 31, 0.72);
  outline-offset: 4px;
}

@media (hover: hover) {
  .nav a:hover {
    color: #ffd4bd;
  }

  .header-cta:hover,
  .button-orange:hover {
    transform: translateY(-1px);
    background: #ff6426;
    box-shadow: 0 14px 28px rgba(239, 91, 31, 0.28);
  }

  .button-outline:hover,
  .filter-button:hover {
    transform: translateY(-1px);
    border-color: rgba(47, 40, 28, 0.42);
    box-shadow: 0 12px 22px rgba(42, 31, 18, 0.14);
  }

  .project-card:hover,
  .project-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 20px 38px rgba(37, 28, 17, 0.14);
  }

  .project-card:hover img,
  .project-card:focus-within img {
    transform: scale(1.025);
  }
}

.eyebrow {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0;
}

.orange-note {
  color: var(--orange);
  font-family: var(--hand);
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 700;
  line-height: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portfolio-hero {
  max-width: 1580px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(340px, 0.36fr) minmax(0, 0.64fr);
  min-height: 520px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  position: relative;
  padding: clamp(56px, 6vw, 92px) clamp(28px, 5vw, 82px);
  overflow: hidden;
  background: rgba(255, 248, 236, 0.55);
}

.hero-grid {
  position: absolute;
  left: 0;
  bottom: 20px;
  width: min(440px, 85%);
  opacity: 0.38;
  mix-blend-mode: multiply;
}

.hero-copy > *:not(.hero-grid) {
  position: relative;
  z-index: 2;
}

.hero-copy h1 {
  width: fit-content;
  margin: 20px 0 24px;
  font-size: clamp(58px, 7vw, 108px);
  line-height: 0.92;
}

.hero-copy h1::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: 12px;
  background: var(--orange);
  transform: rotate(-1deg);
}

.hero-lede {
  max-width: 360px;
  margin-bottom: 18px;
  font-family: var(--serif);
  font-size: clamp(34px, 3.2vw, 52px);
  line-height: 0.95;
}

.hero-copy p:last-child {
  max-width: 320px;
  color: #443d33;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.hero-photo {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: #d6c5ac;
}

.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.hero-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(243,234,220,0.78), rgba(243,234,220,0) 28%);
  pointer-events: none;
}

.hero-note {
  position: absolute;
  right: clamp(34px, 5vw, 72px);
  bottom: clamp(34px, 5vw, 72px);
  max-width: 190px;
  transform: rotate(-6deg);
  text-shadow: 0 1px 0 rgba(255, 248, 236, 0.55);
}

.project-filters {
  position: relative;
  max-width: 1420px;
  margin: 26px auto 34px;
  padding: 0 clamp(18px, 4vw, 54px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 22px;
}

.filter-button {
  min-width: 114px;
  min-height: 42px;
  padding: 0 20px;
  color: #1c1a16;
  background:
    linear-gradient(rgba(255,255,255,0.46), rgba(255,255,255,0.18)),
    url("../v4-portfolio/generated/portfolio/portfolio-filter-tab.webp") center / 105% 115% no-repeat;
  border: 1px solid rgba(45, 37, 25, 0.18);
  border-radius: 5px;
  box-shadow: 0 8px 16px rgba(41, 31, 17, 0.09);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-button.is-active {
  color: #fff8ed;
  background: var(--orange);
  border-color: var(--orange-deep);
}

.project-grid {
  max-width: 1420px;
  margin: 0 auto 54px;
  padding: 0 clamp(18px, 4vw, 54px);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  position: relative;
  grid-column: span 2;
  min-height: 344px;
  display: grid;
  grid-template-rows: 190px 1fr;
  background: rgba(255, 248, 236, 0.82);
  border: 1px solid rgba(45, 37, 25, 0.18);
  border-radius: 7px;
  box-shadow: 0 13px 28px rgba(37, 28, 17, 0.12);
  overflow: hidden;
}

.project-card[hidden] {
  display: none;
}

.project-card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.project-card-media {
  position: relative;
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.project-card-media .project-media-label {
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 7px 9px 6px 21px;
  font-size: 8px;
}

.project-card > div {
  padding: 20px 58px 20px 20px;
}

.project-card h2 {
  margin-bottom: 6px;
  font-size: 27px;
  line-height: 1.02;
}

.project-card p:not(.orange-note) {
  margin-bottom: 8px;
  color: #211f1a;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-card small {
  color: #3f392f;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.project-tag {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 2;
  padding: 6px 9px;
  color: #fff7eb;
  background: var(--orange);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-note {
  position: absolute;
  right: 16px;
  top: 24px;
  z-index: 2;
  width: 110px;
  font-size: 24px;
  transform: rotate(-8deg);
  text-shadow: 0 1px 0 rgba(255, 248, 236, 0.55);
}

.project-card > a {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: auto;
  height: auto;
  display: block;
  overflow: hidden;
  color: transparent;
  border: 0;
  border-radius: inherit;
  font-family: var(--mono);
  font-size: 0;
  font-weight: 900;
}

.project-card > a::after {
  content: "->";
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 248, 236, 0.88);
  border: 1px solid rgba(29, 27, 23, 0.55);
  border-radius: 4px;
  font-size: 13px;
}

.project-card-wide {
  min-height: 300px;
  grid-column: span 3;
  grid-template-rows: minmax(210px, 1fr) auto;
}

.project-card-dark {
  color: #fff8e8;
  background: var(--green);
}

.project-card-dark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.56));
  pointer-events: none;
}

.project-card-dark > div,
.project-card-dark > a,
.project-card-dark .project-tag,
.project-card-dark .card-note {
  z-index: 2;
}

.project-card-dark > div {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

.project-card-dark h2,
.project-card-dark p:not(.orange-note),
.project-card-dark small {
  color: #fff8e8;
}

.project-card-dark > a {
  color: #fff8e8;
  border-color: rgba(255,248,232,0.72);
}

.site-footer {
  max-width: 1580px;
  margin: 0 auto;
  padding: 32px clamp(22px, 5vw, 86px) 36px;
  display: grid;
  grid-template-columns: minmax(280px, 0.32fr) repeat(3, minmax(160px, 1fr));
  gap: clamp(24px, 4vw, 68px);
  color: #f8efe0;
  background: #0f251d;
}

.footer-brand img {
  filter: brightness(0) invert(1) !important;
}

.footer-brand p {
  max-width: 330px;
  margin-top: 20px;
  color: #d8cfbf;
  font-size: 14px;
  line-height: 1.55;
}

.site-footer h2 {
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-footer a,
.site-footer span {
  display: block;
  margin-bottom: 8px;
  color: #d8cfbf;
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
}

.site-footer a {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 0;
}

.project-detail-page {
  max-width: 1580px;
  margin: 0 auto;
}

.project-detail-hero {
  display: grid;
  grid-template-columns: minmax(340px, 0.42fr) minmax(0, 0.58fr);
  min-height: 500px;
  border-bottom: 1px solid var(--line);
}

.project-detail-copy {
  padding: clamp(44px, 5vw, 72px) clamp(28px, 5vw, 82px);
  background:
    linear-gradient(rgba(255,255,255,0.34), rgba(255,255,255,0.06)),
    var(--paper-light);
}

.project-detail-copy h1 {
  margin: 20px 0 20px;
  font-size: clamp(46px, 5.5vw, 82px);
  line-height: 0.95;
}

.project-detail-copy h1::after,
.project-detail-story h2::after,
.project-detail-gallery h2::after {
  content: "";
  display: block;
  width: min(320px, 70%);
  height: 3px;
  margin-top: 13px;
  background: var(--orange);
  transform: rotate(-1deg);
}

.project-detail-lede {
  max-width: 480px;
  color: #3f392f;
  font-size: clamp(19px, 2vw, 27px);
  font-weight: 800;
  line-height: 1.26;
}

.project-detail-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.project-back-link {
  color: var(--ink);
  background: rgba(255,248,236,0.65);
  border: 1px solid var(--line-strong);
}

.project-detail-photo {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  background: #d6c5ac;
}

.project-detail-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-media-label {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 4;
  max-width: calc(100% - 36px);
  padding: 9px 12px 8px 24px;
  color: #fff8ec;
  background: rgba(18, 43, 34, 0.94);
  border: 1px solid rgba(255, 248, 236, 0.38);
  box-shadow: 0 10px 24px rgba(26, 19, 11, 0.22);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.075em;
  line-height: 1.25;
  text-transform: uppercase;
  pointer-events: none;
}

.project-media-label::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff4d2 0 14%, #b9a275 24%, #63543a 72%, #31291d 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
  transform: translateY(-50%);
}

.project-media-label[data-media-kind="rendering"] {
  color: var(--green);
  background: rgba(255, 248, 236, 0.96);
  border-color: rgba(239, 91, 31, 0.72);
}

.project-media-label[data-media-kind="completed"] {
  background: rgba(18, 43, 34, 0.94);
  border-color: rgba(255, 139, 83, 0.72);
}

.project-detail-ledger {
  max-width: 1420px;
  margin: 34px auto;
  padding: 22px clamp(18px, 4vw, 40px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  background: rgba(255,248,236,0.76);
  border: 1px solid rgba(45, 37, 25, 0.16);
  box-shadow: 0 13px 28px rgba(37, 28, 17, 0.09);
}

.project-detail-ledger div {
  min-width: 0;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.project-detail-ledger div:last-child {
  border-right: 0;
}

.project-detail-ledger dt {
  margin-bottom: 7px;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.project-detail-ledger dd {
  margin: 0;
  color: #2d2820;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.project-detail-story {
  max-width: 1420px;
  margin: 0 auto 38px;
  padding: 0 clamp(18px, 4vw, 54px);
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(240px, 0.38fr);
  gap: clamp(24px, 4vw, 58px);
  align-items: start;
}

.story-copy h2,
.project-detail-gallery h2 {
  max-width: 620px;
  margin: 14px 0 22px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.98;
}

.entry-content {
  max-width: 690px;
  color: #40392f;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.65;
}

.entry-content p + p {
  margin-top: 16px;
}

.story-note {
  padding: 28px 26px;
  background:
    linear-gradient(rgba(255,255,255,0.52), rgba(255,255,255,0.08)),
    var(--paper-light);
  border: 1px solid rgba(45, 37, 25, 0.16);
  box-shadow: 0 16px 30px rgba(33, 25, 15, 0.12);
  transform: rotate(1.2deg);
}

.story-note ul {
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 11px;
}

.story-note li {
  list-style: none;
  color: #2d2820;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.story-note li::before {
  content: "/";
  margin-right: 8px;
  color: var(--orange);
}

.project-detail-compare {
  max-width: 1420px;
  margin: 0 auto 54px;
  padding: 0 clamp(18px, 4vw, 54px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project-detail-compare figure {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(45, 37, 25, 0.2);
  box-shadow: 0 18px 34px rgba(33, 25, 15, 0.14);
}

.project-detail-compare img {
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: cover;
}

.project-detail-gallery {
  max-width: 1420px;
  margin: 0 auto 72px;
  padding: 0 clamp(16px, 3.2vw, 48px);
}

.project-detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(20px, 2vw, 28px);
}

.project-detail-gallery-simple .project-detail-gallery-grid {
  margin-top: 0;
}

.project-detail-gallery-grid figure {
  position: relative;
  min-height: clamp(276px, 22vw, 340px);
  padding: 10px;
  background: #fff8ec;
  border: 1px solid rgba(45, 37, 25, 0.16);
  box-shadow: 0 16px 32px rgba(37, 28, 17, 0.12);
}

.project-detail-gallery-grid img {
  width: 100%;
  height: clamp(256px, 20vw, 320px);
  object-fit: cover;
}

.project-detail-photo img,
.project-detail-compare img,
.project-detail-gallery-grid img {
  cursor: zoom-in;
}

.project-back-float {
  position: fixed;
  left: clamp(16px, 3vw, 30px);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff8ec;
  background: rgba(18, 43, 34, 0.94);
  border: 1px solid rgba(255, 248, 236, 0.28);
  box-shadow: 0 18px 36px rgba(25, 19, 12, 0.22);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, background-color 160ms ease;
}

.project-back-float.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.project-back-float:focus-visible {
  outline: 3px solid rgba(239, 91, 31, 0.78);
  outline-offset: 4px;
}

body.project-lightbox-open .project-back-float {
  opacity: 0;
  pointer-events: none;
}

.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  grid-template-columns: minmax(54px, 96px) minmax(0, 1fr) minmax(54px, 96px);
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  padding: clamp(18px, 3vw, 44px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(13, 28, 21, 0.92);
  backdrop-filter: blur(12px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.project-lightbox.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

body.project-lightbox-open {
  overflow: hidden;
}

.project-lightbox-frame {
  grid-column: 2;
  justify-self: center;
  max-width: min(100%, 1220px);
  max-height: calc(100vh - 96px);
  max-height: calc(100svh - 96px);
  background: #10100e;
  border: 1px solid rgba(255, 248, 236, 0.26);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.project-lightbox-frame img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 98px);
  max-height: calc(100svh - 98px);
  object-fit: contain;
  cursor: default;
}

#project-grid {
  scroll-margin-top: 88px;
}

.project-lightbox button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  color: #fff8ec;
  background: rgba(18, 43, 34, 0.84);
  border: 1px solid rgba(255, 248, 236, 0.42);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.project-lightbox button:focus-visible {
  outline: 3px solid rgba(239, 91, 31, 0.78);
  outline-offset: 4px;
}

.project-lightbox .project-lightbox-close {
  position: absolute;
  top: clamp(16px, 3vw, 30px);
  right: clamp(16px, 3vw, 30px);
  width: 46px;
  height: 46px;
}

.project-lightbox-nav {
  width: 54px;
  height: 54px;
  border-radius: 50%;
}

.project-lightbox-close::before,
.project-lightbox-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 25px;
  height: 4px;
  background: currentColor;
  border-radius: 999px;
  transform-origin: center;
}

.project-lightbox-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.project-lightbox-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.project-lightbox-nav::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 17px;
  border-color: currentColor;
  border-style: solid;
  border-width: 0 0 4px 4px;
  border-radius: 1px;
}

.project-lightbox-prev::before {
  transform: translate(-39%, -50%) rotate(45deg);
}

.project-lightbox-next::before {
  transform: translate(-61%, -50%) rotate(-135deg);
}

.project-lightbox-prev {
  grid-column: 1;
  justify-self: center;
}

.project-lightbox-next {
  grid-column: 3;
  justify-self: center;
}

@media (hover: hover) {
  .project-lightbox button:hover {
    transform: translateY(-1px);
    background: var(--orange);
    border-color: rgba(255, 248, 236, 0.72);
  }
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .portfolio-hero,
  .project-detail-hero,
  .project-detail-story {
    grid-template-columns: 1fr;
  }

  .portfolio-hero,
  .project-detail-hero {
    min-height: 0;
  }

  .hero-copy {
    padding: 44px 34px 46px;
  }

  .hero-copy h1 {
    margin: 16px 0 18px;
    font-size: clamp(54px, 8vw, 92px);
  }

  .hero-lede {
    margin-bottom: 14px;
    font-size: clamp(30px, 4vw, 44px);
  }

  .hero-photo {
    min-height: 320px;
  }

  .project-detail-copy {
    padding: 44px 34px 46px;
  }

  .project-detail-copy h1 {
    max-width: none;
    font-size: clamp(46px, 7vw, 76px);
  }

  .project-detail-lede {
    max-width: 520px;
  }

  .project-detail-photo,
  .project-detail-photo img {
    min-height: 340px;
  }

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

  .project-card,
  .project-card-wide {
    grid-column: auto;
  }

  .site-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-detail-ledger {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 780px) {
  .site-header {
    grid-template-columns: 1fr auto;
    position: static;
    min-height: 0;
    gap: 14px;
    padding: 15px 16px;
  }


  .brand,
  .nav a {
    min-height: 44px;
  }

  .brand,
  .nav a {
    display: inline-flex;
    align-items: center;
  }

  .brand img,
  .footer-brand img {
    width: 148px;
  }

  .header-cta,
  .button {
    min-height: 40px;
    padding: 0 14px;
    font-size: 10px;
  }

  .nav {
    gap: 6px 16px;
    font-size: 10px;
    line-height: 1.2;
  }

  .hero-copy {
    padding: 36px 22px 38px;
  }

  .hero-copy h1 {
    font-size: clamp(50px, 18vw, 74px);
  }

  .hero-lede {
    font-size: clamp(31px, 11vw, 44px);
  }

  .hero-photo {
    min-height: 280px;
  }

  .project-filters {
    justify-content: flex-start;
    gap: 10px;
  }

  .filter-button {
    min-width: 0;
    flex: 1 1 calc(50% - 10px);
    padding: 0 10px;
  }

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

  
  .site-footer {
    margin-left: 0;
    margin-right: 0;
    padding-left: 18px;
    padding-right: 18px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .project-detail-copy {
    padding: 36px 22px 38px;
  }

  .project-detail-copy h1 {
    max-width: 8.5ch;
    font-size: clamp(42px, 13vw, 52px);
  }

  .project-detail-lede {
    max-width: none;
    font-size: 18px;
    line-height: 1.28;
  }

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

  .project-detail-actions .button {
    width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  .project-back-float {
    left: 15px;
    top: calc(70px + env(safe-area-inset-top, 0px));
    bottom: auto;
    min-height: 42px;
    padding: 0 14px;
    font-size: 10px;
  }

  .project-detail-photo,
  .project-detail-photo img {
    min-height: 280px;
  }

  .project-detail-ledger,
  .project-detail-compare {
    grid-template-columns: 1fr;
  }

  .project-detail-ledger div {
    padding: 0 0 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-detail-ledger div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .project-detail-compare figure,
  .project-detail-compare img {
    min-height: 320px;
  }

  .project-lightbox {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 66px 14px 18px;
  }

  .project-lightbox-frame {
    grid-column: 1 / -1;
    max-height: calc(100vh - 142px);
    max-height: calc(100svh - 142px);
  }

  .project-lightbox-frame img {
    max-height: calc(100vh - 144px);
    max-height: calc(100svh - 144px);
  }

  .project-lightbox-prev,
  .project-lightbox-next {
    grid-row: 2;
  }

  .project-lightbox-prev {
    grid-column: 1;
    justify-self: end;
  }

  .project-lightbox-next {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 430px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 8px;
    padding: 12px 14px;
  }

  .brand img {
    width: 132px;
  }

  .site-header .header-cta {
    width: auto;
    min-height: 40px;
    padding: 0 10px;
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .site-header .header-cta::after {
    margin-left: 6px;
  }

  .nav {
    grid-column: 1 / -1;
    width: 100%;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 4px;
    font-size: 8.4px;
    letter-spacing: 0.055em;
  }

  .nav a {
    min-width: 40px;
    min-height: 40px;
    padding: 5px 0;
  }

  .hero-photo {
    min-height: 360px;
  }

  .hero-note {
    right: 22px;
    bottom: 22px;
    max-width: 160px;
  }

  .project-card {
    grid-template-rows: 178px 1fr;
  }

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

  .project-media-label {
    left: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
    padding: 8px 10px 7px 22px;
    font-size: 9px;
  }
}
