﻿/* ============================================================
   SCROLLYTELLING — МійВчитель
   Scroll-based animations, sticky sections, motion design
   ============================================================ */

/* ---- Reset / Base ---------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ---- Scroll progress bar --------------------------------- */
#scroll_progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #71FFD7 0%, #a855f7 50%, #fba329 100%);
    z-index: 9999;
    transition: width 0.08s linear;
    pointer-events: none;
}

/* ---- Hero: split-text word animation --------------------- */
.hero-word {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    margin-right: 0.18em;
}

.hero-word-inner {
    display: inline-block;
    opacity: 0;
    transform: translateY(110%) skewY(8deg);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
}

.hero-revealed .hero-word-inner {
    opacity: 1;
    transform: translateY(0) skewY(0deg);
}

/* Stagger для слів hero */
.hero-word:nth-child(1) .hero-word-inner {
    transition-delay: 0.05s;
}

.hero-word:nth-child(2) .hero-word-inner {
    transition-delay: 0.13s;
}

.hero-word:nth-child(3) .hero-word-inner {
    transition-delay: 0.21s;
}

.hero-word:nth-child(4) .hero-word-inner {
    transition-delay: 0.29s;
}

.hero-word:nth-child(5) .hero-word-inner {
    transition-delay: 0.37s;
}

.hero-word:nth-child(6) .hero-word-inner {
    transition-delay: 0.45s;
}

.hero-word:nth-child(7) .hero-word-inner {
    transition-delay: 0.53s;
}

.hero-word:nth-child(8) .hero-word-inner {
    transition-delay: 0.61s;
}

.hero-word:nth-child(9) .hero-word-inner {
    transition-delay: 0.69s;
}

.hero-word:nth-child(10) .hero-word-inner {
    transition-delay: 0.77s;
}

.hero-word:nth-child(11) .hero-word-inner {
    transition-delay: 0.85s;
}

.hero-word:nth-child(12) .hero-word-inner {
    transition-delay: 0.93s;
}

/* Hero subtitle fade */
.hero-sub-animated {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.7s,
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.7s;
}

.hero-sub-animated.hero-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Hero CTA fade */
.hero-cta-animated {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.95s,
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.95s;
}

.hero-cta-animated.hero-revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ---- Scroll-clip text reveal ----------------------------- */
/* Текст розкривається знизу вгору (clip-path) */
.clip-reveal {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    transition: clip-path 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease;
}

.clip-reveal.revealed {
    clip-path: inset(0 0 0% 0);
    opacity: 1;
}

