:root {
  color-scheme: light;
  --ink: #10221b;
  --muted: #5a6d65;
  --paper: #f4f1e8;
  --surface: #fffdf7;
  --line: #d8d8ca;
  --green: #0c6949;
  --green-dark: #064b35;
  --green-soft: #dbece3;
  --amber: #ad6814;
  --amber-soft: #faebcf;
  --red: #a43b31;
  --red-soft: #f8dfdb;
  --shadow: 0 18px 50px rgba(20, 43, 34, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 4%, rgba(12, 105, 73, 0.1), transparent 28rem),
    var(--paper);
}

a {
  color: var(--green-dark);
  text-underline-offset: 0.2em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  min-height: 78px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(16, 34, 27, 0.12);
  background: rgba(244, 241, 232, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: var(--green-dark);
  font-weight: 800;
  letter-spacing: -0.04em;
}

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

.brand small {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.service-state {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.state-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8f958f;
  box-shadow: 0 0 0 4px rgba(143, 149, 143, 0.16);
}

.service-state.ready .state-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(12, 105, 73, 0.16);
}

.service-state.not-ready .state-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(164, 59, 49, 0.16);
}

main {
  width: min(1180px, 90vw);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.7fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: end;
  padding: clamp(5rem, 11vw, 9rem) 0 5rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 880px;
  margin-bottom: 1.5rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 6.2rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.94;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.hero-copy {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.65;
}

.hero-note {
  padding: 1.4rem;
  border: 1px solid rgba(173, 104, 20, 0.28);
  border-radius: 18px;
  background: var(--amber-soft);
  line-height: 1.55;
}

.hero-note p {
  margin: 0.55rem 0 0;
  color: #674719;
  font-size: 0.9rem;
}

.workspace,
.results,
.sources-section {
  scroll-margin-top: 100px;
}

.workspace {
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2.4rem;
}

.section-heading > p {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: right;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field-wide {
  grid-column: span 2;
}

.field span {
  font-size: 0.83rem;
  font-weight: 750;
}

.field b {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

input,
select {
  width: 100%;
  min-height: 49px;
  padding: 0 0.9rem;
  border: 1px solid #bdc6be;
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}

input:focus,
select:focus {
  border-color: var(--green);
  outline: 3px solid rgba(12, 105, 73, 0.15);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
}

.form-message {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

button {
  display: inline-flex;
  align-items: center;
  gap: 1.4rem;
  min-height: 52px;
  padding: 0 1.25rem 0 1.5rem;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--green-dark);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  background: var(--green);
}

button:focus-visible {
  outline: 3px solid rgba(12, 105, 73, 0.25);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: var(--green-dark);
  background: white;
}

.results {
  margin-top: 2rem;
}

.decision-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 1.6rem 2rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.decision-banner strong {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.decision-banner[data-decision="POTENTIAL_MATCH"] strong {
  color: #7f4209;
  background: var(--amber-soft);
}

.decision-banner[data-decision="INCOMPLETE"] strong {
  color: #7b2821;
  background: var(--red-soft);
}

.notice {
  margin-top: 1rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid rgba(164, 59, 49, 0.25);
  border-radius: 14px;
  color: #702921;
  background: var(--red-soft);
}

.notice ul {
  margin-bottom: 0;
}

.match-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.match-card,
.empty-result {
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.match-top {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.match-index {
  margin-bottom: 0.35rem;
  color: var(--green);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.match-card h3 {
  margin-bottom: 0.35rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
}

.match-list-name {
  color: var(--muted);
  font-size: 0.9rem;
}

.score {
  display: grid;
  min-width: 104px;
  height: 82px;
  place-content: center;
  border-radius: 18px;
  color: white;
  background: var(--green-dark);
  text-align: center;
}

.score strong,
.score span {
  display: block;
}

.score strong {
  font-size: 1.5rem;
}

.score span {
  font-size: 0.68rem;
  opacity: 0.78;
  text-transform: uppercase;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.4rem 0;
}

.evidence {
  min-width: 0;
  padding: 0.9rem;
  border-radius: 13px;
  background: #f1f2ea;
}

.evidence span,
.evidence strong,
.evidence small {
  display: block;
}

.evidence-label {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.evidence strong {
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}

.evidence small {
  margin-top: 0.4rem;
  color: var(--muted);
}

.evidence-positive {
  color: var(--green) !important;
}

.evidence-negative {
  color: var(--red) !important;
}

.match-facts,
.source-facts {
  display: grid;
  grid-template-columns: minmax(100px, auto) 1fr;
  gap: 0.65rem 1rem;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  text-transform: uppercase;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  line-height: 1.5;
}

.record-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.2rem;
}

.record-link {
  font-size: 0.86rem;
  font-weight: 750;
}

.sources-section {
  padding: 6rem 0;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.source-card {
  padding: 1.3rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.72);
}

.source-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.source-card-header strong,
.source-publisher {
  display: block;
}

.source-publisher {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.badge {
  height: fit-content;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.badge-ok {
  color: var(--green-dark);
  background: var(--green-soft);
}

.badge-danger {
  color: var(--red);
  background: var(--red-soft);
}

.source-facts {
  grid-template-columns: auto 1fr;
}

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

footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  width: min(1180px, 90vw);
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

footer p {
  max-width: 720px;
  margin: 0;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .site-header {
    padding: 0 4vw;
  }

  .service-state {
    font-size: 0;
  }

  .hero {
    padding-top: 4rem;
  }

  h1 {
    font-size: 3.1rem;
  }

  .section-heading,
  .form-actions,
  .decision-banner,
  .match-top,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading {
    display: flex;
  }

  .section-heading > p {
    text-align: left;
  }

  .form-grid,
  .evidence-grid,
  .source-list {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  button {
    justify-content: space-between;
  }

  .score {
    width: 100%;
    height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

