*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  background: #e9eef2;
  color: #101418;
  font-family: Cambria, Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.65;
  padding-bottom: 6.5rem;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
kh-bar,
kh-nav a,
kh-foot,
button,
summary,
caption,
kh-form label,
kh-job dt,
th {
  font-family: Bahnschrift, "Segoe UI", sans-serif;
}

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 600;
}

h1 {
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.45rem;
  margin: 1.6rem 0 0.45rem;
  scroll-margin-top: 1rem;
}

h3 {
  font-size: 1.15rem;
  margin: 1.1rem 0 0.35rem;
  scroll-margin-top: 1rem;
}

p,
li,
td,
dd {
  overflow-wrap: break-word;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #4f46e5;
  outline-offset: 3px;
}

kh-bar :focus-visible {
  outline-color: #f4f7f8;
}

a[href="#main"] {
  position: absolute;
  left: 0.5rem;
  top: -5rem;
  z-index: 6;
  background: #f4f7f8;
  color: #101418;
  padding: 0.55rem 0.9rem;
  border-radius: 4px;
  font-family: Bahnschrift, "Segoe UI", sans-serif;
}

a[href="#main"]:focus {
  top: 0.5rem;
}

header kh-bar {
  display: block;
}

kh-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  background: #101418;
  color: #f4f7f8;
  padding: 0.35rem 1rem;
}

kh-bar > a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: #f4f7f8;
  text-decoration: none;
  font-size: 1.25rem;
  font-family: Bahnschrift, "Segoe UI", sans-serif;
}

kh-bar svg {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

kh-bar > button {
  display: none;
  margin-left: auto;
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.8rem;
  background: transparent;
  color: #f4f7f8;
  border: 2px solid #f4f7f8;
  border-radius: 4px;
  cursor: pointer;
}

kh-nav {
  display: flex;
  flex-wrap: wrap;
  margin-left: auto;
}

kh-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  color: #f4f7f8;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

kh-nav a:visited {
  color: #f4f7f8;
}

kh-nav a[aria-current="page"] {
  text-decoration-thickness: 3px;
}

main {
  display: block;
}

main a,
kh-foot a {
  color: #101418;
  text-underline-offset: 0.15em;
}

main a:visited,
kh-foot a:visited {
  color: #101418;
}

kh-hero {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 1.5rem 2rem;
  align-items: center;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 0.5rem;
}

kh-hero svg {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  display: block;
}

kh-hero p:last-child a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0.35rem 0.6rem 0.35rem 0;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  border: 2px solid #4f46e5;
  background: #4f46e5;
  color: #f4f7f8;
  text-decoration: none;
  font-family: Bahnschrift, "Segoe UI", sans-serif;
}

kh-hero p:last-child a + a {
  background: #e9eef2;
  color: #101418;
  border-color: #101418;
}

kh-hero p:last-child a:visited {
  color: #f4f7f8;
}

kh-hero p:last-child a + a:visited {
  color: #101418;
}

main > header,
main > section {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.4rem 1.25rem 0.2rem;
}

main > header p,
main > section > p,
main > section > ol,
main > section > ul {
  max-width: 42rem;
}

article:has(> nav) {
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
  gap: 1.25rem 2rem;
  align-items: start;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 1.5rem;
}

article:has(> nav) > nav {
  position: sticky;
  top: 0.75rem;
  display: flex;
  flex-direction: column;
}

article:has(> nav) > nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: #101418;
}

article:has(> nav) > div {
  min-width: 0;
  max-width: 44rem;
}

article:has(> nav) > div p,
article:has(> nav) > div ol,
article:has(> nav) > div ul {
  max-width: 42rem;
}

#bench {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 72rem;
  padding-bottom: 0.5rem;
}

kh-job {
  display: block;
  background: #f4f7f8;
  border-left: 6px solid #4f46e5;
  border-radius: 4px;
  padding: 0.85rem 1rem 1rem;
  margin: 0.75rem 0;
  scroll-margin-top: 1rem;
}

kh-job svg {
  width: 100%;
  max-width: 9rem;
  height: auto;
  aspect-ratio: 8 / 5;
  display: block;
  margin-bottom: 0.45rem;
}

article kh-job {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  column-gap: 1rem;
  align-items: start;
}

article kh-job svg {
  grid-column: 1;
  grid-row: 1 / span 8;
  margin: 0;
}

article kh-job h2,
article kh-job p,
article kh-job dl {
  grid-column: 2;
}

kh-job dl {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.35rem 0.75rem;
  margin: 0.6rem 0 0;
}

kh-job dt {
  margin: 0;
}

kh-job dd {
  margin: 0;
}

