:root {
  --bg: #f6f3eb;
  --bg-soft: #fffdf7;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #fffef8;
  --line: rgba(18, 22, 18, 0.12);
  --text: #11130f;
  --muted: #61675c;
  --accent: #c8ff4d;
  --accent-deep: #98d223;
  --accent-soft: rgba(200, 255, 77, 0.22);
  --shadow: 0 22px 50px rgba(35, 39, 29, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(200, 255, 77, 0.35), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 186, 125, 0.22), transparent 24%),
    linear-gradient(180deg, #f5f1e8 0%, #f7f5ef 48%, #f2efe6 100%);
}

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

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.composer,
.results {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 36px;
}

.hero-copy::before,
.hero-panel::before,
.composer::before,
.results::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), transparent 38%),
    linear-gradient(180deg, transparent, rgba(17, 19, 15, 0.03));
  pointer-events: none;
}

.eyebrow,
.section-kicker,
.panel-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}

.hero h1 {
  margin: 14px 0 14px;
  font-size: clamp(2.7rem, 4vw, 4.8rem);
  line-height: 0.96;
  max-width: 12ch;
}

.hero p {
  max-width: 58ch;
  margin: 0 0 24px;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--muted);
}

.hero-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #162200;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 12px 24px rgba(168, 212, 55, 0.24);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.58;
  cursor: progress;
}

.button-ghost {
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
  box-shadow: none;
  border: 1px solid rgba(17, 19, 15, 0.1);
}

.hero-panel {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(160deg, rgba(17, 19, 15, 0.95), rgba(28, 33, 23, 0.92)),
    linear-gradient(180deg, rgba(200, 255, 77, 0.14), transparent 52%);
  color: #f9faef;
}

.hero-panel .panel-label {
  color: rgba(249, 250, 239, 0.76);
}

.status-chip {
  width: fit-content;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
}

.status-chip-soft {
  background: rgba(17, 19, 15, 0.06);
  color: var(--text);
}

.status-chip-loading {
  background: rgba(255, 255, 255, 0.1);
  color: #fbffdb;
}

.status-chip-success {
  background: rgba(200, 255, 77, 0.16);
  color: #dcff9f;
}

.status-chip-warning {
  background: rgba(255, 199, 143, 0.18);
  color: #ffe1ba;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.metric-card {
  border-radius: var(--radius-md);
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: rgba(249, 250, 239, 0.72);
}

.metric-card strong {
  font-size: 1.02rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(420px, 0.97fr);
  gap: 22px;
  align-items: start;
}

.composer,
.results {
  padding: 28px;
}

.section-head,
.card-head,
.asset-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.section-head h2,
.summary-card h3,
.hook-card h4,
.storyboard-card h4 {
  margin: 8px 0 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(17, 19, 15, 0.12);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(152, 210, 35, 0.8);
  box-shadow: 0 0 0 4px rgba(200, 255, 77, 0.18);
}

.field-span-2 {
  grid-column: 1 / -1;
}

.asset-block,
.brand-panel,
.summary-card,
.hook-card,
.storyboard-card,
.kit-card,
.copy-card,
.detail-card,
.json-card,
.empty-state {
  border: 1px solid rgba(17, 19, 15, 0.08);
  background: var(--surface-strong);
  border-radius: 22px;
  padding: 18px;
}

.asset-head p,
.empty-state p,
.summary-angle,
.hook-grid p,
.list-item,
.prompt-box p {
  color: var(--muted);
}

.assets-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.asset-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 140px auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-radius: 18px;
  background: #f5f6ef;
}

.asset-description {
  min-width: 0;
}

.asset-remove {
  border: 0;
  border-radius: 14px;
  padding: 14px 12px;
  background: rgba(17, 19, 15, 0.08);
  color: var(--text);
  cursor: pointer;
}

.brand-panel {
  margin-top: 4px;
}

.brand-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.results {
  min-height: 840px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  text-align: center;
}

.empty-state h3 {
  margin: 12px 0 8px;
  font-size: 1.5rem;
}

.result-content {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.summary-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.summary-card h3 {
  font-size: 2rem;
}

.summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.summary-pill,
.tag {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(17, 19, 15, 0.06);
  font-size: 0.84rem;
}

.hook-grid,
.copy-grid,
.production-grid {
  display: grid;
  gap: 14px;
}

.hook-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.hook-grid article {
  padding: 16px;
  border-radius: 18px;
  background: #f5f6ef;
}

.hook-grid h4 {
  margin: 0 0 8px;
}

.storyboard-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.scene-card {
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(200, 255, 77, 0.12), transparent 42%),
    #f9faf3;
  border: 1px solid rgba(17, 19, 15, 0.08);
}

.scene-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.scene-card h4 {
  margin: 0 0 12px;
  font-size: 1.18rem;
}

.scene-card p {
  margin: 0 0 10px;
  line-height: 1.5;
}

.prompt-box {
  padding: 14px;
  border-radius: 16px;
  background: rgba(17, 19, 15, 0.04);
}

.prompt-box span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.copy-main {
  line-height: 1.65;
  font-size: 1rem;
}

.tag-list,
.list-block,
.stack-block {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.kit-content {
  margin-top: 14px;
}

.empty-inline {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #f4f5ee;
  color: var(--muted);
}

.list-item {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  background: #f4f5ee;
}

.text-output,
.inline-pre {
  margin: 12px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.6;
}

.text-output {
  max-height: 280px;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: #11130f;
  color: #eaf0cf;
}

.inline-pre {
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(17, 19, 15, 0.06);
  color: var(--text);
}

.json-output {
  overflow: auto;
  margin: 12px 0 0;
  padding: 18px;
  border-radius: 18px;
  background: #11130f;
  color: #eaf0cf;
  font-size: 0.85rem;
  line-height: 1.6;
  font-family: "IBM Plex Mono", monospace;
}

.is-hidden {
  display: none;
}

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

  .results {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 18px, 100%);
    padding-top: 12px;
  }

  .hero-copy,
  .hero-panel,
  .composer,
  .results {
    padding: 20px;
    border-radius: 22px;
  }

  .form-grid,
  .brand-grid,
  .hook-grid,
  .copy-grid,
  .production-grid {
    grid-template-columns: 1fr;
  }

  .summary-card,
  .asset-head,
  .section-head,
  .card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .asset-row {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2.2rem, 12vw, 3.5rem);
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }
}
