/* Crystal gw. Two glass letters that answer to the phone: tilt it and they lean in 3D, the
   light slides across the glass, and a quick shake makes them wobble on a spring before they
   settle. On desktop the pointer does the tilting. All motion is transform/opacity, driven by
   per-element custom properties (never inherited from :root). */
.crystal { --rx: 0deg; --ry: 0deg; --gx: 0px; --gy: 0px; --lx: 50%; --ly: 30%; --sx: 0px; --sy: 10px;
  position: relative; display: inline-flex; align-items: flex-end; font-size: var(--size, 120px); height: 1.12em; perspective: 9em; user-select: none; -webkit-user-select: none; pointer-events: none; }
.crystal__l { position: relative; display: block; transform-style: preserve-3d; will-change: transform;
  transform: translate3d(calc(var(--gx) * var(--depth, 1)), calc(var(--gy) * var(--depth, 1)), 0) rotateX(var(--rx)) rotateY(var(--ry)); }
.crystal__l--g { height: 1.12em; --depth: .7; }
.crystal__l--w { height: .784em; margin: 0 0 .01em -.143em; --depth: 1.25; }
.crystal__l img { display: block; height: 100%; width: auto; filter: drop-shadow(var(--sx) var(--sy) calc(.08em + 4px) rgba(0, 0, 0, .45)); }
/* the light: a soft hot spot and a thin streak that slide with the tilt, clipped to the letter */
.crystal__l i { position: absolute; inset: 0; -webkit-mask: var(--mask) center / 100% 100% no-repeat; mask: var(--mask) center / 100% 100% no-repeat; mix-blend-mode: screen; opacity: .9;
  background:
    radial-gradient(circle at var(--lx) var(--ly), rgba(255, 246, 225, .85) 0, rgba(255, 236, 200, .25) 9%, rgba(255, 255, 255, 0) 22%),
    linear-gradient(115deg, rgba(255,255,255,0) calc(var(--lx) - 14%), rgba(255, 250, 240, .55) var(--lx), rgba(255,255,255,0) calc(var(--lx) + 6%)); }
.crystal__l--g i { --mask: url(assets/brand/crystal/g-mask.png); }
.crystal__l--w i { --mask: url(assets/brand/crystal/w-mask.png); }

/* entrance: the letters rise and catch the light once (rare moment, so it may take its time) */
.crystal[data-enter] .crystal__l { opacity: 0; translate: 0 .12em; scale: .96; }
.crystal .crystal__l { transition: opacity 700ms ease, translate 900ms var(--ease-out), scale 900ms var(--ease-out); }
.crystal .crystal__l--w { transition-delay: 90ms; }

/* placements */
.crystal--hero { --size: clamp(88px, 9vw, 132px); display: flex; margin-bottom: 14px; }
.crystal--cap { --size: 27px; perspective: 3em; height: 1.12em; margin-top: 3px; }
/* small on navy glass: lift the glass so it reads as crystal, not grey */
.crystal--cap .crystal__l img { filter: brightness(1.55) contrast(1.15) saturate(1.1) drop-shadow(0 1px 1.5px rgba(0, 0, 0, .55)); }
.crystal--cap .crystal__l i { opacity: 1; }
.crystal--footer { --size: clamp(150px, 22vw, 300px); margin: 0 auto 18px; }
.crystal--door { --size: min(190px, 30vw); position: absolute; top: 50%; margin-top: calc(var(--size) * -1.62); }
.o-door--l .crystal--door { right: 22px; }
.o-door--r .crystal--door { left: 22px; }
.o-door--r .crystal__l--w { margin: 0 0 .02em 0; }

/* tilt hint for iPhone (motion needs one tap of permission) */
.crystal-hint { position: fixed; z-index: 70; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); translate: -50% 0; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; border-radius: 18px; background: rgba(15, 22, 42, .86); color: #f1ead9; font: 500 12px/1 "Inter", sans-serif; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 10px 24px -10px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(8px); transition: opacity 240ms ease, transform 300ms var(--ease-out); pointer-events: none; }
.crystal-hint[data-on] { opacity: 1; transform: none; pointer-events: auto; }
.crystal-hint svg { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  .crystal__l { transform: none !important; }
  .crystal[data-enter] .crystal__l { translate: none; scale: none; }
}

/* Footer drop: the stage is the floor the letters land on. Only the letters take the pointer,
   so the page keeps scrolling everywhere else. */
.ftr__drop { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.ftr:has(.ftr__drop) { padding-bottom: calc(clamp(190px, 22vw, 270px) + 30px); }
.drop { position: absolute; left: 0; top: 0; display: block; will-change: transform; touch-action: none; cursor: grab; pointer-events: auto; --lx: 50%; }
.drop[data-held] { cursor: grabbing; }
.drop img { display: block; width: 100%; height: 100%; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .45)); pointer-events: none; user-select: none; -webkit-user-select: none; }
.drop i { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; -webkit-mask: var(--mask) center / 100% 100% no-repeat; mask: var(--mask) center / 100% 100% no-repeat;
  background: linear-gradient(115deg, rgba(255,255,255,0) calc(var(--lx) - 14%), rgba(255, 250, 240, .5) var(--lx), rgba(255,255,255,0) calc(var(--lx) + 6%)); }
.drop--g i { --mask: url(assets/brand/crystal/g-mask.png); }
.drop--w i { --mask: url(assets/brand/crystal/w-mask.png); }
@media (max-width: 820px) { .ftr:has(.ftr__drop) { padding-bottom: calc(250px + env(safe-area-inset-bottom)); } }
