@import url("https://fonts.googleapis.com/css2?family=Cherry+Cream+Soda&display=swap");

:root {
    --blue: #28aee4;
    --deep-blue: #085d8d;
    --pink: #ff62ec;
    --gold: #ffb63d;
    --green: #8ccb3f;
    --ink: #143d56;
    --soft: #ecfbfb;
    --white: #ffffff;
    --shadow: 0 18px 45px rgba(9, 84, 126, 0.14);
    --display-font: "Cooper Black", "Cooper Std Black", "Cooper Black Std", "Cherry Cream Soda", Georgia, serif;
    --body-font: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--white);
    font-family: var(--body-font);
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--display-font);
    font-weight: 700;
}

.page {
    width: min(1780px, calc(100% - 48px));
    margin: 34px auto 80px;
}

.layout {
    display: grid;
    grid-template-columns: 405px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.sidebar-actions {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.story-card {
    width: 100%;
    padding: 16px 22px 26px;
    border: 2px solid var(--blue);
    border-radius: 6px;
    background: var(--soft);
    text-align: center;
}

.logo {
    display: block;
    width: min(100%, 362px);
    height: auto;
    margin: 0 auto 12px;
}

.story-card label,
.script-title {
    display: block;
    margin: 0 0 14px;
    color: var(--pink);
    font-family: var(--display-font);
    font-size: clamp(2rem, 2.5vw, 2.65rem);
    font-weight: 700;
    line-height: 1;
}

.story-card input {
    width: 100%;
    min-height: 57px;
    margin-bottom: 18px;
    padding: 10px 14px;
    border: 2px solid var(--blue);
    border-radius: 6px;
    background: var(--white);
    color: var(--ink);
    font-size: 1.25rem;
    text-align: center;
}

.btn {
    display: inline-flex;
    min-height: 63px;
    width: 244px;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--blue);
    border-radius: 7px;
    color: var(--white);
    font-family: var(--display-font);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
    transition: transform 160ms ease, filter 160ms ease;
}

.btn:hover,
.btn:focus-visible {
    filter: brightness(1.04);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--blue);
    border-color: var(--blue);
    width: min(100%, 244px);
}

.btn-gold {
    background: var(--gold);
}

.btn-green {
    background: var(--green);
}

.donate {
    text-align: center;
}

.donate img {
    display: block;
    width: 138px;
    height: auto;
    margin: 6px auto;
}

.library-link {
    display: block;
    max-width: 230px;
    text-align: center;
    text-decoration: none;
}

.library-link span {
    display: block;
    margin-bottom: 8px;
    color: var(--blue);
    font-family: var(--display-font);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.08;
}

.library-link img {
    width: 165px;
    height: auto;
}

.nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px clamp(4px, 0.8vw, 18px);
    justify-content: center;
    margin: 54px 0 48px;
    color: var(--blue);
    font-family: var(--display-font);
    font-size: clamp(2.125rem, calc(4.9vw - 2.45rem), 3rem);
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.nav a {
    display: inline-block;
    max-width: 100%;
    justify-self: center;
    text-decoration: none;
    white-space: nowrap;
}

.nav-compact {
    display: none;
}

.mosaic {
    display: grid;
    grid-template-columns: 1fr 1.12fr 0.93fr;
    grid-template-rows: 280px 332px 287px;
    gap: 10px;
}

.panel {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 160px;
    background: #d9eef5;
    color: var(--white);
    text-decoration: none;
    box-shadow: none;
}

.panel img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease, filter 300ms ease;
}

.panel::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(135deg, rgba(40, 174, 228, 0.62), rgba(8, 93, 141, 0.72));
    opacity: 0;
    transition: opacity 220ms ease;
}

