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

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

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

body {
  margin: 0;
  background: #fbf1fb;
  color: #2b2447;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

button {
  color: inherit;
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
  cursor: pointer;
}

a {
  color: #453880;
}

b,
strong {
  font-weight: 700;
}

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

h1,
h2,
h3 {
  font-weight: 600;
}

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

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #294219;
  outline-offset: 4px;
}

.edition-head,
.main-content-frame,
.edition-foot,
.read-main {
  width: calc(100% - 52px);
  max-width: 1210px;
  margin-inline: auto;
  padding-inline: 0;
}

.read-main {
  display: block;
  margin-block: 8px;
  font-size: 16px;
  text-underline-offset: 4px;
}

.edition-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fbf1fb;
  border-bottom: 1px solid #d9cce3;
  box-shadow: 0 5px 16px rgb(43 36 71 / 5%);
}

.brand-row {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: center;
  padding-block: 12px;
}

.edition-title {
  max-width: 100%;
  color: #453880;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 600ms ease;
}

.edition-title:hover {
  color: #294219;
}

.navigation-row {
  position: absolute;
  top: calc(100% + 28px);
  left: 0;
  width: 188px;
}

#edition-nav {
  max-height: calc(100dvh - 130px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-caption {
  margin-bottom: 16px;
  color: #655a7b;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-link,
.nav-folder > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 2px solid #ded1e7;
  border-radius: 4px 4px 0 0;
  background: #f3e8f6;
  color: #453880;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: color 600ms ease, background-color 600ms ease;
}

.nav-link:hover,
.nav-folder > summary:hover {
  background: #ffffff;
  color: #294219;
}

.nav-link[aria-current="page"] {
  color: #294219;
}

.nav-rule {
  display: block;
  width: 22px;
  margin-block: 16px;
  border-top: 1px solid #9f90b4;
}

.nav-folder > summary {
  list-style: none;
  cursor: pointer;
}

.nav-folder > summary::-webkit-details-marker {
  display: none;
}

.nav-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.collapse-mark {
  display: none;
}

.nav-folder[open] .expand-mark {
  display: none;
}

.nav-folder[open] .collapse-mark {
  display: block;
}

.mark {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 4px;
  background: #eee3f3;
}

.nav-switch,
.dialog-close {
  display: inline-flex;
  width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid #b9a8ce;
  border-radius: 6px;
  background: #fbf1fb;
  transition: background-color 600ms ease;
}

.nav-switch {
  display: none;
}

.nav-switch:hover,
.dialog-close:hover {
  background: #ece0f2;
}

#navigation-dialog {
  width: min(360px, calc(100% - 24px));
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 24px;
  border: 0;
  border-left: 1px solid #d9cce3;
  border-radius: 8px 0 0 8px;
  background: #fbf1fb;
  color: #2b2447;
  box-shadow: -12px 0 32px rgb(43 36 71 / 16%);
  overflow-y: auto;
}

#navigation-dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

#navigation-dialog::backdrop {
  background: rgb(43 36 71 / 45%);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-head h2 {
  font-size: 26px;
  line-height: 1.2;
}

.dialog-navigation {
  min-width: 0;
}

.dialog-navigation #edition-nav {
  max-height: none;
  overflow: visible;
}

.main-content-frame {
  margin-block: 48px 70px;
  scroll-margin-top: 110px;
}

.page-sections {
  display: grid;
  min-width: 0;
  gap: 70px;
  margin-left: 228px;
}

.opening {
  display: grid;
  gap: 16px;
}

.opening > p {
  color: #294219;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.opening h1,
.story-head h1 {
  font-size: 60px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.opening h1 {
  max-width: 900px;
}

.title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.title-line h2 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
}

.feature {
  display: grid;
  width: 75%;
  max-width: 100%;
  min-width: 0;
  gap: 22px;
  margin-left: auto;
  padding: 24px;
  border: 1px solid #392e6b;
  border-radius: 8px;
  background: #453880;
  color: #fbf1fb;
  box-shadow: 0 10px 28px rgb(43 36 71 / 12%);
}

.feature .title-line h2 {
  font-size: 26px;
}

.slider-track {
  position: relative;
  display: flex;
  min-width: 0;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: auto;
  scrollbar-width: thin;
  scrollbar-color: #c0afd8 #392e6b;
}

.slide {
  position: relative;
  display: grid;
  min-width: 0;
  flex: 0 0 84%;
  border-radius: 6px;
  background: #211b39;
  scroll-snap-align: start;
}

.slide:last-child {
  scroll-snap-align: end;
}

.slide > img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  object-fit: cover;
}

