:root {
  --background: #faf9f6;
  --foreground: #111111;
  --muted: #626260;
  --border: #dedbd6;
  --orange: #ff5600;
  --blue: #65b5ff;
  --green: #0bdf50;
  --pink: #ff2067;
  --lime: #b3e01c;
  --surface: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 249, 246, 0.94);
  padding: 16px clamp(18px, 4vw, 56px);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup small {
  margin-top: 3px;
  color: var(--muted);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #111111;
  border-radius: 4px;
  background: #111111;
  color: #ffffff;
  font-weight: 750;
}

nav {
  display: flex;
  gap: 8px;
}

nav a {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 9px 11px;
  color: #313130;
  font-size: 14px;
}

nav a:hover {
  border-color: var(--border);
  background: #ffffff;
}

.hero,
.workspace,
.first-pass-section,
.guardrail-section,
.how-section,
.builder-section {
  display: grid;
  gap: 28px;
  padding: clamp(42px, 7vw, 86px) clamp(18px, 4vw, 56px);
}

.hero {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: end;
}

.workspace {
  grid-template-columns: minmax(310px, 0.86fr) minmax(0, 1.14fr);
  padding-top: 18px;
}

.first-pass-section,
.guardrail-section,
.how-section,
.builder-section {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  border-top: 1px solid var(--border);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.accent {
  color: var(--orange);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 18px;
  font-size: clamp(48px, 7.5vw, 96px);
  font-weight: 550;
  letter-spacing: 0;
  line-height: 0.95;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 550;
  letter-spacing: 0;
  line-height: 0.98;
}

h3 {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.05;
}

.lede,
.first-pass-section > div > p,
.how-section > div > p,
.guardrail-section > div > p,
.builder-section > div > p {
  max-width: 760px;
  color: #313130;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.34;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.sample-note {
  max-width: 660px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.button {
  display: inline-flex;
  min-height: 48px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border: 1px solid #111111;
  border-radius: 4px;
  background: #111111;
  color: #ffffff;
  padding: 0 16px;
  font-weight: 700;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.button:hover {
  transform: scale(1.02);
  background: #ffffff;
  color: #111111;
}

.button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.button.ghost {
  background: transparent;
  color: #111111;
}

.button.secondary {
  width: 100%;
  background: var(--orange);
  color: #111111;
}

.button.full {
  width: 100%;
}

.hero-card,
.input-panel,
.analysis-panel,
.signal-list,
.api-grid article {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.hero-card {
  overflow: hidden;
}

.hero-card div {
  padding: 18px;
}

.hero-card div + div {
  border-top: 1px solid var(--border);
}

.hero-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.hero-card strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.review-output-card small {
  display: block;
  margin-top: 6px;
  color: #313130;
  font-size: 13px;
  line-height: 1.35;
}

.input-panel,
.analysis-panel {
  display: grid;
  align-self: start;
  gap: 16px;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading span,
.status-message {
  color: var(--muted);
  font-size: 13px;
}

.status-message.error {
  color: #c41c1c;
}

.privacy-note {
  margin: -2px 0 0;
  border-left: 3px solid var(--orange);
  color: #313130;
  padding-left: 10px;
  font-size: 13px;
  line-height: 1.35;
}

.form-actions {
  display: grid;
  gap: 10px;
}

.review-progress {
  display: grid;
  gap: 10px;
  border: 1px solid #111111;
  border-radius: 6px;
  background: #ffffff;
  padding: 12px;
}

.review-progress[hidden] {
  display: none;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #313130;
  font-size: 13px;
  line-height: 1.35;
}

.progress-copy strong {
  flex: 0 0 auto;
  color: #111111;
  font-size: 12px;
  text-transform: uppercase;
}

.progress-track {
  position: relative;
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #dedbd6;
}

.progress-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -38%;
  width: 38%;
  border-radius: inherit;
  background: var(--orange);
  animation: review-progress 1.15s ease-in-out infinite;
}

@keyframes review-progress {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(365%);
  }
}

label {
  display: grid;
  gap: 8px;
  color: #313130;
  font-size: 14px;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #faf9f6;
  color: #111111;
  outline: none;
  padding: 12px;
  font-size: 14px;
  line-height: 1.45;
}

textarea:focus {
  border-color: #111111;
  background: #ffffff;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.score-dial {
  display: grid;
  width: clamp(112px, 16vw, 152px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #111111;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 86, 0, 0.24), transparent 46%),
    linear-gradient(315deg, rgba(101, 181, 255, 0.34), transparent 52%),
    #faf9f6;
}

.score-dial span {
  font-size: clamp(46px, 7vw, 72px);
  font-weight: 750;
  line-height: 0.86;
}

.score-dial small {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.score-band {
  display: inline-flex;
  margin: 4px 0 0;
  border: 1px solid #111111;
  border-radius: 4px;
  background: var(--lime);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 750;
}

.decision-label {
  max-width: 500px;
  margin: 8px 0 0;
  color: #313130;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.score-explainer {
  max-width: 500px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.claim-line {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.claim-line[hidden] {
  display: none;
}

.board-line {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.claim-line p:last-child {
  margin: 8px 0 0;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.18;
}

.board-line p:last-child {
  margin: 8px 0 0;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.18;
}

.evidence-grid,
.api-grid,
.guardrail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.signal-list,
.api-grid article,
.guardrail-grid article,
.builder-card {
  padding: 16px;
}

.guardrail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.signal-list ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
}

.signal-list li,
.api-grid p,
.guardrail-grid p,
.builder-card p {
  color: #313130;
  font-size: 14px;
  line-height: 1.38;
}

.api-grid article span {
  display: inline-flex;
  margin: 4px 0 18px;
  border-radius: 4px;
  background: #111111;
  color: #ffffff;
  padding: 6px 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 750;
}

.guardrail-grid article,
.builder-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.api-grid article:nth-child(2) span {
  background: var(--blue);
  color: #111111;
}

.api-grid article:nth-child(3) span {
  background: var(--green);
  color: #111111;
}

.first-pass-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.first-pass-list ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.first-pass-list li,
.first-pass-list p {
  color: #313130;
  font-size: 15px;
  line-height: 1.42;
}

.first-pass-list p {
  margin: 18px 0 0;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

@media (max-width: 980px) {
  .hero,
  .workspace,
  .first-pass-section,
  .guardrail-section,
  .how-section,
  .builder-section {
    grid-template-columns: 1fr;
  }

  .evidence-grid,
  .api-grid,
  .guardrail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  h1 {
    font-size: 46px;
  }

  .score-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .evidence-grid,
  .api-grid,
  .guardrail-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .hero-actions .button {
    width: 100%;
  }

  .button {
    min-height: 46px;
  }
}
