:root {
  color-scheme: light;
  --bg: #f7f9fa;
  --surface: #ffffff;
  --surface-soft: #edf2f4;
  --ink: #172024;
  --muted: #65747b;
  --line: #dbe4e8;
  --accent: #176b74;
  --accent-dark: #0f444b;
  --good: #1f725c;
  --warn: #9b6a1f;
  --bad: #a33f3f;
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Menlo, monospace;
  --shadow: 0 18px 44px rgba(23, 32, 36, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Aptos", "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

.site-header,
.site-footer,
.hero,
.auditor-shell,
.signals-band {
  max-width: 1240px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  padding-bottom: 20px;
}

.brand {
  font-weight: 850;
  text-decoration: none;
}

.nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav a,
.site-footer a {
  text-decoration: none;
}

.nav a:hover,
.site-footer a:hover {
  color: var(--accent-dark);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: 46px;
  align-items: end;
  padding-top: 56px;
  padding-bottom: 38px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.03;
}

h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.08;
}

h3 {
  margin: 0;
  font-size: 16px;
}

.hero-text,
.section-heading p {
  max-width: 680px;
  color: var(--muted);
}

.hero-text {
  margin: 20px 0 0;
  font-size: 17px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-metrics div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.hero-metrics div:last-child {
  border-bottom: 0;
}

.hero-metrics span,
.metrics-grid span,
.score-card span,
.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.hero-metrics strong,
.metrics-grid strong {
  font-family: var(--mono);
  font-size: 20px;
}

.auditor-shell {
  padding-top: 28px;
  padding-bottom: 58px;
}

.section-heading {
  margin-bottom: 22px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  gap: 20px;
  align-items: start;
}

.input-panel,
.results-panel,
.signal-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel,
.results-panel {
  padding: 20px;
}

.textarea-head,
.section-title,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.input-actions,
.form-actions {
  flex-wrap: wrap;
}

label,
legend {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  outline: none;
}

textarea {
  margin-top: 10px;
  padding: 14px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}

select {
  height: 42px;
  padding: 0 12px;
}

textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 116, 0.14);
}

.helper,
.status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

legend {
  grid-column: 1 / -1;
}

fieldset label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.button,
.text-button {
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:active,
.text-button:active {
  transform: translateY(1px) scale(0.99);
}

.button {
  min-height: 44px;
  border: 1px solid transparent;
  padding: 0 16px;
}

.button.primary {
  background: var(--ink);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  padding: 6px 4px;
  font-size: 13px;
}

.score-card {
  padding: 18px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.score-card.good {
  background: #e6f4ef;
}

.score-card.warn {
  background: #f7efe1;
}

.score-card.bad {
  background: #f7e8e8;
}

.score-card strong {
  display: block;
  margin-top: 4px;
  font-size: 34px;
  line-height: 1.05;
}

.score-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metrics-grid div,
.result-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.metrics-grid div {
  padding: 14px;
}

.metrics-grid strong {
  display: block;
  margin-top: 4px;
}

.result-section {
  margin-top: 14px;
  padding: 15px;
}

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

.signal-list li {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.signal-list li:first-child {
  border-top: 0;
}

.signal-list strong {
  font-size: 14px;
}

.signal-list span,
.recommendation {
  color: var(--muted);
  font-size: 13px;
}

.recommendation {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.recommendation code {
  display: block;
  overflow-x: auto;
  border-radius: 8px;
  background: #eef3f5;
  color: var(--ink);
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
}

#reportOutput {
  min-height: 240px;
}

.signals-band {
  padding-top: 10px;
  padding-bottom: 64px;
}

.signal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 14px;
  margin-top: 20px;
}

.signal-grid article {
  padding: 18px;
  box-shadow: none;
}

.signal-grid article:nth-child(2) {
  margin-top: 34px;
}

.signal-grid article:nth-child(3) {
  margin-top: -18px;
}

.signal-grid span {
  color: var(--accent-dark);
  font-weight: 900;
}

.signal-grid p {
  margin: 8px 0 0;
  color: var(--muted);
}

.faq-band {
  padding-top: 0;
}

.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.faq-list article {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.faq-list p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  padding-bottom: 32px;
  color: var(--muted);
}

.legal-page {
  max-width: 820px;
}

.legal-page h1 {
  font-size: clamp(32px, 4vw, 48px);
}

.legal-page p {
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero,
  .workspace,
  .signal-grid {
    grid-template-columns: 1fr;
  }

  .signal-grid article:nth-child(2),
  .signal-grid article:nth-child(3) {
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .site-header,
  .site-footer,
  .hero,
  .auditor-shell,
  .signals-band {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-header,
  .site-footer,
  .textarea-head {
    align-items: flex-start;
    flex-direction: column;
  }

  fieldset,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }
}
