:root,
[data-theme="light"] {
    --font-arabic: "Tajawal", sans-serif;
    --font-latin: "General Sans", sans-serif;

    --text-xs: clamp(0.75rem, 0.72rem + 0.16vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.82rem + 0.25vw, 1rem);
    --text-base: clamp(1rem, 0.94rem + 0.32vw, 1.125rem);
    --text-lg: clamp(1.35rem, 1.1rem + 1vw, 1.9rem);
    --text-xl: clamp(2.35rem, 1.7rem + 3vw, 4.1rem);

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    --radius-sm: 0.875rem;
    --radius-md: 1.25rem;
    --radius-lg: 1.6rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;

    --bg: #f8f9fc;
    --surface: #ffffff;
    --surface-2: #f4f6fb;
    --text: #22242b;
    --muted: #70747f;
    --border: #e7eaf2;
    --ink: #30343e;
    --focus: #579dd7;

    --green: #59d681;
    --green-tint: #edf9f1;
    --orange: #f5a43d;
    --orange-tint: #fff6e9;
    --red: #fb5d66;
    --red-tint: #fff1f3;
    --blue: #4da7f8;
    --blue-tint: #eef7ff;
    --cyan: #43cad2;
    --cyan-tint: #edfbfc;
    --purple: #8875ed;
    --purple-tint: #f3f1ff;
    --pink: #ed6c9b;
    --pink-tint: #fff0f5;

    --shadow: 0 1rem 2.6rem rgba(52, 68, 94, 0.08);
    --soft-shadow: 0 0.4rem 1.2rem rgba(52, 68, 94, 0.05);
    --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --bg: #1d222c;
    --surface: #262d39;
    --surface-2: #202733;
    --text: #f4f6fa;
    --muted: #a9b2c2;
    --border: #3b4657;
    --ink: #e8eef8;
    --shadow: 0 1rem 2.6rem rgba(0, 0, 0, 0.22);
    --soft-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.16);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-arabic);
}

.container {
    width: min(100% - var(--space-8), 72rem);
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(1rem);
}

.nav {
    min-height: 4.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--ink);
    font-family: var(--font-latin);
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.06em;
}

.brand-mark {
    width: 2rem;
    color: var(--blue);
}

.brand small {
    color: var(--red);
    font-size: 0.74em;
}

.nav-links {
    display: flex;
    gap: var(--space-6);
    color: var(--muted);
    font-size: var(--text-sm);
    font-weight: 700;
}

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

.theme-toggle {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--blue);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    transform: translateY(-0.125rem);
    box-shadow: var(--soft-shadow);
}

.hero {
    padding-block: clamp(var(--space-16), 8vw, var(--space-32));
    overflow: hidden;
}

.hero-layout,
.tools-layout,
.progress-layout {
    display: grid;
    align-items: center;
    gap: clamp(var(--space-10), 6vw, var(--space-24));
}

.hero-copy {
    max-width: 35rem;
}

.eyebrow {
    margin-bottom: var(--space-4);
    color: var(--muted);
    font-family: var(--font-latin);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.24;
}

h1 {
    font-size: var(--text-xl);
}

h1 span {
    color: var(--red);
}

.hero-copy > p:not(.eyebrow) {
    margin-top: var(--space-6);
    color: var(--muted);
    font-size: var(--text-base);
    line-height: 1.9;
}

.hero-link {
    min-height: 2.85rem;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-8);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    background: var(--blue);
    color: white;
    font-size: var(--text-sm);
    font-weight: 800;
    box-shadow: 0 0.6rem 1.4rem rgba(77, 167, 248, 0.25);
}

.hero-link:hover {
    transform: translateY(-0.15rem);
    background: #348ee3;
}

.hero-copy > small {
    display: block;
    margin-top: var(--space-4);
    color: var(--muted);
    font-size: var(--text-xs);
}

.dashboard-preview {
    width: min(100%, 23rem);
    justify-self: center;
    padding: var(--space-5);
    border: 0.35rem solid #252a33;
    border-radius: 2.55rem;
    background: var(--surface-2);
    box-shadow: var(--shadow);
}

.preview-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    direction: ltr;
    font-family: var(--font-latin);
    font-size: 0.66rem;
}

.preview-island {
    width: 4.8rem;
    height: 1rem;
    border-radius: var(--radius-full);
    background: #252a33;
}

.preview-heading {
    display: grid;
    place-items: center;
    margin-top: var(--space-5);
    text-align: center;
}

.preview-heading strong {
    font-size: 0.93rem;
}

.preview-heading small {
    color: var(--muted);
    font-family: var(--font-latin);
    font-size: 0.58rem;
}

