:root {
  --bg: #f5efe3;
  --paper: rgba(255, 250, 241, 0.72);
  --panel: rgba(255, 249, 238, 0.9);
  --ink: #1f1d1a;
  --muted: #655d52;
  --line: rgba(31, 29, 26, 0.12);
  --accent: #d95f30;
  --accent-soft: #f4d4bf;
  --olive: #5d6b43;
  --shadow: 0 30px 80px rgba(79, 55, 33, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 95, 48, 0.22), transparent 26%),
    radial-gradient(circle at 90% 20%, rgba(93, 107, 67, 0.16), transparent 20%),
    linear-gradient(180deg, #f7f1e6 0%, #f2eadc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(31, 29, 26, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 29, 26, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent);
}

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

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.hero-copy h1 {
  margin: 10px 0 12px;
  max-width: 12ch;
  font-family: "DM Serif Display", serif;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.eyebrow,
.section-label,
.mini-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-text {
  max-width: 42rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-points span,
.chip span,
.scene-number {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.hero-points span {
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-card {
  padding: 22px;
}

.hero-card ul {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.workspace {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
}

.panel {
  padding: 24px;
}

.panel-head h2 {
  margin: 6px 0 0;
  font-size: 1.6rem;
}

.input-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-panel label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

.tone-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.tone-fieldset legend {
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(31, 29, 26, 0.1);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(217, 95, 48, 0.18);
  border-color: rgba(217, 95, 48, 0.45);
}

.tone-grid {
  display: flex;
  gap: 10px;
}

.chip {
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  min-width: 92px;
  font-weight: 700;
}

.chip input:checked + span {
  border-color: rgba(217, 95, 48, 0.35);
  background: var(--accent-soft);
}

.generate-button {
  border: 0;
  border-radius: 18px;
  padding: 16px 18px;
  font: inherit;
  font-weight: 800;
  color: #fff8f1;
  background: linear-gradient(135deg, #ca5328 0%, #e8834a 100%);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 16px 32px rgba(201, 83, 40, 0.22);
}

.generate-button:hover {
  transform: translateY(-1px);
}

.output-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.summary-card {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.summary-card > div,
.scene-card,
.video-frame {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.66);
}

.summary-card > div {
  padding: 16px;
}

.summary-card p:last-child {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.video-frame {
  overflow: hidden;
}

.video-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 249, 238, 0.8);
}

.video-topbar p {
  margin: 0 0 0 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(31, 29, 26, 0.16);
}

.video-stage {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  min-height: 320px;
}

.stage-left,
.stage-right {
  padding: 26px;
}

.stage-left {
  background:
    linear-gradient(135deg, rgba(217, 95, 48, 0.9), rgba(190, 68, 25, 0.78)),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
  color: #fff8f1;
}

.stage-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    radial-gradient(circle at 20% 25%, rgba(93, 107, 67, 0.32), transparent 30%),
    linear-gradient(180deg, rgba(255, 248, 241, 0.96), rgba(242, 231, 218, 0.92));
}

.stage-left p:last-child,
.stage-right p:last-child {
  font-size: clamp(1.2rem, 2vw, 2rem);
  line-height: 1.2;
  margin-bottom: 0;
}

.storyboard-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.storyboard-head p:last-child {
  margin: 0;
  color: var(--muted);
}

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

.scene-card {
  padding: 18px;
}

.scene-number {
  display: inline-flex;
  padding: 7px 11px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--muted);
}

.scene-title {
  margin: 14px 0 10px;
  font-size: 1.08rem;
}

.scene-visual,
.scene-script {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.scene-script {
  margin-top: 10px;
  color: var(--ink);
}

@media (max-width: 980px) {
  .hero,
  .workspace,
  .video-stage,
  .summary-card,
  .storyboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: 10ch;
  }

  .shell {
    width: min(100% - 24px, 1180px);
    padding-top: 24px;
  }
}
