/* ============================================
   LUNARA — кастомные стили поверх Tailwind
   ============================================ */

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.lenis {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  cursor: auto;
}
body.custom-cursor {
  cursor: none;
}
@media (max-width: 768px) {
  body, body.custom-cursor { cursor: auto; }
}

/* ============= GRAIN OVERLAY ============= */
.grain-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* ============= КАСТОМНЫЙ КУРСОР ============= */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 6px;
  height: 6px;
  background: #1a1410;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  filter: invert(1);
  transition: width 0.3s cubic-bezier(.2,.8,.2,1), height 0.3s cubic-bezier(.2,.8,.2,1), background 0.3s;
  will-change: transform;
}
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(26,20,16,0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  filter: invert(1);
  transition: width 0.4s cubic-bezier(.2,.8,.2,1), height 0.4s cubic-bezier(.2,.8,.2,1), border-color 0.3s;
  will-change: transform;
}
.cursor-ring.is-link {
  width: 70px;
  height: 70px;
  border-color: rgba(26,20,16,0.7);
}
.cursor-ring.is-open::after {
  content: 'Открыть';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #1a1410;
}
.cursor-ring.is-zoom::after {
  content: '+';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-family: 'Fraunces', serif;
  color: #1a1410;
}

/* ============= НАВИГАЦИЯ ============= */
.nav-link {
  position: relative;
  transition: opacity 0.3s;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.4s cubic-bezier(.2,.8,.2,1);
}
.nav-link:hover::after {
  width: 100%;
}

#mobile-menu {
  transition: transform 0.7s cubic-bezier(.7,0,.3,1);
}
#mobile-menu.open {
  transform: translateY(0);
}

/* ============= HERO ============= */
.hero-bg img {
  will-change: transform;
}

.scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, transparent, currentColor, transparent);
  background-size: 100% 200%;
  animation: scroll-line 2.2s ease-in-out infinite;
}
@keyframes scroll-line {
  0% { background-position: 0 -100%; }
  100% { background-position: 0 100%; }
}

/* split text для появления */
.split-line {
  overflow: hidden;
  display: block;
}
.split-word {
  display: inline-block;
  overflow: hidden;
}
.split-char {
  display: inline-block;
  will-change: transform;
}

/* ============= БЕГУЩАЯ СТРОКА ============= */
.marquee {
  width: 100%;
  overflow: hidden;
  display: flex;
}
.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee 28s linear infinite;
  align-items: center;
}
.marquee-track span { display: inline-block; }
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============= УСЛУГИ — ГОРИЗОНТАЛЬНЫЙ СКРОЛЛ ============= */
.services-track {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.services-inner {
  display: flex;
  gap: 2rem;
  padding-left: 6vw;
  padding-right: 6vw;
  will-change: transform;
}
@media (min-width: 768px) {
  .services-inner { gap: 3rem; }
}

.service-card {
  flex: 0 0 75vw;
  max-width: 380px;
  position: relative;
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  .service-card {
    flex: 0 0 28vw;
    max-width: 420px;
  }
}

.service-num {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 0.875rem;
  color: rgba(245, 237, 226, 0.5);
  letter-spacing: 0.3em;
  margin-bottom: 1rem;
}

.service-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s cubic-bezier(.2,.8,.2,1);
  filter: grayscale(20%);
}
.service-card:hover .service-image img {
  transform: scale(1.08);
  filter: grayscale(0);
}

.service-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.service-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.6s cubic-bezier(.2,.8,.2,1), opacity 0.4s;
}
.service-card:hover .service-meta {
  max-height: 200px;
  opacity: 1;
}
.service-desc {
  color: rgba(245, 237, 226, 0.7);
  font-size: 0.875rem;
  line-height: 1.6;
}
.service-price {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.25rem;
  color: #d4b896;
}

