/* =====================================================================
   Ателье «Золотая нить» — единые стили сайта
   Стиль: классическое ателье (тёмный фон + золото + кремовый текст)
   Чистый CSS, без зависимостей. CSS-3D и анимации.
   ===================================================================== */

/* ---------- 1. Переменные (палитра, размеры) ---------- */
:root {
  --bg:        #14110E;   /* основной тёмный тёплый фон */
  --bg-2:      #1B1712;   /* фон секций */
  --panel:     #221C15;   /* карточки/панели */
  --panel-2:   #2B241B;   /* панель светлее */
  --gold:      #C9A24B;   /* основное золото */
  --gold-2:    #E7CE86;   /* светлое золото (блики) */
  --cream:     #ECE3D2;   /* основной текст */
  --muted:     #A99C84;   /* приглушённый текст */
  --line:      rgba(201, 162, 75, 0.28);
  --shadow:    0 18px 45px rgba(0, 0, 0, 0.45);

  --font-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Montserrat', 'Segoe UI', system-ui, sans-serif;

  --maxw: 1160px;
  --radius: 14px;
  --transition: 0.35s ease;
}

/* ---------- 2. База / сброс ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--cream);
  line-height: 1.65;
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  color: var(--cream);
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* акцентное золотое слово */
.gold { color: var(--gold); }

/* тонкая надпись над заголовком */
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  display: inline-block;
  margin-bottom: 14px;
}

