/* ==========================================================================
   Gem & Bill — Tryall Club, Jamaica
   v3 "Editorial cinema": photography-first, huge Fraunces type, scroll
   choreography (GSAP/Lenis in js/motion.js). Motion sets all initial
   hidden states from JS, so the page is fully readable with no JS at all.
   ========================================================================== */

/* ---------- 1. Tokens & resets ---------- */

:root {
  --display: "Fraunces", "Georgia", serif;
  --sans: "Jost", "Segoe UI", sans-serif;
  --script: "Great Vibes", cursive;

  --cream: #f4efe4;
  --cream-2: #eae1cf;
  --ink: #211d17;
  --ink-soft: rgba(33, 29, 23, 0.6);
  --night: #0c1a1b;
  --night-2: #132527;
  --paper: #efe7d5;
  --paper-soft: rgba(239, 231, 213, 0.62);
  --accent: #cd5a3c;
  --accent-deep: #ad4a2f;
  --gold: #b98a2f;
  --hairline: rgba(33, 29, 23, 0.16);
  --hairline-light: rgba(239, 231, 213, 0.2);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  /* clip (not hidden): kills sideways scroll from off-canvas foliage without
     creating a scroll container, so position:sticky keeps working */
  overflow-x: clip;
}

html.gsap {
  scroll-behavior: auto; /* Lenis takes over */
}

body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.02rem;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--cream);
}

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

a {
  color: inherit;
}

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

/* ---------- 2. Preloader ---------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  align-items: center;
  justify-content: center;
  background: var(--night);
  color: var(--paper);
  /* safety: clears itself even if JS never loads */
  animation: pl-safety 0.7s ease 3s forwards;
}

.preloader__mark {
  width: 58px;
  height: 58px;
}

/* the ring draws itself on while the counter runs (pure CSS — no JS dep) */
.preloader__ring {
  stroke-dasharray: 170; /* 2πr, r=27 */
  stroke-dashoffset: 170;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  animation: ring-draw 1.6s var(--ease-out) 0.15s forwards;
}

@keyframes ring-draw {
  to { stroke-dashoffset: 0; }
}

.preloader.done {
  display: none;
}

.preloader__names {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  letter-spacing: 0.06em;
}

.preloader__names i {
  font-family: var(--script);
  font-style: normal;
  color: var(--accent);
  padding: 0 0.12em;
}

.preloader__count {
  position: absolute;
  bottom: 5vh;
  right: 6vw;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 1;
  opacity: 0.35;
  font-variant-numeric: tabular-nums;
}

@keyframes pl-safety {
  to { opacity: 0; visibility: hidden; }
}

/* ---------- 3. Cursor & grain ---------- */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cream);
  mix-blend-mode: difference;
  pointer-events: none;
  transform: translate(-100px, -100px);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out);
}

.cursor.is-hover {
  width: 52px;
  height: 52px;
}

