:root {
  /* Base / background */
  --bg-main: #07090d;
  --bg-section: #0b1018;
  --bg-card: #111824;
  --bg-soft: #182232;

  /* Premium dark surfaces */
  --graphite: #1f2630;
  --wet-asphalt: #252b34;
  --deep-navy: #0d1828;

  /* Text — тёплый «беловатый» тон */
  --text-main: #faf7f2;
  --text-secondary: rgba(250, 247, 242, 0.9);
  --text-muted: #c9c2b8;

  /* Accent */
  --accent-main: #d99a3d;
  --accent-hover: #f0b45a;
  --accent-dark: #9f6827;

  /* Cold blue accent */
  --blue-main: #6f8fb7;
  --blue-soft: #9fb4cf;
  --blue-dark: #30465f;

  /* Borders / dividers */
  --border-soft: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(217, 154, 61, 0.28);

  /* Effects */
  --glow-warm: rgba(217, 154, 61, 0.22);
  --glow-cold: rgba(111, 143, 183, 0.18);

  /* Layout tokens */
  --radius: 22px;
  --container: 1180px;
  --header-height: 78px;

  /* Aliases for existing rules */
  --bg: var(--bg-main);
  --panel: var(--bg-section);
  --card: var(--bg-card);
  --accent: var(--accent-main);
  --text: var(--text-main);
  --muted: var(--text-muted);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(100% - 48px, var(--container));
  margin: 0 auto;
}

.narrow {
  max-width: 860px;
}

.hero-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(to bottom, rgba(7, 9, 13, 0.45), rgba(7, 9, 13, 0.88)),
    url("hero.jpg") center center / cover no-repeat;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg-section) 82%, transparent);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 var(--border-accent);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-main);
}

.menu {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.menu a {
  color: color-mix(in srgb, var(--text-secondary) 92%, var(--accent-hover) 8%);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.menu a:hover {
  color: var(--accent-hover);
}

.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-content {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-top: 8px;
  padding-bottom: 6px;
}

.eyebrow {
  color: var(--accent-main);
  margin: 0 0 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  max-width: 840px;
  font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 1.08;
  color: var(--text-main);
}

.subtitle {
  margin: 14px 0 16px;
  color: var(--text-secondary);
  max-width: 620px;
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--accent-main);
  background: var(--accent-main);
  color: var(--bg-main);
  font-weight: 600;
  border-radius: 999px;
  padding: 12px 22px;
  transition: transform 0.2s ease, filter 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:not(.btn-max):hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg-main);
}

.btn-max:hover {
  filter: brightness(1.08);
}

.btn-small {
  margin-left: 14px;
  padding: 10px 16px;
  font-size: 0.9rem;
}

.btn-ghost {
  background: transparent;
  color: var(--accent-main);
  border-color: var(--border-accent);
}

.btn-ghost:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
  background: color-mix(in srgb, var(--accent-main) 12%, transparent);
}

.btn-max {
  position: relative;
  border-color: var(--border-accent);
  background: linear-gradient(
    120deg,
    var(--accent-dark),
    var(--accent-main),
    var(--accent-hover),
    var(--accent-main)
  );
  background-size: 220% 220%;
  color: var(--bg-main);
  animation:
    max-gradient 2.8s linear infinite,
    max-blink 2.1s ease-in-out infinite;
}

.hero-actions .btn-max {
  min-width: min(100%, 280px);
}

.btn-max::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--accent-main) 35%, transparent);
  animation: max-ring 1.8s ease-out infinite;
}

.btn-max-large {
  min-width: 250px;
  min-height: 70px;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 0 var(--glow-warm);
  animation:
    max-gradient 2.8s linear infinite,
    max-blink 2.1s ease-in-out infinite,
    max-pulse 1.5s ease-out infinite;
}

@keyframes max-gradient {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

@keyframes max-blink {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(217, 154, 61, 0),
      0 0 0 0 rgba(217, 154, 61, 0.2);
  }
  50% {
    box-shadow:
      0 0 22px 6px rgba(217, 154, 61, 0.55),
      0 0 48px 14px rgba(240, 180, 90, 0.28);
  }
}

@keyframes max-ring {
  0% {
    opacity: 0.7;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes max-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--glow-warm);
  }
  70% {
    transform: scale(1.03);
    box-shadow: 0 0 0 16px transparent;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 transparent;
  }
}

.page {
  position: relative;
  z-index: 2;
}

.content-flow {
  padding-bottom: 20px;
}

/* Сцена: очень длинный трек (~в 4× меньше чувствительность к колесу, чем раньше при 4.1/220vh) */
.scroll-story {
  --scroll-stage-h: min(52vh, 520px);
  --story-track-mul: 14;
  position: relative;
  margin: 2px 0 0;
  min-height: max(
    800px,
    min(420vh, calc(var(--scroll-stage-h) * var(--story-track-mul)))
  );
  scroll-margin-top: calc(var(--header-height) + 12px);
}

