/* ═══════════════════════════════════════════════
   RAHATTI — главная (index.html), галерея (gallery.html)
   Design System: Architectural Minimalism
   ═══════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --black:    #0E0E0E;
  --dark:     #1A1A1A;
  --graphite: #2C2C2C;
  --mid:      #3E3E3E;
  --muted:    #6B6B6B;
  --silver:   #9A9A9A;
  --warm:     #F5F3EF;
  --white:    #FFFFFF;
  --gold:     #C6A87A;
  --gold-dim: rgba(198, 168, 122, 0.15);

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;

  --container: 1320px;
  --pad-x:     clamp(24px, 5vw, 80px);
  --pad-section: clamp(80px, 10vw, 140px);

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition: 200ms var(--ease);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 36px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--white);
}
.btn-primary:hover {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.3);
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-gold {
  background: var(--gold);
  color: var(--black);
  border: 1px solid var(--gold);
}
.btn-gold:hover {
  background: transparent;
  color: var(--gold);
}

/* ── Section label ── */
.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
}

/* ══════════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════════ */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  transition: background var(--transition), border-color var(--transition);
  border-bottom: 1px solid transparent;
}

#navbar.scrolled {
  background: rgba(14, 14, 14, 0.95);
  backdrop-filter: blur(12px);
  border-color: var(--graphite);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--white);
  transition: color var(--transition);
}
.nav-logo span { color: var(--gold); }
.nav-logo:hover { color: var(--gold); }

.nav-links {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
}
.nav-links a {
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  transition: color var(--transition);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--white); }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--warm);
  border-radius: 1px;
  transition: var(--transition);
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 80px 24px 40px;
  overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 300;
  color: rgba(255,255,255,0.7);
  transition: color var(--transition);
}
.mobile-menu a:hover { color: var(--gold); }

/* ══════════════════════════════════════════════
   1. HERO — Full-bleed image with overlay
══════════════════════════════════════════════ */
#hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 200px;
  overflow: hidden;
  background-color: var(--black);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to bottom,
      rgba(14,14,14,0.2) 0%,
      rgba(14,14,14,0.5) 50%,
      rgba(14,14,14,0.92) 85%,
      rgba(14,14,14,1)   100%),
    url('../minimalist-kitchen-interior-design.jpg');
  background-size: cover;
  background-position: center 40%;
  transform: scale(1.06);
  transition: transform 8s ease-out;
}
.hero-bg.loaded { transform: scale(1); }

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  padding-top: 120px;
}

.hero-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.hero-label.visible { opacity: 1; transform: none; }
.hero-label::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--gold);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(48px, 6.5vw, 96px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 28px;
}
.hero-title .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  margin-right: 0.18em;
}
.hero-title .word-inner {
  display: block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease-out);
}
.hero-title .word-inner.visible { transform: translateY(0); }
.hero-em {
  font-style: italic;
  color: var(--gold);
}

.hero-sub {
  font-size: 16px;
  font-weight: 300;
  color: rgba(255,255,255,0.65);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 48px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s 0.6s var(--ease-out), transform 0.8s 0.6s var(--ease-out);
}
.hero-sub.visible { opacity: 1; transform: none; }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s 0.9s var(--ease-out), transform 0.8s 0.9s var(--ease-out);
}
.hero-actions.visible { opacity: 1; transform: none; }

/* Primary CTA (white bg, arrow) */
.btn-primary {
  background: var(--white);
  color: var(--black);
}
.btn-primary:hover {
  background: var(--gold);
  color: var(--black);
}

/* Arrow icon in btn */
.btn-arrow {
  width: 16px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: width 0.3s var(--ease-out);
}
.btn-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-top: 1px solid currentColor;
}
.btn:hover .btn-arrow { width: 24px; }

/* ── Stats bar at bottom of hero ── */
.hero-stats {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--graphite);
  padding: 32px 0;
  display: flex;
  z-index: 2;
}
.hero-stats .container {
  display: flex;
  gap: 0;
  width: 100%;
}