.cursor__label {
  display: none;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cursor.has-label {
  width: auto;
  height: auto;
  padding: 0.7em 1.2em;
  border-radius: 99px;
  background: rgba(12, 26, 27, 0.82);
  color: var(--paper);
  mix-blend-mode: normal;
  translate: -50% -140%;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.cursor.has-label .cursor__label {
  display: block;
}

@media (hover: none) {
  .cursor { display: none; }
}

.grain {
  position: fixed;
  inset: -20%;
  z-index: 90;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.045;
  mix-blend-mode: soft-light;
}

/* ---------- 4. Nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 3.4rem);
  color: var(--ink);
  transition: color 0.45s, background 0.45s, backdrop-filter 0.45s;
}

.nav--light {
  color: var(--paper);
}

.nav.is-scrolled::before {
  opacity: 1;
}

.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--cream) 72%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.45s;
}

.nav--light.is-scrolled::before {
  background: color-mix(in srgb, var(--night) 55%, transparent);
}

/* over the night sections: paper text on dark glass */
.nav--dark {
  color: var(--paper);
}

.nav--dark.is-scrolled::before {
  background: color-mix(in srgb, var(--night) 62%, transparent);
}

.nav__brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-decoration: none;
}

.nav__brand i {
  font-style: italic;
  color: var(--accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.4vw, 2.4rem);
}

.nav__links a {
  position: relative;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav__links a:not(.nav__cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}

.nav__links a:not(.nav__cta):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__cta {
  padding: 0.55em 1.5em;
  border-radius: 99px;
  background: var(--accent);
  color: var(--cream);
  transition: background 0.3s, transform 0.3s var(--ease-spring);
}

.nav__cta:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
}

/* ocean ambience toggle — tiny EQ bars, animate only while playing */
.nav__sound {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  margin-left: 1.4rem;
  padding: 0 2px 1px;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.75;
  transition: opacity 0.3s;
}

.nav__sound:hover { opacity: 1; }

.nav__sound i {
  width: 2.5px;
  height: 14px;
  background: currentColor;
  border-radius: 2px;
  transform: scaleY(0.25);
  transform-origin: bottom;
  animation: eq 1.1s ease-in-out infinite alternate;
  animation-play-state: paused;
}

.nav__sound i:nth-child(2) { animation-duration: 0.9s; animation-delay: -0.3s; }
.nav__sound i:nth-child(3) { animation-duration: 1.3s; animation-delay: -0.6s; }
.nav__sound i:nth-child(4) { animation-duration: 0.8s; animation-delay: -0.15s; }

body.sound-on .nav__sound i { animation-play-state: running; }

@keyframes eq {
  from { transform: scaleY(0.25); }
  to   { transform: scaleY(1); }
}

/* section dots — fixed right rail, blends against any background */
.dots {
  position: fixed;
  right: clamp(0.9rem, 2vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 16px;
  mix-blend-mode: difference;
  color: #fff;
}

.dots a {
  position: relative;
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.2px solid currentColor;
  opacity: 0.55;
  transition: opacity 0.3s, transform 0.3s var(--ease-spring), background 0.3s;
}

.dots a:hover,
.dots a.on {
  opacity: 1;
  background: currentColor;
  transform: scale(1.25);
}

.dots a span {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.dots a:hover span { opacity: 0.9; }

@media (max-width: 1100px) {
  .dots { display: none; }
}

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 7px;
  padding: 10px 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

.nav__burger span {
  display: block;
  width: 26px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.35s var(--ease-out);
}

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

  .nav__links {
    position: fixed;
    inset: 0;
    z-index: -2;
    flex-direction: column;
    justify-content: center;
    gap: 1.9rem;
    background: var(--night);
    color: var(--paper);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--ease-out), visibility 0.5s;
  }

  .nav__links a {
    font-family: var(--display);
    font-size: 2rem;
    font-weight: 300;
    text-transform: none;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(18px);
    transition: transform 0.6s var(--ease-out), opacity 0.6s;
  }

  body.menu-open .nav__links {
    opacity: 1;
    visibility: visible;
  }

  body.menu-open .nav__links a {
    opacity: 1;
    transform: none;
    transition-delay: calc(0.055s * var(--i, 1) + 0.12s);
  }

  body.menu-open { overflow: hidden; }
  body.menu-open .nav { color: var(--paper); }
  body.menu-open .nav::before { opacity: 0; }
  body.menu-open .nav__burger span:first-child { transform: translateY(4.2px) rotate(45deg); }
  body.menu-open .nav__burger span:last-child { transform: translateY(-4.2px) rotate(-45deg); }
}

/* ---------- 5. Shared ---------- */

section {
  position: relative;
}

.section__head {
  max-width: 1200px;
  margin: 0 auto clamp(2.6rem, 7vh, 4.5rem);
  padding: 0 clamp(1.2rem, 5vw, 4rem);
}

.overline {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.overline--light {
  color: var(--paper);
  opacity: 0.85;
}

.display {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.display em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.btn {
  position: relative;
  display: inline-block;
  padding: 0.9em 2.4em;
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s, background 0.3s;
  will-change: transform;
}

.btn--primary {
  background: var(--accent);
  color: var(--cream);
}

.btn--primary:hover {
  background: var(--accent-deep);
  box-shadow: 0 16px 34px -14px rgba(173, 74, 47, 0.6);
}

.btn--ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.28) 50%, transparent 60%);
  transform: translateX(-130%);
  transition: transform 0.8s var(--ease-out);
}

.btn:hover::after {
  transform: translateX(130%);
}

/* ---------- 6. Hero ---------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  color: var(--paper);
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__media img,
.hero__media video {
  width: 100%;
  height: 112%;
  object-fit: cover;
  will-change: transform;
}

/* video sits over the photo and fades in once it can actually play */
.hero__video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.hero__video.is-ready {
  opacity: 1;
}

/* gentle Ken Burns when GSAP isn't running */
html:not(.gsap) .hero__media img {
  animation: kb 22s ease-in-out infinite alternate;
}

@keyframes kb {
  from { transform: scale(1.02); }
  to   { transform: scale(1.12) translateY(-2%); }
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 20, 22, 0.5) 0%, rgba(10, 20, 22, 0.08) 32%, rgba(10, 20, 22, 0.12) 68%, rgba(10, 20, 22, 0.62) 100%);
}

.hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.2rem;
}

.hero__eyebrow {
  font-size: clamp(0.72rem, 1.6vw, 0.86rem);
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.hero__names {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 3vw;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(4.4rem, 17vw, 15rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 44px rgba(0, 0, 0, 0.35);
}

.hword {
  display: inline-block;
  overflow: hidden;
  vertical-align: baseline;
}

.hword__in {
  display: inline-block;
  will-change: transform;
}

.hero__amp {
  font-family: var(--script);
  font-size: 0.36em;
  color: var(--gold);
  transform: translateY(-0.55em);
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.4);
}

.hero__tag {
  margin-top: 2.2rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  opacity: 0.95;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.4);
}

.hero__foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 2rem clamp(1.2rem, 4vw, 3.4rem);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.9;
}

.hero__cue {
  display: block;
  width: 1px;
  height: 64px;
  overflow: hidden;
  position: relative;
}

.hero__cue-line {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--paper);
  animation: cue-drop 1.9s var(--ease-out) infinite;
}