.preview-paths {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.preview-path {
    min-height: 6.5rem;
    display: grid;
    place-content: center;
    gap: var(--space-1);
    padding: var(--space-2);
    border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    border-radius: var(--radius-md);
    text-align: center;
}

.path-symbol {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    justify-self: center;
    border-radius: var(--radius-full);
    background: currentColor;
    color: white;
    font-size: 1rem;
}

.preview-path strong {
    font-size: 0.68rem;
}

.preview-path small,
.preview-path em {
    font-size: 0.5rem;
    font-style: normal;
}

.preview-path em {
    opacity: 0.7;
}

.beginner {
    background: var(--green-tint);
    color: #41b96b;
}

.intermediate {
    background: var(--orange-tint);
    color: #e89327;
}

.advanced {
    background: var(--red-tint);
    color: #e9505b;
}

.tools-heading {
    margin-top: var(--space-5);
}

.preview-tools {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.preview-tools span {
    min-height: 2.8rem;
    display: grid;
    place-items: center;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.61rem;
    font-weight: 800;
}

.dictionary { background: var(--blue-tint); }
.grammar { background: var(--pink-tint); }
.verbs { background: var(--purple-tint); }
.synonyms { background: var(--cyan-tint); }

.preview-journey {
    margin-top: var(--space-5);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.journey-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
}

.journey-title div {
    display: grid;
}

.journey-title strong,
.journey-title b {
    font-size: 0.65rem;
}

.journey-title small {
    color: var(--muted);
    font-family: var(--font-latin);
    font-size: 0.48rem;
}

.mini-progress {
    display: grid;
    grid-template-columns: 2.9rem 1fr;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    color: var(--muted);
    font-size: 0.5rem;
}

.mini-progress i,
.large-progress-row i {
    display: block;
    height: 0.34rem;
    overflow: hidden;
    border-radius: var(--radius-full);
    background: var(--border);
}

.mini-progress b {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.green-progress { width: 55%; background: var(--green); }
.orange-progress { width: 35%; background: var(--orange); }
.red-progress { width: 10%; background: var(--red); }

.paths-section,
.tools-section,
.progress-section {
    padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.paths-section {
    background: var(--surface);
}

.section-title {
    max-width: 39rem;
}

h2 {
    font-size: clamp(1.85rem, 1.35rem + 2.2vw, 3.15rem);
}

.section-title > p:not(.eyebrow),
.tools-copy > p:not(.eyebrow),
.progress-layout > div > p:not(.eyebrow) {
    margin-top: var(--space-5);
    color: var(--muted);
}

.path-feature-grid {
    display: grid;
    gap: var(--space-4);
    margin-top: var(--space-12);
}

.feature-card {
    position: relative;
    min-height: 15rem;
    padding: var(--space-6);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--soft-shadow);
}

.feature-number {
    position: absolute;
    top: var(--space-5);
    left: var(--space-5);
    color: var(--muted);
    font-family: var(--font-latin);
    font-size: var(--text-sm);
    font-weight: 700;
}

.feature-icon {
    width: 3.25rem;
    height: 3.25rem;
    display: grid;
    place-items: center;
    border-radius: var(--radius-full);
    color: white;
    font-size: 1.45rem;
}

.feature-card h3 {
    margin-top: var(--space-6);
    font-size: var(--text-lg);
}

.feature-card p {
    margin-top: var(--space-3);
    color: var(--muted);
    font-size: var(--text-sm);
    line-height: 1.8;
}

.beginner-card { background: var(--green-tint); }
.beginner-card .feature-icon { background: var(--green); }

.intermediate-card { background: var(--orange-tint); }
.intermediate-card .feature-icon { background: var(--orange); }

.advanced-card { background: var(--red-tint); }
.advanced-card .feature-icon { background: var(--red); }

.tools-section {
    background: var(--bg);
}

.tools-copy {
    max-width: 33rem;
}

.tool-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.tool-card {
    min-height: 12.5rem;
    padding: var(--space-5);
    border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
    border-radius: var(--radius-lg);
}

.tool-card > span {
    width: 2.8rem;
    height: 2.8rem;
    display: grid;
    place-items: center;
    border-radius: var(--radius-full);
    color: white;
    font-size: 1.15rem;
}

.tool-card h3 {
    margin-top: var(--space-5);
    font-size: var(--text-base);
}

.tool-card p {
    margin-top: var(--space-2);
    color: var(--muted);
    font-size: var(--text-xs);
    line-height: 1.7;
}

.dictionary-card { background: var(--blue-tint); }
.dictionary-card > span { background: var(--blue); }

.grammar-card { background: var(--pink-tint); }
.grammar-card > span { background: var(--pink); }

.verbs-card { background: var(--purple-tint); }
.verbs-card > span { background: var(--purple); }

.synonyms-card { background: var(--cyan-tint); }
.synonyms-card > span { background: var(--cyan); }

.progress-section {
    background: var(--surface);
}

.progress-layout > div {
    max-width: 32rem;
}

.large-progress-card {
    padding: clamp(var(--space-5), 5vw, var(--space-8));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface-2);
    box-shadow: var(--soft-shadow);
}

.large-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--border);
}

