:root {
    --app-ink: #1f2a26;
    --app-flame: #fc3c2a;
    --app-flame-deep: #7f211a;
    --app-clay: #b94a35;
    --app-marigold: #e8b64f;
    --app-parchment: #f8f1e7;
    --app-paper: #fffaf1;
    --app-mist: #dfd2c1;
    --app-muted: #68746f;
    --app-shadow: 0 22px 58px rgba(45, 35, 26, 0.13);
}

html {
    background: var(--app-parchment);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(252, 60, 42, 0.18), transparent 28rem),
        radial-gradient(circle at 80% 12%, rgba(232, 182, 79, 0.18), transparent 24rem),
        linear-gradient(135deg, #fff9ec 0%, var(--app-parchment) 48%, #fff1ec 100%);
    color: var(--app-ink);
    font-family: "Aptos", "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.app-appbar {
    border-bottom: 1px solid rgba(255, 248, 236, 0.2);
    background: linear-gradient(110deg, var(--app-flame-deep), var(--app-flame)) !important;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff8ec;
    text-decoration: none;
}

.app-brand:hover {
    color: #fff8ec;
    text-decoration: none;
}

.app-brand-mark {
    display: inline-grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 1px solid rgba(255, 248, 236, 0.35);
    border-radius: 999px;
    background: rgba(255, 248, 236, 0.14);
    font-family: Georgia, serif;
    font-weight: 800;
}

.app-brand strong,
.app-brand small {
    display: block;
    line-height: 1.05;
}

.app-brand small {
    color: rgba(255, 248, 236, 0.76);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-auth-button,
.app-action-row .mud-button-root,
.app-dashboard-actions .mud-button-root,
.app-section-navigation .mud-button-root {
    border-radius: 999px !important;
    font-weight: 800 !important;
    text-transform: none !important;
}

.app-drawer {
    border-right: 1px solid rgba(252, 60, 42, 0.14);
    background: linear-gradient(180deg, rgba(255, 250, 241, 0.98), rgba(239, 228, 213, 0.92)) !important;
}

.app-drawer .mud-drawer-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 100%;
    padding: 1.25rem 1rem;
}

.app-drawer-intro,
.app-drawer-note {
    border-radius: 1.35rem;
    padding: 1rem;
    background: rgba(252, 60, 42, 0.08);
}

.app-drawer-intro h2 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 1.25rem;
    line-height: 1.15;
}

.app-nav .mud-nav-link {
    border-radius: 1rem;
    margin-bottom: 0.3rem;
}

.app-nav .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: rgba(252, 60, 42, 0.12);
    color: var(--app-flame-deep);
    font-weight: 800;
}

.app-drawer-note {
    margin-top: auto;
    border: 1px solid rgba(252, 60, 42, 0.18);
    background: rgba(255, 250, 241, 0.74);
}

.app-drawer-note span,
.app-eyebrow,
.app-card-kicker,
.app-priority-card span {
    color: var(--app-clay);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.app-drawer-note strong {
    display: block;
    margin-top: 0.25rem;
}

.app-drawer-note p {
    margin: 0.35rem 0 0;
    color: var(--app-muted);
    font-size: 0.88rem;
}

.app-main {
    min-height: 100vh;
    padding-top: 4.25rem;
}

.app-page-shell {
    width: 100%;
    padding: clamp(1.25rem, 3vw, 3rem);
}

.app-hero,
.app-course-preview {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 0.85fr);
    gap: clamp(1.25rem, 4vw, 3.5rem);
    align-items: stretch;
}

.app-hero {
    margin-bottom: clamp(1.5rem, 4vw, 3.5rem);
}

.app-card,
.app-hero-copy,
.app-hero-card,
.app-priority-card,
.app-course-preview,
.app-dashboard-card,
.app-not-found {
    border: 1px solid rgba(252, 60, 42, 0.13);
    border-radius: 1.6rem !important;
    box-shadow: var(--app-shadow);
    animation: app-rise 420ms ease both;
}

