:root {
  color-scheme: light;
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-soft: #f7faff;
  --ink: #111111;
  --ink-strong: #0f172a;
  --muted: #5f6b7a;
  --line: rgba(15, 23, 42, 0.11);
  --line-strong: rgba(15, 23, 42, 0.16);
  --accent: #e8601c;
  --accent-dark: #d45414;
  --brand: #17325f;
  --blue: #2455d6;
  --green: #188657;
  --yellow: #a46314;
  --red: #bd3a3a;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-200%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--surface);
}

.skip-link:focus-visible {
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.score-nav,
.score-hero,
.score-context,
.proof-loop,
.score-footer {
  width: min(1060px, 92%);
  margin: 0 auto;
}

.score-nav {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: visible;
  margin-top: 14px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 26px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(249, 250, 252, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 14px 34px rgba(15, 23, 42, 0.08),
    0 34px 80px rgba(15, 23, 42, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding-right: 24px;
  position: relative;
}

.brand::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 1px;
  height: 30px;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.12);
}

.brand img:first-child {
  width: 32px;
  height: 32px;
  border-radius: 11px;
}

.brand img:last-child {
  width: auto;
  height: 23px;
}

.score-nav nav {
  position: absolute;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 999px;
  padding: 3px;
  background: rgba(15, 23, 42, 0.04);
}

.score-nav nav a,
.score-footer a,
.score-footer span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 0 18px;
  color: #4d5c71;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}

.score-nav nav a:hover,
.score-footer a:hover {
  background: rgba(255, 255, 255, 0.82);
  color: #111111;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #17325f;
  border-radius: 999px;
  padding: 0 18px;
  background: linear-gradient(180deg, #254476 0%, #17325f 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 18px rgba(23, 50, 95, 0.22);
}

.score-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 30px;
  padding: 66px 0 48px;
}

.score-hero::before {
  content: "";
  position: absolute;
  inset: -14px 50% -24px auto;
  z-index: 0;
  width: 100vw;
  transform: translateX(50%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 196, 143, 0.28) 0%, rgba(255, 196, 143, 0) 34%),
    radial-gradient(circle at 100% 8%, rgba(146, 175, 230, 0.2) 0%, rgba(146, 175, 230, 0) 30%),
    linear-gradient(180deg, #fffefb 0%, #f9fbff 54%, #f1f6fc 100%);
}

.score-hero::after {
  content: "";
  position: absolute;
  inset: -14px 50% -24px auto;
  z-index: 0;
  width: 100vw;
  transform: translateX(50%);
  background-image:
    linear-gradient(rgba(72, 96, 132, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(72, 96, 132, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0) 80%);
  pointer-events: none;
}

.score-hero > * {
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow,
.panel-label {
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
dl {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Inter Tight", Inter, system-ui, sans-serif;
  letter-spacing: 0;
}

h1 {
  max-width: 860px;
  margin-top: 8px;
  color: #17181b;
  font-size: clamp(2.65rem, 4.2vw, 3.85rem);
  font-weight: 600;
  line-height: 0.94;
}

h2 {
  color: #17181b;
  font-size: clamp(1.9rem, 2.8vw, 2.55rem);
  line-height: 0.98;
}

h3 {
  color: #17181b;
  font-size: 1.18rem;
  line-height: 1.15;
}

.hero-lede {
  max-width: 680px;
  color: #596779;
  font-size: 1.04rem;
  line-height: 1.58;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hero-proof span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.74);
  color: #31466b;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.score-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 22px;
  align-items: stretch;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius);
  padding: 24px;
  background:
    linear-gradient(rgba(23, 50, 95, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 50, 95, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 247, 239, 0.74) 0%, rgba(255, 255, 255, 0.96) 42%, rgba(243, 248, 255, 0.96) 100%);
  background-size: 34px 34px, 34px 34px, auto;
}

.readiness-form,
.score-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 2.3vw, 24px);
  background: rgba(255, 255, 255, 0.92);
}

.readiness-form {
  display: grid;
  gap: 16px;
}

.form-topline,
.result-head,
.panel-heading,
.form-actions,
.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-topline,
.result-head {
  justify-content: space-between;
}

.text-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: #ffffff;
  color: #33425a;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

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

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

label,
legend {
  color: #2c3a4f;
  font-size: 0.8rem;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 0.92rem;
}

input,
select {
  min-height: 42px;
  padding: 10px 12px;
}

textarea {
  min-height: 92px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--blue);
  outline: 3px solid rgba(36, 85, 214, 0.14);
}

.evidence-checks {
  display: grid;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: rgba(255, 255, 255, 0.68);
}

.evidence-checks label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
}

