:root {
  --shell-brand: #1e88e5;
  --shell-brand-light: #64b5f6;
  --shell-brand-dark: #0d47a1;
  --shell-bg: #0a1628;
  --shell-panel: rgba(255, 255, 255, 0.035);
  --shell-line: rgba(255, 255, 255, 0.11);
  --shell-text: #e2e8f0;
  --shell-muted: #a8b6ca;
  --shell-faint: #748399;
  color-scheme: dark;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 125%;
  scroll-behavior: smooth;
}

body {
  min-width: 16rem;
  margin: 0;
  background: linear-gradient(180deg, #10345f 0, #0d2240 21rem, var(--shell-bg) 42rem);
  background-attachment: fixed;
  color: var(--shell-text);
  font-size: 0.8rem;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  background: var(--shell-brand-dark);
  border-radius: 0 0 0.4rem 0;
  color: #fff;
  font-weight: 700;
  left: 0;
  padding: 0.65rem 1rem;
  position: absolute;
  top: -3rem;
  transition: top 0.15s ease;
  z-index: 100;
}

.skip-link:focus-visible {
  top: 0;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Reusable data-flow diagram: a labelled box with arrows in and out, used to
   replace prose/illustrations for "X goes in, Fractum does Y, Z comes out". */
.flow-diagram {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.flow-diagram__arrow {
  background: var(--shell-brand-light);
  display: inline-block;
  flex: 0 0 auto;
  height: 2px;
  position: relative;
  width: 1.6rem;
}

.flow-diagram__arrow::after {
  border-color: transparent transparent transparent var(--shell-brand-light);
  border-style: solid;
  border-width: 4px 0 4px 6px;
  content: "";
  height: 0;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
}

.flow-diagram__node {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--shell-line);
  border-radius: 0.4rem;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.6rem 0.85rem;
  text-align: center;
  white-space: nowrap;
}

.flow-diagram__node--box {
  background: var(--shell-brand);
  border-color: var(--shell-brand);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1.4rem;
}

.flow-diagram__node--box strong {
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.flow-diagram__node--box span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  font-weight: 600;
}

.flow-diagram__list {
  display: flex;
  flex-basis: 100%;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.flow-diagram__list li {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--shell-line);
  border-radius: 999px;
  color: var(--shell-text);
  display: flex;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.4rem;
  white-space: nowrap;
}

.flow-diagram__note {
  border: 1px dashed rgba(100, 181, 246, 0.45);
  border-radius: 0.4rem;
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
}

.flow-diagram__note p {
  color: var(--shell-brand-light);
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.flow-diagram__note ul {
  color: var(--shell-muted);
  font-size: 0.82rem;
  line-height: 1.6;
  list-style: none;
  margin: 0;
  padding: 0;
}

.flow-diagram__note li::before {
  color: var(--shell-brand-light);
  content: "\2013\0020";
}

@media (max-width: 640px) {
  .flow-diagram {
    align-items: stretch;
    flex-direction: column;
  }

  .flow-diagram__arrow {
    align-self: center;
    transform: rotate(90deg);
  }

  .flow-diagram__node,
  .flow-diagram__list li {
    white-space: normal;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--shell-brand-dark), #1565c0 48%, var(--shell-brand));
  box-shadow: 0 0.6rem 1.5rem rgba(0, 0, 0, 0.22);
}

.site-header .nav {
  align-items: center;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  min-height: 4.7rem;
  margin: 0 auto;
  max-width: 90rem;
  padding: 0 2rem;
}

.site-header .brand {
  align-items: center;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.75rem;
  min-width: 0;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.site-header .brand:hover,
.site-header .brand:focus-visible {
  opacity: 0.85;
}

.site-header .brand-name {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1;
}

.site-header .version-badge {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
}

.nav-toggle {
  display: none;
}

.nav-toggle-label {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.4rem;
  cursor: pointer;
  display: none;
  height: 2.45rem;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  width: 2.45rem;
}

.nav-toggle-label:active {
  transform: scale(0.93);
}

.nav-toggle:checked ~ .nav-toggle-label {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  background: #fff;
  content: "";
  display: block;
  height: 2px;
  position: relative;
  transition: top 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  width: 1.15rem;
}

.nav-toggle-label span::before {
  position: absolute;
  top: -0.4rem;
}

.nav-toggle-label span::after {
  position: absolute;
  top: 0.4rem;
}

.nav-toggle:checked ~ .nav-toggle-label span {
  background: transparent;
}

.nav-toggle:checked ~ .nav-toggle-label span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle:checked ~ .nav-toggle-label span::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-header .nav-links,
.site-header .nav-actions {
  align-items: center;
  display: flex;
}

.site-header .nav-links {
  gap: 2rem;
}

.site-header .nav-links a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.site-header .nav-links a:hover,
.site-header .nav-links a:focus-visible,
.site-header .nav-links a[aria-current="page"] {
  color: #fff;
}

.site-header .nav-actions {
  flex: 0 0 auto;
  gap: 0.8rem;
}

.site-header .github-source {
  align-items: center;
  border-radius: 0.4rem;
  background: var(--shell-brand);
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.55rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.8rem;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.site-header .github-source:hover,
.site-header .github-source:focus-visible {
  background: var(--shell-brand-light);
  color: #fff;
  transform: translateY(-1px);
}

.site-header .github-source:active {
  transform: translateY(0) scale(0.97);
}

.site-header .github-source__icon {
  flex: 0 0 auto;
}

.site-header .github-source__icon svg {
  display: block;
  height: 1.4rem;
  width: 1.4rem;
}

.site-header .github-source__info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  line-height: 1;
}

.site-header .github-source__repo {
  font-size: 0.86rem;
  font-weight: 750;
  white-space: nowrap;
}

.site-header .github-source__facts {
  align-items: center;
  display: flex;
  gap: 0.6rem;
}

.site-header .github-source__fact {
  align-items: center;
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 700;
  gap: 0.2rem;
  white-space: nowrap;
}

.site-header .github-source__fact svg {
  display: block;
  height: 0.7rem;
  width: 0.7rem;
}

.shell-container {
  margin: 0 auto;
  max-width: 90rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.site-footer {
  border-top: 1px solid var(--shell-line);
  background: linear-gradient(180deg, #0d2240 0%, var(--shell-bg) 100%);
  color: var(--shell-text);
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  padding-bottom: 3rem;
  padding-top: 3rem;
}

.footer-brand {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 1.15rem;
  font-weight: 800;
  gap: 0.5rem;
}

.footer-copy,
.trademark {
  color: var(--shell-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0.7rem 0 0;
}

.trademark {
  color: var(--shell-faint);
  font-size: 0.76rem;
  font-style: italic;
}

.footer-heading {
  color: var(--shell-brand-light);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.85rem;
  text-transform: uppercase;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-list li + li {
  margin-top: 0.65rem;
}

.footer-list a,
.site-footer p a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-list a:hover,
.site-footer p a:hover {
  color: #fff;
}

.site-footer code {
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  font-size: 0.85em;
  padding: 0.15rem 0.35rem;
}

.footer-bottom {
  border-top: 1px solid var(--shell-line);
  color: var(--shell-faint);
  font-size: 0.85rem;
  padding: 1.35rem 0;
  text-align: center;
}

@media (max-width: 1180px) {
  .site-header .nav-links {
    gap: 1.1rem;
  }
}

@media (max-width: 980px) {
  .site-header .nav {
    flex-wrap: wrap;
    gap: 0.9rem;
    min-height: 4.5rem;
    padding: 0.85rem 1rem;
  }

  .site-header .version-badge {
    display: none;
  }

  .site-header .github-source__repo,
  .site-header .github-source__fact--version,
  .site-header .github-source__fact--forks {
    display: none;
  }

  .site-header .github-source {
    padding: 0.5rem 0.65rem;
  }

  .nav-toggle-label {
    display: inline-flex;
    margin-left: auto;
    order: 2;
  }

  .site-header .nav-actions {
    order: 3;
  }

  .site-header .nav-links {
    border: 1px solid var(--shell-line);
    border-radius: 0.4rem;
    background: rgba(10, 22, 40, 0.97);
    display: flex;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    order: 4;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease, visibility 0.3s;
  }

  .site-header .nav-links a {
    border-top: 1px solid var(--shell-line);
    display: block;
    padding: 1rem;
    width: 100%;
  }

  .site-header .nav-links a:first-child {
    border-top: 0;
  }

  .nav-toggle:checked ~ .nav-links {
    max-height: 22rem;
    opacity: 1;
    visibility: visible;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .shell-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-header .brand-name {
    font-size: 1.2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

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