/* ===========================================================
   Moulana Peer Syed Shabbir Naqshbandi — Portfolio
   Palette & type inspired by ivory/gold biography keepsake books:
   warm ivory paper, muted antique-gold foil, deep sepia ink.
   =========================================================== */

:root {
  --ivory:        #f5efe0;
  --ivory-deep:    #eee5d0;
  --paper:        #faf6ec;
  --gold:         #a8813f;
  --gold-light:   #c9a35f;
  --gold-deep:    #7c5f2c;
  --ink:          #2c2418;
  --ink-soft:     #5c5140;
  --ink-faint:    #8a7d68;

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-caps:    'Cinzel', 'Georgia', serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------
   HERO
   --------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ivory);
}

/* faint Islamic 8-point star / lattice pattern, drawn as a tiled SVG */
.hero__pattern {
  position: absolute;
  inset: 0;
  background-color: var(--ivory);
  background-image:
    radial-gradient(circle at 50% 50%, rgba(168,129,63,0.10) 0%, rgba(168,129,63,0) 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23a8813f' stroke-width='0.6' opacity='0.16'%3E%3Cpath d='M60 4 L80 24 L60 44 L40 24 Z'/%3E%3Cpath d='M60 76 L80 96 L60 116 L40 96 Z'/%3E%3Cpath d='M4 60 L24 40 L44 60 L24 80 Z'/%3E%3Cpath d='M76 60 L96 40 L116 60 L96 80 Z'/%3E%3Ccircle cx='60' cy='60' r='16'/%3E%3Ccircle cx='0' cy='0' r='16'/%3E%3Ccircle cx='120' cy='0' r='16'/%3E%3Ccircle cx='0' cy='120' r='16'/%3E%3Ccircle cx='120' cy='120' r='16'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, 120px 120px;
  background-repeat: no-repeat, repeat;
}

/* soft vignette so the edges recede and the centre content pops */
.hero__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(245,239,224,0) 40%, rgba(245,239,224,0.55) 78%, var(--ivory) 100%);
  pointer-events: none;
}

/* thin inset gold frame, echoing a book-cover border */
.hero__frame {
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(168,129,63,0.55);
  pointer-events: none;
}
.hero__frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(168,129,63,0.28);
}

/* ---------------------------------------------------------
   Content block
   --------------------------------------------------------- */

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}

.hero__eyebrow {
  font-family: var(--font-caps);
  font-size: clamp(0.62rem, 1.1vw, 0.82rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  opacity: 0;
  animation: riseIn 1s ease-out 0.15s forwards;
}

.hero__ornament {
  width: clamp(140px, 22vw, 200px);
  margin: 22px auto;
  color: var(--gold);
  opacity: 0;
  animation: riseIn 1s ease-out 0.4s forwards;
}
.hero__ornament svg { display: block; width: 100%; height: auto; }

.hero__name {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  color: var(--ink);
  letter-spacing: 0.01em;
  opacity: 0;
  animation: riseIn 1.1s ease-out 0.6s forwards;
}

.hero__title {
  margin-top: 22px;
  font-family: var(--font-caps);
  font-size: clamp(0.66rem, 1.15vw, 0.9rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  animation: riseIn 1s ease-out 0.95s forwards;
}

.hero__rule {
  width: 64px;
  height: 2px;
  margin: 30px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  animation: riseIn 1s ease-out 1.15s forwards;
}

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

/* ---------------------------------------------------------
   Scroll cue
   --------------------------------------------------------- */

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  opacity: 0;
  animation: riseIn 1s ease-out 1.5s forwards;
}

.hero__scroll-line {
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, var(--gold), transparent);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gold-light);
  animation: scrollDrip 2.2s ease-in-out forwards;
}

@keyframes scrollDrip {
  0%   { top: -100%; }
  60%  { top: 100%; }
  100% { top: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__eyebrow, .hero__ornament, .hero__name, .hero__title, .hero__rule, .hero__scroll {
    animation: none;
    opacity: 1;
  }
  .hero__scroll-line::after { animation: none; display: none; }
}

/* ---------------------------------------------------------
   Small screens
   --------------------------------------------------------- */

@media (max-width: 480px) {
  .hero__frame { inset: 12px; }
  .hero__frame::before { inset: 5px; }
  .hero__content { padding: 0 20px; }
}

/* ===========================================================
   BIOGRAPHY / ABOUT
   =========================================================== */

.bio {
  position: relative;
  background: var(--paper);
  padding: 110px 0 130px;
}

.bio__inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 32px;
}