/* ============= МАСТЕРА ============= */
.master {
  cursor: none;
}
.master-photo {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
}
.master-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.7s cubic-bezier(.2,.8,.2,1), transform 1.2s cubic-bezier(.2,.8,.2,1);
}
.master-photo .m-hover {
  opacity: 0;
  transform: scale(1.05);
}
.master:hover .m-default { opacity: 0; }
.master:hover .m-hover {
  opacity: 1;
  transform: scale(1);
}

/* ============= ГАЛЕРЕЯ ============= */
.gallery-item {
  overflow: hidden;
  cursor: none;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/5;
  transition: transform 1s cubic-bezier(.2,.8,.2,1);
  filter: grayscale(15%);
}
.gallery-item:hover img {
  transform: scale(1.06);
  filter: grayscale(0);
}

/* ============= ОТЗЫВЫ ============= */
.review {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}
.review.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}
.review-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(245, 237, 226, 0.25);
  transition: all 0.4s;
}
.review-dot.active {
  background: #d4b896;
  width: 28px;
  border-radius: 4px;
}

/* ============= ФОРМА ============= */
.form-row {
  position: relative;
  border-bottom: 1px solid rgba(58, 42, 32, 0.2);
  padding: 18px 0 10px;
  transition: border-color 0.4s;
}
.form-row:focus-within {
  border-color: rgba(58, 42, 32, 0.7);
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: #1a1410;
  padding: 6px 0;
  cursor: none;
}
.form-row select {
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.form-row textarea {
  resize: none;
}

.form-row label {
  position: absolute;
  left: 0;
  top: 24px;
  color: rgba(58, 42, 32, 0.5);
  font-size: 1rem;
  pointer-events: none;
  transition: all 0.3s;
  font-family: 'Inter', sans-serif;
}
.form-row input:focus + label,
.form-row input:not(:placeholder-shown) + label,
.form-row textarea:focus + label,
.form-row textarea:not(:placeholder-shown) + label {
  top: 0;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(58, 42, 32, 0.6);
}

.submit-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 22px 50px;
  background: #1a1410;
  color: #f5ede2;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  overflow: hidden;
  cursor: none;
  border: none;
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
  font-family: 'Inter', sans-serif;
}
.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #d4b896;
  transform: translateY(101%);
  transition: transform 0.5s cubic-bezier(.7,0,.3,1);
}
.submit-btn:hover::before {
  transform: translateY(0);
}
.submit-btn:hover {
  color: #1a1410;
}

#form-status.success {
  color: #2d6a4f;
  font-weight: 500;
}
#form-status.error {
  color: #b23a48;
}

/* ============= ССЫЛКИ В КОНТАКТАХ ============= */
.hover-line {
  position: relative;
  display: inline-block;
}
.hover-line::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform-origin: right;
  transform: scaleX(1);
  transition: transform 0.5s cubic-bezier(.7,0,.3,1);
}
.hover-line:hover::after {
  transform-origin: left;
  transform: scaleX(0);
  animation: hover-line-back 0.7s 0.3s forwards;
}
@keyframes hover-line-back {
  to { transform: scaleX(1); }
}

.social-link {
  position: relative;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  display: inline-block;
  transition: color 0.3s;
}
.social-link:hover {
  color: #c9a98a;
}

/* ============= LIGHTBOX ============= */
#lightbox.open {
  display: flex;
  animation: lightbox-in 0.4s ease;
}
@keyframes lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
#lightbox-img {
  animation: lightbox-img 0.5s cubic-bezier(.2,.8,.2,1);
}
@keyframes lightbox-img {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ============= REVEAL АНИМАЦИИ ============= */
/* По умолчанию элементы видны — fade-in применяется только если JS загрузился */
html.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(.2,.8,.2,1), transform 1s cubic-bezier(.2,.8,.2,1);
}
html.js-ready [data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

html.js-ready [data-anim="fade-up"] {
  opacity: 0;
  transform: translateY(30px);
}

/* ============= MAGNETIC ============= */
.magnetic {
  display: inline-block;
  will-change: transform;
}

/* ============= ПОИСК + ФИЛЬТРЫ УСЛУГ ============= */
.services-search-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: rgba(245, 237, 226, 0.06);
  border: 1px solid rgba(245, 237, 226, 0.15);
  border-radius: 100px;
  width: 100%;
  max-width: 320px;
  transition: all 0.3s;
}
.services-search-wrap:focus-within {
  border-color: rgba(245, 237, 226, 0.4);
  background: rgba(245, 237, 226, 0.1);
}
.services-search-wrap svg {
  color: rgba(245, 237, 226, 0.5);
  flex-shrink: 0;
}
.services-search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: #f5ede2;
  cursor: none;
}
.services-search-wrap input::placeholder {
  color: rgba(245, 237, 226, 0.4);
}

