:root {
  --bg: #f5efe5;
  --bg-strong: #efe4d4;
  --card: rgba(255, 250, 243, 0.84);
  --card-strong: rgba(255, 247, 238, 0.96);
  --line: rgba(74, 57, 43, 0.12);
  --line-strong: rgba(74, 57, 43, 0.2);
  --text: #2f241b;
  --muted: #78695d;
  --accent: #d25a2f;
  --accent-deep: #b44823;
  --accent-soft: rgba(210, 90, 47, 0.12);
  --success: #2d8a4e;
  --error: #b63c3c;
  --shadow: 0 24px 60px rgba(89, 67, 48, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --mono: "JetBrains Mono", monospace;
  --sans: "Space Grotesk", sans-serif;
  --serif: "Instrument Serif", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(230, 157, 101, 0.35), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(214, 90, 47, 0.16), transparent 24%),
    linear-gradient(180deg, #f8f2e9 0%, #f2eadf 100%);
  color: var(--text);
  font-family: var(--sans);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}

.ambient-a {
  width: 16rem;
  height: 16rem;
  top: 3rem;
  right: 4rem;
  background: rgba(210, 90, 47, 0.34);
}

.ambient-b {
  width: 18rem;
  height: 18rem;
  left: -4rem;
  bottom: 6rem;
  background: rgba(230, 157, 101, 0.34);
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero,
.composer,
.status-strip,
.results-shell,
.settings-card {
  backdrop-filter: blur(16px);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.eyebrow-row,
.composer-top,
.results-head,
.settings-actions,
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.kicker,
.section-label,
.panel-label,
.field-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  margin-top: 18px;
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.3rem, 8vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.hero-copy h1 em {
  color: var(--accent);
  font-style: italic;
}

.lead,
.panel-copy,
.settings-copy,
.empty-copy,
.footer p,
.card-copy,
.meta {
  color: var(--muted);
  line-height: 1.6;
}

.lead {
  max-width: 58ch;
  font-size: 1.03rem;
  margin: 18px 0 22px;
}

.badge-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge,
.quality-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text);
}

.hero-panel,
.settings-card,
.status-strip,
.composer,
.results-shell {
  border-radius: var(--radius-lg);
}

.hero-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.28));
  border: 1px solid var(--line);
  padding: 20px;
}

.panel-list {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.7;
}

.settings {
  margin-top: 18px;
}

.settings.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.settings-card {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.settings-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 8px;
}

.field input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  padding: 16px 18px;
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.field input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(210, 90, 47, 0.5);
  box-shadow: 0 0 0 4px rgba(210, 90, 47, 0.12);
  transform: translateY(-1px);
}

textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.6;
}

.composer,
.status-strip,
.results-shell {
  margin-top: 18px;
  padding: 24px;
}

.composer-top h2,
.results-head h2 {
  margin: 6px 0 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.mode-switch {
  display: inline-flex;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.mode-pill {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 16px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.76rem;
}

.mode-pill.is-active {
  background: var(--text);
  color: #fff4ec;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.primary-btn,
.secondary-btn,
.settings-btn,
.download-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.primary-btn,
.download-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #e07a44 100%);
  color: #fff8f3;
  font-weight: 700;
}

.secondary-btn,
.settings-btn {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  border: 1px solid var(--line);
}

.primary-btn:hover,
.secondary-btn:hover,
.settings-btn:hover,
.download-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.download-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.launch-btn {
  min-width: 170px;
}

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

.status-strip p {
  margin: 0;
}

.results-head {
  margin-bottom: 20px;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  padding: 26px;
  text-align: center;
  background: rgba(255, 255, 255, 0.42);
}

.empty-title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 1.1rem;
}

.empty-state.is-hidden,
.download-all-hidden {
  display: none;
}

.cards {
  display: grid;
  gap: 14px;
}

.card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--card-strong);
}

.thumb {
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(210, 90, 47, 0.16), rgba(47, 36, 27, 0.04)),
    #eadfce;
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-icon {
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--accent-deep);
}

.card-body {
  min-width: 0;
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.meta {
  margin: 8px 0 16px;
  font-size: 0.93rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quality-chip {
  cursor: pointer;
}

.quality-chip.is-active {
  background: var(--text);
  color: #fff5ec;
  border-color: var(--text);
}

.status-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.status-note.is-success {
  color: var(--success);
}

.status-note.is-loading {
  color: var(--accent-deep);
}

.footer {
  padding: 20px 6px 0;
  text-align: center;
}

.footer p {
  margin: 6px 0;
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 840px) {
  .hero-grid,
  .status-strip,
  .card {
    grid-template-columns: 1fr;
  }

  .thumb {
    min-height: 200px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 18px, 1120px);
    padding-top: 10px;
  }

  .hero,
  .composer,
  .status-strip,
  .results-shell,
  .settings-card {
    padding: 18px;
  }

  .eyebrow-row,
  .composer-top,
  .results-head,
  .settings-actions,
  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-switch {
    width: 100%;
    justify-content: space-between;
  }

  .mode-pill {
    flex: 1;
  }

  .launch-btn,
  .primary-btn,
  .secondary-btn,
  .settings-btn,
  .download-btn {
    width: 100%;
  }

  .ambient-a,
  .ambient-b {
    opacity: 0.22;
  }
}
