/* ============================================================
   TyraTag Home v4 — interactive "How it works"
   Dark indigo stage + animated phone. Namespace: .gn-how
   ============================================================ */

.gn-how {
  position: relative;
  background:
    radial-gradient(90% 120% at 12% -10%, rgba(139,145,224,0.5), transparent 50%),
    radial-gradient(80% 120% at 100% 110%, rgba(206,146,88,0.18), transparent 55%),
    linear-gradient(180deg, #34376f 0%, #2c2e60 100%);
  color: #eceefb;
  overflow: clip;
  padding: 84px 0 92px;
}

.gn-how-wrap { max-width: 1560px; margin: 0 auto; padding: 0 44px; }

.gn-how-head { text-align: center; max-width: 40ch; margin: 0 auto; }
.gn-how-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fur-light);
}
.gn-how-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 54px);
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin-top: 14px;
}
.gn-how-head h2 em { font-style: normal; color: var(--fur-light); }
.gn-how-head p {
  margin: 16px auto 0;
  font-size: 16px;
  color: rgba(236,238,251,0.7);
  max-width: 52ch;
}

/* ---- stage layout ---- */
.gn-how-stage {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

/* ---- step list ---- */
.gn-how-steps { display: flex; flex-direction: column; gap: 10px; }
.gn-how-step {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  overflow: hidden;
  transition: background 280ms var(--ease-out), border-color 280ms var(--ease-out), transform 280ms var(--ease-out);
}
.gn-how-step:hover { background: rgba(255,255,255,0.06); }
.gn-how-step.active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(206,146,88,0.55);
  transform: translateX(4px);
}
.gn-how-num {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: rgba(236,238,251,0.55);
  border: 1.5px solid rgba(255,255,255,0.18);
  flex: none;
  transition: all 280ms var(--ease-out);
}
.gn-how-step.active .gn-how-num {
  background: var(--fur-light);
  border-color: var(--fur-light);
  color: #2a2c5a;
  box-shadow: 0 0 0 6px rgba(206,146,88,0.16);
}
.gn-how-info h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: #fff;
}
.gn-how-info p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(236,238,251,0.62);
  max-width: 40ch;
}
/* dwell progress bar (only animates on active) */
.gn-how-bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  width: 100%;
  background: transparent;
}
.gn-how-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--fur-light), #f0c89a);
  border-radius: 0 3px 3px 0;
}
.gn-how-step.active .gn-how-bar i { width: 100%; transition: width var(--gn-how-dwell, 5200ms) linear; }

/* ---- phone ---- */
.gn-how-phone {
  position: relative;
  display: flex;
  justify-content: center;
}
.gn-how-phone::before {
  content: "";
  position: absolute;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(206,146,88,0.32), transparent 68%);
  filter: blur(8px);
  z-index: 0;
}
.gn-how-device {
  position: relative;
  z-index: 1;
  width: 300px;
  height: 612px;
  border-radius: 44px;
  background: #0e0f23;
  padding: 12px;
  box-shadow:
    0 40px 80px -28px rgba(0,0,0,0.6),
    inset 0 0 0 2px rgba(255,255,255,0.06),
    0 0 0 9px #1a1b3a;
}
.gn-how-notch {
  position: absolute;
  top: 22px; left: 50%; transform: translateX(-50%);
  width: 116px; height: 26px;
  background: #0e0f23;
  border-radius: 0 0 16px 16px;
  z-index: 6;
}
.gn-how-viewport {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 33px;
  overflow: hidden;
  background: #fafbff;
}

/* generic screen stacking */
.gn-how-screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(14px) scale(0.99);
  transition: opacity 460ms var(--ease-out), transform 460ms var(--ease-out);
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.gn-how-screen.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ===== static photo placeholder (awaiting real screen photos) ===== */
.gn-ph {
  background:
    repeating-linear-gradient(45deg, #eef0fb, #eef0fb 11px, #e6e9f7 11px, #e6e9f7 22px);
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gn-ph-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 20px 24px;
  text-align: center;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--gn-line);
  border-radius: 16px;
  box-shadow: 0 10px 26px -18px rgba(34,36,90,0.45);
}
.gn-ph-idx { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--gn-peri); }
.gn-ph-card b { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; color: var(--ink); }
.gn-ph-card small { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-60); }

