/* ============ Tokens ============ */
:root {
  --parchment: #f2ebdd;
  --parchment-2: #e9dfcc;
  --linen: #faf6ee;
  --ink: #2a1d1a;
  --ink-soft: #6b5a52;
  --maroon: #6d1a24;
  --maroon-deep: #4a0f17;
  --maroon-tint: rgba(109, 26, 36, 0.08);
  --gold: #a8875a;
  --line: rgba(74, 15, 23, 0.18);

  --display: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --caps: "Cinzel", "Trajan Pro", Georgia, serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gutter: clamp(16px, 4vw, 56px);
  --stage-h: clamp(300px, calc(100svh - 490px), 760px);
  --mat: clamp(10px, 1.6vw, 22px);
  --header-h: 68px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-h); /* anchor targets land below the sticky header */
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--parchment);
  /* faint paper grain */
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 252, 245, 0.7), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

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

a { color: inherit; }

::selection { background: var(--maroon); color: var(--linen); }

:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 3px;
}

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

/* ============ Type ============ */
.caps {
  font-family: var(--caps);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
}

.eyebrow {
  font-family: var(--caps);
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--maroon);
}

/* Roman inscription rule: ——— ◆ ——— */
.rule {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--maroon);
  margin: 0 auto;
  width: min(260px, 60%);
}
.rule::before,
.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
}
.rule::after { transform: scaleX(-1); }
.rule span {
  width: 7px; height: 7px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

/* Greek-key band */
.meander {
  height: 14px;
  color: var(--maroon);
  opacity: 0.55;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='14' viewBox='0 0 24 14' fill='none' stroke='black' stroke-width='1.3'%3E%3Cpath d='M0 13h24M2 13V1h18v9H7V4h9v3'/%3E%3C/svg%3E") repeat-x center / 24px 14px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='14' viewBox='0 0 24 14' fill='none' stroke='black' stroke-width='1.3'%3E%3Cpath d='M0 13h24M2 13V1h18v9H7V4h9v3'/%3E%3C/svg%3E") repeat-x center / 24px 14px;
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gutter);
  background: color-mix(in srgb, var(--parchment) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.wordmark {
  font-family: var(--caps);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-decoration: none;
  color: var(--maroon-deep);
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: clamp(16px, 3vw, 40px);
}
.nav a {
  position: relative;
  font-family: var(--caps);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 6px 0;
  transition: color 0.25s;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 50%; right: 50%; bottom: 0;
  height: 1px;
  background: var(--maroon);
  transition: left 0.35s var(--ease), right 0.35s var(--ease);
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--maroon); }
.nav a:hover::after,
.nav a[aria-current="page"]::after { left: 0; right: 0.3em; }

/* ============ Hero / carousel ============ */
.hero {
  padding: clamp(20px, 4vh, 48px) 0 clamp(32px, 6vh, 72px);
  text-align: center;
}

.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--maroon-deep);
}
.hero-title em { font-style: italic; color: var(--maroon); }
.hero .eyebrow { margin-bottom: 14px; display: block; }
.hero .rule { margin-top: 22px; }

.carousel {
  position: relative;
  margin-top: clamp(16px, 3vh, 40px);
  outline: none;
}

.stage {
  position: relative;
  height: var(--stage-h);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.slide {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  transition: transform 0.75s var(--ease), opacity 0.75s var(--ease), filter 0.75s var(--ease), visibility 0.75s;
  will-change: transform;
  cursor: pointer;
}
.stage.dragging .slide { transition: none; }

/* The artwork in its frame */
.frame {
  position: relative;
  padding: var(--mat);
  background: var(--linen);
  box-shadow:
    0 0 0 1px rgba(74, 15, 23, 0.12),
    0 0 0 6px var(--linen),
    0 0 0 7px var(--maroon),
    0 30px 60px -25px rgba(42, 29, 26, 0.45),
    0 12px 24px -12px rgba(42, 29, 26, 0.25);
}
.frame img {
  width: auto;
  height: auto;
  max-height: calc(var(--stage-h) - 2 * var(--mat) - 16px);
  max-width: min(78vw, 1100px);
  pointer-events: none;
  background: var(--parchment-2);
}

.slide[data-pos="0"] { cursor: zoom-in; }
.slide:not([data-pos="0"]) .frame { box-shadow: 0 0 0 1px rgba(74, 15, 23, 0.12), 0 20px 40px -25px rgba(42, 29, 26, 0.3); }

.caption {
  margin-top: clamp(18px, 3vh, 30px);
  min-height: 4.6em;
  padding: 0 var(--gutter);
}
.caption .numeral {
  font-family: var(--caps);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--maroon);
}
.caption h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-style: italic;
  margin: 6px 0 4px;
}
.caption p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
}
.caption > * { transition: opacity 0.35s, transform 0.45s var(--ease); }
.caption.swap > * { opacity: 0; transform: translateY(6px); }

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 18px;
}

