/* gate.css — the veil's controls, laid over the cover's veiled photograph (css/cover.css).
 *
 * States (on <html>): is-gated + is-loading (first paint, head script) -> is-load-shown
 * (loader after 0.4 s) -> is-ready (every asset in: "Lift the veil", the hem breathes)
 * -> is-opening (the controls fade and rise 24 px in 300 ms; js/gate.js plays the veil clip)
 * -> the gate leaves the DOM. Only opacity / transform animate.
 */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
/* the controls cover exactly the cover's stage: the page column, one screen tall */
.gate__stage {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100%, var(--column));
  height: max(var(--stage-h), var(--stage-min));
  transform: translateX(-50%);
}
@media (min-width: 600px) {
  .gate__stage { box-shadow: 0 0 0 1px rgba(90, 70, 135, 0.08), 0 18px 60px rgba(59, 48, 84, 0.08); }
}

.veil {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  pointer-events: auto;
  touch-action: none;
  cursor: default;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}
.is-ready .veil { cursor: pointer; }
.veil:focus-visible { outline: none; }
.veil:focus-visible .monogram__arch path { stroke: var(--lilac-800); stroke-width: 1.6px; }
.is-opening .gate { pointer-events: none; }
.is-opening .veil { pointer-events: none; }

.veil__content {
  position: absolute;
  inset: 0;
  color: var(--ink);
}
.is-opening .veil__content {
  opacity: 0;
  transform: translate3d(0, -24px, 0);
  transition: opacity 300ms var(--ease-standard), transform 300ms var(--ease-standard);
}

/* upper half, on the pale veil: kicker + the arch monogram, a soft white bloom behind them
 * keeps ink at better than 4.5 : 1 where blossoms show through the tulle */
.veil__top {
  position: absolute;
  left: 0; right: 0;
  top: 17%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.veil__top::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 300px; height: 330px;
  margin: -165px 0 0 -150px;
  background: radial-gradient(closest-side, rgba(252, 251, 254, 0.86), rgba(252, 251, 254, 0.55) 55%, rgba(252, 251, 254, 0) 100%);
  pointer-events: none;
}
.veil__top > * { position: relative; }
.veil__kicker { color: var(--ink); }
/* the copy arrives with js/render.js: until then only the hairline arch shows */
.veil__kicker, .monogram__letters, .veil__loadtext { transition: opacity var(--motion-medium) var(--ease-standard); }
html:not(.is-rendered) .veil__kicker, html:not(.is-rendered) .monogram__letters, html:not(.is-rendered) .veil__loadtext { opacity: 0; }

.monogram {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  aspect-ratio: 100 / 145;
}
.monogram__arch { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.monogram__arch path { fill: none; stroke: var(--lilac-600); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.monogram__letters {
  position: relative;
  top: 10%;
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.monogram__letters em { font-size: 0.62em; color: var(--lilac-600); margin: 0 0.14em; position: relative; top: -0.06em; }
.veil .monogram__arch path { stroke: var(--lilac-800); }

/* bottom, just above the lace hem: progress, then "Lift the veil" */
.veil__foot {
  position: absolute;
  left: 0; right: 0;
  bottom: max(17%, 120px);
  display: grid;
  place-items: center;
  min-height: 52px;
}
/* the loader and "Lift the veil" each sit on a compact paper pill (the cue language used on
 * every photographic stage): ink on paper, no smudge of light on the tulle */
.veil__pill {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(50, 39, 76, 0.14);
  border-radius: 999px;
  background: rgba(251, 250, 253, 0.86);
}
.veil__load, .veil__cta { position: relative; grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.veil__load { opacity: 0; transition: opacity var(--motion-medium) var(--ease-standard); }
.is-load-shown .veil__load { opacity: 1; }
.is-ready .veil__load { opacity: 0; }
.veil__track { position: relative; display: block; width: 104px; height: 1px; background: rgba(90, 70, 135, 0.22); overflow: hidden; }
.veil__fill {
  position: absolute; inset: 0;
  background: var(--lilac-800);
  transform-origin: 0 50%;
  transform: scaleX(var(--load-p, 0));
  transition: transform 360ms var(--ease-standard);
}
.veil__loadtext { font-size: 11px; letter-spacing: 0.06em; color: var(--ink); font-style: normal; }

.veil__cta { opacity: 0; transform: translateY(6px); transition: opacity var(--motion-slow) var(--ease-standard), transform var(--motion-slow) var(--ease-standard); }
.is-ready .veil__cta { opacity: 1; transform: none; }
.veil__cta .veil__pill { padding: 9px 18px 9px 20px; }
.veil__cta .kicker { color: var(--lilac-800); font-weight: 400; }
.veil__load .veil__pill { flex-direction: column; gap: 9px; padding: 11px 20px 10px; }
.veil__chevron {
  width: 10px; height: 10px;
  border-left: 1.5px solid var(--lilac-800);
  border-top: 1.5px solid var(--lilac-800);
  transform: rotate(45deg);
}
.is-ready .veil__chevron { animation: veil-chevron 2.6s var(--ease-soft) infinite; }
@keyframes veil-chevron {
  0%   { transform: translateY(4px) rotate(45deg); opacity: 0.7; }
  40%  { opacity: 1; }
  75%  { transform: translateY(-4px) rotate(45deg); opacity: 0.7; }
  100% { transform: translateY(4px) rotate(45deg); opacity: 0.7; }
}

@media (min-width: 600px) {
  .veil__top { top: 15%; gap: 26px; }
  .veil .monogram { width: 112px; }
  .veil .monogram__letters { font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .is-opening .veil__content { transform: none; }
  .is-ready .veil__chevron { animation: none; }
  .veil__fill { transition: none; }
}