.bio__eyebrow {
  font-family: var(--font-caps);
  font-size: clamp(0.62rem, 1.1vw, 0.82rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-align: center;
}

.bio__heading {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  text-align: center;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  color: var(--ink);
}

.bio__ornament {
  width: clamp(120px, 18vw, 170px);
  margin: 20px auto 0;
  color: var(--gold);
}
.bio__ornament svg { display: block; width: 100%; height: auto; }

/* --- intro / lineage --- */

.bio__intro {
  display: flex;
  gap: 44px;
  align-items: flex-start;
  margin-top: 70px;
}

.bio__portrait {
  flex: 0 0 200px;
  width: 200px;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(168,129,63,0.55);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}
.bio__portrait::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(168,129,63,0.28);
}
.bio__portrait span {
  position: relative;
  font-family: var(--font-caps);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.bio__portrait img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
}

.bio__intro-text p {
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  line-height: 1.75;
  color: var(--ink-soft);
}
.bio__intro-text p + p { margin-top: 18px; }
.bio__intro-text em { color: var(--gold-deep); font-style: italic; }

.bio__closing {
  margin-top: 22px;
}

/* --- subheadings --- */

.bio__subheading {
  font-family: var(--font-caps);
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-align: center;
  margin-top: 96px;
  margin-bottom: 50px;
  position: relative;
}
.bio__subheading::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin: 16px auto 0;
  background: var(--gold);
}

/* --- timeline --- */

.bio__timeline {
  list-style: none;
  position: relative;
  padding-left: 28px;
}
.bio__timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold) 6%, var(--gold) 94%, transparent);
}

.bio__timeline li {
  position: relative;
  padding-left: 36px;
}
.bio__timeline li + li {
  margin-top: 46px;
}
.bio__timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--gold);
}

.bio__year {
  display: block;
  font-family: var(--font-caps);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--gold-deep);
  margin-bottom: 8px;
}

.bio__event h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--ink);
  margin-bottom: 8px;
}

.bio__event p {
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 1.2vw, 1.08rem);
  line-height: 1.72;
  color: var(--ink-soft);
}

/* --- roles grid --- */

.bio__roles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(168,129,63,0.35);
  border: 1px solid rgba(168,129,63,0.35);
}

.bio__role {
  background: var(--paper);
  padding: 30px 26px;
  text-align: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 1;
}
.bio__role:hover {
  background: var(--ivory);
  box-shadow: inset 0 0 0 1px var(--gold);
  z-index: 2;
}

.bio__role h4 {
  font-family: var(--font-caps);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 10px;
}

.bio__role p {
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--ink);
  line-height: 1.4;
}

/* --- responsive --- */

@media (max-width: 700px) {
  .bio { padding: 90px 0 100px; }
  .bio__intro { flex-direction: column; align-items: center; text-align: center; }
  .bio__portrait { flex: 0 0 auto; }
  .bio__roles { grid-template-columns: 1fr; }
  .bio__subheading { margin-top: 72px; margin-bottom: 40px; }
}

/* ===========================================================
   NAVIGATION
   =========================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(245, 239, 224, 0.92);
  backdrop-filter: blur(6px);
  border-bottom-color: rgba(168,129,63,0.25);
  box-shadow: 0 8px 24px rgba(44,36,24,0.06);
}

.nav__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  font-family: var(--font-caps);
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.25s ease;
}
.nav__brand:hover { color: var(--gold-deep); }

.nav__links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav__links a {
  position: relative;
  font-family: var(--font-caps);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 4px;
  transition: color 0.25s ease;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.nav__links a:hover {
  color: var(--ink);
}
.nav__links a:hover::after {
  width: 100%;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}
.nav__toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav__toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* anchor offset so fixed nav doesn't cover section tops */
#hero, #about, #projects, #publications, #gallery, #contact {
  scroll-margin-top: 78px;
}

