:root {
    --bg-color: #0b0c10;
    --text-main: #f5f5f7;
    --text-muted: #8892b0;
    --text-dark: #4a5568;
    --accent: #1f2833;
    --font-serif: 'Gowun Dodum', sans-serif;
    --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-serif);
    line-height: 2.2;
    word-break: keep-all;
    overflow-wrap: break-word;
    transition: background-color 1.5s ease, color 1.5s ease;
}

/* Base transparent overlays for progressive theme */
.cover-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.6));
}



#app {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Page Transitions */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in-out, visibility 1.5s ease-in-out;
    padding: 2rem;
    overflow-y: auto;
}

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

/* Cover */
.cover-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8;
    z-index: -2;
}

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(11, 12, 16, 0.2), rgba(11, 12, 16, 0.9));
    z-index: -1;
}

.cover-content {
    text-align: center;
    margin-top: 10vh;
    margin-bottom: 3rem;
}

.author-small {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
}

.title {
    font-size: 2.8rem;
    font-weight: 400;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    line-height: 1.4;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    letter-spacing: 0.05em;
    font-weight: 300;
}

/* Content */
.content-container {
    max-width: 650px;
    width: 100%;
    text-align: center;
    margin-bottom: 4rem;
}

.fade-text {
    margin-bottom: 4rem;
    font-size: 1.15rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.8s ease-out, transform 1.8s ease-out;
}

.fade-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.chapter-title {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 5rem;
    letter-spacing: 0.15em;
}

.essay-body {
    text-align: center;
    line-height: 2.4;
}

/* Interactive Elements */
.interactive-container {
    text-align: center;
}

.interactive-title {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.guide-text {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.quote-box {
    border-left: 2px solid var(--text-muted);
    padding: 1.5rem 2rem;
    margin: 0 auto 3rem auto;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--text-main);
    display: inline-block;
    text-align: left;
    line-height: 2.2;
    background: rgba(255, 255, 255, 0.02);
}

textarea {
    width: 100%;
    min-height: 180px;
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--text-main);
    font-family: var(--font-serif);
    font-size: 1.1rem;
    padding: 2rem;
    resize: none;
    outline: none;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    line-height: 2.2;
}

textarea:focus {
    border-color: var(--text-muted);
    box-shadow: 0 0 15px rgba(255,255,255,0.03);
}

textarea::placeholder {
    color: var(--text-dark);
}

.question-text {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    line-height: 1.8;
}

.author-text {
    font-family: var(--font-sans);
    color: var(--text-muted);
    margin-top: 5rem;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

/* Buttons */
.next-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    padding: 15px 30px;
    transition: color 0.4s ease, transform 0.4s ease;
    position: absolute;
    bottom: 4rem;
    right: 4rem;
}

.next-btn:hover {
    color: var(--text-main);
    transform: translateY(-2px);
}

/* Tablet & Mobile Layouts handled at the end of the file */

/* --- Storefront Styles --- */
.store-container {
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.store-header {
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    letter-spacing: 0.1em;
}

.store-main {
    flex: 1;
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 4rem;
    align-items: center;
    gap: 5rem;
}

.multi-book-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3rem;
}

.store-intro {
    max-width: 800px;
}

.book-grid {
    display: flex;
    gap: 4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.book-card {
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 300px;
}

.book-card:hover {
    transform: translateY(-10px);
}

.book-card .book-cover-mockup {
    width: 100%;
    height: 420px;
    margin-bottom: 1.5rem;
}

.book-card-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.book-card-info p {
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.book-card-info .price {
    font-size: 1.2rem;
    margin-bottom: 0;
    display: inline-block;
}

.buy-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background-color: var(--text-main);
    color: var(--bg-color);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 4px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.buy-btn:hover {
    background-color: #fff;
    transform: translateY(-2px);
}

.mockup-title.mockup-title-dark {
    color: #fff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.9), 0 2px 6px rgba(0,0,0,0.9), 0 0 30px rgba(0,0,0,0.4);
}

.purchase-info {
    margin-top: 2rem;
}

.book-showcase {
    flex: 1;
    display: flex;
    justify-content: center;
}

.book-cover-mockup {
    width: 350px;
    height: 500px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1) inset;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.mockup-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    color: #fff;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8);
    line-height: 1.4;
}

.book-info {
    flex: 1;
}

.badge {
    background-color: var(--accent);
    color: var(--text-muted);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    display: inline-block;
}

.store-book-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.store-author {
    font-family: var(--font-sans);
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.store-description {
    font-family: var(--font-sans);
    color: #a0aab5;
    line-height: 1.8;
    margin-bottom: 3rem;
    font-weight: 300;
}

.price {
    font-size: 2rem;
    font-family: var(--font-sans);
    font-weight: 300;
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn {
    font-family: var(--font-sans);
    padding: 1rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    border: none;
}

.btn-primary {
    background-color: var(--text-main);
    color: var(--bg-color);
    font-weight: 500;
}

.btn-primary:hover {
    background-color: #fff;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--accent);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background-color: rgba(255,255,255,0.05);
}

.btn-text {
    background: none;
    color: var(--text-muted);
}
.btn-text:hover { color: var(--text-main); }

.notice-text {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-dark);
}

/* Gate View */
#landing-view, #gate-view {
    transition: opacity 0.5s ease;
}

.hidden-view {
    display: none !important;
}

.active-view {
    display: flex;
}

#gate-view {
    flex: 1;
    justify-content: center;
    align-items: center;
}

.gate-box {
    background-color: rgba(255,255,255,0.02);
    border: 1px solid var(--accent);
    padding: 3rem 2rem;
    border-radius: 8px;
    text-align: center;
    max-width: 550px;
    width: 100%;
}

.gate-box h2 {
    margin-bottom: 1rem;
    font-weight: 400;
    font-size: 1.4rem;
    white-space: nowrap;
}

.gate-box p {
    font-family: var(--font-sans);
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.gate-box input {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: white;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    text-align: center;
    border-radius: 4px;
}

.gate-box input:focus {
    outline: none;
    border-color: var(--text-main);
}

.gate-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.error-msg {
    margin-top: 1.5rem;
    margin-bottom: 0 !important;
    height: 20px;
    font-size: 0.85rem !important;
}

/* --- Responsive Design (Web, Tablet, Mobile) --- */

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
    .store-main {
        padding: 2rem;
        gap: 3rem;
    }
    .book-grid {
        gap: 2rem;
    }
    .title {
        font-size: 2.4rem;
    }
    .content-container {
        max-width: 85%;
    }
    .gate-box {
        max-width: 480px;
    }
    .next-btn {
        right: 2.5rem;
        bottom: 2.5rem;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    .subtitle {
        font-size: 0.95rem;
    }
    .fade-text, .quote-box, textarea {
        font-size: 1rem;
    }
    .page {
        padding: 1.5rem;
    }
    .next-btn {
        bottom: 2rem;
        right: 1.5rem;
        padding: 10px 20px;
    }
    .store-main {
        flex-direction: column;
        padding: 1.5rem;
        gap: 2.5rem;
    }
    .store-book-title {
        font-size: 1.8rem;
    }
    .book-card {
        width: 100%;
        max-width: 320px;
    }
    .book-card .book-cover-mockup {
        height: 400px;
    }
    .action-buttons {
        flex-direction: column;
    }
    .gate-box {
        padding: 2.5rem 1.5rem;
        max-width: 90%;
    }
    .gate-box h2 {
        white-space: normal;
        word-break: keep-all;
        font-size: 1.25rem;
    }
}
