/* ==========================================================
   MOTION: curtain, cursor, hero scroll effect, smooth scroll
   ========================================================== */

/* ---------- Stand-in curtain ----------
   Covers the page from the very first paint until motion.js builds
   the real curtain, so there is never a flash of unstyled content.
   Failsafe: if JavaScript fails, it fades itself away after 4 seconds. */
html.js:not(.is-ready)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #0f0f0f;
  animation: ptFailsafe 0.4s ease 4s forwards;
}
@keyframes ptFailsafe {
  to { opacity: 0; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  html.js:not(.is-ready)::before { display: none; }
}

/* ---------- Hold page animations until the curtain lifts ---------- */
html.kp-hold .line-mask > span,
html.kp-hold .hero-slide img,
html.kp-hold .hero-bar span,
html.kp-hold .hero-caption-text,
html.kp-hold .marquee-track {
  animation-play-state: paused;
}
/* Keep scroll-reveal items hidden until the curtain lifts, then they animate in */
html.js.kp-hold [data-reveal] {
  opacity: 0 !important;
  transform: translateY(40px) !important;
}
html.js.kp-hold .g-item {
  opacity: 0 !important;
  transform: translateY(36px) !important;
}

/* ---------- The curtain (page transitions + intro) ---------- */
.pt {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--black);
  visibility: hidden;
  will-change: transform;
}
.pt-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}
.pt-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  text-align: center;
}
.pt-brand .brand-name {
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.4rem);
}
.pt-bar {
  width: min(220px, 50vw);
  height: 1px;
  background: rgba(247, 245, 242, 0.15);
  overflow: hidden;
}
.pt-bar span {
  display: block;
  height: 100%;
  background: var(--gold-light);
  transform: scaleX(0);
  transform-origin: left;
}
.pt.is-quick .pt-bar {
  display: none; /* the progress line only shows on a visitor's first page */
}

/* ---------- Hero scroll effect (--hp is set by motion.js, 0 to 1) ---------- */
.hero-content {
  opacity: calc(1 - var(--hp, 0) * 1.5);
  transform: translate3d(0, calc(var(--hp, 0) * -60px), 0);
}

/* ---------- Custom cursor (desktop with a mouse only) ---------- */
html.has-cursor,
html.has-cursor * {
  cursor: none !important;
}
html.has-cursor :is(input, textarea, select) {
  cursor: text !important;
}

.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: transform;
}
.cursor.is-on {
  opacity: 1;
}
.cursor.is-hidden {
  opacity: 0 !important;
}

.cursor-ring {
  position: absolute;
  left: -19px;
  top: -19px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(247, 245, 242, 0.5);
  border-radius: 50%;
  transition: transform 0.45s var(--ease), background 0.3s ease, border-color 0.3s ease;
}
.cursor-dot {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-light);
  transition: opacity 0.25s ease;
}
.cursor-label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--black);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cursor.is-down .cursor-ring {
  transform: scale(0.85);
}
.cursor.is-link .cursor-ring {
  transform: scale(1.5);
  border-color: var(--accent);
  background: rgba(184, 151, 90, 0.12);
}
.cursor.is-media .cursor-ring {
  transform: scale(2.3);
  background: var(--gold-light);
  border-color: var(--gold-light);
}
.cursor.is-media.is-down .cursor-ring {
  transform: scale(2);
}
.cursor.is-media .cursor-dot {
  opacity: 0;
}
.cursor.is-media .cursor-label {
  opacity: 1;
}

/* ---------- Smooth scroll (Lenis) housekeeping ---------- */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
  overflow: hidden;
}
.lenis.lenis-smooth iframe {
  pointer-events: none;
}