* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background-color: #1a1a1a;
}

header {
    background: #111;
    color: white;
    padding: 3rem 1rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.zine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
    perspective: 1000px;
}

.zine-card {
    cursor: pointer;
    text-align: center;
}

.zine-book {
    position: relative;
    display: inline-block;
    transform: rotateY(-15deg);
    transform-style: preserve-3d;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    box-shadow:
        8px 10px 28px rgba(0,0,0,0.5),
        3px 4px 8px rgba(0,0,0,0.3);
    border-radius: 0 0 4px 0;
}

/* Subtle gloss highlight on cover */
.zine-book::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.08) 0%,
        transparent 50%
    );
    z-index: 1;
    pointer-events: none;
}

/* Page edges sticking out on the right */
.zine-book::after {
    content: '';
    position: absolute;
    top: 0;
    right: -4px;
    bottom: 0;
    width: 4px;
    background: linear-gradient(
        to right,
        #6a6460 0px, #6a6460 1px,
        #5a5450 1px, #5a5450 3px,
        #4a4440 3px
    );
    border-radius: 0 0 4px 0;
    z-index: -1;
}

.zine-card:hover .zine-book {
    transform: rotateY(-4deg) translateY(-8px);
    box-shadow:
        12px 14px 36px rgba(0,0,0,0.5),
        5px 6px 12px rgba(0,0,0,0.3);
}

.zine-spine {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 18px;
    background: linear-gradient(to right, #0e0e0e, #2e2e2e, #0e0e0e);
    transform: rotateY(90deg) translateX(-9px);
    transform-origin: left;
    border-radius: 2px 0 0 2px;
}

.zine-cover {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background-color: #222;
}

.zine-info {
    padding: 1.2rem 0.5rem 0;
}

.zine-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: #e0e0e0;
    font-weight: 600;
}

.zine-info p {
    color: #999;
    font-size: 0.85rem;
}

/* Full-page flipbook viewer overlay */
.viewer-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    flex-direction: column;
}

.viewer-overlay.active {
    display: flex;
}

.viewer-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.viewer-overlay:hover .viewer-close,
.viewer-overlay:hover .viewer-footer {
    opacity: 1;
}

.viewer-close:hover {
    opacity: 1;
}

/* Side navigation arrows */
.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.25);
    font-size: 3rem;
    cursor: pointer;
    padding: 2rem 1rem;
    transition: color 0.2s;
    user-select: none;
}

.viewer-nav:hover {
    color: rgba(255, 255, 255, 0.7);
}

.viewer-nav-prev {
    left: 0;
}

.viewer-nav-next {
    right: 0;
}

/* First-open hint */
.flip-hint {
    position: absolute;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.6rem 1.4rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.flip-hint.visible {
    opacity: 1;
}

.flip-hint.fade-out {
    opacity: 0;
}

.flipbook-container {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.viewer-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 1.5rem;
    opacity: 0;
    transition: opacity 0.3s;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

#page-counter {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
}

.viewer-footer .kofi-btn {
    display: none;
    background: #13C3FF;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.viewer-footer .kofi-btn.visible {
    display: inline-block;
}

.viewer-footer .kofi-btn:hover {
    background: #0da8db;
}

/* StPageFlip page styling */
.flipbook-page {
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.flipbook-page img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Password Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

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

.modal-content {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.password-modal {
    max-width: 400px;
    padding: 2rem;
}

.password-modal h2 {
    margin-bottom: 1rem;
    color: #3498db;
}

.password-modal p {
    margin-bottom: 1rem;
    color: #666;
}

.password-modal input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.password-modal button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.password-modal button:last-of-type {
    background: #999;
}

.password-modal button:hover {
    opacity: 0.9;
}

.error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.newsletter {
    background: #111;
    padding: 3rem 1rem;
    text-align: center;
}

.newsletter h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #e0e0e0;
}

.newsletter p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.newsletter-form {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
    padding: 0.65rem 1rem;
    border: 1px solid #333;
    border-radius: 4px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 0.95rem;
    width: 260px;
}

.newsletter-form input[type="email"]::placeholder {
    color: #555;
}

.newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: #555;
}

.newsletter-form button {
    padding: 0.65rem 1.4rem;
    background: #e0e0e0;
    color: #111;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-form button:hover {
    background: #fff;
}

footer {
    background: #111;
    color: #999;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

footer a {
    color: #13C3FF;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile: always show viewer chrome (no hover on touch) */
@media (hover: none), (pointer: coarse) {
    .viewer-close {
        opacity: 1;
    }

    /* Footer hidden on mobile — Ko-fi CTA lives inside the book instead */
    .viewer-footer {
        display: none;
    }
}

/* Ko-fi end page (last spread of the flipbook) */
.kofi-end-page {
    background: #111;
}

.kofi-end-inner {
    /* StPageFlip forces display:block on the page element, so flex lives here instead */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
    padding: 2rem;
}

.kofi-end-btn {
    display: inline-block;
    background: #13C3FF;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .zine-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }


}