/* status bar */
.gn-how-status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  flex: none;
}
.gn-how-status .dots { display: flex; gap: 4px; align-items: center; }
.gn-how-status .dots span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.5; }

/* ===== Screen 0: tag active ===== */
.s-tag { background: linear-gradient(180deg, #eceefb, #f7f8ff); color: var(--ink); }
.s-tag .gn-how-status { color: var(--ink-60); }
.s-tag .tag-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 10px 26px 30px; }
.tag-card {
  width: 168px;
  background: #f0e2c4;
  border-radius: 22px;
  padding: 18px 16px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  box-shadow: 0 20px 34px -18px rgba(51,53,111,0.5);
  transform: rotate(-4deg);
}
.tag-card .qr { width: 104px; height: 104px; border-radius: 12px; background: #fff; padding: 8px; }
.tag-card .qr canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.tag-card .code { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--ink-deep); }
.tag-claim {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--soft-green); color: var(--green);
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  padding: 9px 16px; border-radius: 999px;
}
.tag-claim svg { flex: none; }
.tag-meta { text-align: center; }
.tag-meta b { display: block; font-family: var(--font-display); font-size: 16px; letter-spacing: -0.01em; }
.tag-meta span { font-size: 12.5px; color: var(--ink-60); }

/* ===== Screen 1: camera scan ===== */
.s-scan { background: #0c0c1c; color: #fff; }
.s-scan .gn-how-status { color: rgba(255,255,255,0.7); }
.scan-body { position: relative; flex: 1; overflow: hidden; }
.scan-body img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.scan-body::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 40%, transparent 40%, rgba(0,0,0,0.55)); }
.scan-reticle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 168px; height: 168px;
  z-index: 3;
}
.scan-reticle span {
  position: absolute; width: 30px; height: 30px;
  border: 3px solid var(--fur-light);
}
.scan-reticle span:nth-child(1) { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.scan-reticle span:nth-child(2) { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 8px 0 0; }
.scan-reticle span:nth-child(3) { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 8px; }
.scan-reticle span:nth-child(4) { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 8px 0; }
.scan-line {
  position: absolute; left: 6px; right: 6px; top: 6px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--fur-light), transparent);
  box-shadow: 0 0 12px 2px rgba(206,146,88,0.7);
  border-radius: 3px;
}
.gn-how-screen.show .scan-line { animation: scanmove 1.9s var(--ease-out) infinite; }
@keyframes scanmove {
  0% { transform: translateY(0); }
  50% { transform: translateY(150px); }
  100% { transform: translateY(0); }
}
.scan-banner {
  position: absolute; left: 16px; right: 16px; bottom: 18px; z-index: 4;
  background: rgba(255,255,255,0.96);
  color: var(--ink);
  border-radius: 16px;
  padding: 13px 15px;
  display: flex; align-items: center; gap: 12px;
  transform: translateY(80px); opacity: 0;
  transition: transform 520ms var(--ease-out) 700ms, opacity 520ms ease 700ms;
}
.gn-how-screen.show .scan-banner { transform: none; opacity: 1; }
.scan-banner .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--gn-peri); display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.scan-banner b { display: block; font-family: var(--font-display); font-size: 13.5px; }
.scan-banner small { font-family: var(--font-mono); font-size: 11px; color: var(--ink-60); }