.evidence-checks input {
  width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.68rem 1.1rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1;
  text-align: center;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button.primary:hover,
.button.primary:focus-visible {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.button.secondary {
  background: #ffffff;
  color: var(--ink);
}

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

.form-status {
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.4;
}

.form-status.is-ready {
  background: #effaf2;
  color: #256b34;
}

.form-status.is-warning {
  background: #fff8e8;
  color: #77510f;
}

.form-status.is-error {
  background: #fff0f0;
  color: #8b2525;
}

.score-result {
  display: grid;
  align-content: start;
  gap: 18px;
}

.result-head strong {
  display: block;
  margin-top: 6px;
  color: #17181b;
  font-family: "Inter Tight", Inter, system-ui, sans-serif;
  font-size: clamp(1.85rem, 3vw, 2.48rem);
  line-height: 0.96;
}

.score-meter {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: center;
  min-width: 102px;
  min-height: 74px;
  border: 1px solid #dbe5f4;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #f7faff;
  color: #17325f;
}

.score-meter span {
  font-family: "Inter Tight", Inter, system-ui, sans-serif;
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 0.9;
}

.score-meter small {
  color: #657188;
  font-weight: 700;
}

.score-bar {
  overflow: hidden;
  height: 10px;
  border: 1px solid #dbe5f4;
  border-radius: 999px;
  background: #eef3fa;
}

.score-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8601c 0%, #f5b35f 45%, #3da66d 100%);
  transition: width 180ms ease;
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.component-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.component-grid dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.component-grid dd {
  margin: 7px 0 0;
  color: #172033;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.diagnosis-panel,
.packet-preview {
  display: grid;
  gap: 12px;
}

.panel-heading {
  align-items: baseline;
  justify-content: space-between;
}

.panel-heading h2 {
  color: #17181b;
  font-size: 1.08rem;
  line-height: 1.1;
}

#diagnosis-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#diagnosis-list li {
  border: 1px solid #dce6f3;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #ffffff;
  color: #314158;
  font-size: 0.86rem;
  line-height: 1.4;
}

#diagnosis-list li.is-strong {
  border-color: #bde9c8;
  background: #f2fff6;
  color: #244133;
}

#diagnosis-list li.is-warning {
  border-color: rgba(183, 121, 31, 0.3);
  background: #fff8e8;
  color: #77510f;
}

#diagnosis-list li.is-error {
  border-color: rgba(189, 58, 58, 0.28);
  background: #fff0f0;
  color: #8b2525;
}

#packet-output {
  max-height: 270px;
  overflow: auto;
  margin: 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius);
  padding: 16px;
  background: #111827;
  color: #eaf1ff;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.54;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.score-result[data-tier="ready"] .result-head strong,
.score-result[data-tier="ready"] .score-meter {
  color: var(--green);
}

.score-result[data-tier="reviewable"] .result-head strong,
.score-result[data-tier="reviewable"] .score-meter {
  color: var(--yellow);
}

.score-result[data-tier="needs_work"] .result-head strong,
.score-result[data-tier="needs_work"] .score-meter,
.score-result[data-tier="not_ready"] .result-head strong,
.score-result[data-tier="not_ready"] .score-meter {
  color: var(--red);
}

.score-context {
  padding: 58px 0 66px;
}

.section-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.section-heading > p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.context-grid article {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  background: #ffffff;
}

.context-grid span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #cfdbef;
  border-radius: 12px;
  background: #e5edff;
  color: #31466b;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.context-grid p {
  color: #6e6e6e;
  font-size: 1.02rem;
  line-height: 1.56;
}

.proof-loop {
  padding: 0 0 70px;
}

.proof-loop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.proof-loop-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.92) 100%);
}

.proof-loop-card span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #cfdbef;
  border-radius: 12px;
  background: #e5edff;
  color: #31466b;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.proof-loop-card h3 {
  margin: 0;
  color: var(--ink-strong);
  font-family: "Inter Tight", Inter, system-ui, sans-serif;
  font-size: 1.18rem;
  line-height: 1.14;
}

.proof-loop-card p {
  margin: 0;
  color: #6e6e6e;
  font-size: 0.98rem;
  line-height: 1.52;
}

.score-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 42px 0;
}

.score-footer a,
.score-footer span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

@media (max-width: 920px) {
  .score-workspace,
  .context-grid,
  .proof-loop-grid {
    grid-template-columns: 1fr;
  }

  .score-hero {
    padding-top: 44px;
  }
}

@media (max-width: 680px) {
  .score-nav,
  .score-hero,
  .score-context,
  .proof-loop,
  .score-footer {
    width: min(100% - 32px, 1100px);
  }

  .score-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    border-radius: 24px;
    gap: 8px;
    padding: 8px 10px;
  }

  .score-nav nav {
    position: static;
    grid-column: 1 / -1;
    transform: none;
    width: 100%;
  }

  .score-nav nav a {
    flex: 1;
  }

  .brand {
    padding-right: 0;
  }

  .brand::after {
    display: none;
  }

  .brand img:first-child {
    width: 34px;
    height: 34px;
  }

  .brand img:last-child {
    height: 18px;
  }

  .nav-cta {
    min-width: 126px;
    min-height: 36px;
    padding: 0 14px;
  }

  h1 {
    font-size: 2.28rem;
  }

  .score-workspace {
    padding: 18px;
  }

  .field-grid,
  .component-grid {
    grid-template-columns: 1fr;
  }

  .form-topline,
  .result-head,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .button,
  .result-actions a,
  .result-actions button,
  .form-actions button {
    width: 100%;
  }

  .score-footer {
    align-items: stretch;
    flex-direction: column;
  }
}
