/* ============================================================
   CSS Custom Properties — Theming
   ============================================================ */
:root {
  --color-bg-light: #f5f2ee;
  --color-bg-dark: #111111;
  --color-text-on-light: #1a1a1a;
  --color-text-on-dark: #f0ece6;
  --color-accent: #c8a96e;
  --color-overlay-bg: rgba(10, 10, 10, 0.95);
  --font-primary: 'Georgia', 'Times New Roman', serif;
  --font-ui: system-ui, -apple-system, sans-serif;
  --header-height: 56px;
  --transition-fast: 0.2s ease;
  --transition-medium: 0.4s ease;
  --transition-slow: 0.6s ease;
}

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

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

body {
  font-family: var(--font-primary);
  background: var(--color-bg-light);
  color: var(--color-text-on-light);
  overflow-x: hidden;
}

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

ul {
  list-style: none;
}

/* Screen-reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Fixed Header
   ============================================================ */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(245, 242, 238, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  transition: background var(--transition-fast);
}

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

.site-name {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-text-on-light);
}

/* ============================================================
   Hamburger Button (mobile only)
   ============================================================ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 4px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text-on-light);
  border-radius: 1px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   Header Nav
   ============================================================ */
.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ============================================================
   Language Switcher
   ============================================================ */
.lang-switcher {
  display: flex;
  gap: 0.25rem;
}

.lang-btn {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  color: var(--color-text-on-light);
  opacity: 0.5;
  border-radius: 3px;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

.lang-btn:hover {
  opacity: 0.8;
}

.lang-btn.active {
  opacity: 1;
  background: rgba(0,0,0,0.08);
}

/* ============================================================
   Header Nav Links
   ============================================================ */
.header-nav-link {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-on-light);
  opacity: 0.55;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  transition: opacity var(--transition-fast);
}

.header-nav-link:hover {
  opacity: 1;
}

/* ============================================================
   Section 1: Hero Gallery (stacked scroll)
   ============================================================ */
#hero {
  background: var(--color-bg-light);
  padding-top: calc(var(--header-height) + 80px);
  padding-bottom: 100px;
  position: relative;
}

/* Fixed centered title pill */
.hero-title {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 500;
  background: rgba(245, 242, 238, 0.92);
  backdrop-filter: blur(4px);
  padding: 12px 36px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  transition: opacity 0.5s ease, transform 0.5s ease;
  white-space: nowrap;
  pointer-events: none;
}

.hero-title.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-12px);
}

.hero-title h1 {
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--color-text-on-light);
}

.hero-title p {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-top: 4px;
  color: #666;
}

/* Stacked image track */
.carousel-track {
  display: flex;
  flex-direction: column;
  gap: 60px;
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
}

.carousel-item {
  width: 100%;
}

.carousel-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Broken image placeholder */
.img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 300px;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

/* ============================================================
   Section 2: Publications
   ============================================================ */
#publications {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.publications-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2.5rem;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  max-width: 1000px;
  width: 100%;
}

.publications-content.revealed {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.publications-featured-img {
  width: 35%;
  max-height: 70vh;
  height: auto;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 2px;
}

.publications-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.pub-link {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-on-dark);
  border: 1px solid rgba(240,236,230,0.35);
  padding: 1rem 2.5rem;
  border-radius: 2px;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.pub-link:hover {
  background: var(--color-accent);
  color: #111;
  border-color: var(--color-accent);
}

/* ============================================================
   Section 3: Portfolio
   ============================================================ */
#portfolio {
  background: var(--color-bg-light);
  min-height: 100vh;
  padding-top: calc(var(--header-height) + 2rem);
  padding-bottom: 4rem;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
}

.collections-list {
  border-right: 1px solid rgba(0,0,0,0.1);
  padding: 2rem 0;
  overflow-y: auto;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
}

.collection-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--color-text-on-light);
  opacity: 0.55;
  transition: opacity var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
}

.collection-item:hover {
  opacity: 0.85;
  background: rgba(0,0,0,0.03);
}

.collection-item[aria-current="true"] {
  opacity: 1;
  font-weight: 600;
  background: rgba(0,0,0,0.05);
  border-left: 2px solid var(--color-accent);
}

