/* ============================================================
   witch-trial.com — Scroll of Testimony
   Aesthetic: sepia toned history, victorian decorative
   Palette:
     #f0e6d2  parchment (background)
     #2a1f14  ink       (body text)
     #5a4a30  border    (woodcut frames)
     #8a7a60  aged      (marginalia, secondary)
     #6b1a1a  blood     (accusation, emphasis)
     #1a1408  scorched  (deepest black, burnt edge)
   ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #f0e6d2;
    color: #2a1f14;
    font-family: "Merriweather", Georgia, "Times New Roman", serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.85;
    /* faint paper grain via layered radial gradients on parchment */
    background-image:
        radial-gradient(at 13% 7%, rgba(90, 74, 48, 0.06) 0, transparent 35%),
        radial-gradient(at 87% 23%, rgba(107, 26, 26, 0.04) 0, transparent 30%),
        radial-gradient(at 23% 71%, rgba(138, 122, 96, 0.07) 0, transparent 38%),
        radial-gradient(at 71% 89%, rgba(26, 20, 8, 0.05) 0, transparent 40%),
        radial-gradient(at 50% 50%, rgba(240, 230, 210, 0) 0, rgba(180, 160, 120, 0.06) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* ----- Container: testimony scroll ----- */
.parchment {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    position: relative;
    overflow: visible;
}

@media (min-width: 800px) {
    .parchment {
        margin: 3.5rem auto;
        padding: 3rem 2rem 4rem;
    }
}

/* Burnt-edge effect at the bottom of the scroll */
.burnt-edge {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 240px;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(138, 122, 96, 0.10) 55%,
        rgba(107, 26, 26, 0.18) 78%,
        rgba(26, 20, 8, 0.55) 100%
    );
    mix-blend-mode: multiply;
}

body::after {
    /* deep scorched fade behind everything */
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 200px;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(26, 20, 8, 0.20) 80%,
        rgba(26, 20, 8, 0.40) 100%
    );
    z-index: 1;
}

/* ----- Typography ----- */
.display-title,
.chapter-title,
.colophon-title {
    font-family: "Cinzel", "Trajan Pro", "Times New Roman", serif;
    font-weight: 700;
    color: #2a1f14;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.15;
}

.display-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 900;
    text-align: center;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    color: #2a1f14;
    text-shadow: 0 1px 0 rgba(240, 230, 210, 0.5);
}

.chapter-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    text-align: center;
    margin: 0;
}

.colophon-title {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 1rem;
    color: #5a4a30;
}

