:root {
  color-scheme: dark;
  --ink: #050706;
  --panel: rgba(14, 18, 16, 0.84);
  --panel-strong: #111613;
  --line: rgba(223, 255, 235, 0.12);
  --line-strong: rgba(168, 255, 200, 0.28);
  --text: #f3f7f4;
  --muted: #8d9991;
  --signal: #85ffae;
  --signal-bright: #bdffd2;
  --danger: #ff8f8f;
  --radius: 22px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #050706;
  background-size: 64px 64px;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at 50% 0%, rgba(82, 171, 112, 0.1), transparent 42%);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(130px);
  opacity: 0.12;
  background: var(--signal);
}

.ambient-one {
  top: 8%;
  right: -260px;
}

.ambient-two {
  bottom: -280px;
  left: -220px;
}

.topbar,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 42px;
  place-items: center;
}

.brand-mark svg {
  width: 30px;
  fill: none;
  stroke: var(--signal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1;
  letter-spacing: 0.14em;
}

.brand strong {
  font-size: 14px;
}

.brand small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}

.engine-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b6a967;
  box-shadow: 0 0 12px rgba(182, 169, 103, 0.7);
}

.engine-status.ready .status-dot {
  background: var(--signal);
  box-shadow: 0 0 14px rgba(133, 255, 174, 0.8);
}

.engine-status.offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 14px rgba(255, 143, 143, 0.7);
}

main {
  padding: 78px 0 46px;
}

.hero {
  max-width: 760px;
  margin-bottom: 54px;
}

.eyebrow {
  margin-bottom: 20px;
  color: var(--signal);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(52px, 7vw, 92px);
  font-weight: 510;
  letter-spacing: -0.065em;
  line-height: 0.92;
}

.hero h1 span {
  color: #879089;
}

.hero p {
  max-width: 610px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.studio {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(9, 12, 10, 0.72);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(24px);
}

.creator-panel {
  padding: 34px;
  border-right: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading h2 {
  font-size: 15px;
  font-weight: 590;
  letter-spacing: -0.01em;
}

.section-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.step {
  padding-top: 2px;
  color: var(--signal);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.dropzone {
  position: relative;
  display: grid;
  height: 224px;
  margin-top: 20px;
  overflow: hidden;
  place-items: center;
  border: 1px dashed rgba(159, 184, 167, 0.3);
  border-radius: 17px;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(133, 255, 174, 0.035), transparent 54%),
    rgba(255, 255, 255, 0.018);
  transition: 180ms ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--signal);
  background-color: rgba(133, 255, 174, 0.05);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.dropzone-copy {
  display: grid;
  gap: 7px;
  justify-items: center;
  color: var(--muted);
  font-size: 12px;
}

.dropzone-copy strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 560;
}

.upload-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 5px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(133, 255, 174, 0.05);
}

.upload-icon svg {
  width: 20px;
  fill: none;
  stroke: var(--signal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

#imagePreview {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropzone.has-image #imagePreview {
  display: block;
}

.dropzone.has-image .dropzone-copy {
  display: none;
}

.replace-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: none;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  background: rgba(5, 7, 6, 0.8);
  font: inherit;
  font-size: 11px;
  backdrop-filter: blur(10px);
}

.dropzone.has-image .replace-button {
  display: block;
}

.prompt-block {
  margin-top: 32px;
}

.prompt-shell {
  position: relative;
  margin-top: 18px;
}

textarea {
  width: 100%;
  min-height: 126px;
  padding: 17px 17px 32px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
  transition: border-color 160ms ease;
}

textarea::placeholder {
  color: #59625c;
}

textarea:focus {
  border-color: var(--line-strong);
}

.character-count {
  position: absolute;
  right: 13px;
  bottom: 11px;
  color: #667068;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.generation-meta {
  display: flex;
  gap: 8px;
  margin: 14px 0 20px;
}

.generation-meta span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.generate-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 20px;
  border: 0;
  border-radius: 13px;
  color: #071009;
  cursor: pointer;
  background: var(--signal);
  font: inherit;
  font-size: 13px;
  font-weight: 680;
  transition:
    transform 150ms ease,
    background 150ms ease,
    opacity 150ms ease;
}

.generate-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--signal-bright);
}

.generate-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.button-arrow {
  font-size: 19px;
  font-weight: 400;
}

.form-error {
  min-height: 17px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.5;
}

