:root {
  --ink: #0a0a0a;
  --paper: #fafafa;
  --cream: #dfdacd;
  --muted: rgba(223, 218, 205, 0.55);
  --muted-strong: rgba(223, 218, 205, 0.78);
  --border: rgba(223, 218, 205, 0.14);
  --doc-ink: #0a0a0a;
  --doc-soft: #3a3530;
  --doc-muted: #8a847a;
  --doc-line: #e5e2dc;
  --doc-cream-soft: #f5f4f0;
  --brand: 'Archivo Black', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--ink);
  color: var(--paper);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* nav */
.nav { padding: 1.4rem 0; border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: baseline; justify-content: space-between; }
.brand { font-family: var(--brand); font-size: 1.1rem; letter-spacing: 0.01em; }
.nav-tag {
  font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}

.eyebrow {
  font-family: 'DM Mono', monospace; font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); display: inline-flex;
  align-items: center; gap: 0.55rem;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cream); display: inline-block; }

/* hero */
.hero { padding: 6.5rem 0 5rem; }
.hero h1 {
  font-weight: 900; font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1.0;
  letter-spacing: -0.03em; margin: 1.6rem 0 1.4rem; max-width: 21ch;
}
.hero h1 .accent { color: var(--cream); opacity: 0.6; display: block; }
.hero .sub { font-size: 1.05rem; color: var(--muted-strong); max-width: 38rem; margin-bottom: 2.2rem; }
.hero-ctas { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.price-tag { font-family: 'DM Mono', monospace; font-size: 0.85rem; color: var(--muted-strong); }
.price-tag strong { color: var(--cream); font-size: 1.05rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.95rem 1.7rem;
  border-radius: 100px; font-weight: 700; font-size: 0.92rem; border: none;
  background: var(--cream); color: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-ghost {
  background: transparent; color: var(--cream); border-bottom: 1px solid var(--cream);
  border-radius: 0; padding: 0.4rem 0.1rem;
}
.btn-ghost:hover { transform: none; opacity: 0.7; }

/* sections */
.section { padding: 4.5rem 0; border-top: 1px solid var(--border); }
.section h2 {
  font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.02em; margin: 1.2rem 0 2rem;
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.step-num { font-family: 'DM Mono', monospace; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.7rem; }
.step h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.step p { font-size: 0.95rem; color: var(--muted-strong); }

.cat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 3rem; max-width: 56rem; }
.cat-item { border-left: 2px solid var(--cream); padding-left: 1.1rem; }
.cat-item h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
.cat-item p { font-size: 0.92rem; color: var(--muted-strong); }

/* form */
.form-card {
  background: rgba(223, 218, 205, 0.04); border: 1px solid var(--border);
  border-radius: 14px; padding: 2.5rem; max-width: 46rem;
}
.field-group { margin-bottom: 1.8rem; }
.field-label {
  display: block; font-family: 'DM Mono', monospace; font-size: 0.7rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 0.6rem;
}
.field-hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.4rem; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; background: rgba(223, 218, 205, 0.06); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75rem 1rem; color: var(--paper);
  font-family: inherit; font-size: 0.95rem;
}
select { color-scheme: dark; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(223, 218, 205, 0.45); }
textarea { min-height: 110px; resize: vertical; }
input[type="number"] { width: 7rem; }
.pair-row { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-end; }
.pair-row > div { flex: 1; min-width: 12rem; }
.tenure-row { display: flex; gap: 0.7rem; }
.tenure-row input { width: 6.5rem; }
.tenure-row select { width: auto; }

.form-error { color: var(--paper); background: rgba(223,218,205,0.12); border: 1px solid var(--cream); border-radius: 8px; padding: 0.8rem 1rem; font-size: 0.9rem; margin-bottom: 1.2rem; display: none; }
.form-error.show { display: block; }
.form-note { font-size: 0.82rem; color: var(--muted); margin-top: 1rem; }

/* footer */
footer { border-top: 1px solid var(--border); padding: 2.5rem 0; margin-top: 4rem; }
.foot-inner { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 1rem; }
.foot-inner .brand { font-size: 0.95rem; }
.foot-links { font-family: 'DM Mono', monospace; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: flex; gap: 1.6rem; }
.foot-links a:hover { color: var(--cream); }

/* ── output document ─────────────────────────────────────────── */
.doc-wrap { padding: 3rem 0 4rem; }
.doc {
  background: #ffffff; color: var(--doc-ink); border-radius: 4px;
  padding: 3.2rem 3.4rem; max-width: 820px; margin: 0 auto;
}
.doc-header { border-bottom: 2px solid var(--doc-ink); padding-bottom: 1.2rem; margin-bottom: 1.6rem; }
.doc-header .doc-brand { font-family: var(--brand); font-size: 0.85rem; margin-bottom: 0.8rem; }
.doc-header h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.01em; }
.doc-header .who { color: var(--doc-soft); font-size: 1rem; margin-top: 0.2rem; }
.doc-header .gen-date { font-family: 'DM Mono', monospace; font-size: 0.72rem; color: var(--doc-muted); margin-top: 0.5rem; }

