/* OBSIDIAN Detailing — тёмная кино-эстетика, палитра из футажа */
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --bg: #0A0908;
  --panel: #14100B;
  --line: #26201700;
  --hairline: rgba(232, 163, 61, .18);
  --amber: #E8A33D;
  --amber-deep: #B4741F;
  --ink: #EDE6DA;
  --muted: #8A7F6F;
  --wide: 'Archivo', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* smooth-скролл делает Lenis; нативный smooth конфликтует с ним */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--wide);
  font-stretch: 100%;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: var(--amber); color: #0A0908; }

/* ---------- Прелоадер ---------- */
#loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  transition: opacity .7s ease, visibility .7s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-mark {
  font-size: 42px; font-weight: 800; font-stretch: 125%;
  color: var(--amber);
  border: 2px solid var(--amber); border-radius: 50%;
  width: 84px; height: 84px;
  display: grid; place-items: center;
}
.loader-bar { width: min(320px, 60vw); height: 2px; background: #241C10; }
.loader-fill { width: 0%; height: 100%; background: var(--amber); transition: width .2s; }
.loader-pct { font-size: 12px; letter-spacing: .25em; color: var(--muted); }

/* ---------- Шапка ---------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px clamp(20px, 4vw, 56px);
  mix-blend-mode: normal;
}
#topbar::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(rgba(8,7,6,.72), rgba(8,7,6,.38) 60%, transparent);
  pointer-events: none;
}
.mainnav a, .wordmark { text-shadow: 0 1px 14px rgba(0,0,0,.65); }
.mainnav {
  display: flex; gap: clamp(18px, 2.6vw, 40px);
  position: absolute; left: 50%; transform: translateX(-50%);
}
.mainnav a {
  color: var(--ink); text-decoration: none;
  font-size: 13px; letter-spacing: .04em;
  opacity: .82; transition: opacity .25s, color .25s;
}
.mainnav a:hover, .mainnav a:focus-visible { opacity: 1; color: var(--amber); }
@media (max-width: 960px) { .mainnav { display: none; } }
.wordmark {
  color: var(--ink); text-decoration: none;
  font-weight: 800; font-stretch: 125%;
  letter-spacing: .22em; font-size: 15px;
}
.wordmark span {
  display: block; font-weight: 400; font-stretch: 100%;
  letter-spacing: .48em; font-size: 8.5px; color: var(--amber);
  margin-top: 2px;
}
.cta-mini {
  color: var(--ink); text-decoration: none; font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--hairline); padding: 10px 18px; border-radius: 100px;
  transition: border-color .3s, color .3s, background .3s;
  background: rgba(10, 9, 8, .35); backdrop-filter: blur(6px);
}
.cta-mini:hover, .cta-mini:focus-visible { border-color: var(--amber); color: var(--amber); }

/* ---------- Скролл-сцена ---------- */
#stage { position: relative; height: 850vh; }
#viewport { position: relative; height: 100vh; overflow: hidden; }
#film { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#dim {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(75deg, rgba(5,4,3,.88) 0%, rgba(5,4,3,.55) 45%, rgba(5,4,3,.12) 100%);
}

.overlay {
  position: absolute; z-index: 5;
  left: clamp(22px, 6vw, 96px);
  bottom: clamp(70px, 14vh, 160px);
  max-width: 620px;
  opacity: 0;
}
.overlay.hero {
  opacity: 1;
  left: 0; right: 0; bottom: auto; top: 0; height: 100%;
  max-width: none;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: center;
  padding-top: 15vh;
  text-align: center;
}

