/* Pixxel - Custom Styles */

:root {
    --reveal-distance: 12px;
    --reveal-duration: 0.7s;
    --reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
    background: #ffffff;
    font-family: "IRANSansX", sans-serif;
    margin: 0;
    padding: 0;
    opacity: 1;
    transition: opacity var(--reveal-duration) var(--reveal-ease);
}

.page-init {
    opacity: 0;
}

.page-loaded {
    opacity: 1;
}

.soft-reveal {
    opacity: 0;
    transform: translateY(var(--reveal-distance));
    transition: opacity var(--reveal-duration) var(--reveal-ease), transform var(--reveal-duration) var(--reveal-ease);
    will-change: opacity, transform;
}

.page-loaded .soft-reveal {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 {
    transition-delay: 0s;
}

.reveal-delay-2 {
    transition-delay: 0.1s;
}

.reveal-delay-3 {
    transition-delay: 0.2s;
}

.reveal-delay-4 {
    transition-delay: 0.3s;
}

.reveal-delay-5 {
    transition-delay: 0.4s;
}

@media (prefers-reduced-motion: reduce) {
    body {
        opacity: 1 !important;
        transition: none !important;
    }
    
    .soft-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

.site-header {
    background: #ffffff;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-logo {
    max-width: 180px;
    height: auto;
    display: block;
    margin-bottom: 1.5rem;
}

.header-divider {
    width: 100%;
    height: 1px;
    background: #3a3a3a;
    opacity: 0.15;
}

.hero-container {
    padding: 4rem 2rem;
    max-width: 1200px;
}

.hero-container .row {
    align-items: center;
}

.character-container {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.speech-bubble {
    position: absolute;
    top: 3%;
    left: 41%;
    transform: translateX(-50%);
    background: #ffffff;
    border-radius: 24px;
    padding: 0.85rem 1.4rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    pointer-events: none;
    max-width: 85%;
    text-align: center;
}

.speech-bubble.visible {
    opacity: 1;
    visibility: visible;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffffff;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.05));
}

.speech-bubble-text {
    font-family: "IRANSansX", sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: #2a2a2a;
    line-height: 1.5;
    display: block;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.speech-bubble-text.fade {
    opacity: 0;
}

.character-container::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 20px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0) 70%);
    z-index: 0;
    pointer-events: none;
}

.halo-decoration {
    position: absolute;
    width: 320px;
    height: 280px;
    top: 50%;
    left: 52%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    clip-path: inset(0 0 50% 0);
}

.halo-decoration::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: #6ba3d838;
    border-radius: 50%;
    border: 1.5px solid rgba(181, 160, 114, 0.75);
    box-sizing: border-box;
    animation: haloPulse 6s ease-in-out infinite;
}

@keyframes haloPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.88;
    }
}

@keyframes sparkPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
}

.star {
    position: absolute;
    color: rgba(181, 160, 114, 0.7);
    font-size: 10px;
    line-height: 1;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.star-1 {
    top: 18%;
    left: 42%;
}

.star-2 {
    top: 20%;
    right: 38%;
}

.page-loaded .star {
    opacity: 1;
}

.interactive-spark {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 1;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: sparkFloat 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
}

.spark-emoji::before,
.spark-emoji::after {
    display: none;
}

.spark-1 {
    animation-delay: 0s;
}

.spark-2 {
    animation-delay: 1s;
}

.spark-3 {
    animation-delay: 2s;
}

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

.interactive-spark::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    background: radial-gradient(circle, rgba(212, 175, 55, 0.9) 0%, rgba(181, 160, 114, 0.8) 40%, rgba(181, 160, 114, 0.6) 60%, transparent 80%);
    clip-path: polygon(50% 0%, 75% 25%, 100% 25%, 75% 50%, 100% 75%, 50% 100%, 25% 75%, 0% 75%, 25% 50%, 0% 25%, 25% 25%);
    filter: blur(1px);
    transition: all 0.3s ease;
}

.spark-blue::before {
    background: radial-gradient(circle, rgba(110, 184, 243, 0.9) 0%, rgba(91, 163, 216, 0.8) 40%, rgba(91, 163, 216, 0.6) 60%, transparent 80%);
}

.interactive-spark::after {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    background: radial-gradient(circle, rgba(212, 175, 55, 0.4) 0%, transparent 70%);
    clip-path: polygon(50% 0%, 75% 25%, 100% 25%, 75% 50%, 100% 75%, 50% 100%, 25% 75%, 0% 75%, 25% 50%, 0% 25%, 25% 25%);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.spark-blue::after {
    background: radial-gradient(circle, rgba(110, 184, 243, 0.4) 0%, transparent 70%);
}

.interactive-spark:hover::before {
    transform: translate(-50%, -50%) rotate(45deg) scale(1.3);
    filter: blur(1.5px);
    background: radial-gradient(circle, rgba(212, 175, 55, 1) 0%, rgba(212, 175, 55, 0.9) 30%, rgba(181, 160, 114, 0.7) 50%, transparent 80%);
}

.spark-blue:hover::before {
    background: radial-gradient(circle, rgba(110, 184, 243, 1) 0%, rgba(110, 184, 243, 0.9) 30%, rgba(91, 163, 216, 0.7) 50%, transparent 80%);
}

.interactive-spark:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(45deg) scale(1.5);
}