.result-panel {
  position: relative;
  display: grid;
  min-height: 670px;
  overflow: hidden;
  place-items: center;
  background:
    linear-gradient(rgba(133, 255, 174, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(133, 255, 174, 0.025) 1px, transparent 1px),
    #090c0a;
  background-size: 42px 42px;
}

.result-panel::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at 50% 45%, rgba(133, 255, 174, 0.09), transparent 36%);
}

.result-idle,
.result-working {
  position: relative;
  z-index: 1;
  width: min(350px, 76%);
  text-align: center;
}

.result-idle h2,
.result-idle p,
.result-working p {
  margin: 0;
}

.result-idle h2 {
  margin-top: 32px;
  font-size: 16px;
  font-weight: 560;
}

.result-idle p,
.result-working p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.idle-orbit {
  position: relative;
  display: grid;
  width: 126px;
  height: 126px;
  margin: auto;
  place-items: center;
}

.idle-orbit svg {
  width: 38px;
  fill: none;
  stroke: var(--signal);
  stroke-width: 1.1;
  filter: drop-shadow(0 0 15px rgba(133, 255, 174, 0.38));
}

.orbit {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(133, 255, 174, 0.16);
  border-radius: 50%;
}

.orbit-one {
  transform: scaleY(0.42) rotate(24deg);
}

.orbit-two {
  transform: scaleY(0.42) rotate(-24deg);
}

.frame-corners span {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(133, 255, 174, 0.32);
  border-style: solid;
}

.frame-corners span:nth-child(1) {
  top: -65px;
  left: -38px;
  border-width: 1px 0 0 1px;
}

.frame-corners span:nth-child(2) {
  top: -65px;
  right: -38px;
  border-width: 1px 1px 0 0;
}

.frame-corners span:nth-child(3) {
  bottom: -65px;
  left: -38px;
  border-width: 0 0 1px 1px;
}

.frame-corners span:nth-child(4) {
  right: -38px;
  bottom: -65px;
  border-width: 0 1px 1px 0;
}

.motion-loader {
  display: flex;
  height: 66px;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.motion-loader span {
  width: 4px;
  height: 22px;
  border-radius: 5px;
  background: var(--signal);
  animation: pulse 1.15s ease-in-out infinite;
  box-shadow: 0 0 14px rgba(133, 255, 174, 0.38);
}

.motion-loader span:nth-child(2) {
  animation-delay: 100ms;
}

.motion-loader span:nth-child(3) {
  animation-delay: 200ms;
}

.motion-loader span:nth-child(4) {
  animation-delay: 300ms;
}

.motion-loader span:nth-child(5) {
  animation-delay: 400ms;
}

@keyframes pulse {
  0%,
  100% {
    height: 18px;
    opacity: 0.4;
  }
  50% {
    height: 54px;
    opacity: 1;
  }
}

.status-label {
  margin-top: 24px;
  font-size: 14px;
  font-weight: 560;
}

.progress-track {
  height: 2px;
  margin-top: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  width: 35%;
  height: 100%;
  background: var(--signal);
  animation: travel 1.8s ease-in-out infinite;
  box-shadow: 0 0 12px var(--signal);
}

@keyframes travel {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(400%);
  }
}

.result-ready {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #070907;
}

.result-ready video {
  display: block;
  width: 100%;
  height: calc(100% - 86px);
  object-fit: contain;
  background: #000;
}

.result-actions {
  display: flex;
  height: 86px;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-top: 1px solid var(--line);
}

.result-actions strong,
.complete-label {
  display: block;
}

.complete-label {
  margin-bottom: 5px;
  color: var(--signal);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-actions strong {
  font-size: 13px;
  font-weight: 570;
}

.download-button {
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  text-decoration: none;
  font-size: 11px;
  transition: background 150ms ease;
}

.download-button:hover {
  background: rgba(133, 255, 174, 0.08);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  color: #5e6861;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.09em;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  main {
    padding-top: 54px;
  }

  .studio {
    grid-template-columns: 1fr;
  }

  .creator-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .result-panel {
    min-height: 520px;
  }
}

@media (max-width: 560px) {
  .topbar,
  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    min-height: 74px;
  }

  .engine-status span:last-child {
    display: none;
  }

  main {
    padding-top: 42px;
  }

  .hero {
    margin-bottom: 36px;
  }

  .hero h1 {
    font-size: 48px;
  }

  .hero p {
    font-size: 15px;
  }

  .creator-panel {
    padding: 24px 18px;
  }

  .dropzone {
    height: 195px;
  }

  .generation-meta {
    flex-wrap: wrap;
  }

  .result-panel {
    min-height: 430px;
  }

  footer {
    min-height: 66px;
  }

  footer span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