.eyebrow {
  color: var(--amber);
  font-size: 11px; font-weight: 600;
  letter-spacing: .42em; text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(46px, 8.6vw, 132px);
  font-weight: 560; font-stretch: 102%;
  letter-spacing: -.015em;
  line-height: 1.0;
  color: #FAF7F2;
  text-shadow: 0 8px 60px rgba(0,0,0,.55);
}
.hero-sub {
  margin-top: 22px;
  font-size: clamp(14px, 1.6vw, 19px);
  letter-spacing: .08em; color: #C9BFAF;
  text-shadow: 0 2px 24px rgba(0,0,0,.85);
}
.scroll-hint {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .38em; text-transform: uppercase; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.scroll-hint span {
  display: block; width: 1px; height: 44px;
  background: linear-gradient(var(--amber), transparent);
  animation: drop 1.8s ease-in-out infinite;
}
@keyframes drop { 0% { transform: scaleY(0); transform-origin: top; } 55% { transform: scaleY(1); } 100% { opacity: 0; transform: scaleY(1); } }

.caption h2 {
  font-size: clamp(36px, 5.6vw, 76px);
  font-weight: 380; font-stretch: 100%;
  line-height: 1.06; letter-spacing: .02em;
  text-transform: uppercase;
  color: #F2EDE4;
}
.caption h2 em {
  font-style: italic; font-weight: 300;
  letter-spacing: .01em; color: #FFFFFF;
}
.cap-text {
  margin-top: 18px; color: var(--muted);
  font-size: clamp(14px, 1.4vw, 17px); max-width: 440px;
}

.btn-amber {
  display: inline-block; margin-top: 28px;
  background: var(--amber); color: #0A0908;
  text-decoration: none; font-weight: 700;
  font-size: 14px; letter-spacing: .1em; text-transform: uppercase;
  padding: 18px 36px; border-radius: 100px;
  transition: transform .25s cubic-bezier(.2,.9,.3,1.4), background .3s, box-shadow .3s;
  box-shadow: 0 0 0 rgba(232,163,61,0);
}
.btn-amber:hover, .btn-amber:focus-visible {
  background: #F5B95A; transform: translateY(-2px);
  box-shadow: 0 12px 44px rgba(232,163,61,.28);
}
.btn-amber.big { font-size: 16px; padding: 22px 48px; }

.cta-link {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 30px; color: var(--ink); text-decoration: none;
  font-size: clamp(15px, 1.5vw, 18px); letter-spacing: .02em;
  border-bottom: 1px solid rgba(237,230,218,.35);
  padding-bottom: 6px;
  transition: color .25s, border-color .25s, gap .25s;
}
.cta-link:hover, .cta-link:focus-visible { color: var(--amber); border-color: var(--amber); gap: 16px; }
.cta-link .arr { font-size: .85em; }

/* Марки (ряд как у EQUIS) */
.brands {
  position: relative; z-index: 6; background: var(--bg);
  border-top: 1px solid rgba(237,230,218,.07);
  padding: 34px clamp(22px, 6vw, 96px) 30px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px 40px;
  max-width: 1440px; margin: 0 auto;
}
.brands-label {
  font-size: 10.5px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--muted);
}
.brands-row {
  font-size: 13.5px; letter-spacing: .18em; text-transform: uppercase;
  color: #B9AF9F; white-space: nowrap; overflow-x: auto; max-width: 100%;
}

/* ---------- Секции ---------- */
.section {
  position: relative; z-index: 6;
  background: var(--bg);
  padding: clamp(90px, 13vh, 170px) clamp(22px, 6vw, 96px);
  max-width: 1440px; margin: 0 auto;
}
.sec-title {
  font-size: clamp(34px, 5vw, 68px);
  font-weight: 540; font-stretch: 101%;
  line-height: 1.04; letter-spacing: -.01em;
  color: #F5F1E9;
  margin-bottom: 18px;
}
.sec-sub { color: var(--muted); max-width: 520px; }

/* Карточки услуг */
.cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.4vw, 34px); margin-top: clamp(40px, 6vh, 72px);
}
.card { background: var(--panel); border: 1px solid var(--hairline); overflow: hidden; }
.card-img { aspect-ratio: 16/10; overflow: hidden; }
.card-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .8s cubic-bezier(.2,.7,.2,1); filter: saturate(.92);
}
.card:hover .card-img img { transform: scale(1.06); }
.card h3 {
  padding: 24px 24px 8px;
  font-size: 17px; font-weight: 700; font-stretch: 116%;
  letter-spacing: .06em; text-transform: uppercase;
}
.card p { padding: 0 24px 28px; color: var(--muted); font-size: 14.5px; }

