/* ==========================================================================
   ZEC PAY — 3D intro (see js/intro.js). Turn off with features.intro = false.
   Layers: page (hidden) < intro-bg 60 < hero/ribbon 70 < intro-ui 80
           < intro-dark 90 < skip 95 < cursor 200
   ========================================================================== */
html.intro-on { overflow: hidden; scroll-behavior: auto; }
html.intro-on body { overflow: hidden; }
html.intro-on .hero { overflow: visible; z-index: 70; }
html.intro-on .ribbon.fallback { animation: none; }

/* Page content waits behind the intro, then fades in as the ribbon flies home */
html.intro-on #site-header,
html.intro-on .hero-in,
html.intro-on .hero .logos,
html.intro-on .guides,
html.intro-on main > section:not(.hero),
html.intro-on #site-footer {
  transition: opacity .9s ease .75s, transform 1.1s cubic-bezier(.2,.8,.2,1) .75s;
}
html.intro-hide #site-header,
html.intro-hide .hero-in,
html.intro-hide .hero .logos,
html.intro-hide .guides,
html.intro-hide main > section:not(.hero),
html.intro-hide #site-footer { opacity: 0; pointer-events: none; }
html.intro-hide .hero-in { transform: translateY(22px); }

/* Custom cursor (mouse/trackpad only) */
html.intro-fine, html.intro-fine * { cursor: none !important; }
.intro-cursor {
  position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; opacity: 0;
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  border: 1.5px solid var(--navy); display: grid; place-items: center;
  transition: opacity .25s, width .3s cubic-bezier(.2,.8,.2,1), height .3s cubic-bezier(.2,.8,.2,1), margin .3s cubic-bezier(.2,.8,.2,1), background-color .3s, border-color .3s;
}
.intro-cursor i { width: 6px; height: 6px; border-radius: 50%; background: var(--zec); box-shadow: 0 0 10px 2px rgba(244,183,40,.7); }
.intro-cursor.on-dark { border-color: rgba(255, 214, 120, .85); }
.intro-cursor.hot { width: 70px; height: 70px; margin: -35px 0 0 -35px; background: rgba(244,183,40,.22); border-color: var(--zec); }

/* ---------- Light stage background ---------- */
.intro-bg {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: #fffaf0; transition: opacity .9s ease .15s;
}
.intro-glow { position: absolute; border-radius: 50%; filter: blur(60px); }
.intro-glow.g1 { width: 70vmax; height: 70vmax; left: 50%; top: 50%; margin: -35vmax 0 0 -35vmax; background: radial-gradient(closest-side, rgba(255, 226, 150, .75), rgba(255, 226, 150, 0)); animation: introBreathe 6s ease-in-out infinite; }
.intro-glow.g2 { width: 40vmax; height: 40vmax; left: 8%; bottom: -14vmax; background: radial-gradient(closest-side, rgba(244, 183, 40, .28), rgba(244, 183, 40, 0)); animation: introBreathe 8s ease-in-out -3s infinite; }
@keyframes introBreathe { 50% { transform: scale(1.12); opacity: .8; } }
html.intro-leaving .intro-bg { opacity: 0; }

