/* ============================================================================
   EntryQ — Intro motion stylesheet
   Scope: dynamic hero QR, 3-A flow, 3-B micro motions, 3-C count-up, FAQ.
   Production tokens are provided by intro.css; this file does not define
   standalone token fallbacks or demo chrome styles.
   ========================================================================= */

/* ============================================================================
   3-A · 작동 흐름 4단계 다이어그램
   ========================================================================= */

.eq-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  position: relative;
  margin-top: 48px;
}

.eq-flow__step {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 28px 24px 26px;
  box-shadow: var(--glass-shadow);
  position: relative;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: box-shadow 320ms cubic-bezier(0.4, 0, 0.2, 1), transform 320ms cubic-bezier(0.4, 0, 0.2, 1), border-color 320ms cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.eq-flow__step:hover,
.eq-flow__step:focus-visible {
  box-shadow: var(--glass-shadow);
  transform: translateY(-2px);
  border-color: var(--aurora-violet);
}

/* Aurora-tinted left rule on each step */
.eq-flow__step::before {
  content: "";
  position: absolute;
  inset: 18px auto 18px 0;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--aurora-violet), var(--aurora-purple));
  opacity: 0.85;
}

.eq-flow__num {
  font: 500 11px/1 ui-monospace, "SF Mono", "JetBrains Mono", monospace;
  color: var(--aurora-purple);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eq-flow__icon {
  width: 44px;
  height: 44px;
  margin: 14px 0 18px;
  color: var(--aurora-purple);
}

.eq-flow__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.eq-flow__desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
  margin: 0;
}

