:root {
  --bg: #1c1917;
  --bg2: #292524;
  --surface: #2a2623;
  --ink: #f5f0e8;
  --muted: #a8a29e;
  --accent: #5eead4;
  --accent-deep: #2dd4bf;
  --accent-ink: #0f1f1c;
  --line: rgba(245, 240, 232, 0.1);
  --line-strong: rgba(94, 234, 212, 0.28);
  --warn: #fda4af;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Literata", Georgia, "Times New Roman", serif;
  --radius: 3px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 55% at 85% 0%, rgba(94, 234, 212, 0.14), transparent 52%),
    radial-gradient(ellipse 45% 40% at 5% 90%, rgba(120, 90, 60, 0.22), transparent 55%),
    linear-gradient(168deg, #1c1917 0%, #231f1c 48%, #1a2422 100%);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  background: rgba(28, 25, 23, 0.72);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.top nav { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.top nav a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.top nav a:not(.btn):hover { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn.buy { background: var(--accent); color: var(--accent-ink); }
.btn.buy:hover:not(:disabled) { background: var(--accent-deep); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover:not(:disabled) { border-color: var(--line-strong); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }

/* —— Landing —— */
.hero {
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem 1.5rem 4.5rem;
  max-width: 42rem;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: 18%;
  bottom: 22%;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  opacity: 0.55;
  animation: pulse-line 3.2s ease-in-out infinite;
}
@keyframes pulse-line {
  0%, 100% { opacity: 0.25; transform: scaleY(0.92); }
  50% { opacity: 0.7; transform: scaleY(1); }
}
.brand-hero {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 4.25rem);
  letter-spacing: -0.035em;
  margin: 0 0 1.1rem;
  line-height: 0.98;
  padding-left: 1.15rem;
  animation: rise-in 0.7s ease both;
}
.hero h1 {
  font-family: var(--font);
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 600;
  margin: 0 0 0.85rem;
  max-width: 28ch;
  line-height: 1.35;
  padding-left: 1.15rem;
  animation: rise-in 0.7s 0.08s ease both;
}
.lede {
  color: var(--muted);
  margin: 0 0 1.85rem;
  max-width: 38ch;
  padding-left: 1.15rem;
  animation: rise-in 0.7s 0.16s ease both;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-left: 1.15rem;
  animation: rise-in 0.7s 0.24s ease both;
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.strip {
  padding: 2.75rem 1.5rem 3.25rem;
  border-top: 1px solid var(--line);
  max-width: 42rem;
}
.strip h2 {
  font-family: var(--display);
  font-weight: 650;
  margin: 0 0 1rem;
  font-size: 1.35rem;
}
.strip ul { margin: 0; padding-left: 1.15rem; color: var(--muted); }
.strip li { margin-bottom: 0.45rem; }

.foot {
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.foot a { color: var(--accent); }

/* —— App —— */
.app-body { background: var(--bg); }
.app-body .atmosphere { display: none; }
.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}
.status {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.status.unlocked::before { background: var(--accent); box-shadow: 0 0 8px rgba(94, 234, 212, 0.55); }

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.panel-title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 650;
  margin: 0;
  letter-spacing: -0.02em;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
input, textarea, select {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  width: 100%;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.12);
}
textarea { resize: vertical; min-height: 4.5rem; }

.phase-list { display: flex; flex-direction: column; gap: 0.5rem; }
.phase-row {
  display: grid;
  grid-template-columns: 1fr 7.5rem auto;
  gap: 0.45rem;
  align-items: center;
}
.phase-row input { text-transform: none; letter-spacing: normal; font-weight: 500; }
.phase-remove {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
}
.phase-remove:hover { color: var(--warn); border-color: rgba(253, 164, 175, 0.4); }
.phase-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

/* Preview */
.preview-wrap {
  position: sticky;
  top: 4.5rem;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.35rem 1.4rem 1.5rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
}
.preview-wrap .panel-title { margin-bottom: 0.25rem; }
.preview-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1.1rem;
}
.proposal {
  font-family: var(--display);
}
.proposal .p-kicker {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.35rem;
}
.proposal .p-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.15rem;
  line-height: 1.15;
}
.proposal .p-client {
  font-family: var(--font);
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
}
.proposal section {
  margin-bottom: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.proposal section h3 {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 0.45rem;
}
.proposal section p,
.proposal section li {
  font-family: var(--font);
  font-size: 0.92rem;
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
}
.proposal section ul {
  margin: 0;
  padding-left: 1.1rem;
}
.proposal section li { margin-bottom: 0.3rem; }
.proposal .empty { color: var(--muted); font-style: italic; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  font-size: 0.88rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius);
  transition: transform 0.28s ease;
  z-index: 40;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

dialog {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg2);
  color: var(--ink);
  padding: 1.35rem;
  max-width: 23rem;
  width: calc(100% - 2rem);
}
dialog::backdrop { background: rgba(12, 10, 9, 0.72); }
dialog h2 {
  font-family: var(--display);
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}
dialog p { color: var(--muted); font-size: 0.9rem; }
.err { color: var(--warn); font-size: 0.85rem; margin: 0.35rem 0 0; }

@media (max-width: 560px) {
  .top { flex-wrap: wrap; gap: 0.75rem; }
  .hero::before { display: none; }
  .brand-hero, .hero h1, .lede, .cta-row { padding-left: 0; }
  .phase-row { grid-template-columns: 1fr; }
  .preview-wrap { position: static; max-height: none; }
}