@media (max-width: 800px) {
  .nav__toggle { display: flex; }

  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--paper);
    border-left: 1px solid rgba(168,129,63,0.3);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 34px;
    padding: 0 44px;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    box-shadow: -18px 0 40px rgba(44,36,24,0.12);
  }
  .nav__links.is-open {
    transform: translateX(0);
  }
  .nav__links a {
    font-size: 0.8rem;
  }
}

/* ===========================================================
   PROJECTS / INITIATIVES
   =========================================================== */

.projects {
  position: relative;
  background: var(--ivory);
  padding: 120px 0 130px;
  border-top: 1px solid rgba(168,129,63,0.2);
  transform: translateZ(0);
}

.projects__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}

.projects__grid {
  margin-top: 70px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  text-align: left;
}

.project-card {
  background: var(--paper);
  border: 1px solid rgba(168,129,63,0.3);
  padding: 38px 32px;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--gold);
  box-shadow: 0 22px 40px rgba(124,95,44,0.16);
}

.project-card__mark {
  display: block;
  width: 10px;
  height: 10px;
  margin-bottom: 22px;
  background: var(--gold);
  transform: rotate(45deg);
  transition: transform 0.35s ease, background 0.35s ease;
}
.project-card:hover .project-card__mark {
  transform: rotate(225deg);
  background: var(--gold-deep);
}

.project-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.32rem;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.3;
}

.project-card p {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.68;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .projects__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .projects__grid { grid-template-columns: 1fr; }
  .projects { padding: 96px 0 100px; }
}

/* ===========================================================
   PUBLICATIONS
   =========================================================== */

.publications {
  position: relative;
  background: var(--paper);
  padding: 120px 0 130px;
  border-top: 1px solid rgba(168,129,63,0.2);
  /* Forces its own compositing layer. Works around a Chrome GPU-paint bug
     where wide grid sections can render blank/truncated after the browser
     window is resized, until something forces a repaint. */
  transform: translateZ(0);
}

.publications__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}

.publications__grid {
  margin-top: 70px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  text-align: left;
}

.pub-card {
  display: flex;
  flex-direction: column;
  background: var(--ivory);
  border: 1px solid rgba(168,129,63,0.3);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.pub-card:hover {
  transform: translateY(-8px);
  border-color: var(--gold);
  box-shadow: 0 22px 40px rgba(124,95,44,0.16);
}

.pub-card__cover {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 133.333%;
  overflow: hidden;
  border-bottom: 1px solid rgba(168,129,63,0.3);
}
.pub-card__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.pub-card:hover .pub-card__cover img {
  transform: scale(1.05);
}

.pub-card__body {
  padding: 26px 26px 30px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pub-card__body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.28rem;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 10px;
}

.pub-card__meta {
  font-family: var(--font-caps);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-deep);
  line-height: 1.6;
  margin-bottom: 14px;
}

.pub-card__desc {
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.62;
  color: var(--ink-soft);
  flex: 1;
}

.pub-card__actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 900px) {
  .publications__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .publications { padding: 96px 0 100px; }
  .publications__grid { grid-template-columns: 1fr; }
}

/* ===========================================================
   GALLERY
   =========================================================== */

.gallery {
  position: relative;
  background: var(--ivory);
  padding: 120px 0 110px;
  border-top: 1px solid rgba(168,129,63,0.2);
  transform: translateZ(0);
}

.gallery__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}

.gallery__group {
  margin-top: 76px;
}
.gallery__group:first-of-type {
  margin-top: 70px;
}

