:root {
    --background: #dccded;
    --paper: #f8f3fc;
    --text: #2d2e41;
    --primary: #242866;
    --accent: #471318;
    --divider: rgba(36, 40, 102, 0.35);
}

html {
    box-sizing: border-box;
}

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

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

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

[hidden] {
    display: none !important;
}

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

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

strong,
b {
    font-weight: 700;
}

em,
i,
cite,
address {
    font-style: normal;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button:disabled {
    opacity: 0.45;
    cursor: default;
}

svg {
    display: block;
    flex-shrink: 0;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

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

.top-band {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    background: var(--background);
    border-bottom: 1px dotted var(--divider);
}

.top-band > .band-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 18px;
    min-height: 72px;
}

.to-main {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.home-link {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 72px;
    color: var(--primary);
}

.home-link img {
    display: block;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.site-name {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

.header-note {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    text-align: right;
}

.nav-place {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    padding-block: 10px 12px;
    border-top: 1px dotted var(--divider);
}

.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-tabs li {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.nav-tabs a {
    display: block;
    padding: 6px 13px;
    border: 2px solid transparent;
    border-radius: 4px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    transition: border-color 250ms ease;
}

.nav-tabs a:hover,
.nav-tabs a[aria-current="page"] {
    border-color: var(--primary);
}

.nav-dot {
    color: var(--accent);
    font-size: 14px;
}

.nav-trigger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 4px;
    background: var(--primary);
    color: var(--background);
    transition: border-color 250ms ease;
}

.nav-trigger:hover {
    border-color: var(--accent);
}

.nav-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 22px;
    border: 0;
    background: var(--background);
    color: var(--text);
    overflow-y: auto;
}

.nav-dialog[open] {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.nav-dialog::backdrop {
    background: var(--primary);
}

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

.dialog-head h2 {
    color: var(--primary);
    font-size: 26px;
}

.close-navigation {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    padding: 6px;
    border: 2px solid transparent;
    border-radius: 4px;
    background: var(--primary);
    color: var(--background);
    transition: border-color 250ms ease;
}

.close-navigation:hover {
    border-color: var(--accent);
}

.dialog-links .nav-tabs {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}

.dialog-links .nav-tabs li {
    width: 100%;
    gap: 12px;
}

.dialog-links .nav-tabs a {
    flex: 1;
    padding: 16px;
    font-size: 20px;
}

.dialog-links .nav-dot {
    width: 12px;
    text-align: center;
}

.main-frame {
    flex: 1;
    display: grid;
    align-content: start;
    gap: 32px;
    padding-block: 32px;
}

.welcome {
    display: grid;
    gap: 10px;
}

.welcome p {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

h1 {
    color: var(--primary);
    font-size: 38px;
    line-height: 1.25;
}

.welcome h1 {
    max-width: 850px;
}

.feature,
.feed {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.section-line {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.section-line h2 {
    color: var(--primary);
    font-size: 26px;
    line-height: 1.3;
}

.section-line > p {
    max-width: 300px;
    margin-left: auto;
    color: var(--accent);
    font-size: 13px;
    text-align: right;
}

.section-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 4px;
    background: var(--primary);
    color: var(--background);
}

.slider {
    min-width: 0;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--primary);
    color: var(--paper);
    box-shadow: 6px 6px 0 rgba(36, 40, 102, 0.24);
}

.slides {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border-radius: 5px 5px 0 0;
    background: var(--primary);
}

.slide-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    background: var(--primary);
}

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

.slide-copy {
    z-index: 1;
    grid-area: 1 / 1;
    align-self: end;
    display: grid;
    justify-items: start;
    gap: 16px;
    min-width: 0;
    padding: 32px;
    background: linear-gradient(0deg, rgba(36, 40, 102, 1) 0%, rgba(36, 40, 102, 0.94) 70%, rgba(36, 40, 102, 0.72) 100%);
}

.slide-kicker {
    color: var(--background);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.slide-copy h3 {
    max-width: 740px;
    font-size: 34px;
    line-height: 1.25;
}

.excerpt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    line-clamp: 6;
}

.slide-copy .excerpt {
    max-width: 740px;
}

.action-link,
.action-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
    padding: 9px 14px;
    border: 2px solid transparent;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.action-link {
    background: var(--background);
    color: var(--primary);
    transition: border-color 250ms ease;
}

.action-link:hover {
    border-color: var(--accent);
}

.slider-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
}

.slider-state {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 16px;
    min-width: 0;
    max-width: 330px;
}

.slide-count {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.position-line {
    flex: 1;
    min-width: 16px;
    height: 4px;
    background: rgba(220, 205, 237, 0.3);
}

.position-fill {
    display: block;
    width: 0;
    height: 100%;
    background: var(--background);
}

.position-line.at-end .position-fill {
    width: 100%;
}

.slide-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.arrow-button,
.play-button {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 6px;
    border: 2px solid transparent;
    background: var(--background);
    color: var(--primary);
    transition: border-color 250ms ease;
}

.arrow-button {
    border-radius: 4px;
}

.play-button {
    border-radius: 50%;
}

.arrow-button:hover:not(:disabled),
.play-button:hover:not(:disabled) {
    border-color: var(--accent);
}

.slider a:focus-visible,
.slider button:focus-visible,
.bottom-band a:focus-visible {
    outline-color: var(--background);
}

.slide-panel.enter-next {
    animation: slide-up-in 250ms ease both;
}

.slide-panel.enter-previous {
    animation: slide-down-in 250ms ease both;
}

.slide-panel.leave-next,
.slide-panel.leave-previous {
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
}

.slide-panel.leave-next {
    animation: slide-up-out 250ms ease both;
}

.slide-panel.leave-previous {
    animation: slide-down-out 250ms ease both;
}

@keyframes slide-up-in {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slide-up-out {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-100%);
    }
}

@keyframes slide-down-in {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slide-down-out {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

.topics {
    display: grid;
    gap: 18px;
    padding-block: 24px;
    border-block: 1px dotted var(--divider);
}

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

.entry-label {
    display: inline-block;
    max-width: 100%;
    padding: 7px 12px;
    border-radius: 4px;
    background: var(--paper);
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
}

.entry-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

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

.entry {
    display: block;
    min-width: 0;
    padding: 18px;
    border: 2px solid transparent;
    border-radius: 6px;
    background: var(--paper);
    box-shadow: 4px 4px 0 rgba(36, 40, 102, 0.24);
    text-align: left;
    transition: border-color 250ms ease;
}

.entry:hover {
    border-color: var(--accent);
}

.entry h3 {
    display: -webkit-box;
    overflow: hidden;
    color: var(--primary);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.entry .excerpt {
    margin-top: 14px;
}

.action-label {
    margin-top: 18px;
    margin-left: auto;
    background: var(--primary);
    color: var(--paper);
}

.reading-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
    gap: 18px;
    min-width: 0;
}

.entry-page {
    display: grid;
    gap: 32px;
    width: 100%;
    max-width: 654px;
    min-width: 0;
    margin-left: auto;
    margin-right: 0;
}

.entry-heading {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.path-links {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    font-size: 14px;
    line-height: 1.6;
}

.path-links a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.path-links [aria-current="page"] {
    color: var(--accent);
}

.path-divider {
    color: var(--accent);
}

.reading {
    min-width: 0;
    padding: 18px;
    border-radius: 6px;
    background: var(--paper);
    box-shadow: 5px 5px 0 rgba(36, 40, 102, 0.24);
}

.reading > * {
    max-width: 100%;
    margin-block: 0;
}

.reading > * + * {
    margin-block-start: 20px;
}

.reading h2 {
    color: var(--primary);
    font-size: 28px;
    line-height: 1.35;
}

.reading > h2:not(:first-child) {
    margin-block-start: 28px;
}

.reading h3 {
    color: var(--primary);
    font-size: 23px;
    line-height: 1.4;
}

.reading a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.reading ul,
.reading ol {
    padding-inline-start: 26px;
}

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

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

.reading li::marker {
    color: var(--accent);
}

.reading blockquote {
    margin-inline: 0;
    padding: 18px;
    border-radius: 4px;
    background: var(--background);
    color: var(--accent);
    font-size: 22px;
    font-weight: 500;
}

.reading blockquote::before {
    content: "“";
    display: block;
    line-height: 1;
    font-size: 56px;
    margin-block-end: 22px;
    font-weight: 600;
}

.reading blockquote > * + * {
    margin-top: 14px;
}

.reading cite {
    display: block;
    font-size: 16px;
    font-weight: 600;
}

.reading table {
    width: 100%;
    min-width: 500px;
    max-width: none;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.5;
}

.reading caption {
    padding-bottom: 12px;
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    caption-side: top;
}

.reading th,
.reading td {
    padding: 12px;
    border-bottom: 1px dotted var(--divider);
    text-align: left;
    vertical-align: top;
}

.reading th {
    background: var(--primary);
    color: var(--paper);
    font-weight: 600;
}

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

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

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

.notes {
    display: grid;
    gap: 18px;
    width: 260px;
    max-width: 100%;
    min-width: 0;
    padding: 18px;
    border-radius: 6px;
    background: var(--primary);
    color: var(--paper);
    box-shadow: 4px 4px 0 var(--accent);
    font-size: 16px;
}

.notes .section-mark {
    background: var(--background);
    color: var(--primary);
}

.notes h2 {
    color: var(--background);
    font-size: 22px;
    line-height: 1.35;
}

.notes ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: square;
}

.notes li + li {
    margin-top: 12px;
}

.note-summary {
    padding-top: 18px;
    border-top: 1px dotted var(--background);
    color: var(--background);
    font-size: 14px;
}

.bottom-band {
    width: 100%;
    padding-block: 24px;
    background: var(--primary);
    color: var(--background);
}

.bottom-band > .band-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-copy {
    max-width: 620px;
    font-size: 14px;
}

.footer-copy p + p {
    margin-top: 6px;
    font-size: 12px;
}

.bottom-band nav a {
    display: inline-block;
    padding: 8px 12px;
    border: 2px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.bottom-band nav a:hover,
.bottom-band nav a[aria-current="page"] {
    border-color: var(--background);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1000px) {
    .reading-columns {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .notes {
        width: 100%;
        max-width: 654px;
        margin-left: auto;
        margin-right: 0;
    }
}

@media (max-width: 840px) {
    body {
        font-size: 18px;
    }

    .top-band > .band-content {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 12px;
    }

    .to-main {
        grid-column: 1 / -1;
        grid-row: 1;
        padding-top: 8px;
        font-size: 12px;
    }

    .home-link {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        min-height: 56px;
    }

    .site-name {
        font-size: 20px;
    }

    .header-note,
    .nav-place {
        display: none;
    }

    .nav-trigger {
        grid-column: 2;
        grid-row: 2;
        display: flex;
    }

    h1 {
        font-size: 32px;
    }

    .section-line {
        flex-wrap: wrap;
    }

    .section-line h2 {
        font-size: 24px;
    }

    .section-line > p {
        width: 100%;
        max-width: none;
        margin-left: 0;
        text-align: left;
    }

    .slide-copy {
        padding: 24px;
    }

    .slide-copy h3 {
        font-size: 28px;
    }

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

    .topics {
        padding-block: 18px;
    }

    .reading h2 {
        font-size: 26px;
    }

    .reading blockquote {
        font-size: 20px;
    }
}

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

    .home-link {
        gap: 8px;
    }

    .home-link img {
        width: 32px;
        height: 32px;
    }

    .site-name {
        font-size: 17px;
    }

    .slide-copy {
        padding: 18px;
    }

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

    .slider-bottom {
        gap: 12px;
        padding: 14px;
    }

    .slider-state {
        gap: 8px;
    }

    .slide-count {
        font-size: 12px;
    }

    .arrow-button,
    .play-button {
        width: 42px;
        height: 42px;
        padding: 4px;
    }

    .bottom-band > .band-content {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .slide-panel {
        animation: none;
    }

    .entry,
    .action-link,
    .nav-tabs a,
    .arrow-button,
    .play-button,
    .nav-trigger,
    .close-navigation {
        transition: none;
    }
}
