/* Mobile-specific styles - completely separate from desktop */

/* Mobile container */
.container {
    padding: 0 1rem;
}

/* Mobile Floating Bar */
.floating-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(99, 102, 241, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    z-index: 1000;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.floating-bar.hidden {
    transform: translateY(100%);
}

.floating-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
}

.floating-content span {
    flex: 1;
    text-align: left;
    line-height: 1.3;
}

.cta-button {
    background: white !important;
    color: var(--primary-color) !important;
    -webkit-text-fill-color: var(--primary-color) !important;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
}

/* Mobile Landing Section */
.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    padding: 2rem 0;
    overflow: hidden; /* Important for slide-in effect */
}

.landing-content {
    text-align: center;
    animation: fadeInUp 1s ease;
}

.logo-main {
    width: 200px;
    max-width: 70vw;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 15px 30px rgba(99, 102, 241, 0.3));
}

.tagline {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    position: relative;
    transition: transform 0.1s ease;
}

.tagline.jittering {
    animation: jitter 0.1s infinite;
}

.subtitle {
    font-size: 1rem;
    font-style: italic;
    font-family: 'EB Garamond', 'Noto Serif SC', serif;
    color: var(--light-text);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.scroll-indicator {
    margin-top: 2rem;
    text-align: center;
    opacity: 0.7;
    animation: float 3s ease-in-out infinite;
}

.scroll-indicator span {
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

.arrow-down {
    width: 20px;
    height: 20px;
    border: 2px solid var(--light-text);
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    margin: 0 auto;
}

/* Mobile Character Portraits for Landing */
.mobile-character-left,
.mobile-character-right {
    position: absolute;
    top: 0;
    height: 100vh;
    z-index: 5; /* Behind main content */
    pointer-events: none;
}

.mobile-character-left {
    left: 0;
    transform: translateX(-100%); /* Start completely off-screen */
}

.mobile-character-right {
    right: 0;
    transform: translateX(100%); /* Start completely off-screen */
}

.mobile-character-left img,
.mobile-character-right img {
    height: 100vh;
    width: auto;
    min-width: 100%;
    object-fit: cover;
    opacity: 0.3; /* Subtle presence */
    filter: brightness(0.8) contrast(1.1);
}

/* Calculate slide distance based on landing content width */
.landing-content {
    position: relative;
    z-index: 10;
    background: rgba(15, 15, 26, 0.8); /* Dark background with 80% opacity */
    /* backdrop-filter: blur(10px); removed blur effect */
    border-radius: 30px;
    padding: 3rem 2rem;
    margin: 0 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                inset 0 0 60px rgba(99, 102, 241, 0.1); /* Subtle inner glow */
    border: 1px solid rgba(99, 102, 241, 0.2); /* Subtle border matching primary color */
}

/* Animation states - will be calculated via JS for precise positioning */
.mobile-character-left.slide-in {
    animation: slideInLeft 1s ease-out 0.3s forwards;
}

.mobile-character-right.slide-in {
    animation: slideInRight 1s ease-out 0.5s forwards;
}

/* Keyframes are dynamically generated in JavaScript based on content width */

/* Mobile Characters - Show floating sprites at bottom */
.characters-container {
    position: fixed;
    bottom: 60px; /* Above floating bar */
    left: 0;
    right: 0;
    height: 120px;
    pointer-events: none;
    z-index: 500;
}

.characters-left, .characters-right {
    display: none; /* Hide main characters on mobile */
}

.character-floating {
    position: absolute;
    opacity: 0.8;
    pointer-events: none;
}

#char-sprite {
    width: 60px;
    height: auto;
    left: 10px;
    bottom: 10px;
}

#char-six {
    width: 50px;
    height: auto;
    right: 10px;
    bottom: 10px;
}

/* Mobile Character Staircase Section */
.mobile-staircase-section {
    height: 60vh;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
}

.staircase-characters-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: visible;
}

.staircase-left,
.staircase-right {
    position: absolute;
    bottom: 0;
    width: 50%;
    height: 100%;
}

.staircase-left {
    left: 0;
}

.staircase-right {
    right: 0;
}

.staircase-char {
    width: 160px; /* Scaled down from desktop's 320px */
    height: auto;
    opacity: 0;
    position: absolute;
    transition: all 0.5s ease;
    mask: linear-gradient(to bottom, white 0%, white 70%, transparent 100%);
    -webkit-mask: linear-gradient(to bottom, white 0%, white 70%, transparent 100%);
    transform: translateX(-200px); /* Start off-screen by default */
}

/* Right side characters start off-screen right */
.staircase-right .staircase-char {
    transform: translateX(200px); /* Start off-screen right */
}

/* Direct copy of desktop positioning, scaled for mobile, pushed further outward */
#stair-basil {
    bottom: 45%;
    left: -10%; /* 5% - 15% = -10% */
    z-index: 1;
}

#stair-dimitri {
    bottom: 25%;
    left: 15%; /* 30% - 15% = 15% */
    z-index: 2;
}

#stair-kat {
    bottom: 5%;
    left: -15%; /* 15% - 15% - 15% = -15% (shifted further left) */
    z-index: 3;
}

#stair-mari {
    bottom: 45%;
    right: -10%; /* 5% - 15% = -10% */
    z-index: 1;
    width: 130px; /* Smaller like desktop */
}

#stair-random-1 {
    bottom: 25%;
    right: 15%; /* 30% - 15% = 15% */
    z-index: 2;
}

#stair-random-2 {
    bottom: 5%;
    right: -15%; /* 15% - 15% - 15% = -15% (shifted further right) */
    z-index: 3;
}