/* Flow connector arrows between steps */
.eq-flow__connector {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.eq-flow__connector svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.eq-flow__connector path {
  fill: none;
  stroke: var(--aurora-violet);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 5 6;
  stroke-dashoffset: 200;
  opacity: 0;
}

/* ── Enter sequence (triggered by .is-playing on container) ── */
.eq-flow.is-playing .eq-flow__step {
  animation: eq-step-in 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.eq-flow.is-playing .eq-flow__step:nth-child(2) { animation-delay: 220ms; }
.eq-flow.is-playing .eq-flow__step:nth-child(3) { animation-delay: 440ms; }
.eq-flow.is-playing .eq-flow__step:nth-child(4) { animation-delay: 660ms; }

.eq-flow.is-playing .eq-flow__connector path {
  animation: eq-connector-flow 1400ms 200ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes eq-step-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes eq-connector-flow {
  0%   { stroke-dashoffset: 200; opacity: 0; }
  10%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

/* ── Single-step replay (triggered by .is-replaying on a step) ── */
.eq-flow__step.is-replaying {
  animation: eq-step-pulse 600ms ease-out;
}
.eq-flow__step.is-replaying .eq-flow__icon {
  animation: eq-icon-pop 500ms ease-out;
}

@keyframes eq-step-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
  60%  { box-shadow: 0 0 0 14px rgba(139, 92, 246, 0); }
  100% { box-shadow: var(--glass-shadow); }
}
@keyframes eq-icon-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ============================================================================
   3-B · 마이크로 모션
   ========================================================================= */

.eq-micros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.eq-micro {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eq-micro__stage {
  width: 100%;
  aspect-ratio: 1;
  max-width: 180px;
  position: relative;
  margin: 6px 0 22px;
}

.eq-micro__stage svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.eq-micro__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}

.eq-micro__desc {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 0;
}

/* ── QR scan ── */
.eq-qr__frame { fill: none; stroke: var(--ink-2); stroke-width: 4; }
.eq-qr__corner { fill: var(--ink-2); }
.eq-qr__pixel { fill: var(--ink-2); opacity: 0; }
.eq-qr__beam {
  stroke: var(--aurora-purple);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.6));
  opacity: 0;
}
.eq-qr__check-circle { fill: var(--aurora-purple); opacity: 0; }
.eq-qr__check-mark {
  fill: none;
  stroke: var(--surface);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 32;
  stroke-dashoffset: 32;
}

.eq-micro.is-playing .eq-qr__pixel {
  animation: eq-fade-in 240ms forwards;
}
.eq-micro.is-playing .eq-qr__pixel:nth-child(1) { animation-delay: 0ms; }
.eq-micro.is-playing .eq-qr__pixel:nth-child(2) { animation-delay: 40ms; }
.eq-micro.is-playing .eq-qr__pixel:nth-child(3) { animation-delay: 80ms; }
.eq-micro.is-playing .eq-qr__pixel:nth-child(4) { animation-delay: 120ms; }
.eq-micro.is-playing .eq-qr__pixel:nth-child(5) { animation-delay: 160ms; }
.eq-micro.is-playing .eq-qr__pixel:nth-child(6) { animation-delay: 200ms; }
.eq-micro.is-playing .eq-qr__pixel:nth-child(7) { animation-delay: 240ms; }

.eq-micro.is-playing .eq-qr__beam {
  animation: eq-qr-beam 1600ms 400ms ease-in-out forwards;
}
.eq-micro.is-playing .eq-qr__check-circle {
  animation: eq-fade-in 240ms 1900ms forwards;
}
.eq-micro.is-playing .eq-qr__check-mark {
  animation: eq-stroke-draw 360ms 2050ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes eq-qr-beam {
  0%   { transform: translateY(-50px); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(50px); opacity: 0; }
}

/* ── Approval check ── */
.eq-check__ring {
  fill: none;
  stroke: var(--ink-5);
  stroke-width: 4;
}
.eq-check__fill {
  fill: none;
  stroke: var(--aurora-purple);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transform-origin: 90px 90px;
  transform: rotate(-90deg);
}
.eq-check__mark {
  fill: none;
  stroke: var(--aurora-purple);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
}
.eq-check__sparkle { fill: var(--aurora-violet); opacity: 0; }

.eq-micro.is-playing .eq-check__fill {
  animation: eq-ring-fill 900ms ease-out forwards;
}
.eq-micro.is-playing .eq-check__mark {
  animation: eq-stroke-draw 520ms 700ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.eq-micro.is-playing .eq-check__sparkle {
  animation: eq-sparkle 1200ms 1200ms ease-out forwards;
}

@keyframes eq-ring-fill {
  to { stroke-dashoffset: 0; }
}
@keyframes eq-stroke-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes eq-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes eq-sparkle {
  0%   { opacity: 0; transform: scale(0); }
  40%  { opacity: 1; transform: scale(1.4); }
  100% { opacity: 0; transform: scale(1.8); }
}

/* ── Vehicle entry ── */
.eq-veh__ground { stroke: var(--ink-5); stroke-width: 2; stroke-dasharray: 4 6; }
.eq-veh__post { fill: var(--ink-3); }
.eq-veh__base { fill: var(--ink-2); }
.eq-veh__bar {
  fill: var(--aurora-purple);
  transform-origin: 28px 38px;
  transform: rotate(0deg);
}
.eq-veh__stripe { fill: var(--surface); opacity: 0.6; }
.eq-veh__car {
  fill: var(--aurora-deep);
  transform: translateX(-90px);
}
.eq-veh__window { fill: var(--aurora-violet); opacity: 0.7; }
.eq-veh__wheel { fill: var(--ink-2); }
.eq-veh__hub { fill: var(--ink-3); }
.eq-veh__exhaust { fill: var(--ink-4); opacity: 0; }

.eq-micro.is-playing .eq-veh__bar {
  animation: eq-bar-lift 700ms 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.eq-micro.is-playing .eq-veh__car {
  animation: eq-car-pass 2200ms 800ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.eq-micro.is-playing .eq-veh__exhaust {
  animation: eq-exhaust 2000ms 900ms ease-out forwards;
}

@keyframes eq-bar-lift {
  0%   { transform: rotate(0deg); }
  60%  { transform: rotate(-78deg); }
  100% { transform: rotate(-75deg); }
}
@keyframes eq-car-pass {
  0%   { transform: translateX(-90px); }
  100% { transform: translateX(220px); }
}
@keyframes eq-exhaust {
  0%   { opacity: 0; transform: translateX(-30px) scale(0.6); }
  30%  { opacity: 0.5; }
  100% { opacity: 0; transform: translateX(-80px) scale(1.4); }
}

/* ── Kakao alert ── */
.eq-kakao__phone {
  fill: var(--surface);
  stroke: var(--ink-3);
  stroke-width: 3;
}
.eq-kakao__screen { fill: var(--bg); }
.eq-kakao__notch { fill: var(--ink-3); }
.eq-kakao__bubble {
  fill: var(--aurora-purple);
  opacity: 0;
}
.eq-kakao__bubble--mint { fill: var(--aurora-mint); }
.eq-kakao__bubble-line {
  stroke: var(--surface);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.85;
}
.eq-kakao__ping {
  fill: none;
  stroke: var(--aurora-purple);
  stroke-width: 2;
  opacity: 0;
}

.eq-micro.is-playing .eq-kakao__bubble {
  animation: eq-bubble-up 800ms forwards cubic-bezier(0.16, 1, 0.3, 1);
}
.eq-micro.is-playing .eq-kakao__bubble:nth-of-type(1) { animation-delay: 300ms; }
.eq-micro.is-playing .eq-kakao__bubble:nth-of-type(2) { animation-delay: 700ms; }
.eq-micro.is-playing .eq-kakao__bubble:nth-of-type(3) { animation-delay: 1100ms; }

.eq-micro.is-playing .eq-kakao__ping {
  animation: eq-ping 1400ms 1400ms ease-out forwards;
}
.eq-micro.is-playing .eq-kakao__ping--delayed {
  animation-delay: 1700ms;
}

@keyframes eq-bubble-up {
  0%   { opacity: 0; transform: translateY(20px); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes eq-ping {
  0%   { opacity: 0.9; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(2.2); }
}

/* ============================================================================
   3-C · 카운트업 (도입 효과)
   ========================================================================= */

.eq-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.eq-count {
  background: linear-gradient(180deg, var(--surface), var(--bg));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.eq-count::after {
  content: "";
  position: absolute;
  inset: -50% -30% auto auto;
  width: 220px; height: 220px;
  background: radial-gradient(circle, var(--aurora-lilac), transparent 70%);
  opacity: 0.35;
  pointer-events: none;
}
[data-theme="dark"] .eq-count::after { opacity: 0.18; }

.eq-count__value {
  font: 500 clamp(40px, 5vw, 64px) / 1 ui-sans-serif, system-ui, "Apple SD Gothic Neo", sans-serif;
  letter-spacing: -0.04em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}
.eq-count__value-num {
  background: linear-gradient(135deg, var(--aurora-purple), var(--aurora-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eq-count__value-suffix {
  font-size: 0.45em;
  color: var(--ink-3);
  font-weight: 500;
}
.eq-count__label {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 500;
}
.eq-count__note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-4);
}

/* ============================================================================
   FAQ accordion (uses native <details>/<summary> for accessibility)
   ========================================================================= */

.eq-faq {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 40px;
}

.eq-faq__item {
  background: var(--surface);
  border: 1.5px solid var(--aurora-violet);
  border-radius: 28px;
  overflow: hidden;
  transition: box-shadow 280ms 320ms cubic-bezier(0.4, 0, 0.2, 1), border-color 280ms 320ms cubic-bezier(0.4, 0, 0.2, 1), border-radius 280ms 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
.eq-faq__item:hover {
  border-color: var(--aurora-purple);
}
.eq-faq__item[open] {
  border-radius: 22px;
  box-shadow: var(--glass-shadow);
}

.eq-faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  outline: none;
  user-select: none;
}
.eq-faq__q::-webkit-details-marker { display: none; }
.eq-faq__q:focus-visible {
  outline: 2px solid var(--aurora-purple);
  outline-offset: -4px;
  border-radius: 22px;
}

.eq-faq__icon {
  position: relative;
  width: 20px; height: 20px;
  flex-shrink: 0;
  color: var(--aurora-purple);
}
.eq-faq__icon::before,
.eq-faq__icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 2px;
}
.eq-faq__icon::before { width: 18px; height: 2px; }
.eq-faq__icon::after {
  width: 2px; height: 18px;
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate(-50%, -50%) rotate(0deg);
}
.eq-faq__item[open] .eq-faq__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.eq-faq__a {
  padding: 0 28px 24px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.75;
}
.eq-faq__item[open] .eq-faq__a {
  animation: eq-faq-slide-in 360ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes eq-faq-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .eq-faq__item[open] .eq-faq__a { animation: none !important; }
  .eq-faq__icon::after { transition: none !important; }
}

@media (max-width: 640px) {
  .eq-faq__q { padding: 18px 22px; font-size: 14px; gap: 14px; }
  .eq-faq__a { padding: 0 22px 22px; font-size: 13px; }
}

.eq-toggle {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--ink-2);
  width: 36px; height: 36px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color 180ms cubic-bezier(0.4, 0, 0.2, 1), border-color 180ms cubic-bezier(0.4, 0, 0.2, 1);
  font: 700 16px/1 "Pretendard", system-ui, sans-serif;
}
.eq-toggle:hover { color: var(--ink); border-color: var(--aurora-violet); }

.eq-hero__visual {
  background: linear-gradient(135deg, var(--aurora-purple), var(--aurora-deep));
  border-radius: 24px;
  width: min(100%, 520px);
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  margin-inline: auto;
}
.eq-hero__visual::before, .eq-hero__visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
}
.eq-hero__visual::before {
  width: 60%; height: 60%; top: -20%; left: -10%;
  background: var(--aurora-pink);
  opacity: 0.6;
  animation: eq-orb 12s ease-in-out infinite;
}
.eq-hero__visual::after {
  width: 50%; height: 50%; bottom: -10%; right: -10%;
  background: var(--aurora-mint);
  opacity: 0.4;
  animation: eq-orb 14s ease-in-out infinite reverse;
}

/* ── Dynamic QR card ── */
.eq-qr-live {
  position: relative;
  z-index: 1;
  width: 76%;
  max-width: 300px;
  background: white;
  border-radius: 22px;
  padding: 20px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow:
    0 24px 60px rgba(20, 12, 50, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.25);
  color: #1a1530;
}
.eq-qr-live__brand {
  display: flex; align-items: center; gap: 10px;
  font: 500 11px/1 ui-monospace, "SF Mono", monospace;
  letter-spacing: 0.14em;
  color: #6b6489;
}
.eq-qr-live__brand-mark {
  width: 16px; height: 16px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--aurora-purple), var(--aurora-pink));
}
.eq-qr-live__svg {
  width: 100%;
  aspect-ratio: 1;
  background: #fbfaff;
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
  overflow: visible;
}
.eq-qr-live__svg.is-fresh {
  animation: eq-qr-pop 420ms cubic-bezier(0.16, 1, 0.3, 1);
}
.eq-qr-live__svg rect { fill: #1a1530; }
@keyframes eq-qr-pop {
  0%   { opacity: 0; transform: scale(0.92); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}

.eq-qr-live__meta {
  display: flex; align-items: center; gap: 10px;
  font: 500 11px/1 ui-monospace, "SF Mono", monospace;
  color: #6b6489;
}
.eq-qr-live__pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--aurora-mint);
  flex-shrink: 0;
  animation: eq-qr-pulse 1.6s infinite cubic-bezier(0.4, 0, 0.6, 1);
}
@keyframes eq-qr-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(94, 234, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0); }
}
.eq-qr-live__label { color: #6b6489; }
.eq-qr-live__label b { color: var(--aurora-purple); font-weight: 600; font-variant-numeric: tabular-nums; }
.eq-qr-live__id {
  margin-left: auto;
  color: #9a93b6;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

@keyframes eq-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(30px, -30px) scale(1.15); }
}

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

@media (max-width: 960px) {
  .eq-flow, .eq-micros { grid-template-columns: repeat(2, 1fr); }
  .eq-counts { grid-template-columns: repeat(3, 1fr); }
  .eq-hero { grid-template-columns: 1fr; }
  .eq-hero__visual { max-width: 360px; justify-self: center; }
}

@media (max-width: 640px) {
  .eq-flow { grid-template-columns: 1fr; }
  .eq-micros { grid-template-columns: 1fr 1fr; }
  .eq-counts { grid-template-columns: 1fr; }
  .eq-flow__connector { display: none; }
}

@media (max-width: 520px) {
  .top-nav { gap: 12px; }
  .top-nav .btn { display: none; }
}

/* ============================================================================
   prefers-reduced-motion — keep final state, kill motion
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  .eq-flow .eq-flow__step,
  .eq-flow.is-playing .eq-flow__step {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .eq-flow__connector path,
  .eq-flow.is-playing .eq-flow__connector path {
    animation: none !important;
    stroke-dashoffset: 0 !important;
    opacity: 1 !important;
  }
  .eq-micro.is-playing *,
  .eq-micro * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
  .eq-qr__beam { opacity: 0 !important; }
  .eq-veh__bar { transform: rotate(-75deg) !important; }
  .eq-veh__car { transform: translateX(80px) !important; }
  .eq-hero__visual::before, .eq-hero__visual::after { animation: none !important; }
}