@keyframes cue-drop {
  0%   { transform: translateY(-100%); }
  55%  { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* ---------- 7. Statement ---------- */

.statement {
  padding: clamp(7rem, 20vh, 13rem) clamp(1.4rem, 8vw, 6rem);
  overflow: hidden;
}

/* huge ghost watermark drifting behind the statement */
.ghost {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(7rem, 22vw, 19rem);
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(33, 29, 23, 0.09);
  pointer-events: none;
  z-index: -2;
}

.statement__text {
  max-width: 1150px;
  margin: 0 auto;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.7rem, 4.6vw, 3.6rem);
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.statement__text .w {
  display: inline-block;
}

/* ---------- 8. Countdown ---------- */

.count {
  padding: 0 clamp(1.2rem, 5vw, 4rem) clamp(6rem, 16vh, 10rem);
  text-align: center;
}

.count__grid {
  display: flex;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.unit {
  flex: 1;
  padding: clamp(1.4rem, 4vw, 2.6rem) 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.unit + .unit {
  border-left: 1px solid var(--hairline);
}

.unit__num {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.unit__num.tick {
  animation: tick 0.5s var(--ease-spring);
}

@keyframes tick {
  0%   { transform: translateY(-8px); opacity: 0.3; }
  100% { transform: none; opacity: 1; }
}

.unit__label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.count__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.6rem;
}

/* ---------- 9. Story ---------- */

.story {
  padding: clamp(5rem, 14vh, 9rem) clamp(1.2rem, 5vw, 4rem);
  max-width: 1240px;
  margin: 0 auto;
}

.story .section__head {
  padding: 0;
}

.story__row {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.6rem, 5vw, 4.5rem);
  align-items: center;
  margin-bottom: clamp(4rem, 12vh, 8rem);
}

.story__row--flip .mask { order: 2; }
.story__row--flip .story__text { order: 1; text-align: right; }

.mask {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 4 / 3;
  box-shadow: 0 34px 64px -32px rgba(28, 26, 16, 0.4);
}

.mask img {
  width: 100%;
  height: 118%;
  object-fit: cover;
  will-change: transform;
}

/* treasure-map dotted trail (path generated in motion.js) */
.trail-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: visible;
}

.trail-dots {
  fill: none;
  stroke: #96774a;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 0.5 14;
  opacity: 0.55;
}

.trail-x path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.6;
  stroke-linecap: round;
  opacity: 0.9;
}

.story__year {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.7rem;
}

.story__text h3 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}

.story__text p {
  max-width: 42ch;
  color: color-mix(in srgb, var(--ink) 82%, transparent);
}

.story__row--flip .story__text p { margin-left: auto; }

.story__kicker {
  text-align: center;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
}

.story__kicker em {
  font-style: italic;
  color: var(--accent);
}

@media (max-width: 760px) {
  .story__row,
  .story__row--flip {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }
  .story__row--flip .mask { order: 0; }
  .story__row--flip .story__text { order: 1; text-align: left; }
  .story__row--flip .story__text p { margin-left: 0; }
}

/* ---------- 10. Weekend sticky stack ---------- */

.stack {
  position: relative;
}

.day {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.day__media {
  position: absolute;
  inset: 0;
}

.day__media img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  will-change: transform;
}

.day__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(10, 20, 22, 0.05) 30%, rgba(10, 20, 22, 0.55) 100%);
}

/* dims a pinned day as the next one slides over it (driven by GSAP) */
.day__cover {
  position: absolute;
  inset: 0;
  background: #060d0e;
  opacity: 0;
  pointer-events: none;
}

.day__panel {
  position: relative;
  margin: 0 0 clamp(1.6rem, 6vh, 4rem) clamp(1.2rem, 5vw, 4rem);
  max-width: 480px;
  padding: clamp(1.6rem, 3.4vw, 2.6rem);
  border-radius: 6px;
  background: color-mix(in srgb, var(--night) 42%, transparent);
  background-color: rgba(12, 26, 27, 0.45); /* fallback if color-mix unsupported */
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid var(--hairline-light);
  color: var(--paper);
}

.day__panel--feature {
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
}

.day__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.9rem;
}

.day__panel h3 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}

.day__meta {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  margin-bottom: 0.9rem;
}

.day__desc {
  font-size: 0.96rem;
  color: var(--paper-soft);
  margin-bottom: 1.2rem;
}

/* dictionary-entry treatment for the Welcome Fête */
.day__define {
  display: block;
}

.day__define-word {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.55em;
  color: var(--gold);
  margin-right: 0.3em;
}

.day__define-phon {
  font-size: 0.88em;
  opacity: 0.75;
  margin-right: 0.5em;
}

.day__define-pos {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.95em;
  opacity: 0.85;
}

.day__define-body {
  display: block;
  margin-top: 0.55em;
}

.day__define-body em {
  font-family: var(--display);
  font-style: italic;
}

.day__dress {
  display: block;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline-light);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--paper-soft);
}

/* mobile: pin the event panel to the top so more of the photo shows,
   and flip the scrim so the darkening follows the text up top */
