@font-face {
    font-family: Fredoka;
    src: url("fonts/Fredoka-500.ttf") format("truetype");
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: Fredoka;
    src: url("../countries/fonts/Fredoka-600.ttf") format("truetype");
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: Fredoka;
    src: url("fonts/Fredoka-650.ttf") format("truetype");
    font-weight: 650;
    font-display: swap;
}

@font-face {
    font-family: Nunito;
    src: url("../countries/fonts/Nunito-650.ttf") format("truetype");
    font-weight: 650;
    font-display: swap;
}

:root {
    color-scheme: light;
    --ink: #142d3f;
    --rule: #e3dac7;
    --book-blue: #2f5d9e;
    --book-orange: #bd5817;
    --muted: #71634e;
    --paper: #fbf6ec;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f5f1e8;
    color: var(--ink);
    font: 1rem/1.5 "Segoe UI", sans-serif;
}

a { color: inherit; }

:focus-visible {
    outline: 2px solid var(--book-blue);
    outline-offset: 4px;
}

.wrap { width: min(72rem, calc(100% - 2rem)); margin-inline: auto; }
.site-header { background: #fffdf8; border-block-end: 1px solid var(--rule); }

.masthead {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .55rem 1rem;
    padding-block: .8rem;
}

.brand {
    display: inline-flex;
    gap: .65rem;
    align-items: center;
    font: clamp(1rem, 4.5vw, 1.2rem)/1.2 Georgia, serif;
    text-decoration: none;
}

.brand img { border-radius: 50%; }

.catalogue {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding-inline: .8rem;
    border: 1px solid var(--rule);
    border-radius: .5rem;
    background: #fffdf8;
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}

.catalogue:hover { background: #f3ece0; }
.book-preview { padding-block: 1.25rem 3rem; }

.preview-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .25rem 1rem;
    margin-block-end: 1rem;
    font-size: .9rem;
}

.preview-label { color: var(--muted); font-weight: 600; }
.preview-tools nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }

.preview-tools nav a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    text-decoration-color: #8b9ca8;
    text-underline-offset: .25em;
}

.preview-tools nav a:hover { color: var(--book-blue); text-decoration-color: currentColor; }
.book-spread { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }

.book-page {
    container-type: inline-size;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    aspect-ratio: 1;
    border: 1px solid var(--rule);
    border-radius: .6rem;
    background: var(--paper);
    box-shadow: 0 4px 16px #5339180c;
    text-align: center;
    scroll-margin-block-start: 1rem;
}

.cover { overflow: hidden; background: #fbf3e2; }

.cover :is(h1, h2) {
    margin: 5.4cqw .5rem 0;
    color: var(--book-blue);
    font: 650 max(1.4rem, 7.52cqw)/1.02 Fredoka, "Segoe UI", sans-serif;
}

.cover :is(h1, h2) span { display: block; color: var(--book-orange); font-size: .87em; }

.cover-subtitle {
    margin: 2.85cqw .5rem 0;
    color: var(--muted);
    font: 500 max(.7rem, 2.45cqw)/1.2 Fredoka, "Segoe UI", sans-serif;
    letter-spacing: .065em;
}

.cover-art {
    width: 66cqw;
    height: auto;
    margin-block-start: 3cqw;
    border-radius: 4.1cqw;
    box-shadow: 0 4px 12px #503c1e2e;
}

.cover-band {
    position: absolute;
    inset: auto 0 0;
    height: 2.6cqw;
    background: linear-gradient(90deg,
        #e8833a 0 16.67%, #5b8fa8 16.67% 33.33%, #c8342f 33.33% 50%,
        #6e5baa 50% 66.67%, #2e9e4f 66.67% 83.33%, #d6587a 83.33%);
}

.sample-art {
    width: 73cqw;
    height: auto;
    margin-block-start: 8.2cqw;
    border-radius: 2.94cqw;
}

.sample-copy { width: 88cqw; margin-block-start: 3.6cqw; }

.sample h2 {
    margin: 0 0 1.5cqw;
    color: var(--book-blue);
    font: 600 max(1.55rem, 4.9cqw)/1.15 Fredoka, "Segoe UI", sans-serif;
}

.sample-copy p {
    margin: 0;
    color: #3b3a4a;
    font: 650 max(1.1rem, 2.95cqw)/1.42 Nunito, "Segoe UI", sans-serif;
}

.page-number {
    margin: auto 0 3.7cqw;
    padding-block-start: 4cqw;
    color: var(--muted);
    font: 500 max(.75rem, 1.8cqw)/1 Fredoka, "Segoe UI", sans-serif;
}

@media (max-width: 68rem) {
    .book-preview { max-width: 37rem; }
    .book-spread { grid-template-columns: minmax(0, 1fr); }
    .sample { aspect-ratio: auto; }
    .sample-art { width: 84cqw; margin-block-start: 6cqw; }
    .sample-copy { width: 93cqw; margin-block-start: 5cqw; }
    .sample h2 { margin-block-end: .65rem; }
    .page-number { margin-block-end: 1.1rem; padding-block-start: 1.35rem; }
}

@media (max-width: 23rem) {
    .brand img { width: 29px; height: 29px; }
    .catalogue { padding-inline: .65rem; }
}
