/* Spooky Teaser Background */
.spooky-bg {
    background: radial-gradient(circle at center, #1a1a24 0%, #050508 100%) !important;
    position: relative;
    overflow: hidden;
}

.spooky-fog {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://www.transparenttextures.com/patterns/stardust.png');
    opacity: 0.15;
    animation: fog-drift 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.spooky-fog-layer2 {
    position: absolute;
    top: -50%; left: -50%; right: -50%; bottom: -50%;
    background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 1;
    animation: pulse-darkness 8s ease-in-out infinite;
}

@keyframes pulse-darkness {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes fog-drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50px, 50px); }
}

/* Teaser Webtoon Header */
.teaser-webtoon-header {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 60px; /* Added top margin */
    position: relative;
    z-index: 2;
}

/* Sentence by Sentence Styling */
.teaser-dynamic-text-container {
    display: flex;
    flex-direction: column;
    gap: 60px; /* 대화형 웹툰 느낌의 스크롤을 유지하되, 사진과 텍스트가 바로 근처에 위치하도록 간격 축소 */
    padding: 0 20px 100px 20px;
    position: relative;
    z-index: 2;
    margin-bottom: 60px;
}

.webtoon-sentence {
    font-family: 'Noto Serif KR', serif; /* Traditional, serious font */
    font-size: 19px;
    line-height: 1.9;
    color: var(--text-main);
    text-align: center;
    padding: 16px 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    opacity: 0;
    transform: translateY(50px); /* Slide up distance increased */
    transition: opacity 1.5s ease-out, transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smoother fade-in */
    word-break: keep-all;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.8); /* Added shadow to make text readable against background */
}

.webtoon-sentence.first-sentence {
    font-size: 26px;
    font-weight: 700;
    color: var(--accent-gold-light);
    border: none;
    background: transparent;
    box-shadow: none;
    text-shadow: 0 0 20px rgba(218, 165, 32, 0.5), 0 4px 12px rgba(0,0,0,0.8);
}

.webtoon-sentence.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reveal on Scroll */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s ease-out;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Teaser Nav */
.teaser-nav {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

/* ==========================================
   무료 맛보기 — 마녀가 들려주는 첫 장 (사진과 짧은 문단이 번갈아 놓이는 세로 이야기)
   ========================================== */
/* display/flex-direction/position 은 .funnel-step 이 이미 정의한다.
   여기서 display 를 다시 선언하면 .funnel-step 의 display:none 을 덮어써
   비활성 상태에서도 화면이 노출된다. 절대 추가하지 말 것. */

/* style.css 의 `#step-teaser, .spooky-bg` 가 한지 텍스처 배경을 !important 로 깔고 있다.
   컷과 배경색이 다르면 이음새에서 갈색 띠가 비쳐 화면이 튀므로 확실히 덮는다. */
#step-teaser.shrine-step {
    background: #07070b !important;
}

/* 맛보기는 사진이 화면을 꽉 채우는 몰입 화면이다.
   앱 컨테이너의 한지 배경과 하단 푸터가 조금이라도 보이면 몰입이 깨진다. */
#app-container.shrine-immersive {
    background: #07070b !important;
}

#app-container.shrine-immersive .app-footer {
    display: none !important;
}

.shrine-step [hidden] {
    display: none !important;
}

.shrine-scroll {
    background: #07070b;
    overflow-x: hidden;
}

/* --- 첫 장 머리: 성황당에 앉은 마녀 사진 아래에 작은 머리글과 마녀의 첫마디 --- */
.tale-head {
    padding: 14px 28px 26px;
    text-align: center;
}

/* 맨 위 마녀 사진. 위쪽 80px 은 사이트 머리 메뉴가 덮으므로 그 아래로 숨 쉴 여백을 더 둔다. */
.tale-img.tale-img--witch {
    margin-top: 100px;
}

.tale-eyebrow {
    margin: 0 0 12px;
    font-family: var(--font-heading);
    font-size: 12px;
    letter-spacing: 2px;
    color: rgba(218, 165, 32, 0.78);
}

.tale-title {
    margin: 0;
    font-family: 'Noto Serif KR', serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: -0.5px;
    color: #F4EBDD;
    word-break: keep-all;
}

/* --- 사진: 화면 폭을 꽉 채우고, 위아래 끝은 배경색으로 녹인다 --- */
.tale-img {
    margin: 6px 0;
    overflow: hidden;
    background: #07070b;
}

.tale-img img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 13%, #000 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 13%, #000 85%, transparent 100%);
    /* 글(0.9s)보다 느리게 간다. 사진이 먼저 어둠 속에서 천천히 배어 나오고 글이 뒤따른다. */
    opacity: 1;
    transform: none;
    transition: opacity 2.2s ease-out,
                filter 2.2s ease-out,
                transform 3.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 기본값은 '보임'이고 is-veiled 일 때만 어둠에 잠긴다. 스크립트가 멈춰도 사진은 반드시 보여야 한다. */