aside {
  border-left: 6px solid #4f46e5;
  background: #f4f7f8;
  border-radius: 4px;
  padding: 0.7rem 1rem;
  margin: 1rem 0;
  max-width: 42rem;
}

main details {
  background: #f4f7f8;
  border-left: 6px solid #4f46e5;
  border-radius: 4px;
  padding: 0.15rem 0.9rem;
  margin: 0.5rem 0;
  max-width: 42rem;
}

main details summary,
kh-consent summary {
  min-height: 44px;
  padding: 0.55rem 0;
  cursor: pointer;
}

main div:has(> table) {
  overflow-x: auto;
  max-width: 100%;
  margin: 0.75rem 0 1rem;
}

table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
}

caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

th,
td {
  border-bottom: 1px solid #101418;
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.45rem;
}

ol,
ul {
  padding-left: 1.2rem;
}

li {
  margin: 0.35rem 0;
}

kh-form {
  display: block;
  max-width: 36rem;
  margin: 0.5rem 0 1rem;
}

kh-form label {
  display: block;
  margin-top: 0.85rem;
}

kh-form input[type="text"],
kh-form input[type="email"],
kh-form select,
kh-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  min-height: 44px;
  padding: 0.45rem 0.55rem;
  border: 2px solid #101418;
  border-radius: 4px;
  background: #f4f7f8;
  color: #101418;
  font: inherit;
}

kh-form textarea {
  min-height: 9rem;
}

kh-form label:has(input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-height: 44px;
  padding-top: 0.45rem;
}

kh-form input[type="checkbox"],
kh-consent input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

kh-form p[id$="-hint"],
kh-form p[id$="-error"],
kh-form [role="status"] {
  margin: 0.3rem 0 0;
  font-family: Bahnschrift, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.45;
}

kh-form [aria-invalid="true"] {
  outline: 3px solid #4f46e5;
  outline-offset: 2px;
}

kh-form button,
#open-consent {
  margin-top: 1rem;
  min-height: 44px;
  padding: 0.45rem 1rem;
  background: #4f46e5;
  color: #f4f7f8;
  border: 2px solid #4f46e5;
  border-radius: 4px;
  cursor: pointer;
}

kh-consent {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(38rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  overflow: auto;
  background: #f4f7f8;
  color: #101418;
  border: 2px solid #101418;
  border-top: 6px solid #4f46e5;
  border-radius: 4px;
}

kh-consent summary {
  padding: 0.65rem 1rem;
}

kh-consent details > div {
  padding: 0 1rem 1rem;
}

kh-consent p {
  margin: 0 0 0.75rem;
  max-width: 38rem;
}

kh-consent details > div > div:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

kh-consent button {
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  background: #f4f7f8;
  color: #101418;
  border: 2px solid #101418;
  border-radius: 4px;
  cursor: pointer;
  flex: 1 1 8rem;
}

kh-consent label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  margin-top: 0.35rem;
  font-family: Bahnschrift, "Segoe UI", sans-serif;
}

footer {
  display: block;
}

kh-foot {
  display: grid;
  gap: 0.75rem 1.5rem;
  max-width: 72rem;
  margin: 1.5rem auto 0;
  padding: 1.5rem 1.25rem 0.5rem;
  border-top: 2px solid #101418;
}

kh-foot nav {
  display: flex;
  flex-direction: column;
}

kh-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

kh-foot button {
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  background: #e9eef2;
  color: #101418;
  border: 2px solid #101418;
  border-radius: 4px;
  cursor: pointer;
}

::selection {
  background: #4f46e5;
  color: #f4f7f8;
}

@media (max-width: 800px) {
  kh-hero,
  article:has(> nav),
  #bench {
    grid-template-columns: 1fr;
  }

  article:has(> nav) > nav {
    position: static;
  }

  article kh-job {
    display: block;
  }

  article kh-job svg {
    margin-bottom: 0.45rem;
  }

  kh-job dl {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 800px) {
  kh-foot {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
}

@media (max-width: 760px) {
  kh-bar > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  kh-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-left: 0;
  }

  kh-nav[open] {
    display: flex;
  }

  kh-nav a {
    padding: 0 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (forced-colors: active) {
  kh-job,
  aside,
  main details,
  kh-consent {
    border-color: CanvasText;
  }

  :focus-visible {
    outline-color: Highlight;
  }
}

.kerf-photos { display: grid; gap: 0.75rem; margin: 1.5rem auto; max-width: 42rem; }
.kerf-photos img { display: block; width: 100%; height: auto; }
.kerf-photos-credit { margin-top: 0.75rem; }