/* Slide-in animations for staircase */
.staircase-char.slide-in-left {
    opacity: 1;
    animation: staircaseSlideInLeft 0.8s ease forwards;
}

.staircase-char.slide-in-right {
    opacity: 1;
    animation: staircaseSlideInRight 0.8s ease forwards;
}

@keyframes staircaseSlideInLeft {
    from {
        transform: translateX(-200px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes staircaseSlideInRight {
    from {
        transform: translateX(200px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Demo Section */
.demo-section {
    padding: 3rem 0;
    background: rgba(0, 0, 0, 0.3);
}

.demo-section h2 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin: 0 auto;
    max-width: 100%;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* Mobile Hero Section */
.hero-section {
    padding: 3rem 0;
    background: linear-gradient(180deg, transparent 0%, rgba(99, 102, 241, 0.05) 100%);
}

.hero-content h2 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-family: 'EB Garamond', 'Noto Sans SC', sans-serif;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--light-text);
    margin-bottom: 2rem;
    text-align: center;
    opacity: 0.9;
}

/* Mobile Features Grid - Stack vertically */
.features-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--heading-text);
}

.feature-card p {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* Mobile Character Section */
.character-section {
    padding: 3rem 0;
    background: rgba(0, 0, 0, 0.2);
}

.character-section h2 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.character-showcase {
    max-width: 500px;
    margin: 0 auto;
}

.character-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.character-image {
    position: relative;
    border-radius: 20px;
    overflow: visible; /* Keep visible for Chinese names */
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 250px; /* Fixed width for container */
    height: 365px; /* Height maintaining 500:731 aspect ratio */
}

.character-image img {
    width: auto;
    height: 100%; /* Force height to match container */
    min-width: 100%; /* Ensure full coverage */
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the image */
    object-fit: cover; /* Maintain aspect ratio while filling height */
    border-radius: 20px; /* Match container radius */
}

/* Width-based scaling for specific characters like Six app */
.character-image.width-based img {
    width: 100%; /* Force width to match container */
    height: auto !important; /* Let height adjust */
    min-width: 100%; /* Keep full width coverage */
    min-height: unset; /* Remove height constraint */
    object-fit: contain; /* Show full image within bounds */
}

.vertical-chinese-name {
    position: absolute;
    left: -35px;
    top: 50%;
    transform: translateY(-50%);
    height: auto;
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    z-index: 20;
    letter-spacing: 0.2em;
    white-space: nowrap; /* Prevent text wrapping */
    word-break: keep-all; /* Keep characters together */
    line-height: 1; /* Tighter line height */
}

.character-info {
    width: 100%;
    text-align: center;
}

.character-name h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Playfair Display', serif;
}

.character-name h4 {
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0.3rem 0 0.5rem 0;
    color: var(--secondary-color);
    opacity: 0.9;
    font-family: 'Noto Sans SC', sans-serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.character-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
    font-family: 'Noto Sans SC', sans-serif;
    letter-spacing: 0.1em;
    justify-content: center;
}

.character-stats span:not(:last-child)::after {
    content: "•";
    margin-left: 0.5rem;
    opacity: 0.5;
}

#char-description {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.character-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.trait {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Mobile Character Navigation */
.character-navigation-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.gradient-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.gradient-left {
    left: 0;
    background: linear-gradient(to right, rgba(15, 15, 26, 1) 0%, rgba(15, 15, 26, 0.8) 50%, transparent 100%);
}

.gradient-right {
    right: 0;
    background: linear-gradient(to left, rgba(15, 15, 26, 1) 0%, rgba(15, 15, 26, 0.8) 50%, transparent 100%);
}

.character-navigation {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0 1rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.character-navigation::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.char-nav-btn {
    width: 60px;
    height: 60px;
    min-width: 60px; /* Prevent shrinking */
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 0;
    flex-shrink: 0; /* Prevent flex shrinking */
}

.char-nav-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.char-nav-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.char-nav-btn:hover img {
    transform: scale(1.1);
}

.char-nav-btn.active {
    border-color: var(--accent-color);
    background: rgba(236, 72, 153, 0.1);
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.3);
}

/* Mobile Screenshots Section */
.screenshots-section {
    padding: 3rem 0;
    background: rgba(0, 0, 0, 0.3);
}

.screenshots-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.features-sidebar h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-align: center;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.features-sidebar li {
    font-size: 0.9rem;
    opacity: 0.9;
    text-align: center;
}

.screenshots-carousel {
    width: 100%;
}

.screenshot-container {
    position: relative;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.screenshot {
    width: 100%;
    height: auto;
    display: none;
}

.screenshot.active {
    display: block;
}

.screenshot-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* Mobile Signup Section */
.signup-section {
    padding: 3rem 0;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
}

.signup-section h2 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.signup-description {
    font-size: 1rem;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.signup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

.email-input {
    padding: 1rem;
    border-radius: 10px;
    font-size: 1rem;
}

.signup-button {
    background: var(--gradient-1);
    color: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.signup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.signup-note {
    font-size: 0.9rem;
    text-align: center;
    opacity: 0.8;
    line-height: 1.5;
}

/* Mobile Footer */
.footer {
    padding: 2rem 0;
    background: rgba(0, 0, 0, 0.5);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1) !important;
    -webkit-text-fill-color: initial !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-color) !important;
    transform: translateY(-3px);
}

.social-link svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.footer-text {
    opacity: 0.7;
    text-align: center;
    font-size: 0.9rem;
}