.stat-item {
  flex: 1;
  padding: 0 clamp(16px, 2.5vw, 40px);
  border-right: 1px solid var(--graphite);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.stat-item:first-child { padding-left: 0; }
.stat-item:last-child  { border-right: none; }
.stat-item.visible { opacity: 1; transform: none; }

.stat-item.stat-wide { flex: 1.5; }
.stat-number {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  color: var(--white);
  margin-bottom: 6px;
}
.stat-number span { color: var(--gold); }
.stat-number.stat-text { font-size: 30px; }
.stat-number.stat-number--tight {
  white-space: nowrap;
  font-size: 38px;
}
.stat-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-mid);
  text-transform: uppercase;
}
.stat-label.stat-label--sentence {
  text-transform: none;
  letter-spacing: 0.05em;
}

/* Scroll indicator */
.scroll-hint {
  position: absolute;
  right: var(--px);
  bottom: 120px;
  writing-mode: vertical-lr;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transition: opacity 0.8s 1.2s var(--ease-out);
  z-index: 2;
}
.scroll-hint.visible { opacity: 1; }
.scroll-hint::after {
  content: '';
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, transparent, var(--gold));
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%, 100% { transform: scaleY(0); transform-origin: top; }
  50%       { transform: scaleY(1); transform-origin: top; }
}

/* ── Scroll to top button ── */
.scroll-top {
  position: fixed;
  right: 32px;
  bottom: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 26, 0.85);
  color: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--mid);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition),
              color var(--transition), border-color var(--transition),
              background var(--transition);
  z-index: 90;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-top:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(26, 26, 26, 0.95);
}
.scroll-top:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

/* ══════════════════════════════════════════════
   2. ABOUT
══════════════════════════════════════════════ */
#about {
  padding: var(--pad-section) 0;
  background: var(--dark);
  position: relative;
}

#about::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--graphite);
}

.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-left {
  position: sticky;
  top: 120px;
}

.about-heading {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 300;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 32px;
}

.about-line-gold {
  width: 60px;
  height: 1px;
  background: var(--gold);
}
.about-heading em {
  font-style: italic;
  color: var(--gold);
}

.about-text-block {
  margin-bottom: 40px;
}

.about-text {
  font-size: 16px;
  font-weight: 300;
  color: rgba(255,255,255,0.55);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-service-list {
  padding-left: 0;
  margin-bottom: 24px;
}
.about-service-list li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  padding: 8px 0;
}
.about-service-list li::before {
  content: '';
  flex-shrink: 0;
  width: 20px;
  height: 1px;
  background: var(--gold);
  margin-top: 11px;
}

.about-signature {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.8vw, 34px);
  font-weight: 300;
  font-style: italic;
  color: var(--gold);
  padding-top: 32px;
  border-top: 1px solid var(--graphite);
}

/* ══════════════════════════════════════════════
   3. PAIN POINTS
══════════════════════════════════════════════ */
#pain-points {
  padding: var(--pad-section) 0;
  background: var(--black);
}

.pain-header {
  max-width: 720px;
  margin-bottom: 56px;
}

.pain-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.5vw, 60px);
  font-weight: 300;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 28px;
}
.pain-title em {
  font-style: italic;
  color: var(--gold);
}

.pain-intro {
  font-size: 16px;
  font-weight: 300;
  color: rgba(255,255,255,0.5);
  line-height: 1.8;
  margin-bottom: 16px;
}

.pain-subtitle {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.65);
  margin-bottom: 32px;
}

.pain-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--graphite);
  border: 1px solid var(--graphite);
  margin-bottom: 48px;
}

.pain-card {
  background: var(--dark);
  padding: 40px;
  position: relative;
  transition: background var(--transition);
}
.pain-card:hover { background: var(--graphite); }

.pain-card-quote {
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 300;
  color: var(--gold);
  line-height: 0.8;
  opacity: 0.4;
  margin-bottom: 12px;
}

.pain-card p {
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.8vw, 22px);
  font-weight: 300;
  font-style: italic;
  color: rgba(255,255,255,0.85);
  line-height: 1.45;
}