.gallery__group-title {
  font-family: var(--font-caps);
  font-size: clamp(0.78rem, 1.3vw, 0.95rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-align: center;
  position: relative;
  margin-bottom: 40px;
}
.gallery__group-title::after {
  content: "";
  display: block;
  width: 44px;
  height: 1px;
  margin: 14px auto 0;
  background: var(--gold);
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
  text-align: left;
}

.gallery__item {
  position: relative;
  background: var(--paper);
  border: 1px solid rgba(168,129,63,0.3);
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.gallery__item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.gallery__item figcaption {
  padding: 14px 16px 16px;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.85rem;
  line-height: 1.55;
}

.gallery__item:hover {
  box-shadow: 0 14px 28px rgba(44,36,24,0.18);
  transform: translateY(-3px);
}

.gallery__note {
  margin-top: 46px;
  font-family: var(--font-caps);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

@media (max-width: 1000px) {
  .gallery__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .gallery { padding: 96px 0 90px; }
  .gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .gallery__item figcaption {
    font-size: 0.74rem; padding: 12px 10px 10px;
  }
}
@media (max-width: 420px) {
  .gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery__item figcaption {
    font-size: 0.68rem; line-height: 1.4; padding: 10px 8px 8px;
  }
}

/* --- legacy sub-section --- */

.gallery__legacy {
  margin-top: 96px;
  padding-top: 70px;
  border-top: 1px solid rgba(168,129,63,0.25);
}

.gallery__legacy-intro {
  max-width: 60ch;
  margin: 0 auto 44px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.gallery__grid--legacy {
  grid-template-columns: repeat(2, minmax(0, 320px));
  justify-content: center;
  max-width: 700px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .gallery__grid--legacy { grid-template-columns: repeat(2, 1fr); max-width: 340px; }
}

/* ===========================================================
   LIGHTBOX
   =========================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 16, 10, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  animation: lightboxIn 0.25s ease;
}
.lightbox[hidden] { display: none; }

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

.lightbox__figure {
  max-width: min(1100px, 90vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid rgba(201,163,95,0.5);
  background: #000;
}

.lightbox__caption {
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ivory);
  text-align: center;
  max-width: 70ch;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: transparent;
  border: 1px solid rgba(201,163,95,0.5);
  color: var(--ivory);
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__close {
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
  line-height: 1;
  border-radius: 50%;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.1rem;
}
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(201,163,95,0.16);
  border-color: var(--gold-light);
}
.lightbox__nav:hover { transform: translateY(-50%) scale(1.08); }

@media (max-width: 700px) {
  .lightbox { padding: 20px; }
  .lightbox__nav { width: 42px; height: 42px; }
  .lightbox__nav--prev { left: 6px; }
  .lightbox__nav--next { right: 6px; }
  .lightbox__close { top: 12px; right: 12px; }
  .lightbox__caption { font-size: 0.88rem; }
}

/* ===========================================================
   CONTACT
   =========================================================== */

.contact {
  position: relative;
  background: var(--paper);
  padding: 120px 0 130px;
  border-top: 1px solid rgba(168,129,63,0.2);
}

.contact__inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}

.contact__intro {
  margin-top: 26px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.contact__social {
  margin-top: 38px;
}

.contact__social-label {
  font-family: var(--font-caps);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 18px;
}

.contact__social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gold-light), var(--gold-deep));
  color: var(--paper);
  box-shadow: 0 8px 18px rgba(124,95,44,0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.social-icon svg {
  width: 26px;
  height: 26px;
}

.social-icon:hover,
.social-icon:focus-visible {
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(124,95,44,0.34);
}

@media (max-width: 480px) {
  .social-icon { width: 50px; height: 50px; }
  .social-icon svg { width: 22px; height: 22px; }
}

.contact__form {
  margin-top: 54px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group label {
  font-family: var(--font-caps);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.form-group input,
.form-group textarea {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(168,129,63,0.45);
  padding: 10px 2px;
  resize: vertical;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 1px 0 0 var(--gold);
}

.form-group input.is-invalid,
.form-group textarea.is-invalid {
  border-color: #b0503f;
}

.btn {
  display: inline-block;
  align-self: center;
  margin-top: 10px;
  padding: 15px 46px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold-deep);
  font-family: var(--font-caps);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
}

.btn:hover {
  background: var(--gold);
  color: var(--paper);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(124,95,44,0.28);
}
.btn:active { transform: translateY(0); }

.btn--small {
  margin-top: 0;
  padding: 11px 22px;
  font-size: 0.64rem;
}

.btn--ghost {
  border-color: rgba(168,129,63,0.4);
  color: var(--ink-soft);
}
.btn--ghost:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  box-shadow: 0 14px 28px rgba(44,36,24,0.2);
}

.contact__status {
  text-align: center;
  font-family: var(--font-caps);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-deep);
  min-height: 1em;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.contact__status.is-visible { opacity: 1; }

@media (max-width: 600px) {
  .contact { padding: 96px 0 100px; }
  .contact__form { margin-top: 44px; }
}

/* ===========================================================
   FOOTER
   =========================================================== */

.site-footer {
  background: var(--ivory-deep);
  border-top: 1px solid rgba(168,129,63,0.3);
  padding: 56px 32px 40px;
  text-align: center;
}

.site-footer__ornament {
  width: 130px;
  margin: 0 auto 22px;
  color: var(--gold);
}
.site-footer__ornament svg { display: block; width: 100%; height: auto; }

.site-footer__name {
  font-family: var(--font-caps);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 10px;
}

.site-footer__copy {
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* ===========================================================
   GALLERY PAGE — search, category tabs, highlights link
   =========================================================== */

.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;
}

.gallery__group[hidden],
.gallery__item[hidden],
.gempty[hidden] { display: none; }

.gallery__group--highlights { margin-top: 70px; }

.gallery__more { margin-top: 54px; }

.gallery--page { padding-top: 150px; min-height: 100vh; }
.gallery--page .gallery__group { margin-top: 64px; }
.gallery--page .gallery__legacy-intro { margin-bottom: 36px; }

.gtools {
  margin-top: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.gsearch {
  position: relative;
  display: block;
  width: 100%;
  max-width: 560px;
}
.gsearch svg {
  position: absolute;
  left: 16px; top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  color: var(--gold-deep);
  pointer-events: none;
}
.gsearch input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  background: var(--paper);
  border: 1px solid rgba(168,129,63,0.45);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.gsearch input::placeholder { color: var(--ink-faint); font-style: italic; }
.gsearch input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(168,129,63,0.18);
}

.gtabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.gtab {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid rgba(168,129,63,0.4);
  color: var(--ink-soft);
  font-family: var(--font-caps);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.gtab:hover { border-color: var(--gold); color: var(--ink); }
.gtab.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--paper);
}
.gtab:focus-visible,
.gsearch input:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

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

.gempty {
  margin-top: 70px;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

@media (max-width: 700px) {
  .gallery--page { padding-top: 120px; }
  .gtab { padding: 9px 14px; font-size: 0.6rem; }
  .gsearch input { font-size: 1rem; }
}

/* ===========================================================
   HOMEPAGE GALLERY — cinematic tile carousel + drifting strips
   =========================================================== */

.gallery--cinema {
  background:
    radial-gradient(ellipse 80% 55% at 50% 40%, #2a2118 0%, #15100a 55%, #0b0805 100%);
  border-top: 1px solid rgba(201,163,95,0.4);
  color: var(--ivory);
  overflow: hidden;           /* the full-width strips must not cause sideways scrolling */
}
.gallery--cinema .bio__eyebrow { color: var(--gold-light); }
.gallery--cinema .bio__heading { color: var(--ivory); }
.gallery--cinema .bio__ornament { color: var(--gold-light); }
.gallery--cinema .gallery__note { color: rgba(245,239,224,0.5); }
.gallery--cinema .gallery__more {
  border-color: var(--gold-light);
  color: var(--gold-light);
}
.gallery--cinema .gallery__more:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: #15100a;
  box-shadow: 0 14px 28px rgba(0,0,0,0.5);
}

/* ---------- drifting photo strips (watermark-like) ---------- */

.strip {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  opacity: 0.3;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
}
.strip--a { margin-top: 56px; margin-bottom: 46px; }
.strip--b { margin-top: 46px; }

.strip__track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: stripLeft 80s linear infinite;
}
.strip--b .strip__track { animation-name: stripRight; animation-duration: 95s; }

.strip__track img {
  display: block;
  height: 84px;
  width: auto;
  flex: none;
  filter: sepia(0.45) saturate(0.8) brightness(0.9);
}

@keyframes stripLeft  { from { transform: translateX(0); }    to { transform: translateX(-50%); } }
@keyframes stripRight { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* ---------- tile carousel ---------- */

.slideshow {
  --per-view: 3;
  --gap: 22px;
  --photo-h: 300px;
  position: relative;
  max-width: 1116px;
  margin: 0 auto;
  text-align: center;
}

.slideshow__viewport {
  overflow: hidden;
  transition: height 0.5s ease;
}

.slideshow__track {
  display: flex;
  align-items: flex-start;       /* each tile keeps its own caption height; JS evens out the visible set */
  transition: transform 0.95s cubic-bezier(.65,.05,.25,1), opacity 0.38s ease;
  will-change: transform;
}
.slideshow__track.is-fading { opacity: 0; }

.slideshow__slide {
  flex: 0 0 calc(100% / var(--per-view));
  margin: 0;
  padding: 0 calc(var(--gap) / 2);
  display: flex;
}

.slideshow__card {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(245,239,224,0.045);
  border: 1px solid rgba(201,163,95,0.35);
  box-shadow: 0 24px 50px rgba(0,0,0,0.5);
}

.slideshow__photo {
  position: relative;
  height: var(--photo-h);
  overflow: hidden;
  background: #0b0805;
  cursor: zoom-in;
}
/* soft vignette, like a cinema screen */
.slideshow__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 70px rgba(0,0,0,0.5);
}

.slideshow__backdrop,
.slideshow__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.slideshow__backdrop {
  object-fit: cover;
  filter: blur(22px) brightness(0.5) saturate(1.1);
  transform: scale(1.2);
}
.slideshow__img {
  object-fit: contain;
  z-index: 1;
  transition: transform 0.6s ease;
}
.slideshow__photo:hover .slideshow__img { transform: scale(1.04); }

.slideshow__caption {
  flex: 1;
  display: block;
  padding: 22px 20px 26px;
}
.slideshow__label {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-caps);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.slideshow__label::after {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  margin: 10px auto 0;
  background: var(--gold);
}
.slideshow__text {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.6;
  color: #f5efe0;
}

.slideshow__arrow {
  position: absolute;
  top: calc(var(--photo-h) / 2);
  z-index: 3;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(15,12,8,0.7);
  border: 1px solid rgba(201,163,95,0.6);
  border-radius: 50%;
  color: var(--ivory);
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s ease;
}
.slideshow__arrow svg { width: 22px; height: 22px; }
.slideshow__arrow:hover { background: rgba(168,129,63,0.9); transform: translateY(-50%) scale(1.06); }
.slideshow__arrow--prev { left: -10px; }
.slideshow__arrow--next { right: -10px; }

.slideshow__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 30px;
}
.slideshow__dots { display: flex; gap: 10px; }
.slideshow__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--gold-light);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.slideshow__dot:hover { transform: scale(1.25); }
.slideshow__dot.is-active { background: var(--gold-light); }

