:root {
  color-scheme: light;
  --ink: oklch(20% 0.025 64);
  --paper: oklch(96% 0.018 75);
  --orange: oklch(79% 0.17 74);
  --orange-light: oklch(91% 0.08 74);
  --blue: oklch(45% 0.19 259);
  --muted: oklch(47% 0.02 64);
  --line: oklch(70% 0.025 64);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Barlow", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

header,
main,
footer {
  width: min(1240px, calc(100% - 2rem));
  margin-inline: auto;
}

header {
  min-height: 5.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--ink);
}

.brand {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand span { color: var(--blue); }
.header-note { color: var(--muted); font-size: 0.9rem; }

.hero {
  min-height: min(720px, calc(100vh - 5.25rem));
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(2rem, 8vw, 8rem);
  padding-block: clamp(4rem, 9vw, 8rem);
}

.hero-copy { max-width: 45rem; }

.stamp {
  margin: 0 0 1rem;
  color: var(--blue);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

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

h1 {
  max-width: 11ch;
  margin-bottom: 1.5rem;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(4.2rem, 8.4vw, 8.8rem);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.hero-copy > p:not(.stamp) {
  max-width: 37rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.45;
}

.jump,
.primary-link {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}

.incident-diagram {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 27rem;
  padding: 2rem;
  background: var(--orange);
  border: 1px solid var(--ink);
  box-shadow: 1rem 1rem 0 var(--orange-light);
  transform: rotate(-1.5deg);
}

.node {
  min-width: 9rem;
  align-self: center;
  padding: 0.75rem 1.5rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.node-final { background: var(--blue); color: var(--paper); }

.line {
  width: 1px;
  height: 100%;
  background: var(--ink);
  position: relative;
}

.line::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: -4px;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  transform: rotate(45deg);
}

.worksheet {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(2rem, 8vw, 8rem);
  padding-block: clamp(5rem, 10vw, 9rem);
  border-top: 1px solid var(--ink);
}

h2 {
  max-width: 11ch;
  margin-bottom: 1rem;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.worksheet-heading > p:last-child,
.related-intro > p:not(.stamp) {
  max-width: 34rem;
  color: var(--muted);
  line-height: 1.55;
}

.credit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

label {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

label > span:first-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 3rem;
  padding: 0;
  appearance: textfield;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  font: 700 2rem/1 "Barlow Condensed", sans-serif;
}

.money-input,
.suffix-input { display: flex; align-items: center; gap: 0.25rem; }
.money-input b, .suffix-input b { font: 700 1.35rem/1 "Barlow Condensed", sans-serif; }
.suffix-input input { text-align: right; }

input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 0.25rem;
}

.result {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--ink);
  color: var(--paper);
}

.result > div { display: grid; gap: 0.25rem; padding: 1.25rem; }
.result > div + div { border-left: 1px solid var(--paper); }
.result span { font-size: 0.8rem; }
.result strong { font: 800 clamp(2.4rem, 5vw, 4.6rem)/0.95 "Barlow Condensed", sans-serif; }
.result small { color: var(--orange); }

.evidence {
  padding-block: clamp(5rem, 10vw, 9rem);
  background: var(--orange);
  box-shadow: 0 0 0 100vmax var(--orange);
  clip-path: inset(0 -100vmax);
}

.evidence > div {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
}

.evidence h2 { margin-bottom: 0; }

.evidence ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  list-style: none;
}

.evidence li {
  min-height: 15rem;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border-bottom: 1px solid var(--ink);
}

.evidence li + li { border-left: 1px solid var(--ink); }
.evidence li span { margin-bottom: auto; font-family: "Barlow Condensed", sans-serif; font-weight: 700; }
.evidence li strong { margin-bottom: 0.5rem; font-size: 1.1rem; }
.evidence li p { margin: 0; line-height: 1.45; }

.related {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 8vw, 8rem);
  padding-block: clamp(5rem, 11vw, 10rem);
}

.related nav { border-top: 1px solid var(--ink); }

.related nav a {
  min-height: 4.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms cubic-bezier(0.16, 1, 0.3, 1), padding 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.related nav a:hover { padding-inline: 0.6rem; background: var(--orange-light); }

footer {
  min-height: 7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--ink);
  color: var(--muted);
}

footer a { color: var(--ink); font-weight: 600; }

@media (max-width: 840px) {
  .hero,
  .worksheet,
  .related { grid-template-columns: 1fr; }
  .incident-diagram { min-height: 20rem; transform: none; }
  .evidence ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evidence li:nth-child(3) { border-left: 0; }
  .evidence li:nth-child(-n + 2) { border-bottom: 0; }
}

@media (max-width: 540px) {
  header { align-items: flex-start; padding-block: 1.1rem; }
  .header-note { max-width: 9rem; text-align: right; }
  .credit-form { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; }
  .result > div + div { border-top: 1px solid var(--paper); border-left: 0; }
  .evidence ol { grid-template-columns: 1fr; }
  .evidence li { min-height: 11rem; border-left: 0 !important; border-bottom: 1px solid var(--ink) !important; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}

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