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

:root {
    /* Colors */
    --primary-blue: #2563EB;
    --primary-orange: #F97316;
    --primary-purple: #9333EA;
    --text-dark: #1a1a1a;
    --text-gray: #666;
    --bg-cream: #FAFAFA;
    --white: #FFFFFF;
    --border-light: #E5E7EB;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
    overflow: hidden;
}

/* Back to site link */
.back-to-site {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 9999;
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.back-to-site:hover {
    background: rgba(0,0,0,0.7);
}

/* Book Wrapper */
.book-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2000px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    transition: background 0.5s ease;
}

.book-wrapper.opened {
    background: #FAFAFA;
}

/* Closed Book */
.book-closed {
    position: relative;
    width: 600px;
    max-width: 90vw;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.book-wrapper.opened .book-closed {
    display: none;
}

/* Physical Book Container */
.physical-book {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3/4;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    transform-origin: center center;
}

.physical-book:not(.flipped):hover {
    transform: translateY(-8px);
}

.physical-book.flipped {
    transform: rotateY(180deg);
}

.physical-book.flipped:hover {
    transform: rotateY(180deg) translateY(-8px);
}

/* Book Spine */
.book-spine-side {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: linear-gradient(to right,
        #1a1a1a 0%,
        #2d2d2d 20%,
        #3a3a3a 50%,
        #2d2d2d 80%,
        #1a1a1a 100%
    );
    border-radius: 4px 0 0 4px;
    box-shadow: inset -2px 0 8px rgba(0, 0, 0, 0.3);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 0;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Kompenzace rotace hřbetu při flipu */
.physical-book.flipped .book-spine-side {
    transform: rotateY(180deg);
}

.spine-logo {
    font-size: 1.5rem;
    transform: scaleX(-1) rotate(-90deg);
    flex-shrink: 0;
}

.spine-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spine-author {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

/* Page Stack */
.page-stack {
    position: absolute;
    left: 50px;
    right: 0;
    top: 0;
    bottom: -8px;
    z-index: 0;
    pointer-events: none;
}

.page-edge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    border-right: 1px solid #d0d0d0;
}

.page-edge-1 {
    transform: translateX(4px) translateY(4px);
    background: #fafafa;
    opacity: 0.8;
}

.page-edge-2 {
    transform: translateX(8px) translateY(8px);
    background: #f0f0f0;
    opacity: 0.6;
}

.page-edge-3 {
    transform: translateX(12px) translateY(12px);
    background: #e8e8e8;
    opacity: 0.4;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.15);
}

/* Book Cover Container */
.book-cover-container {
    position: absolute;
    top: 0;
    left: 50px;
    right: 0;
    bottom: 0;
    border-radius: 0 8px 8px 0;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        -2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
    backface-visibility: hidden;
    cursor: pointer;
}

.front-cover {
    transform: rotateY(0deg);
}

.back-cover {
    transform: rotateY(180deg);
}

.physical-book:hover .book-cover-container {
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        -2px 0 8px rgba(0, 0, 0, 0.1);
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        transparent 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 6rem 3rem 3rem 3rem;
    color: white;
}

.cover-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.cover-subtitle {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 2rem;
    opacity: 0.9;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
    max-width: 400px;
}

.cover-logos {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
}

.cover-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.cover-logo:hover {
    transform: scale(1.1);
}

.open-btn {
    background: var(--primary-orange);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    align-self: flex-start;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.open-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.6);
    background: #EA580C;
}

/* Back Cover Styles */
.back-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.quote-container {
    text-align: center;
    color: white;
}

.quote-mark {
    font-size: 4rem;
    color: var(--primary-orange);
    font-family: Georgia, serif;
    line-height: 1;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.back-quote {
    font-size: 1.5rem;
    line-height: 1.6;
    font-family: Georgia, serif;
    font-style: italic;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.95);
}

.quote-author {
    font-size: 1.1rem;
    color: var(--primary-orange);
    font-weight: 600;
}

