:root {
  --bg: #f4efe5;
  --bg-accent: #eadcc5;
  --panel: rgba(255, 251, 245, 0.88);
  --ink: #1f1d1a;
  --muted: #6a645c;
  --line: rgba(31, 29, 26, 0.12);
  --primary: #d65d0e;
  --primary-dark: #9d4108;
  --secondary: #fff8ef;
  --shadow: 0 18px 60px rgba(65, 48, 25, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --mono: "Consolas", "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(214, 93, 14, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(177, 123, 43, 0.18), transparent 32%),
    linear-gradient(180deg, var(--bg) 0%, #f9f5ed 100%);
}

.page-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 24px auto 40px;
}

.hero,
.workspace {
  display: grid;
  gap: 20px;
}

.hero {
  grid-template-columns: 1.4fr 0.9fr;
  align-items: stretch;
}

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

.hero-copy {
  padding: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.hero-text {
  margin: 0;
  max-width: 48rem;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

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

.hero-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
}

.hero-card-label,
.mini-card-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.command-preview,
.json-preview {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: #fdf8ef;
  background: #1f1a16;
  border-radius: var(--radius-md);
  padding: 18px;
}

.command-preview {
  min-height: 120px;
}

.json-preview {
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
}

.workspace {
  grid-template-columns: 1.3fr 0.9fr;
  align-items: start;
}

.panel {
  padding: 24px;
}

.panel-header {
  margin-bottom: 18px;
}

.panel-header h2 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.panel-header p,
.section-divider p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.project-form,
.beats-list {
  display: grid;
  gap: 16px;
}

.field-grid {
  display: grid;
  gap: 14px;
}

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

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.field span {
  font-size: 13px;
  font-weight: 700;
  color: #4d473f;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(31, 29, 26, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  padding: 13px 14px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(214, 93, 14, 0.18);
  border-color: rgba(214, 93, 14, 0.6);
}

.section-divider {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  padding-top: 6px;
}

.section-divider h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.beat-card,
.mini-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.56);
  padding: 16px;
}

.beat-card {
  display: grid;
  gap: 14px;
}

.beat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.beat-card-header h4 {
  margin: 0;
  font-size: 16px;
}

.panel-preview {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 20px;
}

.asset-rules {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(31, 29, 26, 0.08);
  padding: 12px;
}

.stat-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.stat-value {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
  text-align: center;
}

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

.btn-primary {
  background: var(--primary);
  color: #fffaf4;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--ink);
  border: 1px solid rgba(31, 29, 26, 0.12);
}

.btn-ghost {
  background: transparent;
  color: var(--primary-dark);
  border: 1px solid rgba(214, 93, 14, 0.2);
}

.full-width {
  width: 100%;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

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

  .panel-preview {
    position: static;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    margin-top: 10px;
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 18px;
  }

  .two-col,
  .three-col,
  .summary-stats {
    grid-template-columns: 1fr;
  }

  .section-divider {
    display: grid;
  }

  .hero-actions {
    flex-direction: column;
  }
}
