:root {
  --bg: #07060f;
  --ink: #f4f2ff;
  --ink-2: #b9b4d6;
  --ink-3: #7d789c;
  --glass: rgba(255, 255, 255, .055);
  --glass-2: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .12);
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --pink: #ff4ecd;
  --green: #34d399;
  --red: #ff6b7a;
  --grad: linear-gradient(110deg, var(--cyan), var(--violet) 45%, var(--pink));
  --radius: 22px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
kbd { font: 600 .8em var(--body); padding: .1em .45em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--glass); }

/* ---------- Background layers ---------- */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.aurora {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none; filter: blur(80px); opacity: .55;
  background:
    radial-gradient(40% 35% at 20% 25%, rgba(124, 92, 255, .45), transparent 70%),
    radial-gradient(35% 30% at 80% 20%, rgba(34, 211, 238, .28), transparent 70%),
    radial-gradient(40% 35% at 70% 85%, rgba(255, 78, 205, .25), transparent 70%);
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.08); } }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .nav, .foot { position: relative; z-index: 2; }

/* ---------- Nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1180px; margin: 0 auto; padding: 22px 24px;
}
.logo { display: flex; align-items: center; gap: 10px; font: 700 22px var(--display); letter-spacing: -.02em; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--grad);
  box-shadow: 0 0 24px rgba(124, 92, 255, .6); transform: rotate(45deg) scale(.85);
}
.nav nav { display: flex; gap: 28px; font-size: 14px; color: var(--ink-2); }
.nav nav a:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  max-width: 880px; margin: 0 auto; padding: 9vh 20px 60px; text-align: center;
  min-height: calc(100vh - 80px); display: flex; flex-direction: column; align-items: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px;
  background: var(--glass); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
  backdrop-filter: blur(10px);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
h1 {
  font: 700 clamp(38px, 6.4vw, 76px)/1.03 var(--display); letter-spacing: -.035em;
  margin: 26px 0 20px; text-wrap: balance;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--ink-2); max-width: 620px; text-wrap: pretty; }

/* ---------- Link box ---------- */
.linkbox { width: 100%; max-width: 720px; margin-top: 40px; perspective: 900px; }
.linkbox-inner {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 8px 8px 8px 18px; border-radius: 20px;
  background: rgba(16, 13, 34, .7); border: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px -20px rgba(124, 92, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s;
}
.linkbox-inner::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 60%, var(--cyan), var(--violet), var(--pink), transparent 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s; animation: spin-angle 3s linear infinite;
}
.linkbox:focus-within .linkbox-inner::before, .linkbox.busy .linkbox-inner::before { opacity: 1; }
.linkbox:focus-within .linkbox-inner { border-color: transparent; box-shadow: 0 30px 90px -18px rgba(124, 92, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .1); }
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin-angle { to { --angle: 360deg; } }
.link-ico { width: 22px; height: 22px; color: var(--ink-3); flex: none; }
#url {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--ink);
  font: 500 17px var(--body); padding: 14px 6px;
}
#url::placeholder { color: var(--ink-3); }
.ghost { padding: 10px 14px; border-radius: 12px; font-size: 14px; color: var(--ink-2); }
.ghost:hover { background: var(--glass-2); color: var(--ink); }
.go {
  display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 14px;
  background: var(--grad); background-size: 200% 100%; font-weight: 600; color: #fff;
  box-shadow: 0 10px 30px -8px rgba(124, 92, 255, .8); transition: transform .2s, background-position .5s;
}
.go:hover { background-position: 100% 0; transform: translateY(-1px); }
.go:active { transform: scale(.97); }
.go svg { width: 18px; height: 18px; transition: transform .2s; }
.go:hover svg { transform: translateX(3px); }
.error-msg { min-height: 24px; margin-top: 12px; font-size: 14px; color: var(--red); }
.linkbox.shake .linkbox-inner { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.linkbox.launch .linkbox-inner { animation: launch .7s cubic-bezier(.3, .7, .2, 1); }
@keyframes launch {
  30% { transform: rotateX(18deg) scale(.96); }
  60% { transform: rotateX(-6deg) scale(1.02); box-shadow: 0 0 120px rgba(34, 211, 238, .6); }
}

/* ---------- Stage panels ---------- */
.stage { width: 100%; max-width: 720px; margin-top: 18px; }
.panel {
  border-radius: var(--radius); padding: 30px; background: rgba(16, 13, 34, .62);
  border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: rise .6s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px) rotateX(-12deg) scale(.97); } }

/* processing */
.processing { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.orbit { position: relative; width: 150px; height: 150px; perspective: 600px; transform-style: preserve-3d; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; transform-style: preserve-3d; }
.r1 { border-top-color: var(--cyan); border-left-color: var(--cyan); animation: r1 1.6s linear infinite; }
.r2 { inset: 14px; border-right-color: var(--violet); border-bottom-color: var(--violet); animation: r2 2.1s linear infinite; }
.r3 { inset: 28px; border-top-color: var(--pink); border-right-color: var(--pink); animation: r3 1.3s linear infinite; }
@keyframes r1 { from { transform: rotateX(65deg) rotateZ(0); } to { transform: rotateX(65deg) rotateZ(360deg); } }
@keyframes r2 { from { transform: rotateY(65deg) rotateZ(0); } to { transform: rotateY(65deg) rotateZ(-360deg); } }
@keyframes r3 { from { transform: rotateX(-40deg) rotateY(40deg) rotateZ(0); } to { transform: rotateX(-40deg) rotateY(40deg) rotateZ(360deg); } }
.core {
  position: absolute; inset: 52px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--cyan) 30%, var(--violet) 70%);
  box-shadow: 0 0 40px var(--violet), 0 0 80px rgba(34, 211, 238, .5); animation: breathe 1.2s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(.82); filter: brightness(1.3); } }