.panel-copy {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    opacity: 0;
    text-align: center;
    text-shadow: 0 3px 12px rgba(0, 50, 82, 0.62);
    transform: translateY(8px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.panel h2 {
    margin: 0;
    font-size: clamp(1.55rem, 2.2vw, 2.4rem);
    line-height: 1.03;
}

.panel p {
    max-width: 26rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.panel:hover::after,
.panel:focus-visible::after,
.panel:hover .panel-copy,
.panel:focus-visible .panel-copy {
    opacity: 1;
}

.panel:hover .panel-copy,
.panel:focus-visible .panel-copy {
    transform: translateY(0);
}

.panel:hover img,
.panel:focus-visible img {
    transform: scale(1.035);
    filter: saturate(1.04);
}

.mission-reader {
    grid-area: 1 / 1 / 2 / 2;
}

.books-at-home {
    grid-area: 2 / 1 / 4 / 2;
}

.child-reading {
    grid-area: 1 / 2 / 3 / 3;
}

.book-magic {
    grid-area: 1 / 3 / 2 / 4;
}

.generations-reading {
    grid-area: 2 / 3 / 3 / 4;
}

.book-club {
    grid-area: 3 / 2 / 4 / 4;
}

.book-art {
    width: min(1500px, 82%);
    margin: 78px auto 0;
}

.book-art img {
    display: block;
    width: 100%;
    height: auto;
}

.placeholder-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background: linear-gradient(180deg, #ffffff 0%, #effcfd 100%);
}

.placeholder-card {
    max-width: 640px;
    padding: 38px;
    border: 2px solid var(--blue);
    border-radius: 10px;
    background: var(--white);
    text-align: center;
    box-shadow: var(--shadow);
}

.placeholder-card h1 {
    margin: 12px 0;
    color: var(--blue);
    font-family: var(--display-font);
    font-size: clamp(2.1rem, 6vw, 3.5rem);
    line-height: 1;
}

.placeholder-card p {
    margin: 0 0 24px;
    font-size: 1.08rem;
    line-height: 1.6;
}

.placeholder-card .logo {
    max-width: 280px;
}

@media (hover: none), (max-width: 900px) {
    .panel::after,
    .panel-copy {
        opacity: 1;
    }

    .panel-copy {
        justify-content: center;
        transform: none;
        background: linear-gradient(135deg, rgba(40, 174, 228, 0.46), rgba(8, 93, 141, 0.62));
    }
}

@media (max-width: 1180px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: minmax(280px, 405px) minmax(0, 1fr);
        gap: 24px;
        align-items: stretch;
        justify-content: center;
    }

    .story-card {
        height: 100%;
    }

    .sidebar-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto auto minmax(96px, 1fr) auto;
        gap: 18px 24px;
        height: 100%;
        align-self: stretch;
    }

    .btn-gold {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .btn-green {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .sidebar .btn {
        width: 100%;
    }

    .nav-main {
        display: none;
    }

    .nav-compact {
        display: grid;
        grid-column: 1 / -1;
        grid-row: 3;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 36px 18px;
        width: 100%;
        align-self: center;
        margin: 0;
        padding: 16px 0 20px;
        font-size: clamp(1.75rem, 2.9vw, 1.9rem);
    }

    .donate {
        display: flex;
        grid-column: 1 / 2;
        grid-row: 4;
        align-self: end;
        align-items: flex-end;
        justify-content: center;
        min-height: 125px;
    }

    .library-link {
        display: flex;
        grid-column: 2 / 3;
        grid-row: 4;
        flex-direction: column;
        align-self: end;
        align-items: center;
        justify-content: flex-end;
        max-width: none;
        min-height: 125px;
    }

    .library-link span {
        display: none;
    }

    .library-link img {
        width: 125px;
        height: 125px;
        object-fit: contain;
    }

    .mosaic {
        grid-template-rows: 220px 262px 227px;
    }
}

@media (min-width: 1181px) and (max-width: 1494px) {
    .nav {
        font-size: clamp(1.45rem, calc(3.45vw - 1.095rem), 2.125rem);
    }
}

@media (min-width: 761px) and (max-width: 840px) {
    .sidebar {
        grid-template-columns: minmax(300px, 405px) minmax(320px, 1fr);
        gap: 18px;
    }

    .nav-compact {
        gap: 34px 12px;
        font-size: clamp(1.5rem, 2.9vw, 1.75rem);
    }
}

@media (max-width: 760px) {
    .page {
        width: min(100% - 28px, 620px);
        margin-top: 18px;
    }

    .sidebar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .sidebar-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto auto auto auto;
        gap: 18px;
        align-items: center;
    }

    .story-card,
    .btn-gold,
    .btn-green,
    .nav-compact {
        grid-column: 1 / -1;
    }

    .btn {
        width: 100%;
        min-width: 0;
        min-height: 56px;
        font-size: 1.65rem;
    }

    .nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 34px 12px;
        font-size: 1.75rem;
    }

    .nav-compact {
        margin: 0;
        padding: 24px 0 28px;
        gap: 36px 12px;
    }

    .nav-main {
        display: none;
    }

    .donate,
    .library-link {
        grid-column: auto;
        min-height: 0;
        width: 100%;
        justify-self: center;
    }

    .donate {
        margin-top: 0;
    }

    .donate img {
        width: 125px;
    }

    .mosaic {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .panel {
        grid-area: auto;
        aspect-ratio: 4 / 3;
    }

    .book-club,
    .book-magic {
        aspect-ratio: 16 / 9;
    }

    .book-art {
        width: 100%;
        margin-top: 34px;
    }
}
