/* ============================================
   DDD Book Website - Splash Page Styles
   ============================================ */

/* Splash Container */
.splash-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Animated Background */
.splash-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.bg-layer {
    position: absolute;
    inset: 0;
}

.layer-1 {
    background: radial-gradient(ellipse at 20% 80%, rgba(194,160,112,0.14) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(95,120,110,0.12) 0%, transparent 50%),
                var(--color-bg);
}

.layer-2 {
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
}

.layer-3 {
    background: linear-gradient(180deg, transparent 0%, var(--color-bg) 100%);
    top: 60%;
}

/* Hero Section */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xxl);
    padding: clamp(1.5rem, 4vw, 3rem);
    animation: fadeInUp 1s ease-out;
}

@media (min-width: 900px) {
    .hero-section {
        flex-direction: row;
        justify-content: center;
        gap: var(--spacing-xxl);
    }
}

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

/* 3D Book */
.book-showcase {
    perspective: 1000px;
}

.book-3d {
    position: relative;
    width: clamp(220px, 45vw, 320px);
    height: clamp(320px, 60vw, 460px);
    transform-style: preserve-3d;
    transform: rotateY(-20deg);
    transition: transform var(--transition-slow);
    cursor: pointer;
}

.book-3d:hover {
    transform: rotateY(-5deg) rotateX(5deg);
}

.book-cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c1810 0%, #1a0f0a 100%);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    box-shadow: 
        inset 0 0 30px rgba(0,0,0,0.5),
        0 0 50px rgba(0,0,0,0.5);
    transform: translateZ(15px);
    overflow: hidden;
}

.book-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, transparent 5%);
}

.cover-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: var(--spacing-xl);
    text-align: center;
    background: 
        radial-gradient(ellipse at center, rgba(212,175,55,0.1) 0%, transparent 70%);
}

.cover-ornament {
    width: 120px;
    height: 30px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 30'%3E%3Cpath d='M0 15 Q30 0 60 15 Q90 30 120 15' stroke='%23000' fill='none' stroke-width='2'/%3E%3C/svg%3E");
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 30'%3E%3Cpath d='M0 15 Q30 0 60 15 Q90 30 120 15' stroke='%23000' fill='none' stroke-width='2'/%3E%3C/svg%3E");
    opacity: 0.6;
}

.cover-ornament.top { margin-bottom: var(--spacing-lg); }
.cover-ornament.bottom { margin-top: var(--spacing-lg); }

.book-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gold);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

.cover-subtitle {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--color-gold-light);
    opacity: 0.8;
    margin-bottom: var(--spacing-lg);
}

.cover-author {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.book-spine {
    position: absolute;
    left: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, #1a0f0a 0%, #2c1810 100%);
    transform: rotateY(-90deg) translateZ(15px) translateX(-15px);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.book-spine::after {
    content: 'DDD';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--color-gold);
    letter-spacing: 2px;
    white-space: nowrap;
}

.book-pages {
    position: absolute;
    right: 0;
    top: 5px;
    width: 28px;
    height: calc(100% - 10px);
    background: repeating-linear-gradient(
        to right,
        #f5f5dc 0px,
        #f5f5dc 1px,
        #e8e8d0 1px,
        #e8e8d0 2px
    );
    transform: translateZ(-15px);
    border-radius: 0 2px 2px 0;
}

/* Hero Text */
.hero-text {
    text-align: center;
    max-width: 500px;
}

@media (min-width: 900px) {
    .hero-text {
        text-align: left;
    }
}

.tagline {
    font-family: var(--font-body);
    font-size: clamp(1.15rem, 2.6vw, 1.5rem);
    font-style: italic;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xl);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

@media (min-width: 900px) {
    .hero-stats {
        justify-content: flex-start;
    }
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-gold);
}

.stat-label {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
}

@media (max-width: 700px) {
    .cta-buttons {
        width: 100%;
    }

    .cta-buttons .btn {
        flex: 1 1 100%;
        justify-content: center;
    }
}

@media (min-width: 900px) {
    .cta-buttons {
        justify-content: flex-start;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-text-muted);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    animation: bounce 2s infinite;
}

@media (max-width: 700px) {
    .scroll-indicator {
        bottom: var(--spacing-lg);
        font-size: 0.65rem;
    }
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--color-text-muted);
    border-bottom: 2px solid var(--color-text-muted);
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* Main Content */
.main-content {
    padding: var(--spacing-xxl) var(--spacing-lg);
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Preview Section */
.preview-section {
    margin-bottom: var(--spacing-xxl);
}

.preview-content {
    display: grid;
    gap: var(--spacing-xl);
}

@media (min-width: 768px) {
    .preview-content {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}

.preview-text .lead {
    font-size: 1.35rem;
    color: var(--color-gold-light);
    font-style: italic;
}

.preview-quote {
    background: var(--color-surface);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-gold);
    box-shadow: var(--shadow-sm);
}

.preview-quote blockquote {
    font-style: italic;
    font-size: 1.1rem;
}

.preview-quote cite {
    display: block;
    margin-top: var(--spacing-md);
    font-style: normal;
    color: var(--color-gold);
    font-size: 0.9rem;
}

/* TOC Section */
.toc-section {
    margin-bottom: var(--spacing-xxl);
}

.toc-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

.filter-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    background: var(--color-surface);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-text);
}

.filter-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.toc-grid {
    display: grid;
    gap: var(--spacing-lg);
}

.toc-category {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border);
}

.category-title {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

.toc-items {
    display: grid;
    gap: var(--spacing-sm);
}

@media (min-width: 600px) {
    .toc-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .toc-items {
        grid-template-columns: repeat(3, 1fr);
    }
}

.toc-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-surface-light);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    color: var(--color-text);
    transition: all var(--transition-fast);
    min-height: 52px;
}

.toc-item:hover {
    border-color: var(--color-accent);
    transform: translateX(4px);
    color: var(--color-text);
}

.toc-item.chapter .item-number {
    background: var(--color-chapter);
}

.toc-item.interjection .item-badge {
    background: var(--color-interjection);
}

.toc-item[data-type="front-matter"] .item-number {
    background: var(--color-front-matter);
}

.item-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--color-accent);
    color: white;
    border-radius: 50%;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.item-badge {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-interjection);
    color: white;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.item-title {
    font-size: 0.95rem;
    line-height: 1.3;
}

/* Progress Section */
.progress-section {
    margin-bottom: var(--spacing-xxl);
}

.progress-content {
    background: var(--color-surface);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.progress-bar-container {
    height: 8px;
    background: var(--color-surface-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-gold));
    border-radius: var(--radius-xl);
    transition: width var(--transition-slow);
}

.progress-stats {
    font-family: var(--font-ui);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

.progress-stats span {
    color: var(--color-gold);
    font-weight: 600;
}

/* Hidden State */
.toc-item.hidden {
    display: none;
}

/* Touch interactions */
@media (hover: none) and (pointer: coarse) {
    .book-3d {
        transform: rotateY(-10deg);
    }

    .book-3d:hover {
        transform: rotateY(-10deg);
    }

    .toc-item:active {
        transform: scale(0.98);
    }
    
    .btn:active {
        transform: scale(0.95);
    }
}
