:root {
    color-scheme: dark;
    --background: #101113;
    --text: #f4f1ea;
    --muted: #b9b3a8;
    --gold: #d6b36a;
    --tile: #1d2024;
    --tile-border: #343941;
    --tile-hover: #252a31;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background-color: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.site-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.site-main {
    display: flex;
    flex: 1;
    width: 100%;
}

.home-layout {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: clamp(44px, 8vh, 86px) 24px 32px;
}

.home-logo {
    display: block;
    width: min(560px, 78vw);
    max-height: 42vh;
    height: auto;
    object-fit: contain;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 320px));
    gap: 24px;
    width: min(100%, 664px);
    margin-top: clamp(36px, 7vh, 72px);
}

.nav-tile {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    justify-content: center;
    min-height: 168px;
    padding: 34px;
    border: 1px solid var(--tile-border);
    border-radius: 8px;
    background: var(--tile);
    color: var(--gold);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-tile-icon {
    color: var(--gold);
    font-size: 2.35rem;
    line-height: 1;
}

.nav-tile:hover,
.nav-tile:focus-visible {
    border-color: var(--muted);
    background: var(--tile-hover);
    transform: translateY(-2px);
}

.nav-tile:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 4px;
}

.page-layout {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: clamp(20px, 4vh, 36px) clamp(24px, 6vw, 64px) 32px;
    text-align: center;
}

.page-logo {
    display: block;
    width: min(220px, 48vw);
    height: auto;
    margin-bottom: clamp(24px, 5vh, 44px);
    object-fit: contain;
}

.page-layout h1 {
    margin: 0;
    color: var(--gold);
    font-size: clamp(1.95rem, 5vw, 3.35rem);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.05;
}

.page-layout p {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.55;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1180px;
    margin-top: clamp(28px, 6vh, 52px);
}

.book-tile {
    display: grid;
    grid-template-columns: minmax(132px, 170px) minmax(0, 1fr);
    gap: clamp(18px, 3vw, 24px);
    align-items: start;
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid var(--tile-border);
    border-radius: 8px;
    background: var(--tile);
    text-align: left;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.book-tile:hover,
.book-tile:focus-visible {
    border-color: var(--muted);
    background: var(--tile-hover);
    transform: translateY(-2px);
}

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

.book-cover {
    display: block;
    width: 100%;
    max-width: 170px;
    aspect-ratio: 2 / 3;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

.book-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 170px;
    aspect-ratio: 2 / 3;
    border: 1px solid var(--tile-border);
    border-radius: 4px;
    background: #171a1f;
    color: var(--gold);
}

.book-cover-placeholder .material-symbols-outlined {
    font-size: 3.2rem;
    line-height: 1;
}

.book-content {
    min-width: 0;
}

.book-content .book-kicker {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-transform: uppercase;
}

.book-content h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.15;
}

.book-content .book-description {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.45;
}

.book-action {
    display: inline-flex;
    margin-top: 14px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
}

.book-tile-placeholder {
    color: inherit;
    cursor: default;
}

.book-tile-placeholder:hover {
    border-color: var(--tile-border);
    background: var(--tile);
    transform: none;
}

.site-footer {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 20px 24px 24px;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.site-footer address {
    margin: 0;
    font-style: normal;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .home-layout {
        padding-top: 36px;
    }

    .home-logo {
        width: min(440px, 84vw);
        max-height: 34vh;
    }

    .tile-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        width: min(100%, 420px);
        margin-top: 32px;
    }

    .nav-tile {
        min-height: 124px;
        padding: 28px;
    }

    .nav-tile-icon {
        font-size: 2.1rem;
    }

    .book-grid {
        grid-template-columns: 1fr;
    }

    .book-tile {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .book-cover {
        max-width: min(240px, 72vw);
    }

    .book-cover-placeholder {
        max-width: min(240px, 72vw);
    }

    .site-footer {
        padding-bottom: 18px;
    }
}