.slideshow__count {
  min-width: 64px;
  font-family: var(--font-caps);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--gold-light);
}

.slideshow__toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(201,163,95,0.55);
  border-radius: 50%;
  color: var(--gold-light);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.slideshow__toggle svg { width: 14px; height: 14px; }
.slideshow__toggle:hover { background: var(--gold-light); color: #15100a; }
.slideshow__toggle .icon-play { display: none; }
.slideshow.is-paused .slideshow__toggle .icon-play { display: block; }
.slideshow.is-paused .slideshow__toggle .icon-pause { display: none; }

.slideshow__progress {
  max-width: 220px;
  height: 2px;
  margin: 22px auto 0;
  background: rgba(201,163,95,0.22);
  overflow: hidden;
}
.slideshow__progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--gold-light);
  transform: scaleX(0);
  transform-origin: left center;
}
.slideshow.is-running .slideshow__progress span {
  animation: slideProgress var(--slide-ms, 7000ms) linear forwards;
}
@keyframes slideProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.slideshow__arrow:focus-visible,
.slideshow__dot:focus-visible,
.slideshow__toggle:focus-visible,
.slideshow__photo:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

.gallery__more { margin-top: 50px; }

/* tablet: two tiles at a time */
@media (max-width: 1000px) {
  .slideshow { --per-view: 2; --photo-h: 280px; }
  .slideshow__arrow--prev { left: 4px; }
  .slideshow__arrow--next { right: 4px; }
}

/* phone: one tile at a time */
@media (max-width: 640px) {
  .slideshow { --per-view: 1; --gap: 12px; --photo-h: clamp(260px, 52vh, 400px); }
  .slideshow__arrow { width: 40px; height: 40px; }
  .slideshow__text { font-size: 1.05rem; }
  .slideshow__controls { gap: 14px; }
  .slideshow__dots { gap: 8px; }
  .strip__track img { height: 64px; }
  .strip--a { margin-top: 40px; margin-bottom: 34px; }
  .strip--b { margin-top: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .slideshow__track { transition: none; }
  .slideshow__viewport { transition: none; }
  .strip__track { animation: none; }
  .slideshow.is-running .slideshow__progress span { animation: none; }
}
