/* =================================================================
   MAGDA ZAUTASHVILI — "GALLERY AT DUSK"
   A warm, low-glare palette pulled from the paintings themselves —
   plaster-warm darks instead of true black, ink instead of true
   white, and a museum wall-label treatment for painting details.
   ================================================================= */

/* ===== SELF-HOSTED FONTS =====
   Loaded locally from fonts/ instead of Google Fonts, so no visitor
   IP/request ever goes to Google — keeps the "no third-party
   tracking" claim in privacy.html accurate. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/fraunces-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/fraunces-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/fraunces-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/fraunces-latin-500-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/fraunces-latin-600-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Walls — warm espresso darks, never pure black */
  --wall:      #16130f;
  --wall-2:    #1d1811;
  --wall-3:    #251f16;
  --rule:      #362e21;
  --rule-soft: #2a2418;

  /* Ink — warm bone, never pure white (kinder on the eyes at length) */
  --ink:       #e9e2d2;
  --ink-soft:  #cfc6b1;
  --ink-dim:   #9c9280;
  --ink-faint: #6f6858;

  /* Accents — sampled from Magda's own palette */
  --berry:     #a8475a;   /* deep oxblood-rose, from her figurative work */
  --berry-lt:  #c96a7d;
  --periwinkle:#8d97c7;   /* dusty blue-violet, from the iris hero piece */
  --brass:     #c6a35e;   /* muted brass — reserved for awards only */

  --font:       'Fraunces', 'Georgia', 'Times New Roman', serif;
  --font-sans:  'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:  'JetBrains Mono', 'Courier New', monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
}

/* subtle canvas grain so flat dark fields read as a wall, not a screen */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

h1, h2, h3 { font-family: var(--font); font-weight: 500; letter-spacing: 0.01em; color: var(--ink); }

::selection { background: var(--berry); color: var(--ink); }

:focus-visible {
  outline: 1.5px solid var(--periwinkle);
  outline-offset: 3px;
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 2.5rem;
  background: rgba(19, 16, 11, 0.88);
  border-bottom: 1px solid var(--rule-soft);
  backdrop-filter: blur(10px);
}

.nav-logo {
  font-family: var(--font);
  font-style: italic;
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2.1rem;
}

.nav-links a {
  font-size: 0.76rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.2s var(--ease);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  border-bottom-color: var(--berry);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: var(--wall);
  background-image: url('../images/hero.jpg');
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15,12,8,0.55) 0%, rgba(15,12,8,0.38) 45%, rgba(15,12,8,0.72) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  padding: 2rem;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.3rem;
}

.hero-content h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.08;
  margin-bottom: 1.3rem;
  color: #fbf7ee;
  text-shadow: 0 2px 24px rgba(0,0,0,0.35);
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(233, 226, 210, 0.82);
  margin-bottom: 2.3rem;
  font-family: var(--font-sans);
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 0.8rem 2.1rem;
  background: var(--berry);
  color: #fbf5ee;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--berry);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:hover { background: var(--berry-lt); border-color: var(--berry-lt); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}

.btn-outline:hover {
  background: var(--wall-3);
  border-color: var(--ink-dim);
  color: var(--ink);
}

.btn-small {
  padding: 0.55rem 1.3rem;
  font-size: 0.7rem;
}

/* ===== SECTIONS ===== */
.section {
  padding: 5.5rem 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.7rem;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--ink);
}

.center { text-align: center; }

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 9.5rem 2.5rem 3.2rem;
  text-align: center;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--wall-2);
}

.page-header h1 {
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  margin-bottom: 0.9rem;
}

.page-header p {
  color: var(--ink-dim);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ===== FEATURED GRID (home) ===== */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.6rem;
  margin-bottom: 3.2rem;
}

.featured-card .painting-img-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--wall-2);
  border: 1px solid var(--rule-soft);
}

.card-title {
  margin-top: 0.9rem;
  font-family: var(--font);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ===== STAT STRIP ===== */
.stat-strip {
  display: flex;
  justify-content: center;
  gap: 5rem;
  padding-top: 3.2rem;
  padding-bottom: 3.2rem;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  max-width: 100%;
  background: var(--wall-2);
}

.stat { text-align: center; }

.stat-number {
  display: block;
  font-family: var(--font);
  font-size: 2.9rem;
  color: var(--berry-lt);
  line-height: 1;
}

.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-top: 0.6rem;
}

/* ===== ABOUT STRIP (home) ===== */
.about-strip {
  text-align: center;
  max-width: 680px;
}

.about-strip h2 {
  font-size: 1.9rem;
  margin-bottom: 1.3rem;
  font-style: italic;
}

.about-strip p {
  color: var(--ink-soft);
  margin-bottom: 2.1rem;
  line-height: 1.9;
}

/* ===== GALLERY GRID ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2.2rem;
}

.painting-card {
  background: var(--wall-2);
  border: 1px solid var(--rule-soft);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.painting-card:hover {
  border-color: var(--rule);
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -18px rgba(0,0,0,0.6);
}

.painting-img-wrap {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--wall-3);
  position: relative;
  cursor: pointer;
}

.painting-img-wrap:focus-visible {
  outline: 2px solid var(--periwinkle);
  outline-offset: 3px;
}

.painting-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.painting-card:hover .painting-img-wrap img {
  transform: scale(1.035);
}

.painting-info {
  padding: 1.3rem 1.4rem 1.4rem;
  border-top: 1px solid var(--rule-soft);
}

.painting-info h3 {
  font-size: 1.08rem;
  font-style: italic;
  margin-bottom: 0.55rem;
}

/* museum wall-label treatment for the factual details */
.painting-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.03em;
  color: var(--ink-dim);
  margin-bottom: 0.9rem;
  text-transform: uppercase;
}

