:root {
    --bg: #f3eee1;
    --surface: #ffffff;
    --ink: #2f2e2a;
    --ink-soft: #6f6a60;
    --accent: #4f5c3f;
    --accent-dark: #3b4530;
    --tag-bg: #ece0c8;
    --link-accent: #c97a4a;
    --border: #e5ddc9;
    --danger: #b8483a;
    --radius: 18px;
    --shadow: 0 8px 24px rgba(43, 42, 40, 0.06);
    font-size: 17px;
    color-scheme: light;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Georgia", "Charter", "Iowan Old Style", serif;
    line-height: 1.55;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    max-width: 960px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.nav a {
    color: var(--ink);
    text-decoration: none;
    font-size: 0.95rem;
}

.brand {
    font-family: "Georgia", serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--accent-dark);
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.hero {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 38px 56px;
}

.hero-badge {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.85rem;
    color: var(--ink-soft);
    background: var(--tag-bg);
    border-radius: 999px;
    padding: 6px 16px;
    margin-bottom: 18px;
}

.hero h1 {
    font-size: 2.1rem;
    max-width: 880px;
    margin: 0 auto 14px;
    color: var(--accent-dark);
}

.hero p {
    color: var(--ink-soft);
    max-width: none;
    margin: 0 auto;
    font-size: 1.05rem;
}

.hero p + p {
    margin-top: 12px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 260px));
    justify-content: center;
    gap: 20px;
    margin-top: 32px;
}

.book-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px 14px;
    perspective: 1100px;
}

.book-photo {
    max-width: 82%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(8px 12px 14px rgba(30, 28, 22, 0.35));
    transition: transform 0.35s ease, filter 0.35s ease;
}

.book-card:hover .book-photo {
    transform: translateY(-3px) scale(1.03);
    filter: drop-shadow(9px 16px 18px rgba(30, 28, 22, 0.4));
}

.book {
    position: relative;
    width: 72%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateY(24deg);
    transition: transform 0.35s ease;
    filter: drop-shadow(10px 16px 14px rgba(30, 28, 22, 0.35));
}

.book-card:hover .book {
    transform: rotateY(12deg);
}

.book-face {
    position: absolute;
    inset: 0;
    transform: translateZ(16px);
    border-radius: 6px 2px 2px 6px;
    background-color: var(--accent-dark);
    background-image: linear-gradient(150deg, var(--accent) 0%, var(--accent-dark) 60%, #262b1e 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 14px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    text-align: center;
}

.book-face-eyebrow {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(242, 236, 217, 0.75);
}

.book-face-title {
    font-family: "Georgia", serif;
    font-size: 1.05rem;
    line-height: 1.35;
    color: #f5efdd;
}

.book-face-rule {
    width: 28px;
    height: 1px;
    background: rgba(242, 236, 217, 0.4);
}

.book-spine {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 16px;
    transform-origin: right center;
    transform: rotateY(90deg);
    background: linear-gradient(180deg, var(--accent-dark), #23281c);
    border-radius: 0 2px 2px 0;
}

.book-card h3 {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.3;
}

.book-card p {
    color: var(--ink-soft);
    font-size: 0.83rem;
    line-height: 1.45;
    margin: 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-more {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    margin: -4px 0 0;
    color: var(--accent-dark);
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.link-more:hover { opacity: 0.75; }

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 28, 22, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 44px;
    max-width: 1100px;
    width: 94vw;
    max-height: 88vh;
    overflow-y: auto;
}

.modal-body {
    display: flex;
    align-items: flex-start;
    gap: 48px;
}

.modal-cover {
    flex: 0 0 300px;
}

.modal-cover .book-cover {
    width: 100%;
    max-width: none;
}

.modal-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-top: 8px;
}

.modal-card h2 {
    margin: 0 0 16px;
    font-size: 1.7rem;
    line-height: 1.3;
}

.modal-description {
    color: var(--ink-soft);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0 0 28px;
    flex-grow: 1;
}

@media (max-width: 760px) {
    .modal-card { padding: 32px 22px 24px; }
    .modal-body { flex-direction: column; gap: 20px; }
    .modal-cover { flex: 0 0 auto; max-width: 220px; margin: 0 auto; }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--ink);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover { background: var(--border); }

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.price {
    font-weight: 700;
    font-size: 0.98rem;
}

.btn {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--accent-dark);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn:hover { opacity: 0.9; }

.price-row .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
}
.btn:disabled { opacity: 0.5; cursor: default; }

.btn-secondary {
    background: transparent;
    color: var(--accent-dark);
    border: 1px solid var(--border);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    max-width: 420px;
    margin: 48px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.card h2 { margin-top: 0; }

label {
    display: block;
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin: 14px 0 6px;
}

input[type="email"], input[type="password"], input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg);
    color: var(--ink);
}

