:root {
  --bg: #0f100e;
  --fg: #eceae4;
  --muted: #9a968c;
  --card: #181914;
  --border: #2a2b26;
  --sage: #c98a5f;
  --amber: #c4a574;
  --ink: #0f100e;
  --paper: #eceae4;
  --danger: #c47878;
  --win: #7fa87c;      /* completed steps — the only green in the palette */
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Georgia", "Times New Roman", serif;
  --mono: "SF Mono", "Consolas", ui-monospace, monospace;
  --shadow: 0 0 0 1px var(--border);
  --radius: 12px;
  --max: 64rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sage); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sage { color: var(--sage); }
.amber { color: var(--amber); }

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.25rem;
}
.brand:hover { text-decoration: none; }
.mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--sage), #5a6b58);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.25rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--fg); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover { background: #fff; color: var(--bg); }
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}
.btn-outline:hover { border-color: var(--muted); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover { color: var(--fg); }
.btn-sage {
  background: rgb(138 154 136 / 0.15);
  color: var(--sage);
  border-color: rgb(138 154 136 / 0.35);
}
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Hero */
.hero { padding: 2rem 0 3.5rem; }
.eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  max-width: 18ch;
  margin: 0 0 1.25rem;
}
.hero .lede {
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1.75rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Cards / panels */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}
.grid-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.grid-2 {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

/* Pricing */
.price-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.price-card.featured {
  box-shadow: 0 0 0 1px var(--sage);
}
.price-card h3 { margin: 0; font-size: 1.35rem; }
.price-amount {
  font-family: var(--display);
  font-size: 2.25rem;
  margin: 0.25rem 0;
}
.price-amount span { font-size: 1rem; color: var(--muted); }
.price-card ul {
  margin: 0.5rem 0 1rem;
  padding: 0;
  list-style: none;
  flex: 1;
}
.price-card li {
  padding: 0.35rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  border-bottom: 1px solid rgb(42 43 38 / 0.6);
}
.price-card li::before {
  content: "→ ";
  color: var(--sage);
}

/* Forms */
label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  padding: 0.6rem 0.75rem;
  font: inherit;
  margin-bottom: 0.85rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgb(138 154 136 / 0.45);
  outline-offset: 1px;
}
.field-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}
.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.5rem 0 1rem;
}
.check input { width: auto; margin: 0.2rem 0 0; }

/* Progress */
.progress-track {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), #a8b8a6);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.phases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.phase {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: var(--border);
  color: var(--muted);
}
.phase.on { background: rgb(138 154 136 / 0.2); color: var(--sage); }

/* Live draft paper */
.stage {
  overflow: hidden;
  border-radius: var(--radius);
  background: #121310;
  box-shadow: var(--shadow);
}
.stage-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.paper {
  background: var(--paper);
  color: var(--ink);
  min-height: 16rem;
  max-height: 22rem;
  overflow: auto;
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.caret {
  display: inline-block;
  width: 0.5ch;
  height: 0.9em;
  background: var(--ink);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Hermes chips */
.chip-group { margin-bottom: 1rem; }
.chip-label {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  border-radius: 99px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.chip:hover { border-color: var(--sage); color: var(--sage); }

.log {
  max-height: 20rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.log .who {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.log .msg {
  font-size: 0.9rem;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--fg); }

.section { padding: 2.5rem 0; }
.section h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 0 0 0.75rem;
}
.section .sub {
  color: var(--muted);
  max-width: 36rem;
  margin: 0 0 1.5rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgb(196 165 116 / 0.15);
  color: var(--amber);
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--fg);
  color: var(--bg);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  max-width: 20rem;
  z-index: 50;
  animation: rise 0.25s ease;
}
@keyframes rise {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.legal {
  max-width: 42rem;
  padding: 2rem 0 4rem;
}
.legal h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.legal h2 { font-size: 1.2rem; margin-top: 1.75rem; }
.legal p, .legal li { color: var(--muted); font-size: 0.95rem; }
.legal ul { padding-left: 1.2rem; }

.plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}
.plan-table th, .plan-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.plan-table th { color: var(--muted); font-weight: 500; }

.hidden { display: none !important; }

/* ---------- Celebrations: fireworks + shooting star ---------- */
.burst { position: fixed; z-index: 999; pointer-events: none; }
.spark {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  animation: spark-fly 950ms cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}
@keyframes spark-fly {
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}
.star {
  position: fixed; z-index: 999; pointer-events: none;
  width: 110px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--paper));
  transform: rotate(24deg);
  animation: star-shoot 800ms ease-in forwards;
}
@keyframes star-shoot {
  60% { opacity: 1; }
  100% { transform: rotate(24deg) translateX(-45vw); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .spark, .star { animation: none; display: none; }
}

/* ---------- Support widget ---------- */
.support-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 90;
  border: 1px solid var(--border); border-radius: 99px;
  background: var(--card); color: var(--fg);
  padding: 0.55rem 1rem; font: inherit; font-size: 0.9rem;
  cursor: pointer; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.support-fab:hover { border-color: var(--sage); }
.support-panel {
  position: fixed; right: 1rem; bottom: 3.6rem; z-index: 90;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1rem; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
.support-log { max-height: 16rem; margin-bottom: 0.6rem; }
.support-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.support-chips .chip { font-size: 0.75rem; }
.support-form { display: flex; gap: 0.4rem; }
.support-form input { flex: 1; min-width: 0; margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