.overall { display: flex; align-items: baseline; gap: 0.8rem; margin-bottom: 0.8rem; }
.overall .num { font-size: 3.2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.overall .of { font-family: 'DM Mono', monospace; font-size: 0.75rem; color: var(--doc-muted); }
.verdict {
  background: var(--doc-cream-soft); border-left: 3px solid var(--doc-ink);
  padding: 1rem 1.2rem; font-size: 0.95rem; color: var(--doc-soft); margin-bottom: 2rem;
}

.doc h2 {
  font-size: 1.15rem; font-weight: 700; border-bottom: 1px solid var(--doc-ink);
  padding-bottom: 0.4rem; margin: 2.2rem 0 1rem;
}

/* gauges */
.gauge-row { display: grid; grid-template-columns: 11rem 1fr 3rem; gap: 1rem; align-items: center; padding: 0.45rem 0; }
.gauge-row .g-label { font-weight: 700; font-size: 0.9rem; }
.gauge-row .g-track { height: 9px; background: var(--doc-cream-soft); border: 1px solid var(--doc-line); border-radius: 2px; overflow: hidden; }
.gauge-row .g-fill { display: block; height: 100%; background: var(--doc-ink); }
.gauge-row .g-num { font-family: 'DM Mono', monospace; font-size: 0.85rem; font-weight: 700; text-align: right; }

/* category cards (expandable) */
.cat-card { border: 1px solid var(--doc-line); border-radius: 6px; margin-bottom: 0.8rem; overflow: hidden; }
.cat-card summary {
  list-style: none; cursor: pointer; display: grid;
  grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center;
  padding: 0.9rem 1.1rem;
}
.cat-card summary::-webkit-details-marker { display: none; }
.cat-card summary .c-name { font-weight: 700; font-size: 0.98rem; }
.cat-card summary .c-score { font-family: 'DM Mono', monospace; font-size: 0.85rem; font-weight: 700; }
.cat-card summary .c-chevron { font-family: 'DM Mono', monospace; color: var(--doc-muted); transition: transform 0.2s ease; }
.cat-card[open] summary .c-chevron { transform: rotate(90deg); }
.cat-card summary:hover { background: var(--doc-cream-soft); }
.cat-body { padding: 0 1.1rem 1.1rem; }
.cat-body .assessment { font-size: 0.9rem; color: var(--doc-soft); margin-bottom: 0.8rem; }
.cat-body .sub-label {
  font-family: 'DM Mono', monospace; font-size: 0.62rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--doc-muted); margin: 0.8rem 0 0.35rem;
}
.cat-body ul { list-style: none; }
.cat-body li { padding: 0.25rem 0 0.25rem 1rem; position: relative; font-size: 0.88rem; color: var(--doc-soft); }
.cat-body li::before { content: "·"; position: absolute; left: 0; }
.cat-body .action-phase { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--doc-muted); display: block; }

/* roadmap */
.phase { margin-bottom: 1.4rem; }
.phase .p-title { font-weight: 700; font-size: 1rem; }
.phase .p-focus { font-size: 0.88rem; color: var(--doc-muted); margin-bottom: 0.5rem; }
.phase ol { counter-reset: step; list-style: none; }
.phase ol li { counter-increment: step; display: flex; gap: 0.7rem; padding: 0.3rem 0; font-size: 0.9rem; color: var(--doc-soft); }
.phase ol li::before { content: counter(step) "."; font-family: 'DM Mono', monospace; font-size: 0.8rem; color: var(--doc-muted); min-width: 1.1rem; }

.notes-list { list-style: none; }
.notes-list li { padding: 0.35rem 0 0.35rem 1.1rem; position: relative; font-size: 0.92rem; color: var(--doc-soft); }
.notes-list li::before { content: "·"; position: absolute; left: 0; }

/* output toolbar */
.toolbar { display: flex; gap: 1rem; align-items: center; justify-content: center; padding: 1.6rem 0; flex-wrap: wrap; }

/* loading */
.loading { text-align: center; padding: 7rem 2rem; }
.loading h2 { font-weight: 800; font-size: 1.5rem; margin-bottom: 0.8rem; }
.loading p { color: var(--muted-strong); max-width: 30rem; margin: 0 auto 2rem; }
.pulse-bar { width: 220px; height: 3px; background: var(--border); border-radius: 2px; margin: 0 auto; overflow: hidden; position: relative; }
.pulse-bar::after {
  content: ''; position: absolute; left: -40%; top: 0; height: 100%; width: 40%;
  background: var(--cream); border-radius: 2px; animation: slide 1.6s ease-in-out infinite;
}
@keyframes slide { 0% { left: -40%; } 100% { left: 100%; } }

/* regenerate panel */
.regen { max-width: 820px; margin: 0 auto; }
.regen summary {
  cursor: pointer; font-family: 'DM Mono', monospace; font-size: 0.78rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-strong);
  padding: 1rem 0; list-style: none;
}
.regen summary::before { content: '+ '; }
.regen[open] summary::before { content: '− '; }

@media (max-width: 760px) {
  .container { padding: 0 1.25rem; }
  .hero { padding: 4.5rem 0 3.5rem; }
  .steps, .cat-list { grid-template-columns: 1fr; }
  .form-card { padding: 1.6rem 1.3rem; }
  .doc { padding: 1.8rem 1.3rem; }
  .gauge-row { grid-template-columns: 8rem 1fr 2.4rem; gap: 0.6rem; }
}

@media print {
  body { background: #ffffff; }
  .nav, .toolbar, .regen, footer, .loading { display: none; }
  .doc { padding: 0; max-width: 100%; border-radius: 0; }
  .cat-card { break-inside: avoid; }
}
