/* ==========================================
   Evil Nailong - Premium Stylesheet
   ========================================== */

/* Global Resets & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
}

/* Common Animations */
@keyframes characterEntrance {
    0% {
        transform: scale(0.6) translateY(100px);
        opacity: 0;
    }

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

@keyframes characterBreathe {

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

    50% {
        transform: scale(1.02) translateY(-8px);
    }
}

@keyframes titleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

@keyframes textMarquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes entranceZoom {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

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

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animate {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   Header & Navigation
   ========================================== */
.main-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 30px 50px;
}

/* Inverted corner head peering down */
.header-corner-head {
    position: absolute;
    top: -95px;
    /* Hidden state: mostly off-screen */
    left: 50px;
    width: 250px;
    height: auto;
    transform: rotate(0deg);
    z-index: 110;
    filter: drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.3));
    transition: all 0.5s ease-out;
    /* Page load animation */
    animation: headDropIn 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    cursor: pointer;
}

/* Page load initial drop in */
@keyframes headDropIn {
    0% {
        top: -300px;
        opacity: 0;
    }

    100% {
        top: -95px;
        opacity: 1;
    }
}

/* Keyframes for continuous bounce on hover */
@keyframes cornerHeadBounce {

    0%,
    100% {
        top: -80px;
        transform: rotate(0deg) scale(1.05);
    }

    50% {
        top: -65px;
        transform: rotate(0deg) scale(1.05);
    }
}

.header-corner-head:hover {
    top: -80px;
    /* Comes out fully */
    transform: rotate(0deg) scale(1.05);
    animation: cornerHeadBounce 3s ease-in-out infinite 0.5s;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-btn {
    background-color: #000;
    color: #fff;
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Anton', sans-serif;
    letter-spacing: 1px;
    border: 2px solid #000;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-btn:hover {
    background-color: #fff;
    color: #000;
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
}

.buy-btn {
    background-color: #fff;
    color: #000;
    border-color: #fff;
}

.buy-btn:hover {
    background-color: #000;
    color: #fff;
    border-color: #000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Mobile Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
    position: absolute;
    right: 20px;
    top: 20px;
}

.menu-toggle span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: #000;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ==========================================
   Section 1: Hero
   ========================================== */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 70vh;
    background-color: #F3BA2F;
    background-image: url('../img/patron-fondo-header.png');
    background-repeat: repeat;
    background-size: 1400px;
    /* Much larger pattern */
    background-position: center;
    animation: scrollHeroBackground 20s linear infinite;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-top: 150px;
    overflow: hidden;
}

@keyframes scrollHeroBackground {
    0% {
        background-position: 0px center;
    }

    100% {
        background-position: -1400px center;
    }
}

.hero-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    z-index: 1;
    /* Low z-index so it hides behind section 2 */
}

.hero-character {
    max-width: 95%;
    height: auto;
    width: 800px;
    /* Adjusted size */
    display: block;
    transform-origin: bottom center;
    /* Adjust margin to hide the bottom part behind the marquee/carousel */
    margin-bottom: -320px;
    /* Adjusted to cut off around the hips */
    position: relative;
    z-index: 1;
    /* Less than marquee/carousel so it hides behind */
    animation: characterEntrance 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        characterBreathe 4s ease-in-out infinite 1.2s;
    filter: drop-shadow(0px 10px 20px rgba(0, 0, 0, 0.3));
}

/* ==========================================
   Ticker / Marquee Banner
   ========================================== */
.marquee-banner {
    background-color: #000;
    border-top: 5px solid #000;
    border-bottom: 5px solid #000;
    padding: 12px 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 20;
    /* High z-index to be above hero character */
    transform: rotate(-1.5deg) scale(1.02);
    margin: -20px 0 0 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.marquee-content {
    display: inline-block;
    animation: textMarquee 25s linear infinite;
}

.marquee-content span {
    font-family: 'Anton', sans-serif;
    color: #ffdf42;
    font-size: 28px;
    letter-spacing: 1.5px;
    padding-right: 50px;
    text-transform: uppercase;
}

/* ==========================================
   Section 2: Lore
   ========================================== */
.content-section {
    background-image: url('../img/seccion2-patron-fondo.png');
    background-repeat: repeat;
    background-size: 1400px;
    background-color: #0d0d0d;
    padding: 120px 20px 60px 20px;
    position: relative;
    z-index: 5;
    /* Lower than section 3, higher than hero */
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-block {
    text-align: center;
    margin-bottom: 40px;
}

.title-img {
    max-width: 100%;
    height: auto;
    width: 600px;
    filter: drop-shadow(0px 8px 15px rgba(0, 0, 0, 0.6));
}

.title-img.animate-on-scroll {
    opacity: 0;
    transform: translateX(150px);
    transition: opacity 1s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: none;
}

.title-img.animate-on-scroll.animate {
    opacity: 1;
    transform: translateX(0);
    animation: titleFloat 4s ease-in-out infinite 1s;
}

.lore-card {
    --tilt: 0deg;
    background-color: rgba(10, 10, 10, 0.92);
    border: 3px solid #ffdf42;
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 0px;
    position: relative;
    z-index: 5;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 223, 66, 0.05);
    max-width: 700px;
    font-family: 'Open Sans', sans-serif;
    color: #e0e0e0;
}

.lore-card.animate-on-scroll {
    transform: translateY(30px) rotate(var(--tilt));
}

.lore-card.animate-on-scroll.animate {
    transform: translateY(0) rotate(var(--tilt));
}

.highlight-yellow {
    color: #ffdf42;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 223, 66, 0.2);
}

.character-block {
    text-align: center;
    margin-top: -20px;
    margin-bottom: -160px;
    position: relative;
    z-index: 10;
}

.character-block.animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
}