.form-error {
    color: var(--danger);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9rem;
    margin-top: 12px;
    min-height: 1.2em;
}

.muted-link {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin-top: 18px;
    text-align: center;
}

.muted-link a { color: var(--link-accent); }

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 56px;
    padding: 48px 24px 28px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
}

.footer-brand { max-width: 320px; }

.footer-brand-name {
    font-family: "Georgia", serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent-dark);
    margin-bottom: 10px;
}

.footer-col { min-width: 170px; }

.footer-col-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    font-weight: 600;
    margin-bottom: 12px;
}

.site-footer p {
    color: var(--ink-soft);
    font-size: 0.87rem;
    line-height: 1.6;
    margin: 0 0 10px;
}

.footer-col a, .footer-col span {
    display: block;
    color: var(--ink-soft);
    font-size: 0.87rem;
    text-decoration: none;
    margin-bottom: 8px;
}

.footer-col a:hover { color: var(--link-accent); }

.footer-bottom {
    max-width: 960px;
    margin: 32px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.8rem;
}

.paper-block {
    margin-top: 56px;
    padding: 44px 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.paper-badge {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--danger);
    background: #f3ddd8;
    border-radius: 999px;
    padding: 5px 14px;
    margin-bottom: 16px;
}

.paper-block h2 {
    margin: 0 0 16px;
    font-size: 1.6rem;
}

.paper-block p {
    color: var(--ink-soft);
    max-width: 620px;
    margin: 0 auto 12px;
    line-height: 1.6;
}

.paper-note {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.85rem;
}

.paper-block .btn {
    margin-top: 16px;
    padding: 12px 28px;
}

.paper-form {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.paper-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin: 12px 0 5px;
}

.paper-form label:first-of-type { margin-top: 0; }

.paper-form input,
.paper-form select,
.paper-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.92rem;
    background: var(--bg);
    color: var(--ink);
    font-family: inherit;
}

.paper-form textarea { resize: vertical; }

.paper-form-message {
    font-size: 0.85rem;
    color: var(--danger);
    min-height: 1.2em;
    margin-bottom: 4px;
}

.paper-form-message.ok { color: var(--accent-dark); }

@media (max-width: 720px) {
    .paper-block { padding: 28px 24px; }
}

.faq { margin-top: 56px; }
.faq details {
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
}
.faq p { color: var(--ink-soft); margin: 10px 0 0; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 20px);
    background: var(--ink);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9rem;
    padding: 14px 22px;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    max-width: 90vw;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 200;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

@media (max-width: 600px) {
    .nav {
        flex-wrap: wrap;
        gap: 8px 16px;
        padding: 16px 20px;
    }
    .nav-links { gap: 14px; }
    .nav a, .nav-links span { font-size: 0.85rem; }

    .hero { padding: 28px 20px 36px; }
    .hero-badge { font-size: 0.75rem; padding: 5px 12px; }
    .hero h1 { font-size: 1.5rem; line-height: 1.3; }
    .hero p { font-size: 0.95rem; }

    .container { padding: 0 16px 60px; }
    .paper-block { padding: 24px 18px; }

    .modal-card h2 { font-size: 1.3rem; }
    .modal-description { font-size: 0.88rem; }
}