.arrow {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--maroon);
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.arrow:hover { background: var(--maroon); border-color: var(--maroon); color: var(--linen); }
.arrow:active { transform: scale(0.94); }
.arrow svg { width: 20px; height: 20px; }

.counter {
  min-width: 96px;
  font-family: var(--caps);
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.counter b { color: var(--maroon); font-weight: 500; }

.progress {
  width: min(320px, 60vw);
  height: 1px;
  margin: 18px auto 0;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.progress i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--maroon);
  transition: width 0.75s var(--ease), left 0.75s var(--ease);
}

.autoplay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-family: var(--caps);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s;
}
.autoplay:hover { color: var(--maroon); }
.autoplay svg { width: 11px; height: 11px; }

/* ============ Sections ============ */
.section {
  padding: clamp(56px, 10vh, 120px) var(--gutter);
}
.section-head {
  text-align: center;
  margin-bottom: clamp(32px, 6vh, 64px);
}
.section-head h1,
.section-head h2 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  color: var(--maroon-deep);
  margin: 10px 0 18px;
}

.about {
  border-top: 1px solid var(--line);
  background: linear-gradient(var(--maroon-tint), transparent 70%);
}
.about-body {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  color: var(--ink);
}
.about-body p:first-of-type::first-letter {
  float: left;
  font-family: var(--caps);
  font-size: 3.6em;
  line-height: 0.85;
  padding: 6px 10px 0 0;
  color: var(--maroon);
}
.about-body p { text-align: left; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border: 1px solid var(--maroon);
  background: transparent;
  color: var(--maroon);
  font-family: var(--caps);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.button:hover,
.button.solid { background: var(--maroon); color: var(--linen); }
.button.solid:hover { background: var(--maroon-deep); }
.button:disabled { opacity: 0.5; cursor: wait; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}

/* ============ Gallery ============ */
.gallery {
  columns: 3 300px;
  column-gap: clamp(18px, 2.5vw, 36px);
  max-width: 1400px;
  margin: 0 auto;
}
.tile {
  break-inside: avoid;
  margin: 0 0 clamp(18px, 2.5vw, 36px);
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.tile.in { opacity: 1; transform: none; }
.tile .frame {
  height: auto;
  padding: 10px;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  box-shadow: 0 0 0 1px rgba(74, 15, 23, 0.12), 0 18px 36px -24px rgba(42, 29, 26, 0.4);
}
.tile .frame img {
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
}
.tile:hover .frame,
.tile:focus-visible .frame {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px var(--maroon), 0 28px 44px -24px rgba(42, 29, 26, 0.5);
}
.tile-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 2px 0;
}
.tile-meta h3 { font-size: 1.2rem; font-style: italic; }
.tile-meta span { font-family: var(--caps); font-size: 0.65rem; letter-spacing: 0.25em; color: var(--maroon); white-space: nowrap; }

.empty {
  max-width: 460px;
  margin: 8vh auto;
  text-align: center;
  color: var(--ink-soft);
}
.empty h2 { color: var(--maroon-deep); font-style: italic; font-size: 1.8rem; margin-bottom: 8px; }

/* ============ Lightbox ============ */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(28, 16, 14, 0.97);
  color: var(--linen);
}
.lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; animation: fade 0.35s var(--ease); }
.lightbox::backdrop { background: transparent; }
.lightbox figure {
  margin: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 64px clamp(16px, 8vw, 110px) 0;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100svh - 200px);
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: rise 0.45s var(--ease);
}
.lightbox .lb-caption {
  text-align: center;
  padding: 20px var(--gutter) 28px;
}
.lightbox .lb-caption h2 { font-style: italic; font-size: 1.6rem; }
.lightbox .lb-caption p { margin: 4px 0 0; color: rgba(250, 246, 238, 0.65); font-size: 0.95rem; }
.lightbox .lb-caption .numeral { font-family: var(--caps); font-size: 0.7rem; letter-spacing: 0.3em; color: var(--gold); }
.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(250, 246, 238, 0.25);
  border-radius: 50%;
  background: rgba(28, 16, 14, 0.4);
  color: var(--linen);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}
.lb-btn:hover { background: var(--maroon); border-color: var(--maroon); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: scale(0.97); } }

/* ============ Footer ============ */
.site-footer {
  padding: 28px var(--gutter) 36px;
  text-align: center;
  color: var(--ink-soft);
}
.site-footer .meander { margin-bottom: 26px; }
.site-footer .wordmark { font-size: 0.9rem; }
.site-footer p { margin: 8px 0 0; font-size: 0.9rem; }
.site-footer a { color: var(--maroon); text-underline-offset: 3px; }

/* ============ Responsive ============ */
@media (max-width: 640px) {
  body { font-size: 18px; }
  .site-header { flex-direction: column; gap: 10px; padding-top: 14px; padding-bottom: 12px; }
  .wordmark { font-size: 1rem; }
  :root { --stage-h: min(58vh, 520px); --mat: 8px; --header-h: 94px; }
  .frame img { max-width: 82vw; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; transform: none; }
}

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

.gallery:has(.empty) { columns: auto; }