.section2-character-img {
    max-width: 90%;
    height: auto;
    width: 800px;
    filter: drop-shadow(0px 15px 30px rgba(0, 0, 0, 0.7));
    transition: transform 0.4s ease;
}

.character-block .section2-character-img {
    opacity: 0;
    transform: translateY(100px);
    transition: opacity 1s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.character-block.animate .section2-character-img {
    opacity: 1;
    transform: translateY(0);
    animation: characterBreathe 5s ease-in-out infinite 1s;
}

.section2-character-img:hover {
    transform: scale(1.05) rotate(2deg);
}

/* ==========================================
   Section 3: Gallery Title & Carousels
   ========================================== */

/* Wavy Dividers using SVGs in CSS */
.gallery-title-section::before {
    content: '';
    position: absolute;
    top: -59px;
    left: 0;
    width: 100%;
    height: 60px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 120" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"><path d="M0,60 C240,120 480,0 720,60 C960,120 1200,0 1440,60 L1440,120 L0,120 Z" fill="%230d0d0d" /></svg>');
    background-size: 20% 100%;
    background-repeat: repeat-x;
    z-index: 5;
}

.gallery-title-section::after {
    content: '';
    position: absolute;
    top: 0px;
    left: 0;
    width: 100%;
    height: 60px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 120" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"><path d="M0,60 C240,120 480,0 720,60 C960,120 1200,0 1440,60 L1440,120 L0,120 Z" fill="%230d0d0d" /></svg>');
    background-size: 20% 100%;
    background-repeat: repeat-x;
    transform: rotate(180deg);
    z-index: 5;
}

.gallery-title-section {
    position: relative;
    z-index: 20;
    /* High z-index to cover section 2 character */
    background-size: cover;
    background-position: center;
    background-color: #fddd34;
    text-align: center;
    padding: 100px 20px 60px;
    margin-top: 0px;
}

.gallery-title-container {
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-title-img {
    max-width: 100%;
    height: auto;
    width: 500px;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.2));
    animation: titleFloat 5s ease-in-out infinite;
}

/* Gallery Carousels */
.photo-grid-section::before {
    content: '';
    position: absolute;
    top: -59px;
    left: 0;
    width: 100%;
    height: 60px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 120" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"><path d="M0,60 C240,120 480,0 720,60 C960,120 1200,0 1440,60 L1440,120 L0,120 Z" fill="%23000" /></svg>');
    background-size: 20% 100%;
    background-repeat: repeat-x;
    z-index: 5;
}

.photo-grid-section::after {
    content: '';
    position: absolute;
    top: 0px;
    left: 0;
    width: 100%;
    height: 60px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 120" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"><path d="M0,60 C240,120 480,0 720,60 C960,120 1200,0 1440,60 L1440,120 L0,120 Z" fill="%23000" /></svg>');
    background-size: 20% 100%;
    background-repeat: repeat-x;
    transform: rotate(180deg);
    z-index: 5;
}

.photo-grid-section {
    position: relative;
    z-index: 30;
    background-color: #000;
    padding: 80px 20px 60px;
    margin-top: 0px;
}

