/* =========================================================
   MOTION + NEON LAYER
   deck.css 위에 덮어쓰는 움직임·형광 연두 레이어
   ========================================================= */
:root {
  --neon: #C6FF3D;
  --neon-deep: #9BE000;
  --neon-glow: rgba(198, 255, 61, 0.45);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 진행 바 */
.progress-bar {
  background: linear-gradient(90deg, var(--neon-deep), var(--neon));
  box-shadow: 0 0 12px var(--neon-glow);
}

/* 배경: 흐르는 네온 광원 + 마우스 시차 */
#bg { overflow: hidden; }
#bg .bgl { will-change: transform; }
#bg .bgl:first-child {
  inset: -20%;
  background:
    radial-gradient(520px 380px at 20% 25%, rgba(198,255,61,0.20), transparent 70%),
    radial-gradient(620px 420px at 82% 78%, rgba(44,94,70,0.55), transparent 70%),
    radial-gradient(420px 320px at 70% 12%, rgba(200,90,50,0.14), transparent 70%);
  animation: bgDrift 18s ease-in-out infinite alternate;
  transform: translate(calc(var(--mx, 0) * -24px), calc(var(--my, 0) * -18px));
}
@keyframes bgDrift {
  from { filter: hue-rotate(0deg); background-position: 0 0, 0 0, 0 0; }
  to   { filter: hue-rotate(-14deg); background-position: 60px 40px, -50px -30px, 30px 50px; }
}
#bg .bgl + .bgl {
  background-image: radial-gradient(rgba(198,255,61,0.10) 1px, transparent 1px);
  background-size: 30px 30px;
  animation: gridFlow 24s linear infinite;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
}
@keyframes gridFlow { to { background-position: 30px 30px; } }

/* 슬라이드: 방향 전환 + 네온 테두리 */
.slide {
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(198,255,61,0.22), 0 0 70px rgba(198,255,61,0.10);
  animation: slideInR 0.5s var(--ease);
}
.slide.active[data-dir="back"] { animation-name: slideInL; }
@keyframes slideInR { from { opacity: 0; transform: translateX(46px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes slideInL { from { opacity: 0; transform: translateX(-46px) scale(0.985); } to { opacity: 1; transform: none; } }

/* 요소 차례로 등장 (data-step 요소는 제외) */
.slide.active .slide-body > *:not([data-step]) { animation: riseIn 0.6s var(--ease) backwards; }
.slide.active .slide-body > *:nth-child(1) { animation-delay: 0.08s; }
.slide.active .slide-body > *:nth-child(2) { animation-delay: 0.16s; }
.slide.active .slide-body > *:nth-child(3) { animation-delay: 0.24s; }
.slide.active .slide-body > *:nth-child(4) { animation-delay: 0.32s; }
.slide.active .slide-body > *:nth-child(n+5) { animation-delay: 0.4s; }
.slide.active .slide-header { animation: riseIn 0.5s var(--ease) backwards; }
@keyframes riseIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* 단계 등장: 튕기듯 */
.step { transition: opacity 0.45s var(--ease), transform 0.55s cubic-bezier(0.3, 1.4, 0.5, 1); }
html.stepped .step:not(.in) { transform: translateY(18px) scale(0.96); }

/* 헤더: 네온 스캔 라인 + 깜빡이는 점 */
.slide-header { position: relative; }
.slide-header::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 120px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon), transparent);
  box-shadow: 0 0 10px var(--neon-glow);
  animation: scanX 3.6s ease-in-out infinite;
}
@keyframes scanX { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 120px); opacity: 0; } }
.kicker::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 8px;
  background: var(--neon);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--neon), 0 0 0 1.5px var(--green);
  animation: blink 1.4s ease-in-out infinite;
  vertical-align: 1px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* 제목 형광펜 (.hl): 슬라이드 진입 시 그어짐 */
.hl {
  background: linear-gradient(transparent 58%, var(--neon) 58%, var(--neon) 92%, transparent 92%) no-repeat;
  background-size: 0% 100%;
  padding: 0 3px;
  margin: 0 -3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.slide.active .hl { animation: hlSweep 0.9s 0.55s var(--ease) forwards; }
@keyframes hlSweep { to { background-size: 100% 100%; } }

/* 카드: 호버 시 떠오르며 네온 테두리 */
.card, .sol-card, .flow-card, .service-col, .why-col {
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), opacity 0.45s var(--ease);
}
.card:hover, .sol-card:hover, .service-col:hover, .flow-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(27,58,44,0.16), 0 0 0 1.5px var(--neon-deep);
}
html.stepped .step:not(.in):hover { transform: translateY(18px) scale(0.96); }

/* 다크 카드/배너: 네온 포인트 */
.card.dark { position: relative; overflow: hidden; box-shadow: 0 0 0 1px rgba(198,255,61,0.28), 0 8px 24px rgba(27,58,44,0.25); }
.card.dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(198,255,61,0.16) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: sheen 5s 1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.card.dark .mono-label { color: var(--neon) !important; }

