:root {
    --bg: #060b0a;
    --panel: rgba(18, 27, 25, 0.78);
    --soft-panel: rgba(255, 255, 255, 0.05);
    --text: #ecf6f2;
    --muted: #a9b8b2;
    --green: #00a76f;
    --green-2: #00d38b;
    --red: #d93f4f;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Inter", Arial, sans-serif;
    background: radial-gradient(circle at top right, #10201b 0%, #060b0a 35%, #060606 100%);
    color: var(--text);
    min-height: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1120px, 92%);
    margin: 0 auto;
}

.bg-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(60px);
    opacity: 0.25;
    z-index: -1;
}

.orb-1 {
    width: 260px;
    height: 260px;
    background: var(--green-2);
    top: -90px;
    right: -80px;
}

.orb-2 {
    width: 280px;
    height: 280px;
    background: var(--red);
    bottom: -120px;
    left: -90px;
}

.glass {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.top-nav {
    margin-top: 22px;
    padding: 14px 20px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-weight: 800;
    letter-spacing: 0.3px;
}

.top-nav nav {
    display: flex;
    gap: 18px;
    align-items: center;
}

.nav-cta {
    padding: 8px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--green), var(--green-2));
    color: #03170f;
    font-weight: 700;
}

.hero {
    text-align: center;
    padding: 80px 0 30px;
}

.badge {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 211, 139, 0.12);
    border: 1px solid rgba(0, 211, 139, 0.35);
    color: #86ffcb;
    font-size: 0.86rem;
    margin-bottom: 18px;
}

h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    margin: 0;
}

h2 {
    font-size: clamp(1.35rem, 2.7vw, 2.2rem);
    margin: 0 0 12px;
}

.hero p {
    color: var(--muted);
    max-width: 720px;
    margin: 18px auto;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green), var(--green-2));
    color: #012515;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e9fffb;
}

.compact {
    padding: 8px 12px;
}

.hero-metrics {
    margin-top: 38px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.hero-metrics div {
    padding: 14px;
    border-radius: 14px;
    background: var(--soft-panel);
}

.hero-metrics strong {
    display: block;
    font-size: 1.3rem;
}

.hero-metrics span {
    color: var(--muted);
    font-size: 0.9rem;
}

.features, .demo, .testimonials {
    padding: 52px 0 10px;
}

.feature-grid, .testimonial-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.card {
    background: var(--soft-panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 211, 139, 0.4);
}

.card p, .card cite {
    color: var(--muted);
    line-height: 1.6;
}

.demo-mockup {
    border-radius: 20px;
    padding: 18px;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 16px;
}

.demo-mockup aside {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 16px;
}

.demo-mockup ul {
    padding-left: 16px;
    color: var(--muted);
}

.mockup-main {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 14px;
    padding: 16px;
}

.mockup-bubble {
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
}

.mockup-bubble.user {
    background: rgba(0, 167, 111, 0.2);
}

.mockup-bubble.ai {
    background: rgba(217, 63, 79, 0.15);
}

.mockup-tip {
    color: #9feecf;
    font-size: 0.92rem;
}

.site-footer {
    padding: 48px 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.footer-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.copyright {
    grid-column: 1 / -1;
    color: var(--muted);
}

.app-shell {
    margin-top: 20px;
    min-height: calc(100vh - 40px);
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
}

.sidebar {
    border-radius: 18px;
    padding: 18px;
}

.side-nav {
    margin-top: 24px;
    display: grid;
    gap: 8px;
}

.side-nav a {
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--muted);
}

.side-nav a.active, .side-nav a:hover {
    background: rgba(0, 211, 139, 0.15);
    color: #d3ffef;
}

.app-content {
    display: grid;
    align-content: start;
    gap: 16px;
    padding-bottom: 24px;
}

.app-topbar {
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), #085c43);
    color: #d4ffee;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.translator-card textarea {
    width: 100%;
    min-height: 180px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text);
    padding: 12px;
    resize: vertical;
}

.translator-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.translator-header select, .swap-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    border-radius: 10px;
    padding: 10px;
}

.translator-header select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.translator-header select option {
    background: #0e1715;
    color: #ecf6f2;
}

.translator-header select:focus {
    outline: 2px solid rgba(0, 211, 139, 0.45);
    outline-offset: 1px;
}

.swap-btn {
    cursor: pointer;
}

.translator-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.pulse {
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 211, 139, 0.45); }
    60% { box-shadow: 0 0 0 14px rgba(0, 211, 139, 0); }
}

.loading {
    margin-top: 10px;
    color: #adf9d8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-top-color: var(--green-2);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.chat-shell {
    display: grid;
    gap: 12px;
    min-height: 68vh;
}

