/* === Variables === */
:root {
    --primary: #1a3a4a;
    --primary-light: #e4edf1;
    --secondary: #e63946;
    --secondary-light: #fde8ea;
    --accent: #4a8b9c;
    --accent-light: #e8f3f6;
    --dark: #0f2630;
    --dark-light: #e2e8eb;
    --forest: #3a7d5c;
    --forest-light: #e5f2ec;
    --cream: #f0f4f6;
    --card: #ffffff;
    --text: #1a1a1a;
    --text-muted: #6b6b6b;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--cream);
    color: var(--text);
    line-height: 1.6;
    overflow-x: clip;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul { list-style: none; }

/* === Utilities === */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.text-accent { color: var(--secondary); }

/* === Nav === */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(240,244,246,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: background 0.3s;
}
.navbar.scrolled { background: rgba(240,244,246,0.95); }
.nav-container {
    max-width: 1120px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.nav-back {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    color: var(--text-muted); transition: all 0.2s;
    margin-right: 4px;
}
.nav-back:hover { background: var(--primary-light); color: var(--primary); }
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.nav-icon { width: 36px; height: 36px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.logo-text { color: var(--text); }
.nav-links { display: flex; gap: 32px; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
    font-size: 0.85rem; font-weight: 600;
    padding: 8px 20px; border-radius: 999px;
    background: var(--primary); color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,58,74,0.35); }

/* Mobile toggle */
.mobile-toggle { display: none; flex-direction: column; gap: 5px; padding: 4px; }
.mobile-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }

@media (max-width: 768px) {
    .nav-links, .nav-cta { display: none; }
    .mobile-toggle { display: flex; }
    .nav-links.open {
        display: flex; flex-direction: column; gap: 0;
        position: absolute; top: 64px; left: 0; right: 0;
        background: var(--cream); border-bottom: 1px solid rgba(0,0,0,0.06);
        padding: 16px 24px;
    }
    .nav-links.open a { padding: 12px 0; font-size: 1rem; }
}

/* === Hero === */
.hero {
    position: relative; padding: 140px 0 80px; overflow: hidden;
    background: linear-gradient(170deg, #e4edf1 0%, var(--cream) 60%);
}
.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.shape { position: absolute; border-radius: 50%; opacity: 0.12; }
.shape-1 { width: 500px; height: 500px; background: var(--primary); top: -150px; right: -100px; }
.shape-2 { width: 300px; height: 300px; background: var(--forest); bottom: -80px; left: -60px; }
.shape-3 { width: 200px; height: 200px; background: var(--secondary); top: 40%; left: 30%; }

.hero-content { display: flex; align-items: center; gap: 60px; position: relative; min-height: 0; }
.hero-text { flex: 1; }
.hero-badge {
    display: inline-block; font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; padding: 5px 14px; border-radius: 999px;
    background: var(--primary-light); color: var(--primary); margin-bottom: 20px;
}
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.12; margin-bottom: 20px; }
.hero-subtitle { font-size: 1.1rem; color: var(--text-muted); max-width: 480px; margin-bottom: 32px; line-height: 1.65; }
.hero-actions { margin-bottom: 40px; }
.hero-stats { display: flex; gap: 32px; }
.stat { display: flex; flex-direction: column; }
.stat-number { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.hero-app-icon {
    width: 280px; height: 280px; border-radius: 62px;
    box-shadow: 0 20px 60px rgba(15,38,48,0.3), 0 8px 24px rgba(26,58,74,0.25);
}
.hero-visual { flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

@media (max-width: 900px) {
    .hero-content { flex-direction: column; text-align: center; }
    .hero-subtitle { margin-left: auto; margin-right: auto; }
    .hero-stats { justify-content: center; flex-wrap: wrap; gap: 24px; }
    .hero-actions { display: flex; justify-content: center; }
    .hero-app-icon { width: 200px; height: 200px; border-radius: 44px; }
}
@media (max-width: 560px) {
    .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
}

/* === Section Headers === */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header.light h2 { color: #fff; }
.section-header.light .section-tag { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.9); }
.section-tag {
    display: inline-block; font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; padding: 5px 14px; border-radius: 999px;
    background: var(--primary-light); color: var(--primary); margin-bottom: 12px;
}
.section-header h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }

/* === Features === */
.features { padding: 96px 0; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
    background: var(--card); border-radius: var(--radius); padding: 32px;
    box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; }

@media (max-width: 900px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features-grid { grid-template-columns: 1fr; } }

/* === Topics === */
.topics { padding: 96px 0; background: #e4edf1; }
.topics-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.topic-card {
    background: var(--card); border-radius: var(--radius); padding: 28px 20px;
    text-align: center; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}
.topic-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.topic-emoji { font-size: 2.2rem; display: block; margin-bottom: 12px; }
.topic-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.topic-card p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }

@media (max-width: 900px) { .topics-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .topics-grid { grid-template-columns: repeat(2, 1fr); } }

/* === Dialogues === */
.dialogues {
    padding: 96px 0;
    background: linear-gradient(135deg, var(--dark) 0%, #0a1c24 100%);
}
.dialogues-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.dialogue-card {
    background: rgba(255,255,255,0.07); border-radius: var(--radius); padding: 32px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: transform 0.3s, background 0.3s;
}
.dialogue-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.12); }
.dialogue-icon {
    width: 56px; height: 56px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.dialogue-icon.primary { background: var(--primary); color: #fff; }
.dialogue-icon.secondary { background: var(--secondary); color: #fff; }
.dialogue-icon.accent { background: var(--accent); color: #fff; }
.dialogue-icon.forest { background: var(--forest); color: #fff; }
.dialogue-card h3 { color: #fff; font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.dialogue-card p { color: rgba(255,255,255,0.6); font-size: 0.88rem; line-height: 1.5; }

@media (max-width: 900px) { .dialogues-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .dialogues-grid { grid-template-columns: 1fr; } }

/* === Screenshots === */
.screenshots { padding: 96px 0; background: #e4edf1; }
.screenshots-wrapper {
    display: flex; align-items: center; gap: 16px;
    max-width: 1200px; margin: 0 auto; padding: 0 16px;
}
.screenshots-scroll {
    flex: 1; min-width: 0;
    display: flex; gap: 20px; overflow-x: auto;
    padding: 8px 0 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.screenshots-scroll::-webkit-scrollbar { display: none; }
.screenshot-item { flex-shrink: 0; width: 260px; scroll-snap-align: start; }
.screenshot-item img {
    width: 100%; border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    transition: transform 0.3s ease;
}
.screenshot-item img:hover { transform: scale(1.03); }
.screenshot-caption {
    text-align: center; margin-top: 12px;
    font-size: 0.82rem; font-weight: 500; color: var(--text-muted);
}
.scroll-btn {
    flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%;
    background: #fff; border: 1px solid rgba(0,0,0,0.1);
    color: var(--text-muted); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.scroll-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
@media (max-width: 768px) {
    .scroll-btn { width: 36px; height: 36px; }
    .screenshots-wrapper { gap: 8px; padding: 0 8px; }
}
@media (max-width: 560px) { .screenshot-item { width: 180px; } }

/* === Dialects === */
.dialects { padding: 96px 0; }
.dialects-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    max-width: 720px; margin: 0 auto;
}
.dialect-card {
    background: var(--card); border-radius: var(--radius); padding: 20px 24px;
    text-align: center; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}
.dialect-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.dialect-emoji { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.dialect-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; }
.dialect-card p { font-size: 0.75rem; color: var(--text-muted); }

@media (max-width: 560px) { .dialects-grid { grid-template-columns: repeat(2, 1fr); } }

/* === Our Story === */
.our-story { padding: 96px 0; background: #e4edf1; }

.story-hero {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    border-radius: var(--radius); overflow: hidden;
    background: var(--card); box-shadow: var(--shadow-lg);
    margin-bottom: 64px; border: 1px solid rgba(0,0,0,0.05);
}
.story-hero-photo { position: relative; overflow: hidden; }
.story-hero-photo img {
    width: 100%; height: 100%; object-fit: cover; object-position: center 45%;
    display: block; filter: brightness(1.02) contrast(1.03);
    transition: transform 0.6s ease;
}
.story-hero-photo img:hover { transform: scale(1.04); }
.story-hero-text {
    display: flex; flex-direction: column; justify-content: center; padding: 48px;
}
.story-quote {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem); font-weight: 700; line-height: 1.5;
    color: var(--text); font-style: italic; margin-bottom: 20px;
}
.story-author { font-size: 0.88rem; font-weight: 600; color: var(--primary); }

@media (max-width: 768px) {
    .story-hero { grid-template-columns: 1fr; }
    .story-hero-photo { max-height: 280px; }
    .story-hero-text { padding: 32px; }
}

/* Timeline */
.story-timeline { position: relative; max-width: 800px; margin: 0 auto; padding: 0 20px; }
.timeline-line {
    position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    transform: translateX(-50%); border-radius: 2px;
}
.timeline-item {
    display: flex; align-items: flex-start; gap: 32px;
    margin-bottom: 40px; position: relative;
    padding-right: calc(50% + 32px);
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item .timeline-marker {
    position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--card); border: 3px solid var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; z-index: 2; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.timeline-marker.dual {
    width: auto; height: auto; background: none; border: none; box-shadow: none;
    display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.timeline-marker.dual span {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--card); border: 3px solid var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.timeline-item.right {
    padding-right: 0; padding-left: calc(50% + 32px); flex-direction: row-reverse;
}
.timeline-card {
    background: var(--card); border-radius: var(--radius); padding: 28px;
    box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s; flex: 1;
}
.timeline-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.timeline-label {
    display: inline-block; font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--primary); background: var(--primary-light);
    padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.timeline-card h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.timeline-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }

@media (max-width: 768px) {
    .timeline-line { left: 24px; }
    .timeline-item, .timeline-item.right {
        padding-left: 72px; padding-right: 0; flex-direction: row;
    }
    .timeline-item .timeline-marker { left: 24px; width: 40px; height: 40px; font-size: 1rem; }
}

/* === CTA === */
.cta { padding: 80px 0 96px; }
.cta-card {
    text-align: center; padding: 64px 40px; border-radius: 24px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    color: #fff; display: flex; flex-direction: column; align-items: center;
}
.cta-icon {
    width: 88px; height: 88px; border-radius: 22px;
    margin: 0 auto 24px; box-shadow: 0 8px 28px rgba(0,0,0,0.2);
}
.cta-card h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; margin-bottom: 8px; }
.cta-card p { font-size: 1.05rem; opacity: 0.9; margin-bottom: 32px; }

/* === Footer === */
.footer { padding: 32px 0; border-top: 1px solid rgba(0,0,0,0.06); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.footer-icon { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.footer-copy { font-size: 0.82rem; color: var(--text-muted); }
@media (max-width: 560px) { .footer-inner { flex-direction: column; gap: 12px; text-align: center; } }

/* === Splash Screen === */
.splash {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--dark); display: flex; align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}
.splash.fade-out { opacity: 0; pointer-events: none; }
.splash.hidden { display: none; }
#splashCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.splash-ring { position: absolute; inset: 0; pointer-events: none; }
.ring-img {
    position: absolute; width: 52px; height: 52px;
    opacity: 0; transform: scale(0.3);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ring-img.visible { opacity: 0.2; transform: scale(1); }

.splash-titles {
    position: relative; z-index: 2;
    text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.splash-title {
    font-size: clamp(2.6rem, 7vw, 3.2rem); font-weight: 800;
    background: linear-gradient(90deg, #ffffff, #e4edf1, #ffffff);
    background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0; transform: scale(0.5);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1.2;
}
.splash-title.visible { animation: text-shimmer 2.5s ease-in-out infinite; opacity: 1; transform: scale(1); }
@keyframes text-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.splash-subtitle {
    font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 500;
    color: #e4edf1; text-shadow: 0 0 10px rgba(230,57,70,0.3);
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.splash-subtitle.visible { opacity: 1; transform: translateY(0); }

.splash-label {
    font-size: 0.9rem; font-weight: 500; color: rgba(228,237,241,0.7);
    opacity: 0; transition: opacity 0.6s ease;
}
.splash-label.visible { opacity: 1; }

/* === Animations === */
[data-animate] {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-animate].visible { opacity: 1; transform: translateY(0); }
