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

body {
  font-family: Arial, sans-serif;
  min-height: 100vh;
  background: #111;
  color: #fff;
  overflow-x: hidden;
}

main {
  position: sticky;
  top: 0;
  z-index: 0; /* ниже, чем у .sheet1-frame */
  background: #fff;
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.center-text-images img {
  display: block;
  margin: -150px auto;
  max-width: 50%;
}

.corner-text {
  position: absolute;
  font-size: 13px;
  color: #000;
  pointer-events: none;
}

.top-left    { top: 16px; left: 20px; }
.top-right   { top: 16px; right: 20px; }
.bottom-left { bottom: 16px; left: 20px; }
.bottom-right{ bottom: 16px; right: 20px; }

.bottom-buttons {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  background-color: rgba(0, 255, 255, 0);
}

.bottom-buttons img {
  height: 50px;
  cursor: pointer;
}

#top-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 1000;
  background: rgba(20, 20, 20, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

#top-menu.scrolled {
  opacity: 1;
  pointer-events: auto;
}

.menu-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
}

.logo-img {
  height: 40px;
}

.menu-buttons {
  display: flex;
  gap: 6px;
  height: 36px;           /* фиксированная высота для группы */
  margin-left: 35%;      /* сдвиг вправо на 65% ширины экрана */
  align-items: center;
}

.menu-btn {
  height: 36px;           /* одинаковая высота */
  width: auto;            /* ширина авто */
  cursor: pointer;
  transition: filter 0.3s;
  object-fit: contain;    /* чтобы не растягивались */
  display: block;
}

.apply-btn {
  height: 32px;
}

.gallery-scroll-section {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* важно! */
  background: #000;
}

.gallery-scroll-area {
  height: 400vh; /* или сколько нужно для анимации */
  width: 100%;
  position: relative;
  /* Центрируем фрейм до sticky */
  padding-top: calc(50vh - 150px);    /* 150px — половина высоты .sheet1-frame */
  padding-bottom: calc(50vh - 150px);
  background-color: #111;
}

.gallery-scroll-section2 {
  position: relative;
  top: 0;
  width: 100vw;
  height: 300vh;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
}

.sheet-overlay {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #222;
  position: relative;
  z-index: 2;
}

.sheet1-frame {
  position: sticky;
  top: calc(50vh - 150px); /* Центрирование при скролле */
  max-width: 120vh;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 48px 32px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 40px;
  z-index: 1;
  height: 300px;
}

.sheet1-frame.fixed-center {
  position: fixed !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.sheet1-frame.sticky-active {
  z-index: 1; /* поверх, пока sticky */
}

.sheet-content {
  max-width: 900px;
  width: 100%;
  background: #000000;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 48px 32px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 40px;
}

.sheet1-left {
  flex: 1 1 0;
}

.sheet1-left h2 {
  font-size: 1.8rem;
  color: #222;
  margin-bottom: 15px;
  font-weight: 700;
}

.sheet1-left p {
  font-size: 1.1rem;
  color: #444;
}

.sheet1-right {
  position: relative;
  width: 65vh;
  height: 35vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sheet1-right::before,
.sheet1-right::after {
  content: "";
  position: absolute;
  top: 0;
  width: 48px; /* ширина блюра по краям */
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.gallery-long-img {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: auto;
  min-width: 900px;
  /* animation и animation-timeline удалены */
  /* transform будет управляться через JS */
  transition: transform 0.2s linear;
}

/* --- Sheet overlays content --- */
.sheet-content h2 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 32px;
  font-weight: 700;
}

.sheet-content p {
  font-size: 1.1rem;
  color: #ccc;
}

/* --- Адаптив --- */
@media (max-width: 900px) {
  .sheet1-frame,
  .sheet-content {
    flex-direction: column;
    gap: 24px;
    padding: 24px 8px;
    border-radius: 12px;
  }
  .gallery-long-img {
    width: 90vw;
    height: 40vw;
    min-width: 300px; /* минимальная ширина для мобильных */
    min-height: 120px;
    transition: transform 0.5s linear;
  }
}

.apply-modal {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(10,10,10,0.85);
  transition: opacity 0.3s;
}

.apply-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.apply-modal-content {
  position: relative;
  background: #111;
  border-radius: 24px;
  min-width: 320px;
  min-height: 20px;  
  max-width: 90vw;
  max-height: 80vh;
  padding-top: 50px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Блюр по краям */
.apply-modal-content::before,
.apply-modal-content::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 32px;
  pointer-events: none;
  z-index: 2;
}
.apply-modal-content::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(30,30,30,0.8), rgba(30,30,30,0));
  filter: blur(8px);
}
.apply-modal-content::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(30,30,30,0.8), rgba(30,30,30,0));
  filter: blur(8px);
}

/* Блюр по бокам */
.apply-modal-content .side-blur {
  position: absolute;
  top: 0; bottom: 0;
  width: 32px;
  pointer-events: none;
  z-index: 2;
}
.apply-modal-content .side-blur.left {
  left: 0;
  background: linear-gradient(to right, rgba(30,30,30,0.8), rgba(30,30,30,0));
  filter: blur(8px);
}
.apply-modal-content .side-blur.right {
  right: 0;
  background: linear-gradient(to left, rgba(30,30,30,0.8), rgba(30,30,30,0));
  filter: blur(8px);
}

/* Крестик */
.apply-modal-close {
  position: absolute;
  top: 18px;
  right: 18px; 
  width: 32px;
  height: 32px;
  cursor: pointer;
  z-index: 10;
}

.apply-modal {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(10,10,10,0.85);
  transition: opacity 0.3s;
}
.apply-modal.hidden { opacity: 0; pointer-events: none; }
.apply-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  z-index: 10;
}
.input-label {
  position: relative;
  margin-bottom: 24px;
  display: block;
}
.input-field {
  width: 100%;
  padding: 14px 12px 14px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #222;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border 0.2s;
}
.input-field:focus {
  border-color: #666;
}
.placeholder {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
  font-size: 1rem;
  transition: 0.2s;
  opacity: 1;
}
.input-field:not(:placeholder-shown):not([type="select"]):not([type="radio"]):not([type="checkbox"]),
.input-field:focus {
  background: #222;
}
.input-field:focus + .placeholder,
.input-field:not(:placeholder-shown) + .placeholder {
  opacity: 0;
}
select.input-field {
  color: #fff;
  background: #222;
  appearance: none;
  padding-right: 32px;
}
select.input-field:invalid { color: #888; }
.portfolio-choice {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  color: #aaa;
  font-size: 1rem;
}
.portfolio-link-block { margin-bottom: 18px; }
.test-task-block {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.test-task-download {
  color: #fff;
  background: #333;
  border-radius: 6px;
  padding: 8px 14px;
  text-decoration: none;
  margin-bottom: 8px;
  font-size: 0.98rem;
  display: inline-block;
}
.apply-submit-btn {
  margin-top: 5px;
  padding: 14px 0;
  width: 100%;           /* добавлено */
  background: #222;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.apply-submit-btn:hover { background: #333; }

body.modal-open {
  overflow: hidden;
  touch-action: none;
}
