/* ═══════════════════════════════════════════════════════════════
   EPI Labs — Design polish layer (P0–P1)
   Inspired by Magic UI / Open Props patterns, ported to vanilla CSS.
   Load AFTER epi.css + epi-v2.css. Does not replace the design system.
   ═══════════════════════════════════════════════════════════════ */

/* ── Open Props–style token ladder (v2-home only) ── */
body.v2-home {
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-3: 0 20px 50px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 0 1px var(--accent-line), 0 12px 40px rgba(61, 220, 151, 0.12);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --type-lead: clamp(1.05rem, 0.95rem + 0.4vw, 1.2rem);
  --type-title: clamp(1.85rem, 1.4rem + 1.8vw, 3.1rem);
}

body.v2-home .section-title {
  font-size: var(--type-title);
  letter-spacing: -0.035em;
  text-wrap: balance;
}
body.v2-home .section-desc,
body.v2-home .hero-sub {
  font-size: var(--type-lead);
  line-height: 1.55;
  max-width: 38rem;
}
body.v2-home .block-head {
  margin-bottom: clamp(28px, 4vw, 44px);
}

/* ── Magic UI–style border beam on primary CTAs ── */
body.v2-home .btn-primary.btn-lg,
body.v2-home .btn-primary.btn-beam {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
body.v2-home .btn-primary.btn-lg::before,
body.v2-home .btn-primary.btn-beam::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--beam-angle, 0deg),
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.85) 50%,
    transparent 60%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: epi-beam-spin 4s linear infinite;
  opacity: 0.7;
  z-index: -1;
  pointer-events: none;
}
@keyframes epi-beam-spin {
  to { --beam-angle: 360deg; }
}
@property --beam-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* ── Drop-zone: instrument glow + seal states ── */
body.v2-home .drop-zone {
  position: relative;
  transition: border-color 0.25s var(--ease-out), box-shadow 0.35s var(--ease-out),
    background 0.25s var(--ease-out), transform 0.35s var(--ease-spring);
}
body.v2-home .drop-zone::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    120deg,
    transparent 20%,
    rgba(61, 220, 151, 0.35) 45%,
    transparent 70%
  );
  background-size: 200% 100%;
  mix-blend-mode: screen;
  transition: opacity 0.3s;
}
body.v2-home .drop-zone:hover::after,
body.v2-home .drop-zone.drag-over::after {
  opacity: 0.45;
  animation: epi-shimmer 1.6s var(--ease-out) infinite;
}
@keyframes epi-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

body.v2-home .drop-zone.seal-ok {
  border-color: var(--verified) !important;
  border-style: solid !important;
  box-shadow: var(--shadow-glow), inset 0 0 40px rgba(61, 220, 151, 0.08);
  animation: epi-seal-pop 0.55s var(--ease-spring);
}
body.v2-home .drop-zone.seal-fail {
  border-color: var(--tamper) !important;
  border-style: solid !important;
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.35), var(--shadow-2);
}
body.v2-home .drop-zone.seal-warn {
  border-color: var(--warn) !important;
  border-style: solid !important;
}
@keyframes epi-seal-pop {
  0% { transform: scale(0.98); }
  60% { transform: scale(1.012); }
  100% { transform: scale(1); }
}

/* Check list: soft pass pulse */
body.v2-home .check-item.pass {
  transition: color 0.25s, transform 0.3s var(--ease-spring);
}
body.v2-home .check-item.pass .check-dot {
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.15);
}

