:root {
    --color-bg: #f6f7fb;
    --color-surface: #ffffff;
    --color-text: #1d2433;
    --color-muted: #6b7385;
    --color-primary: #2f5bea;
    --color-again: #d64545;
    --color-hard: #d98b1e;
    --color-good: #2f9e5b;
    --color-easy: #2f5bea;
    --radius: 12px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--color-primary); }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--color-surface);
    border-bottom: 1px solid #e3e6ef;
}
.topbar nav { display: flex; gap: 1.25rem; }
.brand { font-weight: 700; font-size: 1.25rem; text-decoration: none; }

.container { max-width: 720px; margin: 2rem auto; padding: 0 1rem; }
.muted { color: var(--color-muted); }

.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.flash-success { background: #e3f6ea; }
.flash-info { background: #e6edff; }
.flash-error { background: #fde8e8; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0; }
.stat { background: var(--color-surface); border-radius: var(--radius); padding: 1.25rem; text-align: center; }
.stat-value { display: block; font-size: 2rem; font-weight: 700; }
.stat-label { color: var(--color-muted); font-size: .9rem; }

.actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.button {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.2rem;
    border: 1px solid #cfd5e3;
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.button-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
kbd { font-size: .75rem; opacity: .7; border: 1px solid currentColor; border-radius: 4px; padding: 0 .3rem; }

.flashcard { background: var(--color-surface); border-radius: var(--radius); padding: 2rem; text-align: center; }
.term { font-size: 2.5rem; margin: 1rem 0 .5rem; }
.example { color: var(--color-muted); font-style: italic; }
.translation { font-size: 1.6rem; font-weight: 600; margin: 1.5rem 0; }

.badge { display: inline-block; font-size: .75rem; padding: .15rem .5rem; border-radius: 999px; background: var(--color-primary); color: #fff; }
.badge-light { background: #e6edff; color: var(--color-primary); }
.badge-new { background: var(--color-good); }

.ratings { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.rating { justify-content: center; color: #fff; border: none; }
.rating-again { background: var(--color-again); }
.rating-hard { background: var(--color-hard); }
.rating-good { background: var(--color-good); }
.rating-easy { background: var(--color-easy); }

.empty-state { text-align: center; }

.login { display: flex; flex-direction: column; gap: .5rem; max-width: 360px; margin: 0 auto; }
.login input { padding: .6rem; border: 1px solid #cfd5e3; border-radius: 8px; font: inherit; }
.login button { margin-top: 1rem; justify-content: center; }

/* Demo banner */
.demo-banner { background: #fff4d6; color: #6b4e00; text-align: center; padding: .5rem 1rem; font-size: .9rem; }

/* Landing page */
.hero { text-align: center; padding: 2rem 0 1rem; }
.hero h1 { font-size: 2.4rem; line-height: 1.2; margin: .5rem 0 1rem; }
.eyebrow { color: var(--color-primary); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; margin: 0; }
.lead { font-size: 1.15rem; color: var(--color-muted); max-width: 560px; margin: 0 auto 1.5rem; line-height: 1.6; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: .75rem; }
.button-large { padding: .9rem 1.8rem; font-size: 1.1rem; }
.small { font-size: .9rem; }

.section { background: var(--color-surface); border-radius: var(--radius); padding: 1.5rem 2rem; margin-top: 1.5rem; }
.section h2 { margin-top: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: .35rem; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--color-primary); color: #fff; font-weight: 700; }
.steps span { color: var(--color-muted); }

.features { padding-left: 1.2rem; line-height: 1.7; }

.tech { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.tech li { background: #e6edff; color: var(--color-primary); border-radius: 999px; padding: .3rem .8rem; font-size: .9rem; }

.site-footer { text-align: center; color: var(--color-muted); margin: 2rem 0; }

@media (max-width: 540px) {
    .hero h1 { font-size: 1.8rem; }
    .steps { grid-template-columns: 1fr; }
    .stats, .ratings { grid-template-columns: 1fr 1fr; }
}