/* Flip Button */
.flip-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: rgb(249, 115, 22);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    z-index: 9999;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.book-wrapper.opened .flip-btn {
    display: none;
}

.flip-btn:hover {
    background: rgba(234, 88, 12, 1);
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Opened Book */
.book-opened {
    position: fixed;
    inset: 0;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease 0.4s;
    z-index: 100;
}

.book-wrapper.opened .book-opened {
    display: flex;
    opacity: 1;
}

.book-pages {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    padding: 1rem;
    display: flex;
    background: white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: bookOpen 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bookOpen {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pages */
.page {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    background: var(--white);
}

.left-page {
    max-width: 380px;
    border-right: 1px solid var(--border-light);
}

.right-page {
    flex: 1.8;
}

/* Left Page: Chapters */
.chapters-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--text-dark);
}

.chapters-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.chapters-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.chapter-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.chapter-item:hover {
    background: var(--bg-cream);
    border-left-color: var(--primary-orange);
}

.chapter-item.active {
    background: var(--bg-cream);
    border-left-color: var(--primary-orange);
}

.chapter-number {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-gray);
    min-width: 60px;
    font-family: 'Georgia', serif;
}

.chapter-item.active .chapter-number {
    color: var(--primary-orange);
    font-weight: 400;
}

.chapter-title {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.4;
    align-self: center;
}

/* Author Section */
.author-section {
    padding: 2rem 1rem;
    background: var(--bg-cream);
    border-radius: 8px;
    margin-top: auto;
}

.author-avatar {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.author-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.author-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.author-info p {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.author-image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: white;
    border: 2px dashed var(--border-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
    color: var(--text-gray);
}

.placeholder-content span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.placeholder-content p {
    font-size: 0.85rem;
}

/* Right Page: Content */
.chapter-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.chapter-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.content-chapter-num {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.content-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
}

.content-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: 2rem;
    font-weight: 400;
}

.content-body h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--text-dark);
}

.content-body p {
    margin-bottom: 1rem;
    color: var(--text-gray);
}

.steps-list {
    list-style: none;
    counter-reset: steps;
    margin: 2rem 0;
}

.steps-list li {
    counter-increment: steps;
    margin-bottom: 2rem;
    padding-left: 3rem;
    position: relative;
}

.steps-list li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary-orange);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.steps-list strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.steps-list p {
    margin: 0;
}

.content-body ul {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.content-body ul li {
    margin-bottom: 0.75rem;
    color: var(--text-gray);
}

/* Tip Box */
.tip-box {
    background: linear-gradient(135deg, #FEF3C7 0%, #FED7AA 100%);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    border-left: 4px solid var(--primary-orange);
}

.tip-box h4 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.tip-box p {
    margin: 0;
    color: var(--text-dark);
}

/* Tools Catalog */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.catalog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
}

.catalog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-orange);
}

.catalog-logo {
    background: linear-gradient(135deg, var(--bg-cream), white);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
}