/* Ближе к блоку сцен, без лишнего воздуха перед «Популярные предложения» */
#lots.section {
  padding-top: 28px;
}

.scroll-story__sticky {
  position: sticky;
  top: calc(var(--header-height) + 12px);
  height: var(--scroll-stage-h);
  max-height: calc(100vh - var(--header-height) - 24px);
  max-height: calc(100dvh - var(--header-height) - 24px);
  display: flex;
  align-items: stretch;
  z-index: 1;
}

.scroll-story__viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.scroll-story__panel {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-margin-top: calc(var(--header-height) + 20px);
  will-change: transform, opacity;
  opacity: 0;
  transform: translate3d(-108%, 0, 0);
}

.scroll-story__panel-inner {
  height: 100%;
  min-height: 0;
  background: none;
  border: none;
  border-radius: 0;
  padding: 12px 0;
  box-shadow: none;
  backdrop-filter: none;
}

.scroll-story__panel h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  color: var(--text-main);
  text-shadow: 0 1px 28px rgba(7, 9, 13, 0.92);
}

.scroll-story__panel p {
  margin: 0;
  color: var(--text-secondary);
  text-shadow: 0 1px 22px rgba(7, 9, 13, 0.88);
}

.scroll-story__panel .narrow p + p {
  margin-top: 12px;
}

.scroll-story__panel .list li {
  text-shadow: 0 1px 18px rgba(7, 9, 13, 0.88);
}

.section {
  padding: 44px 0;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.section h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  color: var(--text-main);
}

.section p {
  margin: 0;
  color: var(--text-secondary);
}

.narrow p + p {
  margin-top: 12px;
}

.section-card .container {
  padding: 0;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.list li {
  color: var(--text-secondary);
  padding: 10px 0 10px 26px;
  position: relative;
}

.list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--accent-main);
  box-shadow: 0 0 0 0 var(--glow-warm);
}

.animated-list li {
  opacity: 0;
  transform: translateX(-14px);
  animation: list-slide-in 0.65s ease forwards;
}

.animated-list li::before {
  animation: dot-pulse 2.4s ease-in-out infinite;
}

.animated-list li:nth-child(1) {
  animation-delay: 0.06s;
}

.animated-list li:nth-child(2) {
  animation-delay: 0.14s;
}

.animated-list li:nth-child(3) {
  animation-delay: 0.22s;
}

.animated-list li:nth-child(4) {
  animation-delay: 0.3s;
}

.animated-list li:nth-child(5) {
  animation-delay: 0.38s;
}

@keyframes list-slide-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes dot-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--glow-warm);
  }
  50% {
    box-shadow: 0 0 0 8px transparent;
  }
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card {
  background: color-mix(in srgb, var(--bg-card) 94%, transparent);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--blue-dark) 35%, transparent) inset;
}

.lot-gallery {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-accent);
  background: var(--deep-navy);
}

.lot-track {
  display: flex;
  transition: transform 0.35s ease;
}

.lot-track img {
  width: 100%;
  flex: 0 0 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.lot-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-accent);
  background: color-mix(in srgb, var(--graphite) 88%, transparent);
  color: var(--text-main);
  cursor: pointer;
}

.lot-nav:hover {
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

.lot-nav.prev {
  left: 8px;
}

.lot-nav.next {
  right: 8px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg-main) 92%, transparent);
  padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
}

.lightbox.open {
  display: flex;
}

/* Колонка: крестик по центру над фото, под ним — блок снимка со стрелками по краям картинки */
.lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: min(1200px, calc(100vw - 24px));
  pointer-events: auto;
}

.lightbox-img-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  border-radius: 14px;
  overflow: visible;
}

.lightbox-img-wrap img {
  display: block;
  max-width: min(1200px, calc(100vw - 24px));
  max-height: min(82vh, 82dvh);
  width: auto;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border-accent);
  box-shadow: 0 12px 48px var(--glow-cold);
}

.lightbox-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-accent);
  background: var(--graphite);
  color: var(--text-main);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.lightbox-close:hover {
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  left: auto;
  right: auto;
  transform: translateY(-50%);
  z-index: 4;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-accent);
  background: color-mix(in srgb, var(--graphite) 92%, transparent);
  color: var(--text-main);
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
}

.lightbox.open.has-many .lightbox-nav {
  display: flex;
}

.lightbox-nav:hover {
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

/* Стрелки по центру высоты именно фото: слева и справа от кадра */
.lightbox-prev {
  left: 10px;
  padding-right: 2px;
}

.lightbox-next {
  right: 10px;
  padding-left: 2px;
}

@media (max-width: 700px) {
  .lightbox {
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }

  .lightbox-panel {
    max-width: calc(100vw - 16px);
  }

  .lightbox-img-wrap img {
    max-height: min(76vh, 78dvh);
  }

  .lightbox-nav {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    font-size: 2rem;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}

.card h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text-main);
}

