/* =====================================================================
   Motion layer (driven by /js/motion.js). Start states live under
   html.motion, so with no JS or reduced motion everything just shows.
   ===================================================================== */

@property --trail { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* ---------- page progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 40; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--calc), var(--accent), var(--image), var(--pdf)); pointer-events: none;
}

/* ---------- text effect: words rise out of a blur ---------- */
.motion .te-word { display: inline-block; animation: te-in .9s cubic-bezier(.2, .7, .2, 1) calc(.15s + var(--i) * .07s) both; }
.entered .te-word, .entered [data-enter] { animation: none !important; }
@keyframes te-in { from { opacity: 0; filter: blur(12px); transform: translateY(.35em); } }

/* entrance for the rest of the hero copy, in order */
.motion [data-enter] { animation: rise .9s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) both; }
@keyframes rise { from { opacity: 0; filter: blur(6px); transform: translateY(16px); } }

/* ---------- text shimmer ---------- */
.shimmer {
  background: linear-gradient(90deg, currentColor 0 40%, #fff 50%, currentColor 60% 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 3.2s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* ---------- border trail: a light that runs around the edge ---------- */
.trail::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--trail), transparent 0 70%, #7b93ff 82%, #d8a6ff 90%, #7ef0c6 95%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: trail 5s linear infinite;
}
@keyframes trail { to { --trail: 360deg; } }

/* ---------- reveal on scroll ---------- */
.motion [data-reveal] { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity .8s, transform .9s cubic-bezier(.2, .7, .2, 1), filter .8s; }
.motion [data-reveal].in { opacity: 1; transform: none; filter: none; }
.motion [data-stagger] > * { opacity: 0; transform: translateY(24px) scale(.97); transition: opacity .6s, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 60ms); }
.motion [data-stagger].in > * { opacity: 1; transform: none; }

/* ---------- tool cards: 3D tilt + spotlight ---------- */
.tool-grid:not(.compact) { perspective: 1000px; }
.tool-grid:not(.compact) .tool-card {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .2s, border-color .2s;
}
.tool-grid:not(.compact) .tool-card:hover, .tool-grid:not(.compact) .tool-card:focus-visible { --lift: -4px; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift)); transition-duration: .12s, .2s, .2s; }
.tool-grid:not(.compact) .tool-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--c) 16%, transparent), transparent 70%);
}
.tool-grid:not(.compact) .tool-card:hover::after { opacity: 1; }
.tool-grid:not(.compact) .tc-icon { transform: translateZ(28px); }
.tool-grid:not(.compact) .tc-name { transform: translateZ(18px); }

/* ---------- infinite slider ---------- */
.marquee { position: relative; overflow: hidden; padding: 30px 0 6px; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-duration: 120s; }
@keyframes marquee { to { transform: translateX(calc(-50% - 6px)); } }
.marquee .chip { color: var(--ink); background: var(--surface); border-color: var(--line); box-shadow: 0 1px 2px rgba(21, 23, 28, .04); white-space: nowrap; padding: 10px 16px; font-size: 15px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 40px 0 8px; }
.stat {
  position: relative; overflow: hidden; padding: 26px 24px; border-radius: var(--r-panel);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-panel);
}
.stat b { display: block; font: 600 clamp(38px, 5vw, 54px)/1 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--ink), color-mix(in srgb, var(--c, var(--accent)) 80%, var(--ink))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { display: block; margin-top: 10px; color: var(--muted); font-size: 15px; }
.stat::before { content: ''; position: absolute; width: 180px; height: 180px; right: -60px; top: -80px; border-radius: 50%; background: var(--c, var(--accent)); opacity: .12; filter: blur(40px); }

