:root {
  color-scheme: dark;
  --background: #160e11;
  --text: #c8bbc4;
  --primary: #b961a0;
  --accent: #7f75c7;
  --surface: #21161d;
  --raised: #2c1e28;
  --edge: #66505f;
  --heading: #f4e7ef;
  --link: #efb4df;
  --shadow: 4px 4px 0 #0a0608;
  --motion: 250ms;
}

html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: inherit;
}

html:has(dialog:modal) {
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

h1, h2, h3, p {
  margin: 0;
}

h1, h2, h3 {
  color: var(--heading);
  line-height: 1.2;
}

h1 {
  font-size: 38px;
  font-weight: 600;
}

h2 {
  font-size: 24px;
  font-weight: 600;
}

h3 {
  font-size: 22px;
  font-weight: 500;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

button {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

strong, b {
  font-weight: 700;
}

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #c5bcff;
  outline-offset: 3px;
}

.band-content, .main-frame {
  width: calc(100% - 32px);
  max-width: 1142px;
  margin-inline: auto;
  padding-inline: 0;
}

.top-band, .bottom-band {
  width: 100%;
  background: var(--surface);
}

.top-band {
  position: static;
  border-block-end: 1px solid var(--edge);
}

.top-band > .band-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-height: 78px;
  padding-block: 8px;
}

.to-main {
  flex: 0 0 auto;
  font-size: 16px;
}

.to-main:hover {
  color: var(--heading);
}

.site-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-inline-end: auto;
  color: var(--heading);
  font-weight: 700;
  text-decoration: none;
}

.site-name:hover {
  color: var(--link);
}

.site-logo {
  flex: none;
  width: 36px;
  height: 36px;
}

.nav-list, .path-list, .entries, .related-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list, .nav-list > li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-list {
  flex-wrap: wrap;
}

.nav-dot, .path-dot {
  color: var(--accent);
}

.text-button, .nav-trigger, .nav-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--link);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--motion) ease;
}

.nav-list a, .related-list a {
  border-block-end-width: 3px;
}

.text-button:hover, .nav-trigger:hover, .nav-list a:hover {
  border-color: var(--primary);
}

.nav-list a[aria-current='page'], .related-list a[aria-current='page'] {
  border-block-end-color: var(--accent);
  color: var(--heading);
}

.nav-trigger {
  display: none;
}

.mark {
  flex: none;
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.nav-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100%, 368px);
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-inline-start: 1px solid var(--edge);
  background: var(--surface);
  color: var(--text);
  box-shadow: -6px 0 0 #0a0608;
}

.nav-dialog[open] {
  animation: nav-expand var(--motion) ease-out;
}

.nav-dialog::backdrop {
  background: rgb(10 6 8 / 76%);
}

@keyframes nav-expand {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0);
  }
}

.nav-sheet {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.nav-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-block-end: 8px;
  border-block-end: 1px dotted var(--edge);
}

.nav-dialog .nav-list, .nav-dialog .nav-list > li {
  display: grid;
  align-items: stretch;
  gap: 4px;
}

.nav-dialog .nav-dot {
  justify-self: center;
  line-height: 1;
}

.nav-dialog .nav-list a {
  justify-content: flex-start;
  background: var(--raised);
}

.main-frame {
  display: grid;
  gap: 24px;
  padding-block: 24px;
}

.welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--edge);
  border-inline-start: 4px solid var(--primary);
  background: var(--surface);
}

.welcome p {
  max-width: 56ch;
  margin-block-start: 8px;
}

.welcome-art {
  width: 112px;
  height: 64px;
}

.showcase, .entry, .entry-page, .article-side {
  min-width: 0;
  border: 1px solid var(--edge);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.showcase {
  display: grid;
  justify-self: end;
  gap: 12px;
  width: 75%;
  padding: 24px;
}

.slide-stage {
  display: grid;
  min-width: 0;
  overflow: clip;
  border: 1px solid var(--edge);
  background: var(--raised);
}

.slide {
  display: grid;
  grid-area: 1 / 1;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  visibility: hidden;
  pointer-events: none;
}

.slide.is-active {
  visibility: visible;
  pointer-events: auto;
}

.slide.is-shifting {
  animation: slide-shift var(--motion) ease-out;
}

@keyframes slide-shift {
  from {
    transform: translateY(20px);
  }
  to {
    transform: translateY(0);
  }
}

.slide-image, .slide-copy {
  grid-area: 1 / 1;
  align-self: end;
  min-width: 0;
}

.slide-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.slide-copy {
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: clamp(12px, 2.5vw, 24px);
  border-block-start: 1px solid var(--primary);
  background: rgb(22 14 17 / 94%);
}

.slide-copy h3 {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 500;
}

.slide-copy .text-button, .entry > .text-button {
  border-color: var(--edge);
}

.slide-copy .text-button:hover, .entry > .text-button:hover {
  border-color: var(--primary);
}

.slide-tools:not([hidden]) {
  display: grid;
  gap: 8px;
}

.slide-position {
  display: block;
  width: 100%;
  height: 4px;
  appearance: none;
  border: 0;
  background: var(--raised);
  color: var(--accent);
}

.slide-position::-webkit-progress-bar {
  background: var(--raised);
}

.slide-position::-webkit-progress-value {
  background: var(--accent);
}

.slide-position::-moz-progress-bar {
  background: var(--accent);
}

.slide-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.segments {
  display: flex;
  gap: 6px;
  margin-inline-start: auto;
}

.segment {
  display: grid;
  place-items: center;
  width: clamp(26px, 5vw, 44px);
  height: 34px;
  padding: 3px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: border-color var(--motion) ease;
}

.segment span {
  width: 100%;
  height: 6px;
  background: #947c8d;
}

.segment:hover {
  border-color: var(--primary);
}

.segment[aria-current='true'] span {
  height: 9px;
  background: var(--primary);
}

.topics, .materials, .entries {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.section-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-block-end: 8px;
  border-block-end: 1px dotted var(--edge);
}

.entry {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 24px;
  text-align: left;
  transition: border-color var(--motion) ease;
}

.entry:hover, .entry:focus-within {
  border-color: var(--primary);
}

.entry-image {
  display: block;
  width: min(100%, 320px);
  height: auto;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--edge);
  background: var(--raised);
  object-fit: cover;
}

