:root {
  --bg: #f6efe5;
  --paper: rgba(255, 251, 246, 0.92);
  --paper-strong: #fffaf3;
  --ink: #1f2926;
  --muted: #5f6d68;
  --line: rgba(31, 41, 38, 0.12);
  --accent: #d85f31;
  --accent-deep: #a63f18;
  --accent-soft: rgba(216, 95, 49, 0.14);
  --forest: #27564a;
  --forest-soft: rgba(39, 86, 74, 0.13);
  --gold: #d6a245;
  --shadow: 0 28px 80px rgba(51, 45, 36, 0.12);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(214, 162, 69, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(39, 86, 74, 0.12), transparent 28%),
    linear-gradient(180deg, #fbf6ef 0%, #efe5d7 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

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

.site-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.site-menu-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.76);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.site-menu-link:hover,
.site-menu-link.active {
  transform: translateY(-2px);
  border-color: rgba(216, 95, 49, 0.34);
  background: rgba(255, 245, 236, 0.96);
}

.hero,
.template-card,
.meta-card,
.question-section,
.preview-card,
.hero-panel {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 420px);
  gap: 24px;
  padding: 34px;
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
}

.eyebrow,
.panel-label,
.status-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Baskerville", "Georgia", serif;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.6rem, 4vw, 4.5rem);
  line-height: 0.95;
  max-width: 11ch;
}

h2 {
  font-size: clamp(1.8rem, 2.6vw, 2.8rem);
}

h3 {
  font-size: 1.3rem;
}

.lede,
.section-note {
  color: var(--muted);
  max-width: 58ch;
}

.privacy-note {
  margin: 10px 0 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.hero-actions,
.preview-actions,
.status-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.primary-link,
.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.primary-link,
.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff9f3;
  box-shadow: 0 16px 34px rgba(216, 95, 49, 0.26);
}

.ghost-button {
  background: rgba(255, 250, 243, 0.72);
  color: var(--ink);
  border: 1px solid var(--line);
}

.hero-panel {
  padding: 22px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 250, 243, 0.92), rgba(245, 233, 214, 0.84)),
    var(--paper);
}

.starter-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.template-strip {
  margin-bottom: 28px;
}

.section-heading,
.builder-header,
.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

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

.template-card {
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.template-card:hover,
.template-card.active {
  transform: translateY(-4px);
  border-color: rgba(216, 95, 49, 0.35);
  background:
    linear-gradient(180deg, rgba(216, 95, 49, 0.08), rgba(255, 251, 246, 0.92)),
    var(--paper);
}

.template-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.template-meta {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--forest-soft);
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 700;
}

.builder {
  padding-top: 8px;
}

.status-chip {
  min-width: 140px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 250, 243, 0.72);
  border: 1px solid var(--line);
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 22px;
  margin-top: 20px;
}

.question-panel {
  display: grid;
  gap: 18px;
}

.meta-card,
.question-section,
.preview-card {
  border-radius: var(--radius-xl);
  padding: 22px;
}

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

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 38, 0.14);
  background: rgba(255, 252, 247, 0.92);
  color: var(--ink);
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(216, 95, 49, 0.3);
  border-color: rgba(216, 95, 49, 0.38);
}

.questions-root {
  display: grid;
  gap: 18px;
}

.question-section {
  display: grid;
  gap: 14px;
}

.section-index {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 800;
}

.question-row {
  display: grid;
  gap: 8px;
}

.question-row p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.preview-card.sticky {
  position: sticky;
  top: 18px;
}

.output-preview {
  margin: 18px 0 0;
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 18px;
  border-radius: 20px;
  background: #231f1a;
  color: #f8f4ee;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .preview-card.sticky {
    position: static;
  }
}

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

  .hero,
  .meta-card,
  .question-section,
  .preview-card {
    padding: 18px;
  }

  .template-grid,
  .meta-card {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .section-heading,
  .builder-header,
  .preview-header {
    align-items: start;
    flex-direction: column;
  }

  h1 {
    max-width: none;
  }
}
