/* INTRO HOOK OVERLAY */
#intro-hook {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    pointer-events: all;
    transition: opacity 1s ease-out;
}

#intro-hook.fade-out {
    opacity: 0;
    pointer-events: none;
}

.intro-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
    /* Block clicks when hidden */
}

.intro-slide.active {
    opacity: 1;
    z-index: 10;
    pointer-events: all;
}

/* === SLIDE 1: SOCIAL MEDIA STORY INPUT === */
.story-bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    width: 100%;
    height: 100%;
    /* Sunset Vibe */
    background: linear-gradient(to bottom, #f97316, #ec4899, #8b5cf6);
    /* Sunset Vibe */
    z-index: -1;
}

.story-ui-header {
    position: absolute;
    top: 40px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.story-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.story-avatar {
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
}

.story-sticker-container {
    background: #fff;
    padding: 3.5rem 2rem 2rem 2rem;
    /* larger padding */
    border-radius: 16px;
    /* slightly rounder */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 85%;
    width: 340px;
    /* Increased from 280px */
    transform: none;
    margin-bottom: 50px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
    /* Ensure hardware acceleration for crispness */
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: none;
}

.question-header-avatar {
    width: 56px;
    /* Larger avatar */
    height: 56px;
    background-color: #ccc;
    border-radius: 50%;
    position: absolute;
    top: -28px;
    /* Offset for larger size */
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.story-question {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 500;
    color: #000;
    font-size: 1.35rem;
    /* Larger text */
    line-height: 1.3;
    margin: 0;
    text-transform: none;
}

.story-input-wrapper {
    display: flex;
    background: #f0f0f0;
    /* Light Gray */
    border-radius: 8px;
    /* Slightly rounded */
    padding: 2px;
    margin-top: 5px;
    border: 1px solid transparent;
    /* Remove pill shape */
}

#intro-word-input {
    border: none;
    background: transparent;
    padding: 14px 18px;
    /* Larger input area */
    flex: 1;
    outline: none;
    font-size: 1.1rem;
    /* Larger input text */
    font-weight: 400;
    color: #333;
    text-align: center;
}

#intro-word-submit {
    display: none;
    /* Hide button */
}

.story-chips-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 20px;
}

.story-chip {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 12px 24px;
    /* Larger touch target */
    border-radius: 40px;
    color: white;
    font-size: 1.05rem;
    /* Larger text */
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.story-chip:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.5);
}



.hashtag-header {
    font-size: 0.9rem;
    /* Smaller, cleaner */
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    margin-left: 0;
    /* Center it */
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 18px;
    border-radius: 100px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.viz-title {
    color: #fff;
    font-size: 2.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.viz-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 500;
    font-family: "Inter", sans-serif;
}

#intro-word-cloud {
    width: 90%;
    max-width: 900px;
    height: 60vh;
    max-height: 600px;
    min-height: 350px;
    margin: 0 auto 2rem auto;
    position: relative;
    border-radius: 40px;

    /* Dark Glass Aesthetic */
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);

    display: flex;
    /* Centering SVG */
    justify-content: center;
    align-items: center;
}

/* Tooltip: Instagram "Tag" Style */
.word-tooltip {
    position: fixed;
    background: rgba(38, 38, 38, 0.95);
    /* Dark gray/black like IG tags */
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    /* Slightly tighter radius */
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -140%);
    /* Lift higher */
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Arrow for tag */
.word-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    /* Stick closer */
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: rgba(38, 38, 38, 0.95) transparent transparent transparent;
}




/* === STORY PROGRESS BAR === */
.story-progress-container {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 4px;
    display: flex;
    gap: 4px;
    /* Instagram gap */
    z-index: 200;
}

.story-progress-bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    /* Clickable */
}

.story-progress-bar .progress-fill {
    width: 0%;
    height: 100%;
    background: #fff;
    transition: width 0s;
    /* Reset default to instant for clearing */
}

/* Active: Linear Fill Animation */
.story-progress-bar.active .progress-fill {
    width: 100%;
    transition: width 15s linear;
    /* "Story" timer feel */
}

/* Completed: Always full, instant */
.story-progress-bar.completed .progress-fill {
    width: 100%;
    transition: none;
}

/* Hover hint */
.story-progress-bar:hover {
    background: rgba(255, 255, 255, 0.5);
}





/* === VISUAL TRANSITIONS === */
.intro-overlay {
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
    /* Ensure hardware acceleration */
    will-change: transform;
}

.intro-overlay.slide-out {
    transform: translateX(-100%);
}

/* === SLIDE 3: REALITY (Insta Vibe) === */
.slide-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: grayscale(0.2) contrast(1.1);
    z-index: 1;
}

#intro-fog-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    /* On top of BG */
    mix-blend-mode: normal;
}

/* Insta Overlay Text Main Container (Kept for layout) */
.insta-story-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 20px 40px;
    pointer-events: none;
}

