/* Landing Page Styles */
.landing-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* iOS Safari viewport height fix */
@supports (-webkit-touch-callout: none) {
    .landing-wrapper {
        min-height: -webkit-fill-available;
    }
}

.landing-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/вишлист тиночки.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.9;
    z-index: -1;
}

/* Hero Text Container */
.hero-text {
    text-align: center;
    margin-bottom: 150px;
}

/* Main Title Styling */
.hero-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 7rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    cursor: default;
    user-select: none;
    -webkit-user-select: none; /* iOS Safari */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on iOS */
    position: relative;
}

/* Touch/Tap Active State for Mobile */
.hero-title.active .title-line-1,
.hero-title:active .title-line-1 {
    background: linear-gradient(135deg, #f5dcf8 0%, #e8b5f0 50%, #d896e8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateY(-8px);
    text-shadow: 0 8px 30px rgba(200, 140, 220, 0.5);
}

.hero-title.active .title-word-1,
.hero-title:active .title-word-1 {
    opacity: 0.8;
    color: #8b6c9a;
    transform: translateX(-5px);
}

.hero-title.active .title-accent,
.hero-title:active .title-accent {
    color: #d896e8;
    transform: scale(1.2) rotate(-5deg);
    animation: bounce 0.6s ease;
}

.hero-title.active::before,
.hero-title:active::before {
    content: '✨';
    position: absolute;
    font-size: 2rem;
    animation: sparkle 1s ease-in-out forwards;
    pointer-events: none;
    opacity: 0;
}
.title-word-0 {
    display: block;
    color: #9b7aad;
    font-size: 0.5em;
    opacity: 0.6;
    margin-bottom: -0.2em;
    letter-spacing: 0.15em;
}
.hero-title.active::after,
.hero-title:active::after {
    content: '🌙';
    position: absolute;
    font-size: 2rem;
    animation: moonAppear 1s ease-in-out forwards;
    animation-delay: 0.2s;
    pointer-events: none;
    opacity: 0;
}

.hero-title.active .tinomoji-left,
.hero-title:active .tinomoji-left {
    animation: tinomojiLeft 1s ease-in-out forwards;
    opacity: 1;
}

.hero-title.active .tinomoji-right,
.hero-title:active .tinomoji-right {
    animation: tinomojiRight 1s ease-in-out forwards;
    animation-delay: 0.2s;
    opacity: 1;
}

/* Auto-play animation on page load for mobile */
@media (hover: none) and (pointer: coarse) {
    .hero-title {
        animation: autoPlayTrigger 0.1s ease 0.5s forwards;
    }

    @keyframes autoPlayTrigger {
        to {
            /* Trigger class via JS */
        }
    }
}

/* First Line - "ВИШЛИСТ" */
.title-line-1 {
    display: block;
    background: linear-gradient(135deg, #e8b5f0 20%, #d896e8 50%, #c77fdc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(200, 140, 220, 0.3);
    transition: all 0.4s ease;
    letter-spacing: 0.05em;
}

/* Second Line - "ТИНОЧКИ !" */
.title-line-2 {
    display: block;
    transition: all 0.4s ease;
}

/* "ТИНОЧКИ" part */
.title-word-1 {
    color: #6b4c7a;
    opacity: 0.5;
    transition: all 0.4s ease;
}

/* Exclamation mark */
.title-accent {
    color: #b46ec8;
    display: inline-block;
    transition: all 0.4s ease;
    transform-origin: bottom center;
}

/* Hover Effects */
.hero-title:hover .title-line-1 {
    background: linear-gradient(135deg, #f5dcf8 0%, #e8b5f0 50%, #d896e8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateY(-8px);
    text-shadow: 0 8px 30px rgba(200, 140, 220, 0.5);
}

.hero-title:hover .title-word-1 {
    opacity: 0.8;
    color: #8b6c9a;
    transform: translateX(-5px);
}

.hero-title:hover .title-accent {
    color: #d896e8;
    transform: scale(1.2) rotate(-5deg);
    animation: bounce 0.6s ease;
}

/* Bounce Animation for Exclamation Mark */
@keyframes bounce {
    0%, 100% {
        transform: scale(1.2) rotate(-5deg) translateY(0);
    }
    50% {
        transform: scale(1.3) rotate(-8deg) translateY(-10px);
    }
}

/* Sparkle Effect on Hover (emoji) */
.hero-title:hover::before {
    content: '✨';
    position: absolute;
    font-size: 2rem;
    animation: sparkle 1s ease-in-out forwards;
    pointer-events: none;
    opacity: 0;
}

/* Moon Effect on Hover (emoji) */
.hero-title:hover::after {
    content: '🌙';
    position: absolute;
    font-size: 2rem;
    animation: moonAppear 1s ease-in-out forwards;
    animation-delay: 0.2s;
    pointer-events: none;
    opacity: 0;
}

/* Tinomoji PNG Animation - Left Side */
.hero-title:hover .tinomoji-left {
    animation: tinomojiLeft 1s ease-in-out forwards;
    opacity: 1;
}

/* Tinomoji PNG Animation - Right Side */
.hero-title:hover .tinomoji-right {
    animation: tinomojiRight 1s ease-in-out forwards;
    animation-delay: 0.2s;
    opacity: 1;
}

/* Tinomoji Image Elements */
.tinomoji-left,
.tinomoji-right {
    position: absolute;
    width: 3rem;
    height: 3rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes sparkle {
    0% {
        opacity: 0;
        transform: translate(-100px, -50px) scale(0);
    }
    50% {
        opacity: 1;
        transform: translate(-80px, -40px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-60px, -30px) scale(0);
    }
}

@keyframes moonAppear {
    0% {
        opacity: 0;
        transform: translate(100px, 50px) scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translate(80px, 40px) scale(1) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translate(60px, 30px) scale(0) rotate(360deg);
    }
}

@keyframes tinomojiLeft {
    0% {
        opacity: 0;
        transform: translate(-100px, 50px) scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translate(-80px, 60px) scale(1) rotate(-180deg);
    }
    100% {
        opacity: 0;
        transform: translate(-60px, 70px) scale(0) rotate(-360deg);
    }
}

@keyframes tinomojiRight {
    0% {
        opacity: 0;
        transform: translate(100px, -50px) scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translate(80px, -60px) scale(1) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translate(60px, -70px) scale(0) rotate(360deg);
    }
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Laptop (1400px-1920px) */
@media (max-width: 1920px) {
    .hero-title {
        font-size: 6rem;
    }

    .hero-text {
        margin-bottom: 140px;
    }

    .hero-title:hover::before,
    .hero-title:hover::after {
        font-size: 1.8rem;
    }

    .tinomoji-left,
    .tinomoji-right {
        width: 2.7rem;
        height: 2.7rem;
    }

    @keyframes sparkle {
        0% {
            opacity: 0;
            transform: translate(-90px, -45px) scale(0);
        }
        50% {
            opacity: 1;
            transform: translate(-70px, -35px) scale(1);
        }
        100% {
            opacity: 0;
            transform: translate(-50px, -25px) scale(0);
        }
    }

    @keyframes moonAppear {
        0% {
            opacity: 0;
            transform: translate(90px, 45px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(70px, 35px) scale(1) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(50px, 25px) scale(0) rotate(360deg);
        }
    }

    @keyframes tinomojiLeft {
        0% {
            opacity: 0;
            transform: translate(-90px, 45px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(-70px, 55px) scale(1) rotate(-180deg);
        }
        100% {
            opacity: 0;
            transform: translate(-50px, 65px) scale(0) rotate(-360deg);
        }
    }

    @keyframes tinomojiRight {
        0% {
            opacity: 0;
            transform: translate(90px, -45px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(70px, -55px) scale(1) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(50px, -65px) scale(0) rotate(360deg);
        }
    }
}

/* Tablet (768px-1400px) */
@media (max-width: 1400px) {
    .landing-wrapper {
        padding: 1.5rem;
    }

    .hero-title {
        font-size: 5rem;
    }

    .hero-text {
        margin-bottom: 130px;
    }

    .hero-title:hover::before,
    .hero-title:hover::after {
        font-size: 1.6rem;
    }

    .tinomoji-left,
    .tinomoji-right {
        width: 2.4rem;
        height: 2.4rem;
    }

    @keyframes sparkle {
        0% {
            opacity: 0;
            transform: translate(-70px, -40px) scale(0);
        }
        50% {
            opacity: 1;
            transform: translate(-55px, -30px) scale(1);
        }
        100% {
            opacity: 0;
            transform: translate(-40px, -20px) scale(0);
        }
    }

    @keyframes moonAppear {
        0% {
            opacity: 0;
            transform: translate(70px, 40px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(55px, 30px) scale(1) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(40px, 20px) scale(0) rotate(360deg);
        }
    }

    @keyframes tinomojiLeft {
        0% {
            opacity: 0;
            transform: translate(-70px, 40px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(-55px, 45px) scale(1) rotate(-180deg);
        }
        100% {
            opacity: 0;
            transform: translate(-40px, 50px) scale(0) rotate(-360deg);
        }
    }

    @keyframes tinomojiRight {
        0% {
            opacity: 0;
            transform: translate(70px, -40px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(55px, -45px) scale(1) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(40px, -50px) scale(0) rotate(360deg);
        }
    }
}

/* Mobile (480px-768px) */
@media (max-width: 768px) {
    .landing-wrapper {
        padding: 1rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .hero-text {
        margin-bottom: 120px;
    }

    .title-line-1 {
        letter-spacing: 0.02em;
    }

    .hero-title:hover::before,
    .hero-title:hover::after {
        font-size: 1.4rem;
    }

    .tinomoji-left,
    .tinomoji-right {
        width: 2rem;
        height: 2rem;
    }

    .hero-title:hover .title-line-1 {
        transform: translateY(-5px);
    }

    .hero-title:hover .title-word-1 {
        transform: translateX(-3px);
    }

    @keyframes sparkle {
        0% {
            opacity: 0;
            transform: translate(-50px, -30px) scale(0);
        }
        50% {
            opacity: 1;
            transform: translate(-40px, -25px) scale(1);
        }
        100% {
            opacity: 0;
            transform: translate(-30px, -15px) scale(0);
        }
    }

    @keyframes moonAppear {
        0% {
            opacity: 0;
            transform: translate(50px, 30px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(40px, 25px) scale(1) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(30px, 15px) scale(0) rotate(360deg);
        }
    }

    @keyframes tinomojiLeft {
        0% {
            opacity: 0;
            transform: translate(-50px, 30px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(-40px, 35px) scale(1) rotate(-180deg);
        }
        100% {
            opacity: 0;
            transform: translate(-30px, 40px) scale(0) rotate(-360deg);
        }
    }

    @keyframes tinomojiRight {
        0% {
            opacity: 0;
            transform: translate(50px, -30px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(40px, -35px) scale(1) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(30px, -40px) scale(0) rotate(360deg);
        }
    }
}

/* ===== IPHONE SPECIFIC OPTIMIZATIONS ===== */

/* iPhone 11 Pro Max (414px width) and similar large iPhones */
@media only screen
and (min-width: 414px)
and (max-width: 428px)
and (-webkit-device-pixel-ratio: 3) {

    .landing-wrapper {
        padding: 1rem 0.75rem;
    }

    .hero-title {
        font-size: 3.2rem;
        line-height: 1.25;
    }

    .hero-text {
        margin-bottom: 110px;
    }

    .title-line-1 {
        letter-spacing: 0.01em;
    }

    .hero-title:hover::before,
    .hero-title:hover::after {
        font-size: 1.3rem;
    }

    .tinomoji-left,
    .tinomoji-right {
        width: 1.8rem;
        height: 1.8rem;
    }

    .hero-title:hover .title-line-1 {
        transform: translateY(-4px);
    }

    .hero-title:hover .title-word-1 {
        transform: translateX(-2.5px);
    }

    @keyframes bounce {
        0%, 100% {
            transform: scale(1.15) rotate(-4deg) translateY(0);
        }
        50% {
            transform: scale(1.25) rotate(-6deg) translateY(-7px);
        }
    }

    @keyframes sparkle {
        0% {
            opacity: 0;
            transform: translate(-42px, -25px) scale(0);
        }
        50% {
            opacity: 1;
            transform: translate(-34px, -20px) scale(0.95);
        }
        100% {
            opacity: 0;
            transform: translate(-25px, -12px) scale(0);
        }
    }

    @keyframes moonAppear {
        0% {
            opacity: 0;
            transform: translate(42px, 25px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(34px, 20px) scale(0.95) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(25px, 12px) scale(0) rotate(360deg);
        }
    }

    @keyframes tinomojiLeft {
        0% {
            opacity: 0;
            transform: translate(-42px, 25px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(-34px, 30px) scale(0.95) rotate(-180deg);
        }
        100% {
            opacity: 0;
            transform: translate(-25px, 35px) scale(0) rotate(-360deg);
        }
    }

    @keyframes tinomojiRight {
        0% {
            opacity: 0;
            transform: translate(42px, -25px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(34px, -30px) scale(0.95) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(25px, -35px) scale(0) rotate(360deg);
        }
    }
}

/* iPhone 12/13/14 (390px width) and similar mid-size iPhones */
@media only screen
and (min-width: 375px)
and (max-width: 413px)
and (-webkit-device-pixel-ratio: 3) {

    .landing-wrapper {
        padding: 1rem 0.75rem;
    }

    .hero-title {
        font-size: 3rem;
        line-height: 1.25;
    }

    .hero-text {
        margin-bottom: 105px;
    }

    .title-line-1 {
        letter-spacing: 0;
    }

    .hero-title:hover::before,
    .hero-title:hover::after {
        font-size: 1.25rem;
    }

    .tinomoji-left,
    .tinomoji-right {
        width: 1.7rem;
        height: 1.7rem;
    }

    .hero-title:hover .title-line-1 {
        transform: translateY(-3.5px);
    }

    .hero-title:hover .title-word-1 {
        transform: translateX(-2px);
    }

    @keyframes bounce {
        0%, 100% {
            transform: scale(1.12) rotate(-3.5deg) translateY(0);
        }
        50% {
            transform: scale(1.22) rotate(-6deg) translateY(-6px);
        }
    }

    @keyframes sparkle {
        0% {
            opacity: 0;
            transform: translate(-38px, -22px) scale(0);
        }
        50% {
            opacity: 1;
            transform: translate(-30px, -18px) scale(0.92);
        }
        100% {
            opacity: 0;
            transform: translate(-22px, -11px) scale(0);
        }
    }

    @keyframes moonAppear {
        0% {
            opacity: 0;
            transform: translate(38px, 22px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(30px, 18px) scale(0.92) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(22px, 11px) scale(0) rotate(360deg);
        }
    }

    @keyframes tinomojiLeft {
        0% {
            opacity: 0;
            transform: translate(-38px, 22px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(-30px, 27px) scale(0.92) rotate(-180deg);
        }
        100% {
            opacity: 0;
            transform: translate(-22px, 32px) scale(0) rotate(-360deg);
        }
    }

    @keyframes tinomojiRight {
        0% {
            opacity: 0;
            transform: translate(38px, -22px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(30px, -27px) scale(0.92) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(22px, -32px) scale(0) rotate(360deg);
        }
    }
}

/* Small mobile devices (<375px) - iPhone SE, etc. */
@media (max-width: 374px) {
    .landing-wrapper {
        padding: 0.75rem 0.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
        line-height: 1.3;
    }

    .hero-text {
        margin-bottom: 95px;
    }

    .title-line-1 {
        letter-spacing: -0.01em;
    }

    .hero-title:hover::before,
    .hero-title:hover::after {
        font-size: 1.2rem;
    }

    .tinomoji-left,
    .tinomoji-right {
        width: 1.5rem;
        height: 1.5rem;
    }

    .hero-title:hover .title-line-1 {
        transform: translateY(-3px);
    }

    .hero-title:hover .title-word-1 {
        transform: translateX(-1.5px);
    }

    @keyframes bounce {
        0%, 100% {
            transform: scale(1.1) rotate(-3deg) translateY(0);
        }
        50% {
            transform: scale(1.2) rotate(-5deg) translateY(-5px);
        }
    }

    @keyframes sparkle {
        0% {
            opacity: 0;
            transform: translate(-32px, -18px) scale(0);
        }
        50% {
            opacity: 1;
            transform: translate(-25px, -14px) scale(0.88);
        }
        100% {
            opacity: 0;
            transform: translate(-18px, -9px) scale(0);
        }
    }

    @keyframes moonAppear {
        0% {
            opacity: 0;
            transform: translate(32px, 18px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(25px, 14px) scale(0.88) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(18px, 9px) scale(0) rotate(360deg);
        }
    }

    @keyframes tinomojiLeft {
        0% {
            opacity: 0;
            transform: translate(-32px, 18px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(-25px, 23px) scale(0.88) rotate(-180deg);
        }
        100% {
            opacity: 0;
            transform: translate(-18px, 28px) scale(0) rotate(-360deg);
        }
    }

    @keyframes tinomojiRight {
        0% {
            opacity: 0;
            transform: translate(32px, -18px) scale(0) rotate(0deg);
        }
        50% {
            opacity: 1;
            transform: translate(25px, -23px) scale(0.88) rotate(180deg);
        }
        100% {
            opacity: 0;
            transform: translate(18px, -28px) scale(0) rotate(360deg);
        }
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .landing-wrapper {
        min-height: -webkit-fill-available;
        min-height: 100dvh;
    }

    /* Prevent bouncy scroll on iOS */
    html {
        height: -webkit-fill-available;
    }

    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}