/* Body paragraphs */
p {
    margin-bottom: 1.25rem;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

em {
    font-style: italic;
    color: #2a1f14;
}

strong {
    font-weight: 700;
    color: #2a1f14;
}

/* small-caps utility */
.small-caps {
    font-variant: small-caps;
    letter-spacing: 0.06em;
    color: #5a4a30;
}

.hex {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    color: #6b1a1a;
}

/* ----- Masthead ----- */
.masthead {
    text-align: center;
    padding: 2rem 0 1rem;
    border-bottom: 1px solid rgba(90, 74, 48, 0.35);
    margin-bottom: 2rem;
    position: relative;
}

.folio {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 0.85rem;
    color: #8a7a60;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.1rem;
    color: #5a4a30;
    text-align: center;
    margin-bottom: 1.5rem;
    letter-spacing: 0.04em;
}

.lede {
    font-family: "Merriweather", Georgia, serif;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.85;
    text-align: justify;
    color: #2a1f14;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.oath {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-size: 0.9rem;
    color: #8a7a60;
    text-align: center;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

/* ----- Ornamental dividers (◆ ◆ ◆) ----- */
.ornamental-divider,
.ornamental-rule {
    text-align: center;
    color: #8a7a60;
    font-size: 0.9rem;
    letter-spacing: 1.5em;
    margin: 3rem auto 3rem;
    text-indent: 1.5em; /* visually re-center because of letter-spacing */
    user-select: none;
}

.ornamental-rule {
    margin: 1rem auto;
    font-size: 0.75rem;
    letter-spacing: 1.2em;
    text-indent: 1.2em;
    color: #8a7a60;
}

/* ----- Chapters ----- */
.chapter {
    position: relative;
    margin-bottom: 3rem;
    padding-top: 1rem;
}

.chapter-eyebrow {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 0.85rem;
    color: #8a7a60;
    text-align: center;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

/* ----- Woodcut frame (chapter heading) ----- */
.woodcut-frame {
    border: 3px solid #5a4a30;
    padding: 2rem 1.25rem 1.5rem;
    position: relative;
    margin-bottom: 3rem;
    background:
        linear-gradient(rgba(240, 230, 210, 0.4), rgba(240, 230, 210, 0.4)),
        repeating-linear-gradient(
            45deg,
            rgba(90, 74, 48, 0.04) 0,
            rgba(90, 74, 48, 0.04) 2px,
            transparent 2px,
            transparent 6px
        );
    box-shadow:
        inset 0 0 0 1px rgba(240, 230, 210, 0.7),
        inset 0 0 0 5px transparent,
        inset 0 0 0 6px rgba(90, 74, 48, 0.6);
}

.woodcut-frame::before,
.woodcut-frame::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    background: #5a4a30;
    transform: rotate(45deg);
    border: 2px solid #f0e6d2;
}

.woodcut-frame::before {
    top: -8px;
    left: -8px;
}

.woodcut-frame::after {
    bottom: -8px;
    right: -8px;
}

/* second pair of corner ornaments via the eyebrow-and-title containers */
.woodcut-frame > .chapter-eyebrow::before,
.woodcut-frame > .chapter-eyebrow::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #6b1a1a;
    transform: rotate(45deg);
    margin: 0 0.85rem -0.05em;
    vertical-align: middle;
}

/* ----- Marginalia (date stamps in left margin) ----- */
.marginalia {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-weight: 500;
    color: #8a7a60;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

@media (min-width: 880px) {
    .marginalia {
        position: absolute;
        left: -110px;
        width: 100px;
        text-align: right;
        margin: 0;
        padding-top: 0.4em;
        line-height: 1.3;
        border-right: 1px solid rgba(138, 122, 96, 0.5);
        padding-right: 0.6rem;
    }
}

.marginalia + p {
    margin-top: 0;
}

/* ----- Drop-cap (lead letter) ----- */
.lead-letter {
    margin-top: 0;
}

.drop-cap {
    font-family: "Cinzel", "Trajan Pro", serif;
    font-weight: 700;
    float: left;
    font-size: 4.5rem;
    line-height: 0.85;
    padding: 0.45rem 0.6rem 0 0;
    color: #6b1a1a;
    text-shadow: 1px 1px 0 rgba(90, 74, 48, 0.18);
}

/* ----- Testimony quotes ----- */
.testimony {
    border-left: 3px solid #6b1a1a;
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 2rem 0 2rem 0.5rem;
    font-style: italic;
    color: #2a1f14;
    position: relative;
    background:
        linear-gradient(to right, rgba(107, 26, 26, 0.05), transparent 80%);
}

.testimony::before {
    content: "\201C";
    position: absolute;
    left: 0.4rem;
    top: -0.6rem;
    font-family: "Cinzel", serif;
    font-weight: 700;
    color: #6b1a1a;
    font-size: 2rem;
    line-height: 1;
    background: #f0e6d2;
    padding: 0 0.2rem;
}

.testimony p {
    margin-bottom: 0.6rem;
    font-size: 1.05rem;
    line-height: 1.7;
    text-align: left;
    text-indent: 0.5em;
}

.testimony-cite {
    display: block;
    font-style: normal;
    font-family: "EB Garamond", Georgia, serif;
    font-size: 0.85rem;
    color: #8a7a60;
    letter-spacing: 0.04em;
    text-align: right;
    margin-top: 0.4rem;
}

/* ----- Accused (inline marker) ----- */
.accused {
    color: #6b1a1a;
    font-weight: 700;
    font-style: italic;
    border-bottom: 1px dotted rgba(107, 26, 26, 0.55);
    padding: 0 0.05em;
}

/* ----- Enumerated list (mechanics) ----- */
.enumerated {
    list-style: none;
    padding-left: 0;
    margin: 1.5rem 0;
    counter-reset: roman;
}

.enumerated li {
    position: relative;
    padding: 0.6rem 0 0.6rem 0;
    border-bottom: 1px dotted rgba(90, 74, 48, 0.3);
    line-height: 1.65;
}

.enumerated li:last-child {
    border-bottom: none;
}

.enum-marker {
    font-family: "Cinzel", serif;
    font-weight: 700;
    color: #6b1a1a;
    margin-right: 0.85rem;
    letter-spacing: 0.05em;
    display: inline-block;
    min-width: 2.4em;
}

/* ----- Roll of names ----- */
.roll-preface,
.roll-coda {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    color: #5a4a30;
    text-align: center;
    margin: 1rem auto 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 480px;
}

.roll {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    border-top: 1px solid rgba(90, 74, 48, 0.4);
    border-bottom: 1px solid rgba(90, 74, 48, 0.4);
}

.roll li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.7rem 0.25rem;
    border-bottom: 1px dotted rgba(90, 74, 48, 0.3);
}

.roll li:last-child {
    border-bottom: none;
}

.roll-name {
    font-family: "Cinzel", serif;
    font-weight: 400;
    font-size: 0.95rem;
    color: #2a1f14;
    letter-spacing: 0.06em;
}

.roll-date {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-size: 0.85rem;
    color: #8a7a60;
    text-align: right;
    flex-shrink: 0;
}

/* ----- Archive list (definition list) ----- */
.archive-list {
    margin: 1.5rem 0;
}

.archive-list dt {
    font-family: "Cinzel", serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #2a1f14;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 1.5rem;
    border-bottom: 1px solid rgba(90, 74, 48, 0.4);
    padding-bottom: 0.25rem;
}

.archive-list dt:first-child {
    margin-top: 0;
}

.archive-list dd {
    font-family: "EB Garamond", Georgia, serif;
    font-size: 0.95rem;
    color: #5a4a30;
    margin: 0.4rem 0 0 0;
    line-height: 1.6;
    font-style: italic;
}

/* ----- Colophon ----- */
.colophon {
    margin-top: 4rem;
    padding: 2rem 1rem 2rem;
    border-top: 3px double #5a4a30;
    border-bottom: 3px double #5a4a30;
    text-align: center;
    background:
        linear-gradient(to bottom, rgba(240, 230, 210, 0), rgba(26, 20, 8, 0.05));
}

.colophon p {
    text-align: center;
    font-size: 0.95rem;
    color: #5a4a30;
    margin-bottom: 1rem;
}

.colophon-stamp {
    font-family: "Cinzel", serif;
    font-size: 0.8rem;
    line-height: 1.6;
    margin-top: 1.5rem !important;
    color: #6b1a1a !important;
    letter-spacing: 0.12em;
}

.closing-oath {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    color: #8a7a60 !important;
    margin-top: 1rem !important;
    font-size: 0.95rem;
}

/* ----- Return-to-top ----- */
.to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-size: 0.85rem;
    color: #2a1f14;
    background: rgba(240, 230, 210, 0.92);
    border: 1px solid #5a4a30;
    padding: 0.45rem 0.85rem;
    text-decoration: none;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 0 rgba(90, 74, 48, 0.4);
}

