:root {
  --bg: #f3f1eb;
  --text: #1d1d1b;
  --muted: #747474;
  --line: #d7d4cc;
  --field: #f7f7f5;
  --field-border: #cfcfc9;
  --white: #ffffff;
  --accent: #e43d30;
  --link: #009fe3;
  --contact-bg: #ececea;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
}

body.lightbox-open {
  overflow: hidden;
}

/* HEADER */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;

  width: 100%;
  height: 76px;
  padding: 0 40px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  color: var(--text);
  background: rgba(243, 241, 235, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;

  width: 46px;
  height: 46px;

  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;

  transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-icon {
  display: block;

  width: 46px;
  height: 46px;

  flex-shrink: 0;
  object-fit: contain;
}

.brand-wordmark {
  display: flex;
  align-items: center;

  width: 175px;
  height: 46px;
  margin-left: 14px;

  flex-shrink: 0;

  opacity: 0;
  transform: translateX(-18px);

  transition:
    opacity 0.35s ease,
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-wordmark-image {
  display: block;

  width: auto;
  height: 46px;
  max-width: none;
}

@media (hover: hover) {
  .brand:hover {
    width: 235px;
  }

  .brand:hover .brand-wordmark {
    opacity: 1;
    transform: translateX(0);
  }
}

.brand:focus-visible {
  width: 235px;
}

.brand:focus-visible .brand-wordmark {
  opacity: 1;
  transform: translateX(0);
}

/* NAVIGATION */

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.site-nav a {
  position: relative;

  color: inherit;
  text-decoration: none;
  text-transform: uppercase;

  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;

  transition: opacity 0.2s ease;
}

.site-nav a::after {
  content: "";

  position: absolute;
  left: 0;
  bottom: -7px;

  width: 100%;
  height: 1px;

  background: currentColor;

  transform: scaleX(0);
  transform-origin: right;

  transition: transform 0.25s ease;
}

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-nav a:hover {
  opacity: 0.65;
}

.nav-toggle {
  display: none;

  width: 40px;
  height: 40px;
  padding: 0;

  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nav-toggle span {
  display: block;

  width: 22px;
  height: 1px;
  margin: 6px auto;

  background: currentColor;
  transition: transform 0.25s ease;
}

/* WORK PAGE */

.work-page {
  padding-top: 76px;
}

.work-page-intro {
  min-height: 34vh;
  padding: 80px 40px 44px;

  display: flex;
  align-items: flex-end;
}

.work-page-intro h1 {
  margin: 0;

  font-size: clamp(72px, 12vw, 180px);
  font-weight: 400;
  line-height: 0.84;
  letter-spacing: -0.09em;
}

.work-grid {
  padding: 28px 40px 90px;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.work-card {
  position: relative;

  display: block;
  overflow: hidden;

  aspect-ratio: 1 / 1;
  background: #d7d7d3;

  color: var(--white);
  text-decoration: none;
}

.work-card img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
  transform: scale(1);

  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.work-card-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 28px;

  opacity: 0;
  background: rgba(0, 0, 0, 0);

  text-align: center;

  transition:
    opacity 0.35s ease,
    background 0.35s ease;
}

.work-card-overlay h2 {
  max-width: 90%;
  margin: 0 0 14px;

  font-size: clamp(24px, 2vw, 34px);
  font-weight: 600;
  line-height: 1.13;
  letter-spacing: -0.045em;
}

.work-card-overlay p {
  margin: 0;

  font-size: 16px;
  font-weight: 500;
  font-style: italic;
}

.work-card:hover img,
.work-card:focus-visible img {
  transform: scale(1.25);
}

.work-card:hover .work-card-overlay,
.work-card:focus-visible .work-card-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.48);
}

.work-card:focus-visible {
  outline: none;
}

/* PROJECT DETAIL */

.project-page {
  padding-top: 76px;
}

.project-intro {
  padding: 78px 40px 74px;
}

.project-intro h1 {
  max-width: 1500px;
  margin: 0 0 48px;

  font-size: clamp(56px, 7.4vw, 128px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.075em;
}

.project-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(320px, 0.48fr);
  gap: clamp(42px, 4.6vw, 82px);

  align-items: start;
}

.project-image-wrap {
  margin: 0;
}

.project-main-image-button,
.project-story-image-button {
  display: block;

  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;

  cursor: pointer;
}

.project-main-image-button {
  overflow: hidden;
}

.project-main-image-button:focus-visible,
.project-story-image-button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 5px;
}

.project-image-wrap img {
  display: block;

  width: 100%;
  min-height: 620px;
  aspect-ratio: 4 / 3;

  object-fit: cover;
  image-rendering: auto;

  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-main-image-button:hover img {
  transform: scale(1.025);
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 1.65vw, 28px);

  padding-top: 4px;
}

