/* ===================== RESET & BASE ===================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --header-h: 80px;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans:  'Helvetica Neue', Arial, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
}

/* ===================== HEADER ===================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: #fff;
  border-bottom: 1px solid #e8e4de;
}

.header__burger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.header__burger span {
  display: block;
  width: 24px;
  height: 1px;
  background: #1a1a1a;
  transition: transform 0.35s ease, opacity 0.25s ease;
  transform-origin: center;
}

.header__burger.open span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}
.header__burger.open span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* ===================== NAV OVERLAY ===================== */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 360px;
  z-index: 90;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 48px 48px;
  transform: translateX(-100%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  box-shadow: 20px 0 60px rgba(0,0,0,0.3);
}

.nav-overlay.open {
  transform: translateX(0);
  pointer-events: all;
}

/* backdrop */
.nav-overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  left: 360px;
  background: rgba(0,0,0,0);
  transition: background 0.45s ease;
  pointer-events: none;
}

.nav-overlay.open::before {
  background: rgba(0,0,0,0.45);
  pointer-events: all;
}

.nav-overlay__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  counter-reset: nav;
}

.nav-overlay__item {
  border-top: 1px solid rgba(255,255,255,0.07);
}

.nav-overlay__item:last-child {
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.nav-overlay__item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 300;
  font-style: italic;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  counter-increment: nav;
}

.nav-overlay__item a::before {
  content: "0" counter(nav);
  font-family: var(--font-sans);
  font-size: 10px;
  font-style: normal;
  font-weight: 300;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.nav-overlay__item a::after {
  content: '→';
  font-family: var(--font-sans);
  font-size: 14px;
  font-style: normal;
  color: rgba(255,255,255,0);
  transition: color 0.2s, transform 0.2s;
  transform: translateX(-8px);
}

.nav-overlay__item a:hover {
  color: #fff;
}

.nav-overlay__item a:hover::after {
  color: rgba(255,255,255,0.5);
  transform: translateX(0);
}

.nav-overlay__sub {
  margin-top: 40px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.15);
}

.nav-overlay__phone {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-overlay__phone:hover { color: #fff; }

@media (max-width: 400px) {
  .nav-overlay { width: 100%; }
  .nav-overlay::before { display: none; }
}

.header__logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  user-select: none;
  line-height: 0;
}

.header__logo img {
  height: 48px;
  width: auto;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header__lang {
  display: flex;
  gap: 4px;
  align-items: center;
}

.header__lang span {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #888;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.2s;
}

.header__lang span.active { color: #1a1a1a; }
.header__lang span:hover  { color: #1a1a1a; }

.header__tel {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s;
}

.header__tel:hover { color: #555; }

.header__phone {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #1a1a1a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.header__phone:hover { background: #333; }

/* ===================== GRID ===================== */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: 100vh;
  padding-top: var(--header-h);
}

/* ===================== CELL ===================== */
.cell {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cell__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  transition: transform 7s ease, filter 0.7s ease;
}

.cell:hover .cell__bg { transform: scale(1); }

.cell:has(.cell__btn:hover) .cell__bg {
  transform: scale(1.18);
  filter: blur(6px);
  transition: transform 0.9s ease, filter 0.7s ease;
}

.cell:has(.cell__btn:hover) .cell__overlay {
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.28) 55%,
    rgba(0,0,0,0.08) 100%
  );
}

.cell__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* placeholder цвета */
.cell__bg--1 { background-color: #8a7a6a; background-image: linear-gradient(160deg, #6b5a4a 0%, #9a8870 40%, #c4a882 100%); }
.cell__bg--2 { background-color: #7a8a7a; background-image: linear-gradient(160deg, #5a6b5a 0%, #748870 40%, #a0b49a 100%); }
.cell__bg--3 { background-color: #6a7a8a; background-image: linear-gradient(160deg, #4a5a6b 0%, #607088 40%, #8a9ab0 100%); }
.cell__bg--4 { background-color: #8a8a7a; background-image: linear-gradient(160deg, #6b6b4a 0%, #888870 40%, #b4b49a 100%); }

.cell__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  transition: background 0.4s;
}

.cell:hover .cell__overlay { background: rgba(0, 0, 0, 0.18); }

.cell__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  padding: 36px 36px 100px;
}

/* тонкая линия над заголовком */
.cell__content::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
}

.cell__title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 2.8vw, 44px);
  font-weight: 300;
  font-style: italic;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin-bottom: 18px;
}

.cell__desc {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 300;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.06em;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.cell:hover .cell__desc {
  opacity: 1;
  transform: translateY(0);
}

.cell__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease 0.06s, transform 0.4s ease 0.06s;
}

.cell:hover .cell__list {
  opacity: 1;
  transform: translateY(0);
}

.cell__list li {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: center;
}

.cell__list li::before {
  content: '—';
  color: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.cell__btn {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-block;
  padding: 9px 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.cell__btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

/* divider between cells */
.cell:nth-child(1),
.cell:nth-child(2) {
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.cell:nth-child(1),
.cell:nth-child(3) {
  border-right: 1px solid rgba(255,255,255,0.15);
}

/* ===================== MODAL ===================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}

.modal.open { display: flex; }

.modal__box {
  background: #fff;
  padding: 48px;
  width: 100%;
  max-width: 400px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal__box h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.modal__box input {
  background: transparent;
  border: none;
  border-bottom: 1px solid #ddd;
  padding: 12px 0;
  color: #1a1a1a;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  letter-spacing: 0.04em;
  transition: border-color 0.2s;
}

.modal__box input:focus { border-color: #1a1a1a; }
.modal__box input::placeholder { color: #aaa; }

.modal__submit {
  margin-top: 8px;
  padding: 14px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.2s;
}

.modal__submit:hover { background: #333; }

.modal__agree {
  font-size: 10px;
  color: #aaa;
  line-height: 1.6;
}

.modal__close {
  position: absolute;
  top: 16px; right: 20px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal__close:hover { color: #1a1a1a; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 50vh);
    height: auto;
    overflow-y: auto;
  }

  html, body { overflow: auto; }

  .cell:nth-child(1),
  .cell:nth-child(3) { border-right: none; }

  .cell:nth-child(1),
  .cell:nth-child(2),
  .cell:nth-child(3) {
    border-bottom: 1px solid rgba(255,255,255,0.15);
  }
}