/* ---------- 3. Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 1px solid var(--gold);
  transition: transform var(--transition), box-shadow var(--transition),
              background var(--transition), color var(--transition);
}
.btn--primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1509;
  border: none;
}
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(201, 162, 75, 0.35);
}
.btn--ghost { background: transparent; color: var(--gold); }
.btn--ghost:hover {
  background: rgba(201, 162, 75, 0.12);
  transform: translateY(-3px);
}

/* ---------- 4. Шапка / навигация ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 17, 14, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cream);
}
.logo__mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.1rem;
}
.logo small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.nav__links { display: flex; align-items: center; gap: 34px; }
.nav__links a {
  font-size: 0.92rem;
  color: var(--muted);
  position: relative;
  padding: 4px 0;
  transition: color var(--transition);
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1.5px;
  background: var(--gold);
  transition: width var(--transition);
}
.nav__links a:hover,
.nav__links a[aria-current="page"] { color: var(--cream); }
.nav__links a:hover::after,
.nav__links a[aria-current="page"]::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span {
  width: 26px; height: 2px;
  background: var(--gold);
  transition: var(--transition);
}

/* ---------- 5. Общие секции ---------- */
.section { padding: 90px 0; }
.section--alt { background: var(--bg-2); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section__head h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.section__head p { color: var(--muted); margin-top: 14px; }

/* декоративный разделитель */
.divider {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; color: var(--gold); margin: 18px 0;
}
.divider::before, .divider::after {
  content: ''; height: 1px; width: 60px;
  background: linear-gradient(to right, transparent, var(--gold));
}
.divider::after { background: linear-gradient(to left, transparent, var(--gold)); }

/* ---------- 6. HERO (главный экран) ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 74px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 78% 25%, rgba(201, 162, 75, 0.18), transparent 45%),
    radial-gradient(circle at 15% 80%, rgba(201, 162, 75, 0.10), transparent 40%);
  z-index: 0;
}
.hero .container {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}
.hero__title {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.08;
}
.hero__title span { color: var(--gold); font-style: italic; }
.hero__text {
  color: var(--muted);
  font-size: 1.08rem;
  margin: 24px 0 34px;
  max-width: 480px;
}
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero__stats {
  display: flex; gap: 40px; margin-top: 48px;
  border-top: 1px solid var(--line); padding-top: 26px;
}
.hero__stats b {
  font-family: var(--font-head);
  font-size: 1.9rem; color: var(--gold); display: block;
}
.hero__stats span { font-size: 0.82rem; color: var(--muted); }

/* --- 3D сцена: вращающийся куб --- */
.hero__visual {
  display: grid; place-items: center;
  perspective: 1100px;
  min-height: 340px;
}
.scene {
  width: 210px; height: 210px;
  perspective: 900px;
  will-change: transform;
}
.cube {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: cube-spin 18s infinite linear;
}
.cube__face {
  position: absolute;
  width: 210px; height: 210px;
  display: grid; place-items: center;
  font-size: 4.6rem;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
  border-radius: 8px;
}
.cube__face--front  { transform: translateZ(105px); }
.cube__face--back   { transform: rotateY(180deg) translateZ(105px); }
.cube__face--right  { transform: rotateY(90deg)  translateZ(105px); }
.cube__face--left   { transform: rotateY(-90deg) translateZ(105px); }
.cube__face--top    { transform: rotateX(90deg)  translateZ(105px); }
.cube__face--bottom { transform: rotateX(-90deg) translateZ(105px); }
@keyframes cube-spin {
  from { transform: rotateX(-22deg) rotateY(0deg); }
  to   { transform: rotateX(-22deg) rotateY(360deg); }
}
/* золотое свечение под кубом */
.hero__visual::after {
  content: '';
  position: absolute;
  width: 220px; height: 40px;
  bottom: 24px;
  background: radial-gradient(ellipse, rgba(201,162,75,0.35), transparent 70%);
  filter: blur(8px);
}

/* ---------- 7. Услуги — карточки-перевёртыши (3D) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}
.flip { perspective: 1200px; height: 320px; }
.flip__inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(.2,.8,.2,1);
}
.flip:hover .flip__inner,
.flip:focus-within .flip__inner { transform: rotateY(180deg); }
.flip__front, .flip__back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 28px;
  display: flex; flex-direction: column;
}
.flip__front {
  background: linear-gradient(165deg, var(--panel), var(--bg-2));
  align-items: flex-start; justify-content: center;
}
.flip__front .ico { font-size: 2.8rem; margin-bottom: 16px; }
.flip__front h3 { font-size: 1.4rem; margin-bottom: 10px; }
.flip__front p { color: var(--muted); font-size: 0.95rem; }
.flip__hint {
  margin-top: auto; font-size: 0.78rem; color: var(--gold);
  letter-spacing: 0.05em;
}
.flip__back {
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  transform: rotateY(180deg);
  align-items: center; justify-content: center; text-align: center;
}
.flip__back .price {
  font-family: var(--font-head);
  font-size: 2.2rem; color: var(--gold); margin-bottom: 6px;
}
.flip__back small { color: var(--muted); }
.flip__back ul { margin-top: 18px; text-align: left; }
.flip__back li {
  font-size: 0.9rem; color: var(--cream); padding: 4px 0 4px 22px;
  position: relative;
}
.flip__back li::before {
  content: '✓'; position: absolute; left: 0; color: var(--gold);
}

/* ---------- 8. Плитки-фичи (иконка + текст) ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.feature {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.feature .ico { font-size: 2.2rem; margin-bottom: 14px; }
.feature h3 { font-size: 1.2rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 0.92rem; }

/* ---------- 9. Портфолио ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.work {
  position: relative;
  height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transform-style: preserve-3d;
  transition: transform var(--transition), box-shadow var(--transition);
}
.work:hover { transform: translateY(-8px) scale(1.015); box-shadow: var(--shadow); }
.work__img {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 4rem;
}
/* стилизованные «фото»-заглушки — замените на реальные картинки */
.work--1 .work__img { background: linear-gradient(135deg, #3a2f22, #16120d); }
.work--2 .work__img { background: linear-gradient(135deg, #2f2a3a, #14121a); }
.work--3 .work__img { background: linear-gradient(135deg, #223a2f, #0f1613); }
.work--4 .work__img { background: linear-gradient(135deg, #3a2222, #180f0f); }
.work--5 .work__img { background: linear-gradient(135deg, #2f333a, #131518); }
.work--6 .work__img { background: linear-gradient(135deg, #3a3222, #17140d); }
.work__cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 20px 18px;
  background: linear-gradient(to top, rgba(10,8,6,0.92), transparent);
  transform: translateY(8px);
  transition: transform var(--transition);
}
.work:hover .work__cap { transform: translateY(0); }
.work__cap h3 { font-size: 1.15rem; }
.work__cap span { font-size: 0.82rem; color: var(--gold); }

/* --- слайдер «до / после» --- */
.ba {
  position: relative;
  max-width: 680px; margin: 0 auto;
  height: 380px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); user-select: none;
}
.ba__layer {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: 1.5rem;
}
.ba__before { background: linear-gradient(135deg, #2a2620, #17140f); color: var(--muted); }
.ba__after  {
  background: linear-gradient(135deg, #3a2d16, #1d1608); color: var(--gold);
  clip-path: inset(0 0 0 50%);
}
.ba__label {
  position: absolute; top: 16px;
  font-family: var(--font-body); font-size: 0.72rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 20px;
  background: rgba(0,0,0,0.5); border: 1px solid var(--line);
}
.ba__before .ba__label { left: 16px; }
.ba__after  .ba__label { right: 16px; color: var(--gold); }
.ba__handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: var(--gold);
  transform: translateX(-50%);
  pointer-events: none;
}
.ba__handle::before {
  content: '⇆';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold); color: #1a1509;
  display: grid; place-items: center; font-size: 1.1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.ba__range {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: ew-resize; margin: 0;
}

/* ---------- 10. Отзывы ---------- */
.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.quote {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  position: relative;
}
.quote::before {
  content: '“';
  font-family: var(--font-head);
  font-size: 4rem; color: var(--gold);
  position: absolute; top: 6px; left: 18px; opacity: 0.5;
}
.quote p { position: relative; color: var(--cream); margin-bottom: 18px; }
.quote__who { display: flex; align-items: center; gap: 12px; }
.quote__ava {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1509; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700;
}
.quote__who b { font-size: 0.95rem; }
.quote__who span { font-size: 0.8rem; color: var(--muted); display: block; }

/* ---------- 11. Страница «О мастере» ---------- */
.about {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 50px; align-items: center;
}
.about__photo {
  height: 460px; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel-2), var(--bg));
  border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 6rem;
  position: relative;
}
.about__photo span.badge {
  position: absolute; bottom: 22px; left: 22px; right: 22px;
  background: rgba(20,17,14,0.85); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; font-size: 0.85rem;
}
.about__photo .badge b { color: var(--gold); font-family: var(--font-head); }
.about h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 10px; }
.about p { color: var(--muted); margin-bottom: 16px; }

/* шкалы навыков */
.skills { margin-top: 26px; }
.skill { margin-bottom: 16px; }
.skill__top {
  display: flex; justify-content: space-between;
  font-size: 0.9rem; margin-bottom: 6px;
}
.skill__bar { height: 7px; background: var(--panel-2); border-radius: 20px; overflow: hidden; }
.skill__fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  border-radius: 20px;
  transition: width 1.2s ease;
}

/* таймлайн опыта */
.timeline { margin-top: 40px; border-left: 2px solid var(--line); padding-left: 26px; }
.tl { position: relative; padding-bottom: 26px; }
.tl::before {
  content: ''; position: absolute; left: -33px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px rgba(201,162,75,0.15);
}
.tl b { font-family: var(--font-head); color: var(--gold); display: block; }
.tl h4 { margin: 2px 0 4px; }
.tl p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ---------- 12. Контакты ---------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
}
.contact__info li {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.contact__info .ico {
  font-size: 1.4rem; width: 46px; height: 46px;
  display: grid; place-items: center; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 12px; color: var(--gold);
}
.contact__info b { display: block; font-size: 0.75rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.contact__info a, .contact__info span { color: var(--cream); }

.form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 30px;
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; margin-bottom: 7px; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border var(--transition), box-shadow var(--transition);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,75,0.15);
}
.field textarea { resize: vertical; min-height: 120px; }
.form__ok {
  display: none;
  margin-top: 16px; padding: 14px 16px;
  background: rgba(201,162,75,0.12);
  border: 1px solid var(--gold); border-radius: 10px;
  color: var(--gold-2); font-size: 0.92rem;
}
.form__ok.show { display: block; }

/* карта-заглушка */
.map {
  margin-top: 30px; height: 220px; border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(201,162,75,0.06) 29px),
    repeating-linear-gradient(90deg, transparent, transparent 28px, rgba(201,162,75,0.06) 29px),
    var(--bg-2);
  display: grid; place-items: center; color: var(--muted); font-size: 0.9rem;
}

/* ---------- 13. CTA-полоса ---------- */
.cta {
  text-align: center;
  background: linear-gradient(135deg, var(--panel-2), var(--bg-2));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.cta h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 14px; }
.cta p { color: var(--muted); max-width: 520px; margin: 0 auto 28px; }

/* ---------- 14. Подвал ---------- */
.footer {
  background: #0F0C0A;
  border-top: 1px solid var(--line);
  padding: 56px 0 26px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px; margin-bottom: 40px;
}
.footer h4 { font-size: 1rem; margin-bottom: 16px; color: var(--gold); }
.footer p, .footer a { color: var(--muted); font-size: 0.9rem; }
.footer li { margin-bottom: 10px; }
.footer a:hover { color: var(--cream); }
.socials { display: flex; gap: 12px; margin-top: 16px; }
.socials a {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center;
  transition: var(--transition);
}
.socials a:hover { background: var(--gold); color: #1a1509; transform: translateY(-3px); }
.footer__bottom {
  border-top: 1px solid var(--line); padding-top: 22px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 0.82rem; color: var(--muted);
}

/* ---------- 15. Анимации появления ---------- */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.12s; }
.reveal[data-delay="2"] { transition-delay: 0.24s; }
.reveal[data-delay="3"] { transition-delay: 0.36s; }

/* ---------- 16. Адаптивность ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero__visual { order: -1; min-height: 300px; }
  .hero__text { margin-left: auto; margin-right: auto; }
  .hero__actions, .hero__stats { justify-content: center; }
  .about, .contact { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 720px) {
  .nav__links {
    position: fixed; inset: 74px 0 auto 0;
    flex-direction: column; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: 10px 0;
    clip-path: inset(0 0 100% 0);
    transition: clip-path var(--transition);
  }
  .nav__links.open { clip-path: inset(0 0 0 0); }
  .nav__links a { padding: 15px 24px; width: 100%; }
  .nav__toggle { display: flex; }
  .section { padding: 64px 0; }
  .hero__stats { gap: 24px; }
}

/* ---------- 17. Уважение к настройкам движения ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .cube { animation: none; transform: rotateX(-22deg) rotateY(-30deg); }
}