.slide-caption {
  position: relative;
  display: grid;
  grid-area: 1 / 1;
  align-self: end;
  gap: 22px;
  padding: 24px;
  border-radius: 0 0 6px 6px;
  background: rgb(33 27 57 / 96%);
  color: #ffffff;
}

.slide-caption h3 {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
}

.outline-button {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
  border: 1px solid #453880;
  border-radius: 5px;
  background: transparent;
  color: #453880;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: color 600ms ease, background-color 600ms ease, border-color 600ms ease;
}

.outline-button:hover {
  border-color: #294219;
  background: #edf1e8;
  color: #294219;
}

.slide-caption .outline-button {
  border-color: #e3d9f0;
  color: #ffffff;
}

.slide-caption .outline-button:hover {
  border-color: #ffffff;
  background: #fbf1fb;
  color: #453880;
}

.feature a:focus-visible,
.feature button:focus-visible,
.slider-track:focus-visible {
  outline-color: #ffffff;
  outline-offset: -4px;
}

.slider-progress {
  display: block;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 4px;
  background: #6d5e9c;
  color: #c4d8b2;
  accent-color: #c4d8b2;
  appearance: none;
}

.slider-progress::-webkit-progress-bar {
  border-radius: 4px;
  background: #6d5e9c;
}

.slider-progress::-webkit-progress-value {
  border-radius: 4px;
  background: #c4d8b2;
}

.slider-progress::-moz-progress-bar {
  border-radius: 4px;
  background: #c4d8b2;
}

.slider-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.slider-count {
  margin-right: auto;
  font-size: 16px;
  white-space: nowrap;
}

.slide-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.slide-number {
  width: 36px;
  min-height: 40px;
  padding: 4px;
  border: 1px solid #b5a3d1;
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  transition: color 600ms ease, background-color 600ms ease;
}

.slide-number:hover,
.slide-number.is-active {
  background: #fbf1fb;
  color: #453880;
}

.topics,
.post-section {
  display: grid;
  min-width: 0;
  gap: 28px;
  padding-top: 28px;
  border-top: 1px solid #d9cce3;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.post-label {
  display: inline-block;
  max-width: 100%;
  padding: 7px 16px;
  border: 1px solid #c8d0bf;
  border-radius: 5px;
  background: #f0f2eb;
  color: #294219;
  font-size: 16px;
  font-weight: 500;
}

#posts-heading {
  scroll-margin-top: 110px;
}

.post-list {
  display: grid;
  min-width: 0;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-list > li {
  min-width: 0;
}

.post {
  display: grid;
  min-width: 0;
  grid-template-columns: 122px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 34px;
  border: 1px solid #dfd3e7;
  border-radius: 7px;
  background: #fffaff;
  box-shadow: 0 4px 18px rgb(43 36 71 / 6%);
  transition: border-color 600ms ease;
}

.post:hover {
  border-color: #ad9ac5;
}

.post-preview {
  width: 122px;
  height: 280px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: #eadff0;
  object-fit: cover;
}

.post-text {
  display: grid;
  min-width: 0;
  gap: 16px;
  text-align: center;
}

.post-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-summary {
  display: grid;
  gap: 12px;
}

.abstract {
  display: -webkit-box;
  overflow: hidden;
  color: #574d6b;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-meta {
  color: #655a7b;
  font-size: 16px;
  font-weight: 400;
}

.post-foot {
  display: flex;
  justify-content: center;
}

.story-columns {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 676px) 280px;
  align-items: start;
  gap: 22px;
}

.post-page {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 676px;
  gap: 34px;
  margin-left: 0;
  margin-right: auto;
}

.story-head {
  display: grid;
  min-width: 0;
  gap: 22px;
  padding-bottom: 28px;
  border-bottom: 1px solid #d9cce3;
}

.location {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: #655a7b;
  font-size: 16px;
  line-height: 1.5;
}

.location a {
  text-underline-offset: 4px;
}

.location [aria-current="page"] {
  min-width: 0;
  color: #2b2447;
}

.prose {
  min-width: 0;
  max-width: 100%;
}

.prose p {
  margin-bottom: 1.3em;
}

.prose h2 {
  margin-block: 1.8em 0.7em;
  color: #453880;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
}

.prose h3 {
  margin-block: 1.5em 0.6em;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
}

.prose a {
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 600ms ease;
}

.prose a:hover {
  color: #294219;
}

