/* ============================================
   墨韵中国风 (Ink Wash Chinese Painting)
   Custom CSS for HHpoker Landing Page
   ============================================ */

/* === CSS Variables === */
:root {
    --ink: #1a1a1a;
    --ink-light: #2c2c2c;
    --rice: #f5f0e8;
    --rice-light: #faf7f0;
    --vermilion: #c41e3a;
    --vermilion-dark: #b22222;
    --gold: #c9a84c;
    --transition-speed: 0.3s;
}

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

/* === Rice Paper Texture === */
.rice-paper-texture {
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(200, 180, 150, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(180, 160, 130, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(210, 190, 160, 0.08) 0%, transparent 50%);
    background-size: 100% 100%;
}

/* === Brush Stroke Text === */
.brush-text {
    position: relative;
    display: inline-block;
}

.brush-text::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 5%;
    width: 90%;
    height: 6px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(201,168,76,0.3) 10%,
        rgba(201,168,76,0.6) 30%,
        rgba(201,168,76,0.5) 50%,
        rgba(201,168,76,0.3) 70%,
        transparent 100%);
    border-radius: 3px;
    opacity: 0.5;
}

/* === Seal Stamp === */
.seal-stamp {
    animation: sealAppear 1.2s ease-out forwards;
}

@keyframes sealAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-15deg);
    }
    60% {
        opacity: 1;
        transform: scale(1.1) rotate(-3deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(-6deg);
    }
}

.seal-stamp-sm {
    animation: sealAppearSm 1s ease-out forwards;
}

@keyframes sealAppearSm {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(-3deg);
    }
}

.seal-dot {
    box-shadow: 1px 1px 3px rgba(196, 30, 58, 0.3);
}

.seal-mark {
    text-orientation: upright;
}

/* === Feature Cards === */
.feature-card {
    position: relative;
    border: 1px solid rgba(26, 26, 26, 0.08);
    box-shadow: 2px 3px 8px rgba(26, 26, 26, 0.05);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(26,26,26,0.4) 20%,
        rgba(26,26,26,0.7) 50%,
        rgba(26,26,26,0.4) 80%,
        transparent 100%);
    border-radius: 2px;
    opacity: 0.6;
    transition: all var(--transition-speed);
}

.feature-card:hover::before {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(196,30,58,0.4) 20%,
        rgba(196,30,58,0.8) 50%,
        rgba(196,30,58,0.4) 80%,
        transparent 100%);
    opacity: 1;
}

/* === Scroll Cards (Testimonials) === */
.scroll-card {
    position: relative;
    border: 1px solid rgba(26, 26, 26, 0.08);
    box-shadow: 2px 3px 12px rgba(26, 26, 26, 0.06);
}

.scroll-card::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 5%;
    width: 90%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(196,30,58,0.15) 20%,
        rgba(196,30,58,0.25) 50%,
        rgba(196,30,58,0.15) 80%,
        transparent 100%);
    border-radius: 1px;
}

/* === Stat Items === */
.stat-item {
    position: relative;
    overflow: hidden;
}

.stat-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(201,168,76,0.03) 0%,
        transparent 50%,
        rgba(201,168,76,0.03) 100%);
    pointer-events: none;
}

/* === FAQ Accordion === */
.faq-item {
    transition: all var(--transition-speed);
}

.faq-item:hover {
    border-color: rgba(196, 30, 58, 0.2);
    box-shadow: 2px 3px 12px rgba(26, 26, 26, 0.04);
}

.faq-toggle {
    position: relative;
    cursor: pointer;
}

.faq-toggle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--vermilion);
    border-radius: 2px;
    transition: height var(--transition-speed);
}

.faq-item.active .faq-toggle::before {
    height: 60%;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-item.active {
    border-color: rgba(196, 30, 58, 0.3);
}

.faq-content {
    display: none;
    animation: fadeSlideDown 0.4s ease-out;
}

.faq-item.active .faq-content {
    display: block;
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ink-wash brush stroke indicator for FAQ */
.faq-item .faq-icon i {
    position: relative;
}

.faq-item .faq-icon i::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: -4px;
    width: calc(100% + 8px);
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(196,30,58,0.3) 20%,
        rgba(196,30,58,0.5) 50%,
        rgba(196,30,58,0.3) 80%,
        transparent 100%);
    border-radius: 1px;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.faq-item.active .faq-icon i::after {
    opacity: 1;
}

/* === Navbar Scroll Effect === */
#navbar.scrolled {
    box-shadow: 0 2px 12px rgba(26, 26, 26, 0.1);
    background: rgba(250, 247, 240, 0.98);
}

/* === Back to Top === */
#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* === Floating CS Pulse === */
#floating-cs:hover i {
    animation: headsetPulse 0.8s ease-in-out;
}