.pain-result {
  padding-top: 40px;
  border-top: 1px solid var(--graphite);
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 300;
  font-style: italic;
  color: rgba(255,255,255,0.5);
}

/* ══════════════════════════════════════════════
   4. SOLUTIONS
══════════════════════════════════════════════ */
#solutions {
  padding: var(--pad-section) 0;
  background: var(--dark);
}

.solutions-header {
  max-width: 640px;
  margin-bottom: 64px;
}

.solutions-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.5vw, 60px);
  font-weight: 300;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 20px;
}
.solutions-title em {
  font-style: italic;
  color: var(--gold);
}

.solutions-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.45);
  line-height: 1.75;
}

.solutions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--graphite);
  border: 1px solid var(--graphite);
  margin-bottom: 56px;
}
/* 5 items in 3-col: stretch last item across remaining 2 cols (desktop only) */
@media (min-width: 1081px) {
  .solutions-grid .solution-card:nth-child(5):last-child {
    grid-column: 2 / 4;
  }
}

.solution-card {
  background: var(--dark);
  padding: 40px;
  transition: background var(--transition);
}
.solution-card:hover { background: var(--graphite); }

.solution-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 24px;
  color: var(--gold);
  opacity: 0.8;
}
.solution-icon svg {
  width: 100%;
  height: 100%;
}

.solution-name {
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 400;
  color: var(--white);
  margin-bottom: 12px;
  line-height: 1.3;
}

.solution-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.solutions-bottom {
  padding-top: 40px;
  border-top: 1px solid var(--graphite);
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 300;
  font-style: italic;
  color: rgba(255,255,255,0.7);
}

/* ══════════════════════════════════════════════
   5. PROCESS
══════════════════════════════════════════════ */
#process {
  padding: var(--pad-section) 0;
  background: var(--black);
  position: relative;
}

.process-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 80px;
}

.process-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.5vw, 60px);
  font-weight: 300;
  line-height: 1.1;
  color: var(--white);
}

.process-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.45);
  line-height: 1.75;
}

.process-steps {
  position: relative;
}

.process-steps::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--graphite);
}

.steps-grid-7 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

/* Last row: 3 items span evenly across 4 columns */
.steps-grid-7 .step:nth-child(5) {
  grid-column: 1 / 2;
}
.steps-grid-7 .step:nth-child(6) {
  grid-column: 2 / 3;
}
.steps-grid-7 .step:nth-child(7) {
  grid-column: 3 / 5;
}

.step {
  padding: 48px 32px 40px;
  border-right: 1px solid var(--graphite);
  position: relative;
  transition: background var(--transition);
  min-width: 0;
}
.step:last-child { border-right: none; }
.step:hover { background: rgba(198,168,122,0.03); }

.step-num {
  font-family: var(--font-serif);
  font-size: clamp(36px, 3.5vw, 52px);
  font-weight: 300;
  color: var(--gold);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 28px;
}

.step-name {
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 400;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 16px;
}

.step-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* ══════════════════════════════════════════════
   6. RESULTS
══════════════════════════════════════════════ */
#results {
  padding: var(--pad-section) 0;
  background: var(--dark);
}

.results-header {
  max-width: 640px;
  margin-bottom: 56px;
}

.results-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.5vw, 60px);
  font-weight: 300;
  line-height: 1.1;
  color: var(--white);
}
.results-title em {
  font-style: italic;
  color: var(--gold);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--graphite);
}

.result-item {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 32px 40px 32px 0;
  border-bottom: 1px solid var(--graphite);
}
.result-item:nth-child(even) {
  padding-left: 40px;
  border-left: 1px solid var(--graphite);
}

.result-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 8px;
  flex-shrink: 0;
}

.result-item p {
  font-size: 16px;
  color: rgba(255,255,255,0.75);
  line-height: 1.55;
}

/* ══════════════════════════════════════════════
   7. PORTFOLIO
══════════════════════════════════════════════ */
#portfolio {
  padding: var(--pad-section) 0;
  background: var(--black);
}

