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

body.project-body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: #121212;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  /* 684px × 1.5 — верхняя граница контента; на узких экранах — 100% минус отступы */
  --project-max: 1026px;
  --project-pad-x: clamp(16px, 4vw, 48px);
  --project-pad-y-top: clamp(28px, 5vw, 48px);
  --project-pad-y-bottom: clamp(40px, 6vw, 72px);
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: inherit;
}

.project-wrap {
  box-sizing: border-box;
  width: min(100%, var(--project-max));
  max-width: 100%;
  margin: 0 auto;
  padding: max(var(--project-pad-y-top), env(safe-area-inset-top, 0px))
    max(var(--project-pad-x), env(safe-area-inset-right, 0px))
    max(var(--project-pad-y-bottom), env(safe-area-inset-bottom, 0px))
    max(var(--project-pad-x), env(safe-area-inset-left, 0px));
}

.project-back {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: clamp(20px, 3vw, 32px);
  padding: 0;
  border: 1px solid #333;
  border-radius: 10px;
  background: #1a1a1a;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.project-back:hover {
  background: #252525;
  border-color: #444;
}

.project-back:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.project-back__icon {
  display: block;
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(135deg);
}

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

.project-intro {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vw, 30px);
  margin-bottom: clamp(10px, 1.5vw, 12px);
}

.project-header {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 20px, 42px);
}

.project-title {
  margin: 0;
  font-size: clamp(1.5rem, 0.95rem + 1.1vw, 1.125rem);
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.04em;
}

.project-wrap .block__text {
  max-width: none;
  margin-bottom: 0;
  line-height: 1.5;
}

.project-tools .block__title {
  margin-bottom: clamp(10px, 1.5vw, 12px);
}

.project-tools__stack {
  flex-direction: row;
  flex-wrap: wrap;
  gap: clamp(24px, 5vw, 40px);
}

.project-gallery,
.project-content {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 20px, 42px);
}

.project-content {
  gap: clamp(24px, 4vw, 32px);
}

.project-facts strong {
  color: #fff;
  font-weight: 400;
}

.project-text strong {
  color: #fff;
  font-weight: 400;
}

.project-shot--wide {
  aspect-ratio: 1686 / 948;
}

.project-shot--video {
  background: #0a0e27;
}

.project-shot__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: middle;
}

.project-shot--rounded {
  aspect-ratio: 1549 / 983;
  border-radius: 12px;
}

.project-shot--forma-3d {
  aspect-ratio: 1548 / 978;
}

.project-shot--ultrawide {
  aspect-ratio: 3840 / 1536;
}

.project-shot--footer {
  aspect-ratio: 1545 / 367;
  border-radius: 6px;
}

.project-shot--mobile {
  aspect-ratio: 684 / 507;
}

.project-shot--icons {
  aspect-ratio: 684 / 134;
}

.project-hero {
  margin: 0;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #1a1a1a;
  width: 100%;
}

.project-figure-link {
  position: absolute;
  inset: 0;
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}

.project-figure-link:hover {
  opacity: 0.92;
}

.project-figure-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 10px;
}

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

.project-shot {
  margin: 0;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.project-shot--back {
  aspect-ratio: 1700 / 1101;
}

.project-shot--front {
  aspect-ratio: 684 / 443;
}

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

.project-board + .project-board {
  margin-top: clamp(10px, 1.5vw, 14px);
}

.project-board {
  margin: 0;
  position: relative;
  border-radius: clamp(10px, 1.2vw, 16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 100%;
  background: #0a0e27;
}

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

.project-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 12px);
  width: 100%;
}

.project-shot--duo {
  aspect-ratio: 332 / 471;
  border-radius: 4px;
}

.project-shot--habit {
  aspect-ratio: 684 / 968;
  border-radius: 12px;
}

.project-shot--social-wide {
  aspect-ratio: 2752 / 1536;
  border-radius: 12px;
}

.project-shot--social {
  aspect-ratio: 684 / 382;
  border-radius: 12px;
}

.project-shot--posts {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: #1a1a1a;
}

.project-shot--banner {
  aspect-ratio: 1920 / 1080;
  border-radius: 12px;
}

@media (max-width: 900px) {
  .project-wrap .block__title {
    font-size: 18px;
  }

  .project-wrap .block__text {
    line-height: 1.5;
  }
}

.project-shot--slides-grid {
  aspect-ratio: 684 / 589;
  border-radius: 12px;
}

.project-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.04em;
  color: #fff;
}

.project-step__num {
  flex-shrink: 0;
}

.project-step span:first-child {
  min-width: 0;
}

.project-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* Sense Kiss: images in normal document flow (avoids zero-height collapsed figures) */
.project-shot--wireframes,
.project-shot--concept,
.project-shot--typography,
.project-shot--3d-scene,
.project-shot--photos-duo,
.project-shot--page-scroll {
  aspect-ratio: auto;
  height: auto;
  overflow: visible;
  border-radius: 12px;
  background: transparent;
}

.project-shot--wireframes .project-figure-link,
.project-shot--concept .project-figure-link,
.project-shot--typography .project-figure-link,
.project-shot--3d-scene .project-figure-link,
.project-shot--photos-duo .project-figure-link,
.project-shot--page-scroll .project-figure-link {
  position: static;
  display: block;
  width: 100%;
  height: auto;
}

.project-shot--wireframes img,
.project-shot--concept img,
.project-shot--typography img,
.project-shot--3d-scene img,
.project-shot--photos-duo img,
.project-shot--page-scroll img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.project-shot--concept-video,
.project-shot--photos-video {
  overflow: hidden;
  border-radius: 12px;
}

.project-shot--concept .project-shot__video,
.project-shot--photos-duo .project-shot__video {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.project-shot--typography img {
  max-width: 1024px;
}

.project-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-link:hover {
  opacity: 0.85;
}