@media (max-width: 680px) {
  .day {
    align-items: flex-start;
  }

  .day__panel {
    margin: calc(env(safe-area-inset-top, 0px) + 4.6rem) auto 0;
    width: calc(100% - 2rem);
    max-width: none;
  }

  .day__scrim {
    background: linear-gradient(160deg, rgba(10, 20, 22, 0.6) 0%, rgba(10, 20, 22, 0.12) 42%, rgba(10, 20, 22, 0) 62%);
  }
}

/* ---------- 11. Venue cinematic + copy ---------- */

.vcine {
  height: 380vh; /* ~1 viewport of scroll per slide transition */
}

.vcine__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.vcine__track {
  display: flex;
  height: 100%;
  width: max-content;
  will-change: transform;
}

.vslide {
  width: 100vw;
  height: 100%;
  margin: 0;
  flex-shrink: 0;
  overflow: hidden;
}

.vslide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vcine__count {
  position: absolute;
  right: clamp(1.2rem, 4vw, 3.4rem);
  bottom: 2rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

/* sweep progress — centered thin bar */
.vcine__bar {
  position: absolute;
  left: 50%;
  bottom: 2.2rem;
  transform: translateX(-50%);
  width: clamp(170px, 22vw, 330px);
  height: 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--paper) 28%, transparent);
  overflow: hidden;
}

.vcine__bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: left center;
}

.vcine__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 20, 22, 0.3), rgba(10, 20, 22, 0) 45%, rgba(10, 20, 22, 0.35)),
    rgba(8, 18, 20, 0.26);
}

.vcine__title {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--paper);
  padding: 0 1.2rem;
}

.vcine__title h2 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(3.4rem, 11vw, 9.5rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.45);
}

.vcine__sub {
  margin-top: 1.4rem;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  opacity: 0.92;
}

.venue-copy {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(5rem, 14vh, 9rem) clamp(1.4rem, 5vw, 3rem);
  text-align: center;
}

.venue-copy__lede {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  line-height: 1.4;
}

.venue-copy__more {
  margin-top: 1.6rem;
  max-width: 58ch;
  margin-inline: auto;
  color: color-mix(in srgb, var(--ink) 82%, transparent);
}

.venue-copy__foot {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  list-style: none;
}

.chips li {
  padding: 0.45em 1.25em;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--hairline);
  border-radius: 99px;
}

/* ---------- 12. Horizontal gallery ---------- */

.gal {
  overflow: hidden;
  padding-top: clamp(3rem, 9vh, 6rem);
}

.gal__viewport {
  overflow: hidden; /* transform-driven pan; nothing native to fight Lenis */
}

.gal__track {
  display: flex;
  align-items: stretch;
  gap: clamp(1rem, 2.5vw, 2rem);
  width: max-content;
  padding: 0 clamp(1.2rem, 5vw, 4rem) clamp(1.5rem, 4vh, 3rem);
  will-change: transform;
}

.gal__item {
  position: relative;
  margin: 0;
  height: clamp(300px, 58vh, 580px);
  aspect-ratio: 4 / 3; /* width derived from height */
  overflow: hidden;
  border-radius: 4px;
  flex-shrink: 0;
}

.gal__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease-out);
  user-select: none;
  -webkit-user-drag: none;
}

.gal__item:hover img {
  transform: scale(1.05);
}

.gal__item {
  display: block;
  text-decoration: none;
}

.gal__item figcaption,
.gal__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.8rem 1.2rem 0.9rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 1rem;
  color: var(--paper);
  background: linear-gradient(transparent, rgba(8, 18, 20, 0.7));
}

.gal__item figcaption strong,
.gal__caption strong {
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.gal__caption em {
  display: block;
  margin-top: 0.25em;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

/* villa cards — big bedroom-count headline */
.gal__item figcaption.gal__caption--big {
  font-style: normal;
  font-size: clamp(1.6rem, 2.8vw, 2.6rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 2.6rem 1.4rem 1.2rem;
  background: linear-gradient(transparent, rgba(8, 18, 20, 0.78));
}

.gal__item--text {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: auto;
  width: clamp(300px, 42vw, 500px);
  background: var(--cream-2);
  text-align: center;
}

.gal__item--text p {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.2;
}

.gal__item--text em {
  font-style: italic;
  color: var(--accent);
}

/* ---------- 13. Travel ---------- */

.travel {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(5rem, 14vh, 9rem) clamp(1.2rem, 5vw, 4rem);
}

.travel .section__head { padding: 0; }

.travel__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.6rem, 4vw, 3.4rem);
}

.travel__col {
  border-top: 1px solid var(--hairline);
  padding-top: 1.4rem;
}

.travel__col h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.4rem;
  margin-bottom: 0.7rem;
}

.travel__col p {
  font-size: 0.96rem;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}

.travel__note {
  margin-top: 3.2rem;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.12rem;
  color: var(--ink-soft);
}

@media (max-width: 800px) {
  .travel__cols { grid-template-columns: 1fr; }
}

/* ---------- 14. Night sections (RSVP, registry, footer) ---------- */

.night {
  background: var(--night);
  color: var(--paper);
}

.night .overline { color: var(--gold); }
.night .unit__label,
.night .travel__col p { color: var(--paper-soft); }

