:root {
  color-scheme: light;
  --ink: #25172a;
  --muted: #735f76;
  --paper: #fffafd;
  --panel: rgba(255, 255, 255, 0.86);
  --line: rgba(101, 53, 96, 0.16);
  --pink: #d32f76;
  --pink-dark: #93205b;
  --plum: #4c1d56;
  --mint: #0f8a6b;
  --warning: #ad6800;
  --shadow: 0 24px 70px rgba(76, 29, 86, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(251, 207, 232, 0.7), transparent 28rem),
    radial-gradient(circle at 92% 35%, rgba(221, 214, 254, 0.64), transparent 30rem),
    linear-gradient(180deg, #fff9fc 0%, #faf7ff 100%);
}

a {
  color: var(--pink-dark);
  text-underline-offset: 3px;
}

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 225px;
  padding: 36px 44px;
  overflow: hidden;
  color: #fff8fc;
  border-radius: 30px;
  background:
    linear-gradient(120deg, rgba(32, 10, 38, 0.1), transparent 45%),
    linear-gradient(135deg, #35133e 0%, #76204e 52%, #c12f73 100%);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  box-shadow:
    0 0 0 50px rgba(255, 255, 255, 0.035),
    0 0 0 100px rgba(255, 255, 255, 0.025);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 850px;
}

.eyebrow,
.step {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  color: #fbcfe8;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 5vw, 4.9rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: #f9a8d4;
}

.lede {
  max-width: 720px;
  margin: 20px 0 0;
  color: #fce7f3;
  font-size: 1.06rem;
  line-height: 1.65;
}

.hero a {
  color: white;
}

.rabbit-mark {
  position: relative;
  z-index: 1;
  flex: 0 0 144px;
  width: 144px;
  height: 132px;
  margin-right: 42px;
}

.ear,
.face {
  position: absolute;
  display: block;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 12px 30px rgba(41, 10, 38, 0.2);
}

.ear {
  top: 0;
  width: 45px;
  height: 92px;
  border-radius: 60% 60% 45% 45%;
}

.left-ear {
  left: 21px;
  transform: rotate(-9deg);
}

.right-ear {
  right: 21px;
  transform: rotate(9deg);
}

.face {
  inset: 57px 10px 0;
  display: grid;
  place-items: center;
  color: var(--pink);
  border-radius: 52% 52% 44% 44%;
  font-size: 2rem;
}

.boundary {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 18px 0;
  padding: 17px 20px;
  border: 1px solid rgba(211, 47, 118, 0.2);
  border-radius: 18px;
  background: rgba(255, 244, 249, 0.8);
}

.boundary-icon {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: var(--pink);
}

.boundary h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.boundary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.controls {
  display: grid;
  gap: 18px;
}

.panel,
.output-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(76, 29, 86, 0.075);
  backdrop-filter: blur(12px);
}

.panel {
  padding: 26px;
}

.output-panel {
  position: sticky;
  top: 18px;
  padding: 26px;
}

.panel-heading,
.output-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel h2,
.output-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.step {
  color: var(--pink-dark);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 750;
  white-space: nowrap;
}

.badge.idle {
  color: #6b556d;
  background: #f3edf4;
}

.badge.success {
  color: #087455;
  background: #dff8ee;
}

.badge.working {
  color: #8a5200;
  background: #fff2d4;
}

.badge.error {
  color: #9d174d;
  background: #fce7f3;
}

label {
  display: block;
  margin: 16px 0 7px;
  font-size: 0.84rem;
  font-weight: 750;
}

label span {
  color: var(--muted);
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  color: var(--ink);
  border: 1px solid rgba(93, 52, 90, 0.18);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.95);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input,
select {
  min-height: 45px;
  padding: 9px 11px;
}

textarea {
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(211, 47, 118, 0.65);
  box-shadow: 0 0 0 4px rgba(211, 47, 118, 0.1);
}

.code-input,
pre,
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.code-input {
  font-size: 0.78rem;
}

.field-note {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.45;
}

.inline-actions,
.generate-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 13px;
}

.file-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  margin: 0;
  padding: 10px 15px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 780;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.file-button,
.button.secondary {
  color: var(--pink-dark);
  border: 1px solid rgba(147, 32, 91, 0.2);
  background: #fff2f8;
}

.button.primary {
  flex: 1;
  color: white;
  background: linear-gradient(135deg, var(--plum), var(--pink));
  box-shadow: 0 10px 24px rgba(147, 32, 91, 0.2);
}

.button.ghost {
  color: var(--muted);
  border: 1px solid var(--line);
  background: transparent;
}

.button:hover:not(:disabled),
.file-button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.token-reference,
.history-details {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.84rem;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

.token-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 7px 12px;
  margin-top: 13px;
}

.token-grid code {
  color: var(--pink-dark);
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.seed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.checkbox-row,
.authorization {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.checkbox-row {
  min-height: 45px;
  align-items: center;
  margin: 16px 0 0;
}

.checkbox-row input,
.authorization input {
  flex: 0 0 17px;
  width: 17px;
  min-height: 17px;
  margin: 2px 0 0;
  accent-color: var(--pink);
}

.authorization {
  margin-top: 20px;
  padding: 13px 14px;
  color: var(--muted);
  border: 1px solid rgba(173, 104, 0, 0.18);
  border-radius: 12px;
  background: rgba(255, 247, 226, 0.72);
  font-size: 0.8rem;
  line-height: 1.5;
}

.video-stage {
  position: relative;
  display: grid;
  min-height: 410px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(93, 52, 90, 0.15);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(65, 25, 71, 0.96), rgba(124, 32, 80, 0.94)),
    #311235;
}

#output-video {
  display: block;
  width: 100%;
  max-height: 620px;
  background: #180c1b;
}

.empty-state {
  display: grid;
  place-items: center;
  color: #fce7f3;
  text-align: center;
}

.empty-state p {
  margin: 18px 0 0;
  color: #fbcfe8;
  font-size: 0.9rem;
}

.empty-orbit {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  box-shadow:
    0 0 0 18px rgba(255, 255, 255, 0.04),
    0 0 0 36px rgba(255, 255, 255, 0.025);
  font-size: 1.7rem;
}

.progress-track {
  height: 5px;
  margin: 18px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee6ef;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--plum), #ec4899);
  transition: width 400ms ease;
}

.status {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.download-link {
  display: inline-flex;
  margin-top: 10px;
  font-size: 0.86rem;
  font-weight: 750;
}

pre {
  max-height: 280px;
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  color: #4c344e;
  border-radius: 10px;
  background: #f7f1f7;
  font-size: 0.72rem;
  white-space: pre-wrap;
}

footer {
  margin-top: 18px;
  padding: 18px 22px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  line-height: 1.6;
}

footer p {
  margin: 0;
}

@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .output-panel {
    position: static;
  }

  .rabbit-mark {
    margin-right: 10px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 1440px);
    padding-top: 9px;
  }

  .hero {
    min-height: auto;
    padding: 28px 24px;
    border-radius: 22px;
  }

  .rabbit-mark {
    display: none;
  }

  .panel,
  .output-panel {
    padding: 20px;
    border-radius: 19px;
  }

  .field-grid.two,
  .field-grid.four {
    grid-template-columns: 1fr;
  }

  .seed-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .inline-actions,
  .generate-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .video-stage {
    min-height: 300px;
  }
}
