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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    overflow-x: hidden;
}

/* === Nav === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
}

.nav a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav a:hover {
    color: #fff;
}

.nav-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #fff;
    letter-spacing: 2px;
}

/* === Hero === */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    background: #0a0a0f;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(138, 43, 226, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(231, 76, 60, 0.06) 0%, transparent 50%);
}

.hero-label {
    font-size: 0.75rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #8a2be2;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeUp 0.8s 0.2s forwards;
    position: relative;
}

.hero-brand {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(2rem, 6vw, 4rem);
    color: #fff;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeUp 0.8s 0.4s forwards;
    position: relative;
    text-shadow: 0 0 30px rgba(138, 43, 226, 0.3);
}

.hero-sub {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    font-weight: 400;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: #e74c3c;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeUp 0.8s 0.6s forwards;
    position: relative;
}

.hero-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.4);
    max-width: 500px;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeUp 0.8s 0.8s forwards;
    position: relative;
}

.page-count {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1.5rem;
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 50px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    opacity: 0;
    animation: fadeUp 0.8s 1s forwards;
    position: relative;
}

.page-count strong {
    color: #8a2be2;
    font-size: 1.2rem;
}

.scroll-line {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, #8a2be2, transparent);
    opacity: 0;
    animation: fadeUp 0.8s 1.2s forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Book Viewer === */
.viewer-section {
    padding: 4rem 2rem;
    background: #0e0e14;
    position: relative;
}

.viewer-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(138, 43, 226, 0.3), transparent);
}

.book-viewer {
    max-width: 900px;
    margin: 0 auto;
}

.book-display {
    position: relative;
    background: #111118;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
}

/* Top bar like a real app viewer */
.viewer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.viewer-dots {
    display: flex;
    gap: 6px;
}

.viewer-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.viewer-dots span:nth-child(1) {
    background: #e74c3c;
}

.viewer-dots span:nth-child(2) {
    background: #f39c12;
}

.viewer-dots span:nth-child(3) {
    background: #2ecc71;
}

.viewer-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
}

.viewer-page-info {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: #8a2be2;
    letter-spacing: 1px;
}

/* Image display */
.book-image-wrap {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.book-image-wrap img {
    width: 100%;
    display: block;
    transition: transform 0.3s;
}

.book-image-wrap:hover img {
    transform: scale(1.01);
}

.book-image-wrap::after {
    content: 'Click to view full size';
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    letter-spacing: 1px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.book-image-wrap:hover::after {
    opacity: 1;
}

/* Controls */
.book-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.book-btn {
    padding: 0.7rem 2rem;
    background: rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.3);
    color: #8a2be2;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.book-btn:hover {
    background: rgba(138, 43, 226, 0.2);
    border-color: #8a2be2;
}

.book-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: #fff;
    min-width: 80px;
    text-align: center;
}

.page-display span {
    color: rgba(255, 255, 255, 0.3);
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 2px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #8a2be2, #e74c3c);
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* Thumbnails */
.book-thumbs {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
}

.book-thumb {
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.4;
    transition: all 0.2s;
}

.book-thumb:hover {
    opacity: 0.8;
}

.book-thumb.active {
    border-color: #8a2be2;
    opacity: 1;
    box-shadow: 0 0 12px rgba(138, 43, 226, 0.3);
}

.book-thumb img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

/* === Process Section === */
.process-section {
    padding: 6rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.process-header {
    text-align: center;
    margin-bottom: 4rem;
}

.process-header .label {
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #8a2be2;
    margin-bottom: 0.8rem;
}

.process-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #fff;
}

.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 11px;
    width: 2px;
    background: linear-gradient(to bottom, #8a2be2, #e74c3c, transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s, transform 0.6s;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -3rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #8a2be2;
    border: 3px solid #0a0a0f;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.4);
}

.timeline-step {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: #8a2be2;
    margin-bottom: 0.3rem;
}

.timeline-item h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.timeline-item p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.7;
}

/* === Gallery Sections === */
.gallery-section {
    padding: 5rem 2rem;
    background: #0e0e14;
    position: relative;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(138, 43, 226, 0.3), transparent);
}

.gallery-header {
    text-align: center;
    margin-bottom: 3rem;
}

.gallery-header .label {
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #8a2be2;
    margin-bottom: 0.8rem;
}

.gallery-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.gallery-header p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    max-width: 550px;
    margin: 0 auto;
}

.gallery-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.gallery-grid-2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 700px;
}

.gallery-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(138, 43, 226, 0.1);
    transition: opacity 0.6s, transform 0.6s, border-color 0.3s, box-shadow 0.3s;
    opacity: 0;
    transform: translateY(20px);
}

.gallery-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-card:hover {
    border-color: rgba(138, 43, 226, 0.5);
    box-shadow: 0 8px 30px rgba(138, 43, 226, 0.15);
}

.gallery-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.gallery-card:hover img {
    transform: scale(1.03);
}

.gallery-card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.8rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    text-align: center;
}

.gallery-card-label span {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* === Colors Section === */
.colors-section {
    padding: 5rem 2rem;
    background: #0e0e14;
}

.colors-section::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(138, 43, 226, 0.3), transparent);
    margin-bottom: 4rem;
}

.colors-header {
    text-align: center;
    margin-bottom: 3rem;
}

.colors-header .label {
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #8a2be2;
    margin-bottom: 0.8rem;
}

.colors-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: #fff;
}

.color-palette {
    max-width: 700px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.color-swatch {
    text-align: center;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s, transform 0.5s;
}

.color-swatch.visible {
    opacity: 1;
    transform: translateY(0);
}

.swatch-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 0.8rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s;
}

.swatch-circle:hover {
    transform: scale(1.1);
}

.color-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.2rem;
}

.color-hex {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
}

/* === Lightbox === */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 2rem;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 0.7;
}

/* === Footer === */
.page-footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid rgba(138, 43, 226, 0.1);
}

.page-footer a {
    color: #8a2be2;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    transition: opacity 0.3s;
}

.page-footer a:hover {
    opacity: 0.7;
}

/* === Responsive === */
@media (max-width: 768px) {
    .book-display {
        padding: 1rem;
    }

    .book-thumbs {
        grid-template-columns: repeat(4, 1fr);
    }

    .color-palette {
        grid-template-columns: repeat(3, 1fr);
    }

    .viewer-title {
        display: none;
    }
}