.rsvp-sec {
  padding: clamp(6rem, 16vh, 10rem) clamp(1.2rem, 5vw, 4rem);
  border-radius: clamp(28px, 5vw, 56px) clamp(28px, 5vw, 56px) 0 0;
  overflow: hidden;
}

.fireflies {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.8;
}

.fy {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffefa0 0%, rgba(255, 233, 138, 0) 70%);
  box-shadow: 0 0 8px 2px rgba(255, 233, 138, 0.5);
  animation:
    fy-drift var(--dur, 9s) ease-in-out var(--delay, 0s) infinite alternate,
    fy-glow 2.7s ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes fy-drift {
  to { transform: translate(var(--dx, 60px), var(--dy, -40px)); }
}

@keyframes fy-glow {
  0%, 100% { opacity: 0.1; }
  55%      { opacity: 0.9; }
}

.rsvp__note {
  max-width: 52ch;
  margin: -1.2rem auto 2.8rem;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--paper-soft);
}

.rsvp {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.rsvp__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.7rem 2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: none;
}

.field--wide { grid-column: 1 / -1; }

.field__label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--paper-soft);
}

.field__input {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;
  color: var(--paper);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(239, 231, 213, 0.28);
  padding: 0.55em 0.1em;
  border-radius: 0;
  transition: border-color 0.3s;
}

.field__input:focus {
  outline: none;
  border-bottom-color: var(--gold);
}

.field__input::placeholder {
  color: rgba(239, 231, 213, 0.32);
}

textarea.field__input { resize: vertical; }
select.field__input option { color: var(--ink); }

.field--radios { gap: 0.75rem; }

.radio {
  display: flex;
  align-items: center;
  gap: 0.7em;
  cursor: pointer;
  font-size: 0.98rem;
}

.radio input {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(239, 231, 213, 0.5);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: border-color 0.25s;
  cursor: pointer;
}

.radio input::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  transform: scale(0);
  transition: transform 0.3s var(--ease-spring);
}

.radio input:checked { border-color: var(--gold); }
.radio input:checked::after { transform: scale(1); }

.rsvp__submit { margin-top: 2.2rem; }

.rsvp__success {
  margin-top: 1.4rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.15rem;
}

.petal {
  position: absolute;
  top: 40%;
  width: 11px;
  height: 15px;
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
  background: radial-gradient(circle at 35% 30%, #e8836a, var(--accent) 70%);
  pointer-events: none;
  animation: petal-fall var(--dur, 1.6s) cubic-bezier(0.3, 0.4, 0.6, 1) forwards;
}

@keyframes petal-fall {
  from { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  to   { transform: translate(var(--dx, 40px), var(--dy, 220px)) rotate(var(--rot, 220deg)); opacity: 0; }
}

@media (max-width: 640px) {
  .rsvp__grid { grid-template-columns: 1fr; }
}

/* ---------- 15. Registry ---------- */

.registry {
  padding: 0 clamp(1.2rem, 5vw, 4rem) clamp(6rem, 16vh, 10rem);
}

.registry__note {
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.2rem;
  margin-bottom: 2.4rem;
}

.registry__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  max-width: 780px;
  margin: 0 auto;
}

.registry__card {
  display: block;
  padding: 2rem 1.8rem;
  border: 1px solid var(--hairline-light);
  border-radius: 6px;
  text-decoration: none;
  transition: transform 0.4s var(--ease-out), border-color 0.4s, background 0.4s;
}

.registry__card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--gold) 60%, transparent);
  background: var(--night-2);
}

.registry__card h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.registry__card p {
  font-size: 0.95rem;
  color: var(--paper-soft);
}

.registry__cta {
  display: inline-block;
  margin-top: 1.1rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  transition: transform 0.35s var(--ease-out);
}

.registry__card:hover .registry__cta {
  transform: translateX(6px);
}

@media (max-width: 640px) {
  .registry__grid { grid-template-columns: 1fr; }
}

/* ---------- 16. Footer ---------- */

.footer {
  padding: clamp(3rem, 8vh, 5rem) 0 3rem;
  border-top: 1px solid var(--hairline-light);
  text-align: center;
  overflow: hidden;
}

.marquee {
  white-space: nowrap;
  overflow: hidden;
}

.marquee__track {
  display: inline-flex;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  letter-spacing: -0.01em;
  animation: mq 30s linear infinite;
}

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

.footer__tag {
  margin-top: 2rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--gold);
}

.footer__fine {
  margin-top: 1.6rem;
  padding: 0 1.4rem;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--paper-soft);
}

/* ---------- 17. Parallax foliage (photo cutouts from Tryall's palms) ----------
   Wrapper spans carry the static placement transform (rotate/flip); GSAP
   animates the inner <img> (parallax drift + idle sway), so the two never
   fight over the transform property. */

.leaf {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  will-change: transform;
}

.leaf img {
  width: 100%;
  height: auto;
}

/* Feather the assets' hard crop edges to transparent so no flat line can
   ever show, at any viewport. Masks sit on the img (child) so the wrapper's
   drop-shadow follows the feathered silhouette. */