.large-progress-header div {
    display: grid;
    gap: var(--space-1);
}

.large-progress-header strong {
    font-size: var(--text-lg);
}

.large-progress-header small {
    color: var(--muted);
    font-family: var(--font-latin);
    font-size: var(--text-xs);
}

.large-progress-header > span {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    background: var(--blue-tint);
    color: var(--blue);
    font-size: var(--text-xs);
    font-weight: 800;
}

.large-progress-row {
    display: grid;
    grid-template-columns: 5.5rem 3rem 1fr;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
    font-size: var(--text-sm);
}

.row-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
}

.dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: var(--radius-full);
}

.green-dot { background: var(--green); }
.orange-dot { background: var(--orange); }
.red-dot { background: var(--red); }

.large-progress-row > strong {
    color: var(--muted);
    direction: ltr;
    font-family: var(--font-latin);
    font-size: var(--text-xs);
    font-weight: 600;
}

.large-progress-row em {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.fill-green { width: 58%; background: var(--green); }
.fill-orange { width: 35%; background: var(--orange); }
.fill-red { width: 8%; background: var(--red); }

.site-footer {
    padding-block: var(--space-8);
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    color: var(--muted);
    font-size: var(--text-xs);
}

.footer-brand {
    font-size: var(--text-base);
}

.footer-brand .brand-mark {
    width: 1.8rem;
}

.domain-link {
    color: var(--blue);
    font-family: var(--font-latin);
    font-weight: 700;
}

@media (min-width: 48rem) {
    .hero-layout,
    .tools-layout,
    .progress-layout {
        grid-template-columns: 1fr 1fr;
    }

    .path-feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

    .dashboard-preview {
        width: min(100%, 20rem);
    }

    .footer-content {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}


/* App icon brand alignment */
.brand {
    direction: ltr;
}

.brand-app-icon {
    width: 2.45rem;
    height: 2.45rem;
    flex: 0 0 auto;
    border-radius: 0.78rem;
    object-fit: cover;
    box-shadow: 0 0.35rem 0.85rem rgba(77, 167, 248, 0.22);
}

.footer-brand .brand-app-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.64rem;
}


/* HnEng wordmark: header and footer */
.brand {
    direction: ltr;
}

.brand-wordmark {
    display: block;
    width: clamp(8.2rem, 14vw, 10.5rem);
    height: auto;
    object-fit: contain;
}

.footer-brand .brand-wordmark {
    width: 7.4rem;
}

/* يحافظ على وضوح الشعار عند تفعيل الوضع الداكن. */
@media (prefers-color-scheme: dark) {
    .brand-wordmark {
        background: #f8f9fc;
        border-radius: 0.9rem;
        padding: 0.18rem 0.34rem;
    }
}


/* HnEng interactive lessons */
.path-card,
.learning-path-card,
.track-card,
[data-learning-path] {
    cursor: pointer;
}

.path-card:focus-visible,
.learning-path-card:focus-visible,
.track-card:focus-visible,
[data-learning-path]:focus-visible {
    outline: 0.22rem solid #4da7f8;
    outline-offset: 0.28rem;
}

.lesson-page {
    min-height: 100vh;
    color: #2b2b35;
    background:
        radial-gradient(circle at 88% 6%, rgba(77, 167, 248, 0.14), transparent 25rem),
        radial-gradient(circle at 12% 90%, rgba(242, 100, 120, 0.12), transparent 24rem),
        #f8f9fc;
}

.lesson-shell {
    width: min(70rem, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.2rem 0 3rem;
}

.lesson-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0 1.6rem;
}

.lesson-logo {
    width: 9rem;
    height: auto;
    object-fit: contain;
}

.lesson-back {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 1rem;
    border: 1px solid rgba(43, 43, 53, 0.12);
    border-radius: 0.85rem;
    color: #2b2b35;
    background: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.lesson-back:hover {
    background: #eef7ff;
}

.lesson-hero,
.lesson-card {
    border: 1px solid rgba(43, 43, 53, 0.08);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 0.8rem 2rem rgba(43, 43, 53, 0.08);
}

.lesson-hero {
    padding: clamp(1.5rem, 5vw, 3rem);
    margin-bottom: 1.35rem;
}

.lesson-kicker {
    display: inline-block;
    margin: 0 0 0.7rem;
    color: #e6576e;
    font-weight: 800;
}

.lesson-hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.lesson-hero p {
    max-width: 42rem;
    margin: 0.85rem 0 0;
    color: #626575;
    line-height: 1.8;
}

.lesson-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.lesson-card {
    display: flex;
    flex-direction: column;
    padding: 1.35rem;
    color: inherit;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.lesson-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 1.1rem 2.2rem rgba(43, 43, 53, 0.13);
}

.lesson-number {
    display: grid;
    width: 2.3rem;
    height: 2.3rem;
    place-items: center;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    color: #ffffff;
    background: #4da7f8;
    font-weight: 800;
}

.lesson-card h2 {
    margin: 0;
    font-size: 1.15rem;
}

.lesson-card p {
    margin: 0.65rem 0 1rem;
    color: #626575;
    line-height: 1.7;
}

.lesson-open {
    margin-top: auto;
    color: #e6576e;
    font-weight: 800;
}

.lesson-content {
    padding: clamp(1.4rem, 4vw, 2.4rem);
}

.lesson-content h1 {
    margin-top: 0;
}

.vocabulary-list {
    display: grid;
    gap: 0.75rem;
    margin: 1.2rem 0 1.7rem;
}

.vocabulary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.95rem;
    background: #f4f7fc;
}

.vocabulary-item strong {
    color: #e6576e;
}

.quiz-box {
    margin-top: 1.8rem;
    padding: 1.25rem;
    border-radius: 1rem;
    background: #fff5f7;
}

.quiz-options {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.quiz-options button {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(43, 43, 53, 0.1);
    border-radius: 0.8rem;
    color: #2b2b35;
    background: #ffffff;
    text-align: right;
    cursor: pointer;
    font: inherit;
}

.quiz-options button:hover {
    border-color: #4da7f8;
    background: #eef7ff;
}

.quiz-result {
    min-height: 1.5rem;
    margin: 1rem 0 0;
    font-weight: 800;
}

@media (max-width: 44rem) {
    .lesson-grid {
        grid-template-columns: 1fr;
    }

    .lesson-topbar {
        align-items: flex-start;
        flex-direction: column-reverse;
    }
}

@media (prefers-color-scheme: dark) {
    .lesson-page {
        color: #eef2fa;
        background: #151722;
    }

    .lesson-hero,
    .lesson-card {
        border-color: rgba(255, 255, 255, 0.09);
        background: #202330;
        box-shadow: none;
    }

    .lesson-hero p,
    .lesson-card p {
        color: #c1c7d5;
    }

    .lesson-back,
    .quiz-options button {
        border-color: rgba(255, 255, 255, 0.12);
        color: #eef2fa;
        background: #292d3d;
    }

    .vocabulary-item {
        background: #292d3d;
    }

    .quiz-box {
        background: #322631;
    }

    .lesson-logo {
        border-radius: 0.8rem;
        background: #f8f9fc;
        padding: 0.15rem 0.3rem;
    }
}


/* HnEng phone lesson cards clickable */
.phone *,
.phone-mockup *,
.phone-frame *,
.app-preview *,
.app-mockup *,
.device-preview *,
.device-frame *,
.dashboard-phone * {
    pointer-events: auto !important;
}

.phone .path-card,
.phone-mockup .path-card,
.app-preview .path-card,
.app-mockup .path-card,
.device-preview .path-card {
    cursor: pointer !important;
}


/* HnEng real curriculum web module */
.hneng-course-page {
    min-height: 100vh;
    color: #292b35;
    background:
        radial-gradient(circle at 92% 3%, rgba(77, 167, 248, 0.13), transparent 23rem),
        radial-gradient(circle at 6% 94%, rgba(242, 100, 120, 0.1), transparent 25rem),
        #f8f9fc;
}

.hneng-shell {
    width: min(74rem, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.15rem 0 4rem;
}

.hneng-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.7rem;
}

.hneng-wordmark-link {
    display: inline-flex;
    align-items: center;
}

.hneng-wordmark {
    display: block;
    width: clamp(8rem, 14vw, 10.4rem);
    height: auto;
    object-fit: contain;
}

.hneng-back,
.hneng-level-tab,
.hneng-real-lesson-card,
.hneng-lesson-navigation a {
    text-decoration: none;
}

.hneng-back {
    display: inline-flex;
    align-items: center;
    min-height: 2.7rem;
    padding: 0 1rem;
    border: 1px solid rgba(41, 43, 53, 0.12);
    border-radius: 0.85rem;
    color: #292b35;
    background: #ffffff;
    font-weight: 800;
}

.hneng-back:hover {
    border-color: #4da7f8;
    background: #eef7ff;
}

.hneng-course-hero,
.hneng-lesson-hero,
.hneng-course-summary,
.hneng-content-panel,
.hneng-quiz-panel {
    border: 1px solid rgba(41, 43, 53, 0.08);
    border-radius: 1.45rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 0.8rem 2.2rem rgba(31, 42, 65, 0.07);
}

.hneng-course-hero,
.hneng-lesson-hero {
    padding: clamp(1.5rem, 4vw, 2.8rem);
}

.hneng-eyebrow {
    margin: 0 0 0.55rem;
    color: #e35b70;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.hneng-course-hero h1,
.hneng-lesson-hero h1 {
    margin: 0;
    font-size: clamp(1.85rem, 4vw, 3rem);
    line-height: 1.25;
}

.hneng-course-hero > p:last-child,
.hneng-lesson-hero > p:last-child {
    max-width: 43rem;
    margin: 0.8rem 0 0;
    color: #626575;
    line-height: 1.9;
}

.hneng-level-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.15rem 0;
}

.hneng-level-tab {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.9rem 1rem;
    border: 1px solid transparent;
    border-radius: 1rem;
    color: #545867;
    background: #ffffff;
    transition: transform 180ms ease, border-color 180ms ease;
}

.hneng-level-tab:hover {
    transform: translateY(-0.15rem);
    border-color: var(--tab-color);
}

.hneng-level-tab.is-active {
    border-color: var(--tab-color);
    background: var(--tab-soft);
    color: #292b35;
}

.hneng-level-tab span {
    font-weight: 900;
}

.hneng-level-tab small {
    color: #767b8d;
}

.hneng-course-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.15rem;
}

.hneng-summary-copy h2,
.hneng-section-heading h2,
.hneng-quiz-panel h2 {
    margin: 0;
}

.hneng-summary-copy > p:last-child {
    margin: 0.55rem 0 0;
    color: #626575;
}

.hneng-progress-box {
    width: min(13rem, 100%);
    flex: 0 0 auto;
}

.hneng-progress-box strong,
.hneng-progress-box span {
    display: block;
}

.hneng-progress-box strong {
    font-size: 1.15rem;
}

.hneng-progress-box span {
    margin-top: 0.18rem;
    color: #707588;
    font-size: 0.82rem;
}

.hneng-progress-track {
    height: 0.42rem;
    overflow: hidden;
    margin-top: 0.6rem;
    border-radius: 99px;
    background: #e5e8ef;
}

.hneng-progress-track span {
    height: 100%;
    margin: 0;
    border-radius: inherit;
}

.hneng-lesson-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.hneng-real-lesson-card {
    display: flex;
    flex-direction: column;
    min-height: 13.5rem;
    padding: 1.2rem;
    border: 1px solid rgba(41, 43, 53, 0.08);
    border-radius: 1.2rem;
    color: #292b35;
    background: #ffffff;
    box-shadow: 0 0.5rem 1.5rem rgba(31, 42, 65, 0.06);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.hneng-real-lesson-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 1rem 2rem rgba(31, 42, 65, 0.12);
}

.hneng-real-lesson-card.is-complete {
    border-color: var(--lesson-color);
    background: var(--lesson-soft);
}

.hneng-lesson-number {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    margin-bottom: 1rem;
    border-radius: 0.72rem;
    color: #ffffff;
    background: var(--lesson-color);
    font-weight: 900;
}

.hneng-real-lesson-main h3 {
    margin: 0;
    font-size: 1.1rem;
}

.hneng-lesson-en {
    margin: 0.35rem 0;
    color: var(--lesson-color);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: right;
}

.hneng-real-lesson-main > p:last-child {
    margin: 0.7rem 0 0;
    color: #656a7a;
    line-height: 1.7;
}

.hneng-card-meta {
    margin-top: auto;
    padding-top: 1rem;
    color: #777d8f;
    font-size: 0.78rem;
    font-weight: 700;
}

.hneng-lesson-title-en {
    margin: 0.4rem 0 0;
    color: #e35b70;
    font-weight: 900;
    text-align: right;
}

.hneng-content-panel,
.hneng-quiz-panel {
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-top: 1.15rem;
}

.hneng-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.hneng-count {
    padding: 0.4rem 0.7rem;
    border-radius: 99px;
    color: #5f6576;
    background: #f1f3f8;
    font-size: 0.8rem;
    font-weight: 800;
}

.hneng-vocabulary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.hneng-word-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 4.7rem;
    padding: 0.75rem;
    border: 1px solid #e9ecf3;
    border-radius: 0.9rem;
    background: #fbfcfe;
}

