:root {
  --bg-0: #0b1210;
  --bg-1: #12201b;
  --ink: #eef6f1;
  --muted: #9db5a8;
  --line: rgba(238, 246, 241, 0.12);
  --accent: #3dffa8;
  --accent-2: #ff6b4a;
  --danger: #ff7b7b;
  --font-display: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --radius: 18px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 255, 168, 0.16), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(255, 107, 74, 0.14), transparent 50%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 45%, #0a100e);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  animation: drift 14s ease-in-out infinite alternate;
}
.glow-a { background: #3dffa8; top: 12%; left: -8%; }
.glow-b { background: #ff6b4a; top: 40%; right: -10%; animation-delay: -4s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, 30px, 0) scale(1.12); }
}

.topbar, main, .footer { position: relative; z-index: 1; }

.topbar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), #8cffd0 40%, var(--accent-2));
  box-shadow: 0 0 24px rgba(61, 255, 168, 0.45);
  animation: pulse 2.4s ease-in-out infinite;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
}

.nav { display: flex; gap: 22px; font-size: 0.95rem; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav-muted { opacity: 0.7; }

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 24px 40px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 96px);
}

.brand-hero {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff 10%, var(--accent) 55%, #b8ffe0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rise 0.8s ease both;
}

.hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.25;
  max-width: 18ch;
  animation: rise 0.9s ease both;
}

.lede {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 42ch;
  animation: rise 1s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.download-form { animation: rise 1.1s ease both; }
.input-row {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 14, 12, 0.55);
  backdrop-filter: blur(10px);
}

.input-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 14px 18px;
}

.input-row input::placeholder { color: #6f867a; }

.input-row button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--accent), #22d48a);
  color: #062116;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
  white-space: nowrap;
}
.input-row button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.input-row button:disabled { opacity: 0.7; cursor: wait; transform: none; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(6, 33, 22, 0.25);
  border-top-color: #062116;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hint {
  margin: 12px 0 0 18px;
  color: #7f978b;
  font-size: 0.88rem;
}

.hero-visual { display: flex; justify-content: center; animation: rise 1.15s ease both; }
.frame {
  width: min(340px, 80vw);
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  padding: 12px;
  background: linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.frame-bar {
  height: 8px;
  width: 36%;
  margin: 6px auto 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}
.frame-screen {
  height: calc(100% - 40px);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(61,255,168,0.12), transparent 40%),
    linear-gradient(145deg, #173028, #0d1713 60%, #1a120f);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.pulse-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid rgba(61, 255, 168, 0.45);
  animation: ring 2.8s ease-out infinite;
}
.play-shape {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 18px 0 18px 30px;
  border-color: transparent transparent transparent var(--accent);
  filter: drop-shadow(0 0 18px rgba(61,255,168,0.55));
  margin-left: 8px;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes ring {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

.result {
  max-width: var(--max);
  margin: 0 auto 48px;
  padding: 0 24px;
}
.result-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 14, 12, 0.45);
  animation: rise 0.5s ease both;
}
.preview {
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: #08100d;
  display: grid;
  place-items: center;
}
.preview img, .preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.meta-author {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 600;
}
.meta-title {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 52ch;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #22d48a);
  color: #062116;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.error {
  max-width: var(--max);
  margin: 0 auto 24px;
  padding: 0 24px;
  color: var(--danger);
}

.how {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 24px 80px;
}
.how h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}
.section-lede { margin: 0 0 28px; color: var(--muted); }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  counter-reset: step;
}
.steps li {
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  counter-increment: step;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}
.steps strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.steps span { color: var(--muted); line-height: 1.55; font-size: 0.95rem; }

.footer {
  border-top: 1px solid var(--line);
  padding: 22px 24px 36px;
  text-align: center;
  color: #6f867a;
  font-size: 0.9rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 36px;
    gap: 28px;
  }
  .hero-visual { order: -1; }
  .frame { width: min(220px, 55vw); }
  .result-inner { grid-template-columns: 1fr; }
  .preview { max-width: 260px; }
  .steps { grid-template-columns: 1fr; }
  .input-row { flex-direction: column; border-radius: 20px; }
  .input-row button { width: 100%; }
}

.result-download-only {
  grid-template-columns: 1fr !important;
  max-width: 560px;
}
.result-download-only .actions {
  margin-top: 8px;
}
.result-download-only .btn-primary {
  min-width: 180px;
  text-align: center;
}