.chat-messages {
    max-height: 58vh;
    overflow-y: auto;
    display: grid;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 12px 14px;
    border-radius: 14px;
    line-height: 1.5;
}

.message.user {
    justify-self: end;
    background: rgba(0, 167, 111, 0.25);
}

.message.ai {
    justify-self: start;
    background: rgba(255, 255, 255, 0.06);
}

.chat-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.chat-input-row input {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
}

.typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 4px;
    background: #9decc8;
    border-radius: 50%;
    animation: blink 1s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes blink {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.guides-intro p {
    color: var(--muted);
    margin: 8px 0 0;
    line-height: 1.7;
}

.guides-toolbar {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.guides-toolbar input {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(0, 0, 0, 0.22));
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.guides-toolbar input:focus {
    outline: none;
    border-color: rgba(0, 211, 139, 0.6);
    box-shadow: 0 0 0 4px rgba(0, 211, 139, 0.16);
}

.guides-feedback {
    font-size: 0.9rem;
    color: #a8f5d2;
    min-height: 20px;
}

.guide-card h3 {
    margin-bottom: 8px;
}

.guide-card > p {
    color: var(--muted);
    margin-top: 0;
}

.guide-section h4 {
    margin: 14px 0 8px;
    font-size: 0.95rem;
    color: #c8f6e2;
}

.guide-section ul,
.guides-cheatsheet ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: var(--muted);
}

.guide-section li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.guide-section li strong {
    color: #ebfff6;
}

.phrase-actions {
    display: inline-flex;
    gap: 6px;
}

.phrase-btn {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
    color: #d9fff0;
    border-radius: 8px;
    padding: 5px 9px;
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.phrase-btn:hover {
    border-color: rgba(0, 211, 139, 0.45);
    transform: translateY(-1px);
}

.favorite-btn {
    background: linear-gradient(135deg, rgba(217, 63, 79, 0.15), rgba(217, 63, 79, 0.06));
    border-color: rgba(217, 63, 79, 0.35);
}

.favorite-btn.is-saved {
    background: linear-gradient(135deg, rgba(0, 211, 139, 0.24), rgba(0, 167, 111, 0.14));
    border-color: rgba(0, 211, 139, 0.6);
    color: #c8ffe8;
}

.guide-tip {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 211, 139, 0.11);
    border: 1px solid rgba(0, 211, 139, 0.24);
    color: #a8f5d2;
    font-size: 0.92rem;
}

.guides-cheatsheet {
    margin-top: 14px;
}

.guides-favorites {
    margin-top: 14px;
    background: linear-gradient(135deg, rgba(0, 167, 111, 0.1), rgba(217, 63, 79, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.guides-favorites p {
    color: var(--muted);
    margin-top: 6px;
}

#favoritePhrases {
    margin: 10px 0 0;
    padding-left: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.favorite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
}

.favorite-text {
    color: #dffef2;
    font-size: 0.9rem;
    line-height: 1.5;
}

.favorite-remove {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.25);
    color: #ffd2d8;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorite-remove:hover {
    border-color: rgba(217, 63, 79, 0.55);
    background: rgba(217, 63, 79, 0.15);
}

.cheatsheet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.cheatsheet-grid h4 {
    margin: 0 0 10px;
    color: #d9fff0;
}

.kids-page .card {
    border-color: rgba(255, 215, 0, 0.25);
}

.flashcard {
    margin-top: 12px;
    padding: 28px;
    text-align: center;
    font-size: clamp(1.3rem, 3vw, 2rem);
    background: linear-gradient(135deg, rgba(255, 212, 77, 0.3), rgba(255, 122, 69, 0.2));
    border-radius: 18px;
    transition: transform 0.25s ease;
}

.flashcard.flip {
    transform: rotateY(90deg);
}

.kids-note {
    color: var(--muted);
}

@media (max-width: 980px) {
    .feature-grid, .testimonial-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .demo-mockup {
        grid-template-columns: 1fr;
    }
    .app-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: sticky;
        top: 12px;
        z-index: 2;
    }
}

@media (max-width: 640px) {
    .top-nav {
        flex-direction: column;
        gap: 10px;
    }
    .top-nav nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero-metrics {
        grid-template-columns: 1fr;
    }
    .feature-grid, .testimonial-grid, .guide-grid, .dashboard-grid, .translator-panels {
        grid-template-columns: 1fr;
    }
    .cheatsheet-grid {
        grid-template-columns: 1fr;
    }
    .site-footer {
        grid-template-columns: 1fr;
    }
}