.hneng-word-emoji {
    display: grid;
    width: 2.45rem;
    height: 2.45rem;
    place-items: center;
    border-radius: 0.72rem;
    background: #f0f7ff;
    font-size: 1.35rem;
}

.hneng-word-card strong,
.hneng-word-card span {
    display: block;
}

.hneng-word-card strong {
    color: #353845;
    font-size: 0.92rem;
}

.hneng-word-card div > span {
    margin-top: 0.18rem;
    color: #707689;
    font-size: 0.82rem;
}

.hneng-examples-list {
    display: grid;
    gap: 0.75rem;
}

.hneng-example-card {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 0.95rem;
    background: #f8f9fc;
}

.hneng-example-card > span {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: #7b72e9;
    font-size: 0.75rem;
    font-weight: 900;
}

.hneng-example-card strong {
    color: #363946;
}

.hneng-example-card p {
    margin: 0.35rem 0 0;
    color: #6d7284;
    line-height: 1.7;
}

.hneng-quiz-panel {
    background: linear-gradient(135deg, #fff6f8, #f3f4ff);
}

.hneng-quiz-panel > p:not(.hneng-eyebrow) {
    color: #626575;
    line-height: 1.8;
}

.hneng-quiz-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 1rem;
}

.hneng-quiz-options button,
.hneng-complete-button {
    border: 1px solid rgba(41, 43, 53, 0.12);
    border-radius: 0.8rem;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.hneng-quiz-options button {
    padding: 0.82rem 0.9rem;
    color: #393c48;
    background: #ffffff;
}

.hneng-quiz-options button:hover {
    border-color: #4da7f8;
    background: #eef7ff;
}

.hneng-quiz-result {
    min-height: 1.5rem;
    margin: 1rem 0 0;
    font-weight: 900;
}

.hneng-quiz-result.is-correct {
    color: #218b5b;
}

.hneng-quiz-result.is-wrong {
    color: #d15468;
}

.hneng-complete-button {
    margin-top: 1.25rem;
    padding: 0.82rem 1rem;
    color: #ffffff;
    background: #e35b70;
}

.hneng-complete-button.is-complete {
    background: #218b5b;
}

.hneng-lesson-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.2rem;
}