/* ── Reveal stagger (IntersectionObserver already adds .visible) ── */
body.v2-home .reveal {
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
body.v2-home .reveal.d1 { transition-delay: 0.08s; }
body.v2-home .reveal.d2 { transition-delay: 0.16s; }
body.v2-home .reveal.d3 { transition-delay: 0.24s; }
body.v2-home .truth-card.reveal:nth-child(1) { transition-delay: 0.05s; }
body.v2-home .truth-card.reveal:nth-child(2) { transition-delay: 0.14s; }
body.v2-home .truth-card.reveal:nth-child(3) { transition-delay: 0.23s; }
body.v2-home .v2-plan.reveal:nth-child(1) { transition-delay: 0.05s; }
body.v2-home .v2-plan.reveal:nth-child(2) { transition-delay: 0.12s; }
body.v2-home .v2-plan.reveal:nth-child(3) { transition-delay: 0.19s; }

/* ── Truth trio bento polish + icons ── */
body.v2-home .truth-trio {
  gap: 16px;
}
body.v2-home .truth-card {
  position: relative;
  padding: 28px 24px 24px;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.03) 0%, transparent 48%),
    var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  transition: transform 0.3s var(--ease-out), border-color 0.25s, box-shadow 0.3s;
  overflow: hidden;
}
body.v2-home .truth-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-str);
  box-shadow: var(--shadow-2);
}
body.v2-home .truth-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
body.v2-home .truth-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
  fill: none;
  stroke: currentColor;
}
body.v2-home .truth-card--seal .truth-icon {
  color: var(--verified);
  border-color: rgba(61, 220, 151, 0.3);
  background: rgba(61, 220, 151, 0.08);
}
body.v2-home .truth-card--identity .truth-icon {
  color: var(--warn);
  border-color: rgba(230, 184, 77, 0.3);
  background: rgba(230, 184, 77, 0.08);
}
body.v2-home .truth-card--policy .truth-icon {
  color: var(--signal);
  border-color: rgba(91, 140, 255, 0.3);
  background: rgba(91, 140, 255, 0.08);
}

/* ── Plans: featured elevation ── */
body.v2-home .v2-plan {
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s, border-color 0.25s;
  box-shadow: var(--shadow-1);
}
body.v2-home .v2-plan:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}
body.v2-home .v2-plan.featured {
  box-shadow: var(--shadow-glow);
  border-color: var(--accent-line);
}
body.v2-home .v2-plan.featured .plan-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #04120C;
  background: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* ── Hero file card subtle float ── */
body.v2-home .v2-file-card {
  animation: epi-card-float 7s ease-in-out infinite;
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(255, 255, 255, 0.04);
}
@keyframes epi-card-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
body.v2-home .v2-seal-pill {
  animation: epi-pill-glow 2.8s ease-in-out infinite;
}
@keyframes epi-pill-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
  50% { box-shadow: 0 0 16px 2px rgba(61, 220, 151, 0.35); }
}

/* ── Video chapter dots ── */
body.v2-home .v2-video-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}
body.v2-home .v2-video-chapters button {
  font-family: var(--mono, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
body.v2-home .v2-video-chapters button:hover,
body.v2-home .v2-video-chapters button:focus-visible {
  color: var(--ink);
  border-color: var(--accent-line);
  background: var(--accent-glow);
  outline: none;
}

/* ── Command strip step hover ── */
body.v2-home .command-strip li {
  transition: border-color 0.2s, background 0.2s, transform 0.25s var(--ease-out);
}
body.v2-home .command-strip li:hover {
  transform: translateX(4px);
}

/* ── Light mode polish ── */
html[data-theme="light"] body.v2-home {
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-2: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-3: 0 18px 40px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 0 1px rgba(0, 119, 182, 0.2), 0 12px 32px rgba(0, 119, 182, 0.08);
}
html[data-theme="light"] body.v2-home .truth-card {
  background: #fff;
}
html[data-theme="light"] body.v2-home .drop-zone::after {
  mix-blend-mode: multiply;
}

/* ── Reduced motion: kill decorative motion, keep usability ── */
@media (prefers-reduced-motion: reduce) {
  body.v2-home .btn-primary.btn-lg::before,
  body.v2-home .btn-primary.btn-beam::before,
  body.v2-home .v2-file-card,
  body.v2-home .v2-seal-pill,
  body.v2-home .drop-zone::after {
    animation: none !important;
  }
  body.v2-home .drop-zone.seal-ok {
    animation: none !important;
  }
  body.v2-home .reveal {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  body.v2-home .truth-card:hover,
  body.v2-home .v2-plan:hover,
  body.v2-home .command-strip li:hover {
    transform: none;
  }
}
