/* ══════════════════════════════════════════
   VARIABLES & RESET
══════════════════════════════════════════ */
:root {
  --paper:  #FAF8F5;
  --ink:    #1A1A1A;
  --stone:  #6B6660;
  --line:   #E5E0D8;
  --accent: #A0492C;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

section[id] { scroll-margin-top: 2rem; }


/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
#hero {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 3rem 2rem 5rem;
  overflow-x: clip; /* clips horizontal bleed without trapping fixed children */
}

/* ══════════════════════════════════════════
   STICKY HEADER
══════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 3.25rem;
  transition: background 0.35s ease;
}

.site-header.scrolled {
  background: var(--paper);
}

/* Brand — appears once the hero scrolls away */
.header-brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.site-header.scrolled .header-brand {
  opacity: 1;
  pointer-events: auto;
}

/* Nav — always visible, always interactive */
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.8125rem;
  color: var(--stone);
  letter-spacing: 0.04em;
}

.header-nav a          { color: var(--stone); }
.header-nav a:hover    { color: var(--ink); }
.header-nav .lang-toggle { margin-left: 0; }

/* Hero content */
.hero-content {
  display: flex;
  flex-direction: column;
}

/* ── Animated name ── */
.hero-name {
  position: relative;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: clamp(3.75rem, 14vw, 13rem);
  line-height: 0.9;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.name-sizer {
  display: block;
  visibility: hidden;
  user-select: none;
  pointer-events: none;
}

.name-layer {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: cover;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

.name-layer.active { opacity: 1; }

.n0 { background-image: url('works/kazan-mother-of-god.jpg'); background-position: 50% 25%; }
.n1 { background-image: url('works/saint-nicholas.jpg');      background-position: 50% 20%; }
.n2 { background-image: url('works/prayer.jpg');              background-position: 50% 35%; }
.n3 { background-image: url('works/brave-horse.jpg');         background-position: 50% 40%; }
.n4 { background-image: url('works/jellyfish.jpg');           background-position: 50% 50%; }
.n5 { background-image: url('works/lime.jpg');                background-position: 50% 50%; }

/* Hero subtitle */
.hero-subtitle {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.125rem, 2.5vw, 1.625rem);
  color: var(--stone);
  margin-top: 1.25rem;
}



/* ══════════════════════════════════════════
   LANGUAGE TOGGLE
══════════════════════════════════════════ */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
}

.lang-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.6875rem;
  color: var(--stone);
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: color 0.2s;
  line-height: 1;
}
.lang-btn.active { color: var(--ink); font-weight: 500; }
.lang-btn:hover  { color: var(--ink); }

.lang-sep {
  color: var(--line);
  font-size: 0.6875rem;
  line-height: 1;
}

/* In desktop nav, toggle doesn't need auto-margin */
.nav-desktop .lang-toggle { margin-left: 0; }


/* ══════════════════════════════════════════
   WORK SECTION
══════════════════════════════════════════ */
#work {
  padding: 3.5rem 2rem 8rem;
  border-top: 1px solid var(--line);
}

.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: 1;
  color: var(--ink);
  margin-bottom: 2.5rem;
}

/* Material note */
.work-note {
  font-size: 0.875rem;
  color: var(--stone);
  margin-top: -1rem;
  margin-bottom: 2.5rem;
  max-width: 640px;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 3rem;
}

.filter-btn {
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0.125rem 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  color: var(--stone);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.filter-btn:hover         { color: var(--ink); }
.filter-btn.active        { color: var(--ink); border-bottom-color: var(--accent); }
.filter-btn--sale         { color: var(--accent); }
.filter-btn--sale.active  { border-bottom-color: var(--accent); }

/* Masonry */
.masonry {
  column-count: 3;
  column-gap: 1.5rem;
}

/* Gallery items */
.gallery-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  animation: fadeUp 0.5s ease both;
}

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

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.03); }