.hneng-lesson-navigation a {
    max-width: 48%;
    color: #4e57a9;
    font-weight: 900;
}

@media (max-width: 52rem) {
    .hneng-level-tabs,
    .hneng-vocabulary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hneng-lesson-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 34rem) {
    .hneng-shell {
        width: min(100% - 1rem, 74rem);
    }

    .hneng-topbar,
    .hneng-course-summary {
        align-items: flex-start;
        flex-direction: column-reverse;
    }

    .hneng-level-tabs,
    .hneng-lesson-grid,
    .hneng-vocabulary-grid,
    .hneng-quiz-options {
        grid-template-columns: 1fr;
    }

    .hneng-course-summary {
        gap: 1rem;
    }

    .hneng-progress-box {
        width: 100%;
    }
}

@media (prefers-color-scheme: dark) {
    .hneng-course-page {
        color: #f0f2f8;
        background: #151722;
    }

    .hneng-wordmark {
        padding: 0.15rem 0.3rem;
        border-radius: 0.75rem;
        background: #f8f9fc;
    }

    .hneng-back,
    .hneng-course-hero,
    .hneng-lesson-hero,
    .hneng-course-summary,
    .hneng-content-panel,
    .hneng-real-lesson-card {
        border-color: rgba(255, 255, 255, 0.09);
        color: #f0f2f8;
        background: #202330;
        box-shadow: none;
    }

    .hneng-back:hover,
    .hneng-quiz-options button:hover {
        background: #283448;
    }

    .hneng-level-tab {
        color: #ccd2df;
        background: #202330;
    }

    .hneng-level-tab.is-active {
        color: #ffffff;
    }

    .hneng-course-hero > p:last-child,
    .hneng-lesson-hero > p:last-child,
    .hneng-summary-copy > p:last-child,
    .hneng-real-lesson-main > p:last-child,
    .hneng-example-card p,
    .hneng-word-card div > span {
        color: #b9c0cf;
    }

    .hneng-word-card,
    .hneng-example-card,
    .hneng-quiz-options button {
        border-color: rgba(255, 255, 255, 0.08);
        color: #f0f2f8;
        background: #292d3d;
    }

    .hneng-word-card strong,
    .hneng-example-card strong {
        color: #ffffff;
    }

    .hneng-word-emoji,
    .hneng-count,
    .hneng-progress-track {
        background: #34394a;
    }

    .hneng-quiz-panel {
        border-color: rgba(255, 255, 255, 0.09);
        background: #292331;
        box-shadow: none;
    }
}