/* Wipe-секция */
.wipe-sec { max-width: none; }
.wipe-sec .eyebrow, .wipe-sec .sec-title, .wipe-sec .sec-sub {
  max-width: 1440px; margin-left: auto; margin-right: auto;
}
.wipe-sec .sec-title { margin-bottom: 14px; }
#wipeWrap {
  position: relative; margin-top: clamp(36px, 6vh, 64px);
  aspect-ratio: 16/9; max-height: 82vh; width: 100%;
  overflow: hidden; cursor: crosshair;
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
#wipeCanvas { width: 100%; height: 100%; display: block; }
#wipeHint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 12px; letter-spacing: .4em; text-transform: uppercase;
  color: rgba(237,230,218,.85); background: rgba(10,9,8,.45);
  padding: 14px 26px; border: 1px solid rgba(237,230,218,.25); border-radius: 100px;
  pointer-events: none; transition: opacity .6s;
  backdrop-filter: blur(4px);
}
#wipeWrap.touched #wipeHint { opacity: 0; }

/* Пакеты */
.tiers {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.4vw, 34px); margin-top: clamp(40px, 6vh, 72px);
  align-items: stretch;
}
.tier {
  border: 1px solid var(--hairline); background: var(--panel);
  padding: 38px 32px 42px;
  display: flex; flex-direction: column;
}
.tier.featured { border-color: var(--amber); position: relative; }
.tier.featured::before {
  content: 'Beliebt'; position: absolute; top: -11px; left: 32px;
  background: var(--amber); color: #0A0908;
  font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 100px;
}
.tier h3 {
  font-size: 14px; font-weight: 700; font-stretch: 120%;
  letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
}
.tier .price {
  font-size: clamp(40px, 4.6vw, 58px); font-weight: 850; font-stretch: 122%;
  color: var(--ink); margin: 14px 0 22px; letter-spacing: .02em;
}
.tier.featured .price { color: var(--amber); }
.tier ul { list-style: none; }
.tier li {
  color: var(--muted); font-size: 14.5px;
  padding: 10px 0 10px 26px; position: relative;
  border-top: 1px solid rgba(232,163,61,.08);
}
.tier li::before {
  content: ''; position: absolute; left: 2px; top: 17px;
  width: 10px; height: 1.5px; background: var(--amber);
}

/* Контакт */
#kontakt { text-align: center; }
#kontakt .sec-sub { margin: 0 auto; }
.contact-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px; margin-top: clamp(50px, 8vh, 90px);
  text-align: center;
}
.contact-grid h4 {
  font-size: 11px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 10px; font-weight: 600;
}
.contact-grid p { color: var(--muted); font-size: 15px; }

footer {
  border-top: 1px solid var(--hairline);
  padding: 36px clamp(22px, 6vw, 96px) 44px;
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  color: var(--muted); font-size: 12.5px;
}
footer .builder a { color: var(--amber); }

/* Плёночное зерно поверх всего */
#grain {
  position: fixed; inset: -50%; z-index: 150; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .16; mix-blend-mode: overlay;
  animation: grain 900ms steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 25% { transform: translate(-2%,3%); }
  50% { transform: translate(3%,-2%); } 75% { transform: translate(-3%,-3%); } 100% { transform: translate(2%,2%); }
}

@media (prefers-reduced-motion: reduce) {
  #grain { animation: none; }
  .scroll-hint span { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Мобилка ---------- */
@media (max-width: 860px) {
  .cards, .tiers, .contact-grid { grid-template-columns: 1fr; }
  .overlay { left: 22px; right: 22px; bottom: 84px; }
  .tier.featured { order: -1; }
  footer { flex-direction: column; }
  #wipeWrap { aspect-ratio: 4/5; }
}