.gallery-carousels-wrapper {
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

.gallery-carousels {
    transform: rotate(-1.5deg);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 50px;
    overflow: hidden;
    width: 110%;
    margin-left: -5%;
}

.carousel-row {
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 20px;
    width: max-content;
}

/* Animations for horizontal tracks */
@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes scrollRight {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

.track-right-to-left {
    animation: scrollLeft 45s linear infinite;
}

.track-left-to-right {
    animation: scrollRight 45s linear infinite;
}

.carousel-track:hover {
    animation-play-state: paused;
}

.carousel-track img {
    aspect-ratio: 1;
    object-fit: cover;
    border: 4px solid #000;
    border-radius: 12px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.carousel-track img:hover {
    transform: scale(1.06);
    border-color: #ffdf42;
}

.row-1 .carousel-track img {
    height: 280px;
}

.row-2 .carousel-track img,
.row-3 .carousel-track img {
    height: 150px;
}

/* CA Container at the bottom of Section 3 */
.ca-container {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 10;
    margin-top: 30px;
    transform: rotate(-1deg);
}

.ca-box {
    background-color: #000;
    color: #fff;
    padding: 16px 36px;
    border-radius: 50px;
    font-family: 'Anton', sans-serif;
    font-weight: normal;
    font-size: 20px;
    letter-spacing: 1.5px;
    border: 3px solid #ffdf42;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    word-break: break-all;
    max-width: 90%;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ca-box:hover {
    background-color: #ffdf42;
    color: #000;
    border-color: #fff;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 15px 30px rgba(255, 223, 66, 0.4);
}

/* ==========================================
   Section 4: Footer
   ========================================== */
.footer-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 60px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 120" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"><path d="M0,60 C240,120 480,0 720,60 C960,120 1200,0 1440,60 L1440,120 L0,120 Z" fill="black" /></svg>');
    background-size: 20% 100%;
    background-repeat: repeat-x;
    transform: rotate(180deg);
}

.footer-section {
    position: relative;
    background-size: cover;
    background-position: center;
    background-color: #fddd34;
    padding: 100px 20px 0px;
    margin-top: -5px;
    overflow: hidden;
}

.footer-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 80px;
    padding-top: 20px;
}

.footer-character-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.footer-character {
    width: 450px;
    height: auto;
    filter: drop-shadow(0px 15px 25px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
    margin-bottom: -160px;
    transform-origin: bottom center;
}

.footer-character:hover {
    transform: scale(1.05) rotate(2deg);
}

.footer-social-link {
    display: block;
    text-decoration: none;
    margin-bottom: 220px;
}

@keyframes floatSocial {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-50px);
    }
}

.telegram-link {
    animation: floatSocial 4s ease-in-out infinite;
}

.x-link {
    animation: floatSocial 4s ease-in-out infinite -2s;
}

.footer-social-icon {
    width: 170px;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
}

.footer-social-icon:hover {
    transform: scale(1.18) rotate(8deg);
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.5));
}

/* ==========================================
   Responsive Breakpoints
   ========================================== */

/* Tablet Mode (up to 900px) */
@media (max-width: 900px) {
    .header-corner-head {
        width: 140px;
        left: 3%;
        animation: headDropInTablet 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    @keyframes headDropInTablet {
        0% { top: -200px; opacity: 0; }
        100% { top: -55px; opacity: 1; }
    }

    .header-corner-head:hover {
        top: -45px;
        transform: rotate(0deg) scale(1.05);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s cubic-bezier(0.77, 0.2, 0.05, 1);
        z-index: 1000;
        gap: 30px;
        visibility: hidden;
        pointer-events: none;
    }

    .nav-links.active {
        right: 0;
        visibility: visible;
        pointer-events: all;
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle span {
        background-color: #000;
    }

    .nav-btn {
        font-size: 22px;
        background: transparent;
        border: none;
        color: #ffdf42;
        padding: 15px 30px;
    }

    .nav-btn:hover {
        background: transparent;
        color: #fff;
        box-shadow: none;
    }

    .buy-btn {
        background-color: #ffdf42;
        color: #000 !important;
        border-radius: 50px;
        padding: 15px 45px;
    }

    .hero-section {
        min-height: 60vh;
        padding-top: 120px;
    }

    .hero-character {
        width: 360px;
        margin-bottom: -120px;
    }

    .marquee-content span {
        font-size: 22px;
    }

    .content-section {
        padding: 100px 15px 40px;
    }

    .title-img {
        width: 90%;
    }

    .lore-card {
        padding: 30px;
        font-size: 16px;
    }

    .character-block {
        margin-bottom: -100px;
    }

    .section2-character-img {
        width: 450px;
    }

    .gallery-title-img {
        width: 80%;
    }

    .row-1 .carousel-track img {
        height: 180px;
    }

    .row-2 .carousel-track img,
    .row-3 .carousel-track img {
        height: 110px;
    }

    .ca-box {
        font-size: 14px;
        padding: 12px 20px;
    }

    .footer-content {
        gap: 40px;
    }

    .footer-character {
        width: 320px;
        margin-bottom: -110px;
    }

    .footer-social-link {
        margin-bottom: 150px;
    }

    .footer-social-icon {
        width: 120px;
    }
}

/* Mobile Mode (up to 480px) */
@media (max-width: 480px) {
    .header-corner-head {
        width: 100px;
        animation: headDropInMobile 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    @keyframes headDropInMobile {
        0% { top: -200px; opacity: 0; }
        100% { top: -40px; opacity: 1; }
    }

    .header-corner-head:hover {
        top: -30px;
        transform: rotate(0deg) scale(1.05);
    }

    .hero-section {
        min-height: 55vh;
    }

    .hero-character {
        width: 270px;
        margin-bottom: -90px;
    }

    .content-section {
        padding: 80px 10px 30px;
    }

    .lore-card {
        padding: 20px;
        font-size: 14px;
        border-radius: 18px;
    }

    .character-block {
        margin-bottom: -60px;
    }

    .section2-character-img {
        width: 280px;
    }

    .ca-box {
        font-size: 11px;
        padding: 10px 15px;
        letter-spacing: 0.5px;
    }

    .footer-content {
        gap: 15px;
        padding-top: 10px;
    }

    .footer-character {
        width: 200px;
        margin-bottom: -70px;
    }

    .footer-social-link {
        margin-bottom: 95px;
    }

    .footer-social-icon {
        width: 75px;
    }
}