.portfolio-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 56px;
  gap: 40px;
}

.portfolio-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.5vw, 60px);
  font-weight: 300;
  line-height: 1.1;
  color: var(--white);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--graphite);
  border: 1px solid var(--graphite);
}

.project-card {
  background: var(--dark);
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/5;
}

.project-card.tall {
  grid-row: span 2;
  aspect-ratio: auto;
}

.project-img {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: var(--graphite);
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 700ms var(--ease), filter 700ms var(--ease);
  filter: brightness(0.78) saturate(0.9);
}

.project-card:hover .project-img img {
  transform: scale(1.05);
  filter: brightness(0.6) saturate(0.85);
}

.project-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px;
  background: linear-gradient(to top, rgba(14,14,14,0.95) 0%, transparent 100%);
  transform: translateY(100%);
  transition: transform 400ms var(--ease);
}

.project-card:hover .project-overlay { transform: translateY(0); }

.project-type {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.project-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 6px;
}
.project-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.portfolio-cta {
  margin-top: 56px;
  text-align: center;
}

/* ══════════════════════════════════════════════
   8. CONSULTATION FORM
══════════════════════════════════════════════ */
#consultation {
  padding: var(--pad-section) 0;
  background: var(--dark);
  border-top: 1px solid var(--graphite);
  border-bottom: 1px solid var(--graphite);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.form-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 300;
  line-height: 1.12;
  color: var(--white);
  margin-bottom: 24px;
}

.form-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.72);
  line-height: 1.75;
  margin-bottom: 48px;
}

.form-contacts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.78);
  transition: color var(--transition);
}
.form-contact-link:hover { color: var(--gold); }
.form-contact-link svg { flex-shrink: 0; }

/* Form right */
.form-right form {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--graphite);
  border: 1px solid var(--graphite);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--graphite);
}

.form-field {
  background: var(--dark);
  display: flex;
  flex-direction: column;
}

.form-field label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  padding: 20px 24px 0;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--white);
  padding: 8px 24px 20px;
  transition: background var(--transition);
}

.form-field select {
  appearance: none;
  cursor: pointer;
}
.form-field select option {
  background: var(--dark);
  color: var(--white);
}

/* ── Custom Select ── */
.cs-wrapper {
  position: relative;
}

.cs-wrapper select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 24px 20px;
  cursor: pointer;
  user-select: none;
}

.cs-value {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
  transition: color var(--transition);
}
.cs-value.has-value { color: var(--white); }

.cs-arrow {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform var(--transition), color var(--transition);
}
.cs-wrapper.open .cs-arrow {
  transform: rotate(180deg);
  color: var(--gold);
}

.cs-dropdown {
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  background: var(--dark);
  border: 1px solid var(--mid);
  border-top: 1px solid var(--gold);
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.cs-dropdown::-webkit-scrollbar { width: 3px; }
.cs-dropdown::-webkit-scrollbar-track { background: var(--dark); }
.cs-dropdown::-webkit-scrollbar-thumb { background: var(--graphite); }

.cs-wrapper.open .cs-dropdown { display: block; }

.cs-dropdown li {
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-bottom: 1px solid var(--graphite);
}
.cs-dropdown li:last-child { border-bottom: none; }
.cs-dropdown li:hover {
  background: var(--graphite);
  color: var(--white);
}
.cs-dropdown li.cs-selected {
  color: var(--gold);
  background: rgba(198,168,122,0.06);
}

.form-field textarea {
  resize: none;
  min-height: 100px;
  line-height: 1.6;
}

.form-field:focus-within {
  background: rgba(198,168,122,0.04);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: rgba(255,255,255,0.45);
}

.phone-wrapper {
  display: flex;
  align-items: stretch;
  padding: 0 24px 20px;
  gap: 0;
}
.phone-prefix {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  color: rgba(255,255,255,0.85);
  padding-top: 8px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  user-select: none;
}
.phone-wrapper input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--white);
  padding: 8px 0 0 6px;
  letter-spacing: 0.04em;
}
.phone-wrapper input::placeholder { color: rgba(255,255,255,0.45); }

