/* 5sigmas — ultra-minimal content system */
:root {
  --s5-bg: #ffffff;
  --s5-surface: #f7f7f7;
  --s5-text: #111111;
  --s5-muted: #666666;
  --s5-line: #dedede;
  --s5-line-strong: #111111;
  --s5-width: 1180px;
  --md-primary-fg-color: #ffffff;
  --md-primary-bg-color: #111111;
  --md-accent-fg-color: #111111;
  --md-default-bg-color: #ffffff;
  --md-default-fg-color: #111111;
  --md-text-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --md-code-font: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

[data-md-color-scheme="slate"] {
  --s5-bg: #111111;
  --s5-surface: #191919;
  --s5-text: #f5f5f5;
  --s5-muted: #a8a8a8;
  --s5-line: #343434;
  --s5-line-strong: #f5f5f5;
  --md-default-bg-color: #111111;
  --md-default-fg-color: #f5f5f5;
}

html { scroll-behavior: smooth; }
body,
.md-main,
.md-container,
.md-content,
.md-content__inner {
  background: var(--s5-bg) !important;
  background-image: none !important;
}

body { color: var(--s5-text); }

.md-header {
  background: color-mix(in srgb, var(--s5-bg) 94%, transparent) !important;
  border-bottom: 1px solid var(--s5-line);
  box-shadow: none !important;
  color: var(--s5-text) !important;
  backdrop-filter: blur(12px);
}

.md-header__inner { min-height: 3.25rem; }
.md-header__button { color: var(--s5-text) !important; }
.md-header__button.md-logo { margin: 0 .55rem 0 0; padding: 0; }
.md-logo img { width: 28px !important; height: 28px !important; }
.md-header__title {
  color: var(--s5-text) !important;
  font-size: .88rem;
  font-weight: 750;
  letter-spacing: -.025em;
}
.md-header__topic:first-child::after { content: none !important; }

.md-tabs {
  background: var(--s5-bg) !important;
  border-bottom: 1px solid var(--s5-line);
  color: var(--s5-text) !important;
}
.md-tabs__link {
  color: var(--s5-muted) !important;
  font-size: .7rem;
  font-weight: 650;
  letter-spacing: .02em;
  text-transform: none;
  opacity: 1;
}
.md-tabs__link--active,
.md-tabs__link:hover { color: var(--s5-text) !important; }

.md-search__form,
.md-search__output { background: var(--s5-bg) !important; }
.md-search__input { color: var(--s5-text) !important; }

.md-main__inner { margin-top: 0; }
.md-content__inner { padding-top: 2.25rem; }
.md-typeset {
  color: var(--s5-text);
  font-size: .94rem;
  line-height: 1.75;
}
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--s5-text) !important;
  background: none !important;
  background-image: none !important;
  -webkit-text-fill-color: currentColor !important;
  font-family: inherit;
  font-weight: 720;
  letter-spacing: -.045em;
}
.md-typeset h1 {
  max-width: 18ch;
  margin-bottom: 1.35rem;
  font-size: clamp(2.6rem, 5.2vw, 5rem);
  line-height: .98;
}
.md-typeset h2 {
  margin-top: 4.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--s5-line);
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  line-height: 1.05;
}
.md-typeset h3 {
  margin-top: 2.5rem;
  font-size: 1.3rem;
  line-height: 1.15;
}
.md-typeset p,
.md-typeset li { max-width: 72ch; }
.md-typeset a:not([class]) {
  color: var(--s5-text) !important;
  text-decoration: underline;
  text-decoration-color: var(--s5-muted);
  text-underline-offset: .2em;
}
.md-typeset a:not([class]):hover { text-decoration-color: var(--s5-text); }
.md-typeset strong { color: var(--s5-text); }
.md-typeset hr { border-color: var(--s5-line); }
.md-typeset blockquote {
  border-left: 2px solid var(--s5-text);
  color: var(--s5-muted);
  font-style: normal;
}
.md-typeset .admonition,
.md-typeset details,
.md-typeset table:not([class]) {
  border: 1px solid var(--s5-line);
  border-radius: 0;
  background: var(--s5-bg);
  box-shadow: none;
}
.md-typeset .admonition-title,
.md-typeset summary { background: var(--s5-surface); }
.md-typeset table:not([class]) th {
  background: var(--s5-surface);
  color: var(--s5-text);
  font-size: .72rem;
  text-transform: none;
}
.md-typeset code { border-radius: 2px; }