/* === NEW INSTAGRAM STYLE HEADER === */
.story-user-tag {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    padding: 0;
    pointer-events: none;
    width: 100%;
}

.story-avatar-small {
    width: 38px;
    /* Slightly larger */
    height: 38px;
    background: #ccc;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.story-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.story-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.story-username {
    font-weight: 600;
}

.story-time {
    font-weight: 400;
    opacity: 0.8;
}

.story-music {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.9;
}

.music-icon {
    font-size: 0.7rem;
}

/* === CONTENT LAYER LAYOUT === */
.story-content-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Common Sticker Bases */
.story-sticker {
    position: absolute;
    /* Using absolute for precise placement like user drag-drop */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 20;
}

/* 1. Location Sticker (White Pill) */
.location-sticker.pill-white {
    top: 18%;
    right: 5%;
    background: #fff;
    color: #000;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transform: rotate(1deg);
}

/* 2. Time Sticker (Digital Clock Blocks) */
.time-sticker.digital-clock {
    top: 26%;
    right: 5%;
    transform: rotate(-2deg);
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
}

.time-group {
    display: flex;
    gap: 2px;
}

.time-digit {
    font-family: 'Oswald', sans-serif;
    /* Tall condensed */
    font-size: 3.5rem;
    font-weight: 400;
    color: #ffffff;
    line-height: 1;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.time-ampm-box {
    background: rgba(255, 255, 255, 0.7);
    color: #4c4c4c;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 4px;
    align-self: center;
    margin-right: 6px;
    /* Put AM before? Ref shows AM block then numbers? OR numbers then AM? */
    /* Ref Sunny: AM block (left smaller), then 9 2 3 */
    /* Let's reorder in Flex if needed. HTML has Am last. Flex-flow row-reverse? No, just order. */
    order: -1;
    height: fit-content;
    text-transform: uppercase;
}

/* 3. Hashtag Sticker */
.hashtag-sticker.pill-white {
    top: 38%;
    right: 5%;
    background: #fff;
    color: #000;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 1.1rem;
    transform: rotate(2deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* 4. Main Text (Big & Bold) */
.story-main-text {
    position: absolute;
    bottom: 20%;
    left: 8%;
    font-family: 'Inter', sans-serif;
    /* Fallback to Inter, but we want thick */
    font-weight: 900;
    font-size: 3rem;
    color: #fff;
    line-height: 0.95;
    text-align: left;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lyric-small {
    font-size: 1.5rem;
    /* half of 3rem */
    font-weight: 700;
    opacity: 0.9;
    line-height: 1.1;
}

/* Ensure GIF sticker is still supported if used, but we removed it in HTML */
.gif-sticker {
    /* Legacy support */
    display: none;
}

/* === NAVIGATION BUTTONS === */
.intro-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 1000;
    /* Top most */
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: background 0.2s, transform 0.2s;
}

.intro-close-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

/* === RESTORED ARTICLE CARD STYLES === */
.article-card {
    background: rgba(255, 255, 255, 0.95);
    width: 85%;
    max-width: 400px;
    /* Increased from 350px */
    border-radius: 24px;
    /* More rounded */
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s;
    opacity: 0.5;
    /* Dimmed initially under fog */
}

/* When fog is cleared, pop the card */
.fog-cleared .article-card {
    transform: scale(1);
    opacity: 1;
    cursor: pointer;
    box-shadow: 0 20px 50px rgba(255, 255, 255, 0.2);
}

.article-card-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #eee;
}

.article-card-header span {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.article-thumbnail {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
}

.article-info {
    padding: 16px;
    text-align: left;
}

.article-info h3 {
    margin: 0 0 8px 0;
    color: #000;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.subtitle-small {
    font-size: 0.9rem;
    color: #e1306c;
    /* Insta-like pink/red */
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.article-cta {
    background: #f5f5f5;
    color: #0095f6;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    transition: background 0.2s;
}

.article-card:hover .article-cta {
    background: #eee;
}

/* Initial State of Overlays */
.fog-text-overlay {
    transition: opacity 1s;
}

.fog-cleared .fog-text-overlay {
    opacity: 0;
    pointer-events: none;
}

.fog-cleared #intro-fog-layer {
    transition: opacity 1s;
    opacity: 0;
    pointer-events: none;
}

/* === FIX SWIPE HINT PRECISIOIN === */
.swipe-hint-container {
    position: absolute;
    bottom: 8%;
    /* Below the main text which is at 20% */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: auto;
    z-index: 30;
}

.swipe-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    color: #2d2d2d;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    animation: hint-pulse 2s infinite ease-in-out;
}

.scrub-icon {
    display: inline-block;
    font-size: 1.4rem;
    animation: scrub-wipe 1.5s infinite ease-in-out;
}

@keyframes scrub-wipe {

    0%,
    100% {
        transform: translateX(-8px) rotate(-15deg);
    }

    50% {
        transform: translateX(8px) rotate(5deg);
    }
}