.collection-area {
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

.collection-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.collection-grid.active {
  display: grid;
}

.collection-empty {
  display: none;
  padding: 3rem;
  text-align: center;
  color: #999;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.collection-empty.active {
  display: block;
}

.collection-description {
  grid-column: 1 / -1;
  padding: 1rem 0 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-light);
  max-width: 70ch;
}

.portfolio-default {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
  color: #aaa;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.photo-thumb {
  cursor: pointer;
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 3/4;
  background: #ddd;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.photo-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.photo-thumb.selected {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Photo Description Panel */
.photo-description-panel {
  display: none;
  background: rgba(245,242,238,0.97);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 4px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.photo-description-panel.open {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
}

.photo-desc-img {
  width: 75%;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
}

.photo-desc-text {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--color-text-on-light);
}

.photo-desc-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #444;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.25);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.photo-desc-close:hover {
  background: #222;
  color: #fff;
  border-color: #222;
}

/* Photo Panel Navigation */
.photo-desc-nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
  width: 100%;
  margin-top: 0.5rem;
}

.photo-desc-prev,
.photo-desc-next {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 300;
  color: #555;
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.photo-desc-prev:hover,
.photo-desc-next:hover {
  background: #222;
  color: #fff;
  border-color: #222;
}

/* ============================================================
   Lightbox (desktop only)
   ============================================================ */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 2px;
  user-select: none;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 1rem;
  max-width: 70ch;
  line-height: 1.5;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
  z-index: 2001;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
  z-index: 2001;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
  color: #fff;
}

/* ============================================================
   Section 4: Biography
   ============================================================ */
#biography {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  padding: 5rem 2rem;
  display: flex;
  justify-content: center;
}

.biography-inner {
  max-width: 750px;
  width: 100%;
  text-align: center;
}

.biography-title {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  color: var(--color-text-on-dark);
  opacity: 0.9;
}

.biography-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bio-paragraph {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text-on-dark);
  opacity: 0.8;
}

.bio-heading {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
  color: var(--color-accent);
}

/* ============================================================
   Section 5: Footer / Contact
   ============================================================ */
#contact {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  padding: 4rem 2rem;
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-inner {
  max-width: 600px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-name {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.footer-email a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  opacity: 0.65;
  transition: opacity var(--transition-fast);
}

.footer-email a:hover {
  opacity: 1;
}

.footer-phones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.footer-phone {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  opacity: 0.55;
  letter-spacing: 0.03em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.footer-link {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.footer-link:hover {
  opacity: 0.9;
}

.footer-copy {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  opacity: 0.3;
  margin-top: 1rem;
}

/* ============================================================
   Responsive Layout
   ============================================================ */
@media (max-width: 768px) {
  /* Mobile hamburger menu */
  .hamburger {
    display: flex;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1rem;
    background: rgba(245, 242, 238, 0.97);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  }

  .header-nav.open {
    display: flex;
  }

  .header-nav .lang-switcher {
    gap: 0.5rem;
  }

  .header-nav .lang-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }

  .header-nav .header-nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    opacity: 0.7;
  }

  /* Publications: stack vertically on mobile */
  .publications-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .publications-featured-img {
    width: 100%;
  }

  /* Biography: tighter padding on mobile */
  #biography { padding: 3rem 1.25rem; }
  .biography-title { font-size: 1.2rem; margin-bottom: 1.75rem; }
  .bio-paragraph { font-size: 0.95rem; }

  #portfolio {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .collections-list {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    overflow: visible;
  }

  .collection-item {
    display: inline-block;
    width: auto;
    padding: 0.35rem 0.75rem;
    flex-shrink: 0;
    font-size: 0.72rem;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 20px;
    white-space: nowrap;
    text-align: center;
  }

  .collection-item[aria-current="true"] {
    background: var(--color-text-on-light);
    color: var(--color-bg-light);
    border-color: var(--color-text-on-light);
    border-left: none;
  }

  .collection-area {
    padding: 1.5rem 1rem;
  }

  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .photo-description-panel {
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1rem;
    background: transparent;
  }

  .photo-description-panel.open {
    flex-direction: column;
    gap: 0.75rem;
  }

  .photo-desc-img {
    width: 100%;
  }

}

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

  .header-inner {
    padding: 0 1rem;
  }
}
