/* nextchapter.cz: the maker's page for the three sites. Fonts and pictures are
   its own files; the clips and the live release list come from
   bookreleasecalendar.com. Light by default, dark through prefers-color-scheme.
   The strips scroll by hand until hub.js turns them into slow loops. */

@font-face {
    font-family: "Cinzel";
    src: url("fonts/cinzel-latin.woff2") format("woff2");
    font-weight: 400 900;
    font-display: swap;
}

@font-face {
    font-family: "Crimson Pro";
    src: url("fonts/crimson-pro-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Crimson Pro";
    src: url("fonts/crimson-pro-latin-ext-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Crimson Pro";
    src: url("fonts/crimson-pro-latin-600-normal.woff2") format("woff2");
    font-weight: 600;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Crimson Pro";
    src: url("fonts/crimson-pro-latin-ext-600-normal.woff2") format("woff2");
    font-weight: 600;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Crimson Pro";
    src: url("fonts/crimson-pro-latin-400-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Crimson Pro";
    src: url("fonts/crimson-pro-latin-ext-400-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* The logo family's green, parchment, gold and oak (docs/brand/logos). */
:root {
    --page: #FFFCF3;
    --band: #F6F0E1;
    --ink: #16382A;
    --ink-soft: #46594E;
    --line: #DDD2B8;
    --gold: #85632A;
    --moved: #0F2A20;
    --moved-ink: #EFE3C7;
    --moved-link: #D2AC60;
    --button: #16382A;
    --button-ink: #F6F0E1;
    --phone: #0F2A20;
    --shadow: rgb(15 42 32 / 0.25);
    --wood: #B98F51;
    --wood-top: #CDA767;
    --wood-edge: #9D7843;
    --spine-dark: #16382A;
    --spine-light: #EFE3C7;
    --serif: "Crimson Pro", Georgia, "Times New Roman", serif;
    --display: "Cinzel", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --page: #0F2A20;
        --band: #17382B;
        --ink: #EFE3C7;
        --ink-soft: #BFC9B8;
        --line: #2F4D3F;
        --gold: #D2AC60;
        --moved: #D2AC60;
        --moved-ink: #0F2A20;
        --moved-link: #0F2A20;
        --button: #EFE3C7;
        --button-ink: #0F2A20;
        --phone: #081A13;
        --shadow: rgb(0 0 0 / 0.45);
        --wood: #C29A5A;
        --wood-top: #D8B676;
        --wood-edge: #A88148;
    }
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 400 1.1875rem/1.5 var(--serif);
    overflow-x: hidden;
}

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

h1,
h2,
p {
    margin: 0;
}

h1,
h2 {
    font-weight: 600;
    line-height: 1.1;
    text-wrap: balance;
}

a {
    color: inherit;
    text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible,
.carousel:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.wrap {
    max-width: 71rem;
    margin: 0 auto;
    padding-inline: 1.25rem;
}

.moved {
    background: var(--moved);
    color: var(--moved-ink);
    font-size: 1rem;
    line-height: 1.35;
}

.moved .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    align-items: baseline;
    padding-block: 0.65rem;
}

.moved a {
    color: var(--moved-link);
    font-weight: 600;
    white-space: nowrap;
}

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 1.1rem;
}

.maker {
    font: 700 1.05rem/1 var(--display);
    letter-spacing: 0.06em;
}

.lang {
    display: flex;
    border: 1px solid currentColor;
    border-radius: 999px;
    overflow: hidden;
    font-size: 0.95rem;
    line-height: 1;
}

.lang > * {
    padding: 0.45rem 0.8rem;
    text-decoration: none;
}

/* The page's own language is a label, not a link: a link back to the same
   page would load it again from the start. */
.lang [aria-current="page"] {
    background: var(--ink);
    color: var(--page);
}

.btn {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.5rem 1.35rem;
    border-radius: 999px;
    background: var(--button);
    color: var(--button-ink);
    font-weight: 600;
    font-size: 1.0625rem;
    text-decoration: none;
}

.more {
    display: block;
    margin-top: 0.9rem;
    color: var(--ink-soft);
}

.cover {
    border-radius: 3px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    height: auto;
}

/* Hero: three phones playing the real clips. Aligned to the top, because the
   Czech text is taller: centred, the phones jumped when the language changed. */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 3rem;
    align-items: start;
    padding-block: 2rem 4rem;
}

.hero h1 {
    font-size: clamp(2.4rem, 5.6vw, 4.2rem);
}

.hero p {
    margin-top: 1.1rem;
    font-size: 1.3rem;
    color: var(--ink-soft);
    max-width: 30rem;
}

.jump {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.7rem;
}

.jump a {
    font-size: 1.2rem;
    text-decoration: none;
}

.jump b {
    font-weight: 600;
    text-decoration: underline;
}

.jump b + span {
    color: var(--ink-soft);
    white-space: nowrap;
}

.phones {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phones > .lift {
    flex: none;
    width: 11.5rem;
    border-radius: 1.7rem;
}

.phone {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border: 6px solid var(--phone);
    border-radius: 1.7rem;
    background: var(--phone);
}

.phones > .lift {
    box-shadow: 0 18px 34px var(--shadow);
}

.phones > .lift:nth-child(1) {
    transform: rotate(-5deg) translateX(1.6rem);
}

.phones > .lift:nth-child(2) {
    width: 13.5rem;
    z-index: 1;
}

.phones > .lift:nth-child(3) {
    transform: rotate(5deg) translateX(-1.6rem);
}

/* One section per site */
.site {
    padding-top: 3.5rem;
    border-top: 1px solid var(--line);
}

.site .head {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1.5rem 4rem;
    align-items: end;
    padding-bottom: 2.25rem;
}

.site .logo {
    width: auto;
    height: 6rem;
    margin-left: -0.35rem;
}

.when {
    font-style: italic;
    color: var(--gold);
    font-size: 1.15rem;
    margin-top: 0.9rem;
}

.site h2 {
    font-size: clamp(1.8rem, 3.6vw, 2.6rem);
    margin-top: 0.25rem;
}

.say p {
    color: var(--ink-soft);
    font-size: 1.25rem;
}

.say .btn {
    margin-top: 1.1rem;
}

.strip {
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--band);
    border-block: 1px solid var(--line);
}

.strip::-webkit-scrollbar {
    display: none;
}

.track {
    display: flex;
    width: max-content;
}

/* Moved by hub.js: a sideways finger is the strip's, an upright one the page's. */
.strip.is-looping {
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    -webkit-user-select: none;
    user-select: none;
}

/* Calendar: release days in a row, the books under their day */
.ribbon .track {
    padding-block: 1.75rem 2rem;
}

.day {
    flex: none;
    padding-inline: 1.75rem;
    border-left: 1px solid var(--line);
}

.day time {
    display: block;
}

.day b {
    display: block;
    font-size: 2.1rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.day time span {
    display: block;
    color: var(--ink-soft);
    font-size: 1rem;
    margin-top: 0.15rem;
}

.day .books {
    display: flex;
    gap: 1.1rem;
    margin-top: 1rem;
}

.day .books a {
    display: block;
    width: 6.5rem;
    text-decoration: none;
}

.caption {
    display: block;
    margin-top: 0.55rem;
    font-size: 0.95rem;
    line-height: 1.2;
    font-weight: 600;
}

.caption i {
    display: block;
    font-weight: 400;
    color: var(--ink-soft);
}

.today b {
    color: var(--gold);
}

.today p {
    margin-top: 1rem;
    width: 6.5rem;
    font-size: 0.95rem;
    line-height: 1.25;
    font-weight: 600;
}

/* Bookshelf Maker: one long oak plank */
.plankstrip {
    background: var(--page);
    border: 0;
}

.plankstrip .track {
    align-items: flex-end;
    gap: 2px;
    /* The gap after the last book, so both halves of the loop are equally wide. */
    padding: 1rem 2px 0 0;
}

.spine {
    flex: none;
    display: flex;
    align-items: center;
    width: var(--w);
    height: var(--h);
    padding-block: 0.5rem;
    overflow: hidden;
    border-radius: 2px 2px 0 0;
    background: var(--spine);
    color: var(--spine-ink);
    writing-mode: vertical-rl;
    font-size: 0.7rem;
    line-height: 1;
    white-space: nowrap;
    box-shadow: inset -3px 0 5px rgb(0 0 0 / 0.25), inset 2px 0 2px rgb(255 255 255 / 0.12);
}

.plankstrip .lift {
    flex: none;
    margin-inline: 4px;
}

.plankstrip .cover {
    width: auto;
    height: 11.5rem;
}

.plank {
    height: 20px;
    background: linear-gradient(var(--wood-top), var(--wood));
    border-bottom: 6px solid var(--wood-edge);
    box-shadow: 0 10px 14px var(--shadow);
}

/* Bookshelf Templates: a carousel of real cards */
.carousel {
    display: flex;
    gap: 1.1rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 1.75rem max(1.25rem, calc((100vw - 71rem) / 2 + 1.25rem)) 2rem;
    scrollbar-width: none;
    background: var(--band);
    border-block: 1px solid var(--line);
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel > .lift {
    flex: none;
    border-radius: 8px;
    scroll-snap-align: start;
    box-shadow: 0 10px 22px var(--shadow);
}

.carousel img {
    width: auto;
    height: 24rem;
}

/* Hover, as a tracked book does on the calendar: the picture rises, its
   shadow deepens and a soft light passes over it. A spine is its own frame.
   The frame carries the shadow and clips the light, so the light can slide
   with a transform: moving a background instead repaints the picture on
   every frame, which stutters on a strip that is itself moving. The frame's
   colour shows until its picture has loaded. */
.lift {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 3px;
    background: var(--line);
    box-shadow: 0 6px 14px var(--shadow);
}

.lift,
.spine {
    transition: translate 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lift::after,
.spine::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 25%, rgb(255 255 255 / 0.28) 45%, rgb(255 255 255 / 0.08) 55%, transparent 75%);
    transform: translateX(-100%);
    transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.spine {
    position: relative;
}

@media (hover: hover) {
    .lift:hover,
    a:focus-visible .lift,
    .spine:hover {
        translate: 0 -8px;
    }

    .lift:hover::after,
    a:focus-visible .lift::after,
    .spine:hover::after {
        transform: translateX(100%);
    }

    .lift:hover,
    a:focus-visible .lift {
        box-shadow: 0 26px 36px -12px var(--shadow), 0 10px 18px -8px var(--shadow);
    }

    .phones > .lift:hover {
        box-shadow: 0 34px 48px -10px var(--shadow), 0 14px 22px -8px var(--shadow);
    }
}

/* The maker */
.maker-note {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 40rem);
    gap: 1.5rem;
    align-items: start;
    padding-block: 4rem 1rem;
}

.maker-note img {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.maker-note h2 {
    font-size: 1.6rem;
    margin-bottom: 0.6rem;
}

.maker-note p {
    color: var(--ink-soft);
}

.maker-note .love {
    margin-top: 0.6rem;
    color: var(--ink);
    font-style: italic;
}

.foot {
    display: grid;
    gap: 0.75rem;
    padding-block: 2.5rem 3rem;
    font-size: 1rem;
    color: var(--ink-soft);
}

.legal {
    display: grid;
    gap: 0.5rem;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    cursor: pointer;
}

.consent {
    position: fixed;
    inset: auto 1rem 1rem;
    z-index: 20;
    max-width: 26rem;
    margin-left: auto;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--band);
    color: var(--ink);
    box-shadow: 0 10px 30px var(--shadow);
}

.consent[hidden] {
    display: none;
}

.consent p {
    margin: 0 0 0.75rem;
}

.consent-title {
    font-family: var(--display);
    font-weight: 600;
}

.consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.consent .btn {
    border: 1px solid var(--button);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn-quiet {
    background: none;
    color: var(--ink);
}

@media (max-width: 760px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
        padding-block: 1rem 2.5rem;
    }

    .phones > .lift {
        width: 31%;
        border-radius: 1.2rem;
    }

    .phone {
        border-width: 4px;
        border-radius: 1.2rem;
    }

    .phones > .lift:nth-child(2) {
        width: 36%;
    }

    .phones > .lift:nth-child(1) {
        transform: rotate(-4deg) translateX(0.6rem);
    }

    .phones > .lift:nth-child(3) {
        transform: rotate(4deg) translateX(-0.6rem);
    }

    .site {
        padding-top: 2.5rem;
    }

    .site .head {
        grid-template-columns: minmax(0, 1fr);
        padding-bottom: 1.75rem;
    }

    .site .logo {
        height: 4.75rem;
    }

    .day {
        padding-inline: 1.1rem;
    }

    .day .books a,
    .today p {
        width: 5.4rem;
    }

    .spine {
        height: calc(var(--h) - 1.8rem);
    }

    .plankstrip .cover {
        height: 9.5rem;
    }

    .carousel img {
        height: 19rem;
    }

    .maker-note {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 3rem;
    }
}

/* EN and CZ are two pages. hub.js changes the words in place; where it cannot,
   the browser fades from one page to the other instead of showing an empty one. */
@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lift,
    .spine,
    .lift > img,
    .lift > video,
    .lift::after,
    .spine::after {
        transition: none;
    }
}
