/* ========================================
   КАТОК — katok.io
   Shared styles · Dark gallery aesthetic
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=Manrope:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0C0A09;
  --bg-card: #141110;
  --bg-elevated: #1A1614;
  --bg-warm: #1E1A17;
  --text: #F5F0EB;
  --text-secondary: #C8BFB0;
  --text-muted: #9C8E7E;
  --text-dim: #6B5F53;
  --accent: #C4392A;
  --accent-hover: #D94A3B;
  --gold: #C9A96E;
  --gold-dim: rgba(201,169,110,0.15);
  --border: rgba(201,169,110,0.1);
  --border-strong: rgba(201,169,110,0.2);
  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans: 'Manrope', -apple-system, sans-serif;
  --max-w: 1200px;
  --max-w-narrow: 800px;
  --gap: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 100;
  opacity: 0.4;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--text); }

/* ─── Typography ─── */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h4 { font-size: 1.1rem; font-weight: 500; }

.overline {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.body-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 640px;
}

/* ─── Layout ─── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gap); }
.container--narrow { max-width: var(--max-w-narrow); margin: 0 auto; padding: 0 var(--gap); }

.section {
  padding: clamp(60px, 10vw, 120px) 0;
}

.section--dark { background: var(--bg); }
.section--elevated { background: var(--bg-elevated); }
.section--warm { background: var(--bg-warm); }

/* ─── Header / Nav ─── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(12,10,9,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  transition: transform 0.3s;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header__logo img {
  height: 40px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.site-nav a:hover { color: var(--text); }
.site-nav a.active { color: var(--gold); }

.nav-lang {
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 4px;
}

.nav-lang:hover { border-color: var(--border-strong); color: var(--text-muted); }

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 8px; }

@media (max-width: 768px) {
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 20px var(--gap);
    border-bottom: 1px solid var(--border);
    gap: 16px;
  }
  .nav-toggle { display: block; }
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 14px 28px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); color: #fff; }

.btn--outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}
.btn--outline:hover { border-color: var(--gold); color: var(--text); }

.btn--gold {
  background: var(--gold);
  color: var(--bg);
}
.btn--gold:hover { background: #D4B87A; color: var(--bg); }

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.card__img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

.card__body { padding: 20px; }

.card__overline {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.card__title {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 8px;
}

.card__desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Grid ─── */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Hero ─── */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(12,10,9,0.4) 0%, var(--bg) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero__content h1 { margin-bottom: 20px; }
.hero__content p { font-size: 1.1rem; color: var(--text-secondary); max-width: 520px; margin-bottom: 32px; }

/* ─── Photo gallery strip ─── */
.photo-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 var(--gap);
}
.photo-strip::-webkit-scrollbar { display: none; }

.photo-strip img {
  height: 320px;
  width: auto;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
}

/* ─── Stats ─── */
.stats {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.stat__num {
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
}

.stat__label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Timeline ─── */
.timeline { max-width: 600px; }
.timeline__item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.timeline__item:last-child { border-bottom: none; }
.timeline__time { font-family: var(--serif); font-size: 1.2rem; color: var(--accent); }
.timeline__title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.timeline__desc { font-size: 14px; color: var(--text-muted); }

/* ─── CTA block ─── */
.cta-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(32px, 5vw, 60px);
  text-align: center;
}

.cta-block h2 { margin-bottom: 12px; }
.cta-block p { color: var(--text-muted); margin-bottom: 24px; max-width: 500px; margin-left: auto; margin-right: auto; }

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  margin-top: auto;
}

.site-footer .container {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .site-footer .container { grid-template-columns: 1fr; gap: 32px; }
}

.footer__logo img { height: 24px; margin-bottom: 12px; }
.footer__desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.footer__heading { font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.footer__links { list-style: none; }
.footer__links li { margin-bottom: 10px; }
.footer__links a { font-size: 14px; color: var(--text-dim); }
.footer__links a:hover { color: var(--text); }

.footer__bottom {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .footer__bottom { flex-direction: column; gap: 12px; }
}

/* ─── Animations ─── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }

/* ─── Divider ─── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* ─── Badge ─── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--gold-dim);
  color: var(--gold);
}

.badge--red { background: rgba(196,57,42,0.15); color: var(--accent); }
.badge--sold { background: rgba(107,95,83,0.2); color: var(--text-dim); }

/* ─── Ambient glow ─── */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 600px 400px at 50% 20%, rgba(196,57,42,0.04) 0%, transparent 100%),
    radial-gradient(ellipse 500px 500px at 80% 70%, rgba(201,169,110,0.02) 0%, transparent 100%);
}

/* ─── Page spacer after header ─── */
.page-offset { padding-top: 80px; }

/* ─── Work detail ─── */
.work-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.work-hero__img { border-radius: 8px; width: 100%; }
.work-hero__meta { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-muted); margin-top: 20px; }
.work-hero__meta span { display: flex; gap: 8px; }
.work-hero__meta strong { color: var(--text-secondary); font-weight: 500; }

@media (max-width: 768px) {
  .work-hero { grid-template-columns: 1fr; }
}

/* ─── Utility ─── */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-accent { color: var(--accent); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ─── Modal ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 36px;
  max-width: 480px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal::-webkit-scrollbar { display: none; }
.modal h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.modal p.modal-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.modal .field { margin-bottom: 18px; }
.modal label {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}
.modal input, .modal textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.modal input:focus, .modal textarea:focus { border-color: var(--gold); }
.modal textarea { resize: vertical; min-height: 90px; }
.modal .consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 20px;
  margin-bottom: 20px;
}
.modal .consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--gold);
}
.modal .consent label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 0;
}
.modal .consent a { color: var(--gold); text-decoration: underline; }
.modal input[type="radio"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--gold);
  -webkit-appearance: radio;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--text); }
@media (max-width: 768px) {
  .modal { padding: 24px; }
}

/* Мобильная адаптация модалки успеха */
@media (max-width: 480px) {
  #invite-success .success-header {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    gap: 12px !important;
  }
  #invite-success .success-photo {
    width: 64px !important;
    height: 64px !important;
  }
  #invite-success .success-title {
    font-size: 24px !important;
  }
  #invite-success .success-row {
    gap: 10px !important;
  }
  #invite-success .success-icon {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px;
    border-radius: 6px !important;
  }
  #invite-success .success-icon svg {
    width: 14px;
    height: 14px;
  }
  #invite-success .success-text {
    font-size: 16px !important;
  }
  #invite-success .success-subtext {
    font-size: 14px !important;
  }
  #invite-success .success-cta {
    font-size: 16px !important;
    padding: 11px 16px !important;
  }
  #invite-success .success-footer {
    font-size: 14px !important;
  }
}