.currency-wrapper {
  display: flex;
  align-items: baseline;
  padding: 0 24px 20px;
  gap: 10px;
}
.currency-wrapper input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--white);
  padding: 8px 0 0;
}
.currency-wrapper input::placeholder { color: rgba(255,255,255,0.45); }
.currency-suffix {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.6);
  flex-shrink: 0;
  user-select: none;
  letter-spacing: 0.02em;
}

.form-submit {
  background: var(--dark);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.form-submit .btn { min-width: 220px; justify-content: center; }

.form-privacy {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════
   9. CONTACTS
══════════════════════════════════════════════ */
#contacts {
  padding: var(--pad-section) 0;
  background: var(--black);
}

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contacts-right {
  position: sticky;
  top: 120px;
}

.contacts-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.5vw, 60px);
  font-weight: 300;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 48px;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--graphite);
}

.contact-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--graphite);
  align-items: start;
}

.contact-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}

.contact-value {
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
}

.contact-value a {
  transition: color var(--transition);
}
.contact-value a:hover { color: var(--gold); }

.contacts-map {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--graphite);
  border: 1px solid var(--mid);
  position: relative;
  overflow: hidden;
}

.contacts-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}


/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
footer {
  background: var(--dark);
  border-top: 1px solid var(--graphite);
  padding: 24px 0 20px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--graphite);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--white);
  flex-shrink: 0;
  transition: color var(--transition);
}
.footer-logo span { color: var(--gold); }
.footer-logo:hover { color: var(--gold); }

.footer-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  transition: color var(--transition);
}
.footer-nav a:hover { color: var(--gold); }