.tool-logo {
    height: 60px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logo-placeholder.claude {
    background: linear-gradient(135deg, #D97706, #F59E0B);
}

.logo-placeholder.cursor {
    background: linear-gradient(135deg, #000000, #374151);
}

.logo-placeholder.openclaw {
    background: linear-gradient(135deg, #DC2626, #EF4444);
}

.logo-placeholder.macaly {
    background: linear-gradient(135deg, var(--primary-blue), #60A5FA);
}

.logo-placeholder.lovable {
    background: linear-gradient(135deg, #EC4899, #F472B6);
}

.catalog-content {
    padding: 1.5rem;
}

.catalog-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.catalog-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.catalog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.catalog-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.catalog-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-orange);
}

.catalog-link {
    display: inline-block;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.catalog-link:hover {
    color: var(--primary-orange);
    transform: translateX(4px);
}

/* Quotes & Inspiration */
.quote-card {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    padding: 2.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    text-align: center;
}

.quote {
    font-size: 1.4rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.quote-source {
    font-size: 0.95rem;
    color: var(--text-gray);
}

.daily-tip-card {
    background: var(--bg-cream);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary-purple);
}

.daily-tip-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.daily-tip-card p {
    margin: 0;
}

.wisdom-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-top: 3px solid var(--primary-orange);
}

.wisdom-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.wisdom-card p {
    margin: 0;
    font-style: italic;
}

/* Tear-off Pages Generator */
.tearoff-container {
    margin: 2rem 0;
}

.tearoff-info {
    text-align: center;
    margin-bottom: 1rem;
}

.tearoff-counter {
    font-size: 1rem;
    color: var(--text-gray);
}

.tearoff-counter strong {
    color: var(--primary-orange);
    font-size: 1.2rem;
}

.tearoff-stack {
    position: relative;
    min-height: 400px;
    perspective: 1000px;
}

.tearoff-page {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.tearoff-page.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.95);
    z-index: 0;
}

.tearoff-page.active {
    opacity: 1;
    z-index: 10;
}

.tearoff-page.tearing {
    animation: tearAway 0.8s ease-out forwards;
}

@keyframes tearAway {
    0% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) translateY(-30px) rotate(-5deg);
        opacity: 0.7;
    }
    100% {
        transform: translateX(-50%) translateY(-100px) rotate(-15deg) scale(0.8);
        opacity: 0;
    }
}

.tearoff-perforation {
    height: 30px;
    background: repeating-linear-gradient(
        to right,
        var(--border-light) 0px,
        var(--border-light) 8px,
        transparent 8px,
        transparent 16px
    );
    border-radius: 8px 8px 0 0;
    position: relative;
}

.tearoff-perforation::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-light);
}

.tearoff-content {
    padding: 2rem;
}

.idea-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.idea-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

.idea-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.idea-tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--bg-cream);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-gray);
}

.tear-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-orange), #EA580C);
    color: white;
    border: none;
    border-radius: 0 0 8px 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.tear-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.tear-button:hover::before {
    width: 300px;
    height: 300px;
}

.tear-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.tear-button:active {
    transform: translateY(0);
}

.tear-button span {
    position: relative;
    z-index: 1;
}

/* Final page */
.tearoff-page.final {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
}

.final-content {
    text-align: center;
    padding: 3rem 2rem;
}