.interactive-spark:active::before {
    transform: translate(-50%, -50%) rotate(45deg) scale(1.1);
}

.spark-emoji:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 0 8px rgba(255, 200, 0, 0.6));
}

.spark-emoji:active {
    transform: scale(1.1);
}

.spark-1 {
    top: 30%;
    left: 15%;
}

.spark-2 {
    top: 35%;
    right: 12%;
}

.spark-3 {
    top: 50%;
    left: 18%;
}

.character-image {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.character-image.active {
    opacity: 1;
    transform: translateX(0);
}

.preview-card-container {
    margin: 2rem 0 1.5rem;
    text-align: center;
}

.preview-card {
    max-width: 380px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    position: relative;
}

.preview-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 133%;
    overflow: hidden;
}

.preview-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    filter: blur(2px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.preview-image-wrapper.scanning .preview-image {
    opacity: 0.85;
    filter: blur(0.5px);
    transition: opacity 0.4s ease, filter 0.4s ease;
}

.preview-image-wrapper.scan-complete .preview-image {
    opacity: 1;
    filter: blur(0);
    transition: opacity 0.5s ease, filter 0.5s ease;
}

.scan-line {
    position: absolute;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
}

.scan-vertical {
    top: 0;
    width: 2.5px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, #FF7A00, #FF7A00, transparent);
    box-shadow: 0 0 8px rgba(255, 122, 0, 0.7), 0 0 14px rgba(255, 122, 0, 0.5);
    left: 0;
}

.preview-image-wrapper.scanning .scan-vertical {
    opacity: 1;
    animation: scanHorizontal 2.5s ease-in-out infinite;
}

@keyframes scanHorizontal {
    0% {
        left: 0;
    }
    100% {
        left: 100%;
    }
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(107, 163, 216, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(107, 163, 216, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.25s ease;
}

.preview-image-wrapper.scanning .grid-overlay {
    opacity: 0.055;
}

.preview-image-wrapper.scan-complete .grid-overlay,
.preview-image-wrapper.scan-complete .scan-line {
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: none;
}

.preview-status {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #6b6b6b;
    font-weight: 400;
}

.interaction-section {
    padding: 2rem 2rem 2rem 0;
    text-align: right;
}

.main-headline {
    font-size: clamp(1.68rem, 3vw + 0.9rem, 2.5rem);
    font-weight: 600;
    color: #2a2a2a;
    line-height: 1.35;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    margin-top: 0;
}

.supporting-text {
    font-size: clamp(0.9rem, 1vw + 0.6rem, 1rem);
    color: #777;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.action-group {
    margin-top: 1rem;
}

.file-input-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}


.btn-primary-pixxel {
    width: 100%;
    padding: 1.15rem 2rem;
    background: #6ba3d8;
    color: #ffffff;
    border: 1.5px solid rgba(181, 160, 114, 0.75);
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 500;
    font-family: "IRANSansX", sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(107, 163, 216, 0.2);
    position: relative;
}

.btn-primary-pixxel:hover:not(:disabled) {
    background: #5a92c7;
    border-color: rgba(181, 160, 114, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 163, 216, 0.3);
}

.btn-primary-pixxel:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(107, 163, 216, 0.2);
}

.btn-primary-pixxel:disabled {
    background: #d0d0d0;
    border-color: #c0c0c0;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .header-content {
        padding: 1.5rem 1rem 0;
    }
    
    .brand-logo {
        max-width: 140px;
        margin-bottom: 1.25rem;
    }
    
    .character-container {
        height: 400px;
    }
    
    .main-headline {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .supporting-text {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .btn-primary-pixxel {
        font-size: 1.05rem;
    }
    
    .halo-decoration {
        clip-path: inset(0 0 40% 0);
    }
    
    .interaction-section {
        padding: 1.5rem 1rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .action-group {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 1rem;
    }

    .preview-card {
        max-width: 320px;
        margin: 0 auto;
    }
    
    .preview-card-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 2rem 0 1.5rem;
    }
    
    .preview-status {
        text-align: center;
    }
    
    .btn-primary-pixxel {
        width: 100%;
        max-width: 100%;
    }
    
    .spark-1 {
        top: 20%;
        left: 10%;
    }
    
    .spark-2 {
        top: 30%;
        right: 8%;
    }
    
    .spark-3 {
        top: 40%;
        left: 12%;
    }
    
    .speech-bubble {
        top: 2%;
        left: 41%;
        max-width: 90%;
        padding: 0.75rem 1.25rem;
    }
    
    .speech-bubble-text {
        font-size: 0.95rem;
    }
}