.leaf--st1 img {
  -webkit-mask-image: linear-gradient(to top, transparent 0, #000 24%);
  mask-image: linear-gradient(to top, transparent 0, #000 24%);
}

.leaf--sy2 img,
.leaf--ve2 img,
.leaf--rs1 img {
  -webkit-mask-image: linear-gradient(to top, transparent 0, #000 26%);
  mask-image: linear-gradient(to top, transparent 0, #000 26%);
}

.leaf--sy3 img,
.leaf--rg img {
  -webkit-mask-image: linear-gradient(to top, transparent 0, #000 20%);
  mask-image: linear-gradient(to top, transparent 0, #000 20%);
}

.leaf--ve1 img {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 18%);
}

/* Sections with a centered max-width (story/travel/venue-copy): their box
   edge is NOT the viewport edge, so leaves anchor to the viewport via
   calc((100% - 100vw) / 2). Full-width sections just use 0. Only frond
   TIPS enter the frame — the trimmed stems stay off-screen. */

/* statement — expanded canopy tucked behind everything (incl. the ghost
   word). Rotated and pulled up-left so the asset's flat bottom crop exits
   the viewport; the section's overflow:hidden clips its top flush with the
   hero, so it reads as emerging from beneath the video. */
.leaf--st1 {
  left: 0;
  top: 0;
  width: clamp(360px, 44vw, 720px);
  transform: translate(-30%, -30%) rotate(-16deg);
  filter: drop-shadow(0 28px 40px rgba(20, 30, 20, 0.24));
  z-index: -3;
}

.leaf--st2 {
  right: 0;
  bottom: 6%;
  width: clamp(230px, 25vw, 420px);
  transform: translateX(40%) rotate(-9deg);
  filter: drop-shadow(0 22px 30px rgba(20, 30, 20, 0.2));
  opacity: 0.96;
  z-index: -1;
}

/* story — frond tip upper-left, bush right, frangipani low-left */
.leaf--sy1 {
  left: calc((100% - 100vw) / 2);
  top: 16%;
  width: clamp(260px, 26vw, 440px);
  transform: translateX(-46%) rotate(8deg);
  filter: drop-shadow(0 20px 28px rgba(20, 30, 20, 0.2));
  z-index: 2;
}

.leaf--sy2 {
  right: calc((100% - 100vw) / 2);
  top: 36%;
  width: clamp(260px, 26vw, 450px);
  transform: translateX(50%) rotate(16deg);
  filter: drop-shadow(0 20px 28px rgba(20, 30, 20, 0.2));
  z-index: 2;
}

.leaf--sy3 {
  left: calc((100% - 100vw) / 2);
  bottom: -4%;
  width: clamp(230px, 23vw, 400px);
  transform: translateX(-36%) rotate(-5deg);
  filter: drop-shadow(0 18px 26px rgba(20, 30, 20, 0.2));
  z-index: 2;
}

/* venue copy — diagonal frond from the right, bush low-left */
.leaf--ve1 {
  right: calc((100% - 100vw) / 2);
  top: 4%;
  width: clamp(180px, 18vw, 300px);
  transform: translateX(42%) rotate(-14deg);
  filter: drop-shadow(0 16px 24px rgba(20, 30, 20, 0.18));
  opacity: 0.97;
  z-index: 2;
}

.leaf--ve2 {
  left: calc((100% - 100vw) / 2);
  bottom: 8%;
  width: clamp(200px, 21vw, 360px);
  transform: translateX(-48%) rotate(-16deg);
  filter: drop-shadow(0 16px 24px rgba(20, 30, 20, 0.18));
  opacity: 0.95;
  z-index: -1;
}

/* travel — frond tip from the right */
.leaf--tr {
  right: calc((100% - 100vw) / 2);
  top: 8%;
  width: clamp(240px, 25vw, 430px);
  transform: translateX(45%) rotate(-6deg);
  filter: drop-shadow(0 18px 26px rgba(20, 30, 20, 0.18));
  opacity: 0.97;
  z-index: 2;
}

/* rsvp night — moonlit silhouettes (night bg: keep z >= 1) */
.leaf--rs1 {
  right: 0;
  top: 0;
  width: clamp(250px, 26vw, 440px);
  transform: translate(42%, -12%) rotate(9deg);
  filter: brightness(0.32) saturate(0.6);
  opacity: 0.9;
  z-index: 1;
}

.leaf--rs2 {
  left: 0;
  bottom: 4%;
  width: clamp(240px, 26vw, 430px);
  transform: translateX(-40%) rotate(8deg);
  filter: brightness(0.3) saturate(0.55);
  opacity: 0.85;
  z-index: 1;
}

/* registry night — moonlit frangipani (flipped to hang from the right) */
.leaf--rg {
  right: 0;
  bottom: -4%;
  width: clamp(190px, 20vw, 330px);
  transform: translateX(38%) scaleX(-1) rotate(-7deg);
  filter: brightness(0.62) saturate(0.85);
  opacity: 0.9;
  z-index: 1;
}

@media (max-width: 900px) {
  .leaf { display: none; }

  /* keep a few small accents on mobile, tucked behind content */
  .leaf--st1,
  .leaf--sy3,
  .leaf--rs1 {
    display: block;
    z-index: 0;
    width: clamp(150px, 36vw, 230px);
    opacity: 0.6;
  }
}

/* ---------- 18. Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.2s !important;
  }

  .preloader { animation: pl-safety 0.2s ease 0.3s forwards; }
  .marquee__track { animation: none; }
  .hero__media img { animation: none; }
}

/* ---------- 19. Garden gate (site password) ---------- */

/* returning guests: html.gate-open is set inline in <head> before first paint */
html.gate-open .gate { display: none; }

/* pin the page while the gate is up */
html.gate-locked { overflow: hidden; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 250; /* above preloader (200), below custom cursor (300) */
  overflow: hidden;
  color: var(--paper);
  /* no-GSAP / reduced-motion fallback: main.js adds .gate--open → simple fade */
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.gate--open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* the night behind the leaves — fades separately during the dolly so the
   foliage is still sweeping past while the site appears behind it */
.gate__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46% 34% at 50% 52%, rgba(244, 239, 228, 0.07) 0%, transparent 70%),
    radial-gradient(120% 90% at 50% 112%, rgba(21, 46, 33, 0.6) 0%, transparent 58%),
    radial-gradient(110% 80% at 50% -12%, rgba(13, 33, 29, 0.85) 0%, transparent 55%),
    var(--night);
}

.gate__fireflies { opacity: 0.55; }

.gleaf {
  position: absolute;
  pointer-events: none;
}

.gleaf img {
  width: 100%;
  height: auto;
  will-change: transform;
}

/* far plane — near-black shapes framing the clearing */
.gleaf--far-canopy { top: -16%; left: -12%; width: 74vw; min-width: 420px; transform: rotate(-9deg); }
.gleaf--far-canopy img { filter: brightness(0.25) saturate(0.5); }
.gleaf--far-bush { bottom: -20%; right: -13%; width: 50vw; min-width: 320px; transform: rotate(7deg); }
.gleaf--far-bush img { filter: brightness(0.22) saturate(0.5); }

/* mid plane */
.gleaf--mid-frondL { top: 14%; left: -10%; width: 42vw; min-width: 300px; transform: rotate(6deg); }
.gleaf--mid-frondL img { filter: brightness(0.45) saturate(0.7); }
.gleaf--mid-frondR { top: 30%; right: -11%; width: 44vw; min-width: 300px; transform: rotate(-7deg); }
.gleaf--mid-frondR img { filter: brightness(0.45) saturate(0.7); }
.gleaf--mid-frangi { bottom: -10%; left: -7%; width: 36vw; min-width: 250px; transform: rotate(10deg); }
.gleaf--mid-frangi img { filter: brightness(0.5) saturate(0.75); }
.gleaf--mid-palmL { bottom: -18%; left: -14%; width: 54vw; min-width: 340px; transform: rotate(-4deg); }
.gleaf--mid-palmL img { filter: brightness(0.38) saturate(0.65); }

/* near plane — big silhouettes that sweep past the camera on entry */
.gleaf--near-canopy { top: -14%; right: -16%; width: 90vw; min-width: 520px; transform: scaleX(-1) rotate(-8deg); }
.gleaf--near-canopy img { filter: brightness(0.5) saturate(0.8); }
.gleaf--near-hang { top: -13%; left: -8%; width: 46vw; min-width: 300px; transform: rotate(9deg); }
.gleaf--near-hang img { filter: brightness(0.58) saturate(0.85); }
.gleaf--near-bushL { bottom: -18%; left: -16%; width: 60vw; min-width: 380px; transform: rotate(6deg); }
.gleaf--near-bushL img { filter: brightness(0.5) saturate(0.8); }
.gleaf--near-bushR { bottom: -22%; right: -18%; width: 66vw; min-width: 400px; transform: rotate(-8deg); }
.gleaf--near-bushR img { filter: brightness(0.45) saturate(0.75); }

/* loading shroud — pure black over the streaming fronds, contracting into
   the card halo once they've decoded. html.gate-veil comes from the inline
   <head> script (locked + JS + no reduced motion — so no-JS and RM visitors
   never see it); main.js flips .gate--revealed on #gate when every .gleaf
   img has decoded (3.5s cap / 650ms floor). shroud-safety self-reveals if
   that never happens — same self-clearing idiom as pl-safety/gate-pending. */
.gate__shroud { display: none; }

html.gate-veil .gate__shroud {
  display: block;
  position: absolute;
  left: 50%;
  top: 48%; /* card's visual center (top 50%, translate -52%) */
  z-index: 10; /* over every .gleaf, under the card (20) */
  width: 760px;
  height: 660px;
  margin: -330px 0 0 -380px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    50% 50% at 50% 50%,
    #070f0e 0%,
    #070f0e 60%,
    rgba(7, 15, 14, 0.55) 74%,
    transparent 100%
  );
  transform: scale(12); /* solid core covers a 4k viewport corner-to-corner */
  will-change: transform, opacity;
  animation: shroud-safety 1.5s ease 4.5s forwards;
}

html.gate-veil .gate--revealed .gate__shroud {
  transform: scale(1);
  opacity: 0;
  transition:
    transform 1.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.9s ease 0.6s;
}

@keyframes shroud-safety {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

/* the clearing */
.gate__card {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  width: min(88vw, 480px);
  transform: translate(-50%, -52%);
  text-align: center;
  text-shadow: 0 1px 18px rgba(4, 10, 9, 0.55);
}

/* soft dark halo so the card reads over any frond behind it */
.gate__card::before {
  content: "";
  position: absolute;
  inset: -20% -16%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    50% 50% at 50% 50%,
    rgba(7, 15, 14, 0.78) 0%,
    rgba(7, 15, 14, 0.5) 55%,
    transparent 78%
  );
}

/* monogram seal above the names — same ring + G&B mark as the preloader.
   The ring sits fully drawn by default; motion.js rewinds dashoffset to 0
   and animates the draw as the first beat of the card entrance. */
.gate__seal {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.3rem;
}

.gate__seal-ring {
  stroke-dasharray: 170; /* 2πr, r=27 */
  transform: rotate(-90deg); /* draw starts at 12 o'clock */
  transform-origin: 50% 50%;
}

/* mask for the names' rise (hero .hword technique): overflow hidden on the
   wrapper, motion.js tweens the inner span yPercent 112 -> 0. Without JS the
   inner span rests at 0, so the names simply show. */
.gate__names-mask {
  display: block;
  overflow: hidden;
}

.gate__names-in {
  display: block;
  will-change: transform;
}

.gate__names {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
}

.gate__names i {
  font-family: var(--script);
  font-style: normal;
  color: var(--accent);
  padding: 0 0.1em;
}

.gate__line {
  margin-top: 1.1rem;
  font-size: 0.98rem;
  color: rgba(239, 231, 213, 0.92);
  line-height: 1.7;
}

.gate__row {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  margin: 1.8rem auto 0;
  width: min(78vw, 320px);
}

/* Entrance frame zero — html.gate-pending is set pre-paint by the inline
   <head> script so a cold load paints the card already in the entrance's
   starting pose (no finished-card flash while GSAP is in transit).
   motion.js mirrors these as inline GSAP states and drops the class; if it
   never runs, the delayed animations below reveal the card on their own —
   same self-clearing idea as the preloader's pl-safety. Delays sit just
   past motion.js's 2.5 s late-start cutoff so the two can't overlap. */
html.gate-pending .gate__seal-ring {
  stroke-dashoffset: 170;
  animation: gate-ring-in 1.1s ease-in-out 2.9s forwards;
}
html.gate-pending .gate__seal-text {
  opacity: 0;
  animation: gate-fade-in 0.6s ease 3.2s forwards;
}
html.gate-pending .gate__names-in {
  transform: translateY(112%);
  animation: gate-rise-in 0.9s var(--ease-out) 3s forwards;
}
html.gate-pending .gate__line,
html.gate-pending .gate__row {
  opacity: 0;
  transform: translateY(14px);
  animation: gate-fade-up 0.8s var(--ease-out) 3.1s forwards;
}

@keyframes gate-ring-in { to { stroke-dashoffset: 0; } }
@keyframes gate-fade-in { to { opacity: 1; } }
@keyframes gate-rise-in { to { transform: translateY(0); } }
@keyframes gate-fade-up { to { opacity: 1; transform: translateY(0); } }

.gate__input {
  flex: 1;
  min-width: 0;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--paper);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(239, 231, 213, 0.6);
  padding: 0.6em 0.2em;
  border-radius: 0;
  transition: border-color 0.3s;
}

.gate__input:focus {
  outline: none;
  border-bottom-color: var(--gold);
}

.gate__input::placeholder {
  color: rgba(239, 231, 213, 0.55);
  letter-spacing: 0.18em;
}

.gate__btn {
  flex: 0 0 auto;
  width: 2.9rem;
  font-size: 1.15rem;
  color: var(--paper);
  background: transparent;
  border: 1px solid rgba(239, 231, 213, 0.6);
  border-radius: 99px;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}

.gate__btn:hover,
.gate__btn:focus-visible {
  border-color: var(--gold);
  background: rgba(185, 138, 47, 0.12);
}

.gate__err {
  min-height: 1.6em;
  margin-top: 0.9rem;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: #f2b39f;
}

.gate__card.is-wrong .gate__row { animation: gate-shake 0.5s var(--ease-out); }

@keyframes gate-shake {
  15% { transform: translateX(-7px); }
  35% { transform: translateX(6px); }
  55% { transform: translateX(-4px); }
  75% { transform: translateX(3px); }
}

.gate__noscript {
  position: absolute;
  left: 50%;
  bottom: 8vh;
  transform: translateX(-50%);
  z-index: 30;
  width: min(86vw, 480px);
  text-align: center;
  font-size: 0.9rem;
  color: var(--paper-soft);
}

@media (max-width: 680px) {
  /* declutter small screens; keep the frame */
  .gleaf--mid-frondL,
  .gleaf--mid-palmL { display: none; }
  /* breathing room above the software keyboard */
  .gate__card { top: 46%; }
}
