* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  font-size: 19px;
  line-height: 1.7;
  color: #1a1a1a;
  background: #fafaf8;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

main {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ─── Progress bar ─── */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #e8e8e4;
  z-index: 100;
}

.progress-fill {
  height: 100%;
  background: #1a1a1a;
  transition: width 0.4s ease;
  width: 0%;
}

/* ─── Screens ─── */

.screen { display: none; }
.screen.active { display: block; }
.screen-center {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
.screen-center.active {
  display: flex;
}

/* ─── Landing ─── */

.screen-landing { padding-top: 120px; padding-bottom: 120px; }
.screen-landing.active { display: block; }

.lede {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 38px;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 20px;
  max-width: 660px;
  font-weight: 400;
}

.body-copy {
  font-size: 20px;
  line-height: 1.65;
  color: #555;
  margin-bottom: 8px;
  max-width: 660px;
}

.body-copy:last-of-type { margin-bottom: 48px; }
.body-copy em { font-style: italic; color: #333; }

.subtle-link {
  color: #999;
  text-decoration: none;
  border-bottom: 1px solid #ddd;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.subtle-link:hover { color: #555; border-color: #999; }

/* ─── Forms ─── */

textarea {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 18px;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 16px 18px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

textarea:focus { border-color: #1a1a1a; }
textarea::placeholder { color: #bbb; }

/* ─── Buttons ─── */

.button-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.button-row-center { justify-content: center; margin-top: 32px; }

.btn-primary {
  display: inline-block;
  padding: 12px 26px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 17px;
  font-weight: 400;
  color: #fafaf8;
  background: #1a1a1a;
  border: 1px solid #1a1a1a;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.01em;
}
.btn-primary:hover { background: #333; border-color: #333; }
.btn-primary:disabled { background: #ccc; border-color: #ccc; cursor: not-allowed; }

.btn-secondary {
  display: inline-block;
  padding: 12px 26px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 17px;
  font-weight: 400;
  color: #888;
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: #999; color: #555; }

.btn-small { padding: 9px 16px; font-size: 14px; }

[hidden] { display: none !important; }

.btn-back {
  font-family: inherit;
  font-size: 14px;
  color: #aaa;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.btn-back:hover { color: #555; }

/* ─── Wizard ─── */

.wizard-card {
  width: 100%;
  max-width: 640px;
  padding: 0 24px;
}

.wizard-context {
  font-size: 14px;
  color: #999;
  margin-bottom: 12px;
  line-height: 1.5;
}

.wizard-question {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.35;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.wizard-subtext {
  font-size: 16px;
  color: #888;
  margin-bottom: 28px;
  line-height: 1.5;
}

.wizard-card textarea {
  margin-bottom: 0;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.wizard-actions-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ─── Loading ─── */

.loading-card {
  text-align: center;
}

.loading-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.loading-progress-track { display: none; }
.loading-progress-bar { display: none; }

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a1a1a;
  animation: pulse 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.loading-text {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  color: #555;
  transition: opacity 0.3s;
}

.loading-subtext {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #999;
  max-width: 420px;
  text-align: center;
  margin-top: 12px;
  line-height: 1.6;
  transition: opacity 0.3s;
  min-height: 40px;
}

/* ─── Results: Gallery ─── */

.results-header {
  padding-top: 60px;
  margin-bottom: 40px;
}

.results-headline {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1.2;
}

.results-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin-bottom: 72px;
}

.gallery-card {
  border: 1px solid #e8e8e4;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}
.gallery-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }

.gallery-card-header {
  width: 100%;
  padding: 32px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gallery-card-header-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.gallery-card-swatches {
  display: flex;
  gap: 6px;
}

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
}

.gallery-card-body { padding: 22px; }

.gallery-card-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  color: #1a1a1a;
  margin-bottom: 4px;
  line-height: 1.2;
}

.gallery-card-type {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin-bottom: 14px;
}

.gallery-card-story {
  font-size: 15px;
  line-height: 1.6;
  color: #555;
  margin-bottom: 14px;
}

.gallery-card-tagline {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  font-style: italic;
}

.gallery-card-details {
  margin-top: 12px;
  border-top: 1px solid #e5e5e3;
  padding-top: 8px;
}

.gallery-card-details summary {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gallery-card-details[open] summary {
  margin-bottom: 10px;
}

.detail-row {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #444;
  margin-bottom: 8px;
}

.detail-label {
  font-weight: 600;
  color: #1a1a1a;
}

/* ─── Results: Report ─── */

.results-report {
  max-width: 700px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.report-headline {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8e8e4;
}

.report-section {
  margin-bottom: 16px;
  border: 1px solid #e8e8e4;
  border-radius: 6px;
  overflow: hidden;
}

.report-section summary {
  padding: 14px 18px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 16px;
  color: #555;
  cursor: pointer;
  background: #f5f5f2;
  user-select: none;
  transition: background 0.15s;
}
.report-section summary:hover { background: #eee; color: #333; }

.report-section-content {
  padding: 18px;
  font-size: 15px;
  line-height: 1.7;
  color: #444;
}

.report-section-content h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 18px;
  font-weight: 400;
  margin-top: 20px;
  margin-bottom: 6px;
}

.report-section-content p { margin-bottom: 12px; }
.report-section-content strong { font-weight: 600; }
.report-section-content em { font-style: italic; }
.report-section-content hr { border: none; border-top: 1px solid #eee; margin: 20px 0; }

/* ─── Results: Footer ─── */

.results-footer {
  text-align: center;
  padding: 40px 0 100px;
}

/* ─── Wide layout for results ─── */

body.results-mode main {
  max-width: 1100px;
  padding-left: 40px;
  padding-right: 40px;
}

/* ─── Responsive ─── */

@media (max-width: 480px) {
  .screen-landing { padding-top: 72px; }
  .lede { font-size: 30px; }
  .body-copy { font-size: 18px; }
  .wizard-question { font-size: 24px; }
  .results-gallery { grid-template-columns: 1fr; }
  .results-headline { font-size: 32px; }
  .button-row { flex-direction: column; align-items: stretch; }
  .btn-primary, .btn-secondary { text-align: center; }
}
