/*
 * Shared editorial typography for the homepage exhibits (Exhibit A — the
 * bathhouse — and Exhibit C), plus the character-by-character title reveal
 * driven by js/home/title-reveal.js.
 *
 * Only typography lives here; each exhibit lays these elements out in its
 * own stylesheet. Contract: docs/components/home-opening.md.
 */

/* ── Kicker: "EXHIBIT A" ── */

.exhibit__kicker {
  width: fit-content;
  margin: 0 0 clamp(18px, 2.2vh, 28px);
  padding-bottom: 10px;
  border-bottom: 1px solid rgb(var(--rgb-gold-ui) / 0.58);
  font-family: var(--font-sans);
  font-size: clamp(11px, 0.82vw, 14px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgb(var(--rgb-gold-highlight) / 0.92);
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.58);
}

/* ── Title: gold serif lines ── */

.exhibit__title {
  max-width: 100%;
  margin: 0;
  perspective: 800px;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  text-wrap: balance;
}

.exhibit__title > span {
  display: block;
  color: transparent;
  background: var(--gradient-gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  filter: var(--shadow-title-span);
}

.exhibit__title-ivory {
  font-size: clamp(34px, 3.2vw, 50px);
}

.exhibit__title-gold {
  font-size: clamp(38px, 3.6vw, 56px);
}

/* ── Subline between two hairlines ── */

.exhibit__subline {
  position: relative;
  margin: clamp(14px, 1.6vh, 20px) 0 0;
  padding: 10px 0;
  font-family: var(--font-sans);
  font-size: clamp(11px, 0.86vw, 14px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgb(var(--rgb-gold-highlight) / 0.84);
}

.exhibit__subline::before,
.exhibit__subline::after {
  content: "";
  position: absolute;
  left: 0;
  width: min(100%, 470px);
  height: 1px;
  background: linear-gradient(90deg, rgb(var(--rgb-gold-ui) / 0.62), transparent);
}

.exhibit__subline::before {
  top: 0;
}

.exhibit__subline::after {
  bottom: 0;
}

/* ── Body copy ── */

.exhibit__copy {
  max-width: 500px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(15px, 1.08vw, 18px);
  font-weight: 430;
  line-height: 1.54;
  color: rgb(var(--rgb-cream-strong) / 0.96);
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.54);
}

.exhibit__emphasis {
  font-weight: 800;
  letter-spacing: 0.035em;
  color: #c99a45;
}

/* Gap between paragraphs, independent of line-height. */
.exhibit__para-gap {
  display: block;
  width: 100%;
  height: 0.9em;
  pointer-events: none;
}

/* ── Character reveal (js/home/title-reveal.js) ── */

[data-kt-character-reveal] {
  perspective: 800px;
}

/* Each glyph rises out of its own clipped shell. */
.title-reveal__shell {
  display: inline-block;
  overflow: hidden;
  padding-block: 0.08em 0.12em;
  margin-block: -0.08em -0.12em;
  vertical-align: top;
}

/* The gold gradient is sized to the word (or the whole title) so it reads
   continuously across the separate glyphs. */
.title-reveal__char {
  display: inline-block;
  color: transparent;
  background: var(--title-reveal-gradient, var(--gradient-gold-text));
  background-repeat: no-repeat;
  background-size: var(--title-gradient-w, 100%) var(--title-gradient-h, 100%);
  background-position: var(--title-gradient-x, 0) var(--title-gradient-y, 0);
  -webkit-background-clip: text;
  background-clip: text;
  backface-visibility: hidden;
  transform-origin: 50% 100%;
  will-change: transform, opacity, filter;
}

.is-character-ready .title-reveal__char {
  opacity: 0;
  filter: blur(5px);
  transform:
    translate3d(calc(var(--char-direction) * 0.06em), 112%, 0)
    rotateX(-62deg)
    skewX(calc(var(--char-direction) * 2deg));
}

.is-character-revealed .title-reveal__char {
  animation: titleCharacterReveal 920ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(90ms + var(--char-index) * 58ms);
}

.is-character-ready .title-reveal__char.is-settled {
  animation: none;
  opacity: 1;
  filter: none;
  transform: none;
  will-change: auto;
}

/* ── Responsive ── */

@media (max-width: 1180px) {
  .exhibit__title-ivory {
    font-size: clamp(30px, 3.4vw, 44px);
  }

  .exhibit__title-gold {
    font-size: clamp(34px, 3.8vw, 50px);
  }
}

@media (max-width: 767px) {
  .exhibit__kicker {
    font-size: 14px;
  }

  .exhibit__title-ivory {
    font-size: clamp(34px, 10vw, 42px);
  }

  .exhibit__title-gold {
    font-size: clamp(40px, 12vw, 50px);
  }

  .exhibit__subline {
    padding-bottom: 18px;
    font-size: 15px;
  }

  .exhibit__para-gap {
    height: 0.95em;
  }
}

/* Phone landscape and compact touch landscape. */
@media (orientation: landscape) and (max-width: 1000px) and (max-height: 500px),
       (pointer: coarse) and (orientation: landscape) and (min-width: 1100px) and (max-width: 1180px) and (max-height: 780px) {
  .exhibit__copy {
    font-size: clamp(16px, calc(1.6vw + 4px), 18px);
    line-height: 1.42;
  }

  .exhibit__para-gap {
    height: 0.65em;
  }
}

/* Phone prose size; wins over the landscape size on small landscape phones. */
@media (max-width: 767px) {
  .exhibit__copy {
    font-size: 20px;
    line-height: 1.55;
  }
}

/* Short desktop windows (e.g. 1280×720). */
@media (max-height: 760px) and (min-width: 1181px),
       (max-height: 760px) and (min-width: 1025px) and (max-width: 1099px),
       (max-height: 760px) and (min-width: 1025px) and (pointer: fine),
       (max-height: 760px) and (min-width: 1025px) and (orientation: portrait) {
  .exhibit__kicker {
    margin-bottom: 14px;
  }

  .exhibit__subline {
    margin-top: 12px;
    margin-bottom: 0;
  }
}

/* Above 1920×1080: type grows with the smaller viewport ratio (capped). */
@media (min-width: 1921px) and (min-height: 1081px) {
  .exhibit__kicker {
    font-size: clamp(14px, min(0.729167vw, 1.296296vh), 21px);
  }

  .exhibit__title-ivory {
    font-size: clamp(50px, min(2.604167vw, 4.62963vh), 72.5px);
  }

  .exhibit__title-gold {
    font-size: clamp(56px, min(2.916667vw, 5.185185vh), 81.2px);
  }

  .exhibit__copy {
    font-size: clamp(14px, min(0.729167vw, 1.296296vh), 21px);
  }
}

/* Phones and touch tablets: no pre-promoted layers. */
@media (max-width: 1180px), (pointer: coarse) and (min-width: 768px) {
  .title-reveal__char {
    will-change: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-character-ready .title-reveal__char,
  .is-character-revealed .title-reveal__char {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
}

@keyframes titleCharacterReveal {
  0% {
    opacity: 0;
    filter: blur(5px);
    transform:
      translate3d(calc(var(--char-direction) * 0.06em), 112%, 0)
      rotateX(-62deg)
      skewX(calc(var(--char-direction) * 2deg));
  }
  62% {
    opacity: 1;
    filter: blur(0.5px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) rotateX(0) skewX(0);
  }
}