.card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  color: var(--text-muted);
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  min-height: 36px;
  color: var(--text-secondary);
}

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.contacts-info {
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-form {
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 10px;
  backdrop-filter: blur(6px);
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--border-soft);
  background: var(--deep-navy);
  color: var(--text-main);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--blue-main);
  box-shadow: 0 0 0 1px var(--glow-cold);
}

.form-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--accent-main);
}

.site-footer {
  padding: 10px 0 24px;
}

.footer-inner {
  border-top: 1px solid var(--border-accent);
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.footer-inner h3 {
  margin: 0 0 4px;
  color: var(--text-main);
}

.footer-inner p {
  margin: 0;
  color: var(--text-muted);
}

.company-legal {
  display: grid;
  gap: 6px;
  max-width: 980px;
}

@media (max-width: 980px) {
  .menu {
    display: none;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contacts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  /* Меньше дёргания hero при скролле: стабильная высота вьюпорта, без smooth по html, без blur шапки */
  html {
    scroll-behavior: auto;
  }

  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: color-mix(in srgb, var(--bg-section) 94%, transparent);
  }

  .hero-section {
    min-height: 100vh;
    min-height: 100svh;
  }

  .hero-bg {
    inset: unset;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
  }

  .container {
    width: min(100% - 28px, var(--container));
  }

  .header-inner {
    gap: 10px;
  }

  .btn-small {
    margin-left: auto;
    padding: 9px 14px;
  }

  .hero-content {
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
  }

  .subtitle {
    font-size: 1rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .scroll-story {
    --scroll-stage-h: min(46vh, 420px);
    --story-track-mul: 9;
  }

  .scroll-story__sticky {
    max-height: calc(100vh - var(--header-height) - 24px);
    max-height: calc(100svh - var(--header-height) - 24px);
  }

  .section {
    padding: 34px 0;
  }

  .section-card .container {
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animated-list li {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .animated-list li::before {
    animation: none;
  }

  .btn-max,
  .btn-max::after {
    animation: none;
  }

  .btn-max-large {
    animation: none;
  }

  .scroll-story {
    min-height: 0;
  }

  .scroll-story__sticky {
    position: relative;
    top: 0;
    height: auto;
    max-height: none;
  }

  .scroll-story__viewport {
    overflow: visible;
  }

  .scroll-story__panel {
    position: relative;
    inset: auto;
    opacity: 1 !important;
    transform: none !important;
    overflow: visible;
    margin-bottom: 28px;
    pointer-events: auto !important;
  }

  .scroll-story__panel:last-child {
    margin-bottom: 0;
  }

  .thanks-card,
  .thanks-icon,
  .thanks-icon-ring,
  .thanks-title,
  .thanks-message,
  .thanks-actions {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --- Страница благодарности --- */

.thanks-body {
  min-height: 100vh;
}

.thanks-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.thanks-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
}

.thanks-card {
  width: min(100%, 520px);
  text-align: center;
  padding: 40px 32px 36px;
  background: color-mix(in srgb, var(--bg-card) 94%, transparent);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 0 var(--glow-warm);
  animation:
    thanks-card-enter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both,
    thanks-card-glow 2.8s ease-in-out 0.75s infinite;
}

@keyframes thanks-card-enter {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes thanks-card-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--glow-warm);
  }
  50% {
    box-shadow: 0 0 40px 2px var(--glow-cold);
  }
}

.thanks-icon {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
  animation: thanks-icon-wrap 0.65s cubic-bezier(0.34, 1.4, 0.64, 1) 0.12s both;
}

@keyframes thanks-icon-wrap {
  from {
    opacity: 0;
    transform: scale(0.3) rotate(-18deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.thanks-icon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--border-accent);
  animation: thanks-ring-pulse 2s ease-in-out 0.5s infinite;
}

@keyframes thanks-ring-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.75;
  }
}

.thanks-icon-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.35rem;
  font-weight: 700;
  color: var(--accent-main);
  line-height: 1;
  text-shadow: 0 0 24px var(--glow-warm);
  animation: thanks-check-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both;
}

@keyframes thanks-check-pop {
  from {
    opacity: 0;
    transform: scale(0.2);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.thanks-title {
  margin: 0 0 14px;
  font-size: clamp(1.65rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-main);
  animation: thanks-fade-up 0.55s ease-out 0.22s both;
}

.thanks-message {
  margin: 0 0 26px;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--text-secondary);
  animation: thanks-fade-up 0.55s ease-out 0.38s both;
}

.thanks-actions {
  animation: thanks-fade-up 0.55s ease-out 0.52s both;
}

@keyframes thanks-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.thanks-footer {
  position: relative;
  z-index: 2;
  padding: 0 0 20px;
}

.thanks-footer .footer-inner {
  border-top: 1px solid var(--border-soft);
  text-align: center;
}

.thanks-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