.s5-progress {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--s5-text);
  pointer-events: none;
}

.s5-landing {
  width: min(var(--s5-width), calc(100vw - 2.5rem));
  max-width: none;
  margin: 0 auto;
  color: var(--s5-text);
}

.s5-eyebrow {
  margin: 0 0 .9rem;
  color: var(--s5-muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.s5-home-hero {
  max-width: 920px;
  padding: clamp(5rem, 11vw, 10rem) 0 clamp(4rem, 8vw, 7rem);
}
.s5-home-hero h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(3.5rem, 9vw, 8.2rem);
  line-height: .86;
  letter-spacing: -.075em;
}
.s5-home-hero p {
  max-width: 620px !important;
  margin: 2rem 0 0;
  color: var(--s5-muted);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.6;
}

.s5-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: clamp(6rem, 11vw, 10rem);
  border-top: 1px solid var(--s5-line-strong);
}
.s5-entry {
  display: block;
  min-width: 0;
  padding: 1.25rem 2rem 2rem 0;
  border-right: 1px solid var(--s5-line);
  color: var(--s5-text) !important;
  text-decoration: none !important;
}
.s5-entry + .s5-entry { padding-left: 2rem; }
.s5-entry:last-child { border-right: 0; }
.s5-entry__index { color: var(--s5-muted); font-size: .7rem; }
.s5-entry__title { margin-top: 1.5rem; font-size: clamp(1.5rem, 2.5vw, 2.2rem); font-weight: 720; letter-spacing: -.04em; }
.s5-entry__text { max-width: 29ch; margin-top: .65rem; color: var(--s5-muted); font-size: .86rem; line-height: 1.55; }
.s5-entry:hover .s5-entry__title { text-decoration: underline; text-underline-offset: .15em; }

.s5-section {
  margin: clamp(6rem, 11vw, 10rem) 0;
}
.s5-section-head {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: baseline;
  margin-bottom: 1.5rem;
  padding-top: .9rem;
  border-top: 1px solid var(--s5-line-strong);
}
.s5-section-head h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: clamp(1.75rem, 3.3vw, 3rem);
  line-height: 1;
}
.s5-section-head a { color: var(--s5-text) !important; font-size: .78rem; text-decoration: none !important; }
.s5-section-head a:hover { text-decoration: underline !important; }

.s5-feature-media {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.s5-feature-media__image,
.s5-media-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--s5-surface);
}
.s5-feature-media h2 {
  margin: .6rem 0 1rem;
  padding: 0;
  border: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: .98;
}
.s5-feature-media p { color: var(--s5-muted); }
.s5-text-link {
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--s5-text) !important;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: underline !important;
  text-underline-offset: .22em;
}

.s5-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.s5-media-card { color: var(--s5-text) !important; text-decoration: none !important; }
.s5-media-card__meta { margin-top: .85rem; color: var(--s5-muted); font-size: .68rem; }
.s5-media-card__title { margin-top: .35rem; font-size: 1.05rem; font-weight: 700; line-height: 1.25; letter-spacing: -.025em; }
.s5-media-card:hover .s5-media-card__title { text-decoration: underline; text-underline-offset: .15em; }

.s5-simple-list { border-top: 1px solid var(--s5-line-strong); }
.s5-list-row {
  display: grid;
  grid-template-columns: 48px minmax(180px, .7fr) minmax(0, 1.3fr) auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--s5-line);
  color: var(--s5-text) !important;
  text-decoration: none !important;
}
.s5-list-row__n,
.s5-list-row__meta { color: var(--s5-muted); font-size: .68rem; }
.s5-list-row__title { font-size: 1.05rem; font-weight: 700; letter-spacing: -.025em; }
.s5-list-row__desc { color: var(--s5-muted); font-size: .82rem; }
.s5-list-row:hover .s5-list-row__title { text-decoration: underline; text-underline-offset: .15em; }