.prose blockquote {
  margin: 28px 0;
  padding: 22px 24px;
  border-left: 4px solid #294219;
  border-radius: 0 5px 5px 0;
  background: #f1e6f5;
  font-style: italic;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose cite {
  display: block;
  margin-top: 12px;
  color: #453880;
  font-size: 16px;
  font-weight: 500;
  font-style: italic;
}

.prose ul,
.prose ol {
  margin-block: 0 1.3em;
  padding-left: 28px;
}

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

.prose ol {
  list-style-type: decimal;
}

.prose li {
  padding-left: 4px;
}

.prose li + li {
  margin-top: 8px;
}

.prose li::marker {
  color: #294219;
}

.prose table {
  width: 100%;
  max-width: 100%;
  margin-block: 22px;
  border-collapse: collapse;
  text-align: left;
}

.prose caption {
  padding-bottom: 12px;
  color: #453880;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  caption-side: top;
}

.prose th,
.prose td {
  padding: 12px 16px;
  border-bottom: 1px solid #d9cce3;
  vertical-align: top;
}

.prose th {
  color: #453880;
  font-weight: 600;
}

.prose td {
  font-weight: 400;
}

.prose img {
  height: auto;
  margin-block: 22px;
  border-radius: 5px;
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.story-foot {
  padding-top: 22px;
  border-top: 1px solid #d9cce3;
  color: #655a7b;
  font-size: 16px;
}

.story-aside {
  display: grid;
  width: 280px;
  max-width: 100%;
  min-width: 0;
  gap: 16px;
  padding: 24px;
  border: 1px solid #dfd3e7;
  border-radius: 6px;
  background: #fffaff;
  box-shadow: 0 4px 18px rgb(43 36 71 / 5%);
}

.story-aside h2 {
  color: #453880;
  font-size: 26px;
  line-height: 1.2;
}

.story-aside p {
  font-size: 16px;
}

.edition-foot {
  padding-block: 28px;
  border-top: 1px solid #cfc1dc;
}

.credits-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 24px;
  color: #655a7b;
  font-size: 16px;
}

.reveal {
  animation: reveal-items 600ms ease 100ms both;
}

.slide.is-changing {
  animation: slide-fade 600ms ease both;
}

@keyframes reveal-items {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 1257px) {
  .story-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .story-aside {
    width: 100%;
    max-width: 676px;
  }
}

@media (max-width: 1000px) {
  .feature {
    width: 100%;
  }
}

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

  .brand-row {
    min-height: 64px;
    padding-block: 12px;
  }

  .edition-title {
    max-width: calc(100% - 110px);
    font-size: 28px;
  }

  .navigation-row {
    top: 0;
    right: 0;
    left: auto;
    display: flex;
    width: 44px;
    min-height: 64px;
    align-items: center;
    justify-content: flex-end;
  }

  .navigation-row > #edition-nav {
    display: none;
  }

  .nav-switch {
    display: inline-flex;
  }

  .main-content-frame {
    margin-block: 32px 48px;
    scroll-margin-top: 90px;
  }

  .page-sections {
    gap: 48px;
    margin-left: 0;
  }

  .opening h1,
  .story-head h1 {
    font-size: 36px;
    line-height: 1.15;
  }

  .opening > p {
    letter-spacing: 0.04em;
  }

  .feature {
    width: 100%;
    gap: 16px;
    padding: 16px;
  }

  .title-line h2,
  .feature .title-line h2 {
    font-size: 26px;
  }

  .slide {
    flex-basis: 84%;
  }

  .slide-caption {
    gap: 16px;
    padding: 16px;
  }

  .slide-caption h3 {
    font-size: 26px;
  }

  .outline-button {
    padding: 10px 16px;
    font-size: 16px;
  }

  .topics,
  .post-section {
    gap: 24px;
    padding-top: 24px;
  }

  #posts-heading {
    scroll-margin-top: 90px;
  }

  .post-list {
    gap: 24px;
  }

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

  .post-preview {
    width: 100%;
    height: auto;
    max-width: 280px;
    margin-inline: auto;
    aspect-ratio: 1 / 1;
  }

  .post-title {
    font-size: 22px;
  }

  .post-page {
    gap: 24px;
  }

  .story-head {
    gap: 16px;
    padding-bottom: 24px;
  }

  .prose h2 {
    font-size: 28px;
  }

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

  .prose blockquote {
    margin-block: 24px;
    padding: 16px 20px;
  }

  .prose th,
  .prose td {
    padding: 12px;
  }

  .credits-row {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .edition-head,
  .main-content-frame,
  .edition-foot,
  .read-main {
    width: calc(100% - 24px);
  }
}

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

  .slider-track {
    scroll-behavior: auto;
  }

  .reveal,
  .slide.is-changing {
    animation: none;
    opacity: 1;
  }

  .edition-title,
  .nav-link,
  .nav-folder > summary,
  .nav-switch,
  .dialog-close,
  .outline-button,
  .slide-number,
  .post,
  .prose a {
    transition: none;
  }
}
