:root {
  --bg: #e8d7c7;
  --ink: #171717;
  --muted: #77736b;
  --frame: #201f1d;
  --paper: #fffcf5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(232, 215, 199, 0.28), rgba(232, 215, 199, 0.28)),
    url("../img/wall-bg.png") repeat;
  background-size: auto, 760px auto;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

.site-header {
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 38px 24px 28px;
  background: linear-gradient(
    180deg,
    rgba(232, 215, 199, 0.88) 0%,
    rgba(232, 215, 199, 0.58) 72%,
    rgba(232, 215, 199, 0) 100%
  );
}

.site-header-sticky {
  position: sticky;
  top: 0;
}

.logo {
  width: clamp(150px, 18vw, 260px);
  height: auto;
  display: block;
}

.gallery {
  width: min(1180px, calc(100% - 40px));
  margin: 28px auto 96px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: start;
}

.piece {
  display: block;
  touch-action: manipulation;
}

.piece:nth-child(1) {
  grid-column: 2 / span 4;
  margin-top: 38px;
}

.piece:nth-child(2) {
  grid-column: 8 / span 5;
  margin-top: 54px;
}

.frame {
  position: relative;
  aspect-ratio: var(--ratio);
  perspective: 1200px;
  transition: transform 420ms ease;
}

.frame-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 720ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.frame-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--paper);
  border: none;
  box-shadow: 0 18px 45px rgba(23, 23, 23, 0.08);
  backface-visibility: hidden;
  transition: box-shadow 420ms ease;
}

.frame-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: clamp(18px, 2.2vw, 30px);
  text-align: center;
  transform: rotateY(180deg);
}

.frame-back p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(15px, 2vw, 24px);
  line-height: 1.18;
  font-weight: 500;
}

.frame-back span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.artwork {
  width: 100%;
  height: 100%;
  overflow: hidden;
  transition: transform 520ms ease;
}

.artwork img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0;
}

.label strong {
  color: var(--ink);
  font-weight: 500;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 0 24px 42px;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a {
  transition: color 220ms ease;
}

.site-footer a:hover {
  color: var(--ink);
}

.project-page {
  width: min(940px, calc(100% - 40px));
  margin: 26px auto 96px;
}

.project-page-featured {
  width: min(1360px, calc(100% - 40px));
}

.back-link {
  display: inline-block;
  margin-bottom: 54px;
  color: var(--muted);
  font-size: 12px;
  transition: color 220ms ease;
}

.back-link:hover {
  color: var(--ink);
}

.project-detail {
  display: grid;
  gap: 24px;
}

.project-detail-featured {
  gap: 32px;
}

.project-editorial {
  display: grid;
  gap: clamp(46px, 7vw, 92px);
}

.editorial-cover {
  min-height: clamp(360px, 45vw, 560px);
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(320px, 1.28fr);
  grid-template-rows: auto 1fr auto auto;
  column-gap: clamp(32px, 7vw, 110px);
  align-items: start;
  padding: clamp(28px, 5vw, 70px) 0 clamp(20px, 4vw, 48px);
}

.editorial-cover .project-number {
  grid-column: 1;
  grid-row: 1;
}

.editorial-cover h1 {
  grid-column: 1 / -1;
  grid-row: 4;
  margin: 0;
  color: var(--ink);
  font-size: clamp(72px, 15vw, 210px);
  line-height: 0.72;
  font-weight: 600;
  letter-spacing: 0;
  transform: translateY(0.05em);
}

.editorial-cover .project-lead {
  grid-column: 2;
  grid-row: 3;
  width: min(560px, 100%);
  margin: 0 0 clamp(12px, 2vw, 22px) auto;
  align-self: end;
  justify-self: end;
  text-align: right;
}

.editorial-intro {
  width: min(980px, 100%);
  margin-left: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 76px);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.62;
}

.editorial-intro p,
.editorial-section p {
  margin: 0;
}

.project-heading {
  display: grid;
  gap: 10px;
}

.project-number {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.project-detail h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 6vw, 76px);
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: 0;
}

.project-detail img {
  width: min(520px, 100%);
  display: block;
  margin: 18px auto 8px;
  box-shadow: 0 26px 70px rgba(23, 23, 23, 0.12);
}

.project-detail .project-hero-image {
  width: 100%;
  margin: 0;
  box-shadow: 0 30px 90px rgba(23, 23, 23, 0.14);
}

