:root {
  --bg: #08101d;
  --bg-2: #0d1830;
  --panel: rgba(11, 21, 41, 0.74);
  --panel-strong: rgba(13, 26, 51, 0.92);
  --text: #f3f7ff;
  --muted: #9db2d8;
  --line: rgba(145, 170, 214, 0.3);
  --brand: #32d6ff;
  --brand-2: #ff9c43;
  --ok: #53f4c8;
  --radius: 22px;
  --shadow: 0 25px 60px rgba(0, 5, 16, 0.46);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  height: 100%;
  overflow-x: hidden;
}

body {
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(900px 500px at -10% -15%, rgba(50, 214, 255, 0.24), transparent 60%),
    radial-gradient(800px 480px at 110% 15%, rgba(255, 156, 67, 0.18), transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 48%, #081223 100%);
  min-height: 100svh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.35;
  z-index: -2;
}

.bg-shape-a {
  width: 460px;
  height: 460px;
  background: #2fd2ff;
  top: -120px;
  left: -80px;
}

.bg-shape-b {
  width: 420px;
  height: 420px;
  background: #ff9e4c;
  bottom: -160px;
  right: -90px;
}

.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.18;
  background-image: radial-gradient(rgba(255, 255, 255, 0.42) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
}

.site-shell {
  width: min(1180px, 94vw);
  margin: 24px auto 80px;
  padding-inline: max(0px, env(safe-area-inset-left)) max(0px, env(safe-area-inset-right));
  display: grid;
  gap: 18px;
}

.panel,
.hero,
.feature-band,
.nav {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.nav {
  background: rgba(8, 17, 34, 0.62);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 22px rgba(50, 214, 255, 0.7);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.93rem;
}

.hero {
  background: linear-gradient(145deg, rgba(10, 22, 44, 0.93), rgba(13, 27, 53, 0.9));
  padding: clamp(18px, 4vw, 34px);
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 18px;
}

.hero-copy h1,
.hero-preview h2,
h3 {
  font-family: "Sora", sans-serif;
}

.badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #041423;
  background: linear-gradient(120deg, #71e3ff, #84ffc9);
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4.2vw, 3rem);
  line-height: 1.1;
  max-width: 19ch;
}

.hero-copy p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 62ch;
}

.hero-pills {
  margin-top: 16px;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.hero-pills span {
  border: 1px solid rgba(126, 170, 235, 0.45);
  background: rgba(12, 22, 42, 0.82);
  color: #c6dbff;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.hero-preview {
  background: rgba(8, 19, 39, 0.78);
  border: 1px solid rgba(127, 169, 230, 0.32);
  border-radius: 16px;
  padding: 16px;
}

.hero-preview h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.hero-preview ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.hero-preview li {
  border: 1px solid rgba(117, 161, 224, 0.32);
  border-radius: 12px;
  padding: 10px;
  background: rgba(14, 24, 45, 0.86);
}

.hero-preview strong {
  display: block;
  color: var(--ok);
  margin-bottom: 4px;
}

.hero-preview span {
  color: var(--muted);
  font-size: 0.89rem;
}

.warning {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 180, 129, 0.36);
  background: rgba(108, 54, 19, 0.44);
  color: #ffe1c8;
  font-weight: 600;
}

.feature-band {
  background: rgba(10, 20, 40, 0.75);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature-band article {
  border: 1px solid rgba(126, 164, 223, 0.28);
  border-radius: 14px;
  background: rgba(11, 22, 43, 0.82);
  padding: 12px;
}

.feature-band h3 {
  margin: 0 0 6px;
  font-size: 1.03rem;
}

.feature-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.studio {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.2fr 0.8fr;
}

.tri-studio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.studio-controls {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.tri-studio.compact .secondary-panel {
  display: none;
}

#civitaiPromptPanel {
  order: 1;
}

#twoPhotoActionPanel {
  order: 2;
}

#textVideoPanel {
  order: 3;
}

#characterPanel {
  order: 4;
}

#results {
  order: 5;
}

#photoAnimate {
  order: 6;
}

.site-footer {
  border: 1px solid rgba(127, 170, 231, 0.34);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(9, 19, 37, 0.92), rgba(10, 24, 48, 0.85));
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  text-decoration: none;
  color: #eaf4ff;
  border: 1px solid rgba(127, 174, 238, 0.45);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
  background: linear-gradient(120deg, #1a2f58 0%, #27457e 100%);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.social-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.legal-text {
  margin: 0;
  color: #9fb8df;
  font-size: 0.88rem;
  line-height: 1.6;
}

.ai-module {
  align-content: start;
  gap: 12px;
  background: linear-gradient(145deg, rgba(14, 26, 50, 0.88), rgba(10, 20, 40, 0.84));
}

.ai-bubble {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px 14px 14px 4px;
  border: 1px solid rgba(128, 182, 245, 0.38);
  background: rgba(12, 27, 52, 0.88);
  color: #d7ebff;
  line-height: 1.6;
  font-size: 0.9rem;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  border-radius: 999px;
  border: 1px solid rgba(121, 170, 233, 0.46);
  background: rgba(18, 35, 66, 0.95);
  color: #d3e8ff;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.panel {
  background: var(--panel);
  padding: 18px;
  display: grid;
  gap: 11px;
}