.tale-img.is-veiled img {
    opacity: 0;
    filter: saturate(0.2) brightness(0.35) blur(12px);
    transform: scale(1.06);
}

/* --- 글 --- */
.tale-hook,
.tale-p,
.tale-key {
    opacity: 1;
    transform: none;
    transition: opacity 0.9s ease-out, transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.tale-hook.is-veiled,
.tale-p.is-veiled,
.tale-key.is-veiled,
.tale-head.is-veiled,
.tale-premium.is-veiled {
    opacity: 0;
    transform: translateY(20px);
}

.tale-head,
.tale-premium {
    transition: opacity 0.9s ease-out, transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.tale-hook {
    margin: 26px 28px 0;
    font-family: 'Noto Serif KR', serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.55;
    letter-spacing: -0.4px;
    color: var(--accent-gold-light);
    word-break: keep-all;
}

.tale-p {
    margin: 22px 28px;
    font-family: 'Noto Serif KR', serif;
    font-size: 16px;
    line-height: 1.95;
    letter-spacing: -0.3px;
    color: #DCD0BE;
    word-break: keep-all;
    white-space: pre-line;
}

.tale-p .highlight-yellow,
.tale-key .highlight-yellow {
    color: var(--accent-gold-light);
    font-weight: 700;
}

/* --- 마녀의 한마디: 화면 가운데 크게 박히는 핵심 --- */
.tale-key {
    padding: 46px 28px 40px;
    text-align: center;
}

.tale-key-label {
    display: block;
    margin-bottom: 14px;
    font-family: var(--font-heading);
    font-size: 11.5px;
    letter-spacing: 3px;
    color: rgba(218, 165, 32, 0.8);
}

.tale-key-text {
    margin: 0;
    font-family: 'Noto Serif KR', serif;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.65;
    letter-spacing: -0.4px;
    color: var(--accent-gold-light);
    word-break: keep-all;
    text-shadow: 0 0 18px rgba(218, 165, 32, 0.25);
}

.tale-key-rule {
    display: block;
    width: 1px;
    height: 44px;
    margin: 22px auto 0;
    background: linear-gradient(to bottom, rgba(218, 165, 32, 0.7), rgba(218, 165, 32, 0));
}

/* --- 본편 안내 카드 --- */
.tale-premium {
    margin: 40px 20px 0;
    padding: 26px 20px 24px;
    border: 1px solid rgba(218, 165, 32, 0.45);
    border-radius: 18px;
    background: radial-gradient(120% 90% at 50% 0%, rgba(218, 165, 32, 0.1) 0%, rgba(7, 7, 11, 0) 60%), #0d0b10;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.6);
    text-align: center;
    word-break: keep-all;
}

.tale-premium-eyebrow {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--accent-gold);
}

/* 붉은 인주로 찍은 낙관 — 바탕을 칠하고 '天機'를 세로로 비워 새긴 음각 도장 */
.tale-premium-mark {
    width: 40px;
    height: 40px;
    margin: 16px auto 14px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    color: #F6E7C8;
    background: linear-gradient(160deg, #B42A22 0%, #8E1A16 100%);
    box-shadow: inset 0 0 0 2px #9E1F1A, inset 0 0 0 3px rgba(246, 231, 200, 0.55), 0 2px 10px rgba(0, 0, 0, 0.5);
    transform: rotate(-5deg);
}

.tale-premium-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-gold-light);
}

.tale-premium-desc {
    margin: 10px 0 16px;
    font-size: 13px;
    line-height: 1.7;
    color: rgba(240, 232, 212, 0.68);
}

/* 네 가지 구성을 2×2 로 가지런히 둔다 */
.tale-premium-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-width: 280px;
    margin: 0 auto;
}

.tale-premium-chips span {
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
    border: 1px solid rgba(218, 165, 32, 0.4);
    border-radius: 999px;
    font-size: 11.5px;
    color: rgba(240, 220, 160, 0.9);
    background: rgba(218, 165, 32, 0.06);
}

@media (prefers-reduced-motion: reduce) {
    .tale-img img,
    .tale-head,
    .tale-hook,
    .tale-p,
    .tale-key,
    .tale-premium {
        transition: opacity 0.2s linear;
    }
    .tale-img.is-veiled img {
        filter: none;
        transform: none;
    }
    .tale-hook.is-veiled,
    .tale-p.is-veiled,
    .tale-key.is-veiled,
    .tale-head.is-veiled,
    .tale-premium.is-veiled {
        transform: none;
    }
}

/* --- 마무리 CTA: 본편 안내 카드 바로 아래 --- */
.shrine-cta {
    background: #07070b;
    padding: 22px 20px calc(40px + env(safe-area-inset-bottom));
}
