:root {
  color-scheme: light;
  --page: #f6f6f2;
  --paper: #ffffff;
  --ink: #161616;
  --ink-soft: #4f524f;
  --ink-muted: #7e827c;
  --line: #d8d9d2;
  --line-strong: #aeb2aa;
  --red: #c8352b;
  --red-dark: #98271f;
  --blue: #245c73;
  --amber: #8a620d;
  --amber-soft: #f4ead5;
  --green: #2e6f4e;
  --shadow-line: 0 1px 0 rgba(22, 22, 22, 0.05);
  --max: 1184px;
  --gutter: clamp(20px, 4vw, 56px);
  --step: 8px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background:
    linear-gradient(90deg, rgba(216, 217, 210, 0.34) 1px, transparent 1px) center top / calc((min(1184px, 100vw - 40px)) / 12) 100%,
    var(--page);
}

body {
  min-height: 100%;
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--red);
  pointer-events: none;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

a {
  color: var(--blue);
  text-decoration-color: color-mix(in srgb, var(--blue), transparent 45%);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: var(--blue);
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.site-header,
.site-footer,
.page-shell {
  width: min(var(--max), calc(100vw - (var(--gutter) * 2)));
  margin-inline: auto;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 24px;
  padding-block: 34px 18px;
  border-bottom: 1px solid var(--ink);
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  color: var(--ink);
  font-weight: 720;
  letter-spacing: 0;
  text-decoration: none;
}

.brand::before {
  content: "";
  width: 11px;
  height: 11px;
  background: var(--red);
  transform: translateY(-1px);
}

.scope-label {
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 560;
}

.page-shell {
  padding-block: clamp(48px, 7vw, 96px);
}

.site-footer {
  padding-block: 30px 42px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.875rem;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 24px;
  font-size: clamp(2.45rem, 5.2vw, 5.7rem);
  font-weight: 720;
  letter-spacing: 0;
  line-height: 0.96;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.2rem, 1.6vw, 1.5rem);
  font-weight: 690;
  line-height: 1.14;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.075rem;
  font-weight: 690;
  line-height: 1.24;
}

.eyebrow,
.section-kicker,
.status-text,
.metadata,
.field-help {
  font-size: 0.875rem;
  line-height: 1.45;
}

.eyebrow,
.section-kicker,
.status-text {
  color: var(--red);
  font-weight: 720;
}

.metadata,
.field-help {
  color: var(--ink-soft);
}

.lead {
  max-width: 690px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: clamp(1.15rem, 1.55vw, 1.42rem);
  line-height: 1.42;
}

.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 7.2fr) minmax(300px, 3.8fr);
  gap: clamp(48px, 7vw, 104px);
  align-items: start;
}

.landing-main {
  padding-top: clamp(18px, 4vw, 52px);
}

.landing-main .eyebrow {
  margin-bottom: 26px;
}

.scope-panel,
.result-rail,
.notice-block {
  background: color-mix(in srgb, var(--paper), var(--page) 18%);
  border-top: 4px solid var(--ink);
  box-shadow: var(--shadow-line);
}

.scope-panel {
  display: grid;
  gap: 0;
  padding: 30px 32px;
}

.scope-panel section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.scope-panel section:first-child {
  padding-top: 0;
}

.scope-panel section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.scope-panel h2,
.result-rail h2 {
  font-size: 1rem;
}

.plain-list {
  display: grid;
  gap: 6px;
  margin-bottom: 0;
  padding-left: 1.05rem;
}

.action-line {
  margin-top: 44px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 0 22px;
  cursor: pointer;
  font-weight: 690;
  letter-spacing: 0;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

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

.button-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--paper);
}

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

.button-secondary:hover {
  border-color: var(--red);
  color: var(--red-dark);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.wide {
  width: 100%;
}

.assessment {
  max-width: 820px;
}

.assessment-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(148px, auto);
  gap: 32px;
  align-items: end;
}

.assessment h1 {
  max-width: 700px;
  margin-bottom: 0;
  font-size: clamp(2.25rem, 4.8vw, 4.45rem);
}

.progress-readout {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 620;
}

#stepCounter {
  color: var(--ink);
  font-size: 1.04rem;
}

.progress-track {
  height: 2px;
  margin: 28px 0 58px;
  background: var(--line);
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--red);
  transition: width 180ms ease;
}

.question-step {
  display: none;
}

.question-step.is-active {
  display: block;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  width: 100%;
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 720;
  line-height: 1.1;
}

.field,
.field-group {
  display: block;
  margin-bottom: 34px;
}

.field > span:first-child,
.question-label {
  display: block;
  max-width: 680px;
  margin-bottom: 8px;
  font-weight: 690;
  line-height: 1.32;
}

.field-help {
  display: block;
  max-width: 640px;
  margin-bottom: 14px;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
.field input:not([type]) {
  width: min(100%, 430px);
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 13px;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
.field input:not([type]):focus {
  border-color: var(--blue);
  outline: 2px solid color-mix(in srgb, var(--blue), transparent 74%);
  outline-offset: 0;
}

[aria-invalid="true"] {
  border-color: var(--danger) !important;
}

.choice,
.checkline {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
}

.choice:last-child,
.checkline:last-child {
  border-bottom: 1px solid var(--line);
}

.choice input,
.checkline input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--ink);
}

