/* =====================================================================
   GOLABII — Glass Ember pill (Join Waitlist in the top bar)
   A thick glass slab tilted back toward the light, as in the reference:
   the top face is lit cream → saffron → ember → black from its left end,
   a glowing rim runs round it, with a lit bevel along its lower edge. Gilded lettering sits in the middle. On hover the
   slab tips up, the glass fills with saffron from the lit end and the
   letters turn deep burgundy where the liquid reaches them.

   <a class="gp gp--cta" href="…">
     <span class="gp__glass">
       <i class="gp__fill" aria-hidden="true"></i>
       <i class="gp__shine" aria-hidden="true"></i>
       <span class="gp__label">Join Waitlist</span>
       <span class="gp__ink" aria-hidden="true">Join Waitlist</span>
     </span>
   </a>
   ===================================================================== */

@property --halo {
  syntax: '<number>';
  inherits: true;
  initial-value: 1;
}

.gp {
  --halo: 1;
  --h: 2.7em;                      /* height of the top face */
  --tilt: 22deg;
  --fill-t: 0.75s;
  position: relative;
  display: inline-block;
  perspective: 14em;
  perspective-origin: 50% 0%;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: --halo 0.5s ease;
}

.gp__glass {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  height: var(--h);
  border-radius: 999px;
  transform-origin: 50% 100%;
  transform: rotateX(var(--tilt));
  transition: transform 0.55s cubic-bezier(.2, .9, .25, 1.15);
}

/* the top face and its rim */
.gp__glass::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  border: 0.08em solid transparent;
  background:
    /* light caught along the upper face */
    linear-gradient(180deg, rgba(255, 244, 230, 0.16) 0%, rgba(255, 244, 230, 0) 45%) padding-box,
    /* a little darker toward the bottom of the face, so it reads as a solid slab */
    linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(25, 0, 4, 0.28) 100%) padding-box,
    /* the light, entering at the left end */
    linear-gradient(97deg,
      #fffaf0 0,
      #ffe9bc 0.55em,
      #ffcc6c 1.1em,
      #fb9a33 1.65em,
      #e5521d 2.2em,
      #b21e12 2.85em,
      #5a0509 3.8em,
      #240107 5.2em,
      #140004 72%,
      #1d0106 100%) padding-box,
    /* rim: cream on the lit end, glowing red round the dark end */
    linear-gradient(90deg,
      #fffaf2 0,
      #ffd29c 2.2em,
      #ff7f60 4em,
      #ff4a3c 78%,
      #ff9a86 100%) border-box;
  box-shadow:
    /* bevel inside the same shape: lit lower edge, softer upper edge */
    inset 0 -0.16em 0.14em rgba(255, 120, 90, 0.42),
    inset 0 0.07em 0.08em rgba(255, 240, 222, 0.22),
    /* glow */
    -0.2em 0 0.7em rgba(255, 210, 160, calc(0.34 * var(--halo))),
    0 0.1em 1.3em rgba(255, 110, 50, calc(0.26 * var(--halo))),
    0 0.2em 2.6em rgba(210, 30, 14, calc(0.22 * var(--halo)));
}

/* saffron that fills the glass on hover */
.gp__fill {
  position: absolute;
  inset: 0.08em;
  z-index: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 250, 235, 0.38) 0%, rgba(255, 250, 235, 0) 48%),
    linear-gradient(97deg, #fff8e8 0, #ffe7aa 18%, #ffc85c 42%, #fca237 66%, #f06a22 86%, #d63c18 100%);
}

/* a soft specular streak along the top of the face */
.gp__shine {
  position: absolute;
  z-index: 1;
  left: 1.1em;
  right: 1.3em;
  top: 0.16em;
  height: 0.5em;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 238, 215, 0.4), rgba(255, 238, 215, 0));
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 38%, transparent 62%);
          mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 38%, transparent 62%);
  pointer-events: none;
}

