/* Custom Animations & Effects for OpenSelf Landing Page */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --neon-green: #10b981;
    --neon-red: #ef4444;
    --brand-purple: #7c5dfa;
    --brand-cyan: #06b6d4;
    --bg-light: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: #1a1a2e;
    overflow-x: hidden;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Gradient Blobs */
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.12;
    animation: float 10s ease-in-out infinite;
}

.blob-purple {
    background: var(--brand-purple);
    width: 400px;
    height: 400px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    top: -100px;
    left: -100px;
}

.blob-cyan {
    background: var(--brand-cyan);
    width: 300px;
    height: 300px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    bottom: 20%;
    right: -50px;
    animation-delay: -2s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) rotate(10deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* Mindmap Center Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.15;
        transform: scale(1.35);
    }
}

/* Status Pulse Animation */
.status-dot {
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: inherit;
    border-radius: 50%;
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    z-index: -1;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }

    50% {
        transform: scale(2);
        opacity: 0;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Hero Badge Text Rotation */
.hero-badge-text {
    transition: opacity 0.5s ease;
}

/* Hero Grid Layout */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

/* Desktop: taglines below text column */
.hero-taglines {
    margin-top: 2rem;
}

/* Phone Frame Mockup */
.phone-frame {
    background: #1a1a2e;
    border-radius: 40px;
    padding: 12px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 25px 60px -10px rgba(0, 0, 0, 0.35),
        0 0 80px -20px rgba(124, 93, 250, 0.25);
    position: relative;
    z-index: 10;
}

.phone-notch {
    width: 12px;
    height: 12px;
    background: #2a2a3e;
    border-radius: 50%;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.phone-screen {
    border-radius: 28px;
    overflow: hidden;
    position: relative;
    background: #1a1a2e;
    aspect-ratio: 9 / 16.5;
}

.phone-iframe {
    width: 375px;
    height: 812px;
    border: none;
    display: block;
    transition: opacity 0.4s ease;
    transform-origin: top left;
    /* Desktop: slightly larger for visual impact */
    transform: scale(0.835);
}

/* Carousel: stack all iframes, show only active */
.hero-carousel-frame {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.hero-carousel-frame.active {
    opacity: 1;
    pointer-events: auto;
}

.phone-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1.5rem;
    background: linear-gradient(transparent 80%, rgba(0, 0, 0, 0.35));
    opacity: 0;
    transition: opacity 0.3s ease;
    text-decoration: none;
    z-index: 15;
}

.phone-overlay:hover {
    opacity: 1;
}

.phone-overlay-label {
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a2e;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 100px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.phone-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 10px 0 2px;
}

.phone-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.phone-dot.active {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.2);
}

.phone-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* Legacy phone shadow (keep for backward compat) */
.phone-shadow {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08),
        0 20px 40px -10px rgba(0, 0, 0, 0.25),
        0 0 80px -20px rgba(124, 93, 250, 0.2);
}

/* Bento Grid Hover Effects */
.bento-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Gradient Text */
.text-gradient {
    background: linear-gradient(135deg, #1a1a2e 0%, #7c5dfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Benefit Path Cards */
.benefit-path {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 1.5rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.benefit-path:hover {
    border-color: rgba(124, 93, 250, 0.2);
    box-shadow: 0 8px 30px -10px rgba(124, 93, 250, 0.12);
    transform: translateY(-2px);
}

.benefit-path.active {
    border-color: rgba(124, 93, 250, 0.3);
    box-shadow: 0 12px 40px -10px rgba(124, 93, 250, 0.15);
    cursor: default;
    transform: none;
}

.benefit-path-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.benefit-path.active .benefit-path-arrow svg {
    transform: rotate(180deg);
}

.benefit-path-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        margin-top 0.3s ease;
    margin-top: 0;
}

.benefit-path.active .benefit-path-content {
    max-height: 600px;
    opacity: 1;
    margin-top: 1rem;
}

.benefit-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    transition: background 0.2s ease;
}

.benefit-item:hover {
    background: rgba(124, 93, 250, 0.04);
}

.benefit-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
    margin-top: 2px;
}

.benefit-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
    line-height: 1.3;
}