/* ===== Screen 2: verify / safety ===== */
.s-verify { background: #fafbff; color: var(--ink); }
.s-verify .gn-how-status { color: var(--ink-60); }
.verify-body { flex: 1; padding: 14px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.verify-911 {
  display: flex; align-items: center; gap: 11px;
  background: color-mix(in oklab, var(--red) 12%, #fff);
  border: 1px solid color-mix(in oklab, var(--red) 35%, #fff);
  border-radius: 14px; padding: 12px 14px;
}
.verify-911 .badge { width: 30px; height: 30px; border-radius: 9px; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.verify-911 b { display: block; font-family: var(--font-display); font-size: 13px; color: var(--red); }
.verify-911 small { font-size: 11px; color: var(--ink-60); }
.verify-head { margin-top: 2px; }
.verify-head b { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; display: block; }
.verify-head span { font-size: 12.5px; color: var(--ink-60); }
.verify-code { display: flex; gap: 9px; }
.verify-code i {
  flex: 1; aspect-ratio: 1; border-radius: 12px;
  border: 1.5px solid var(--gn-line); background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 20px; color: var(--ink-deep);
  font-style: normal;
}
.gn-how-screen.show .verify-code i { animation: codepop 360ms var(--ease-out) backwards; }
.gn-how-screen.show .verify-code i:nth-child(1) { animation-delay: 600ms; }
.gn-how-screen.show .verify-code i:nth-child(2) { animation-delay: 820ms; }
.gn-how-screen.show .verify-code i:nth-child(3) { animation-delay: 1040ms; }
.gn-how-screen.show .verify-code i:nth-child(4) { animation-delay: 1260ms; }
@keyframes codepop {
  0% { opacity: 0; transform: scale(0.6); border-color: var(--gn-peri); }
  60% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); border-color: var(--gn-peri); }
}
.verify-ok {
  margin-top: auto;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--green); color: #fff;
  border-radius: 14px; padding: 14px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  opacity: 0; transform: translateY(10px);
  transition: opacity 400ms ease 1500ms, transform 400ms var(--ease-out) 1500ms;
}
.gn-how-screen.show .verify-ok { opacity: 1; transform: none; }

/* ===== Screen 3: masked connect ===== */
.s-connect { background: linear-gradient(180deg, #2c2e60, #1c1d40); color: #fff; }
.s-connect .gn-how-status { color: rgba(255,255,255,0.7); }
.connect-body { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 26px 24px 26px; }
.connect-avatar {
  width: 96px; height: 96px; border-radius: 50%; margin-top: 20px;
  background: linear-gradient(150deg, var(--gn-peri), #bbc1ee);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 34px; color: #fff;
  box-shadow: 0 0 0 0 rgba(206,146,88,0.5);
}
.gn-how-screen.show .connect-avatar { animation: ring 2s ease-out infinite; }
@keyframes ring {
  0% { box-shadow: 0 0 0 0 rgba(206,146,88,0.45); }
  100% { box-shadow: 0 0 0 26px rgba(206,146,88,0); }
}
.connect-name { margin-top: 18px; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.connect-status { margin-top: 5px; font-family: var(--font-mono); font-size: 11.5px; color: var(--fur-light); letter-spacing: 0.06em; }
.connect-masked {
  margin-top: 22px;
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px; padding: 10px 16px;
  font-size: 12.5px; color: rgba(236,238,251,0.82);
}
.connect-masked svg { color: var(--fur-light); flex: none; }
.connect-actions { margin-top: auto; display: flex; gap: 26px; }
.connect-actions button {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; color: #fff;
}
.connect-actions .msg { background: rgba(255,255,255,0.12); }
.connect-actions .call { background: var(--green); box-shadow: 0 10px 24px -8px rgba(15,107,75,0.8); }

@media (prefers-reduced-motion: reduce) {
  .scan-line, .verify-code i, .connect-avatar { animation: none !important; }
  .gn-how-step.active .gn-how-bar i { transition: none; width: 100%; }
}

/* ---- responsive ---- */
@media (max-width: 1000px) {
  .gn-how-stage { grid-template-columns: 1fr; gap: 44px; }
  .gn-how-steps { order: 2; max-width: 560px; margin: 0 auto; width: 100%; }
  .gn-how-phone { order: 1; }
}
@media (max-width: 600px) {
  .gn-how-wrap { padding-left: 22px; padding-right: 22px; }

  /* two-up grid of steps instead of a tall list */
  .gn-how-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: none; }
  .gn-how-step { grid-template-columns: 1fr; gap: 12px; padding: 16px 14px; align-content: start; }
  .gn-how-step.active { transform: none; }
  .gn-how-num { width: 36px; height: 36px; font-size: 15px; }
  .gn-how-info h4 { font-size: 16px; }
  .gn-how-info p { font-size: 12.5px; line-height: 1.45; }
}