/* HnEng learning tools */
.hn-tool-page {
  min-height: 100vh;
  margin: 0;
  color: #24315a;
  background:
    radial-gradient(circle at 10% 0%, rgba(244, 167, 191, .19), transparent 32rem),
    radial-gradient(circle at 90% 12%, rgba(143, 194, 236, .18), transparent 30rem),
    #f9fbff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
}

.hn-tool-header,
.hn-tool-footer,
.hn-tool-shell {
  box-sizing: border-box;
}

.hn-tool-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.hn-tool-brand,
.hn-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #26365f;
  font-weight: 800;
  font-size: 1.14rem;
  text-decoration: none;
  direction: ltr;
}

.hn-tool-brand img,
.hn-footer-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
}

.hn-tool-nav {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hn-tool-nav a {
  padding: 9px 13px;
  border-radius: 11px;
  text-decoration: none;
  color: #59698d;
  font-weight: 700;
  font-size: .91rem;
}

.hn-tool-nav a:hover,
.hn-tool-nav a.is-active {
  color: #2f4f86;
  background: rgba(255,255,255,.85);
}

.hn-tool-shell {
  width: min(100% - 32px, 1040px);
  margin: 8px auto 44px;
}

.hn-back-link {
  display: inline-block;
  margin: 2px 0 25px;
  color: #5970a5;
  text-decoration: none;
  font-weight: 700;
  font-size: .94rem;
}

.hn-tool-intro {
  max-width: 650px;
  margin-bottom: 26px;
}

.hn-eyebrow {
  margin: 0 0 8px;
  color: #b85a7f;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  direction: ltr;
  text-align: right;
}

.hn-tool-intro h1 {
  margin: 0;
  color: #26365f;
  font-size: clamp(1.85rem, 4vw, 2.8rem);
  line-height: 1.18;
}

.hn-tool-intro > p:last-child {
  margin: 11px 0 0;
  color: #667594;
  line-height: 1.8;
  font-size: 1rem;
}

.hn-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.hn-tool-card {
  position: relative;
  min-height: 135px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 19px;
  color: #25345e;
  text-decoration: none;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(117, 147, 195, .18);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(65, 92, 142, .08);
  transition: transform .18s ease, box-shadow .18s ease;
}

.hn-tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 17px 34px rgba(65, 92, 142, .14);
}