.answer-banner {
  background:
    radial-gradient(420px 160px at 85% 0%, rgba(198,255,61,0.20), transparent 70%),
    linear-gradient(120deg, #1B3A2C, #14291F 60%, #1B3A2C);
  background-size: 140% 140%, 100% 100%;
  animation: bannerFlow 9s ease-in-out infinite alternate;
  box-shadow: 0 0 0 1px rgba(198,255,61,0.30), 0 10px 30px rgba(27,58,44,0.3);
}
@keyframes bannerFlow { to { background-position: 30% 60%, 0 0; } }
.answer-banner .mono-label { color: var(--neon) !important; }
.plus { color: var(--neon); text-shadow: 0 0 12px var(--neon-glow); animation: plusPulse 1.8s ease-in-out infinite; }
@keyframes plusPulse { 50% { transform: scale(1.35); } }
.pillar strong { text-shadow: 0 0 14px rgba(198,255,61,0.35); }

/* 흐름 카드 사이 화살표 */
.flow-card:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -17px; top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green);
  color: var(--neon);
  border-radius: 50%;
  font-size: 11px; font-weight: 800;
  z-index: 2;
  box-shadow: 0 0 10px var(--neon-glow);
  animation: nudge 1.4s ease-in-out infinite;
}
@keyframes nudge { 50% { right: -21px; } }
.step.in .step-badge { animation: badgePop 0.7s var(--ease); }
@keyframes badgePop {
  0% { transform: scale(0.4) rotate(-20deg); box-shadow: 0 0 0 0 var(--neon-glow); }
  60% { transform: scale(1.25); }
  100% { transform: none; box-shadow: 0 0 0 12px rgba(198,255,61,0); }
}

/* 순환 바: 흐르는 점선 */
.loop-bar::before, .loop-bar::after {
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 10px, transparent 10px 18px);
  background-size: 18px 2px;
  opacity: 0.8;
  animation: dashFlow 1.2s linear infinite;
}
.loop-bar::before { animation-direction: reverse; }
@keyframes dashFlow { to { background-position: 18px 0; } }

/* 표지 */
.cover-right {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(420px 320px at 80% 15%, rgba(198,255,61,0.16), transparent 70%),
    var(--green);
}
.cover-right::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -30%;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(198,255,61,0.10), transparent);
  animation: scanY 6s linear infinite;
  pointer-events: none;
}
@keyframes scanY { to { top: 110%; } }
.dot-matrix span { animation: dotWave 3.4s ease-in-out infinite; }
@keyframes dotWave {
  0%, 100% { background: rgba(255,255,255,0.20); transform: scale(1); }
  50% { background: rgba(198,255,61,0.55); transform: scale(1.35); }
}
.dot-matrix span.hot { background: var(--neon); box-shadow: 0 0 12px var(--neon), 0 0 22px var(--neon-glow); animation: hotPulse 1.6s ease-in-out infinite; }
@keyframes hotPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 8px var(--neon); }
  50% { transform: scale(1.7); box-shadow: 0 0 22px var(--neon), 0 0 40px var(--neon-glow); }
}
.cover-toc .num { color: var(--neon); text-shadow: 0 0 10px var(--neon-glow); }
.cover-toc li:hover { color: var(--neon); }
.slide-cover.active .cover-main > * { animation: riseIn 0.8s var(--ease) backwards; }
.slide-cover.active .cover-main > :nth-child(1) { animation-delay: 0.15s; }
.slide-cover.active .cover-main > :nth-child(2) { animation-delay: 0.3s; }
.slide-cover.active .cover-main > :nth-child(3) { animation-delay: 0.5s; }
.slide-cover.active .cover-toc li { animation: slideInR 0.7s var(--ease) backwards; }
.slide-cover.active .cover-toc li:nth-child(1) { animation-delay: 0.5s; }
.slide-cover.active .cover-toc li:nth-child(2) { animation-delay: 0.62s; }
.slide-cover.active .cover-toc li:nth-child(3) { animation-delay: 0.74s; }
.slide-cover.active .cover-toc li:nth-child(4) { animation-delay: 0.86s; }
.cover-main h1::after {
  content: "";
  display: inline-block;
  width: 0.09em; height: 0.85em;
  margin-left: 0.12em;
  background: var(--green);
  vertical-align: -0.05em;
  animation: blink 1s ease-in-out infinite;
}

/* QR / 이미지 */
.qr-trio img, .qr-mini img { transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.qr-trio a:hover img { transform: translateY(-4px) scale(1.04); box-shadow: 0 0 0 2px var(--neon-deep), 0 10px 24px rgba(27,58,44,0.2); }
.sol-card img, .photo-figure img, .edu-photos img { transition: transform 0.6s var(--ease); }
.sol-card:hover img { transform: scale(1.04); }
.sol-card { overflow: hidden; }

/* 컨트롤 바 */
.controls { box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(198,255,61,0.25); }
.controls .counter, .controls .stepdots { color: var(--neon); }
.controls button:hover { background: rgba(198,255,61,0.16); border-color: var(--neon); }

/* 목차 */
.overview-item:hover, .overview-item.current { border-color: var(--neon-deep); box-shadow: 0 0 0 1.5px var(--neon-deep); }
.overview-item .code { color: var(--green-mid); }

/* 접근성 · 캡처 · 인쇄 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hl { background-size: 100% 100%; }
}
html.capture *, html.capture *::before, html.capture *::after { animation: none !important; }
html.capture .hl { background-size: 100% 100%; }
@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hl { background-size: 100% 100% !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .flow-card::after, .card.dark::before, .slide-header::after, .cover-right::after { display: none !important; }
}
