/* ========================================
   Rinat Baibekov — Official Website
   Clean · Refined · Elegant
   ======================================== */

:root {
  --bg: #0c0c0c;
  --bg-elevated: #141414;
  --bg-soft: #1a1a1a;
  --text: #f5f0e8;
  --text-muted: #a89f91;
  --accent: #c9a66b;
  --accent-soft: rgba(201, 166, 107, 0.15);
  --border: rgba(201, 166, 107, 0.2);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}

.nav.scrolled {
  background: rgba(12, 12, 12, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  transition: color 0.3s;
}

.logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--nav-height) 2rem 4rem;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(201, 166, 107, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(201, 166, 107, 0.05) 0%, transparent 45%),
    var(--bg);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, var(--bg));
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 780px;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

.hero-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-style: italic;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2.75rem;
}

.btn {
  display: inline-block;
  padding: 1rem 2.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: all 0.35s var(--ease);
}

.btn:hover {
  background: transparent;
  color: var(--accent);
}

.btn-full {
  width: 100%;
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-indicator span {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* Fade-up animation */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  animation: fadeUp 0.9s var(--ease) forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }

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

/* ---------- Sections ---------- */
.section {
  padding: 7rem 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.section-title.center {
  text-align: center;
}

.divider {
  width: 48px;
  height: 1px;
  background: var(--accent);
  margin-bottom: 2.5rem;
}

.divider.center {
  margin-left: auto;
  margin-right: auto;
}

.section-intro {
  text-align: center;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 3.5rem;
  font-size: 0.95rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 4rem;
  align-items: start;
}

.about-text .lead {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.35rem;
}

.about-text blockquote {
  margin: 2.5rem 0 0;
  padding: 1.5rem 0 1.5rem 1.5rem;
  border-left: 2px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.55;
}

.about-visual {
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
}

.portrait-frame {
  aspect-ratio: 3/4;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(10%);
  transition: transform 0.6s var(--ease), filter 0.4s;
}

.portrait-frame:hover .portrait-img {
  transform: scale(1.03);
  filter: grayscale(0%);
}

.caption {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* ---------- Gallery ---------- */
.gallery-section {
  background: var(--bg-elevated);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: var(--bg);
  aspect-ratio: 4/5;
  border: 1px solid transparent;
  transition: border-color 0.4s, transform 0.5s var(--ease);
}

.gallery-item:hover {
  border-color: var(--border);
  transform: translateY(-4px);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.5s;
}

.gallery-item:hover img {
  transform: scale(1.04);
  filter: brightness(0.85);
}

.gallery-item figcaption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.gallery-item:hover figcaption {
  opacity: 1;
}

.gallery-item h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.gallery-item span {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.gallery-note {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  text-align: center;
  transform: scale(0.96);
  transition: transform 0.4s var(--ease);
}

.lightbox.open .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  max-height: 72vh;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto 1.25rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-info h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.lightbox-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.25s, color 0.25s;
  z-index: 10;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
  color: var(--accent);
}

.lightbox-close {
  top: 1.5rem;
  right: 1.75rem;
  font-size: 2.5rem;
}

.lightbox-prev {
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.lightbox-next {
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

/* ---------- Exhibitions ---------- */
.exhibitions-list {
  max-width: 700px;
  margin: 0 auto;
}

.exhibition-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.exhibition-item:first-child {
  border-top: 1px solid var(--border);
}

.exhibition-item .year {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
}

.exhibition-item h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.exhibition-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Contact ---------- */
.contact {
  background: var(--bg-elevated);
}

.contact-form {
  max-width: 560px;
  margin: 0 auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 300;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

.form-note {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ---------- Footer ---------- */
.footer {
  padding: 3.5rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 1.5rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-visual {
    position: static;
    max-width: 320px;
    margin: 0 auto;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(12, 12, 12, 0.98);
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.4s var(--ease), opacity 0.4s;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .exhibition-item {
    grid-template-columns: 80px 1fr;
  }

  .section {
    padding: 5rem 0;
  }
}

@media (max-width: 500px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 2.2rem;
  }
}