.hn-tool-card-icon {
  flex: 0 0 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #edf4ff;
  font-size: 1.55rem;
}

.hn-tool-card-content {
  display: grid;
  gap: 3px;
  padding-left: 25px;
}

.hn-tool-card strong {
  font-size: 1.07rem;
}

.hn-tool-card small {
  color: #8290ad;
  direction: ltr;
  text-align: right;
}

.hn-tool-card em {
  margin-top: 4px;
  color: #677795;
  font-size: .88rem;
  line-height: 1.55;
  font-style: normal;
}

.hn-tool-card b {
  margin-top: 5px;
  color: #b7597f;
  font-size: .78rem;
}

.hn-card-arrow {
  position: absolute;
  left: 18px;
  color: #b5c0d4;
  font-size: 1.35rem;
}

.hn-toolbar {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
  padding: 15px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(117, 147, 195, .16);
  border-radius: 19px;
}

.hn-toolbar-stack {
  grid-template-columns: 1fr;
}

.hn-search-label,
.hn-select-label {
  display: grid;
  gap: 7px;
  color: #536484;
  font-size: .84rem;
  font-weight: 700;
}

.hn-search-label input,
.hn-select-label select {
  box-sizing: border-box;
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  color: #25345e;
  background: #fbfdff;
  border: 1px solid #dbe4f4;
  border-radius: 12px;
  outline: none;
  font: inherit;
}

.hn-search-label input:focus,
.hn-select-label select:focus {
  border-color: #8db7e6;
  box-shadow: 0 0 0 3px rgba(141,183,230,.18);
}

.hn-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hn-filter,
.hn-more-button,
.hn-speak,
.hn-learn-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: transform .15s ease, background .15s ease;
}

.hn-filter {
  padding: 9px 14px;
  color: #687895;
  background: #f0f5fc;
  border-radius: 11px;
  font-weight: 700;
}

.hn-filter.is-selected,
.hn-filter:hover {
  color: #fff;
  background: #678cc8;
}

.hn-result-count {
  margin: 16px 2px 12px;
  color: #7c8aa5;
  font-size: .9rem;
  font-weight: 700;
}

.hn-dictionary-list,
.hn-verb-list,
.hn-relation-list {
  display: grid;
  gap: 12px;
}

.hn-dictionary-card,
.hn-verb-card,
.hn-relation-card,
.hn-letter-card,
.hn-alphabet-progress {
  box-sizing: border-box;
  background: rgba(255,255,255,.91);
  border: 1px solid rgba(117,147,195,.16);
  box-shadow: 0 10px 25px rgba(65,92,142,.06);
}

.hn-dictionary-card,
.hn-verb-card,
.hn-relation-card {
  padding: 17px;
  border-radius: 18px;
}

.hn-word-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.hn-word-row h2 {
  direction: ltr;
  text-align: right;
  margin: 0;
  color: #2d477c;
  font-size: 1.22rem;
}

