:root {
  --bg: #0a0b0d;
  --bg-elevated: #12141a;
  --surface: #181b24;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaef;
  --muted: #8b92a5;
  --accent: #e8a54b;
  --accent-dim: rgba(232, 165, 75, 0.15);
  --radius: 14px;
  --font: "Onest", system-ui, -apple-system, sans-serif;
  --max: 1120px;
  --header-h: 64px;
  /* Горизонтальные поля + вырезы (iPhone, Pixel и др.) */
  --pad-inline-start: max(1.25rem, env(safe-area-inset-left, 0px));
  --pad-inline-end: max(1.25rem, env(safe-area-inset-right, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  box-sizing: border-box;
  background: rgba(10, 11, 13, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline-start: var(--pad-inline-start);
  padding-inline-end: var(--pad-inline-end);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.logo {
  font-weight: 700;
  font-size: clamp(0.95rem, 2.8vw, 1.1rem);
  color: var(--text);
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.logo span {
  color: var(--accent);
  font-weight: 600;
}

.nav {
  display: none;
  gap: 1.75rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.header__cta {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1206;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.header__cta:hover {
  filter: brightness(1.06);
  text-decoration: none;
}

.burger {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23e8eaef' stroke-width='2'%3E%3Cpath d='M4 6h12M4 10h12M4 14h12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
}

.burger[aria-expanded="true"] {
  background-color: var(--accent-dim);
  border-color: rgba(232, 165, 75, 0.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23e8eaef' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 5l10 10M15 5L5 15'/%3E%3C/svg%3E");
}

/* Иначе display:flex из класса перебивает поведение атрибута hidden — меню не скрывается */
.mobile-nav[hidden] {
  display: none !important;
}

.mobile-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem var(--pad-inline-end) calc(1rem + var(--safe-bottom))
    var(--pad-inline-start);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 13, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mobile-nav a {
  color: var(--text);
  padding: 0.65rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 500;
  text-decoration: none;
}

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

.hero {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  /* 100dvh — стабильнее на мобильных, чем 100vh (панель адреса) */
  min-height: calc(100vh - var(--header-h) - var(--safe-top));
  min-height: calc(100dvh - var(--header-h) - var(--safe-top));
  padding: 2rem 0 calc(2.5rem + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

.hero__inner {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-inline-end) 0 var(--pad-inline-start);
  display: grid;
  gap: 1.5rem;
  align-content: center;
}

@media (max-width: 899px) {
  .hero__content,
  .hero__panel {
    min-width: 0;
  }
}

.hero__media {
  position: absolute;
  inset: 0;
  border-radius: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg-elevated);
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  display: block;
}

.hero__media-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Сильнее затемняем зоны под текстом (слева) и карточками (справа) */
  background:
    linear-gradient(
      95deg,
      rgba(5, 6, 9, 0.97) 0%,
      rgba(5, 6, 9, 0.88) 14%,
      rgba(5, 6, 9, 0.55) 32%,
      rgba(5, 6, 9, 0.14) 48%,
      rgba(5, 6, 9, 0.18) 56%,
      rgba(5, 6, 9, 0.62) 74%,
      rgba(5, 6, 9, 0.94) 100%
    ),
    linear-gradient(
      to bottom,
      rgba(5, 6, 9, 0.35) 0%,
      transparent 40%,
      rgba(5, 6, 9, 0.45) 100%
    );
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 36rem;
  padding: 0.35rem 0;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.hero__title {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 5.2vw + 0.6rem, 2.75rem);
  font-weight: 700;
  text-wrap: balance;
  color: var(--text);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 2px 24px rgba(0, 0, 0, 0.55);
}

.hero__model {
  display: block;
  margin-top: 0.2em;
  color: var(--accent);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 2px 20px rgba(0, 0, 0, 0.5);
}

.hero__lead {
  margin: 0 0 1.5rem;
  color: #d8dce6;
  font-weight: 500;
  font-size: clamp(0.97rem, 2.5vw, 1.08rem);
  line-height: 1.6;
  max-width: 32rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

.hero__price {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(8, 10, 14, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.hero__price-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a8b0c4;
}

.hero__price-value {
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: max(0.9rem, 16px);
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.btn--primary {
  background: var(--accent);
  color: #1a1206;
}

.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--ghost {
  background: rgba(8, 10, 14, 0.45);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.btn--ghost:hover {
  border-color: rgba(232, 165, 75, 0.45);
  color: var(--accent);
}

.btn--lg {
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
}

.hero__panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.hero__stat {
  padding: 1rem 1.15rem;
  background: rgba(10, 12, 18, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.hero__stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hero__stat-label {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #b4bccf;
  font-weight: 500;
}

.section-head {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem var(--pad-inline-end) 1.5rem var(--pad-inline-start);
}

@media (min-width: 480px) {
  .section-head {
    padding-top: 4rem;
    padding-bottom: 2rem;
  }
}

.section-head h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: none;
}

.about__grid {
  list-style: none;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-inline-end) calc(3rem + var(--safe-bottom))
    var(--pad-inline-start);
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .about__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.about__grid li {
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.about__grid h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.about__grid p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.inline-code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
}

.gallery__stage {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-inline-end) calc(3rem + var(--safe-bottom))
    var(--pad-inline-start);
}

.gallery__hero {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  background: var(--surface);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  aspect-ratio: 16 / 9;
  max-height: min(78vh, 720px);
  position: relative;
}

@media (min-width: 900px) {
  .gallery__hero {
    max-height: min(82vh, 780px);
  }
}

.gallery__hero:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.gallery__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .gallery__hero:hover::after {
    background: rgba(0, 0, 0, 0.12);
  }
}

.gallery__hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gallery__thumbs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 0.75rem;
  padding: 0.35rem 0 0.85rem;
  scroll-padding-inline: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(232, 165, 75, 0.45) rgba(255, 255, 255, 0.06);
}

.gallery__thumbs::-webkit-scrollbar {
  height: 6px;
}

.gallery__thumbs::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.gallery__thumbs::-webkit-scrollbar-thumb {
  background: rgba(232, 165, 75, 0.45);
  border-radius: 999px;
}

.gallery__thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 72px;
  padding: 0;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 480px) {
  .gallery__thumb {
    width: 112px;
    height: 84px;
  }
}

.gallery__thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.gallery__thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.35);
}

/* Лайтбокс */
.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
}

.lightbox::backdrop {
  background: rgba(5, 7, 11, 0.92);
  backdrop-filter: blur(6px);
}

.lightbox__backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  cursor: zoom-out;
}

.lightbox__shell {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(1rem, var(--safe-top)) max(1rem, var(--pad-inline-end))
    max(1rem, var(--safe-bottom)) max(1rem, var(--pad-inline-start));
  pointer-events: none;
}

.lightbox__shell > * {
  pointer-events: auto;
}

.lightbox__img {
  max-width: min(96vw, 1600px);
  max-height: min(78vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.lightbox__close {
  position: fixed;
  top: max(0.75rem, var(--safe-top));
  right: max(0.75rem, var(--pad-inline-end));
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(12, 14, 20, 0.9);
  color: var(--text);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.lightbox__close:hover {
  background: rgba(24, 28, 38, 0.95);
  border-color: rgba(232, 165, 75, 0.45);
}

.lightbox__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(12, 14, 20, 0.9);
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  -webkit-tap-highlight-color: transparent;
}

.lightbox__nav:hover {
  border-color: rgba(232, 165, 75, 0.45);
  color: var(--accent);
}

.lightbox__nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lightbox__nav--prev {
  left: max(0.5rem, var(--pad-inline-start));
}

.lightbox__nav--next {
  right: max(0.5rem, var(--pad-inline-end));
}

@media (max-width: 520px) {
  .lightbox__nav {
    width: 42px;
    height: 42px;
    font-size: 1.65rem;
  }

  .lightbox__img {
    max-height: min(70vh, 800px);
  }
}

.facts {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.facts__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--pad-inline-end) 1.5rem var(--pad-inline-start);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

@media (min-width: 768px) {
  .facts__inner {
    grid-template-columns: repeat(4, 1fr);
  }
}

.fact__label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.fact__value {
  font-size: 1rem;
  font-weight: 600;
  word-break: break-word;
}

.specs {
  padding-bottom: calc(3rem + var(--safe-bottom));
}

.specs__tables {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-inline-end) 0 var(--pad-inline-start);
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .specs__tables {
    grid-template-columns: repeat(2, 1fr);
  }
}

.spec-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.spec-block h3 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}

.spec-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.spec-block th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  padding: 0.45rem 0.75rem 0.45rem 0;
  vertical-align: top;
  width: 48%;
  border-bottom: 1px solid var(--border);
}

.spec-block td {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  word-break: break-word;
  hyphens: auto;
}

.spec-block tr:last-child th,
.spec-block tr:last-child td {
  border-bottom: none;
}

/* Узкие телефоны (320–430 CSS px): таблица строками, без горизонтального скролла */
@media (max-width: 479px) {
  .spec-block table,
  .spec-block tbody,
  .spec-block tr,
  .spec-block th,
  .spec-block td {
    display: block;
    width: 100%;
  }

  .spec-block tr {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
  }

  .spec-block tr:last-child {
    border-bottom: none;
  }

  .spec-block th {
    width: 100%;
    padding: 0 0 0.25rem;
    border-bottom: none;
    font-size: 0.8rem;
  }

  .spec-block td {
    padding: 0;
    border-bottom: none;
    font-size: 0.9rem;
  }
}

.contact {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--pad-inline-end) calc(4rem + var(--safe-bottom))
    var(--pad-inline-start);
}

.contact__card {
  padding: 2rem 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(145deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  text-align: center;
}

@media (min-width: 640px) {
  .contact__card {
    padding: 2.5rem 2rem;
    text-align: left;
  }
}

.contact__card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.contact__hint {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

@media (min-width: 640px) {
  .contact__actions {
    justify-content: flex-start;
  }
}

.footer {
  padding: 1.5rem var(--pad-inline-end) calc(1.5rem + var(--safe-bottom))
    var(--pad-inline-start);
  border-top: 1px solid var(--border);
  text-align: center;
}

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

/* Крупные ПК / мониторы QHD: чуть шире контентная колонка */
@media (min-width: 1280px) {
  :root {
    --max: 1180px;
  }
}

@media (min-width: 1536px) {
  :root {
    --max: 1200px;
  }
}

@media (min-width: 900px) {
  .nav,
  .header__cta {
    display: inline-flex;
  }

  .burger {
    display: none;
  }

  .mobile-nav {
    display: none !important;
  }

  .hero__inner {
    grid-template-columns: minmax(260px, 400px) minmax(72px, 1fr) minmax(
        248px,
        300px
      );
    align-items: center;
    gap: clamp(1rem, 2.8vw, 2.5rem);
  }

  .hero__content {
    grid-column: 1;
  }

  .hero__panel {
    grid-column: 3;
    align-self: stretch;
    align-content: center;
  }

  /* Широкий кадр: центр по горизонтали, чуть выше середины по вертикали */
  .hero__img {
    object-position: 50% 42%;
    transform: scale(1.02);
    transform-origin: 50% 45%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn:hover {
    transform: none;
  }

  .hero__img {
    transform: none;
  }
}
