:root {
  color-scheme: light;
  --background: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #edf2f7;
  --text: #182230;
  --muted: #536273;
  --border: #cbd5e1;
  --accent: #075985;
  --accent-hover: #0c4a6e;
  --focus: #eab308;
  --content-width: 72rem;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, #e8f2f8 0, var(--background) 18rem),
    var(--background);
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

a:focus-visible,
[tabindex]:focus-visible {
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.2rem;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 1rem;
  color: #ffffff;
  background: #111827;
  border-radius: 0.35rem;
  transform: translateY(-180%);
}

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

.shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid rgb(148 163 184 / 45%);
  background: rgb(255 255 255 / 82%);
  backdrop-filter: blur(0.7rem);
}

.site-header .shell {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding-block: 1rem;
}

.site-title {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
}

.site-context {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.breadcrumbs {
  padding-block: 1.25rem 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  margin-left: 0.4rem;
  content: "/";
}

.content {
  min-height: calc(100vh - 15rem);
  margin-bottom: 3rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgb(203 213 225 / 80%);
  border-radius: 0.8rem;
  box-shadow: 0 1rem 2.5rem rgb(15 23 42 / 7%);
}

.markdown > :first-child,
.not-found > :first-child {
  margin-top: 0;
}

.markdown > :last-child,
.not-found > :last-child {
  margin-bottom: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.85rem, 5vw, 3rem);
}

h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

h3 {
  margin-top: 2rem;
}

hr {
  height: 1px;
  margin-block: 2rem;
  background: var(--border);
  border: 0;
}

blockquote {
  margin-inline: 0;
  padding: 0.1rem 1rem;
  color: var(--muted);
  border-left: 0.3rem solid var(--accent);
}

code {
  padding: 0.12rem 0.3rem;
  color: #7c2d12;
  background: #fff7ed;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

pre {
  padding: 1rem;
  overflow: auto;
  color: #e2e8f0;
  background: #172033;
  border-radius: 0.5rem;
}

pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

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

.table-scroll {
  max-width: 100%;
  margin-block: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
}

table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 0.7rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

th {
  color: #0f172a;
  background: var(--surface-muted);
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.align-center {
  text-align: center;
}

.align-right {
  text-align: right;
}

.resources {
  margin-top: 2.5rem;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.resource-list a {
  display: flex;
  min-height: 5rem;
  flex-direction: column;
  justify-content: center;
  padding: 0.9rem 1rem;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  text-decoration: none;
}

.resource-list a:hover {
  border-color: var(--accent);
  box-shadow: 0 0.4rem 1rem rgb(15 23 42 / 8%);
}

.resource-list span {
  color: var(--accent);
  font-weight: 700;
}

.resource-list small {
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button {
  display: inline-block;
  padding: 0.65rem 1rem;
  color: #ffffff;
  background: var(--accent);
  border-radius: 0.4rem;
  font-weight: 700;
  text-decoration: none;
}

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

.site-footer {
  padding-block: 1.5rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

@media (max-width: 40rem) {
  .site-header .shell {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .site-context {
    text-align: left;
  }

  .content {
    padding: 1.1rem;
    border-inline: 0;
    border-radius: 0;
  }

  .shell {
    width: min(100%, var(--content-width));
  }

  .breadcrumbs,
  .site-header .shell,
  .site-footer .shell {
    width: calc(100% - 2rem);
  }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #0f172a;
    --surface: #172033;
    --surface-muted: #202c42;
    --text: #e5edf7;
    --muted: #b8c4d4;
    --border: #45546a;
    --accent: #7dd3fc;
    --accent-hover: #bae6fd;
  }

  body {
    background:
      linear-gradient(180deg, #12263a 0, var(--background) 18rem),
      var(--background);
  }

  .site-header {
    background: rgb(15 23 42 / 88%);
  }

  th {
    color: var(--text);
  }

  code {
    color: #fed7aa;
    background: #431407;
  }

  .button,
  .button:hover {
    color: #082f49;
  }
}
