/* ==========================================
   Story Book - Vintage Literary Journal
   Realistic page-turning with radio inputs
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Caveat:wght@400;500;600;700&family=Patrick+Hand&display=swap');

:root {
    /* Colors - Warm vintage palette */
    --book-bg: #1a1612;
    --page-bg: #F9F6F0;
    --page-aged: #F5F0E8;
    --page-shadow: #E8DCC8;
    --text-primary: #2A2420;
    --text-secondary: #5D4E37;
    --accent-warm: #C9A961;
    --spine-dark: #3a2f1f;

    /* Typography */
    --font-display: 'Crimson Text', serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-handwritten: 'Caveat', cursive;
    --font-casual: 'Patrick Hand', cursive;

    /* Spacing - based on golden ratio */
    --baseline: 12px;
    --page-padding: calc(var(--baseline) * 4);
}

/* ==========================================
   Book Modal Container
   ========================================== */

.book-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--book-bg);
}

.book-modal.active {
    display: flex;
    opacity: 1;
}

.book-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(42, 36, 32, 0.95) 0%, rgba(26, 22, 18, 0.98) 100%);
    backdrop-filter: blur(12px);
}

.book-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1600px;
    height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 2rem;
}

.book-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 246, 240, 0.95);
    border: 2px solid var(--accent-warm);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.book-close svg {
    color: var(--text-secondary);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-close:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(201, 169, 97, 0.4);
}

.book-close:hover svg {
    transform: rotate(90deg);
}

/* ==========================================
   Book Wrapper & Perspective
   ========================================== */

.book-wrapper {
    position: relative;
    perspective: 2400px;
    perspective-origin: center center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1400px;
}

.book {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: calc(var(--baseline) * 60);
    max-height: 750px;
    display: flex;
    transform-style: preserve-3d;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 40px 100px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 40px rgba(201, 169, 97, 0.15));
}

/* ==========================================
   Book Spine
   ========================================== */

.book-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(to right,
        #5d4e37 0%,
        #4a3f2e 15%,
        var(--spine-dark) 25%,
        #2a1f0f 50%,
        var(--spine-dark) 75%,
        #4a3f2e 85%,
        #5d4e37 100%);
    transform: translateX(-50%) translateZ(1px);
    border-radius: 8px;
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.6),
        inset 0 2px 1px rgba(255, 255, 255, 0.1),
        0 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.book-spine::before {
    content: '';
    position: absolute;
    inset: 30px 0;
    border-top: 3px solid rgba(139, 115, 85, 0.4);
    border-bottom: 3px solid rgba(139, 115, 85, 0.4);
}

.book-spine::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        rgba(139, 115, 85, 0.6) 50%,
        transparent);
    transform: translate(-50%, -50%);
}

/* ==========================================
   Book Sides & Page Structure
   ========================================== */

.book-left-side,
.book-right-side {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
}

.book-left-side {
    left: 0;
    right: 50%;
}

.book-right-side {
    left: 50%;
    right: 0;
}

/* Static pages (always visible, don't flip) */
.book-page-static {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg,
        var(--page-bg) 0%,
        var(--page-aged) 100%);
    border: 1px solid #D4C5A9;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.2),
        inset 0 0 80px rgba(212, 197, 169, 0.15);
}