/* ---------- showcase: a product window that stands up as you scroll ---------- */
.showcase { padding: 72px 0 16px; text-align: center; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.showcase h2 { font-size: clamp(30px, 4.4vw, 52px); letter-spacing: -0.04em; line-height: 1.05; max-width: 18ch; margin: 0 auto; text-wrap: balance; }
.showcase > p { color: var(--muted); font-size: 18px; max-width: 52ch; margin: 16px auto 0; text-wrap: balance; }
.sc-stage { perspective: 1400px; perspective-origin: 50% 0%; margin-top: 48px; }
.sc-window {
  --p: 1; position: relative; max-width: 960px; margin: 0 auto; text-align: left; transform-style: preserve-3d;
  transform: rotateX(calc((1 - var(--p)) * 38deg)) scale(calc(.86 + var(--p) * .14)) translateY(calc((1 - var(--p)) * 40px));
  border-radius: 22px; background: #0d1120; border: 1px solid rgba(255, 255, 255, .1); color: #e9ecf5;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 calc(30px + var(--p) * 30px) 90px -40px rgba(59, 91, 253, .55), 0 30px 60px -30px rgba(0, 0, 0, .5);
}
.sc-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sc-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.sc-bar i:nth-child(2) { background: #febc2e; }
.sc-bar i:nth-child(3) { background: #28c840; }
.sc-url { margin: 0 auto; padding: 6px 14px; border-radius: 8px; font-size: 13px; color: #8d96b3; background: rgba(255, 255, 255, .05); display: inline-flex; align-items: center; gap: 6px; }
.sc-url .ico { color: #7ef0c6; }
.sc-body { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; padding: 26px; transform-style: preserve-3d; }
.sc-drop {
  position: relative; display: grid; place-items: center; min-height: 280px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(170deg, #2c2150, #8e4ec6 55%, #f76b15); transform: translateZ(20px);
}
.sc-drop::before { content: ''; position: absolute; inset: auto -10% -18% -10%; height: 62%; background: #0d1120; opacity: .55; clip-path: polygon(0 100%, 26% 30%, 46% 60%, 70% 10%, 100% 100%); }
.sc-drop::after { content: ''; position: absolute; width: 46px; height: 46px; border-radius: 50%; background: #ffe7b8; top: 18%; right: 22%; box-shadow: 0 0 60px #ffd38a; }
.sc-side { display: flex; flex-direction: column; gap: 14px; transform: translateZ(40px); }
.sc-card { padding: 16px 18px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.sc-card small { display: block; color: #8d96b3; font-size: 12.5px; margin-bottom: 6px; }
.sc-size { display: flex; align-items: baseline; gap: 10px; font: 600 28px/1 var(--display); letter-spacing: -0.03em; }
.sc-size s { color: #6b7391; font-size: 18px; text-decoration-thickness: 2px; }
.sc-size em { font-style: normal; color: #7ef0c6; }
.sc-meter { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 12px; }
.sc-meter span { display: block; height: 100%; width: calc(var(--p) * 92%); border-radius: inherit; background: linear-gradient(90deg, #12a594, #7ef0c6); }
.sc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 12px; background: #fff; color: #0b0e1a; font-weight: 600; }
.sc-float {
  position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 500;
  background: rgba(22, 27, 46, .9); border: 1px solid rgba(255, 255, 255, .14); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .7);
}
.sc-float .ico { color: var(--c); }
.sc-float.f1 { left: -28px; top: 34%; transform: translateZ(90px) rotate(-4deg); }
.sc-float.f2 { right: -24px; bottom: 16%; transform: translateZ(120px) rotate(3deg); }

/* ---------- privacy band glow ---------- */
.privacy-band { position: relative; overflow: hidden; isolation: isolate; }
.privacy-band::before {
  content: ''; position: absolute; inset: -40%; z-index: -1; opacity: .5;
  background: conic-gradient(from var(--trail), transparent, color-mix(in srgb, var(--ok) 25%, transparent), transparent 40%);
  animation: trail 12s linear infinite;
}

@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; gap: 10px; margin-top: 28px; }
  .stat { padding: 20px; }
  .sc-body { grid-template-columns: 1fr; padding: 16px; }
  .sc-drop { min-height: 180px; }
  .sc-float { display: none; }
  .showcase { padding-top: 52px; }
}
