/* ============================================================
   Illumine — two-step guided hero
   Step 1: card form.   Step 2: Illumine converts fiat -> crypto.
   Core UI is pure black & white + dark neumorphism / glass.
   Color only appears in the crypto logos (the value we deliver).
   ============================================================ */

:root {
  --bg:        #050506;
  --ink:       #f4f4f6;
  --ink-dim:   rgba(244, 244, 246, 0.62);
  --ink-faint: rgba(244, 244, 246, 0.38);
  --line:      rgba(255, 255, 255, 0.10);
  --glass:     rgba(255, 255, 255, 0.035);
  --glass-2:   rgba(255, 255, 255, 0.06);

  --surface:   linear-gradient(145deg, #15151b 0%, #0b0b0e 100%);
  --neu-dark:  rgba(0, 0, 0, 0.6);
  --neu-light: rgba(255, 255, 255, 0.05);
  --shadow-deep: 0 40px 80px -30px rgba(0, 0, 0, 0.9);

  --r-lg: 26px;
  --r-md: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  background: radial-gradient(135% 120% at 50% -10%, #101016 0%, #060608 45%, var(--bg) 100%);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  min-height: 100svh;
}

/* ---------- ambient layers ---------- */

.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 480px; height: 480px; margin: -240px 0 0 -240px;
  border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.11) 0%, rgba(255,255,255,0.04) 35%, transparent 70%);
  transform: translate3d(-1000px, -1000px, 0);
  will-change: transform; mix-blend-mode: screen;
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(120% 90% at 50% 30%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ---------- layout ---------- */

.stage {
  position: relative; z-index: 2;
  height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: clamp(16px, 3vw, 32px) clamp(20px, 5vw, 64px);
  max-width: 1280px; margin: 0 auto;
}

.topbar { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 30px; height: 30px; display: block; overflow: visible;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.22));
}
.brand-name { font-weight: 600; letter-spacing: 0.14em; font-size: 17px; text-transform: uppercase; }

.hero {
  align-self: center;
  display: grid; grid-template-columns: 1.08fr 0.92fr;
  align-items: center; gap: clamp(24px, 5vw, 76px);
}
.hero > * { min-width: 0; }

/* ============================================================
   Animation stage + swipe transition
   ============================================================ */

.stage-anim { display: flex; flex-direction: column; gap: clamp(14px, 2.4vw, 26px); }
.scenes {
  position: relative;
  height: clamp(300px, 50svh, 430px);
  will-change: transform;
  overflow: hidden;
}

.scene {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 1;
  transform: translateX(100%);                 /* parked off-screen right */
  transition: transform 0.85s cubic-bezier(0.66, 0, 0.34, 1);
  pointer-events: none;
}
.scene.is-active  { transform: translateX(0); }       /* in frame */
.scene.is-leaving { transform: translateX(-100%); }   /* panned off-screen left */

/* connection beam — JS positions it from the form's right edge to the
   Illumine circle's left edge, tracking both as they pan (step 1 -> 2). */