.choice:has(input:checked) {
  padding-left: 14px;
  border-left: 4px solid var(--red);
  background: linear-gradient(90deg, rgba(200, 53, 43, 0.055), transparent 42%);
  font-weight: 670;
}

.checkline:has(input:checked) {
  font-weight: 670;
}

.conditional {
  margin: 22px 0 34px;
  padding: 24px 28px;
  border-left: 3px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.48);
}

.not-sure-note {
  max-width: 620px;
  margin-top: -8px;
  color: var(--amber);
  font-size: 0.94rem;
}

.field-error {
  display: none;
  margin-top: 8px;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 620;
}

.field-error.is-visible {
  display: block;
}

.navigation-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 58px;
  padding-top: 26px;
  border-top: 1px solid var(--ink);
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 7.5fr) minmax(300px, 3.5fr);
  gap: clamp(48px, 7vw, 92px);
  align-items: start;
}

.result-main h1 {
  margin-bottom: 18px;
  font-size: clamp(2.15rem, 4.3vw, 4.2rem);
}

.event-summary {
  max-width: 820px;
  color: var(--ink-soft);
  font-size: 1.06rem;
}

.deadline-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto);
  gap: 28px;
  margin: 44px 0 64px;
  padding: 30px 0 32px;
  border-top: 4px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.deadline-block h2 {
  grid-column: 1;
  margin-bottom: 8px;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  font-weight: 760;
  line-height: 0.95;
}

.deadline-block .section-kicker {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.deadline-label {
  margin-bottom: 8px;
  font-size: 1.08rem;
  font-weight: 720;
}

.deadline-warning {
  grid-column: 1 / -1;
  max-width: 680px;
  margin-top: 8px;
  color: var(--danger);
  font-weight: 660;
}

.deadline-block.is-passed {
  border-top-color: var(--danger);
}

.deadline-block.is-unconfirmed {
  border-top-color: var(--amber);
}

.result-section {
  margin-top: 64px;
}

.result-section > h2 {
  margin-bottom: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}

.ruled-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 26px;
  padding: 27px 0 28px;
  border-bottom: 1px solid var(--line);
}

.ruled-item:first-of-type {
  border-top: 0;
}

.ruled-item p:last-child,
.confirmation-item p:last-child {
  margin-bottom: 0;
}

.item-number,
.item-marker {
  color: var(--ink-muted);
  font-size: 0.95rem;
  font-weight: 720;
}

.item-marker {
  color: var(--red);
}

.status-text {
  margin-bottom: 6px;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.confirmation-section > h2 {
  border-bottom-color: var(--amber);
}

.confirmation-item {
  margin-top: 18px;
  padding: 24px 26px 26px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
}

.confirmation-item .status-text {
  color: var(--amber);
}

.inline-source,
.source-detail {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.inline-source summary,
.source-detail summary {
  width: fit-content;
  cursor: pointer;
  color: var(--blue);
  font-weight: 670;
}

.inline-source[open],
.source-detail[open] {
  padding-bottom: 6px;
}

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

.result-rail {
  position: sticky;
  top: 24px;
  padding: 28px 0 0;
  background: transparent;
}

.result-rail > p {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.result-rail .button {
  margin-top: 28px;
}

.resource-links {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.resource-links ul {
  display: grid;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.resource-links a {
  font-size: 0.94rem;
  font-weight: 700;
}

.notice-block {
  max-width: 720px;
  padding: 34px;
}

@media (max-width: 980px) {
  html {
    background: var(--page);
  }

  .landing-grid,
  .result-layout {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .result-rail {
    position: static;
    padding-top: 28px;
    border-top: 1px solid var(--ink);
  }
}

@media (max-width: 720px) {
  body::before {
    width: 3px;
  }

  .site-header,
  .site-footer,
  .page-shell {
    width: min(100vw - 36px, 680px);
  }

  .site-header {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-block: 24px 14px;
  }

  .page-shell {
    padding-block: 42px 56px;
  }

  h1 {
    font-size: clamp(2.25rem, 13vw, 3.6rem);
  }

  .landing-main {
    padding-top: 0;
  }

  .scope-panel,
  .notice-block {
    border-top-width: 3px;
  }

  .assessment-header {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .assessment h1 {
    font-size: clamp(2.05rem, 11vw, 3.25rem);
  }

  .progress-readout {
    justify-items: start;
  }

  .progress-track {
    margin-bottom: 42px;
  }

  legend {
    font-size: 1.28rem;
  }

  .choice,
  .checkline {
    min-height: 60px;
  }

  input[type="text"],
  input[type="date"],
  input[type="time"],
  input[type="number"],
  .field input:not([type]) {
    width: 100%;
  }

  .conditional {
    padding: 20px;
  }

  .navigation-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    margin-inline: 0;
    padding: 18px 0 0;
    background: transparent;
    border-top: 1px solid var(--ink);
  }

  #submitAssessment {
    grid-column: 1 / -1;
  }

  .deadline-block {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .deadline-block h2 {
    font-size: clamp(2.4rem, 15vw, 4rem);
  }

  .ruled-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 16px;
    padding-block: 24px;
  }

  .confirmation-item {
    padding: 22px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