/* ---- Counter number animation ---------------------------- */
.counter-animated {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Benefit cards: staggered slide-up ------------------- */
.benefit-card-animated {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.benefit-card-animated.revealed {
    opacity: 1;
    transform: translateY(0);
}

.benefit-card-animated:nth-child(1) {
    transition-delay: 0.0s;
}

.benefit-card-animated:nth-child(2) {
    transition-delay: 0.15s;
}

.benefit-card-animated:nth-child(3) {
    transition-delay: 0.30s;
}

/* ---- Color blocks: scale-in ------------------------------ */
.color-block-animated {
    opacity: 0;
    transform: scale(0.88) translateY(20px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.color-block-animated.revealed {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.color-block-animated:nth-child(1) {
    transition-delay: 0.00s;
}

.color-block-animated:nth-child(2) {
    transition-delay: 0.12s;
}

.color-block-animated:nth-child(3) {
    transition-delay: 0.24s;
}

.color-block-animated:nth-child(4) {
    transition-delay: 0.36s;
}

/* ---- Horizontal slide cards ------------------------------ */
.slide-left-animated {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.slide-left-animated.revealed {
    opacity: 1;
    transform: translateX(0);
}

.slide-right-animated {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.slide-right-animated.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ---- Section header: glitch-free line reveal ------------- */
.section-title-line {
    overflow: hidden;
    display: block;
}

.section-title-line-inner {
    display: block;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-title-line-inner.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-title-line:nth-child(2) .section-title-line-inner {
    transition-delay: 0.12s;
}

.section-title-line:nth-child(3) .section-title-line-inner {
    transition-delay: 0.24s;
}

/* ---- Parallax image (hero img) --------------------------- */
.hero-img-parallax {
    will-change: transform;
    transition: transform 0.12s linear;
}

/* ---- Pricing section: card morph on scroll --------------- */
.pricing_card {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* ---- Sticky storytelling section ------------------------- */
.sticky-story-wrap {
    position: relative;
}

.sticky-story-panel {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ---- Micro-interactions: buttons ------------------------- */
.Button_pedal {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease !important;
}

.Button_pedal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255, 255, 255, 0.35) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.Button_pedal:hover {
    transform: translateY(-3px) scale(1.02) !important;
}

.Button_pedal:active {
    transform: translateY(0px) scale(0.98) !important;
}

.Button_pedal:hover::after {
    opacity: 1;
}

/* Card CTA micro hover */
.card_cta {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease,
        background 0.3s ease !important;
}

.card_cta:hover {
    transform: translateY(-2px) scale(1.03) !important;
}

.card_cta:active {
    transform: translateY(0) scale(0.98) !important;
}

/* ---- Eyebrow label animated ------------------------------ */
.eyebrow-animated {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.eyebrow-animated.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ---- Progress dots (section nav) ------------------------- */
#section_dots {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

#section_dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s, height 0.3s;
}

#section_dots .dot.active {
    background: #71FFD7;
    border-color: #71FFD7;
    height: 24px;
    border-radius: 4px;
    transform: scale(1.1);
}

#section_dots .dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

/* ---- Gradient line divider between sections -------------- */
.section-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(113, 255, 215, 0.3), transparent);
    margin: 0;
}

/* ---- Image hover tilt ------------------------------------ */
.tilt-on-hover {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

/* ---- Fade-in up for form section ------------------------- */
.form-section-animated {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.form-section-animated.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Contacts section ------------------------------------ */
.contacts-animated {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.contacts-animated.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Highlight pulse (badge, discount) ------------------- */
@keyframes badge-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(251, 163, 41, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(251, 163, 41, 0);
    }
}

.pricing_discount_badge {
    animation: badge-pulse 2.5s ease-in-out infinite;
}

/* ---- Scroll-reveal for icon images ----------------------- */
.icon-pop {
    opacity: 0;
    transform: scale(0.5) rotate(-15deg);
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-pop.revealed {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* ---- Footer / contacts reveal ---------------------------- */
.contacts_wrap {
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Contacts section redesign --------------------------- */
.contacts_wrap {
    background: linear-gradient(0deg, #9d63fb 0%, #673AB7 100%) !important;
    padding: 0 !important;
}

.contacts_section_new {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 20px 100px;
    text-align: center;
}

.contacts_eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #71FFD7;
    background: rgba(113, 255, 215, 0.1);
    border: 1px solid rgba(113, 255, 215, 0.25);
    padding: 6px 18px;
    border-radius: 50px;
    margin-bottom: 24px;
}

.contacts_title {
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.contacts_title span {
    color: #71FFD7;
}

.contacts_subtitle {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto 56px;
}

.contacts_cards_row {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.contacts_card {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.3s ease,
        border-color 0.3s ease;
}

.contacts_card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(113, 255, 215, 0.3);
}

.contacts_card_main {
    background: rgba(113, 255, 215, 0.08);
    border-color: rgba(113, 255, 215, 0.25);
    justify-content: center;
    gap: 28px;
    padding: 44px 32px;
}

.contacts_card_icon img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    margin-bottom: 4px;
}

.contacts_card_label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.contacts_card_value {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: #71FFD7;
    text-decoration: none;
    transition: opacity 0.2s;
}

.contacts_card_value:hover {
    opacity: 0.75;
}

.contacts_card_note {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

.contacts_card_quote {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    line-height: 1.6;
    font-style: italic;
    text-align: center;
}

.contacts_cta_btn {
    display: inline-block;
    background: linear-gradient(140deg, #ffcb00 10%, #fba329 90%);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    padding: 16px 32px;
    border-radius: 50px;
    border: 5px solid #fff;
    box-shadow: inset 0 -3px 0 rgba(204, 119, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Montserrat', sans-serif;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
    white-space: nowrap;
}

.contacts_cta_btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: inset 0 -3px 0 rgba(204, 119, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.3);
}

@media (max-width: 900px) {
    .contacts_cards_row {
        grid-template-columns: 1fr;
        max-width: 460px;
        margin: 0 auto;
    }

    .contacts_card_main {
        order: -1;
    }
}

@media (max-width: 767px) {
    .contacts_section_new {
        padding: 60px 15px 80px;
    }

    .contacts_title {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .contacts_subtitle {
        font-size: 15px;
        margin-bottom: 40px;
    }

    .contacts_cards_row {
        gap: 15px;
    }

    .contacts_card {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .contacts_card_main {
        padding: 35px 25px;
    }

    .contacts_cta_btn {
        font-size: 13px;
        padding: 12px 20px;
        white-space: normal;
        line-height: 1.3;
    }
}

/* ---- Mobile overrides ------------------------------------ */
@media (max-width: 767px) {
    #section_dots {
        display: none;
    }

    .hero-word-inner {
        transition-duration: 0.5s;
    }

    .benefit-card-animated {
        transition-delay: 0s !important;
    }

    .color-block-animated {
        transition-delay: 0s !important;
    }

    .slide-left-animated,
    .slide-right-animated {
        transform: translateY(40px);
        /* On mobile, convert horizontal to vertical for cleaner feel */
    }

    .slide-left-animated.revealed,
    .slide-right-animated.revealed {
        transform: translateY(0);
    }
}