.to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.to-top:hover {
    background: #f0e6d2;
    color: #6b1a1a;
}

/* ----- Reveal animation (chapters fade-in as the scroll unrolls) ----- */
.chapter,
.colophon,
.masthead .lede,
.masthead .oath {
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.is-hidden {
    opacity: 0;
    transform: translateY(1.25rem);
}

.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ----- Selection: looks like a quill underline ----- */
::selection {
    background: rgba(107, 26, 26, 0.25);
    color: #1a1408;
}

/* ----- Reduced motion: no transitions ----- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

    html {
        scroll-behavior: auto;
    }

    .is-hidden {
        opacity: 1;
        transform: none;
    }
}

/* ----- Narrow viewports: collapse marginalia inline ----- */
@media (max-width: 879px) {
    .parchment {
        padding: 1.25rem 1.25rem 3rem;
    }

    .marginalia {
        display: inline-block;
        background: rgba(138, 122, 96, 0.12);
        padding: 0.15rem 0.5rem;
        border-left: 2px solid #8a7a60;
        font-size: 0.72rem;
        margin-bottom: 0.5rem;
    }

    .ornamental-divider,
    .ornamental-rule {
        letter-spacing: 1em;
        text-indent: 1em;
    }

    .roll li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .roll-date {
        text-align: left;
        font-size: 0.8rem;
    }

    .drop-cap {
        font-size: 3.5rem;
        padding: 0.4rem 0.45rem 0 0;
    }
}

/* ----- Print: clean parchment ----- */
@media print {
    body {
        background: #f0e6d2;
    }

    .to-top,
    .burnt-edge {
        display: none;
    }

    .chapter,
    .colophon {
        page-break-inside: avoid;
    }
}
