/* Reset and Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2D2D2D;
    --primary-light: #4A4A4A;
    --accent: #FF6B6B;
    --accent-hover: #FF5252;
    --background: #FAFAFA;
    --white: #FFFFFF;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --text: #2D2D2D;
    --text-muted: #757575;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--gray-300);
}

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

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s ease;
}

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

.nav-links .btn {
    margin-left: 8px;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    padding-top: 100px;
    overflow: hidden;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px 120px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content h1 {
    margin-bottom: 24px;
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 500px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.hero-badge .flag {
    font-size: 1.2rem;
}

.hero-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* New word highlight in chat */
.new-word {
    background: linear-gradient(120deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: help;
    font-weight: 500;
}

/* Hero Visual */
.hero-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.tomo-character {
    position: absolute;
    bottom: -30px;
    right: -20px;
    z-index: 10;
    animation: float 3s ease-in-out infinite;
}

.tomo-mascot {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.chat-preview {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
}

.chat-bubble {
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.chat-bubble:last-child {
    margin-bottom: 0;
}

.chat-bubble:nth-child(1) { animation-delay: 0.2s; }
.chat-bubble:nth-child(2) { animation-delay: 0.6s; }
.chat-bubble:nth-child(3) { animation-delay: 1s; }

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

.tomo-bubble {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.bubble-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.avatar-icon {
    width: 32px;
    height: 32px;
}

.bubble-content {
    flex: 1;
    min-width: 0;
}

.tomo-bubble .bubble-content {
    background: var(--gray-100);
    padding: 12px 14px;
    border-radius: var(--radius);
    border-top-left-radius: 4px;
}

.user-bubble .bubble-content {
    background: var(--primary);
    padding: 12px 14px;
    border-radius: var(--radius);
    border-top-right-radius: 4px;
}

/* Japanese text with furigana */
.japanese {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
    margin: 0 0 6px 0;
}

.user-bubble .japanese {
    color: var(--white);
}

ruby {
    ruby-position: over;
}

rt {
    font-size: 0.6em;
    color: var(--text-muted);
}

.user-bubble rt {
    color: rgba(255, 255, 255, 0.7);
}

/* Translation text */
.translation {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    font-style: italic;
}

.user-bubble .translation {
    color: rgba(255, 255, 255, 0.7);
}

/* Grammar button and explanation */
.grammar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--gray-300);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s ease;
}

.grammar-btn:hover {
    background: var(--white);
    border-color: var(--primary);
    color: var(--primary);
}

.grammar-btn svg {
    flex-shrink: 0;
}

.grammar-explanation {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
    background: var(--white);
    border-radius: 8px;
    margin-top: 0;
}

.grammar-explanation.expanded {
    max-height: 200px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--gray-200);
}

.grammar-explanation p {
    font-size: 0.8rem;
    color: var(--text);
    margin: 0 0 8px 0;
    line-height: 1.5;
    background: none;
    padding: 0;
}

.grammar-explanation p:last-child {
    margin-bottom: 0;
}

.grammar-explanation strong {
    color: var(--primary);
    font-weight: 600;
}

.user-bubble {
    display: flex;
    justify-content: flex-end;
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.hero-wave svg {
    display: block;
    width: 100%;
}

/* Section Styles */
.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px;
}

.section-header h2 {
    margin-bottom: 16px;
    color: var(--primary);
}

.section-header p {
    font-size: 1.15rem;
    color: var(--text-muted);
}

/* Features Section */
.features {
    padding: 100px 0;
    background: var(--white);
}

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

.feature-card {
    padding: 32px;
    border-radius: var(--radius-lg);
    background: var(--background);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 12px;
    color: var(--primary);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Method Section */
.method {
    padding: 100px 0;
    background: var(--white);
}

/* Zones Visual */
.zones-visual {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.zone {
    padding: 40px 32px;
    text-align: center;
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    position: relative;
}

.zone-content h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.zone-content p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.comfort-zone {
    background: var(--gray-200);
    color: var(--gray-600);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.growth-zone {
    background: linear-gradient(135deg, #48c774 0%, #3ec46d 100%);
    color: white;
    transform: scale(1.05);
    z-index: 2;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
}

.panic-zone {
    background: var(--gray-200);
    color: var(--gray-600);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.zone-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* Method Cards */
.method-explanation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.method-card {
    text-align: center;
    padding: 32px 24px;
}

.method-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.method-card h3 {
    margin-bottom: 12px;
    color: var(--primary);
}

.method-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Who Is It For Section */
.who-is-it-for {
    padding: 100px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
}

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

.audience-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.audience-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.audience-check {
    color: #48c774;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.audience-card p {
    color: var(--text);
    font-size: 0.95rem;
    margin: 0;
}

/* How It Works Section */
.how-it-works {
    padding: 100px 0;
    background: var(--white);
}

.steps {
    max-width: 700px;
    margin: 0 auto;
}

.step {
    display: flex;
    gap: 24px;
    margin-bottom: 48px;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 24px;
    top: 60px;
    width: 2px;
    height: calc(100% - 20px);
    background: var(--gray-300);
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.step-content h3 {
    margin-bottom: 8px;
    color: var(--primary);
}

.step-content p {
    color: var(--text-muted);
}

/* Footer */
.footer {
    background: var(--background);
    padding: 60px 0 30px;
    border-top: 1px solid var(--gray-200);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 250px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
}

.footer-logo .logo-icon {
    width: 32px;
    height: 32px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.footer-column h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-column a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 10px;
    transition: color 0.2s ease;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--gray-200);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-content {
        order: 1;
    }

    .hero-visual {
        order: 2;
    }

    .hero-subtitle {
        margin: 0 auto 32px;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-visual {
        align-items: center;
    }

    .chat-preview {
        margin: 0 auto;
        max-width: 100%;
    }

    .tomo-character {
        position: absolute;
        bottom: -20px;
        right: -10px;
    }

    .tomo-mascot {
        width: 80px;
        height: 80px;
    }

    .features-grid,
    .method-explanation,
    .audience-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .zones-visual {
        flex-direction: column;
        align-items: center;
    }

    .zone {
        max-width: 100%;
        width: 100%;
    }

    .comfort-zone {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .panic-zone {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    .growth-zone {
        transform: scale(1.02);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero-container {
        padding: 40px 24px 100px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn-large {
        width: 100%;
        max-width: 300px;
    }

    .features-grid,
    .method-explanation,
    .audience-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 40px;
    }

    .footer-brand {
        max-width: 100%;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 40px;
        justify-content: center;
    }

    .zone {
        padding: 30px 24px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .tomo-mascot {
        width: 60px;
        height: 60px;
    }

    .tomo-character {
        bottom: -15px;
        right: -5px;
    }

    .chat-preview {
        padding: 14px;
    }

    .japanese {
        font-size: 0.9rem;
    }

    .translation {
        font-size: 0.75rem;
    }

    .avatar-icon {
        width: 26px;
        height: 26px;
    }

    .bubble-avatar {
        width: 26px;
        height: 26px;
    }

    .feature-card {
        padding: 24px;
    }

    .step {
        gap: 16px;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .step:not(:last-child)::after {
        left: 19px;
    }
}