.project-editorial .project-hero-image {
  width: min(1120px, 92%);
  justify-self: end;
  margin-top: clamp(-42px, -3vw, -18px);
  box-shadow: 0 30px 90px rgba(23, 23, 23, 0.14);
}

.project-text {
  width: min(720px, 100%);
  margin: 24px auto 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.62;
}

.project-text p {
  margin: 0 0 14px;
}

.project-lead {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.14;
  font-weight: 500;
}

.project-text h2 {
  margin: 46px 0 14px;
  color: var(--ink);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: 0;
}

.editorial-section {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.66;
}

.editorial-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 6vw, 82px);
  line-height: 0.92;
  font-weight: 600;
  letter-spacing: 0;
}

.editorial-section p + p {
  margin-top: 14px;
}

.editorial-section-split {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr);
  gap: clamp(28px, 7vw, 120px);
  align-items: start;
  width: min(1060px, 100%);
  margin: 0 auto;
}

.editorial-section-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 7vw, 110px);
  width: min(1060px, 100%);
  margin: 0 auto;
}

.editorial-section-columns h2 {
  margin-bottom: 18px;
  font-size: clamp(28px, 4vw, 52px);
}

.balanced-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.balanced-columns > div {
  display: flex;
  flex-direction: column;
}

.balanced-columns h2 {
  min-height: 2.05em;
  display: flex;
  align-items: flex-end;
}

.branding-row {
  width: min(1060px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 1.3fr);
  gap: clamp(34px, 8vw, 130px);
  align-items: center;
}

.brand-mark {
  width: min(320px, 100%);
  margin: 0;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
}

.brand-mark img {
  width: 100%;
  display: block;
  box-shadow: none;
}

.branding-copy h2 {
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 72px);
}

@media (hover: hover) and (pointer: fine) {
  .piece:hover .frame {
    transform: translateY(-8px);
  }

  .piece:hover .frame-inner {
    transform: rotateY(180deg);
  }

  .piece:hover .frame-face {
    box-shadow: 0 26px 68px rgba(23, 23, 23, 0.14);
  }

  .piece:hover .artwork {
    transform: scale(1.025);
  }
}

@media (max-width: 760px) {
  .site-header {
    padding: 30px 18px 20px;
  }

  .gallery {
    width: min(460px, calc(100% - 32px));
    margin-top: 18px;
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .piece,
  .piece:nth-child(1),
  .piece:nth-child(2) {
    grid-column: 1;
    margin-top: 0;
  }

  .label {
    font-size: 11px;
  }

  .project-page {
    width: min(460px, calc(100% - 32px));
    margin-top: 18px;
  }

  .project-page-featured {
    width: min(640px, calc(100% - 24px));
  }

  .back-link {
    margin-bottom: 36px;
  }

  .project-detail-featured {
    gap: 22px;
  }

  .project-editorial {
    gap: 44px;
  }

  .editorial-cover {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 18px;
    padding: 18px 0 4px;
  }

  .editorial-cover .project-number,
  .editorial-cover h1,
  .editorial-cover .project-lead {
    grid-column: 1;
    grid-row: auto;
  }

  .editorial-cover h1 {
    font-size: clamp(66px, 23vw, 118px);
  }

  .editorial-cover .project-lead {
    width: 100%;
  }

  .editorial-intro,
  .editorial-section-split,
  .editorial-section-columns,
  .branding-row {
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%;
  }

  .balanced-columns h2 {
    min-height: 0;
  }

  .project-editorial .project-hero-image {
    width: calc(100% - 18px);
    justify-self: start;
    margin-top: 0;
  }

  .editorial-section h2,
  .editorial-section-columns h2 {
    font-size: clamp(28px, 11vw, 48px);
  }

  .editorial-intro {
    gap: 26px;
  }

  .editorial-intro p:nth-child(2) {
    width: 86%;
    margin-left: auto;
    text-align: right;
  }

  .editorial-section {
    padding-top: 8px;
  }

  .editorial-section-split:nth-of-type(2) h2,
  .balanced-columns > div:nth-child(2) h2 {
    text-align: right;
  }

  .editorial-section-columns > div:nth-child(2) {
    margin-top: 18px;
  }

  .editorial-section-columns > div:nth-child(2) h2 {
    text-align: right;
  }

  .editorial-section-columns > div:nth-child(2) p {
    width: 92%;
    margin-left: auto;
  }

  .brand-mark {
    width: min(260px, 70vw);
    justify-self: center;
    margin: 0 auto 12px;
  }
}
