:root {
  color-scheme: light;
  --ink: #18201d;
  --muted: #59635f;
  --line: #d8e1dc;
  --paper: #fbfcfb;
  --panel: #ffffff;
  --accent: #175b49;
  --accent-2: #b34a32;
  --accent-3: #2e6a9e;
  --soft: #edf5f1;
  --warn: #8b5d0b;
  --fail: #9d2633;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  border-radius: 6px;
}

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

.brand small,
.eyebrow,
.label,
.status,
footer {
  color: var(--muted);
}

nav {
  display: flex;
  gap: 16px;
  font-size: 14px;
  font-weight: 700;
}

nav a {
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 44px;
}

.hero {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: 20px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  max-width: 760px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.intro {
  max-width: 760px;
  font-size: 19px;
  line-height: 1.55;
  color: #31403a;
}

.signal-map {
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(23, 91, 73, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(179, 74, 50, 0.1) 1px, transparent 1px),
    #ffffff;
  background-size: 34px 34px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border-radius: 8px;
}

.signal-map span {
  min-height: 94px;
  display: grid;
  place-items: center;
  padding: 12px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  text-align: center;
  border-radius: 6px;
}

.signal-map span:nth-child(2) {
  background: var(--accent-2);
}

.signal-map span:nth-child(3) {
  background: var(--accent-3);
}

.signal-map span:nth-child(4) {
  background: #4e6342;
}

.workspace,
.results-grid,
.split-tools {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.workspace {
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
}

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

.tool-panel,
.score-panel,
.results-grid article,
.learner-path {
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

.panel-head,
.run-row,
.actions,
.path-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.domain-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
textarea,
button,
.path-actions a {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 210px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

button,
.path-actions a {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 13px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary,
.primary-link {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.score-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

#score {
  font-size: 52px;
  line-height: 1;
}

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

.stats span {
  padding: 10px;
  background: var(--soft);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.stats b {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.stack {
  display: grid;
  gap: 10px;
}

.muted {
  color: var(--muted);
}

.finding {
  border-left: 4px solid var(--accent-3);
  background: #f7fafc;
  padding: 12px;
  border-radius: 6px;
}

.finding.fail {
  border-left-color: var(--fail);
  background: #fff7f7;
}

.finding.warn {
  border-left-color: var(--warn);
  background: #fffaf0;
}

.finding p,
.finding small {
  margin: 6px 0 0;
  color: var(--muted);
}

pre {
  min-height: 180px;
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  background: #111a17;
  color: #e9fff5;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.generator-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.learner-path {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, auto);
  gap: 18px;
  align-items: center;
  background: #eef6f2;
}

footer {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 34px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

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

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .workspace,
  .results-grid,
  .split-tools,
  .learner-path {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 42px;
  }

  .domain-form {
    grid-template-columns: 1fr;
  }

  .signal-map {
    grid-template-columns: 1fr 1fr;
    min-height: 220px;
  }
}