.left-page {
    left: 0;
    background: linear-gradient(-135deg,
        var(--page-bg) 0%,
        var(--page-aged) 100%);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.left-page:hover {
    transform: rotateY(3deg);
}

.right-page {
    left: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.right-page:hover {
    transform: rotateY(-3deg);
}

/* Smooth content transitions on static pages */
.book-page-static .page-content {
    transition: opacity 0.2s ease-in-out;
}

/* Flipping page (animated) */
.book-page-flip {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform-style: preserve-3d;
    transform-origin: 0% 50%;
    transition: none; /* No transition by default */
    pointer-events: none;
    opacity: 0;
    z-index: 10;
}

.book-page-flip.animating {
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.9s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* Paper texture overlay */
.book-page-static::before,
.book-page-front::before,
.book-page-back::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 1.5px,
            rgba(212, 197, 169, 0.02) 1.5px,
            rgba(212, 197, 169, 0.02) 3px),
        repeating-linear-gradient(90deg,
            transparent,
            transparent 1.5px,
            rgba(212, 197, 169, 0.02) 1.5px,
            rgba(212, 197, 169, 0.02) 3px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

/* Subtle page curl effect */
.book-page-static::after,
.book-page-front::after,
.book-page-back::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(225deg,
        var(--page-bg) 0%,
        var(--page-shadow) 40%,
        transparent 60%);
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================
   Page Flip States
   ========================================== */

/* Flipped state for the flipping page (forward flip - left rotation) */
.book-page-flip.flipped {
    transform: rotateY(-180deg);
}

/* Flipped state for backward flip (starts at +180deg, animates to 0deg - right rotation) */
.book-page-flip.flipped-reverse {
    transform: rotateY(180deg);
}

/* ==========================================
   Double-Sided Pages (Front & Back)
   ========================================== */

.book-page-front,
.book-page-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: grid;
    place-items: center;
    border: 1px solid #D4C5A9;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.2),
        inset 0 0 80px rgba(212, 197, 169, 0.15);
}

.book-page-front {
    transform: rotateY(0deg);
    z-index: 2;
    background: linear-gradient(135deg,
        var(--page-bg) 0%,
        var(--page-aged) 100%);
}

.book-page-back {
    transform: rotateY(180deg);
    background: linear-gradient(-135deg,
        var(--page-bg) 0%,
        var(--page-aged) 100%);
}

/* ==========================================
   Page Content Container
   ========================================== */

.page-content {
    position: relative;
    padding: var(--page-padding);
    height: 100%;
    width: 100%;
    overflow-y: auto;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

/* Custom scrollbar */
.page-content::-webkit-scrollbar {
    width: 10px;
}

.page-content::-webkit-scrollbar-track {
    background: rgba(232, 220, 200, 0.3);
    border-radius: 5px;
}

.page-content::-webkit-scrollbar-thumb {
    background: var(--accent-warm);
    border-radius: 5px;
    transition: background 0.3s;
}

.page-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==========================================
   Profile Page
   ========================================== */

.profile-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1.25rem;
}

.profile-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px double var(--accent-warm);
}

.profile-name {
    font-family: var(--font-handwritten);
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.profile-subtitle {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-style: italic;
    color: var(--accent-warm);
    font-weight: 400;
}

.profile-photo {
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 340px;
    flex-shrink: 1;
}

.polaroid {
    position: relative;
    background: #fff;
    padding: 12px 12px 50px;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.2),
        inset 0 -2px 6px rgba(0, 0, 0, 0.05);
    transform: rotate(-2deg);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.polaroid:hover {
    transform: rotate(0deg) scale(1.02);
}

.polaroid img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.polaroid-caption {
    position: absolute;
    bottom: 14px;
    left: 12px;
    right: 12px;
    font-family: var(--font-handwritten);
    font-size: 1.35rem;
    color: #555;
    text-align: center;
}

.tape {
    position: absolute;
    background: rgba(255, 248, 220, 0.8);
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.tape.top {
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
    width: 100px;
    height: 28px;
}

.profile-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    flex-shrink: 0;
}

.info-item {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 2px solid rgba(212, 197, 169, 0.4);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent-warm);
    transform: translateY(-2px);
}

.info-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent-warm);
    margin-bottom: 0.35rem;
}

.info-value {
    font-family: var(--font-handwritten);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.profile-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    flex-shrink: 0;
}

.profile-trait {
    padding: 0.5rem 1.125rem;
    background: #fff;
    border: 2px solid var(--accent-warm);
    border-radius: 50px;
    font-family: var(--font-casual);
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-trait:hover {
    background: var(--accent-warm);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3);
}

/* ==========================================
   Story Pages
   ========================================== */

.story-page {
    font-family: var(--font-body);
    font-size: 1.25rem;
    line-height: 2;
    color: var(--text-primary);
}

.story-page h3 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.2;
    text-align: center;
    border-bottom: 2px solid var(--accent-warm);
    padding-bottom: 1rem;
}