.assistant-note {
  background: linear-gradient(145deg, rgba(14, 25, 48, 0.9), rgba(12, 22, 44, 0.8));
}

.assistant-note p {
  margin: 0;
  color: #e5efff;
  line-height: 1.7;
  white-space: pre-wrap;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

#statusText {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

small {
  color: var(--muted);
  font-weight: 700;
}

label {
  font-size: 0.92rem;
  color: #d4e3ff;
  font-weight: 700;
}

.mode-hint {
  margin: -2px 0 2px;
  font-size: 0.83rem;
  color: #88c8ff;
  font-weight: 600;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  border-radius: 14px;
  border: 1px solid rgba(128, 167, 228, 0.45);
  background: rgba(9, 17, 34, 0.92);
  color: var(--text);
  padding: 13px;
  font: inherit;
}

textarea:focus {
  outline: 2px solid rgba(80, 226, 249, 0.45);
  border-color: rgba(110, 203, 255, 0.85);
}

.upload-block {
  border: 1px dashed rgba(135, 169, 223, 0.5);
  border-radius: 14px;
  background: rgba(8, 17, 33, 0.82);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.upload-block input[type="file"] {
  width: 100%;
  color: #d8e8ff;
  font: inherit;
  border: 1px solid rgba(129, 166, 224, 0.4);
  border-radius: 12px;
  background: rgba(13, 24, 45, 0.9);
  padding: 10px;
}

.upload-block select {
  width: 100%;
  color: #d8e8ff;
  font: inherit;
  border: 1px solid rgba(129, 166, 224, 0.4);
  border-radius: 12px;
  background: rgba(13, 24, 45, 0.9);
  padding: 10px;
}

.upload-block select:focus {
  outline: 2px solid rgba(101, 216, 255, 0.4);
  border-color: rgba(125, 203, 255, 0.8);
}

.upload-block input[type="file"]::file-selector-button {
  border: 1px solid rgba(114, 196, 255, 0.5);
  background: linear-gradient(120deg, #183561 0%, #205695 100%);
  color: #eaf3ff;
  font: inherit;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 12px;
  margin-right: 10px;
  cursor: pointer;
}

.upload-block input[type="file"]::file-selector-button:hover {
  filter: brightness(1.08);
}

.file-picker-row {
  display: grid;
  gap: 8px;
}

.video-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid rgba(130, 166, 226, 0.45);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(12, 23, 42, 0.92);
  color: #e9f3ff;
  font: inherit;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(101, 216, 255, 0.4);
  border-color: rgba(125, 203, 255, 0.8);
}

.check-field {
  align-content: end;
}

.check-field label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.file-name-text {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-word;
}

.actions,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.primary-btn {
  color: #071522;
  background: linear-gradient(120deg, #53e2ff 0%, #4fffb8 100%);
  box-shadow: 0 10px 22px rgba(40, 213, 227, 0.28);
}

.ghost-btn {
  color: #dcedff;
  background: linear-gradient(120deg, #1a2f58 0%, #223968 100%);
  border: 1px solid rgba(126, 163, 220, 0.45);
}

.results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.output-box.is-hidden {
  display: none;
}

.output-box {
  align-content: start;
}

.image-wrap,
.video-wrap {
  border: 1px dashed rgba(143, 173, 220, 0.46);
  border-radius: 14px;
  min-height: 280px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(9, 16, 31, 0.84);
}

.image-wrap span,
.video-wrap span {
  color: #8ea5cf;
}

.image-wrap.empty img,
.video-wrap.empty video {
  display: none;
}

.image-wrap:not(.empty) span,
.video-wrap:not(.empty) span {
  display: none;
}

.image-wrap img,
.video-wrap video {
  display: block;
  width: 100%;
  height: auto;
}

.video-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.reveal {
  opacity: 0;
  transform: translateY(15px);
  animation: reveal 0.6s ease forwards;
}

.delay-1 {
  animation-delay: 0.08s;
}

.delay-2 {
  animation-delay: 0.16s;
}

.delay-3 {
  animation-delay: 0.24s;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .tri-studio {
    grid-template-columns: 1fr;
  }

  .footer-socials {
    gap: 8px;
  }

  .studio {
    grid-template-columns: 1fr;
  }

  .results {
    grid-template-columns: 1fr;
  }

  .feature-band {
    grid-template-columns: 1fr;
  }

  .video-config-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes floatA {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(26px, 22px) scale(1.08);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-20px, -18px) scale(0.95);
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .pro-grid {
    grid-template-columns: 1fr 1fr;
  }

  .result-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .site-shell {
    width: 100vw;
    margin: 0;
    padding: max(10px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
    gap: 12px;
  }

  .panel,
  .hero,
  .feature-band,
  .nav,
  .site-footer {
    border-radius: 16px;
  }

  .panel {
    padding: 14px;
  }

  textarea {
    min-height: 104px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-note {
    text-align: left;
  }

  #statusText {
    width: 100%;
    margin-left: 0;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .pro-grid {
    grid-template-columns: 1fr;
  }
}
