/* ========================================
   iSuara - Custom Styles
   ======================================== */

/* Custom Styles for Effects */
body {
    background-color: #FAFAFA;
    color: #1A1A1A;
    overflow-x: hidden;
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.1);
}

/* Hero Radar Effect */
.radar-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

/* Hide Scrollbar */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Smooth Text Selection */
::selection {
    background: #000;
    color: #fff;
}

/* The continuous scrolling animation */
@keyframes infinite-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.animate-marquee {
    animation: infinite-scroll 20s linear infinite;
    width: max-content; 
}


/* ========================================
   How It Works - Sequential Fade-In
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-step {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.6s; }
.delay-3 { animation-delay: 1.0s; }

/* ===========================================
   1. GLOBAL VIEWPORT & SNAP SCROLLING
   =========================================== */
html, body {
    min-height: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

/* Enable slide-snap presentation mode on desktop screens */
@media (min-width: 1024px) {
    html {
        height: 100%;
        scroll-snap-type: y mandatory;
    }
    
    body {
        height: 100%;
    }

    section {
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }
}

/* Fluid, natural scrolling on mobile screens */
@media (max-width: 1023px) {
    html, body {
        height: auto;
        scroll-snap-type: none;
    }

    section {
        scroll-snap-align: none;
        scroll-snap-stop: normal;
    }
}

/* ===========================================
   2. PRESENTATION UI (Nav Dots & Progress)
   =========================================== */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.05);
    z-index: 9999;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #2563EB; /* Blue color */
    transition: width 0.3s ease;
}

.nav-dots {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0,0,0,0.2);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-dot:hover {
    background: rgba(0,0,0,0.4);
    transform: scale(1.2);
}

.nav-dot.active {
    background: white;
    border-color: #2563EB; /* Blue color */
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    transform: scale(1.3);
}

/* Hide UI on very small/short screens to save space */
@media (max-height: 500px), (max-width: 768px) {
    .nav-dots { display: none; }
}

@keyframes kineticDrift {
    0% { transform: translate(-50%, -50%) translate(0, 0) rotate(var(--base-rot)); }
    25% { transform: translate(-50%, -50%) translate(var(--drift-x), var(--drift-y)) rotate(calc(var(--base-rot) + 3deg)); }
    50% { transform: translate(-50%, -50%) translate(calc(var(--drift-x) * -0.5), calc(var(--drift-y) * 1.2)) rotate(calc(var(--base-rot) - 3deg)); }
    75% { transform: translate(-50%, -50%) translate(calc(var(--drift-x) * 1.2), calc(var(--drift-y) * -0.5)) rotate(calc(var(--base-rot) + 2deg)); }
    100% { transform: translate(-50%, -50%) translate(0, 0) rotate(var(--base-rot)); }
}

.drifting-word {
    animation: kineticDrift var(--float-speed) ease-in-out infinite;
    animation-delay: var(--float-delay);
}

@keyframes wave-flow {
                0% { transform: translateX(-1440px); }
                100% { transform: translateX(0); }
            }
            .animate-wave-fast { animation: wave-flow 12s linear infinite; }
            .animate-wave-mid { animation: wave-flow 18s linear infinite; }
            .animate-wave-slow { animation: wave-flow 25s linear infinite; }

/* ===========================================
   3. LANGUAGE TOGGLE (EN / 中文)
   ===========================================
   Everything language-specific is scoped under html.lang-zh, so the English
   rendering is byte-for-byte unchanged. */

.lang-toggle {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 95;
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.lang-toggle button {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    background: transparent;
    color: rgba(0, 0, 0, 0.45);
    transition: background 0.25s ease, color 0.25s ease;
}

.lang-toggle button:hover { color: rgba(0, 0, 0, 0.78); }

.lang-toggle button.active {
    background: #2563EB;
    color: #fff;
}

@media (max-width: 768px) {
    .lang-toggle { top: 10px; right: 10px; }
    .lang-toggle button { padding: 7px 11px; font-size: 11px; }
}

@media print {
    .lang-toggle { display: none; }
}

/* ===========================================
   4. CHINESE TYPOGRAPHY
   ===========================================
   Inter and Outfit carry no CJK glyphs. Appending a Noto face keeps Latin
   rendering identical (Inter still wins for every Latin codepoint) while Han
   characters resolve to a consistent face instead of a random system fallback. */

html.lang-zh,
html.lang-zh .font-sans {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

html.lang-zh .font-serif {
    font-family: 'Noto Serif SC', ui-serif, Georgia, serif;
}

/* The iSuara / 守语 wordmark is set in Outfit, which has no CJK coverage. */
html.lang-zh [data-i18n-html="brand.wordmark"] {
    font-family: 'Outfit', 'Noto Sans SC', sans-serif;
}

/* Avoids a flash of English when Chinese is the remembered choice.
   Applied only when zh is saved, so English can never be blanked. */
html.i18n-booting body { visibility: hidden; }