.footer-social {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.footer-social a {
  width: 30px;
  height: 30px;
  border: 1px solid var(--graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: border-color var(--transition), color var(--transition);
}
.footer-social a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-copy {
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.06em;
}

.footer-policy {
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  transition: color var(--transition);
}
.footer-policy:hover { color: var(--muted); }

/* ══════════════════════════════════════════════
   SCROLL REVEAL ANIMATIONS
══════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 220ms; }
.reveal-delay-3 { transition-delay: 340ms; }
.reveal-delay-4 { transition-delay: 460ms; }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */

@supports (min-height: 100svh) {
  #hero { min-height: 100svh; }
}

/* ── Tablet landscape: 1080px ── */
@media (max-width: 1080px) {
  /* --- Navigation: switch to hamburger --- */
  .hamburger { display: flex; }
  .hamburger span {
    background: var(--warm);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  }
  .nav-links, .nav-cta { display: none; }

  .scroll-hint { display: none; }

  .steps-grid-7 { grid-template-columns: repeat(4, 1fr); }

  .solutions-grid { grid-template-columns: 1fr 1fr; }
  .solutions-grid .solution-card:nth-child(5):last-child { grid-column: 1 / -1; }

  .pain-cards { grid-template-columns: 1fr 1fr; }

  /* --- Hero --- */
  #hero { min-height: auto; padding-bottom: 0; flex-direction: column; align-items: stretch; }
  .hero-content { padding-top: 100px; padding-bottom: 48px; }
  .hero-stats { position: relative; padding: 24px 0; }
  .hero-stats .container { flex-wrap: wrap; }
  .stat-item { flex: 1 1 45%; padding: 16px 24px; border-right: 1px solid var(--graphite); border-bottom: 1px solid var(--graphite); }
  .stat-item.stat-wide { flex: 1 1 45%; }
  .stat-item:nth-child(1),
  .stat-item:nth-child(3) { padding-left: 0; }
  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(4) { border-right: none; }
  .stat-item:nth-child(3),
  .stat-item:nth-child(4) { border-bottom: none; }
  .stat-number { font-size: 32px; }
  .stat-number.stat-text { font-size: 26px; }
  .stat-number.stat-number--tight { font-size: 28px; }
  .hero-sub { margin-bottom: 32px; }
  .hero-title { font-size: clamp(36px, 10vw, 56px); }
}

/* ── Tablet: 860px ── */
@media (max-width: 860px) {
  /* --- Common grids --- */
  .about-layout { grid-template-columns: 1fr; gap: 24px; }
  .about-left { position: static; }
  .about-heading { margin-bottom: 16px; }
  .about-line-gold { display: none; }
  .process-header,
  .form-grid,
  .contacts-grid { grid-template-columns: 1fr; gap: 48px; }
  .contacts-right { position: static; }

  /* --- Process steps: 2 col --- */
  .steps-grid-7 {
    grid-template-columns: 1fr 1fr;
  }
  .steps-grid-7 .step:nth-child(5),
  .steps-grid-7 .step:nth-child(6),
  .steps-grid-7 .step:nth-child(7) {
    grid-column: auto;
  }
  .step { border-right: 1px solid var(--graphite); }
  .steps-grid-7 .step:nth-child(even) { border-right: none; }
  .steps-grid-7 .step:last-child { border-right: none; }

  /* --- Pain cards: 2 col stays --- */
  .pain-cards { grid-template-columns: 1fr 1fr; }

  /* --- Solutions: 1 col --- */
  .solutions-grid { grid-template-columns: 1fr; }

  /* --- Results: 1 col --- */
  .results-grid { grid-template-columns: 1fr; }
  .result-item:nth-child(even) {
    padding-left: 0;
    border-left: none;
  }

  /* --- Portfolio: 2 col --- */
  .portfolio-grid { grid-template-columns: 1fr 1fr; }
  .project-card.tall { grid-row: span 1; aspect-ratio: 4/5; }
  .portfolio-grid .project-card:nth-child(5):last-child { grid-column: 1 / -1; aspect-ratio: 16/9; }

  /* --- Form --- */
  .form-row { grid-template-columns: 1fr; }
  .form-submit { flex-direction: column; align-items: stretch; gap: 16px; }
  .form-submit .btn { width: 100%; justify-content: center; }

  /* --- Contacts --- */
  .contact-row { grid-template-columns: 80px 1fr; gap: 16px; }

  /* --- Footer --- */
  .footer-nav { gap: 16px; }
}

/* ── Large mobile: 640px ── */
@media (max-width: 640px) {
  :root {
    --pad-section: clamp(56px, 12vw, 80px);
  }

  /* --- Hero mobile --- */
  .hero-title { font-size: clamp(36px, 9vw, 52px); }
  .hero-label { margin-bottom: 24px; font-size: 10px; }
  .hero-actions { gap: 12px; }
  .hero-actions .btn { flex: 1 1 auto; text-align: center; justify-content: center; }
  .hero-stats .container { flex-direction: column; flex-wrap: nowrap; gap: 12px; }
  .stat-item { flex: 1 1 100%; border-right: none; padding: 0 0 10px; border-bottom: 1px solid var(--graphite); }
  .stat-item:last-child { border-bottom: none; padding-bottom: 0; }
  .stat-number { font-size: 28px; }
  .stat-number.stat-number--tight { font-size: 25px; }

  /* --- Pain cards: 1 col --- */
  .pain-cards { grid-template-columns: 1fr; }
  .pain-card { padding: 28px 24px; }

  /* --- Portfolio --- */
  .portfolio-header { flex-direction: column; align-items: flex-start; gap: 24px; }

  /* --- Form --- */
  .form-title { font-size: clamp(28px, 7vw, 40px); }

  /* --- Contacts --- */
  .contact-row { grid-template-columns: 1fr; gap: 4px; padding: 20px 0; }
  .contact-label { padding-bottom: 4px; }

  /* --- Footer --- */
  .footer-row { gap: 16px; }
  .footer-nav { gap: 14px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── Small mobile: 480px ── */
@media (max-width: 480px) {
  /* --- Steps: 1 col --- */
  .steps-grid-7 { grid-template-columns: 1fr; }
  .steps-grid-7 .step:nth-child(5),
  .steps-grid-7 .step:nth-child(6),
  .steps-grid-7 .step:nth-child(7) {
    grid-column: auto;
  }
  .step {
    border-right: none;
    border-bottom: 1px solid var(--graphite);
    padding: 32px 24px;
  }
  .step:last-child { border-bottom: none; }

  /* --- Portfolio: 1 col --- */
  .portfolio-grid { grid-template-columns: 1fr; }
  .project-card { aspect-ratio: 16/9; }
  .project-overlay { transform: translateY(0); }

  /* --- Buttons full width in hero --- */
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  /* --- Nav logo size --- */
  .nav-logo { font-size: 20px; }

  /* --- Form --- */
  .form-field input,
  .form-field select,
  .form-field textarea { font-size: 16px; }
  .form-field label { padding: 16px 16px 0; }
  .form-field input,
  .form-field select,
  .form-field textarea { padding: 8px 16px 16px; }
  .phone-wrapper { padding: 0 16px 16px; }
  .phone-wrapper input { padding: 8px 0 0 6px; }
  .currency-wrapper { padding: 0 16px 16px; }
  .currency-wrapper input { padding: 8px 0 0; }

  /* --- Scroll to top --- */
  .scroll-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
  .cs-trigger { padding: 8px 16px 16px; }
  .cs-dropdown li { padding: 12px 16px; }
  .form-submit { padding: 16px; }
}

/* ── Very small phones: 380px ── */
@media (max-width: 380px) {
  :root { --pad-x: 16px; }

  .hero-title { font-size: clamp(30px, 9vw, 38px); }
  .hero-sub { font-size: 14px; }
  .stat-number { font-size: 24px; }
  .stat-number.stat-number--tight { font-size: 21px; }

  .btn { padding: 13px 24px; font-size: 13px; }

  .about-heading { font-size: clamp(28px, 8vw, 38px); }
  .pain-title,
  .solutions-title,
  .results-title,
  .form-title,
  .contacts-title,
  .process-title,
  .portfolio-title { font-size: clamp(28px, 8vw, 36px); }

  .mobile-menu a { font-size: 26px; gap: 28px; }
}

/* ══════════════════════════════════════════════
   PAGE: GALLERY
══════════════════════════════════════════════ */
body.page-gallery {
  background: var(--black);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.page-gallery main {
  flex: 1 0 auto;
  width: 100%;
}

body.page-gallery footer {
  flex-shrink: 0;
  width: 100%;
}

body.page-gallery #navbar {
  background: rgba(14, 14, 14, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--graphite);
}

.nav-links a[aria-current="page"] {
  color: var(--white);
}

.gallery-page-hero {
  padding: calc(72px + clamp(40px, 8vw, 88px)) 0 clamp(32px, 5vw, 56px);
  border-bottom: 1px solid var(--graphite);
}

.gallery-page-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--white);
  margin: 12px 0 20px;
  line-height: 1.15;
}

.gallery-page-lead {
  max-width: 52rem;
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 28px;
}

.gallery-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
}

.gallery-page-grid-wrap {
  padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 10vw, 120px);
}

