/* ── Prism Pipeline — matches prism-monetization.vercel.app ─ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:         #F5F3EE;
  --ink:        #0D0D0B;
  --ink-2:      #3A3833;
  --ink-3:      #6B6660;
  --ink-4:      #A09A93;
  --rule:       #D8D3CB;
  --dark:       #0D0D0B;
  --dark-text:  #F5F3EE;
  --dark-muted: #8A8480;

  --serif: 'EB Garamond', Georgia, serif;
  --sans:  'Inter', system-ui, sans-serif;
  --mono:  'JetBrains Mono', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Lightbox ────────────────────────────────────────────── */
#prismLightbox {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
}
#prismLightbox.is-open { display: flex; align-items: center; justify-content: center; }
.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(13,13,11,0.75);
  backdrop-filter: blur(4px);
}
.lb-panel {
  position: relative; z-index: 1;
  background: var(--bg);
  border: 1px solid var(--rule);
  max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.lb-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.lb-title {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-4);
}
.lb-close {
  font-size: 14px; color: var(--ink-3); background: none;
  border: none; cursor: pointer; padding: 0 4px; line-height: 1;
}
.lb-close:hover { color: var(--ink); }
.lb-img-wrap { overflow-y: auto; flex: 1; }
.lb-img { display: block; width: 100%; height: auto; }

/* ── Nav ─────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.nav.is-scrolled { border-color: var(--rule); }
.nav__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 48px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__wordmark {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.nav__wordmark-sub {
  font-weight: 400;
  font-style: italic;
  color: var(--ink-3);
}
.nav__right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-ghost {
  font-size: 14px;
  color: var(--ink-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px 0;
  transition: color 0.15s;
}
.btn-ghost:hover { color: var(--ink); }
.btn-outline {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ── Screens ─────────────────────────────────────────────── */
.screen {
  min-height: calc(100vh - 54px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 48px 80px;
}
.screen--hidden { display: none !important; }

/* ── Input screen ────────────────────────────────────────── */
.input-wrap {
  max-width: 600px;
  width: 100%;
}
.input-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 28px;
}
.input-title {
  font-family: var(--serif);
  font-size: clamp(42px, 5.5vw, 62px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.0;
  color: var(--ink);
  margin-bottom: 20px;
}
.input-title em { font-style: italic; font-weight: 400; }
.input-sub {
  font-size: 16px;
  color: var(--ink-3);
  line-height: 1.7;
  margin-bottom: 48px;
  max-width: 460px;
}

/* ── Form ────────────────────────────────────────────────── */
.form-body { display: flex; flex-direction: column; gap: 20px; }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-field { display: flex; flex-direction: column; gap: 7px; }

.form-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.form-label span { opacity: 0.7; }

.form-input,
.form-textarea {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--ink-4); }
.form-input:focus,
.form-textarea:focus { border-color: var(--ink); }

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}
.form-textarea--mono {
  font-family: var(--mono);
  font-size: 12px;
  min-height: 160px;
}
.form-hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.form-divider {
  height: 1px;
  background: var(--rule);
  margin: 4px 0;
}

.btn-run {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 20px;
  background: var(--dark);
  color: var(--dark-text);
  border: none;
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  width: 100%;
}
.btn-run:hover { opacity: 0.8; }
.btn-run:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-run__arrow { font-family: var(--mono); font-size: 13px; }
.form-quick-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: -8px;
}
.btn-prefill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}
.btn-prefill:hover { color: var(--ink-3); }

/* ── Loading screen ──────────────────────────────────────── */
.loading-wrap {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 380px;
  width: 100%;
}
.loading-wordmark {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 28px;
  animation: fade-pulse 2.2s ease-in-out infinite;
}
@keyframes fade-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
.loading-status {
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.loading-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 40px;
}
.steps-track {
  width: 100%;
  border-top: 1px solid var(--rule);
}
.step-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
}
.step-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  width: 20px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  transition: color 0.2s;
}
.step-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--ink);
  border-radius: 50%;
  color: var(--bg);
  font-size: 9px;
  line-height: 1;
}
.step-label {
  font-size: 13px;
  color: var(--ink-4);
  transition: color 0.2s;
}
.step-row.active .step-num  { color: var(--ink); }
.step-row.active .step-label { color: var(--ink); font-weight: 500; }
.step-row.done .step-num   { color: var(--ink-3); }
.step-row.done .step-label { color: var(--ink-3); }

/* ── Report screen ───────────────────────────────────────── */
#screenReport {
  display: block;
  min-height: 100vh;
  padding: 0;
  align-items: stretch;
}
.report-topbar {
  position: sticky;
  top: 54px;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 0 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.report-topbar-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.report-layout {
  display: flex;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 0;
}
#reportBody {
  flex: 1;
  min-width: 0;
  max-width: 860px;
  padding: 64px 48px 120px;
}

/* ── TOC sidebar ── */
.report-toc {
  width: 180px;
  flex-shrink: 0;
  padding-top: 68px;
  padding-right: 32px;
}
.report-toc__inner {
  position: sticky;
  top: 120px;
}
.toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.toc-num {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-4);
  letter-spacing: 0.06em;
  flex-shrink: 0;
  transition: color 0.15s;
}
.toc-label {
  font-size: 12px;
  color: var(--ink-4);
  line-height: 1.3;
  transition: color 0.15s;
}
.toc-item:hover .toc-num,
.toc-item:hover .toc-label { color: var(--ink-3); }
.toc-item.is-active .toc-num { color: var(--ink); }
.toc-item.is-active .toc-label { color: var(--ink); font-weight: 500; }
