/* --- CSS Design System --- */
:root {
    --bg-main: hsl(220, 25%, 7%);
    --bg-card: hsla(220, 20%, 12%, 0.7);
    --bg-nav: hsla(220, 25%, 7%, 0.8);
    
    --primary: hsl(250, 85%, 66%);
    --primary-hover: hsl(250, 85%, 72%);
    --primary-glow: rgba(114, 92, 255, 0.4);
    
    --secondary: hsl(220, 15%, 20%);
    --secondary-hover: hsl(220, 15%, 26%);
    
    --text-main: hsl(210, 20%, 98%);
    --text-muted: hsl(210, 12%, 75%);
    --text-dim: hsl(210, 8%, 55%);
    
    --success: hsl(145, 80%, 45%);
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: hsl(38, 90%, 55%);
    --warning-bg: rgba(245, 158, 11, 0.15);
    
    --border-color: hsla(210, 20%, 25%, 0.4);
    --border-glow: hsla(250, 85%, 66%, 0.2);
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Rules --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Typography & Buttons --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-muted);
}

.gradient-text {
    background: linear-gradient(135deg, hsl(270, 90%, 70%) 0%, hsl(210, 95%, 65%) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(114, 92, 255, 0.15);
    border: 1px solid rgba(114, 92, 255, 0.3);
    border-radius: 100px;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* --- Header / Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background-color: var(--bg-nav);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

/* --- Hero Section --- */
.hero {
    padding-top: 140px;
    padding-bottom: 80px;
    position: relative;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    max-width: 600px;
}

.hero-title {
    font-size: 54px;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 18px;
    margin-bottom: 36px;
    color: var(--text-muted);
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

/* --- Phone Mockup --- */
.phone-mockup-wrapper {
    position: relative;
    width: 320px;
    height: 600px;
}

.phone-mockup {
    width: 100%;
    height: 100%;
    background-color: #0d0e12;
    border: 12px solid #282a35;
    border-radius: 44px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(114, 92, 255, 0.15);
    z-index: 2;
    position: relative;
}

.phone-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: hsl(220, 25%, 8%);
    padding: 16px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
}

.app-lang-selector {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--text-muted);
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.lesson-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
}

.card-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 8px;
}

.phrase-chinese {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: 2px;
}

.phrase-jyutping {
    font-size: 14px;
    color: var(--text-dim);
    font-family: monospace;
    margin-bottom: 16px;
}

.audio-wave {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    height: 32px;
    margin-bottom: 16px;
}

.bar {
    width: 4px;
    background-color: var(--primary);
    border-radius: 4px;
    animation: bounce 1.2s ease-in-out infinite alternate;
}

.bar-1 { height: 12px; animation-delay: 0.1s; }
.bar-2 { height: 28px; animation-delay: 0.3s; }
.bar-3 { height: 16px; animation-delay: 0.5s; }
.bar-4 { height: 24px; animation-delay: 0.2s; }
.bar-5 { height: 10px; animation-delay: 0.4s; }

.record-btn-mock {
    width: 100%;
    padding: 12px;
    background-color: rgba(255,255,255,0.05);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.feedback-panel-mock {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    padding: 16px;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.score-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--success);
}

.score-label {
    font-size: 12px;
    color: var(--text-muted);
}

.syllables-feedback {
    display: flex;
    gap: 8px;
}

.syllable {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: monospace;
}

.syllable.correct {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.syllable.warning {
    background-color: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.glow-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--primary-glow) 0%, rgba(0,0,0,0) 70%);
    z-index: 1;
    filter: blur(40px);
}

/* --- Features Section --- */
.features {
    padding: 100px 0;
    background-color: hsl(220, 25%, 5%);
    border-top: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 64px auto;
}

.section-title {
    font-size: 38px;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(114, 92, 255, 0.1);
}

.feature-icon-wrapper {
    font-size: 36px;
    margin-bottom: 24px;
}

.feature-card-title {
    font-size: 20px;
    margin-bottom: 12px;
}

.feature-card-desc {
    font-size: 15px;
    color: var(--text-muted);
}

/* --- Interactive Simulator Section --- */
.simulator-intro {
    padding: 100px 0;
    border-top: 1px solid var(--border-color);
}

.simulator-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
    align-items: center;
}

.simulator-info {
    max-width: 500px;
}

.check-list {
    list-style: none;
    margin-top: 24px;
}

.check-list li {
    font-size: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.simulator-interface-wrapper {
    display: flex;
    justify-content: center;
}

.simulator-chat {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
}

.chat-avatar {
    font-size: 24px;
}

.chat-name {
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 15px;
}

.chat-status {
    font-size: 11px;
    color: var(--success);
    font-weight: 600;
}

.chat-messages {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 240px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.message.incoming {
    align-self: flex-start;
    background-color: var(--secondary);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.message.outgoing {
    align-self: flex-end;
    background-color: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-goals {
    display: flex;
    padding: 16px 20px;
    background-color: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border-color);
    gap: 12px;
    flex-wrap: wrap;
}

.goal-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 100px;
    color: var(--text-muted);
}

.goal-item.completed {
    background: var(--success-bg);
    color: var(--success);
}

/* --- Download CTA --- */
.download-cta {
    padding: 80px 0;
}

.cta-card {
    background: linear-gradient(135deg, hsl(250, 60%, 15%) 0%, hsl(220, 25%, 7%) 100%);
    border: 1px solid var(--primary-glow);
    border-radius: 32px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(114, 92, 255, 0.15);
}

.cta-title {
    font-size: 40px;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.cta-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 32px auto;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* --- Footer --- */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    background-color: hsl(220, 25%, 5%);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    font-size: 14px;
    color: var(--text-dim);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

/* --- Keyframes & Animations --- */
@keyframes bounce {
    0% { transform: scaleY(0.4); }
    100% { transform: scaleY(1.0); }
}

/* --- Responsive Designs --- */
@media (max-width: 992px) {
    .hero-container, .simulator-layout {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    .hero-content, .simulator-info {
        max-width: 100%;
    }
    .hero-buttons, .cta-buttons {
        justify-content: center;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .footer-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
