:root {
  --bg: #0a0d0b;
  --surface: #101612;
  --surface-2: #151d18;
  --surface-3: #1e2822;
  --line: #2b3a31;
  --line-strong: #45604e;
  --text: #f4f7f3;
  --muted: #aeb9b1;
  --faint: #748177;
  --green: #9be35d;
  --green-2: #48d091;
  --gold: #efbd5a;
  --coral: #ee7d67;
  --cyan: #60d8c8;
  --ink: #07100b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 11, 0.92);
  backdrop-filter: blur(12px);
}

.brand,
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-mark {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  box-shadow: 0 0 0 4px rgba(155, 227, 93, 0.12);
}

.topbar-meta {
  color: var(--muted);
  font-weight: 600;
}

.app {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.landing {
  min-height: calc(100vh - 140px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  padding: 34px 0 42px;
}

.landing-copy {
  min-width: 0;
}

.eyebrow {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 15px;
  background: rgba(155, 227, 93, 0.05);
  color: var(--green);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(155, 227, 93, 0.12);
}

.landing-title {
  max-width: 12ch;
  margin: 24px 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(42px, 6.1vw, 76px);
  font-weight: 380;
  line-height: 1.03;
  letter-spacing: -0.02em;
}

.landing-sub {
  max-width: 56ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.5;
}

.landing-actions {
  margin-top: 34px;
}

.landing-dims {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dim-card {
  min-height: 172px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), #0d130f);
}

.dim-card span {
  color: var(--gold);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.dim-card h2 {
  margin: 20px 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 21px;
  font-weight: 450;
  line-height: 1.15;
}

.dim-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.loading-block {
  min-height: 60vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  color: var(--muted);
}

.generating {
  min-height: 56vh;
  display: grid;
  align-content: center;
  gap: 18px;
}

.loader {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--green);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 86px;
  padding: 6px 0;
}

.rail-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
}

.progress-card,
.snapshot {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.progress-card + .snapshot {
  margin-top: 16px;
}

.progress-line {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-2), var(--green), var(--gold));
  transition: width 240ms ease;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.dim-stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.dim-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.mini-track {
  height: 6px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.mini-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
}

.snapshot-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.snapshot-list li {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
}

.snapshot-list b {
  color: var(--text);
  font-size: 21px;
  line-height: 1;
}

.work-area {
  min-width: 0;
}

.stage-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.question-title {
  max-width: 850px;
  margin: 0;
  color: var(--text);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(25px, 3.2vw, 36px);
  font-weight: 420;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.question-sub {
  max-width: 780px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.control-group {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

.choice {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.choice:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.choice.is-selected {
  border-color: var(--green);
  background: rgba(155, 227, 93, 0.08);
}

.choice-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
}

.choice.multi .choice-mark {
  border-radius: 6px;
}

.choice.is-selected .choice-mark {
  border-color: var(--green);
  background: var(--green);
  color: var(--ink);
}

.choice-mark::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: transparent;
}

.choice.multi .choice-mark::after {
  width: 11px;
  height: 7px;
  border: 2px solid transparent;
  border-top: 0;
  border-right: 0;
  border-radius: 0;
  transform: rotate(-45deg);
}

.choice.is-selected .choice-mark::after {
  background: var(--ink);
}

.choice.multi.is-selected .choice-mark::after {
  background: transparent;
  border-color: var(--ink);
}

.choice-text {
  min-width: 0;
  color: var(--text);
  font-size: 15.5px;
}

.choice-peer {
  color: var(--faint);
  font-size: 13px;
  white-space: nowrap;
}

.matrix {
  width: 100%;
  margin-top: 28px;
  border-collapse: collapse;
}

.matrix th,
.matrix td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.matrix th {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.matrix th:first-child,
.matrix td:first-child {
  width: 38%;
  padding-left: 0;
  text-align: left;
}

.matrix-label {
  color: var(--text);
  font-size: 14px;
}

.matrix-peer {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 12px;
}

.seg {
  min-width: 48px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.seg:hover {
  border-color: var(--line-strong);
}

.seg.is-selected {
  border-color: var(--green);
  background: var(--green);
  color: var(--ink);
  font-weight: 800;
}

.text-field {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.text-field input,
.text-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 14px 15px;
  resize: vertical;
}

.text-field textarea {
  min-height: 150px;
}

.text-field input:focus,
.text-field textarea:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(155, 227, 93, 0.12);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.btn-primary {
  background: var(--green);
  color: var(--ink);
}

.btn-secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.btn-secondary:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 14px 15px;
}

.form-field input:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(155, 227, 93, 0.12);
}

.error {
  margin-top: 14px;
  color: var(--coral);
  font-size: 14px;
}

.report-shell {
  display: grid;
  gap: 34px;
}

.report-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px;
  align-items: end;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.report-kicker,
.report-source {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.report-title {
  margin: 12px 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 430;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.score-block {
  text-align: right;
}

.score-number {
  font-family: "Fraunces", Georgia, serif;
  font-size: 68px;
  font-weight: 500;
  line-height: 1;
}

.score-number span {
  color: var(--faint);
  font-size: 28px;
}

.score-band {
  margin-top: 8px;
  color: var(--muted);
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.report-section {
  min-width: 0;
}

.section-title {
  margin: 0 0 14px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.summary {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.5;
}

.dim-bars {
  display: grid;
  gap: 16px;
}

.dim-bar {
  display: grid;
  gap: 8px;
}

.dim-bar-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--green-2));
}

.insight-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight-list li {
  border-left: 3px solid var(--line-strong);
  padding-left: 13px;
  color: var(--muted);
}

.insight-list strong {
  color: var(--text);
}

.wide {
  grid-column: 1 / -1;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.comparison {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.comparison b {
  color: var(--green);
  font-size: 22px;
}

.comparison span {
  color: var(--muted);
  font-size: 13px;
}

.report-note {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}

@media (max-width: 900px) {
  .app {
    width: min(100% - 28px, 720px);
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .landing {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 18px;
  }

  .landing-dims {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    order: 2;
  }

  .work-area {
    order: 1;
  }

  .matrix,
  .matrix tbody,
  .matrix tr,
  .matrix td {
    display: block;
    width: 100%;
  }

  .matrix thead {
    display: none;
  }

  .matrix tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .matrix td {
    border: 0;
    padding: 6px 0;
  }

  .matrix td:first-child {
    width: 100%;
  }

  .seg {
    width: 100%;
  }

  .report-head,
  .report-grid,
  .comparison-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .score-block {
    text-align: left;
  }
}

@media print {
  .topbar,
  .report-actions {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .app {
    width: 100%;
    padding: 0;
  }
}
