:root {
  color-scheme: light;
  --ink: #221f1b;
  --muted: #6b6258;
  --paper: #fbfaf7;
  --line: rgba(34, 31, 27, 0.14);
  --violet: #7c3aed;
  --teal: #0f766e;
  --gold: #b7791f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f7f1e8;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.hero {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 241, 232, 0.9)), url("/creative-spark/musestudio.jpg") center/cover;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(18px, 4vw, 48px);
}

.topbar-actions,
.panel-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-nav {
  justify-content: space-between;
  margin-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 58px);
  letter-spacing: 0;
  color: #17130f;
}

.brand span {
  font-style: italic;
  background: linear-gradient(90deg, #7c3aed, #0f766e, #b7791f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font-size: 13px;
}

.skower-logo-back {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(34, 31, 27, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px;
  box-shadow: 0 12px 34px rgba(34, 31, 27, 0.08);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.skower-logo-back:hover,
.skower-logo-back:focus-visible {
  border-color: rgba(15, 118, 110, 0.32);
  background: rgba(255, 255, 255, 0.92);
  outline: none;
  transform: translateY(-1px);
}

.skower-logo-back img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: clamp(22px, 5vw, 70px);
  align-items: center;
  padding: clamp(18px, 5vw, 62px);
}

.hero-copy h1,
.panel h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 9vw, 112px);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 680px;
  margin: 24px 0 0;
  color: #4a4036;
  font-size: clamp(18px, 2.2vw, 25px);
  line-height: 1.45;
}

.hero-copy .hero-line {
  margin-top: 14px;
  color: #251f18;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  border: 1px solid rgba(34, 31, 27, 0.18);
  border-radius: 999px;
  padding: 13px 18px;
  background: #17130f;
  color: #fff;
  font-weight: 700;
  min-height: 46px;
}

.btn.compact {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.72);
  color: #251f18;
}

.btn.ghost {
  background: transparent;
  color: #3d332a;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.error-banner {
  margin-top: 18px;
  border: 1px solid rgba(124, 58, 237, 0.24);
  border-radius: 12px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.78);
  color: #4b2a74;
  font-size: 14px;
  line-height: 1.45;
}

.upload-card,
.panel,
.result-card {
  border: 1px solid rgba(34, 31, 27, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 24px 80px rgba(57, 42, 25, 0.12);
}

.upload-card {
  padding: 20px;
}

.upload-drop {
  min-height: 270px;
  border: 1px dashed rgba(34, 31, 27, 0.22);
  border-radius: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.52);
}

.upload-drop img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 12px;
  object-fit: contain;
}

.ticker {
  overflow: hidden;
  padding: 0 0 18px;
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: 12px;
  animation: scroll 65s linear infinite;
}

.ticker img {
  width: 104px;
  height: 78px;
  object-fit: cover;
  border-radius: 10px;
  opacity: 0.9;
}

@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.panel-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 44px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(247, 241, 232, 0.94)), var(--question-bg, url("/creative-spark/musestudio.jpg")) center/cover;
}

.panel {
  width: min(1120px, 100%);
  padding: clamp(16px, 3vw, 34px);
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(34, 31, 27, 0.1);
  margin: 16px 0 26px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--teal), var(--gold));
  transition: width 0.25s ease;
}

.question {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
}

.question h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
}

.question p,
.muted {
  color: var(--muted);
  line-height: 1.45;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 104px;
  border: 1px solid rgba(34, 31, 27, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  padding: 10px 12px 12px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(34, 31, 27, 0.04);
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.option:hover,
.option:focus-visible {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(255, 255, 255, 0.94);
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(34, 31, 27, 0.08);
}

.option-thumb {
  position: relative;
  display: block;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #ece7df;
  cursor: zoom-in;
  isolation: isolate;
}

.option-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(17, 14, 11, 0.45));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.option-thumb:hover::after,
.option-thumb:focus-visible::after {
  opacity: 1;
}

.option-thumb:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.45);
  outline-offset: 2px;
}

.option-image {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.option-thumb:hover .option-image,
.option-thumb:focus-visible .option-image {
  transform: scale(1.06);
}

.option-thumb-hint {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 1;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.88);
  color: rgba(34, 31, 27, 0.78);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.option-thumb:hover .option-thumb-hint,
.option-thumb:focus-visible .option-thumb-hint {
  opacity: 1;
  transform: translateY(0);
}

.option-copy {
  min-width: 0;
}

.option.no-image {
  grid-template-columns: 1fr;
}

.option.no-image .select-button {
  grid-column: 1;
}

.option strong {
  display: block;
  margin-bottom: 5px;
}

.option small {
  color: var(--muted);
}

.option.selected {
  border-color: rgba(15, 118, 110, 0.42);
  background: #fff;
  box-shadow:
    0 0 0 3px rgba(15, 118, 110, 0.1),
    0 14px 28px rgba(34, 31, 27, 0.06);
}

.select-button {
  grid-column: 2;
  justify-self: start;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(34, 31, 27, 0.1);
  border-radius: 999px;
  padding: 8px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12)),
    linear-gradient(120deg, #f3e7c8 0%, #d9f2e8 52%, #cfe8e4 100%);
  color: rgba(34, 31, 27, 0.88);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 6px 14px rgba(34, 31, 27, 0.08);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    filter 0.22s ease;
}

