/* ==========================================================================
   1. Variables & Design Tokens (Dark Mode Palette)
   ========================================================================== */
:root {
    /* Colors */
    --charcoal: #2A2A2A;        /* Primary dark background */
    --almost-black: #1a1a1a;    /* Deeper sections */
    --electric-pink: #FF1755;   /* Accent, headlines, energy */
    --tokyo-blue: #00D4FF;      /* Interactive elements, highlights */
    --gold: #FFB300;            /* CTA buttons, special moments */
    --warm-white: #FAFAFA;      /* Light sections, contrast */
    
    --text-primary: #333333;    /* Body text on light backgrounds */
    --text-light: #E0E0E0;      /* Body text on dark backgrounds */
    --text-white: #FFFFFF;      /* Headlines on dark backgrounds */

    /* Fonts */
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    
    /* Spacing - Generous breathing room */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 48px;
    --space-xl: 80px;
    --space-2xl: 120px;
    --space-3xl: 160px;
    
    /* Typography Scale (Desktop) */
    --text-display: 56px;
    --text-headline: 36px;
    --text-body: 24px;
    --text-small: 16px;
    --text-tiny: 14px;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-stack);
    background-color: var(--charcoal);
    color: var(--text-light);
    line-height: 1.8; /* More breathing room in text */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--tokyo-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
    border-bottom: 1px solid var(--tokyo-blue);
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* Utility Classes */
.dark-bg { background-color: var(--charcoal); }
.almost-black-bg { background-color: var(--almost-black); }
.white-text { color: var(--text-white); }
.light-text { color: var(--text-light); }
.pink-text { 
    color: var(--electric-pink); 
    font-weight: 700; /* Bold for emphasis, no underline */
}
.gold-text { color: var(--gold); font-weight: 700; }

/* ==========================================================================
   3. Typography
   ========================================================================== */
.display-text {
    font-size: var(--text-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.headline-text {
    font-size: var(--text-headline);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-xl);
}

.body-text {
    font-size: var(--text-body);
    font-weight: 400;
    line-height: 1.8;
}

.small-text {
    font-size: var(--text-small);
    font-weight: 400;
    line-height: 1.6;
}

.tiny-text {
    font-size: var(--text-tiny);
    font-weight: 400;
    line-height: 1.5;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip Link (Accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--electric-pink);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus Indicators */
*:focus {
    outline: 3px solid var(--tokyo-blue);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--tokyo-blue);
    outline-offset: 2px;
}

/* ==========================================================================
   4. Layout & Spacing
   ========================================================================== */
.section-padding {
    padding: var(--space-2xl) var(--space-md);
}

.section-padding-small {
    padding: var(--space-xl) var(--space-md);
}

.content-container {
    max-width: 720px;
    margin: 0 auto;
}

.centered {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.full-height {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ==========================================================================
   5. Components - iMessage-inspired, not boxed
   ========================================================================== */

/* Annabelle Message Bubble - Feels like iMessage dark mode */
.annabelle-message {
    max-width: 680px;
    margin: 0 auto 40px auto;  /* Reduced from 48px - tighter rhythm */
    padding: 24px 32px;  /* Slightly less padding - more intimate */
    
    /* Barely-there background - just enough to separate from base */
    background: rgba(255, 255, 255, 0.02);
    
    /* Soft left accent - thinner, lower opacity */
    border-left: 2px solid rgba(255, 23, 85, 0.3);
    
    /* Asymmetric radius - mimics chat bubble */
    border-radius: 4px 12px 12px 4px;
    
    /* Subtle depth without color - neutral shadow */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    
    position: relative;
}

/* Optional: Very subtle hover effect */
.annabelle-message:hover {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: rgba(255, 23, 85, 0.4);
}


.annabelle-message p + p {
    margin-top: 20px; /* Space between paragraphs within message */
}

/* Buttons */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-bottom: none !important; /* Override global link style */
    text-shadow: none !important;   /* Override global link style */
}

.cta-button:active {
    transform: translateY(-1px);
}

.cta-whatsapp {
    background: #25D366;
    color: #FFFFFF;
}

.cta-whatsapp:hover {
    background: #20BD5C;
}

.cta-telegram {
    background: #0088CC;
    color: #FFFFFF;
}

.cta-telegram:hover {
    background: #0077B3;
}

.cta-container {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-lg);
}

/* Typing Indicator - Positioned absolutely to avoid layout shift */
.typing-indicator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    height: auto;
    transition: opacity 0.5s ease-out;
    opacity: 0;
}

.typing-indicator.visible {
    opacity: 1;
}

