:root {
    --ink: #2e241b;
    --ink-soft: #655542;
    --faded: #8a765d;
    --paper: #d8c9a8;
    --paper-light: #e6d9bb;
    --paper-shadow: #b4a17b;
    --rule: rgba(70, 52, 35, 0.48);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: #302a21;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: clamp(10px, 2vw, 24px);
    color: var(--ink);
    font-family: "IM Fell English", Georgia, serif;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 245, 214, 0.08), transparent 42%),
        #302a21;
}

.book-page {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: calc(100vh - clamp(20px, 4vw, 48px));
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(30px, 5vw, 68px) clamp(24px, 7vw, 90px) clamp(22px, 4vw, 46px);
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(71, 49, 26, 0.12), transparent 8%, transparent 92%, rgba(71, 49, 26, 0.1)),
        radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.25), transparent 25%),
        radial-gradient(circle at 82% 76%, rgba(104, 70, 34, 0.12), transparent 31%),
        var(--paper);
    border: 1px solid #807054;
    box-shadow: 0 18px 60px rgba(9, 7, 4, 0.48), inset 0 0 80px rgba(91, 65, 32, 0.14);
}

.book-page::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: 0.32;
    pointer-events: none;
    background-image:
        repeating-radial-gradient(circle at 24% 32%, transparent 0 2px, rgba(55, 37, 22, 0.08) 3px, transparent 4px),
        repeating-linear-gradient(87deg, transparent 0 4px, rgba(255, 255, 255, 0.035) 5px, transparent 7px);
    background-size: 37px 41px, 17px 100%;
    mix-blend-mode: multiply;
}

.book-page::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 10px;
    border: 1px solid rgba(69, 50, 31, 0.25);
    pointer-events: none;
}

.page-rule {
    position: absolute;
    top: 20px;
    right: 20px;
    bottom: 20px;
    left: 20px;
    border: 1px solid var(--rule);
    pointer-events: none;
}

.page-rule::before,
.page-rule::after {
    content: "❦";
    position: absolute;
    left: 50%;
    padding: 0 12px;
    color: var(--faded);
    font-size: 17px;
    line-height: 1;
    background: var(--paper);
    transform: translateX(-50%);
}

.page-rule::before {
    top: -8px;
}

.page-rule::after {
    bottom: -8px;
    transform: translateX(-50%) rotate(180deg);
}

.masthead,
footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: var(--ink-soft);
    text-transform: uppercase;
}

.masthead {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--rule);
    font-size: 0.66rem;
    letter-spacing: 0.18em;
}

.masthead p,
footer span {
    margin: 0;
}

.established span {
    margin-right: 0.5em;
    font-style: italic;
    text-transform: none;
}

.title-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(100%, 760px);
    margin: 0 auto;
    padding: clamp(64px, 9vh, 104px) 0 clamp(48px, 7vh, 78px);
    text-align: center;
}

.flourish {
    display: grid;
    grid-template-columns: minmax(38px, 95px) auto minmax(38px, 95px);
    align-items: center;
    gap: 14px;
    width: min(70%, 280px);
    margin-bottom: 27px;
    color: var(--faded);
}

.flourish span {
    height: 1px;
    background: currentColor;
}

.flourish b {
    font-size: 0.65rem;
    font-weight: 400;
}

h1 {
    margin: 0;
    font-family: "Libre Caslon Display", "Times New Roman", serif;
    font-size: clamp(4.2rem, 12vw, 9.4rem);
    font-weight: 400;
    line-height: 0.82;
    letter-spacing: -0.055em;
    text-shadow: 0.035em 0.045em 0 rgba(117, 89, 55, 0.14);
    animation: reveal 900ms ease-out both;
}

.label-type {
    width: min(92%, 600px);
    margin: clamp(20px, 3vw, 31px) 0 0;
    padding: 13px 0 10px;
    border-top: 3px double var(--rule);
    border-bottom: 1px solid var(--rule);
    color: var(--ink-soft);
    font-size: clamp(0.78rem, 1.6vw, 1rem);
    letter-spacing: clamp(0.35em, 1vw, 0.68em);
    line-height: 1;
    text-indent: 0.68em;
    text-transform: uppercase;
    animation: reveal 900ms 120ms ease-out both;
}

.declaration {
    margin: clamp(35px, 5vw, 52px) 0 0;
    font-size: clamp(1.25rem, 2.8vw, 1.8rem);
    font-style: italic;
    letter-spacing: 0.035em;
    animation: reveal 900ms 220ms ease-out both;
}

.colophon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 27px 0 22px;
    color: var(--ink-soft);
    font-size: 1.75rem;
    border: 1px solid var(--rule);
    transform: rotate(45deg);
}

.colophon span {
    transform: rotate(-45deg);
}

.notice {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.74rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.contact {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 29px;
    padding: 3px 8px 5px;
    color: var(--ink);
    font-size: 1rem;
    text-decoration-color: var(--faded);
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
    transition: color 180ms ease, transform 180ms ease;
}

.contact span {
    color: var(--faded);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.contact:hover {
    color: #6a2f22;
    transform: translateY(-2px);
}

.contact:focus-visible {
    outline: 1px solid var(--ink);
    outline-offset: 5px;
}

footer {
    padding-top: 16px;
    border-top: 1px solid var(--rule);
    font-size: 0.56rem;
    letter-spacing: 0.2em;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    body {
        padding: 0;
    }

    .book-page {
        min-height: 100vh;
        padding: 38px 31px 29px;
        border: 0;
    }

    .book-page::after {
        inset: 7px;
    }

    .page-rule {
        inset: 14px;
    }

    .masthead {
        justify-content: center;
    }

    .edition {
        display: none;
    }

    .title-page {
        padding: 62px 0 50px;
    }

    h1 {
        font-size: clamp(3.75rem, 20vw, 5.6rem);
    }

    .notice {
        max-width: 260px;
        line-height: 1.8;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