.painting-price {
  font-family: var(--font);
  font-size: 1.25rem;
  color: var(--berry-lt);
  margin-bottom: 1.1rem;
}

/* ===== SOLD GRID ===== */

.sold-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(22, 19, 15, 0.85);
  color: var(--brass);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid var(--brass);
}

.sold-card .painting-img-wrap { opacity: 0.88; }

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 8, 6, 0.94);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-height: 80vh;
  max-width: 90vw;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 2rem;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 2.3rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s var(--ease);
}

.lightbox-close:hover { color: var(--berry-lt); }

#lightbox-title {
  margin-top: 1.2rem;
  font-family: var(--font);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* ===== ABOUT PAGE ===== */
.about-page {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 5rem;
  align-items: start;
}

.about-photo-wrap {
  position: sticky;
  top: 6.5rem;
  border: 1px solid var(--rule-soft);
}

.about-photo-placeholder {
  aspect-ratio: 3/4;
  min-height: unset;
  background: var(--wall-3);
  opacity: 1;
}

.about-text p {
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  line-height: 1.9;
  max-width: 62ch;
}

.about-lead {
  font-family: var(--font);
  font-style: italic;
  font-size: 1.2rem !important;
  color: var(--ink) !important;
  max-width: 60ch;
}

.about-details {
  margin-top: 2.6rem;
  border-top: 1px solid var(--rule-soft);
  padding-top: 1.6rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
}

.about-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.about-detail-item span:last-child {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.detail-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ===== CONTACT ===== */
.contact-section {
  max-width: 600px;
}

.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }

.form-group { display: flex; flex-direction: column; gap: 0.55rem; }

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.form-group input,
.form-group textarea {
  background: var(--wall-2);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 0.9rem 1.05rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--ink-faint); }

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--periwinkle);
  background: var(--wall-3);
}

.form-note {
  font-size: 0.82rem;
  color: var(--ink-dim);
  margin-top: 0.5rem;
  line-height: 1.7;
}

.contact-success {
  text-align: center;
  padding: 4.5rem 2rem;
}

.contact-success h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-style: italic;
  color: var(--berry-lt);
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--rule-soft);
  padding: 2.8rem 2.5rem;
  text-align: center;
  background: var(--wall-2);
  color: var(--ink-dim);
  font-size: 0.83rem;
  letter-spacing: 0.03em;
  line-height: 2;
}

.footer a { color: var(--berry-lt); transition: color 0.2s var(--ease); }
.footer a:hover { color: var(--ink); }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; flex-direction: column; align-items: flex-start; position: absolute; top: 100%; left: 0; right: 0; background: var(--wall-2); padding: 1.5rem; gap: 1.2rem; border-bottom: 1px solid var(--rule-soft); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .section { padding: 3.2rem 1.5rem; }
  .page-header { padding: 7.2rem 1.5rem 2.6rem; }

  .stat-strip { gap: 2.5rem; padding: 3rem 1.5rem; flex-wrap: wrap; }

  .about-page { grid-template-columns: 1fr; gap: 2.6rem; }
  .about-photo-wrap { position: static; max-width: 320px; margin: 0 auto; }
  .about-details { grid-template-columns: 1fr; }

  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.3rem; }

  .exhibition-item { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ===== LANGUAGE TOGGLE ===== */
.lang-btn {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-dim);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
  font-family: var(--font-sans);
}

.lang-btn:hover {
  border-color: var(--periwinkle);
  color: var(--periwinkle);
}

/* ===== PROSE (privacy / long-form text) ===== */
.prose { max-width: 66ch; }

.prose h2 {
  font-family: var(--font);
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--berry-lt);
  letter-spacing: 0.01em;
  margin-top: 2.6rem;
  margin-bottom: 0.7rem;
}

.prose p,
.prose li {
  color: var(--ink-soft);
  line-height: 1.9;
  margin-bottom: 0.9rem;
}

.prose ul {
  padding-left: 1.4rem;
  margin-bottom: 0.9rem;
}

.prose li { margin-bottom: 0.4rem; }

.prose a {
  color: var(--berry-lt);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover { color: var(--ink); }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  color: var(--periwinkle);
}

/* ===== FOOTER — quiet link ===== */
.footer-quiet { margin-top: 0.5rem; }

.footer-quiet a {
  color: var(--ink-dim);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  opacity: 0.75;
  transition: opacity 0.2s var(--ease), color 0.2s var(--ease);
}

.footer-quiet a:hover {
  color: var(--periwinkle);
  opacity: 1;
}

/* ===== EXHIBITIONS ===== */
.exhibition-list {
  max-width: 800px;
  margin: 0 auto;
}

.exhibition-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.9rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--rule-soft);
}

.exhibition-item:first-child { padding-top: 0; }
.exhibition-item:last-child { border-bottom: none; }

.exhibition-year {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--berry-lt);
  line-height: 1.4;
}

.exhibition-name {
  font-size: 1.12rem;
  font-style: italic;
  margin-bottom: 0.4rem;
}

.exhibition-venue {
  font-size: 0.86rem;
  color: var(--ink-dim);
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.exhibition-prize {
  margin-top: 0.75rem;
  font-size: 0.83rem;
  color: var(--ink-soft);
}

.prize-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
  border: 1px solid var(--brass);
  padding: 3px 8px;
  margin-right: 0.7rem;
}
