:root {
  --bg0: #07141a;
  --ink: #f4f1ea;
  --muted: #b7c5c8;
  --accent: #e2b35a;
  --accent-ink: #1a1205;
  --line: rgba(244, 241, 234, 0.16);
  --danger: #ff7a6a;
  --ok: #7dcca0;
  --radius: 18px;
  --font-display: "Syne", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", system-ui, sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--bg0);
  line-height: 1.55;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.bg-image {
  position: absolute;
  inset: -8%;
  background:
    url("/vidpro-bg.png") center / cover no-repeat;
  animation: bgDrift 28s ease-in-out infinite alternate;
  transform: scale(1.08);
  filter: saturate(1.05) contrast(1.05);
}

.bg-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(7, 20, 26, 0.72) 0%, rgba(7, 20, 26, 0.45) 40%, rgba(10, 28, 34, 0.78) 100%),
    radial-gradient(800px 500px at 15% 10%, rgba(226, 179, 90, 0.18), transparent 55%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  animation: orbFloat 16s ease-in-out infinite alternate;
}

.bg-orb-a {
  width: 42vw;
  height: 42vw;
  left: -10%;
  top: 10%;
  background: rgba(46, 140, 130, 0.35);
}

.bg-orb-b {
  width: 36vw;
  height: 36vw;
  right: -8%;
  bottom: 5%;
  background: rgba(226, 179, 90, 0.22);
  animation-delay: -6s;
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  mix-blend-mode: soft-light;
  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.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  pointer-events: none;
}

@keyframes bgDrift {
  from { transform: scale(1.08) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(-2.5%, 1.5%, 0); }
}

@keyframes orbFloat {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(4%, -3%, 0); }
}

.top {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: rise 0.7s ease both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
  background:
    linear-gradient(135deg, var(--accent), #f0c56d 45%, transparent 46%),
    linear-gradient(315deg, #2f9b84, #163f39);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.2rem;
}

.brand-sub {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.stage {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.2rem 1.25rem 4rem;
  animation: rise 0.85s ease 0.08s both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.headline {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  letter-spacing: -0.04em;
  line-height: 1.12;
  max-width: 14ch;
}

.lede {
  margin: 0 0 1.2rem;
  color: var(--muted);
  max-width: 36ch;
  font-size: 1.02rem;
}

.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.22);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.chip.is-active {
  color: var(--accent-ink);
  background: linear-gradient(120deg, #f0c56d, var(--accent));
  border-color: transparent;
  transform: translateY(-1px);
}

.detect-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.compose { display: grid; gap: 0.9rem; }

textarea {
  width: 100%;
  resize: vertical;
  min-height: 7rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(7, 20, 26, 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  outline: none;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, transform 0.25s ease;
}

textarea:focus {
  border-color: rgba(226, 179, 90, 0.65);
  transform: translateY(-1px);
}

.yt-cookie-panel {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(7, 20, 26, 0.42);
  animation: rise 0.35s ease both;
}

.yt-cookie-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.yt-cookie-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.yt-cookie-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.yt-cookie-panel textarea {
  min-height: 4.2rem;
  box-shadow: none;
  font-size: 0.86rem;
}

.text-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
}

.text-btn:hover {
  text-decoration: underline;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.primary-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.1rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  background: linear-gradient(120deg, #f0c56d, var(--accent));
  color: var(--accent-ink);
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(226, 179, 90, 0.28);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.btn-spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid rgba(26, 18, 5, 0.25);
  border-top-color: var(--accent-ink);
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.status {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.status.is-error { color: var(--danger); }
.status.is-ok { color: var(--ok); }

.result {
  margin-top: 1.5rem;
  padding: 1.15rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  animation: rise 0.45s ease both;
  display: grid;
  gap: 1rem;
}

.result-visual {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1rem;
  align-items: center;
}

.result-visual img {
  width: 96px;
  height: 128px;
  object-fit: cover;
  border-radius: 12px;
  background: #123;
}

.result-platform {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.result-copy h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  line-height: 1.35;
}

.result-copy p#meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.download-btn {
  width: 100%;
  text-align: center;
}

.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: 560px) {
  .result-visual { grid-template-columns: 72px 1fr; }
  .result-visual img { width: 72px; height: 96px; }
  .headline { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-image, .bg-orb { animation: none; }
}
