:root {
    --bg-base: #050505;
    --bg-surface: rgba(20, 20, 22, 0.6);
    --bg-surface-hover: rgba(30, 30, 35, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a5;
    --accent-primary: #7c3aed;
    --accent-secondary: #ec4899;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite alternate;
}

.orb-1 {
    top: -10%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: var(--accent-primary);
}

.orb-2 {
    bottom: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: var(--accent-secondary);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, 50px) scale(1.1); }
}

/* Components */
.glass-container {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
    transform: translateY(-2px);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--text-primary);
}

.btn-outline:hover {
    color: var(--accent-secondary);
}

.btn-large {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 12px 0;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}

.logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}
.logo-text {
    font-weight: 300;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

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

.nav-links a:not(.btn) {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

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

/* Mobile Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    z-index: 101;
}

.menu-toggle .menu-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    margin: 3px 0;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.menu-toggle.open .menu-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.open .menu-bar:nth-child(2) { opacity: 0; }
.menu-toggle.open .menu-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 89;
}

.nav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* Hero Section */
.hero {
    padding: 160px 0 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 60px;
}

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

.hero-title {
    font-size: clamp(3rem, 5vw, 5rem);
    letter-spacing: -1.5px;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.download-options {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.platform-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.platform-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.22);
}

/* Primary (available) download CTA — the Web App */
.platform-btn.primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 24px -8px var(--accent-primary);
}

.platform-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px -10px var(--accent-primary);
}

/* Coming-soon platforms — visible but clearly not yet downloadable */
.platform-btn.soon {
    cursor: default;
    opacity: 0.65;
}

.platform-btn.soon:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-color);
}

.platform-btn .soon-badge {
    margin-left: 2px;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    white-space: nowrap;
}

.p-icon {
    font-size: 1.2rem;
    line-height: 1;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

.hero-visual {
    width: 100%;
    max-width: 1000px;
    perspective: 1000px;
}

.image-wrapper {
    padding: 12px;
    border-radius: 24px;
    transform: rotateX(5deg) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.image-wrapper:hover {
    transform: rotateX(0) scale(1);
}

.image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* Feature Sections */
.feature-section {
    padding: 100px 0;
}
.feature-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}
.feature-container.reverse {
    direction: rtl;
}
.feature-container.reverse > * {
    direction: ltr;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
    background: rgba(255,255,255,0.05);
    padding: 16px;
    border-radius: 16px;
}
.feature-text h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}
.feature-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Animation Boxes */
.animation-box {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 40px;
}

/* 1. Typing Demo */
.typing-demo {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.typing-text {
    font-size: 1.3rem;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    border-right: 2px solid var(--accent-primary);
    animation: typing 6s steps(30) infinite;
    margin-bottom: 30px;
    color: #fff;
}
.flashcard-result {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: 16px;
    padding: 30px;
    width: 80%;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: reveal-card 6s infinite;
}
.fc-front {
    font-size: 1.5rem;
    font-weight: bold;
}
.fc-divider {
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 20px 0;
}
.fc-back {
    color: var(--text-secondary);
}
@keyframes typing {
    0%, 10% { width: 0; }
    30%, 100% { width: 100%; }
}
@keyframes reveal-card {
    0%, 40% { opacity: 0; transform: translateY(20px); }
    50%, 90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

/* 2. Graph Demo */
.graph-demo {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.graph-demo h4 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-secondary);
}
.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    position: relative;
    z-index: 2;
}
.bar-wrapper {
    width: 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}
.bar {
    width: 100%;
    background: var(--accent-gradient);
    border-radius: 8px 8px 0 0;
    height: 0;
    animation: grow-bar 2s forwards ease-out;
}
.bar-label {
    position: absolute;
    bottom: -30px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
@keyframes grow-bar {
    to { height: var(--target); }
}
.curve-svg {
    position: absolute;
    bottom: 50px;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 1;
    opacity: 0.5;
}
.curve-path {
    fill: none;
    stroke: var(--accent-secondary);
    stroke-width: 3;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-curve 3s forwards ease-in-out;
}
@keyframes draw-curve {
    to { stroke-dashoffset: 0; }
}

/* 3. Companion Character Clips */
.video-placeholder {
    background: #08060f;
}
.video-placeholder .companion-clip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Portrait (phone) clips: show the whole frame, never crop top/bottom.
       The dark stage + glow fills the side letterbox area. */
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 5;
}
.video-placeholder .companion-clip.loaded {
    opacity: 1;
}
/* Glow that shows behind the clip (and stands in while it loads) */
.persona-pulse {
    width: 100px;
    height: 100px;
    background: var(--accent-primary);
    border-radius: 50%;
    filter: blur(40px);
    animation: pulse 2s infinite alternate;
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 1; }
}