/* ---------- 3D glow stage ---------- */
.intro-dark { position: fixed; inset: 0; z-index: 90; background: #030a14; transition: opacity .8s ease; }
.intro-dark canvas { width: 100%; height: 100%; display: block; }
.intro-dark.out { opacity: 0; pointer-events: none; }
.intro-dark.fast { transition-duration: .35s; }

/* ---------- Enter screen ---------- */
.intro-ui {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; perspective: 1000px; pointer-events: none;
}
.intro-ui.show { pointer-events: auto; }
.intro-ui > * { transform-style: preserve-3d; }
.intro-kicker {
  margin: 0 0 18px; font-size: 15px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--zec-ink); background: rgba(255, 255, 255, .7); padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--zec-border); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.intro-word {
  margin: 0; display: flex; justify-content: center; perspective: 900px;
  font-size: clamp(76px, 16vw, 260px); line-height: .9; letter-spacing: -0.05em; color: var(--navy);
  font-weight: 700; text-shadow: 0 0 60px rgba(255, 250, 235, .7);
}
.intro-word span { display: inline-block; transform-origin: 50% 80%; }
.intro-word span.thin { font-weight: 300; }
.intro-sub {
  margin: 26px 0 38px; font-size: clamp(17px, 1.4vw, 21px); color: var(--slate-2); max-width: 30em;
  background: rgba(255, 255, 255, .62); padding: 8px 16px; border-radius: 8px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.intro-enter {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 36px; border: 0; border-radius: 999px;
  background: var(--navy); color: #fff; font: inherit; font-size: 18px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 18px 40px -16px rgba(6, 27, 49, .55), 0 0 0 0 rgba(244, 183, 40, .55);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .3s, background-color .25s;
}
.intro-enter .chev { width: 14px; height: 14px; color: var(--zec); transition: transform .25s; }
.intro-enter::after {
  content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 1.5px solid rgba(244, 183, 40, .7);
  opacity: 0; animation: introPulse 2.4s ease-out 3s infinite; pointer-events: none;
}
.intro-enter:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 24px 50px -16px rgba(6, 27, 49, .6), 0 0 0 8px rgba(244, 183, 40, .28); }
.intro-enter:hover .chev { transform: translateX(3px); }
.intro-enter:focus-visible { outline: 3px solid var(--zec); outline-offset: 4px; }
@keyframes introPulse { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.25); } }
.intro-hint { position: absolute; bottom: 28px; left: 0; right: 0; margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate); }
.intro-skip {
  position: fixed; right: 24px; bottom: 22px; z-index: 95;
  background: rgba(255, 255, 255, .12); color: #cfd8e3; border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px; height: 36px; padding: 0 16px; font: inherit; font-size: 13px; font-weight: 500;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: color .4s, background-color .4s, border-color .4s;
}
.intro-dark.out ~ .intro-skip, .intro-ui.show ~ .intro-skip { color: var(--slate-2); background: rgba(255, 255, 255, .7); border-color: var(--line); }
.intro-skip:hover { color: var(--navy); }
.intro-skip:focus-visible { outline: 2px solid var(--zec); outline-offset: 3px; }

/* Entrances: hidden until .show, then 3D drop-in from depth */
.intro-ui:not(.show) .intro-kicker,
.intro-ui:not(.show) .intro-word span,
.intro-ui:not(.show) .intro-sub,
.intro-ui:not(.show) .intro-enter,
.intro-ui:not(.show) .intro-hint { opacity: 0; }
.intro-ui.show .intro-word span { animation: introLetter 1.15s cubic-bezier(.16,.9,.24,1) both; animation-delay: calc(var(--i) * 75ms); }
.intro-ui.show .intro-kicker { animation: introRise .9s cubic-bezier(.2,.8,.2,1) both; }
.intro-ui.show .intro-sub { animation: introRise .9s cubic-bezier(.2,.8,.2,1) .55s both; }
.intro-ui.show .intro-enter { animation: introRise .9s cubic-bezier(.2,.8,.2,1) .75s both; }
.intro-ui.show .intro-hint { animation: introFade 1s ease 1.4s both; }
@keyframes introLetter {
  from { opacity: 0; transform: translateZ(-700px) translateY(60px) rotateX(-75deg); filter: blur(14px); }
  60% { opacity: 1; filter: blur(0); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes introRise { from { opacity: 0; transform: translateY(24px) translateZ(-120px); } to { opacity: 1; transform: none; } }
@keyframes introFade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 720px) {
  .intro-kicker { font-size: 12px; letter-spacing: .14em; }
  .intro-enter { height: 58px; padding: 0 28px; font-size: 16px; }
  .intro-skip { right: 14px; bottom: 14px; }
  .intro-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-ui.show .intro-word span, .intro-ui.show > * { animation: none !important; }
  .intro-glow { animation: none; }
  html.intro-on #site-header, html.intro-on .hero-in, html.intro-on .hero .logos, html.intro-on .guides,
  html.intro-on main > section:not(.hero), html.intro-on #site-footer { transition: opacity .3s; }
}