.gallery-root {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 6vw, 64px);
}

/* Контент галереи вставляется из JS: без scroll-reveal — иначе при opacity:0 до .visible блок «пустой» */
.gallery-root .reveal {
  opacity: 1;
  transform: none;
}

.gallery-filters-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gallery-filters-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.gallery-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.gallery-filter-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition),
    opacity var(--transition);
}

.gallery-filter-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.gallery-filter-btn[aria-checked='true'] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--black);
  opacity: 1;
}

.gallery-filter-btn[aria-checked='true']:hover {
  background: transparent;
  color: var(--gold);
}

.gallery-filter-btn[aria-checked='false'] {
  opacity: 0.5;
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.42);
}

.gallery-filter-btn[aria-checked='false']:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.78);
}

.gallery-filter-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.gallery-filter-empty {
  margin: 0;
  padding: 32px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px;
  line-height: 1.55;
  border: 1px solid var(--graphite);
  grid-column: 1 / -1;
}

.gallery-inline-code,
.gallery-load-error__code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  color: var(--gold);
  opacity: 0.95;
}

.gallery-load-error {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--graphite);
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  font-size: 15px;
}

.gallery-load-error__code {
  white-space: normal;
  word-break: break-all;
}

/* Галерея: плотная сетка без промежутков между ячейками */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  grid-auto-rows: 42px;
  grid-auto-flow: dense;
  gap: 3px;
  background: var(--black);
  align-items: stretch;
}