.benefit-desc {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
    margin-top: 2px;
}

/* Mindmap Teaser */
.mindmap-teaser {
    display: none;
    position: relative;
    margin-top: 2rem;
    border-radius: 1.25rem;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mindmap-teaser-heading {
    display: block;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--brand-purple);
    margin-bottom: 0.75rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.mindmap-teaser-heading:hover {
    opacity: 0.7;
}

.mindmap-iframe {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: none;
    border-radius: 1.25rem;
    pointer-events: none;
    display: block;
}

.mindmap-teaser-clickzone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    align-items: flex-end;
    padding: 1rem 1.25rem;
    background: linear-gradient(transparent 60%, rgba(0, 0, 0, 0.5));
    border-radius: 0 0 1.25rem 1.25rem;
    text-decoration: none;
    cursor: pointer;
}

.mindmap-teaser-label {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.mindmap-teaser:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -8px rgba(124, 93, 250, 0.25);
}

.benefit-column .mindmap-teaser.visible {
    display: block;
    animation: fadeInTeaser 0.4s ease forwards;
}

@keyframes fadeInTeaser {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* Mobile Mindmap */
.mindmap-mobile {
    display: none;
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
    display: none;
    flex-direction: column;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.5rem 1.5rem 1rem;
}

.mobile-nav-overlay.open {
    display: flex;
}

.mobile-nav-link {
    padding: 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: color 0.2s ease;
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

.mobile-nav-link:hover {
    color: #111827;
}

/* Trust Bar */
.trust-bar {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(124, 93, 250, 0.02);
}

.trust-divider {
    color: #d1d5db;
    font-weight: 300;
}

/* How It Works Steps */
.steps-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.step-card {
    flex: 1;
    max-width: 260px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px -10px rgba(124, 93, 250, 0.15);
    border-color: rgba(124, 93, 250, 0.2);
}

.step-number {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1.75rem;
    height: 1.75rem;
    background: var(--brand-purple);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.step-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.step-desc {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
}

.step-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 767px) {

    /* Hero: remove min-h-screen so phone peeks into viewport */
    #hero-section {
        min-height: auto;
        padding-top: 5rem;
        padding-bottom: 0;
    }

    /* Single column, reorder: text(1) → phone(2) → taglines(3) */
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-grid>.reveal:first-child {
        order: 1;
    }

    .hero-grid>.reveal.delay-200 {
        order: 2;
    }

    .hero-taglines {
        order: 3;
        margin-top: 0;
        padding-bottom: 2rem;
    }

    /* Phone visible immediately on mobile (no reveal animation) */
    .hero-grid>.reveal.delay-200 {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    /* Phone frame smaller on mobile */
    .phone-frame {
        max-width: 260px !important;
        border-radius: 32px;
        padding: 10px;
    }

    .phone-notch {
        width: 10px;
        height: 10px;
        top: 16px;
    }

    .phone-screen {
        border-radius: 22px;
    }

    .phone-iframe {
        /* Mobile: frame inner ≈ 240px. 240/375 = 0.645 */
        transform: scale(0.645);
    }

    /* Hide desktop teasers on mobile */
    .mindmap-teaser {
        display: none !important;
    }

    /* Show full-width mindmap on mobile */
    .mindmap-mobile {
        display: block;
        margin-top: 2rem;
    }

    .mindmap-mobile-link {
        display: block;
        position: relative;
        border-radius: 1.25rem;
        overflow: hidden;
        text-decoration: none;
    }

    .mindmap-mobile .mindmap-iframe {
        width: 100%;
        aspect-ratio: 1 / 1;
        border: none;
        border-radius: 1.25rem;
        pointer-events: none;
    }

    .mindmap-mobile .mindmap-teaser-clickzone {
        border-radius: 0 0 1.25rem 1.25rem;
    }

    /* Steps go vertical on mobile */
    .steps-grid {
        flex-direction: column;
        gap: 0.5rem;
    }

    .step-card {
        max-width: 100%;
        width: 100%;
    }

    .step-connector {
        transform: rotate(90deg);
    }

    .trust-divider {
        display: none;
    }
}