/* Status badges on gallery items */
.status-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  pointer-events: none;
  z-index: 2;
}
.status-badge.sold    { background: rgba(160,73,44,0.88); color: #fff; }
.status-badge.donated { background: rgba(80,76,72,0.80);  color: #fff; }

.item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 55%, rgba(0,0,0,0.28));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover .item-overlay { opacity: 1; }

.item-title {
  display: block;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
}
.item-dims {
  display: block;
  color: rgba(255,255,255,0.65);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}


/* ══════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════ */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26,26,26,0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
#lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lb-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 0.8125rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s;
}
.lb-close:hover { color: #fff; }

.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 1rem;
  transition: color 0.2s;
  user-select: none;
  z-index: 1;
}
.lb-prev:hover, .lb-next:hover { color: #fff; }
.lb-prev { left: 0; }
.lb-next { right: 0; }

.lb-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 960px;
}

/* Image wrapper — no overflow hidden, let object-fit do the work */
.lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image constrained so tall icons show in full */
#lb-img {
  max-width: 82vw;
  max-height: 58vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.15s ease;
}
#lb-img.loading { opacity: 0; }

.lb-info {
  text-align: center;
  max-width: 560px;
  padding: 0 1rem;
}

.lb-info h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 0.3rem;
}
.lb-dims {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.6rem;
}
.lb-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}
.lb-status {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.75rem;
}
.lb-enquire {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 1.4rem;
  margin-bottom: 0.75rem;
  transition: background 0.2s;
}
.lb-enquire:hover { background: #8a3c24; }
.lb-counter {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.08em;
}


/* ══════════════════════════════════════════
   ABOUT
══════════════════════════════════════════ */
#about {
  padding: 5rem 2rem 7rem;
  border-top: 1px solid var(--line);
}

.section-label {
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 3rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
}

.about-photo img {
  width: 100%;
  height: auto;
}

.bio {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: var(--ink);
  font-size: 0.9375rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.exhibitions h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.exhibitions ul { display: flex; flex-direction: column; gap: 1rem; }

.exhibitions li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9375rem;
}

.ex-year {
  font-size: 0.75rem;
  color: var(--stone);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}


/* ══════════════════════════════════════════
   CONTACT
══════════════════════════════════════════ */
#contact {
  padding: 5rem 2rem 7rem;
  border-top: 1px solid var(--line);
}

.contact-image {
  width: 240px;
  margin: 0 auto 2rem;
}

.contact-image img {
  width: 100%;
  height: auto;
  display: block;
}

.contact-inner {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.contact-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: var(--ink);
  margin-bottom: 1rem;
}

.contact-sub {
  font-size: 0.9375rem;
  color: var(--stone);
  margin-bottom: 2.5rem;
  line-height: 1.65;
}

.btn-contact {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 2.5rem;
  transition: background 0.2s ease;
}
.btn-contact:hover { background: #8a3c24; }


/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--line);
  padding: 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--stone);
}


/* ══════════════════════════════════════════
   SCROLL REVEAL
══════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (min-width: 640px) {
  #hero          { padding: 3.5rem 3.5rem 6rem; }
  #work          { padding: 3.5rem 3.5rem 9rem; }
  #about         { padding: 6rem 3.5rem 8rem; }
  #contact       { padding: 6rem 3.5rem 8rem; }
  footer         { padding: 2.5rem 3.5rem; }
  .site-header   { padding: 0 3.5rem; }
  .masonry       { column-count: 2; }
}

@media (min-width: 1024px) {
  #hero          { padding: 4rem 5rem 7rem; }
  #work          { padding: 4rem 5rem 10rem; }
  #about         { padding: 7rem 5rem 9rem; }
  #contact       { padding: 7rem 5rem 9rem; }
  footer         { padding: 2.5rem 5rem; }

  .site-header   { padding: 0 5rem; }
  .header-nav    { gap: 2rem; }

  .masonry       { column-count: 3; }

  /* Lightbox: side-by-side on desktop */
  .lb-inner {
    flex-direction: row;
    align-items: flex-start;
    gap: 2.5rem;
    max-height: 85vh;
  }
  .lb-img-wrap { flex-shrink: 0; }
  #lb-img {
    max-width: 55vw;
    max-height: 80vh;
  }
  .lb-info {
    text-align: left;
    max-width: 220px;
    padding: 0;
    align-self: flex-start;
    flex-shrink: 0;
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: start;
  }
}