.select-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.45) 48%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}

.select-button:hover,
.select-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 20px rgba(34, 31, 27, 0.12);
  filter: saturate(1.05);
}

.select-button:hover::before,
.select-button:focus-visible::before {
  transform: translateX(120%);
}

.select-button:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 4px 10px rgba(34, 31, 27, 0.08);
}

.select-button.is-selected {
  border-color: rgba(15, 118, 110, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.08)),
    linear-gradient(120deg, #0f766e, #148f84);
  color: #f7fffc;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 18px rgba(15, 118, 110, 0.24);
}

.select-button.is-lightbox {
  justify-self: end;
  padding: 10px 20px;
}

.style-preview {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 16px 0 4px;
  border: 1px solid rgba(34, 31, 27, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.style-preview-thumb {
  position: relative;
  display: block;
  width: 128px;
  height: 100px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #ece7df;
  cursor: zoom-in;
}

.style-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.style-preview-thumb:hover img,
.style-preview-thumb:focus-visible img {
  transform: scale(1.05);
}

.style-preview-zoom {
  position: absolute;
  left: 8px;
  bottom: 8px;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(17, 14, 11, 0.62);
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.style-preview strong,
.style-preview span {
  display: block;
}

.style-preview span {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.style-preview.empty {
  display: block;
  padding: 14px;
  color: var(--muted);
}

.preview-lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: preview-fade-in 0.22s ease;
}

.preview-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 14, 11, 0.62);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.preview-lightbox-card {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  background: #11100e;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: preview-rise-in 0.28s ease;
}

.preview-lightbox-card img {
  display: block;
  width: 100%;
  max-height: min(72vh, 720px);
  object-fit: contain;
  background: #0b0a09;
}

.preview-lightbox-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.preview-lightbox-meta strong {
  display: block;
  color: #f6f1e8;
  font-size: 16px;
}

.preview-lightbox-meta p {
  margin: 4px 0 0;
  color: rgba(246, 241, 232, 0.62);
  font-size: 13px;
  line-height: 1.4;
}

.preview-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(17, 14, 11, 0.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  backdrop-filter: blur(8px);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.preview-lightbox-close:hover,
.preview-lightbox-close:focus-visible {
  background: rgba(17, 14, 11, 0.8);
  transform: scale(1.04);
  outline: none;
}

@keyframes preview-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes preview-rise-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.custom,
.refine {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.custom textarea,
.refine textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border: 1px solid rgba(34, 31, 27, 0.16);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.panel.loading {
  position: relative;
  overflow: hidden;
  min-height: min(72vh, 640px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 60px rgba(34, 31, 27, 0.12);
  text-align: center;
  padding: 0;
}

.loading-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  pointer-events: none;
}

.loading-foreground {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: inherit;
  flex-direction: column;
  padding: clamp(16px, 3vw, 34px);
}

.loading-foreground .panel-nav {
  margin-bottom: 0;
}

.loading-copy {
  margin: auto;
  max-width: 28rem;
  padding: 28px 22px;
  border-radius: 22px;
  background: rgba(251, 250, 247, 0.78);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(17, 14, 11, 0.14);
}

.loading-copy h1 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 0.96;
}

.generation-error {
  max-width: 720px;
}

.generation-error h1 {
  margin: 34px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 7vw, 78px);
  line-height: 0.96;
  letter-spacing: 0;
}

.orb {
  width: 84px;
  height: 84px;
  margin: 0 auto 22px;
  border-radius: 999px;
  border: 8px solid rgba(124, 58, 237, 0.18);
  border-top-color: var(--violet);
  animation: spin 1s linear infinite;
}

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

.result {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  padding: clamp(12px, 3vw, 34px);
  background: #f5efe6;
}

.result-card {
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding: 16px;
}

.result-card img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  border-radius: 14px;
  object-fit: contain;
}

.result-copy {
  align-self: start;
  border: 1px solid rgba(34, 31, 27, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  padding: 20px;
}

.result-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: 0;
}

.result-summary {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.footer-note {
  padding: 16px clamp(18px, 4vw, 48px);
  color: rgba(34, 31, 27, 0.54);
  font-size: 12px;
}

@media (max-width: 860px) {
  .hero-main,
  .question,
  .result {
    grid-template-columns: 1fr;
  }

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

  .option,
  .style-preview {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .preview-lightbox-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .select-button.is-lightbox {
    justify-self: stretch;
    width: 100%;
  }

  .hero-copy h1,
  .panel h1 {
    font-size: clamp(42px, 16vw, 74px);
  }
}