@keyframes headsetPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* === IntersectionObserver Reveal Animations === */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid items */
.reveal:nth-child(1) { transition-delay: 0.05s; }
.reveal:nth-child(2) { transition-delay: 0.15s; }
.reveal:nth-child(3) { transition-delay: 0.25s; }
.reveal:nth-child(4) { transition-delay: 0.1s; }
.reveal:nth-child(5) { transition-delay: 0.2s; }
.reveal:nth-child(6) { transition-delay: 0.3s; }

/* Keep stagger within grid context */
.feature-card.reveal:nth-child(1) { transition-delay: 0.05s; }
.feature-card.reveal:nth-child(2) { transition-delay: 0.15s; }
.feature-card.reveal:nth-child(3) { transition-delay: 0.25s; }
.feature-card.reveal:nth-child(4) { transition-delay: 0.1s; }
.feature-card.reveal:nth-child(5) { transition-delay: 0.2s; }
.feature-card.reveal:nth-child(6) { transition-delay: 0.3s; }

.stat-item.reveal:nth-child(1) { transition-delay: 0.05s; }
.stat-item.reveal:nth-child(2) { transition-delay: 0.15s; }
.stat-item.reveal:nth-child(3) { transition-delay: 0.25s; }
.stat-item.reveal:nth-child(4) { transition-delay: 0.35s; }

.testimonial-card.reveal:nth-child(1) { transition-delay: 0.05s; }
.testimonial-card.reveal:nth-child(2) { transition-delay: 0.15s; }
.testimonial-card.reveal:nth-child(3) { transition-delay: 0.25s; }

.faq-item.reveal:nth-child(1) { transition-delay: 0.05s; }
.faq-item.reveal:nth-child(2) { transition-delay: 0.1s; }
.faq-item.reveal:nth-child(3) { transition-delay: 0.15s; }
.faq-item.reveal:nth-child(4) { transition-delay: 0.2s; }
.faq-item.reveal:nth-child(5) { transition-delay: 0.25s; }
.faq-item.reveal:nth-child(6) { transition-delay: 0.3s; }

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

::-webkit-scrollbar-track {
    background: var(--rice);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--ink-light), var(--ink));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--vermilion);
}

/* === Selection === */
::selection {
    background: rgba(196, 30, 58, 0.2);
    color: var(--ink);
}

::-moz-selection {
    background: rgba(196, 30, 58, 0.2);
    color: var(--ink);
}

/* === Mobile Menu Transition === */
#mobile-menu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 400px;
    }
}

/* === Active Navigation Link === */
.nav-link {
    position: relative;
    font-family: 'ZCOOL XiaoWei', 'Ma Shan Zheng', serif;
}

/* === Hero Section Ink Mountains Animation === */
#home > div:first-child > div {
    animation: mistDrift 20s ease-in-out infinite alternate;
}

#home > div:first-child > div:nth-child(2) {
    animation-delay: -5s;
}

#home > div:first-child > div:nth-child(3) {
    animation-delay: -10s;
}

@keyframes mistDrift {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(2%);
    }
}

/* === CTA Section Button Hover === */
#cta a:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* === Footer Link Hover Effect === */
footer a:hover {
    padding-left: 2px;
}

/* === Hero - Sun circle pulse === */
#home .rounded-full.bg-vermilion\/80 {
    animation: sunPulse 4s ease-in-out infinite;
}

@keyframes sunPulse {
    0%, 100% {
        box-shadow: 0 0 60px 20px rgba(196,30,58,0.3), 0 0 120px 40px rgba(196,30,58,0.1);
    }
    50% {
        box-shadow: 0 0 80px 25px rgba(196,30,58,0.4), 0 0 150px 50px rgba(196,30,58,0.15);
    }
}

/* === Responsive Adjustments === */
@media (max-width: 768px) {
    #home h1 {
        font-size: 2.25rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    #stats .grid {
        gap: 1rem;
    }

    .stat-item {
        padding: 1.25rem;
    }

    .stat-item .text-5xl {
        font-size: 2rem;
    }

    .faq-toggle span {
        font-size: 0.95rem;
    }
}

@media (max-width: 640px) {
    #navbar .text-xl {
        font-size: 1rem;
    }

    #home h1 {
        font-size: 1.75rem;
        letter-spacing: 0.15em;
    }

    #home p {
        font-size: 0.95rem;
    }

    #home .flex.flex-col.sm\\:flex-row a {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    #cta h2 {
        font-size: 1.75rem;
    }

    footer .grid {
        gap: 2rem;
    }
}

/* === Print Styles === */
@media print {
    #navbar,
    #floating-cs,
    #back-to-top,
    #mobile-menu {
        display: none !important;
    }
}
