body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.75;
    color: var(--text);
    background:
        radial-gradient(circle at top, var(--page-glow), transparent 42%),
        linear-gradient(180deg, var(--page-bg), var(--page-bg-alt));
}

a {
    color: inherit;
}

a:focus-visible,
summary.lesson-date:focus-visible,
.quiz-card button:focus-visible {
    outline: 3px solid var(--accent-strong);
    outline-offset: 4px;
}

.page-shell {
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px 18px 48px;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--nav-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.top-nav a {
    text-decoration: none;
}

.top-nav a:hover {
    text-decoration: underline;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.page-hero,
.hub-hero {
    padding: 30px;
    border-radius: 26px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 18px 42px var(--shadow);
}

.page-hero {
    background: linear-gradient(135deg, var(--hero-start), var(--hero-end));
}

.hub-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
    background: linear-gradient(
        135deg,
        #fff3a6 0%,
        #fff3a6 33%,
        #93c5fd 33%,
        #93c5fd 66%,
        #9ae6b4 66%,
        #9ae6b4 100%
    );
}

.hub-hero-copy {
    flex: 1 1 560px;
    min-width: 0;
}

.hub-hero-visual {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

.hub-hero-image {
    display: block;
    height: 5cm;
    width: auto;
    filter: drop-shadow(0 18px 26px rgba(15, 23, 42, 0.18));
}

.page-hero h1,
.hub-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.1;
}

.page-hero p,
.hub-hero p {
    max-width: 720px;
    margin: 0;
    font-size: 1.04rem;
}

.index-container {
    background: var(--surface);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px var(--shadow);
}

.index-container > p {
    margin-top: 0;
    color: var(--muted);
}

#lesson-container {
    margin-top: 20px;
}

.empty-state {
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px dashed var(--border);
    background: var(--surface-alt);
    color: var(--muted);
    font-weight: 600;
}

details.daily-lesson {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    margin-bottom: 16px;
    padding: 16px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

details.daily-lesson[open] {
    border-color: var(--accent);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.1);
}

details.daily-lesson:hover {
    transform: translateY(-2px);
}

summary.lesson-date {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--accent-strong);
    cursor: pointer;
    padding: 4px 0;
    list-style: none;
}

.lesson-date-prefix,
.lesson-date-text,
.lesson-separator,
.lesson-title-text {
    display: inline;
}

.lesson-age {
    display: inline;
    font-size: 0.74em;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    vertical-align: middle;
}

summary.lesson-date::-webkit-details-marker {
    display: none;
}

summary.lesson-date:hover {
    color: var(--accent);
}

.lesson-description {
    font-style: italic;
    color: var(--muted);
    margin-top: 8px;
    margin-bottom: 14px;
    font-size: 0.96rem;
}

.lesson-content {
    border-top: 1px dashed var(--border);
    padding-top: 20px;
    margin-top: 10px;
}

.header {
    text-align: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    padding: 20px;
    border-radius: 18px;
}

.header h2 {
    margin: 0;
    color: #ffffff;
    text-transform: none;
    letter-spacing: 0;
}

.section {
    margin-bottom: 28px;
    border-left: 5px solid var(--accent);
    padding-left: 18px;
}

.section h2 {
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1.12rem;
    margin-bottom: 10px;
}

.vocab-box {
    background: var(--surface-alt);
    border-left: 4px solid var(--accent-strong);
    padding: 18px;
    margin: 18px 0;
    border-radius: 0 14px 14px 0;
}

.vocab-term {
    font-weight: 800;
    color: var(--accent-strong);
}

.quiz-card {
    background: var(--quiz-card);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 18px;
}

.quiz-card button:hover {
    transform: translateY(-1px);
}

.feedback {
    font-weight: 700;
}

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

.hub-card {
    display: block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.94);
    color: #183153;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hub-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 36px rgba(15, 23, 42, 0.16);
}

.hub-card h2 {
    margin: 14px 0 10px;
    font-size: 1.7rem;
}

.hub-card p {
    margin: 0;
    color: #355070;
}