.typing-dot {
    width: 10px;
    height: 10px;
    background: var(--electric-pink);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Opening headline */
.opening-headline {
    opacity: 0;
    transition: opacity 0.8s ease-out;
    display: block; /* Ensure it occupies space */
}

.opening-headline.visible {
    opacity: 1;
    animation: fadeIn 0.8s ease-out forwards;
}

/* Subtext - positioned absolutely in same spot as typing indicator */
.opening-subtext {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease-out;
    
    /* Enhanced chat bubble styling */
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid rgba(255, 23, 85, 0.3);
    border-radius: 4px 12px 12px 4px;
    padding: 28px 36px;
    max-width: 680px;
    width: 100%;
    margin-top: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.opening-subtext.visible {
    opacity: 1;
}

/* Override inline margin for the first paragraph in the bubble */
.opening-subtext p:first-child {
    margin-top: 0 !important;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0; /* Hidden initially */
    transition: opacity 0.8s ease-out;
}

.scroll-indicator.visible {
    opacity: 0.5;
}

.scroll-indicator.visible:hover { opacity: 1; }

.scroll-arrow {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ==========================================================================
   6. Animations
   ========================================================================== */
/* Opening content container - Ensures proper centering */
.opening-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    width: 100%;
    position: relative;
}

/* Opening headline - locked in position */
.opening-headline {
    opacity: 0;
    transition: opacity 0.8s ease-out;
    display: block;
    margin-bottom: 24px; /* Space for typing indicator/subtext */
}

.opening-headline.visible {
    opacity: 1;
}

/* Container for typing indicator and subtext - fixed height to prevent layout shift */
.opening-animation-container {
    position: relative;
    width: 100%;
    min-height: 200px; /* Reserve space to prevent shifts */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.opening-content.visible .typing-indicator {
    /* display: none; REMOVED: We want to control this manually */
}

/* Scroll Fade-In */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.0s ease-out, transform 1.0s ease-out; /* Slower, more patient */
}

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

/* ==========================================================================
   7. Specific Sections
   ========================================================================== */

/* REALITY CHECK - Visual mode shift */
#reality-check {
    background: var(--almost-black);
    position: relative;
    padding: var(--space-3xl) var(--space-md); /* Extra padding for emphasis */
}

/* Add subtle gradient overlay to intensify the "leaning in" feeling */
#reality-check::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, var(--charcoal), transparent);
    pointer-events: none;
}

#reality-check::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, var(--charcoal), transparent);
    pointer-events: none;
}

#reality-check .content-container {
    position: relative;
    z-index: 1;
}

/* Disclaimer */
.disclaimer {
    opacity: 0.6;
    text-align: center;
    max-width: 500px;
    margin: 80px auto 0;
}

/* FAQ (Details/Summary) */
.faq-item {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 32px;
}

.faq-item summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    margin-bottom: 32px;
    transition: color 0.3s;
}

.faq-item summary:hover {
    color: var(--tokyo-blue);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-content {
    margin-top: 32px;
    padding-left: 24px;
    border-left: 1px solid rgba(255,255,255,0.1);
}

.faq-question {
    margin-bottom: 48px;
}

.faq-question h3 {
    margin-bottom: 12px;
}

/* Visual Examples */
.visual-example {
    text-align: center;
    margin: 80px 0;
}

.example-image {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.1);
}

.caption {
    opacity: 0.7;
}

/* Footer */
.site-footer {
    padding: var(--space-xl) var(--space-md);
    text-align: center;
}

.footer-content {
    opacity: 0.5;
}

/* ==========================================================================
   8. Media Queries (Responsive)
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --text-display: 36px;
        --text-headline: 28px;
        --text-body: 20px;
        --space-2xl: 80px; /* Adjusted */
        --space-lg: 32px; /* Adjusted */
    }

    .annabelle-message {
        margin: 0 0 32px 0;
        padding: 24px 28px;
        border-radius: 16px;
    }

    .cta-container {
        flex-direction: column;
        gap: 16px;
        width: 100%;
        padding: 0;
    }

    .cta-button {
        width: 100%;
        justify-content: center;
        padding: 18px 32px;
        font-size: 16px;
    }
    
    .full-height {
        min-height: 90vh; /* Account for mobile browser bars */
    }
    
    #reality-check {
        padding: var(--space-2xl) var(--space-md); /* Less aggressive on mobile */
    }
}

@media (min-width: 1024px) {
    .annabelle-message {
        max-width: 720px;
        padding: 32px 40px;
    }
}

@media (min-width: 1440px) {
    .content-container {
        max-width: 800px;
    }
}