.spark { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; }
.s1 { animation: orbit1 1.8s linear infinite; }
.s2 { animation: orbit1 2.4s linear infinite reverse; background: var(--cyan); }
.s3 { animation: orbit1 3s linear infinite; background: var(--pink); }
@keyframes orbit1 { from { transform: rotate(0) translateX(72px) scale(1); } 50% { transform: rotate(180deg) translateX(60px) scale(.5); } to { transform: rotate(360deg) translateX(72px) scale(1); } }
.capsule {
  max-width: 100%; padding: 6px 14px; border-radius: 99px; background: var(--glass); border: 1px solid var(--line);
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.steps { list-style: none; padding: 0; display: grid; gap: 8px; text-align: left; font-size: 15px; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--ink-3); transition: color .3s; }
.steps li::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); flex: none; transition: all .3s;
}
.steps li.active { color: var(--ink); }
.steps li.active::before { border-color: var(--cyan); border-top-color: transparent; animation: spin .7s linear infinite; }
.steps li.ok { color: var(--ink-2); }
.steps li.ok::before { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 3px #10101e; }
@keyframes spin { to { transform: rotate(360deg); } }

/* result */
.result { display: grid; grid-template-columns: 260px 1fr; gap: 24px; text-align: left; align-items: center; }
.thumb { position: relative; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: var(--glass-2); transform: perspective(700px) rotateY(8deg); box-shadow: -18px 24px 50px -16px rgba(0, 0, 0, .7); transition: transform .5s; }
.result:hover .thumb { transform: perspective(700px) rotateY(0); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.noimg { background: var(--grad); }
.duration { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .7); font-size: 12px; font-weight: 600; }
.source { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.meta h2 { font: 600 20px/1.3 var(--display); margin: 6px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.uploader { color: var(--ink-3); font-size: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.actions.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 12px;
  background: var(--glass-2); border: 1px solid var(--line); font-weight: 600; font-size: 15px; transition: transform .2s, background .2s;
}
.btn:hover { background: rgba(255, 255, 255, .14); transform: translateY(-2px); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 30px -10px rgba(124, 92, 255, .9); }
.btn svg { width: 18px; height: 18px; }

/* progress */
.progress, .done { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ringwrap { position: relative; width: 150px; height: 150px; }
.pring { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 0 14px rgba(124, 92, 255, .6)); }
.pring circle { fill: none; stroke-width: 8; }
.pring .track { stroke: rgba(255, 255, 255, .08); }
.pring .bar { stroke: url(#pg); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .5s ease; }
.progress.working .pring { animation: wobble 2.5s ease-in-out infinite; }
@keyframes wobble { 50% { transform: rotate(-90deg) scale(1.04); } }
.pct { position: absolute; inset: 0; display: grid; place-content: center; font: 700 38px var(--display); grid-auto-flow: column; align-items: baseline; }
.pct small { font-size: 18px; color: var(--ink-3); }
.pstage { font-weight: 600; }
.pinfo { color: var(--ink-3); font-size: 14px; word-break: break-all; }

/* done */
.check { width: 84px; height: 84px; }
.check circle { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .7s .1s forwards; }
.check path { fill: none; stroke: var(--green); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .7s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h2 { font: 600 24px var(--display); }

/* ---------- Sites marquee ---------- */
.sites { padding: 20px 0 80px; text-align: center; }
.eyebrow { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 22px; }
.marquee { overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.track-x { display: flex; gap: 14px; width: max-content; animation: marquee 40s linear infinite; }
.track-x span { padding: 10px 20px; border-radius: 99px; border: 1px solid var(--line); background: var(--glass); font: 500 15px var(--display); color: var(--ink-2); white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- How it works ---------- */
.how { max-width: 1100px; margin: 0 auto; padding: 40px 20px 120px; }
.section-title { font: 700 clamp(28px, 4vw, 44px) var(--display); letter-spacing: -.03em; text-align: center; margin-bottom: 44px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; perspective: 1000px; }
.card {
  position: relative; padding: 32px 28px; border-radius: var(--radius); background: rgba(16, 13, 34, .6);
  border: 1px solid var(--line); backdrop-filter: blur(14px); transform-style: preserve-3d; transition: transform .25s ease-out, border-color .3s;
}
.card:hover { border-color: rgba(124, 92, 255, .5); }
.card .num { display: block; font: 700 46px var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; transform: translateZ(40px); }
.card h3 { font: 600 20px var(--display); margin: 10px 0 6px; transform: translateZ(25px); }
.card p { color: var(--ink-2); transform: translateZ(15px); }

/* ---------- Footer ---------- */
.foot { text-align: center; padding: 30px 20px 50px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; display: grid; gap: 6px; }
.muted { color: var(--ink-3); }

/* ---------- Reveal on load / scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s cubic-bezier(.2, .8, .2, 1), transform .9s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.notfound { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 16px; position: relative; z-index: 2; padding: 20px; }
.notfound h1 { margin: 0; font-size: clamp(80px, 18vw, 180px); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav { padding: 18px 16px; }
  .nav nav { gap: 16px; font-size: 13px; }
  .hero { padding: 6vh 16px 40px; }
  .linkbox-inner { flex-wrap: wrap; padding: 8px; }
  .link-ico { margin-left: 8px; }
  #url { flex-basis: calc(100% - 40px); font-size: 16px; }
  .ghost { flex: 1; background: var(--glass); }
  .go { flex: 2; justify-content: center; }
  .result { grid-template-columns: 1fr; }
  .thumb { transform: none; }
  .panel { padding: 22px 18px; }
  .cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