.connector {
  position: absolute; top: 50%; left: 0; width: 0;
  height: 2px; transform: translateY(-50%);
  z-index: 5; pointer-events: none;
  opacity: 0; transition: opacity 0.3s ease;
}
.connector::before {
  content: ""; position: absolute; inset: 0; border-radius: 2px;
  background: linear-gradient(90deg, rgba(150,210,255,0.7) 0%, rgba(255,255,255,0.72) 50%, rgba(150,210,255,0.7) 100%);
  box-shadow: 0 0 10px rgba(120,200,255,0.55);
}
.connector-pulse {
  position: absolute; top: 50%; left: 0; width: 11px; height: 11px;
  margin: -5.5px 0 0 -5.5px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #ffffff 0%, rgba(120,200,255,0.85) 40%, transparent 70%);
  box-shadow: 0 0 14px 4px rgba(150,210,255,0.7);
}
.connector.is-connecting { opacity: 1; }
.connector.is-connecting .connector-pulse { animation: travelPulse 0.85s ease-in-out forwards; }
@keyframes travelPulse {
  0%   { left: 0;   opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
/* debug-only static state for ?pan=1 */
.connector.show { opacity: 1; }
.connector.show .connector-pulse { left: 55%; opacity: 1; animation: none; }

/* ============================================================
   Step 1 — checkout form
   ============================================================ */

.checkout {
  width: clamp(260px, 30vw, 360px);
  border-radius: var(--r-md);
  padding: clamp(20px, 2vw, 28px);
  display: flex; flex-direction: column; gap: 14px;
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.checkout-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 14px; color: var(--ink-dim); letter-spacing: 0.02em; }
.checkout-amt { font-size: 17px; font-weight: 600; color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.input {
  display: flex; align-items: center; min-height: 42px; padding: 0 13px;
  border-radius: 11px;
  background: linear-gradient(145deg, #0a0a0d, #131318);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.6), inset -2px -2px 5px rgba(255,255,255,0.03);
  font-family: ui-monospace, "SF Mono", "Cascadia Code", monospace;
  font-size: 14px; letter-spacing: 0.06em; color: var(--ink);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.field.is-active .input {
  border-color: rgba(255,255,255,0.28);
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.6), 0 0 0 3px rgba(255,255,255,0.06);
}
.caret { width: 1.5px; height: 17px; margin-left: 2px; background: var(--ink); opacity: 0; border-radius: 1px; }
.field.is-active .caret { animation: blink 1s steps(1) infinite; }
@keyframes blink { 0%, 50% { opacity: 0.9; } 51%, 100% { opacity: 0; } }

.pay-btn {
  margin-top: 6px; height: 46px; border: 0; border-radius: 12px;
  font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  color: #0a0a0c; cursor: default;
  background: linear-gradient(180deg, #ffffff, #d6d6dc);
  box-shadow: 0 10px 26px -10px rgba(255,255,255,0.45), inset 0 1px 1px rgba(255,255,255,0.9);
  transition: transform 0.25s ease, background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}
.pay-btn.is-loading { color: transparent; position: relative; transform: scale(0.99); }
.pay-btn.is-loading::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px;
  border-radius: 50%; border: 2px solid rgba(10,10,12,0.3); border-top-color: #0a0a0c;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pay-btn.is-done {
  color: #051b12;
  background: linear-gradient(180deg, #b8f5da, #6fe6b6);
  box-shadow: 0 12px 30px -10px rgba(56,232,176,0.5), inset 0 1px 1px rgba(255,255,255,0.8);
}

/* ============================================================
   Step 2 — Illumine converts (fiat -> crypto)
   ============================================================ */

.convert { position: relative; width: 100%; height: 100%; }

/* --- Illumine hub (left) --- */
.converter {
  position: absolute; left: 17%; top: 50%;
  transform: translate(-50%, -50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* --- merchant (right) --- */
.merchant {
  position: absolute; left: 83%; top: 50%;
  transform: translate(-50%, -50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.m-orb {
  display: grid; place-items: center;
  width: clamp(86px, 10vw, 120px); height: clamp(86px, 10vw, 120px);
  border-radius: 28px; color: rgba(255,255,255,0.82);
  background: var(--surface); border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 10px 10px 24px var(--neu-dark), -8px -8px 18px var(--neu-light), inset 0 1px 1px rgba(255,255,255,0.06);
}
.m-orb svg { width: 52%; height: 52%; }
.conv-stack { position: relative; width: clamp(98px, 11vw, 132px); height: clamp(98px, 11vw, 132px); display: grid; place-items: center; }
.conv-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(255,255,255,0.55);
  border-right-color: rgba(255,255,255,0.14);
  animation: spin 3.2s linear infinite;
}
.conv-ring-2 { inset: 10px; border-top-color: rgba(255,255,255,0.35); border-left-color: rgba(255,255,255,0.1); animation: spin 4.6s linear infinite reverse; }
.conv-core {
  width: 66%; height: 66%; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 8px 8px 20px var(--neu-dark), -6px -6px 14px var(--neu-light), inset 0 1px 1px rgba(255,255,255,0.06);
  animation: hubPulse 3s ease-in-out infinite;
}
@keyframes hubPulse {
  0%, 100% { box-shadow: 8px 8px 20px var(--neu-dark), -6px -6px 14px var(--neu-light), inset 0 1px 1px rgba(255,255,255,0.06), 0 0 0 0 rgba(255,255,255,0.12); }
  50%      { box-shadow: 8px 8px 20px var(--neu-dark), -6px -6px 14px var(--neu-light), inset 0 1px 1px rgba(255,255,255,0.06), 0 0 34px 4px rgba(255,255,255,0.12); }
}
.hub-mark {
  width: 58%; height: 58%; display: block; overflow: visible;
  filter: drop-shadow(0 0 7px rgba(255,255,255,0.28));
}
.conv-label { font-size: 12px; letter-spacing: 0.06em; color: var(--ink-dim); }

/* --- crypto tokens (flow Illumine -> merchant) --- */
.token {
  position: absolute; top: 50%; left: 17%;
  width: clamp(36px, 4.1vw, 50px); height: clamp(36px, 4.1vw, 50px);
  z-index: 1; opacity: 0;
  display: grid; place-items: center; border-radius: 50%;
}
.token svg { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 12px 26px -10px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08); }

/* Cycle with a small rest gap; each coin crosses during the first ~62%,
   then waits briefly. The visible window x 4 coins sets the on-screen density.
   --arc is the single arc height (negative = up, positive = down). */
.token-out { animation: flowOut var(--dur, 5.7s) linear infinite; animation-delay: var(--d, 0s); }

/* --lane keeps each coin on its own vertical track (so coins never fully
   cover each other); --arc bows outward from that lane mid-path. */
@keyframes flowOut {
  0%    { left: 17%; opacity: 0; transform: translate(-50%, calc(-50% + var(--lane, 0px))) scale(0.5); }
  4%    { opacity: 1; transform: translate(-50%, calc(-50% + var(--lane, 0px))) scale(1); }
  31%   { opacity: 1; transform: translate(-50%, calc(-50% + var(--lane, 0px) + var(--arc, -14px))) scale(1); }
  57%   { opacity: 1; transform: translate(-50%, calc(-50% + var(--lane, 0px))) scale(1); }
  62%   { left: 83%; opacity: 0; transform: translate(-50%, calc(-50% + var(--lane, 0px))) scale(0.55); }
  100%  { left: 83%; opacity: 0; transform: translate(-50%, calc(-50% + var(--lane, 0px))) scale(0.55); }
}

/* --- card-network badges (step 1) --- */
.net-badges { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; }
.net-badge {
  display: inline-flex; align-items: center; justify-content: center;
  height: 20px; padding: 0 3px; border-radius: 4px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.net-badge svg { height: 13px; width: auto; display: block; }
.net-badge { transition: opacity 0.25s ease, filter 0.25s ease; }
.net-badge.is-dim { opacity: 0.35; filter: grayscale(1); }
.field-num .typed { white-space: nowrap; }

/* ============================================================
   Step indicator
   ============================================================ */

.steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 2.4vw, 30px); }
.step { display: flex; align-items: center; gap: 9px; opacity: 0.4; transition: opacity 0.5s ease; }
.step.is-active { opacity: 1; }
.step-no {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: 12px; font-weight: 600; color: var(--ink-dim);
  background: var(--surface); border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 4px 4px 10px var(--neu-dark), -3px -3px 8px var(--neu-light);
  transition: color 0.5s ease, box-shadow 0.5s ease;
}
.step.is-active .step-no { color: #0a0a0c; background: linear-gradient(180deg, #ffffff, #d6d6dc); box-shadow: 0 6px 16px -6px rgba(255,255,255,0.4), inset 0 1px 1px rgba(255,255,255,0.9); }
.step-text { font-size: clamp(11px, 1vw, 13px); letter-spacing: 0.02em; color: var(--ink-dim); white-space: nowrap; }
.step.is-active .step-text { color: var(--ink); }

/* ============================================================
   Copy
   ============================================================ */

.copy { position: relative; border-radius: var(--r-lg); padding: clamp(26px, 3vw, 42px); }
.glass {
  position: relative;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(120%); -webkit-backdrop-filter: blur(22px) saturate(120%);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255,255,255,0.08);
}
/* Iridescent sheen: where the white cursor glow crosses the glass, a few small
   faint colour pockets bloom and drift — mostly clear glow with only minor
   rainbow hints scattered asymmetrically, not a symmetric spectral ring. Each
   lobe orbits the glow on its own slow timer (JS feeds --oxN/--oyN), so the
   colours wander and rarely line up. JS also feeds --gx/--gy (glow position
   relative to this panel) and --prism (0..1 proximity intensity). */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; z-index: 1;
  opacity: var(--prism, 0); mix-blend-mode: screen;
  background:
    radial-gradient(circle 124px
      at calc(var(--gx, 50%) + var(--ox1, 0px)) calc(var(--gy, 50%) + var(--oy1, 0px)),
      rgba(255, 70, 90, 0.03) 0%, rgba(255, 70, 90, 0) 64%),
    radial-gradient(circle 112px
      at calc(var(--gx, 50%) + var(--ox2, 0px)) calc(var(--gy, 50%) + var(--oy2, 0px)),
      rgba(255, 200, 80, 0.024) 0%, rgba(255, 200, 80, 0) 62%),
    radial-gradient(circle 134px
      at calc(var(--gx, 50%) + var(--ox3, 0px)) calc(var(--gy, 50%) + var(--oy3, 0px)),
      rgba(80, 230, 170, 0.026) 0%, rgba(80, 230, 170, 0) 64%),
    radial-gradient(circle 118px
      at calc(var(--gx, 50%) + var(--ox4, 0px)) calc(var(--gy, 50%) + var(--oy4, 0px)),
      rgba(120, 120, 255, 0.028) 0%, rgba(150, 90, 255, 0) 62%);
}
.headline { margin: 0; font-size: clamp(32px, 4.6vw, 58px); line-height: 1.02; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: break-word; }
.headline-accent { background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.55) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nb { white-space: nowrap; }
.subline { margin: clamp(14px, 1.8vw, 20px) 0 0; font-size: clamp(14px, 1.2vw, 16.5px); line-height: 1.55; color: var(--ink-dim); max-width: 40ch; font-weight: 300; }

.cta-row { margin-top: clamp(22px, 2.6vw, 32px); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.btn {
  text-decoration: none; font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  padding: 13px 24px; border-radius: 999px; white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn-primary {
  color: #0a0a0c; background: linear-gradient(180deg, #ffffff, #d8d8de);
  box-shadow: 0 10px 30px -8px rgba(255,255,255,0.4), inset 0 1px 1px rgba(255,255,255,0.9);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(255,255,255,0.55), inset 0 1px 1px rgba(255,255,255,0.9); }
.btn-ghost { color: var(--ink-dim); border: 1px solid var(--line); background: var(--glass-2); }
.btn-ghost:hover { color: var(--ink); border-color: rgba(255,255,255,0.3); transform: translateY(-2px); }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; padding: 0;
  color: var(--ink-faint); border: 1px solid var(--line); background: var(--glass-2);
}
.btn-icon:hover { color: var(--ink); border-color: rgba(255,255,255,0.3); transform: translateY(-2px); }
.btn-icon svg { display: block; }

/* ---------- footer ---------- */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--ink-faint); letter-spacing: 0.03em; }
.footer-main { display: flex; align-items: center; gap: 10px; }   /* wordmark + contact, bottom-left */
.footer a { color: var(--ink-faint); text-decoration: none; transition: color 0.25s ease, opacity 0.25s ease; }
.footer a:hover { color: var(--ink); }
.footer .dot { opacity: 0.5; }

/* legal links: bottom-right, smaller + more faded */
.footer-legal { display: flex; align-items: center; gap: 7px; font-size: 11px; opacity: 0.55; }
.footer-legal .dot { opacity: 0.6; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 940px) {
  /* Stacked layout: let the page grow and scroll on short phones instead of
     clipping, while staying vertically centred on tall ones. */
  body { overflow: hidden auto; }
  .stage { height: auto; min-height: 100svh; }
  .topbar { justify-content: center; }    /* centre the logo on mobile */
  .hero {
    grid-template-columns: 1fr;
    gap: clamp(18px, 4vw, 34px);
    padding: clamp(8px, 2vh, 22px) 0;     /* breathing room top & bottom */
  }
  /* tall enough to hold the whole card (incl. its float + focus glow) */
  .scenes { height: clamp(300px, 40svh, 360px); }
  .copy { text-align: center; }
  .subline { margin-left: auto; margin-right: auto; }
  .cta-row { justify-content: center; }
  .headline { font-size: clamp(30px, 7vw, 46px); }
}

@media (max-width: 560px) {
  .stage { padding: 16px 16px 20px; }
  .scenes { height: clamp(300px, 44svh, 340px); }
  .checkout { width: clamp(240px, 84vw, 310px); }
  .input { font-size: 12px; letter-spacing: 0.03em; }
  .net-badge { height: 16px; padding: 0 4px; }
  .net-badge svg { height: 11px; }
  .token { width: clamp(34px, 10.8vw, 45px); height: clamp(34px, 10.8vw, 45px); }
  .headline { font-size: clamp(28px, 8.4vw, 40px); }
  .subline { font-size: 14px; }
  .steps { display: none; }       /* hide the 1 / 2 step indicator on phones */
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn { text-align: center; }
  .desktop-only { display: none; }

  /* footer: hide the wordmark/contact line, keep just the legal links centred */
  .footer-main { display: none; }
  .footer { justify-content: center; }
}

@media (max-height: 700px) and (min-width: 941px) { .scenes { height: min(46svh, 380px); } }

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .checkout, .conv-ring, .conv-core, .token { animation: none !important; }
  .scene { transition: none; }
}