.app-hero-copy,
.app-course-preview,
.app-dashboard-card,
.app-priority-card,
.app-not-found {
    background: rgba(255, 250, 241, 0.84) !important;
}

.app-hero-copy {
    padding: clamp(1.5rem, 5vw, 4rem);
}

.app-hero-card {
    padding: clamp(1.25rem, 4vw, 2rem);
    background: linear-gradient(160deg, var(--app-flame), var(--app-flame-deep)) !important;
    color: #fff8ec;
    animation-delay: 80ms;
}

.app-priority-card,
.app-dashboard-card {
    height: 100%;
    padding: 1.35rem;
}

.app-hero h1,
.app-page-header h1,
.app-not-found h1 {
    max-width: 12ch;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 8vw, 6.5rem);
    line-height: 0.9;
    letter-spacing: -0.07em;
}

.app-hero-card h2,
.app-course-preview h2,
.app-priority-card h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1;
    letter-spacing: -0.045em;
}

.app-hero-card h2,
.app-course-preview h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.app-priority-card h2 {
    margin: 0.4rem 0;
    font-size: 1.55rem;
}

.app-lede,
.app-page-header p,
.app-course-preview p,
.app-priority-card p {
    color: var(--app-muted);
    line-height: 1.55;
}

.app-lede,
.app-page-header p,
.app-course-preview p {
    max-width: 46rem;
    font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.app-chip-row,
.app-action-row,
.app-dashboard-actions,
.app-dashboard-header,
.app-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.app-chip-row {
    margin-bottom: 2rem;
}

.app-action-row {
    margin-top: 2rem;
}

.app-progress-list,
.app-course-flow {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.app-progress-list article,
.app-course-flow article {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 1.2rem;
    background: rgba(255, 248, 236, 0.1);
}

.app-course-flow {
    margin-top: 0;
}

.app-course-flow article {
    background: rgba(252, 60, 42, 0.07);
}

.app-progress-list span {
    display: inline-grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border-radius: 999px;
    background: var(--app-marigold);
    color: var(--app-ink);
    font-weight: 900;
}

.app-course-flow span {
    display: inline-grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border-radius: 999px;
    background: var(--app-flame);
    color: #fff8ec;
    font-weight: 900;
}

.app-priority-card .mud-icon-root {
    color: var(--app-flame);
}

.app-logo-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1.2rem;
}

.app-logo-strip img {
    width: 100%;
    height: 12rem;
    border-radius: 1.1rem;
    object-fit: contain;
    padding: 0.8rem;
    background: rgba(255, 250, 241, 0.94);
}

.app-hero-photo {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.app-hero-photo img {
    width: 100%;
    max-height: 17rem;
    border-radius: 1.25rem;
    object-fit: cover;
}

.app-hero-photo p {
    color: rgba(255, 248, 236, 0.82);
    line-height: 1.55;
}

.app-course-preview {
    margin-top: clamp(1.5rem, 5vw, 4rem);
    padding: clamp(1.5rem, 4vw, 3rem);
    background: linear-gradient(135deg, rgba(245, 199, 189, 0.58), rgba(255, 250, 241, 0.74)) !important;
    box-shadow: none;
}

.app-dashboard-header,
.app-status-row {
    justify-content: space-between;
}

.app-dashboard-header span,
.app-status-row span {
    color: var(--app-muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.app-dashboard-header strong {
    display: block;
    margin-top: 0.25rem;
    font-family: Georgia, serif;
    font-size: 1.45rem;
}

.app-progress,
.app-alert,
.app-stat-grid,
.app-course-grid {
    margin-top: 1.25rem;
}

.app-course-card {
    height: 100%;
    border: 1px solid rgba(252, 60, 42, 0.13);
    border-radius: 1.6rem !important;
    background: rgba(255, 250, 241, 0.86) !important;
    box-shadow: var(--app-shadow);
}

.app-bio-card {
    height: 100%;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid rgba(252, 60, 42, 0.13);
    border-radius: 1.6rem !important;
    background: rgba(255, 250, 241, 0.86) !important;
    box-shadow: var(--app-shadow);
}

.app-bio-copy {
    color: var(--app-muted);
    line-height: 1.6;
}

.app-bio-photo {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.app-bio-photo-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-bio-photo img {
    width: 100%;
    height: clamp(17rem, 32vw, 24rem);
    border-radius: 1.25rem;
    object-fit: cover;
}

.app-bio-next-step {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.app-course-meta {
    color: var(--app-muted);
}

.app-course-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0 1rem 1rem !important;
}

.app-player-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.app-player-header h1 {
    max-width: 14ch;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 0.92;
    letter-spacing: -0.06em;
}

.app-player-header p {
    max-width: 44rem;
    color: var(--app-muted);
    font-size: 1.1rem;
    line-height: 1.55;
}

.app-player-shell {
    display: grid;
    grid-template-columns: minmax(16rem, 0.35fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.app-section-rail,
.app-player-panel,
.app-question-card {
    border: 1px solid rgba(252, 60, 42, 0.13);
    border-radius: 1.6rem !important;
    background: rgba(255, 250, 241, 0.86) !important;
    box-shadow: var(--app-shadow);
}

.app-section-rail {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 7rem);
    min-height: 0;
    overflow: hidden;
    position: sticky;
    top: 5.5rem;
    padding: 1rem;
}

.app-section-list {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0.75rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
    scrollbar-color: rgba(252, 60, 42, 0.62) rgba(252, 60, 42, 0.08);
}

.app-section-item {
    border-radius: 1rem !important;
}

.app-section-item.selected {
    background: rgba(252, 60, 42, 0.12);
    color: var(--app-flame-deep);
    font-weight: 800;
}

.app-player-panel,
.app-question-card {
    padding: clamp(1rem, 3vw, 1.5rem);
}

.app-section-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.app-section-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0 1.25rem;
}

.app-section-navigation-bottom {
    margin: 1.5rem 0 0;
}

.app-sample-quiz,
.app-answer-list,
.app-lesson-copy,
.app-picture-grid {
    margin-top: 1.25rem;
}

.app-answer-list p,
.app-lesson-copy p {
    color: var(--app-muted);
    line-height: 1.6;
}

.app-correct-answer {
    color: var(--app-ink) !important;
    font-weight: 900;
}

.app-picture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1rem;
}

.app-picture-grid img,
.app-video {
    width: 100%;
    border-radius: 1.25rem;
}

.app-video {
    max-height: 34rem;
    margin-top: 1.25rem;
    background: #1f2a26;
}

.app-audio {
    width: 100%;
    margin-top: 0.75rem;
}

.app-page-header {
    max-width: 70rem;
    margin-bottom: 2rem;
}

.app-not-found {
    max-width: 48rem;
    margin: 4rem auto;
    padding: clamp(1.5rem, 5vw, 3rem);
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 10000;
    max-width: 32rem;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    background: #a94438;
    color: #fff8ec;
    box-shadow: var(--app-shadow);
}

@keyframes app-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 960px) {
    .app-hero,
    .app-course-preview,
    .app-player-shell {
        grid-template-columns: 1fr;
    }

    .app-section-rail {
        max-height: min(26rem, 70vh);
        position: static;
    }

    .app-player-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .app-page-shell {
        padding: 1rem;
    }

    .app-brand small,
    .app-auth-button {
        display: none;
    }

    .app-hero h1,
    .app-page-header h1,
    .app-not-found h1 {
        font-size: clamp(2.7rem, 17vw, 4.1rem);
    }

    .app-dashboard-header,
    .app-status-row,
    .app-section-navigation {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-logo-strip {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