.hub-pill {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hub-card.beginner-card {
    border-top: 6px solid #d4a900;
}

.hub-card.beginner-card .hub-pill {
    background: #fff3b3;
    color: #8c6a00;
}

.hub-card.intermediate-card {
    border-top: 6px solid #2563eb;
}

.hub-card.intermediate-card .hub-pill {
    background: #dbeafe;
    color: #1d4ed8;
}

.hub-card.advanced-card {
    border-top: 6px solid #2f855a;
}

.hub-card.advanced-card .hub-pill {
    background: #dcfce7;
    color: #166534;
}

.hub-resource {
    margin-top: 24px;
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(233, 244, 255, 0.92));
    border: 1px solid rgba(147, 197, 253, 0.55);
    box-shadow: 0 18px 32px rgba(30, 58, 138, 0.12);
}

.hub-resource h2 {
    margin: 0 0 10px;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    color: #183153;
}

.hub-resource p {
    margin: 0;
    max-width: 720px;
    color: #355070;
}

.hub-resource-link {
    display: inline-block;
    margin-top: 18px;
    padding: 12px 20px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #2563eb, #2f855a);
    color: #ffffff;
    box-shadow: 0 14px 24px rgba(37, 99, 235, 0.24);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hub-resource-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 28px rgba(37, 99, 235, 0.3);
}

.theme-hub {
    --page-bg: #fffdf8;
    --page-bg-alt: #eef4ff;
    --page-glow: rgba(37, 99, 235, 0.15);
    --surface: rgba(255, 255, 255, 0.7);
    --surface-alt: rgba(239, 246, 255, 0.9);
    --text: #183153;
    --muted: #3b5b86;
    --accent: #c62828;
    --accent-strong: #1e3a8a;
    --border: rgba(147, 197, 253, 0.55);
    --shadow: rgba(30, 58, 138, 0.15);
    --nav-bg: rgba(255, 255, 255, 0.72);
    --hero-start: #fee2e2;
    --hero-end: #dbeafe;
    --quiz-card: #ffffff;
    --button-border: #cbd5e1;
    --quiz-question: #1e3a8a;
}

.theme-beginner {
    --page-bg: #fff7bf;
    --page-bg-alt: #fffdf0;
    --page-glow: rgba(234, 179, 8, 0.2);
    --surface: rgba(255, 252, 235, 0.94);
    --surface-alt: #fff5c8;
    --text: #4f3b00;
    --muted: #7a5c00;
    --accent: #f4b400;
    --accent-strong: #b7791f;
    --border: #efd673;
    --shadow: rgba(168, 112, 0, 0.16);
    --nav-bg: rgba(255, 250, 214, 0.86);
    --hero-start: #fff3a6;
    --hero-end: #ffe082;
    --quiz-card: #fff8db;
    --button-border: #d8b84a;
    --quiz-question: #8a6400;
}

.theme-intermediate {
    --page-bg: #dfefff;
    --page-bg-alt: #f4f8ff;
    --page-glow: rgba(37, 99, 235, 0.16);
    --surface: rgba(248, 251, 255, 0.96);
    --surface-alt: #e7f0ff;
    --text: #183153;
    --muted: #365a8c;
    --accent: #3b82f6;
    --accent-strong: #1d4ed8;
    --border: #b7d0ff;
    --shadow: rgba(37, 99, 235, 0.14);
    --nav-bg: rgba(240, 247, 255, 0.86);
    --hero-start: #cfe2ff;
    --hero-end: #93c5fd;
    --quiz-card: #eef5ff;
    --button-border: #8eb2f4;
    --quiz-question: #1d4ed8;
}

.theme-advanced {
    --page-bg: #dff6e8;
    --page-bg-alt: #f5fff8;
    --page-glow: rgba(34, 197, 94, 0.16);
    --surface: rgba(248, 255, 250, 0.96);
    --surface-alt: #e2f7e8;
    --text: #163a23;
    --muted: #2f5d3d;
    --accent: #38a169;
    --accent-strong: #1f7a4a;
    --border: #b7e2c6;
    --shadow: rgba(34, 139, 84, 0.13);
    --nav-bg: rgba(241, 255, 245, 0.86);
    --hero-start: #ccefd8;
    --hero-end: #9ae6b4;
    --quiz-card: #edf9f1;
    --button-border: #8fcea8;
    --quiz-question: #1f7a4a;
}

@media (max-width: 800px) {
    .hub-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .hub-hero-visual {
        align-self: center;
    }

    .hub-hero-image {
        height: 5cm;
    }

    .hub-grid {
        grid-template-columns: 1fr;
    }

    .top-nav {
        flex-direction: column;
        align-items: flex-start;
    }
}
