/* ---------- Основа ---------- */
:root {
  --red: #E02200;     /* фірмовий колір тексту */
  --bg: #FFFFFF;
  --ph: #F1EFEE;      /* колір заглушок */
  --gap: 2.4vw;
  --left: 11.5vw;     /* відступ бокової панелі */
  --grid-left: 30vw;  /* де починається сітка робіт */
  --grid-width: 57.75vw;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--red); }
body {
  font-family: "Inter", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-transform: uppercase;
}
a { color: inherit; text-decoration: none; }
a:hover { opacity: .6; }
img, video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Бокова панель ---------- */
#sidebar { position: fixed; left: var(--left); top: 56px; z-index: 5; }
#sidebar .name { display: block; font-size: 27px; font-weight: 700; line-height: .7; margin-bottom: 18px; }
#sidebar .name:hover { opacity: 1; }
.services { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.2; }
#nav { position: fixed; left: var(--left); bottom: 56px; display: flex; flex-direction: column; gap: 6px; font-size: 16px; font-weight: 700; z-index: 5; }

/* ---------- Сітка на головній ---------- */
#grid { margin-left: var(--grid-left); width: var(--grid-width); padding: 56px 0 120px; }
.cols { display: flex; gap: var(--gap); align-items: flex-start; }
.col { flex: 1; display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.tile { display: block; position: relative; }
.tile:hover { opacity: 1; }
.tile.hero { width: calc(50% - var(--gap) / 2); margin-bottom: var(--gap); }
.tile-media { width: 100%; overflow: hidden; background: var(--ph); }
.tile-cap {
  position: absolute; left: 0; right: 0; top: 100%;
  padding-top: 6px; font-size: 10px; line-height: 1.25; font-weight: 600;
  display: flex; flex-direction: column;
  opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 2;
  background: var(--bg);
}
.tile:hover .tile-cap { opacity: 1; }

/* ---------- Заглушка ---------- */
.ph {
  width: 100%; height: 100%; min-height: 80px; background: var(--ph);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 10px; font-weight: 600; letter-spacing: .02em; padding: 8px; color: var(--red);
}

/* ---------- Сторінка проєкту ---------- */
.back { font-size: 16px; font-weight: 500; }
.project-back { position: fixed; top: 32px; left: 32px; z-index: 5; }
.stage { position: relative; margin-top: 80px; height: min(72vh, 620px); }
.stage.single { display: flex; justify-content: center; }
.stage.single video, .stage.single img, .stage.single .ph { width: auto; max-width: 92vw; height: 100%; object-fit: contain; background: #000; }
.stage.single .ph { width: 40vh; background: var(--ph); }
.track {
  display: flex; gap: 30px; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-inline: 35vw; scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 auto; height: 100%; scroll-snap-align: center; }
.slide img, .slide video { width: auto; height: 100%; object-fit: contain; }
.slide .ph { width: calc(72vh * .67); }
.arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--red); font-size: 40px; line-height: 1; cursor: pointer; padding: 10px;
}
.arrow.prev { left: 16px; }
.arrow.next { right: 16px; }
#info { display: flex; justify-content: space-between; gap: 32px; padding: 32px; font-size: 16px; line-height: 1.35; }
#info p { margin: 0 0 16px; }
.info-left { max-width: 560px; }
.about { text-transform: none; }
.label { display: inline-block; background: var(--red); color: var(--bg); font-weight: 700; font-size: 13px; padding: 0 3px; }
.info-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.missing { padding: 120px 32px; }

/* ---------- About ---------- */
#about-text { margin-left: 42vw; width: 36vw; padding-top: 210px; font-size: 16px; font-weight: 700; line-height: 1.5; text-transform: none; }
#about-text p { margin: 0 0 20px; }
#about-text .back { display: inline-block; margin-top: 40px; font-size: 13px; text-transform: uppercase; }

/* ---------- Телефон ---------- */
@media (max-width: 820px) {
  :root { --gap: 12px; }
  #sidebar, #nav { position: static; }
  #sidebar { padding: 24px 16px 0; }
  #sidebar .name { font-size: 24px; }
  #nav { flex-direction: row; gap: 16px; padding: 12px 16px 0; font-size: 14px; }
  #grid { margin: 0; width: 100%; padding: 24px 16px 60px; }
  .tile.hero { width: 100%; }
  .tile-cap { display: none; }
  .project-back { position: static; display: block; padding: 20px 16px 0; }
  .stage { margin-top: 20px; height: 62vh; }
  .track { padding-inline: 16px; gap: 12px; }
  .arrow { display: none; }
  #info { flex-direction: column; padding: 24px 16px; }
  .info-right { align-items: flex-start; }
  #about-text { margin: 0; width: auto; padding: 48px 16px; }
}
