:root {
  --ink: #120d08;
  --gold: #d9b36a;
  --gold-soft: #ecd9a8;
  --parchment: #f6ecd6;
  --font-serif: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--font-serif);
}

body.is-splash {
  overflow: hidden;
}

/* ---------- Splash ---------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: var(--ink);
  transition: opacity 1.2s ease, visibility 0s linear 1.2s;
}

.splash.is-leaving {
  opacity: 0;
  visibility: hidden;
}

/* Panels: a polyptych of the paintings, column count set from JS */
.splash__panels {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), 1fr);
  gap: 2px;
  background: var(--ink);
}

.splash__panel {
  position: relative;
  overflow: hidden;
  clip-path: inset(50% 0 50% 0);
  transition: clip-path 1.8s cubic-bezier(.65, 0, .25, 1);
  transition-delay: var(--delay, 0s);
}

.splash.is-ready .splash__panel {
  clip-path: inset(0 0 0 0);
}

.splash__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0;
  transition: opacity 2.4s ease;
  animation: drift var(--drift, 24s) ease-in-out infinite alternate;
  animation-delay: var(--drift-delay, 0s);
  will-change: transform, opacity;
}

.splash__img.is-visible {
  opacity: 1;
}

@keyframes drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.14) translate3d(0, -2%, 0); }
}

/* Darkening so the title stays legible over gold leaf */
.splash__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 50%, rgba(18, 13, 8, .72) 0%, rgba(18, 13, 8, .35) 60%, rgba(18, 13, 8, .15) 100%),
    linear-gradient(to bottom, rgba(18, 13, 8, .45) 0%, rgba(18, 13, 8, 0) 30%, rgba(18, 13, 8, 0) 70%, rgba(18, 13, 8, .6) 100%);
  opacity: 0;
  transition: opacity 2s ease 1s;
}

.splash.is-ready .splash__shade {
  opacity: 1;
}

/* Title: letters appear in place, no movement */
.splash__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-align: center;
}

.splash__title {
  margin: 0;
  font-weight: 300;
  font-size: clamp(2.6rem, 8.5vw, 7.5rem);
  line-height: 1;
  letter-spacing: .02em;
  color: var(--parchment);
  text-shadow: 0 2px 30px rgba(0, 0, 0, .55), 0 0 2px rgba(0, 0, 0, .4);
}

.splash__line {
  display: block;
}

.splash__line + .splash__line {
  font-style: italic;
  color: var(--gold-soft);
  margin-top: .08em;
}

.splash__char {
  opacity: 0;
  filter: blur(8px);
  transition: opacity 1.4s ease, filter 1.6s ease;
  transition-delay: var(--d, 0s);
}

.splash.is-titled .splash__char {
  opacity: 1;
  filter: blur(0);
}

.splash__rule {
  display: block;
  width: min(220px, 40vw);
  height: 1px;
  margin: clamp(1.4rem, 3vw, 2.2rem) 0;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 1.6s ease var(--rule-delay, 2.4s);
}

.splash.is-titled .splash__rule {
  opacity: .9;
}

.splash__enter {
  font: inherit;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 500;
  letter-spacing: .35em;
  text-transform: uppercase;
  padding: .7em 1.4em .7em 1.75em; /* extra left offsets trailing letter-spacing */
  color: var(--gold-soft);
  background: rgba(18, 13, 8, .25);
  border: 1px solid rgba(217, 179, 106, .55);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.4s ease, visibility 0s linear 1.4s, background-color .4s ease, border-color .4s ease, color .4s ease;
}

.splash.is-enterable .splash__enter {
  opacity: 1;
  visibility: visible;
  transition: opacity 1.4s ease, visibility 0s, background-color .4s ease, border-color .4s ease, color .4s ease;
}

.splash__enter:hover,
.splash__enter:focus-visible {
  background: rgba(217, 179, 106, .18);
  border-color: var(--gold);
  color: var(--parchment);
  outline: none;
}

/* ---------- Site ---------- */

.site {
  min-height: 100%;
  outline: none;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .splash__img {
    animation: none;
    transform: scale(1.04);
  }

  .splash__panel {
    clip-path: none;
    transition: none;
  }

  .splash__char {
    filter: none;
  }
}