.gallery-tile {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: var(--dark);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  grid-row: span 6;
  min-height: 0;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.gallery-tile:nth-child(8n + 1) { grid-row: span 8; }
.gallery-tile:nth-child(8n + 2) { grid-row: span 5; }
.gallery-tile:nth-child(8n + 3) { grid-row: span 7; }
.gallery-tile:nth-child(8n + 4) { grid-row: span 6; }
.gallery-tile:nth-child(8n + 5) { grid-row: span 9; }
.gallery-tile:nth-child(8n + 6) { grid-row: span 5; }
.gallery-tile:nth-child(8n + 7) { grid-row: span 7; }
.gallery-tile:nth-child(8n + 8) { grid-row: span 6; }

.gallery-tile:hover {
  box-shadow: inset 0 0 0 1px rgba(198, 168, 122, 0.35);
}

.gallery-tile:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--gold);
}

.gallery-tile__inner {
  position: relative;
  display: block;
  height: 100%;
  min-height: 200px;
  overflow: hidden;
  background: var(--graphite);
}

.gallery-tile:hover .gallery-tile__inner img {
  transform: scale(1.05);
  filter: brightness(0.6) saturate(0.85);
}

.gallery-tile__inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 700ms var(--ease), filter 700ms var(--ease);
  filter: brightness(0.78) saturate(0.9);
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 38px;
    gap: 3px;
  }

  .gallery-tile,
  .gallery-tile:nth-child(8n + 1),
  .gallery-tile:nth-child(8n + 2),
  .gallery-tile:nth-child(8n + 3),
  .gallery-tile:nth-child(8n + 4),
  .gallery-tile:nth-child(8n + 5),
  .gallery-tile:nth-child(8n + 6),
  .gallery-tile:nth-child(8n + 7),
  .gallery-tile:nth-child(8n + 8) {
    grid-row: span 7;
  }

  .gallery-tile__inner {
    min-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-tile__inner img {
    transition: none;
  }

  .gallery-tile:hover .gallery-tile__inner img {
    transform: none;
    filter: brightness(0.78) saturate(0.9);
  }
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox__figure {
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.gallery-lightbox__img {
  max-width: 100%;
  max-height: min(78vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--graphite);
}

.gallery-lightbox__text {
  text-align: center;
  max-width: 42rem;
}

.gallery-lightbox__title {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 28px);
  color: var(--white);
  margin-bottom: 6px;
}

.gallery-lightbox__caption {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}

.gallery-lightbox__caption:empty {
  display: none;
}

.gallery-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--graphite);
  background: rgba(14, 14, 14, 0.6);
  color: var(--warm);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.gallery-lightbox__close:hover {
  color: var(--gold);
  border-color: rgba(201, 169, 98, 0.5);
}

.gallery-lightbox__prev,
.gallery-lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 1px solid var(--graphite);
  background: rgba(14, 14, 14, 0.55);
  color: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.gallery-lightbox__prev:hover,
.gallery-lightbox__next:hover {
  color: var(--gold);
  border-color: rgba(201, 169, 98, 0.45);
}

.gallery-lightbox__prev { left: clamp(12px, 3vw, 28px); }
.gallery-lightbox__next { right: clamp(12px, 3vw, 28px); }

@media (max-width: 640px) {
  .gallery-lightbox__prev,
  .gallery-lightbox__next {
    top: auto;
    bottom: 24px;
    transform: none;
  }
  .gallery-lightbox__prev { left: 16px; }
  .gallery-lightbox__next { right: 16px; }
}