.hn-word-row p {
  margin: 5px 0 0;
  color: #687895;
  font-weight: 700;
}

.hn-speak {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: #5475ad;
  background: #eef5ff;
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 800;
}

.hn-speak:hover,
.hn-learn-button:hover,
.hn-more-button:hover {
  transform: translateY(-1px);
}

.hn-tags {
  display: flex;
  gap: 7px;
  margin-top: 13px;
  direction: ltr;
}

.hn-tags span {
  padding: 4px 8px;
  color: #6d7e9e;
  background: #f1f5fa;
  border-radius: 7px;
  font-size: .74rem;
  font-weight: 700;
}

.hn-definition {
  margin: 12px 0 0;
  color: #556583;
  line-height: 1.65;
  direction: ltr;
  text-align: right;
}

.hn-verb-forms,
.hn-relation-pair {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 8px;
  margin-top: 15px;
  direction: ltr;
}

.hn-relation-pair {
  grid-template-columns: repeat(2, minmax(0,1fr));
}

.hn-verb-forms > div,
.hn-relation-pair > div {
  padding: 10px;
  background: #f5f8fd;
  border-radius: 11px;
  text-align: center;
}

.hn-verb-forms small,
.hn-relation-pair small {
  display: block;
  color: #8491aa;
  margin-bottom: 5px;
}

.hn-verb-forms b,
.hn-relation-pair b {
  color: #3b578b;
  font-size: .88rem;
  overflow-wrap: anywhere;
}

.hn-example {
  margin: 14px 0 0;
  color: #61718d;
  line-height: 1.65;
  direction: ltr;
  text-align: right;
}

.hn-example span {
  color: #b65b80;
  font-weight: 800;
}

.hn-more-button {
  display: block;
  margin: 20px auto 0;
  padding: 11px 22px;
  color: #fff;
  background: #698dcc;
  border-radius: 12px;
  font-weight: 800;
}

.hn-empty {
  padding: 25px;
  color: #7786a1;
  text-align: center;
  background: rgba(255,255,255,.75);
  border-radius: 15px;
}

.hn-alphabet-progress {
  margin-bottom: 18px;
  padding: 17px;
  border-radius: 17px;
}

.hn-alphabet-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  color: #52658a;
  font-weight: 800;
}

.hn-progress-track {
  height: 9px;
  margin-top: 12px;
  overflow: hidden;
  background: #edf2f9;
  border-radius: 20px;
}

.hn-progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ef97b4, #7faee5);
  border-radius: inherit;
  transition: width .2s ease;
}

.hn-alphabet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 13px;
}

.hn-letter-card {
  padding: 16px;
  border-radius: 18px;
  text-align: center;
}

.hn-letter-card.is-learned {
  border-color: #a7d4bc;
  background: #f4fcf7;
}

.hn-letter-emoji {
  font-size: 1.65rem;
}

.hn-letter-card h2 {
  margin: 5px 0 0;
  color: #315389;
  direction: ltr;
  font-size: 1.65rem;
}

.hn-pronunciation {
  margin: 3px 0 10px;
  color: #bd6789;
  font-weight: 800;
}

.hn-letter-example {
  display: grid;
  gap: 4px;
  color: #5d6c88;
}

.hn-letter-example b {
  color: #405a8d;
  direction: ltr;
}

.hn-letter-actions {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 13px;
}

.hn-learn-button {
  padding: 8px 10px;
  color: #4a8768;
  background: #eaf8ef;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 800;
}

.hn-tool-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 25px 24px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: #8490a8;
  border-top: 1px solid rgba(117,147,195,.13);
  font-size: .82rem;
}

.hn-tool-footer > a {
  color: #6283ba;
  direction: ltr;
  text-decoration: none;
  font-weight: 800;
}

.hn-tool-footer p {
  margin: 0;
}

@media (max-width: 680px) {
  .hn-tool-header {
    padding: 15px 16px;
  }

  .hn-tool-nav a {
    padding: 8px 8px;
    font-size: .8rem;
  }

  .hn-tool-shell {
    width: min(100% - 24px, 1040px);
    margin-top: 5px;
  }

  .hn-tools-grid,
  .hn-alphabet-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .hn-tool-card {
    min-height: 152px;
    padding: 15px;
    align-items: flex-start;
  }

  .hn-tool-card-icon {
    flex-basis: 39px;
    width: 39px;
    height: 39px;
    border-radius: 13px;
    font-size: 1.2rem;
  }

  .hn-tool-card-content {
    padding-left: 0;
  }

  .hn-card-arrow {
    display: none;
  }

  .hn-toolbar {
    grid-template-columns: 1fr;
  }

  .hn-verb-forms {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .hn-tool-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 16px 28px;
  }
}