.s5-page-intro {
  max-width: 850px;
  padding: clamp(5rem, 10vw, 9rem) 0 clamp(3rem, 6vw, 5rem);
}
.s5-page-intro h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3.2rem, 7.5vw, 7rem);
  line-height: .9;
  letter-spacing: -.07em;
}
.s5-page-intro p { max-width: 620px !important; margin-top: 1.5rem; color: var(--s5-muted); font-size: 1.05rem; }

.s5-note-feature {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--s5-line-strong);
  border-bottom: 1px solid var(--s5-line);
}
.s5-note-feature h2 { margin: 0 0 .8rem; padding: 0; border: 0; font-size: clamp(1.8rem, 3.8vw, 3.5rem); }
.s5-note-feature p { color: var(--s5-muted); }
.s5-note-feature__meta { min-width: 180px; color: var(--s5-muted); font-size: .72rem; line-height: 1.7; }

.s5-about {
  display: grid;
  grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr);
  gap: clamp(3rem, 8vw, 8rem);
  padding: clamp(5rem, 10vw, 9rem) 0;
}
.s5-about__aside { color: var(--s5-muted); font-size: .82rem; }
.s5-about__aside strong { display: block; margin-bottom: .5rem; color: var(--s5-text); font-size: 1rem; }
.s5-about__body h1 { max-width: 12ch; margin: 0 0 3rem; font-size: clamp(3rem, 7vw, 6.5rem); line-height: .9; }
.s5-about__body h2 { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--s5-line); }
.s5-about__body p { color: var(--s5-muted); }

.s5-video-embed { margin: 1.5rem 0 2rem; }
.s5-video-embed video {
  border: 1px solid var(--s5-line);
  border-radius: 0;
  background: #000;
  box-shadow: none;
}
.s5-video-embed__watch { margin-top: .75rem !important; }
.s5-video-embed__watch a {
  color: var(--s5-text) !important;
  font-size: .75rem;
  font-weight: 700;
  text-decoration: underline !important;
  text-underline-offset: .2em;
}

.md-sidebar--primary .md-sidebar__scrollwrap {
  border-right: 1px solid var(--s5-line) !important;
  background: var(--s5-bg) !important;
}
.md-nav__link { color: var(--s5-muted) !important; }
.md-nav__link:hover,
.md-nav__link--active { color: var(--s5-text) !important; }
.md-nav__item--active > .md-nav__link { font-weight: 700; }

.md-footer { background: var(--s5-bg) !important; border-top: 1px solid var(--s5-line); color: var(--s5-muted) !important; }
.md-footer-meta { background: var(--s5-bg) !important; }

@media (max-width: 800px) {
  .s5-landing { width: min(100% - 1.5rem, var(--s5-width)); }
  .s5-home-hero { padding-top: 4.5rem; }
  .s5-entry-grid,
  .s5-media-grid,
  .s5-feature-media,
  .s5-about { grid-template-columns: 1fr; }
  .s5-entry { padding: 1.25rem 0 1.75rem !important; border-right: 0; border-bottom: 1px solid var(--s5-line); }
  .s5-section-head { align-items: flex-start; flex-direction: column; gap: .6rem; }
  .s5-feature-media { gap: 1.5rem; }
  .s5-media-grid { gap: 2rem; }
  .s5-list-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: .75rem; }
  .s5-list-row__desc { grid-column: 2 / -1; }
  .s5-note-feature { grid-template-columns: 1fr; gap: 1rem; }
  .s5-about { padding-top: 4rem; }
  .s5-about__aside { padding-bottom: 2rem; border-bottom: 1px solid var(--s5-line); }
  .md-typeset h1 { font-size: clamp(2.5rem, 13vw, 4.5rem); }
}

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