/* the fill and the burgundy letters are revealed by the same sweeping mask */
.gp__fill,
.gp__ink {
  -webkit-mask-image: linear-gradient(90deg, #000 44%, transparent 56%);
          mask-image: linear-gradient(90deg, #000 44%, transparent 56%);
  -webkit-mask-size: 250% 100%;
          mask-size: 250% 100%;
  -webkit-mask-position: 100% 0;
          mask-position: 100% 0;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  transition: -webkit-mask-position var(--fill-t) cubic-bezier(.3, .7, .2, 1),
                      mask-position var(--fill-t) cubic-bezier(.3, .7, .2, 1);
}

/* the gold letters are swept away by the opposite mask as the burgundy ones arrive */
.gp__label {
  -webkit-mask-image: linear-gradient(90deg, transparent 44%, #000 56%);
          mask-image: linear-gradient(90deg, transparent 44%, #000 56%);
  -webkit-mask-size: 250% 100%;
          mask-size: 250% 100%;
  -webkit-mask-position: 100% 0;
          mask-position: 100% 0;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  transition: -webkit-mask-position var(--fill-t) cubic-bezier(.3, .7, .2, 1),
                      mask-position var(--fill-t) cubic-bezier(.3, .7, .2, 1);
}

/* both copies of the label share one grid cell, so they sit dead centre */
.gp__label,
.gp__ink {
  grid-area: 1 / 1;
  z-index: 2;
  padding: 0.06em 1.45em 0;
}

/* gilded lettering with a dark burgundy edge: reads on the bright end and the dark end */
.gp__label {
  background: linear-gradient(180deg, #fffaf0 0%, #ffe8b4 38%, #f3b24c 58%, #ffdc94 80%, #fff1d2 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0.035em 0 #3a0307)
    drop-shadow(0 0 0.03em #3a0307)
    drop-shadow(0 0 0.03em #3a0307)
    drop-shadow(0 0.04em 0.18em rgba(30, 0, 5, 0.85));
}

.gp__ink {
  color: #3d0409;
  filter: drop-shadow(0 0.03em 0 rgba(255, 246, 228, 0.75));
}

/* hover (mouse) / keyboard focus / tapped: tip up toward you and fill with saffron */
.kbd .gp:focus-visible,
.gp.is-lit { --halo: 1.7; }
.kbd .gp:focus-visible .gp__glass,
.gp.is-lit .gp__glass { transform: rotateX(8deg) translateY(-0.08em); }
.kbd .gp:focus-visible :is(.gp__fill, .gp__ink, .gp__label),
.gp.is-lit :is(.gp__fill, .gp__ink, .gp__label) {
  -webkit-mask-position: 0 0;
          mask-position: 0 0;
}
@media (hover: hover) {
  .gp:hover { --halo: 1.7; }
  .gp:hover .gp__glass { transform: rotateX(8deg) translateY(-0.08em); }
  .gp:hover :is(.gp__fill, .gp__ink, .gp__label) {
    -webkit-mask-position: 0 0;
            mask-position: 0 0;
  }
}
.gp:active .gp__glass { transform: rotateX(14deg) scale(0.97); }
.main-nav .gp:focus-visible { outline: none !important; }   /* the saffron fill is the focus mark */

@media (prefers-reduced-motion: reduce) {
  .gp__glass, .gp__fill, .gp__ink, .gp__label { transition-duration: 0.01s; }
}

/* ---------- Join Waitlist sizing ---------- */
.gp--cta {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: 1.22rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.035em;
}
@media (max-width: 900px) {
  .gp--cta { font-size: 1rem; }
}
@media (max-width: 480px) {
  .gp--cta { font-size: 0.92rem; }
  .gp--cta .gp__label, .gp--cta .gp__ink { padding-inline: 1.2em; }
}
@media (max-width: 370px) {
  .gp--cta { font-size: 0.84rem; }
  .gp--cta .gp__label, .gp--cta .gp__ink { padding-inline: 1.05em; }
}