.project-meta-item h2 {
  margin: 0 0 5px;

  font-size: clamp(16px, 1.15vw, 20px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.project-meta-item p {
  margin: 0;

  white-space: pre-line;

  font-size: clamp(16px, 1.14vw, 20px);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

/* PROJECT STORY */

.project-story-section {
  padding: 18px 40px 110px;
}

.project-story {
  max-width: 1600px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(20px, 2vw, 36px);
  row-gap: clamp(58px, 6vw, 96px);
}

.project-story-text,
.project-story-image {
  margin: 0;
}

.project-story-text p {
  margin: 0 0 25px;

  font-size: clamp(19px, 1.48vw, 26px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.03em;
}

.project-story-text p:last-child {
  margin-bottom: 0;
}

.story-center {
  grid-column: 4 / span 6;
  max-width: 860px;
}

.story-left {
  grid-column: 2 / span 4;
  align-self: center;
}

.story-right-text {
  grid-column: 8 / span 4;
  align-self: center;
}

.story-right-image {
  grid-column: 7 / span 6;
}

.story-left-image {
  grid-column: 1 / span 6;
}

.story-center-image {
  grid-column: 4 / span 6;
}

.project-story-image-button {
  overflow: hidden;
}

.project-story-image img {
  display: block;

  width: 100%;
  aspect-ratio: 4 / 3;

  object-fit: cover;
  object-position: center;
  image-rendering: auto;

  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-story-image-button:hover img {
  transform: scale(1.035);
}

.project-story-image figcaption {
  margin-top: 10px;

  color: var(--muted);

  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.015em;
}

/* LIGHTBOX */

.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 70px 100px 72px;

  background: rgba(8, 25, 56, 0.93);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.project-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.project-lightbox-figure {
  max-width: min(82vw, 1450px);
  max-height: calc(100svh - 140px);
  margin: 0;

  display: flex;
  flex-direction: column;
  align-items: flex-start;

  color: #ffffff;

  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}

.project-lightbox-figure:active {
  cursor: grabbing;
}

.project-lightbox-figure img {
  display: block;

  max-width: 100%;
  max-height: calc(100svh - 185px);

  object-fit: contain;

  opacity: 1;
  transform: scale(1);

  transition:
    opacity 0.18s ease,
    transform 0.18s ease;

  -webkit-user-drag: none;
}

.project-lightbox-figure img.is-changing {
  opacity: 0;
  transform: scale(0.985);
}

.project-lightbox-figure figcaption {
  max-width: 750px;
  margin-top: 12px;

  color: rgba(255, 255, 255, 0.78);

  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.015em;
}

.project-lightbox-close {
  position: absolute;
  top: 24px;
  right: 34px;
  z-index: 2;

  width: 46px;
  height: 46px;
  padding: 0;

  border: 0;
  background: transparent;
  color: #ffffff;

  font-size: 40px;
  font-weight: 300;
  line-height: 1;

  cursor: pointer;
}

.project-lightbox-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;

  width: 60px;
  height: 60px;
  padding: 0;

  display: grid;
  place-items: center;

  border: 0;
  background: transparent;
  color: #ffffff;

  cursor: pointer;

  transform: translateY(-50%);
  transition: opacity 0.2s ease;
}

.project-lightbox-arrow:hover {
  opacity: 0.65;
}

.project-lightbox-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

.project-lightbox-arrow svg {
  width: 34px;
  height: 34px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-lightbox-prev {
  left: 18px;
}

.project-lightbox-next {
  right: 18px;
}

.project-lightbox-counter {
  position: absolute;
  right: 38px;
  bottom: 28px;

  margin: 0;

  color: #ffffff;

  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

/* PROJECT NAVIGATION */

.project-navigation {
  padding: 0 40px 80px;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.project-nav-link {
  display: flex;
  flex-direction: column;
  gap: 10px;

  color: var(--text);
  text-decoration: none;

  transition: opacity 0.25s ease;
}

.project-nav-link:hover {
  opacity: 0.6;
}

.project-nav-link span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.project-nav-link strong {
  max-width: 90%;

  font-size: clamp(18px, 1.6vw, 28px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.project-nav-next {
  align-items: flex-end;
  text-align: right;
}

/* CONTACT */

.contact-section {
  min-height: 100svh;
  padding: 110px 40px 80px;

  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(520px, 1.1fr);
  gap: clamp(70px, 8vw, 140px);

  background: var(--contact-bg);
  border-top: 1px solid #d8d8d2;
}

.contact-left {
  display: flex;
  flex-direction: column;
}

.contact-label {
  margin: 0 0 26px;

  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5em;
  text-transform: uppercase;
}

.contact-left h2 {
  max-width: 660px;
  margin: 0;

  font-size: clamp(46px, 5vw, 76px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.contact-left h2 span {
  display: block;
  white-space: nowrap;
}

.contact-intro {
  max-width: 650px;
  margin: 28px 0 0;

  color: var(--muted);

  font-size: clamp(18px, 1.22vw, 21px);
  line-height: 1.62;
}

.contact-info {
  margin-top: 32px;

  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-info-item h3,
.contact-info-item a {
  margin: 0;

  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.2;
}

.contact-info-item h3 {
  font-weight: 700;
  text-transform: uppercase;
}

.contact-info-item a {
  color: var(--link);
  text-decoration: none;
}

.contact-form {
  align-self: start;
  padding-top: 18px;

  display: flex;
  flex-direction: column;
  gap: 28px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label {
  margin-bottom: 14px;

  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.form-field label span {
  color: var(--accent);
}

.name-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.name-input-group {
  display: flex;
  flex-direction: column;
}

.form-field input,
.form-field textarea {
  width: 100%;

  border: 1px solid var(--field-border);
  outline: none;
  background: var(--field);
  color: var(--text);

  font-family: inherit;
  font-size: 18px;
}

.form-field input {
  height: 64px;
  padding: 0 18px;
}

.form-field textarea {
  min-height: 170px;
  padding: 18px;
  resize: vertical;
}

.form-field small {
  margin-top: 10px;

  color: #4f5660;
  font-size: 14px;
}

.submit-button {
  align-self: flex-end;

  display: flex;
  align-items: center;
  gap: 18px;

  padding: 0;
  border: 0;
  background: transparent;

  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;

  cursor: pointer;
}

.submit-button span {
  position: relative;

  display: block;
  width: 48px;
  height: 1px;

  background: var(--text);
}

/* TABLET */

@media (max-width: 1150px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-main-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(270px, 0.75fr);
  }

  .project-image-wrap img {
    min-height: 560px;
  }

  .story-center {
    grid-column: 4 / span 6;
  }

  .story-left {
    grid-column: 2 / span 4;
  }

  .story-right-text {
    grid-column: 8 / span 4;
  }

  .story-right-image {
    grid-column: 7 / span 6;
  }

  .story-left-image {
    grid-column: 1 / span 6;
  }

  .story-center-image {
    grid-column: 4 / span 6;
  }

  .contact-section {
    grid-template-columns: 1fr;
  }

  .contact-form {
    max-width: 760px;
  }
}

/* MOBILE */

@media (max-width: 900px) {
  .site-header {
    height: 68px;
    padding: 0 20px;
  }

  .brand,
  .brand-icon {
    width: 38px;
    height: 38px;
  }

  .brand-wordmark {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;

    width: 100%;
    padding: 20px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;

    color: var(--text);
    background: var(--bg);
    border-bottom: 1px solid var(--line);

    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);

    transition:
      opacity 0.25s ease,
      transform 0.25s ease;
  }

  .site-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-toggle.is-open span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }

  .nav-toggle.is-open span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
  }

  .work-page,
  .project-page {
    padding-top: 68px;
  }

  .work-page-intro {
    min-height: 28vh;
    padding: 60px 20px 34px;
  }

  .work-grid {
    padding: 20px 20px 60px;

    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-intro {
    padding: 60px 20px;
  }

  .project-intro h1 {
    margin-bottom: 34px;

    font-size: clamp(42px, 11vw, 72px);
  }

  .project-main-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .project-image-wrap img {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .project-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 18px;
  }

  .project-meta-item h2,
  .project-meta-item p {
    font-size: 15px;
  }

  .project-story-section {
    padding: 10px 20px 70px;
  }

  .project-story {
    display: flex;
    flex-direction: column;
    gap: 44px;
  }

  .project-story-text p {
    margin-bottom: 21px;
    font-size: clamp(18px, 5vw, 24px);
  }

  .project-story-image {
    width: 100%;
  }

  .project-story-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
  }

  .project-story-image figcaption {
    font-size: 10px;
  }

  .project-lightbox {
    padding: 64px 20px 62px;
  }

  .project-lightbox-figure {
    max-width: 100%;
    max-height: calc(100svh - 130px);
  }

  .project-lightbox-figure img {
    max-height: calc(100svh - 175px);
  }

  .project-lightbox-close {
    top: 16px;
    right: 14px;

    font-size: 36px;
  }

  .project-lightbox-arrow {
    width: 44px;
    height: 44px;
  }

  .project-lightbox-arrow svg {
    width: 26px;
    height: 26px;
  }

  .project-lightbox-prev {
    left: 0;
  }

  .project-lightbox-next {
    right: 0;
  }

  .project-lightbox-counter {
    right: 20px;
    bottom: 18px;

    font-size: 10px;
  }

  .project-lightbox-figure figcaption {
    font-size: 10px;
  }

  .project-navigation {
    padding: 0 20px 60px;

    grid-template-columns: 1fr;
    gap: 24px;
  }

  .project-nav-link strong {
    max-width: 100%;
    font-size: clamp(18px, 6vw, 24px);
  }

  .contact-section {
    min-height: auto;
    padding: 100px 20px 60px;

    display: flex;
    flex-direction: column;
    gap: 56px;
  }

  .contact-left h2 {
    font-size: clamp(42px, 12vw, 60px);
  }

  .contact-left h2 span {
    white-space: normal;
  }

  .contact-intro {
    font-size: 17px;
  }

  .contact-info-item h3,
  .contact-info-item a {
    font-size: clamp(16px, 4.6vw, 20px);
  }

  .contact-form {
    gap: 24px;
    padding-top: 0;
  }

  .form-field input {
    height: 58px;
    padding: 0 14px;
    font-size: 16px;
  }

  .form-field textarea {
    min-height: 160px;
    font-size: 16px;
  }
}