.final-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.reset-button {
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-button:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

/* Close Button */
.close-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Scrollbar */
.page::-webkit-scrollbar {
    width: 8px;
}

.page::-webkit-scrollbar-track {
    background: var(--bg-cream);
}

.page::-webkit-scrollbar-thumb {
    background: var(--primary-orange);
    border-radius: 4px;
}

.page::-webkit-scrollbar-thumb:hover {
    background: #EA580C;
}

/* Mobile Chapter Bar */
.mobile-chapter-bar {
    display: none;
}

.mobile-chapter-dropdown {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .book-pages {
        flex-direction: column;
        height: auto;
        max-height: calc(100vh - 56px);
        margin-top: 56px;
    }

    .left-page {
        display: none;
    }

    .right-page {
        flex: 1;
        max-height: calc(100vh - 56px);
    }

    .mobile-chapter-bar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: #1a1a1a;
        color: white;
        padding: 0 1rem;
        z-index: 200;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .mobile-back-link {
        background: none;
        border: none;
        color: white;
        font-size: 1.3rem;
        padding: 0.25rem 0.5rem;
        opacity: 0.8;
        flex-shrink: 0;
        cursor: pointer;
    }

    .mobile-back-link:hover {
        opacity: 1;
    }

    .mobile-chapter-title {
        flex: 1;
        background: none;
        border: none;
        color: white;
        font-size: 1.05rem;
        font-weight: 700;
        letter-spacing: 0.3px;
        text-align: left;
        cursor: pointer;
        padding: 0.25rem 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-book-menu-btn {
        background: none;
        border: 2px solid rgba(255,255,255,0.3);
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        transition: all 0.2s;
    }

    .mobile-book-menu-btn:hover,
    .mobile-book-menu-btn.active {
        background: var(--primary-orange);
        border-color: var(--primary-orange);
    }

    .mobile-chapter-dropdown {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background: #1a1a1a;
        z-index: 199;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .mobile-chapter-dropdown.open {
        display: block;
        animation: slideDown 0.2s ease;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .mobile-chapter-item {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.25rem;
        text-decoration: none;
        color: rgba(255,255,255,0.7);
        border-bottom: 1px solid rgba(255,255,255,0.06);
        transition: all 0.2s;
    }

    .mobile-chapter-item:hover {
        background: rgba(255,255,255,0.05);
        color: white;
    }

    .mobile-chapter-item.active {
        color: var(--primary-orange);
        background: rgba(249, 115, 22, 0.1);
    }

    .mci-number {
        font-size: 1.4rem;
        font-weight: 300;
        font-family: Georgia, serif;
        min-width: 2rem;
    }

    .mci-title {
        font-size: 1rem;
        font-weight: 500;
    }

    .cover-title {
        font-size: 2.5rem;
    }

    .author-section {
        padding: 1.5rem;
    }

    .author-image-placeholder {
        display: none;
    }

    /* Hide close btn on mobile — mobile bar handles it */
    .close-btn {
        display: none;
    }

    /* Hide back-to-site when book is opened on mobile */
    .back-to-site.book-is-open {
        display: none;
    }
}

@media (max-width: 768px) {
    .page {
        padding: 1.5rem 1rem;
    }

    .book-spine-side {
        width: 35px;
        padding: 1.5rem 0;
    }

    .spine-logo {
        font-size: 1.2rem;
    }

    .spine-title {
        font-size: 0.65rem;
        letter-spacing: 2px;
    }

    .spine-author {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }

    .book-cover-container {
        left: 35px;
    }

    .page-stack {
        left: 35px;
    }

    .cover-title {
        font-size: 2rem;
    }

    .cover-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .cover-logos {
        bottom: 1rem;
        right: 1rem;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .cover-logo {
        width: 32px;
        height: 32px;
    }

    .back-quote {
        font-size: 1.2rem;
    }

    .flip-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .cover-overlay {
        padding: 4rem 2rem 2rem 2rem;
    }

    .content-title {
        font-size: 1.6rem;
    }

    .content-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .lead {
        font-size: 1.05rem;
    }

    .content-body h3 {
        font-size: 1.25rem;
    }

    .quote {
        font-size: 1.2rem;
    }

    .chapter-number {
        font-size: 1.5rem;
    }

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

    .catalog-logo {
        padding: 1.5rem;
    }

    .tool-logo {
        height: 45px;
        max-width: 150px;
    }

    .logo-placeholder {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .tip-box {
        padding: 1.25rem;
    }

    .tearoff-stack {
        min-height: 300px;
    }
}

/* Role Selection Styles */
.role-selection {
    margin: 2rem 0;
}

.role-selection-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-dark);
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.role-card {
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.role-card:hover {
    border-color: var(--primary-orange);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.15);
}

.role-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.role-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.role-desc {
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* Tearoff Header */
.tearoff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.back-to-roles {
    background: transparent;
    border: 1px solid var(--border-light);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.back-to-roles:hover {
    background: var(--bg-cream);
    border-color: var(--primary-orange);
    color: var(--primary-orange);
}

/* Screenshot Styles */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.screenshot-single {
    margin: 2rem 0;
}

.screenshot-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.screenshot-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.screenshot-img:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.screenshot-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-gray);
    font-style: italic;
}

@media (max-width: 768px) {
    .screenshots-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .role-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .role-card {
        padding: 1rem;
    }

    .role-icon {
        font-size: 2rem;
    }

    .tearoff-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .book-pages {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .role-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .role-card {
        padding: 0.75rem;
    }

    .role-icon {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .role-name {
        font-size: 0.9rem;
    }

    .role-desc {
        font-size: 0.75rem;
    }

    .content-title {
        font-size: 1.4rem;
    }

    .open-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}