.story-page p {
    margin-bottom: 1.75rem;
    text-align: justify;
    text-indent: 2.5rem;
    hyphens: auto;
}

.story-page p:first-of-type::first-letter {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 700;
    float: left;
    line-height: 0.8;
    margin: 0.1em 0.2em 0 0;
    color: var(--accent-warm);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   Photo Collage
   ========================================== */

.photo-collage {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem 1.75rem;
}

.collage-header {
    text-align: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.collage-title {
    font-family: var(--font-handwritten);
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.collage-ornament {
    font-size: 1rem;
    color: var(--accent-warm);
    opacity: 0.6;
}

.collage-grid {
    position: relative;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.25rem;
    padding: 0.5rem;
}

.memory-photo {
    position: relative;
    background: #fff;
    padding: 8px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.memory-photo-1 {
    transform: rotate(-1.5deg);
    z-index: 1;
}

.memory-photo-2 {
    transform: rotate(2deg);
    z-index: 2;
}

.memory-photo-3 {
    transform: rotate(1.5deg);
    z-index: 3;
}

.memory-photo-4 {
    transform: rotate(-2.5deg);
    z-index: 4;
}

.memory-photo:hover {
    transform: rotate(0deg) scale(1.08);
    z-index: 10;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.25),
        0 2px 6px rgba(0, 0, 0, 0.15);
}

.photo-corners {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.corner {
    position: absolute;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg,
        rgba(212, 197, 169, 0.9) 0%,
        rgba(212, 197, 169, 0.6) 100%);
    box-shadow:
        inset -1px -1px 2px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.corner.top-left {
    top: 0;
    left: 0;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.corner.top-right {
    top: 0;
    right: 0;
    clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.corner.bottom-left {
    bottom: 0;
    left: 0;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.corner.bottom-right {
    bottom: 0;
    right: 0;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.memory-photo img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.photo-caption {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-handwritten);
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

/* ==========================================
   Intro Page (First Page Left Side)
   ========================================== */

.intro-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    height: 100%;
    text-align: center;
}

.intro-ornament {
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.intro-ornament svg {
    color: var(--accent-warm);
    opacity: 0.6;
    width: 50px;
    height: 50px;
}

.intro-title {
    font-family: var(--font-display);
    font-size: 3.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
    line-height: 1.1;
    flex-shrink: 0;
}

.intro-divider {
    width: 70px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--accent-warm),
        transparent);
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.intro-text {
    font-family: var(--font-body);
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    max-width: 360px;
}

.intro-text strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.intro-benefits {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.85rem 0;
    align-items: flex-start;
    width: 100%;
    max-width: 280px;
}

.intro-benefit {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.benefit-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-warm);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.benefit-text {
    font-weight: 500;
}

.intro-signature {
    font-family: var(--font-handwritten);
    font-size: 1.6rem;
    color: var(--text-secondary);
    margin-top: 0.85rem;
    flex-shrink: 0;
}

/* ==========================================
   CTA Page
   ========================================== */

.cta-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2.5rem;
    height: 100%;
}

.cta-heart {
    width: 140px;
    height: 140px;
    color: var(--accent-warm);
    opacity: 0.4;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.cta-heading {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.2;
}

.cta-text {
    font-family: var(--font-body);
    font-size: 1.5rem;
    line-height: 1.8;
    color: var(--text-primary);
    max-width: 550px;
    font-style: italic;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 3.5rem;
    background: var(--text-secondary);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    border: 3px solid var(--accent-warm);
    border-radius: 60px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 10px 30px rgba(93, 78, 55, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-button:hover {
    background: var(--accent-warm);
    color: var(--text-secondary);
    transform: translateY(-4px);
    box-shadow:
        0 15px 40px rgba(201, 169, 97, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* ==========================================
   Navigation Controls
   ========================================== */

.book-navigation {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 1rem 2rem;
    background: rgba(249, 246, 240, 0.1);
    border-radius: 60px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(201, 169, 97, 0.2);
}

.nav-btn {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 246, 240, 0.95);
    border: 2px solid var(--accent-warm);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.nav-btn svg {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    background: #fff;
    transform: scale(1.15);
    box-shadow: 0 6px 24px rgba(201, 169, 97, 0.4);
}

.nav-btn:hover:not(:disabled) svg {
    transform: scale(1.1);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #ccc;
    transform: none !important;
}

.nav-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.page-indicator {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--page-bg);
    min-width: 100px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 1400px) {
    .book {
        max-width: 1000px;
        height: calc(var(--baseline) * 50);
    }

    .profile-name {
        font-size: 3.5rem;
    }

    .story-page {
        font-size: 1.125rem;
    }
}

@media (max-width: 1024px) {
    .book {
        max-width: 800px;
        height: calc(var(--baseline) * 42);
    }

    .page-content {
        padding: calc(var(--baseline) * 3);
    }

    .profile-name {
        font-size: 3rem;
    }

    .story-page h3 {
        font-size: 2.5rem;
    }

    .story-page {
        font-size: 1rem;
        line-height: 1.8;
    }
}

@media (max-width: 768px) {
    .book {
        max-width: 600px;
        height: calc(var(--baseline) * 35);
    }

    .page-content {
        padding: calc(var(--baseline) * 2);
    }

    .profile-name {
        font-size: 2.5rem;
    }

    .photo-collage {
        padding: 1rem;
    }

    .collage-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 2rem;
    }

    .memory-photo img {
        height: 180px;
    }

    .memory-photo-1,
    .memory-photo-2,
    .memory-photo-3,
    .memory-photo-4 {
        transform: rotate(0deg);
    }

    .book-navigation {
        gap: 1.5rem;
    }

    .nav-btn {
        width: 56px;
        height: 56px;
    }

    /* ==========================================
       Mobile stacked book (no 3D flip spread)
       ========================================== */
    .book-modal.mobile-view .book-container {
        height: 100vh;
        height: 100dvh;
        max-width: 100%;
        padding: 0;
        gap: 0;
        justify-content: flex-start;
    }

    .book-modal.mobile-view .book-wrapper {
        display: block;
        perspective: none;
        width: 100%;
        max-width: 100%;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4.5rem 0 2rem;
    }

    .book-modal.mobile-view .book {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
        box-shadow: none;
        filter: none;
        transform-style: flat;
    }

    .book-modal.mobile-view .book-navigation {
        display: none;
    }

    .book-mobile-page {
        background: linear-gradient(135deg, var(--page-bg) 0%, var(--page-aged) 100%);
        border-top: 1px solid #D4C5A9;
        padding: 2rem 1.5rem;
    }

    .book-mobile-page:first-child {
        border-top: none;
    }

    .book-mobile-page .profile-page,
    .book-mobile-page .story-page,
    .book-mobile-page .photo-collage,
    .book-mobile-page .cta-page {
        height: auto;
    }

    .book-mobile-page .photo-collage {
        padding: 0;
    }

    .book-mobile-page .story-page h3 {
        font-size: 2rem;
    }

    .book-mobile-page .cta-page {
        gap: 1.5rem;
    }

    .book-mobile-page .cta-heart {
        width: 90px;
        height: 90px;
    }

    .book-mobile-page .cta-heading {
        font-size: 2.25rem;
    }

    .book-mobile-page .cta-text {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .book-container {
        padding: 1rem;
    }

    .book {
        height: calc(var(--baseline) * 30);
    }

    .page-content {
        padding: calc(var(--baseline) * 1.5);
    }

    .book-close {
        top: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }

    .profile-name {
        font-size: 2rem;
    }

    .story-page {
        font-size: 0.9375rem;
    }

    .nav-btn {
        width: 48px;
        height: 48px;
    }

    .profile-info {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Accessibility & Interactions
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .book-page,
    .book input[type="radio"]:checked + .book-page,
    .polaroid,
    .collage-photo,
    .nav-btn,
    .cta-button {
        transition: none;
    }

    .cta-heart {
        animation: none;
    }

    .profile-page,
    .story-page,
    .cta-page {
        animation: none;
    }
}

/* Print styles */
@media print {
    .book-modal {
        position: static;
        background: white;
    }

    .book-backdrop,
    .book-close,
    .book-navigation {
        display: none;
    }

    .page-content {
        overflow: visible;
    }
}