.entry h3 {
  min-block-size: 2lh;
  font-size: 32px;
  font-weight: 500;
  text-wrap: balance;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 16px;
}

.entry-label {
  display: inline-block;
  justify-self: start;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid var(--edge);
  border-inline-start: 3px solid var(--primary);
  background: var(--raised);
  color: var(--heading);
  font-size: 16px;
  font-weight: 500;
}

.read-length {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-columns {
  grid-template-columns: minmax(0, 1fr) 274px;
  align-items: start;
  gap: 38px;
}

.entry-page {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 772px;
  margin-left: auto;
  margin-right: 0;
  padding: 24px;
}

.path-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 16px;
}

.path-list > li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.path-dot {
  flex: none;
}

.reading {
  display: flow-root;
  min-width: 0;
  padding-block-start: 16px;
  border-block-start: 1px dotted var(--edge);
}

.reading p, .reading ul, .reading ol, .reading blockquote {
  margin-block: 0 1em;
}

.reading h2, .reading h3 {
  margin-block: 1em 0.5em;
}

.reading > :first-child {
  margin-block-start: 0;
}

.reading > :last-child {
  margin-block-end: 0;
}

.reading ul, .reading ol {
  padding-inline-start: 1.5em;
}

.reading ul {
  list-style-type: disc;
}

.reading li + li {
  margin-block-start: 0.35em;
}

.reading li::marker {
  color: #b4a9f1;
}

.reading blockquote {
  margin-inline: 0;
  padding: 16px;
  border: 1px solid var(--edge);
  border-inline-start: 3px solid var(--primary);
  background: var(--raised);
  font-style: italic;
}

.reading blockquote::before {
  display: block;
  margin-block-end: 24px;
  color: var(--primary);
  font-size: 44px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  content: '«';
}

.reading blockquote > :last-child {
  margin-block-end: 0;
}

.reading cite {
  color: #c5bcff;
  font-size: 16px;
  font-style: italic;
  font-weight: 500;
}

.reading table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.reading th, .reading td {
  padding: 8px 12px;
  border: 1px solid var(--edge);
  vertical-align: top;
}

.reading th {
  color: var(--heading);
  font-weight: 600;
}

.reading thead, .reading tbody tr:nth-child(even) {
  background: var(--raised);
}

.reading caption {
  padding-block: 8px;
  color: var(--heading);
  font-weight: 600;
  text-align: left;
}

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

.reading pre {
  max-width: 100%;
  overflow: auto;
}

.article-side {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.related-list {
  display: grid;
  gap: 6px;
}

.related-list a {
  justify-content: flex-start;
  width: 100%;
  background: var(--raised);
}

.bottom-band {
  margin-block-start: auto;
  border-block-start: 1px dotted var(--edge);
}

.bottom-band > .band-content {
  padding-block: 16px;
  font-size: 16px;
}

@media (max-width: 932px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 32px;
  }

  .top-band > .band-content {
    gap: 8px;
    min-height: 64px;
  }

  .nav-trigger:not([hidden]) {
    display: inline-flex;
  }

  .nav-trigger:not([hidden]) + #site-nav {
    display: none;
  }

  .showcase {
    width: 100%;
  }

  .entry h3 {
    font-size: 24px;
  }

  .article-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .band-content, .main-frame {
    width: calc(100% - 40px);
  }

  .site-logo {
    width: 28px;
    height: 28px;
  }

  .nav-trigger {
    padding-inline: 5px;
  }

  .nav-caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .welcome {
    grid-template-columns: minmax(0, 1fr);
  }

  .welcome-art {
    display: none;
  }

  .welcome, .showcase, .entry, .entry-page, .article-side {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .nav-dialog[open], .slide.is-shifting {
    animation: none;
  }

  .entry, .text-button, .nav-trigger, .nav-list a, .segment {
    transition: none;
  }
}

.article-cover {display:block; width:100%; height:auto; aspect-ratio:3/2; object-fit:cover; border:1px solid var(--edge);}
.entry-image {aspect-ratio:3/2;}
.medical-disclaimer {font-size: 0.9em; padding: 12px 0 0; border-top: 1px dotted var(--edge);}
