:root {
  --sand: #e9e1d4;
  --sand-soft: #f4efe6;
  --ink: #1c1915;
  --gold: #b08958;
  --gold-soft: #d4b483;
  --jungle: #1a332c;
  --jungle-deep: #121c18;
  --muted: rgba(28, 25, 21, 0.68);
  --line: rgba(176, 137, 88, 0.35);
  --focus: #b08958;
  --radius: 2px;
  --max: 820px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: Outfit, system-ui, sans-serif;
  font-weight: 300;
  color: var(--ink);
  background: var(--sand-soft);
  line-height: 1.55;
}

a { color: var(--jungle); }
a:hover { color: var(--gold); }

img { max-width: 100%; display: block; }

.wrap {
  width: min(100% - 40px, var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(26, 51, 44, 0.92);
  color: var(--sand);
  backdrop-filter: blur(8px);
}

.site-header a {
  color: var(--sand);
  text-decoration: none;
}
.site-header a:hover { color: var(--gold-soft); }

.brand {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.brand b {
  display: block;
  margin-top: 2px;
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--sand);
}

.eyebrow {
  display: block;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

h1, h2, .display {
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
}

h1 { font-size: clamp(32px, 6vw, 48px); }
h2 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 12px; }

.lead {
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 38em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #1c1915;
  font-family: Outfit, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover,
.btn:focus {
  filter: brightness(1.06);
  color: #1c1915;
}
.btn:focus-visible,
.chip:focus-visible,
.ghost:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.btn.ghost {
  background: transparent;
  color: var(--jungle);
}
.btn.ghost:hover,
.btn.ghost:focus {
  color: var(--jungle);
  background: rgba(176, 137, 88, 0.12);
  filter: none;
}
.btn.ghost.light {
  border-color: var(--gold-soft);
  color: var(--sand);
}
.btn.ghost.light:hover,
.btn.ghost.light:focus {
  color: var(--sand);
  background: rgba(233, 225, 212, 0.12);
  filter: none;
}
.btn.block { width: 100%; }

.hero {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(176, 137, 88, 0.18), transparent 50%),
    linear-gradient(180deg, var(--jungle) 0%, #152822 100%);
  color: var(--sand);
  padding: 72px 0 80px;
}
.hero .lead { color: rgba(233, 225, 212, 0.88); }
.hero .support {
  margin-top: 14px;
  font-size: 14px;
  color: rgba(233, 225, 212, 0.7);
}
.hero-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

.section { padding: 64px 0; }
.section.alt { background: #fff; }
.section.dark {
  background: var(--jungle);
  color: var(--sand);
}
.section.dark .lead { color: rgba(233, 225, 212, 0.85); }

.intro p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 40em;
}
.intro .highlight {
  margin: 28px 0;
  padding: 20px 22px;
  border-left: 3px solid var(--gold);
  background: rgba(176, 137, 88, 0.1);
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  font-style: italic;
  color: var(--jungle);
  line-height: 1.3;
}

.benefits {
  display: grid;
  gap: 20px;
  margin-top: 36px;
}
@media (min-width: 720px) {
  .benefits { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
.benefit h3 {
  font-family: Outfit, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  color: var(--jungle);
}
.benefit p { margin: 0; font-size: 15px; color: var(--muted); }

.how ol {
  margin: 20px 0 0;
  padding-left: 1.2em;
  color: var(--muted);
}
.how li { margin-bottom: 10px; }

.faq details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

.site-footer {
  padding: 36px 20px 48px;
  background: var(--jungle-deep);
  color: rgba(233, 225, 212, 0.75);
  font-size: 14px;
  text-align: center;
}
.site-footer a { color: var(--gold-soft); }
.site-footer .tag { color: var(--gold-soft); letter-spacing: 0.16em; text-transform: uppercase; font-size: 11px; }

/* Wizard */
.wizard-shell { padding: 28px 0 80px; }
.progress-wrap { margin-bottom: 28px; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.progress-bar {
  height: 4px;
  background: rgba(26, 51, 44, 0.12);
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.25s ease;
}

.step-head { margin-bottom: 28px; }
.step-head p { color: var(--muted); max-width: 40em; }

.q-block { margin-bottom: 32px; }
.q-block h3 {
  font-family: Outfit, sans-serif;
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 8px;
}
.q-hint { font-size: 13px; color: var(--muted); margin: 0 0 14px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid rgba(26, 51, 44, 0.2);
  background: #fff;
  color: var(--ink);
  font-family: Outfit, sans-serif;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.chip[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(176, 137, 88, 0.16);
  color: var(--jungle);
  font-weight: 500;
}
.chip:disabled { opacity: 0.45; cursor: not-allowed; }

.order-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 8px;
}
.order-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
}
.order-list .n {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--jungle);
  color: var(--sand);
  font-size: 12px;
  flex-shrink: 0;
}
.order-list .order-move {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.order-list .order-move .btn {
  padding: 4px 8px;
  min-height: 0;
  font-size: 14px;
  line-height: 1;
}

.gap-table { display: grid; gap: 16px; }
.gap-row {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.gap-row strong { display: block; margin-bottom: 10px; font-weight: 500; }
.gap-controls {
  display: grid;
  gap: 10px;
}
@media (min-width: 560px) {
  .gap-controls { grid-template-columns: 1fr 1fr; gap: 16px; }
}
.gap-controls label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.gap-controls input[type="range"] { width: 100%; accent-color: var(--gold); }
.gap-diff {
  margin-top: 8px;
  font-size: 13px;
  color: var(--jungle);
}
.gap-diff.focus { font-weight: 500; color: #6b4f28; }

.field { margin-top: 12px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.field input[type="email"],
.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(26, 51, 44, 0.22);
  background: #fff;
  font-family: inherit;
  font-size: 15px;
}
.field textarea { min-height: 96px; resize: vertical; }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  margin: 12px 0;
}
.check input { margin-top: 3px; accent-color: var(--gold); }

.nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.nav-row .btn:last-of-type {
  margin-left: auto;
}
.nav-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}
.text-tool {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.text-tool:hover { color: var(--jungle); }
.skip-link {
  display: inline-block;
  margin-top: 20px;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.skip-link:hover { color: var(--jungle); }
.summary-box {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(26, 51, 44, 0.05);
  font-size: 14px;
}
.summary-box ul { margin: 8px 0 0; padding-left: 1.2em; }

.mission-preview {
  display: grid;
  gap: 14px;
  margin: 16px 0;
}
.mission-card {
  padding: 18px 18px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.mission-card[aria-pressed="true"] {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.mission-card small {
  display: block;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 8px;
}
.mission-card p { margin: 0; font-family: "Cormorant Garamond", serif; font-size: 20px; line-height: 1.35; }

.select-count { font-variant-numeric: tabular-nums; }
.select-count.at-limit { color: #6b4f28; font-weight: 500; }

/* Result */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 32px;
}
.result-block {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.result-block h2 {
  font-size: 28px;
  margin-bottom: 12px;
}
.mission-edit {
  width: 100%;
  min-height: 140px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  line-height: 1.4;
}
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.pill-list li {
  padding: 6px 12px;
  background: rgba(176, 137, 88, 0.15);
  font-size: 14px;
}
.email-box {
  margin-top: 32px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
}
.status {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}
.status.ok { color: var(--jungle); }
.status.err { color: #8a2b2b; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.chapter-blurb {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 16px;
}
.q-help {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 38em;
  margin: 0 0 18px;
}
.reflect-area {
  min-height: 180px !important;
  font-size: 17px !important;
  line-height: 1.55 !important;
}
.save-hint { margin-top: 8px; }
.inspiration-panel {
  margin-top: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.inspiration-panel .deepen-prompt {
  margin: 14px 0 8px;
  font-size: 15px;
}
.insp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.people-grid, .discovery-list, .themes-list, .commit-list { display: grid; gap: 16px; }
.people-row, .meaning-block, .discovery-card, .theme-row {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.people-row h4, .meaning-block h4 { margin: 0 0 10px; font-weight: 500; font-size: 16px; }
.ai-badge {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.tensions {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(26, 51, 44, 0.05);
}
.chapter-list {
  padding-left: 1.2em;
  display: grid;
  gap: 12px;
  color: var(--muted);
}
.chapter-list strong { color: var(--ink); font-weight: 500; }
.commit-result { padding-left: 1.1em; display: grid; gap: 14px; }
.result-doc .mission-edit { min-height: 160px; max-height: 50vh; overflow: auto; }
.mission-print-view {
  display: none;
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

@media print {
  .site-header, .result-actions, .email-box, .site-footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .wrap { width: 100%; max-width: none; }
  .result-doc { max-width: 40em; }
  /* Textarea con scroll se rompe al imprimir → usar bloque de texto */
  #missionText,
  textarea.mission-edit {
    display: none !important;
  }
  .mission-print-view {
    display: block !important;
    border: none;
    padding: 0;
    margin: 0 0 8px;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
  }
  .result-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .pill-list { break-inside: avoid; }
}