/* 4. Carousel Box */
.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s ease;
}
.carousel-item.active {
    opacity: 1;
    transform: scale(1);
}
.c-icon-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}
.carousel-item h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}
.carousel-item p {
    color: var(--text-secondary);
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 80px 0 40px;
    background: rgba(0,0,0,0.3);
}

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

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

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 16px;
    font-size: 0.9rem;
}

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

.link-group h4 {
    margin-bottom: 20px;
    font-size: 1rem;
}

.link-group a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 12px;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.link-group a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Animations Utilities */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* Responsive */
@media (max-width: 900px) {
    .feature-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .feature-container.reverse {
        direction: ltr;
    }

    .menu-toggle {
        display: inline-flex;
    }
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(82vw, 320px);
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        padding: 96px 24px 32px;
        background: rgba(10, 10, 12, 0.94);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-left: 1px solid var(--border-color);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 90;
        overflow-y: auto;
    }
    .nav-links.open {
        transform: translateX(0);
    }
    .nav-links a:not(.btn) {
        font-size: 1.05rem;
        padding: 6px 0;
    }
    .nav-links .btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    .nav-links .lang-switch {
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-top: 18px !important;
        margin-top: 6px;
        border-left: none !important;
        border-top: 1px solid var(--border-color);
        width: 100%;
    }
    body.menu-open {
        overflow: hidden;
    }

    .hero {
        padding: 110px 0 40px;
        min-height: auto;
    }
    .hero-container {
        gap: 36px;
    }
    .hero-subtitle {
        font-size: 1.05rem;
    }
    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    .download-options {
        gap: 8px;
    }
    .platform-btn {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .feature-section {
        padding: 60px 0;
    }
    .feature-text h2 {
        font-size: 1.9rem;
    }
    .feature-text p {
        font-size: 1rem;
    }
    .animation-box {
        height: 320px;
        padding: 24px;
    }
    .typing-text {
        font-size: 1rem !important;
    }
    .flashcard-result {
        width: 100%;
        padding: 22px;
    }
    .fc-front {
        font-size: 1.2rem;
    }
    .chart-bars {
        height: 160px;
    }
    .bar-wrapper {
        width: 32px;
    }

    .footer-container {
        flex-direction: column;
        gap: 32px;
    }
    .footer-links {
        gap: 32px;
        flex-wrap: wrap;
    }

    /* Document & Legal Pages */
    .doc-wrap {
        margin: 90px 12px 60px;
        padding: 24px 20px;
    }
    .doc-header h1 {
        font-size: 1.9rem;
    }
    .doc-content h2 {
        font-size: 1.4rem;
        margin: 28px 0 14px;
    }
    .doc-content h3 {
        font-size: 1.15rem;
    }
    .doc-content p,
    .doc-content li {
        font-size: 1rem;
        line-height: 1.7;
    }
    .doc-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .info-box {
        padding: 16px;
    }
    .pricing-card {
        padding: 24px;
    }
    .pricing-card .tier-desc {
        min-height: 0;
    }
}

/* Document & Legal Pages */
.doc-wrap {
    max-width: 800px;
    margin: 120px auto 100px;
    padding: 40px;
}
.doc-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 40px;
}
.doc-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
.doc-header .updated {
    color: var(--text-secondary);
}
.doc-content h2 {
    font-size: 1.8rem;
    margin: 40px 0 20px;
    color: var(--accent-secondary);
}
.doc-content h3 {
    font-size: 1.4rem;
    margin: 24px 0 16px;
    color: var(--text-primary);
}
.doc-content p, .doc-content li {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 16px;
}
.doc-content ul, .doc-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
}
.doc-content a {
    color: var(--accent-primary);
    text-decoration: underline;
}
.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
.doc-content th, .doc-content td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}
.doc-content th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}
.info-box {
    background: rgba(124, 58, 237, 0.1);
    border-left: 4px solid var(--accent-primary);
    padding: 20px;
    border-radius: 0 12px 12px 0;
    margin: 30px 0;
}
.info-box p {
    margin: 0;
    color: var(--text-primary);
}

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 40px;
}
.pricing-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    transition: all 0.3s ease;
}
.pricing-card.featured {
    border-color: var(--accent-primary);
    background: rgba(124, 58, 237, 0.05);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
}
.pricing-card .tier-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.pricing-card .tier-price {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 16px 0;
    color: var(--text-primary);
}
.pricing-card .tier-unit {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}
.pricing-card .tier-desc {
    color: var(--text-secondary);
    min-height: 50px;
    margin-bottom: 24px;
}
.pricing-card ul {
    list-style: none;
    padding: 0;
}
.pricing-card li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
}
.pricing-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-secondary);
    font-weight: bold;
}