.services-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.srv-chip {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid rgba(245, 237, 226, 0.2);
  color: rgba(245, 237, 226, 0.7);
  border-radius: 100px;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-family: inherit;
  cursor: none;
  transition: all 0.3s cubic-bezier(.2,.8,.2,1);
}
.srv-chip:hover {
  border-color: rgba(245, 237, 226, 0.5);
  color: #f5ede2;
}
.srv-chip.active {
  background: #d4b896;
  border-color: #d4b896;
  color: #1a1410;
}
@media (max-width: 768px) {
  .srv-chip { cursor: pointer; }
  .services-search-wrap input { cursor: text; }
}

.service-card.hidden {
  display: none !important;
}

/* ============= НОВОСТИ / ЖУРНАЛ ============= */
.news-feature {
  cursor: none;
}
@media (max-width: 768px) { .news-feature { cursor: auto; } }

.news-feature-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 4px;
}
.news-feature-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(10%);
  transition: transform 1.2s cubic-bezier(.2,.8,.2,1), filter 0.6s;
}
.news-feature:hover .news-feature-img img {
  transform: scale(1.05);
  filter: grayscale(0);
}

.news-side {
  cursor: none;
  display: flex;
  flex-direction: column;
}
@media (max-width: 768px) { .news-side { cursor: auto; } }

.news-side-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: 4px;
}
.news-side-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(15%);
  transition: transform 1s cubic-bezier(.2,.8,.2,1), filter 0.6s;
}
.news-side:hover .news-side-img img {
  transform: scale(1.05);
  filter: grayscale(0);
}

.news-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 14px;
  background: rgba(245, 237, 226, 0.95);
  color: #3a2a20;
  border-radius: 100px;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

/* ============= КОНТАКТЫ — ДЕТАЛЬНЫЕ ЧАСЫ ============= */
.hours-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hours-line {
  display: flex;
  justify-content: space-between;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.25rem;
  color: #1a1410;
  padding: 4px 0;
  border-bottom: 1px solid rgba(58, 42, 32, 0.08);
}
.hours-line:last-child { border-bottom: none; }

.open-now-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 8px 16px;
  background: rgba(45, 106, 79, 0.1);
  color: #2d6a4f;
  border-radius: 100px;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
}
.dot-pulse {
  width: 8px;
  height: 8px;
  background: #2d6a4f;
  border-radius: 50%;
  animation: pulse-green-d 2s infinite;
}
@keyframes pulse-green-d {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* ============= ФОРМА — ДОПОЛНЕНИЯ ============= */
.form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 600px) {
  .form-row-grid { grid-template-columns: 1fr; gap: 0; }
}

.form-row input[type="date"] {
  font-family: inherit;
  color: #1a1410;
  padding-top: 6px;
}
.form-row input[type="date"]::-webkit-calendar-picker-indicator {
  filter: opacity(0.5);
  cursor: pointer;
}

.static-label {
  position: absolute !important;
  top: 0 !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase !important;
  color: rgba(58, 42, 32, 0.6) !important;
}

/* ============= АДАПТИВ ============= */
@media (max-width: 768px) {
  .cursor-dot, .cursor-ring { display: none; }
  body, .submit-btn, .form-row input, .form-row select, .form-row textarea, .gallery-item, .master {
    cursor: auto;
  }
  .submit-btn {
    cursor: pointer;
  }
}

/* Снижаем анимации для тех, кто их отключил */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
