:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #606060;
  --accent: #982f25;
  --rule: rgba(17, 17, 17, 0.48);
  --measure: 80ch;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1rem;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

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

.skip-link {
  position: fixed;
  z-index: 2;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.45rem 0.7rem;
  transform: translateY(-200%);
  background: var(--ink);
  color: var(--paper);
}

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

.site-shell {
  width: min(calc(100% - 3rem), var(--measure));
  margin-inline: auto;
  padding-block: clamp(2.25rem, 7vw, 5.5rem) 2.5rem;
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 1.15rem;
  border-bottom: 1px solid rgba(17, 17, 17, 0.18);
  animation: settle 260ms ease-out both;
}

.site-title,
.site-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-title {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.75rem;
}

.site-title::before,
.site-title::after {
  position: absolute;
  width: 0.5rem;
  height: 0.5rem;
  content: "";
}

.site-title::before {
  top: 0;
  left: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.site-title::after {
  right: 0;
  bottom: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.site-nav a {
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.site-main {
  min-height: 55vh;
  animation: settle 300ms 60ms ease-out both;
}

.intro {
  margin-block: clamp(2.4rem, 7vw, 4.5rem);
}

.intro p {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.075rem);
  line-height: 1.55;
}

.notes h2,
.page-header h1,
.post-header h1 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.notes h2::after {
  display: block;
  width: 1.4rem;
  margin-top: 0.55rem;
  border-bottom: 2px solid var(--accent);
  content: "";
}

.advisory-page .page-header h1::after {
  display: block;
  width: 1.4rem;
  margin-top: 0.55rem;
  border-bottom: 2px solid var(--accent);
  content: "";
}

.post-list {
  display: grid;
  gap: 0.4rem;
  margin: 1.65rem 0 0;
  padding: 0;
  list-style: none;
}

.post-list li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.45rem 0.6rem;
  align-items: baseline;
}

.post-list time,
.post-date {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.post-list a {
  display: inline-block;
  text-decoration: none;
  transition: color 120ms ease, transform 120ms ease;
}

.post-list a:hover,
.post-list a:focus-visible {
  transform: translateX(0.25rem);
}

.empty-state {
  margin-top: 1.65rem;
  color: var(--muted);
}

.page,
.post,
.advisory-page {
  margin-block: clamp(2.5rem, 7vw, 4.75rem);
}

.page-header,
.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  max-width: 54ch;
  font-size: clamp(1.25rem, 3vw, 1.85rem);
  text-transform: none;
}

.post-date {
  margin: 0 0 0.65rem;
}

.prose {
  max-width: 72ch;
}

.prose h2,
.prose h3 {
  margin: 2.5em 0 0.75em;
  line-height: 1.3;
}

.prose h2 {
  font-size: 1.2rem;
}

.prose h3 {
  font-size: 1rem;
}

.prose p,
.prose ul,
.prose ol,
.prose pre,
.prose blockquote {
  margin-block: 1.15rem;
}

.prose img {
  max-width: 100%;
  height: auto;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem;
  border-left: 2px solid var(--accent);
  background: rgba(17, 17, 17, 0.055);
  font-size: 0.9rem;
}

.prose code {
  font-family: inherit;
  font-size: 0.92em;
}

.prose :not(pre) > code {
  padding: 0.08em 0.28em;
  background: rgba(17, 17, 17, 0.07);
}

.prose blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 1px dashed var(--rule);
  color: var(--muted);
}

.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px dashed var(--rule);
  text-align: left;
}

.advisory-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--ink);
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
}

.advisory-table tr {
  border-bottom: 1px solid rgba(17, 17, 17, 0.18);
}

.advisory-table td {
  padding: 1.05rem 0.55rem;
  vertical-align: top;
}

.advisory-table .advisory-reference {
  width: 9.9rem;
  padding-left: 0;
  color: var(--accent);
  white-space: nowrap;
}

.advisory-finding {
  width: 58%;
}

.advisory-finding > strong {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
}

.advisory-finding span,
.advisory-state small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.advisory-table .advisory-state {
  width: 10.5rem;
  padding-right: 0;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.advisory-state small {
  margin-top: 0.28rem;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
  white-space: normal;
}

.site-footer {
  margin-top: clamp(3.5rem, 9vw, 6.5rem);
  padding-top: 1rem;
  border-top: 1px solid rgba(17, 17, 17, 0.18);
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(0.3rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 40rem) {
  html {
    font-size: 15px;
  }

  .site-shell {
    width: min(calc(100% - 1.5rem), var(--measure));
    padding-block-start: 1.25rem;
  }

  .site-header {
    align-items: flex-start;
    gap: 1rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .site-title {
    max-width: 16ch;
  }

  .post-list {
    gap: 1rem;
  }

  .post-list li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .advisory-table,
  .advisory-table tbody,
  .advisory-table tr,
  .advisory-table td {
    display: block;
    width: 100%;
  }

  .advisory-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem 1rem;
    padding-block: 1rem;
  }

  .advisory-table td {
    padding: 0;
  }

  .advisory-reference {
    grid-area: 1 / 1;
  }

  .advisory-state {
    grid-area: 1 / 2;
  }

  .advisory-finding {
    grid-area: 2 / 1 / auto / -1;
  }

}

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