:root {
  --color-bg: #f5f0eb;          /* warm cream */
  --color-bg-dark: #1a1714;     /* warm dark */
  --color-text: #2c2420;        /* warm dark brown */
  --color-text-light: #6a5e53;  /* darkened from #7a6e63 for better contrast (#18) */
  --color-accent: #b8922e;      /* ochre/gold */
  --color-border: #ddd5cb;      /* warm border */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden; /* #3 prevent horizontal text clipping */
}

/* ── Navigation (#4, #5, #17) ──────────────────────────────── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;          /* consistent vertical alignment */
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.5rem;
  padding: 1rem 2rem;           /* tightened from 2rem 3rem */
}

.nav-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--color-text);
  line-height: 1.15;
}

.nav-descriptor {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--color-text-light);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;             /* bumped from 400 for contrast (#5) */
  letter-spacing: 0.12em;       /* consistent with section labels (#17) */
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text-light);
  transition: color 0.3s;
  position: relative;
}

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

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

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

/* ── Main content (#19) ─────────────────────────────────────── */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem;         /* reduced from 2rem 3rem */
}

/* ── Hero (#6, #7, #2) ──────────────────────────────────────── */
.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 55vh;
  padding: 0 0 1.5rem;          /* dead space above removed, tight below (#6) */
}

.hero img {
  max-width: 85%;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: box-shadow 0.3s;
}

.hero img:hover {
  box-shadow: 0 12px 50px rgba(0,0,0,0.18);
}

/* ── Divider (#20) ───────────────────────────────────────────── */
.divider {
  width: 60px;
  height: 1px;
  background: var(--color-accent);
  margin: 2rem auto;
}

/* ── Gallery Grid (#8, #9) ───────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 1.5rem 0;
}

@media (max-width: 1100px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

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

.gallery-item {
  cursor: pointer;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;         /* consistent ratio across all items (#8) */
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, box-shadow 0.3s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.gallery-item:hover img {
  transform: scale(1.015);
  box-shadow: 0 8px 30px rgba(0,0,0,0.14);
}

.gallery-item .caption {
  padding: 0.8rem 0;            /* standardized (#9) */
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--color-text-light);
}

/* ── About page (#11, #12, #13) ─────────────────────────────── */
.about {
  max-width: 750px;
  margin: 0 auto;
  padding: 2rem 0;              /* reduced from 4rem (#11) */
}

.about h1 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 300;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.about .subtitle {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.about p {
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 1.2rem;        /* reduced from 1.5rem (#12) */
  color: var(--color-text);
}

.about .exhibitions {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.about .exhibitions h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 300;
  margin-bottom: 1.2rem;
  color: var(--color-text);
}

.about .exhibitions li {
  list-style: none;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  color: var(--color-text-light);
  border-bottom: 1px solid rgba(0,0,0,0.03);
}

/* ── Contact (#14, #15, #16) ────────────────────────────────── */
.contact {
  max-width: 550px;
  margin: 0 auto;
  padding: 2rem 0;              /* reduced from 4rem */
}

.contact h1 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 300;
  margin-bottom: 1rem;
}

.contact > p {
  margin-bottom: 2rem;
  color: var(--color-text-light);
  line-height: 1.8;
}

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

.contact input, .contact textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 300;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--color-border);
  background: rgba(255,255,255,0.6);
  border-radius: 2px;
  outline: none;
  transition: border-color 0.3s, background 0.3s;
  color: var(--color-text);
  width: 100%;
}

.contact input:focus, .contact textarea:focus {
  border-color: var(--color-accent);
  background: white;
}

.contact input::placeholder, .contact textarea::placeholder {
  color: #9a8e83;               /* explicit readable-but-muted placeholder (#14) */
  font-weight: 300;
}

.contact textarea { min-height: 150px; resize: vertical; }

.contact button {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 1rem 2.5rem;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  align-self: flex-start;
}

.contact button:hover {
  background: var(--color-accent);
  transform: translateY(-1px);
}

.contact .email-alt {           /* #16 direct email below form */
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
  text-align: center;
}

.contact .email-alt a {
  color: var(--color-accent);
  text-decoration: none;
}

.contact .email-alt a:hover {
  text-decoration: underline;
}

/* ── Lightbox ───────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,23,20,0.95);
  z-index: 100;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 8px 60px rgba(0,0,0,0.4);
}

.lightbox .info {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  text-align: center;
  white-space: nowrap;
}

/* ── Footer (#21) ───────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem 2rem;
  font-size: 0.75rem;
  color: var(--color-text-light);
  letter-spacing: 0.05em;
  margin-top: 3rem;
  border-top: 1px solid var(--color-border);
}

/* ── Mobile (#1, #2, #3, #15) ───────────────────────────────── */
@media (max-width: 768px) {
  /* Nav: stack vertically, name+descriptor centered, links wrap below (#1) */
  nav {
    padding: 1rem 1.2rem;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .nav-left {
    align-items: center;
  }

  .nav-name { font-size: 1.45rem; }
  .nav-descriptor { font-size: 1rem; }

  .nav-links {
    gap: 1rem 1.4rem;           /* row-gap col-gap — links wrap without clipping */
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-links a {
    font-size: 0.72rem;         /* smaller to fit all three links */
  }

  main { padding: 1rem 1.2rem; }

  /* Gallery: single column on phone */
  .gallery {

    gap: 1.5rem;
  }

  /* Hero: full width, no clip (#2) */
  .hero {
    min-height: 30vh;
    padding: 0 0 1.2rem;
  }

  .hero img {
    max-width: 100%;
    width: 100%;
    max-height: 55vh;
  }

  .about h1, .contact h1 { font-size: 2.2rem; }
  .about { padding: 1.5rem 0; }
  .contact { padding: 1.5rem 0; }

  /* Submit button full-width on mobile (#15) */
  .contact button {
    width: 100%;
    align-self: stretch;
    text-align: center;
  }

  footer { margin-top: 2rem; padding: 1.5rem 1.2rem; }
}

/* Disable hover underline animation on touch devices */
@media (hover: none) {
  .nav-links a::after { display: none; }
}

/* Nav label: full on desktop, short on mobile */
.nav-short { display: none; }
@media (max-width: 768px) {
  .nav-full { display: none; }
  .nav-short { display: inline; }
}

/* Hide page-level heading on mobile when nav already shows context */
@media (max-width: 768px) {
  .page-label { display: none; }
}

/* Homepage selected works: always 2 columns, single on mobile */
.home-gallery {
  grid-template-columns: repeat(2, 1fr) !important;
}
@media (max-width: 600px) {
  .home-gallery { grid-template-columns: 1fr !important; }
}

/* Caption collection line — block display to force second line */
.caption-collection {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-style: italic;
  color: var(--color-text-light);
  margin-top: 0.2rem;
  opacity: 0.8;
}
