/* ===== Tokens ===== */
:root {
  --bg: #f2ede4;
  --bg-2: #e8e1d5;
  --ink: #2f2f2f;
  --muted: #6c6559;
  --line: rgba(47, 47, 47, 0.16);
  --font: 'Onest', 'Helvetica Neue', Arial, sans-serif;
  --max: 1360px;
  --pad: clamp(20px, 5vw, 72px);
  --gap: clamp(24px, 4vw, 64px);
  --section: clamp(72px, 10vw, 140px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  background: var(--bg-2);
}

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

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

ol,
ul {
  list-style: none;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.label {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.label a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.section-title {
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 20px;
}

.arrow {
  display: inline-block;
  transition: transform 0.3s ease-out;
}

/* ===== Top bar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}

.topbar__name {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.topbar__nav {
  display: flex;
  gap: 36px;
}

.topbar__nav a,
.topbar__cta {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 12px 0;
}

.topbar__nav a:hover,
.topbar__cta:hover {
  color: var(--muted);
}

.topbar__cta {
  display: none;
}

/* ===== CTA link ===== */
.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 18px;
  border-bottom: 1px solid var(--ink);
}

.link-cta:hover .arrow,
.contact__link:hover .arrow,
.index__row:hover .arrow {
  transform: translateX(6px);
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: var(--gap);
  align-items: end;
  padding-top: clamp(40px, 6vw, 88px);
  padding-bottom: var(--section);
}

.hero__text {
  padding-bottom: clamp(8px, 4vw, 56px);
}

.hero__title {
  margin: 24px 0 28px;
  font-size: clamp(40px, 4.6vw, 68px);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero__lead {
  max-width: 30em;
  margin-bottom: 36px;
  font-size: 17px;
  color: var(--muted);
}

.hero__figure img {
  aspect-ratio: 5 / 6;
  max-height: 82vh;
  object-position: 30% center;
}

.hero__figure figcaption,
.process__photos figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Project index ===== */
.index {
  padding-bottom: var(--section);
}

.index__list {
  border-bottom: 1px solid var(--line);
}

.index__row {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr 240px 32px;
  align-items: baseline;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.index__num,
.index__meta {
  font-size: 14px;
  color: var(--muted);
}

.index__name {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 300;
  line-height: 1.2;
  transition: transform 0.3s ease-out;
}

.index__row .arrow {
  justify-self: end;
}

.index__row:hover .index__name {
  transform: translateX(8px);
}

.index__preview {
  position: absolute;
  top: 50%;
  right: 320px;
  z-index: 2;
  width: 240px;
  aspect-ratio: 4 / 3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.96);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

@media (hover: hover) {
  .index__row:hover .index__preview {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

/* ===== Recent ===== */
.recent {
  padding-bottom: var(--section);
}

.recent__nav {
  display: flex;
  gap: 8px;
}

.recent__btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease-out, opacity 0.2s ease-out;
}

.recent__btn:hover:not(:disabled) {
  border-color: var(--ink);
}

.recent__btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.recent__btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.recent__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.recent__track::-webkit-scrollbar {
  display: none;
}

.recent__track:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.recent__item {
  flex: 0 0 auto;
  margin: 0;
  scroll-snap-align: start;
}

.recent__item img {
  width: auto;
  height: clamp(360px, 38vw, 560px);
  max-width: calc(100vw - 2 * var(--pad));
}

/* ===== Services ===== */
.services {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--gap);
  padding-top: var(--section);
  padding-bottom: var(--section);
  border-top: 1px solid var(--line);
}

.services__list > div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.services__list > div:last-child {
  border-bottom: 1px solid var(--line);
}

.services__list dt {
  font-size: 18px;
}

.services__list dd {
  color: var(--muted);
}

.services__note {
  grid-column: 2;
  color: var(--muted);
}

/* ===== Process ===== */
.process {
  padding-bottom: var(--section);
}

.process__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin: 48px 0 64px;
}

.process__steps li {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.process__num {
  display: block;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--muted);
}

.process__steps h3 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 400;
}

.process__steps p {
  font-size: 15px;
  color: var(--muted);
}

.process__photos {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 24px;
  align-items: start;
}

.process__photos figure:last-child {
  margin-top: 96px;
}

.process__photos img {
  aspect-ratio: 5 / 4;
}

/* ===== About ===== */
.about {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: var(--gap);
  align-items: start;
  padding-top: var(--section);
  padding-bottom: var(--section);
  border-top: 1px solid var(--line);
}

.about__photo img {
  aspect-ratio: 4 / 5;
  object-position: 50% 30%;
}

.about__text .section-title {
  margin-bottom: 28px;
}

.about__text > p {
  max-width: 36em;
  margin-bottom: 18px;
}

.facts {
  margin-top: 36px;
}

.facts > div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.facts > div:last-child {
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
}

/* ===== Contact ===== */
.contact {
  background: var(--bg-2);
}

.contact__inner {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: var(--gap);
  padding-top: var(--section);
  padding-bottom: var(--section);
}

.contact__title {
  margin: 20px 0 20px;
  font-size: clamp(36px, 4.4vw, 64px);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.contact__lead {
  max-width: 28em;
  color: var(--muted);
}

.contact__list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: baseline;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.contact__list li:last-child {
  border-bottom: 1px solid var(--line);
}

.contact__link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 22px 0;
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 300;
  overflow-wrap: anywhere;
}

/* ===== Project page ===== */
.hero--project {
  grid-template-columns: 5fr 7fr;
}

.hero--project .hero__figure img {
  aspect-ratio: 4 / 3;
  object-position: center;
}

.hero--project .facts {
  max-width: 30em;
}

.story {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--gap);
  padding-bottom: var(--section);
}

.story__text p {
  max-width: 38em;
  margin-bottom: 20px;
  font-size: 17px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding-bottom: var(--section);
}

.gallery__item--wide {
  grid-column: span 2;
}

.cta-band {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 24px;
  padding-top: var(--section);
  padding-bottom: var(--section);
  border-top: 1px solid var(--line);
}

/* ===== Footer ===== */
.footer {
  padding-top: 32px;
  padding-bottom: 40px;
  font-size: 13px;
  color: var(--muted);
}

.footer__note {
  margin-top: 6px;
  font-size: 12px;
}

/* ===== Mobile CTA bar ===== */
.mbar {
  display: none;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .index__row {
    grid-template-columns: 56px 1fr 180px 24px;
  }

  .index__preview {
    display: none;
  }

  .services__list > div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

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

@media (max-width: 820px) {
  body {
    padding-bottom: 60px;
  }

  .topbar {
    min-height: 60px;
  }

  .topbar__nav {
    display: none;
  }

  .topbar__cta {
    display: block;
  }

  .hero,
  .hero--project,
  .services,
  .about,
  .contact__inner,
  .story {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 32px;
  }

  .hero__text {
    padding-bottom: 0;
  }

  .hero__figure img {
    aspect-ratio: 4 / 5;
    max-height: none;
  }

  .index__row {
    grid-template-columns: 36px 1fr 20px;
    row-gap: 4px;
    padding: 18px 0;
  }

  .index__meta {
    grid-column: 2;
    grid-row: 2;
  }

  .index__row .arrow {
    grid-column: 3;
    grid-row: 1;
  }

  .recent__nav {
    display: none;
  }

  .recent__track {
    gap: 12px;
    margin: 0 calc(var(--pad) * -1);
    padding: 0 var(--pad);
    scroll-padding-left: var(--pad);
  }

  .recent__item img {
    height: min(105vw, 520px);
    max-width: 85vw;
  }

  .services__note {
    grid-column: 1;
  }

  .process__steps {
    grid-template-columns: 1fr;
    gap: 0;
    margin: 32px 0 40px;
  }

  .process__steps li {
    padding: 18px 0;
  }

  .process__num {
    margin-bottom: 8px;
  }

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

  .process__photos figure:last-child {
    margin-top: 0;
  }

  .facts > div,
  .contact__list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .contact__list li {
    padding-top: 16px;
  }

  .contact__link {
    padding: 4px 0 18px;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gallery__item--wide {
    grid-column: span 1;
  }

  .mbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    height: 60px;
    background: var(--ink);
    color: var(--bg);
    font-size: 16px;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
