:root {
    --font: "Avenir Next", "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --mono: "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
    --serif: "Iowan Old Style", Baskerville, Georgia, "Times New Roman", serif;
    --canvas: #f2f1e9;
    --surface: rgba(255, 255, 250, .42);
    --surface-solid: #fbfbf4;
    --surface-2: rgba(255, 255, 250, .64);
    --surface-3: rgba(18, 21, 16, .065);
    --ink: #121510;
    --text: #2d3028;
    --muted: #62675e;
    --faint: #858b80;
    --line: rgba(18, 21, 16, .14);
    --line-strong: rgba(18, 21, 16, .26);
    --accent: #315fc4;
    --accent-hover: #284fa6;
    --accent-soft: rgba(49, 95, 196, .12);
    --success: #317153;
    --success-soft: rgba(49, 113, 83, .13);
    --danger: #a94438;
    --danger-soft: rgba(169, 68, 56, .11);
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 18px 46px rgba(18, 21, 16, .075);
    --shadow-small: 0 10px 24px rgba(18, 21, 16, .055);
    --page-width: 1320px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    background:
        linear-gradient(rgba(18, 21, 16, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 21, 16, .035) 1px, transparent 1px),
        var(--canvas);
    background-size: 64px 64px;
    color: var(--text);
    font-family: var(--font);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .08;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button,
a,
input,
textarea {
    outline: none;
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 34%, transparent);
    outline-offset: 3px;
}

.grid {
    display: grid;
    gap: 16px;
}

.shell,
.course-shell,
.editorial-shell {
    min-height: 100dvh;
}

.content,
.course-shell {
    background: transparent;
}

.card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .56);
    backdrop-filter: blur(12px) saturate(112%);
    -webkit-backdrop-filter: blur(12px) saturate(112%);
}

.button,
.editorial-button,
.editorial-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 250, .35);
    color: var(--ink);
    font-size: 13px;
    font-weight: 760;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.button:hover,
.editorial-button:hover,
.editorial-cta:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--ink) 45%, var(--line));
    background: rgba(255, 255, 250, .58);
    box-shadow: var(--shadow-small);
}

.button:active,
.editorial-button:active,
.editorial-cta:active {
    transform: translateY(0) scale(.98);
}

.button.primary,
.button.completed,
.editorial-button-dark,
.status-card .button {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--canvas);
}

.button.danger {
    border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
    color: var(--danger);
}

.progress,
.week-bar,
.editorial-progress,
.next-panel-bar {
    position: relative;
    overflow: hidden;
    height: 6px;
    border-radius: 999px;
    background: rgba(18, 21, 16, .14);
}

.progress {
    margin: 18px 0 12px;
}

.progress > i,
.week-bar i,
.editorial-progress i,
.next-panel-bar i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--route, var(--accent));
    transition: width .55s cubic-bezier(.16, 1, .3, 1);
}

.eyebrow,
.section-kicker,
.metric span,
.status-card > span,
.table th {
    color: var(--muted);
    font: 760 10px/1 var(--mono);
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* Shared navigation */
.editorial-header,
.sidebar,
.course-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    min-height: 76px;
    padding: 0 clamp(20px, 3.5vw, 56px);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--canvas) 88%, transparent);
    backdrop-filter: blur(18px) saturate(112%);
    -webkit-backdrop-filter: blur(18px) saturate(112%);
}

.editorial-brand,
.brand,
.course-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    color: var(--ink);
}

.brand-mark,
.logo,
.course-brand span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--canvas);
    font: 800 12px/1 var(--mono);
    letter-spacing: .06em;
}

.brand-copy,
.brand span:last-child,
.course-brand strong {
    color: var(--ink);
    font: 760 11px/1.05 var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}

body[data-page="route"] .brand span:last-child {
    font-size: 0;
}

body[data-page="route"] .brand span:last-child::after {
    content: "Learning Routes";
    font: 760 11px/1.05 var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.editorial-nav,
.nav,
.course-nav {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: clamp(16px, 2vw, 28px);
    min-width: 0;
}

.editorial-nav a,
.nav a,
.course-nav a {
    position: relative;
    padding: 27px 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.editorial-nav a::after,
.nav a::after,
.course-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 19px;
    height: 2px;
    background: var(--ink);
    transition: right .18s ease;
}

.editorial-nav a:hover::after,
.editorial-nav a.active::after,
.editorial-nav a.active-route::after,
.nav a:hover::after,
.nav a.active::after,
.nav a.active-route::after,
.course-nav a:hover::after,
.course-nav a.active::after,
.course-nav a.active-route::after {
    right: 0;
}

.editorial-cta,
.sidebar-note,
.course-header > .button {
    justify-self: end;
}

.sidebar-note {
    max-width: 15ch;
    padding: 10px 14px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 720;
    line-height: 1.25;
    text-align: center;
}

/* Homepage */
body.respira-theme {
    background:
        linear-gradient(rgba(18, 21, 16, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 21, 16, .035) 1px, transparent 1px),
        var(--canvas);
    background-size: 64px 64px;
    color: var(--ink);
}

.editorial-main {
    width: min(var(--page-width), calc(100% - 72px));
    margin-inline: auto;
}

.editorial-hero {
    padding: clamp(24px, 3vw, 42px) 0 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    justify-items: center;
    gap: clamp(22px, 3vw, 38px);
    padding: clamp(30px, 4.2vw, 58px) 0 clamp(12px, 2vw, 26px);
    text-align: center;
}

.hero-heading .eyebrow {
    margin: 0 0 18px;
}

.hero-title-main,
.hero-title-main em,
.next-feature-copy h2,
.section-intro h2,
.route-title-wrap h3,
.route-status strong,
.workflow-heading h2,
.hero-metrics strong {
    color: var(--ink);
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -.045em;
}

.hero-title-main {
    display: flex;
    max-width: 1280px;
    justify-content: center;
    margin-inline: auto;
    flex-wrap: wrap;
    gap: .12em;
    font-size: clamp(68px, 7vw, 116px);
    line-height: .96;
}

.hero-title-main em {
    font-style: normal;
    letter-spacing: -.035em;
}

.hero-summary {
    display: grid;
    justify-items: center;
    justify-self: center;
    width: min(100%, 900px);
    padding-bottom: 0;
}

.hero-summary > p {
    max-width: 62ch;
    margin: 0;
    color: var(--muted);
    font-size: clamp(15px, 1.15vw, 18px);
    line-height: 1.72;
    text-wrap: pretty;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.editorial-search {
    width: min(100%, 860px);
    margin-top: 18px;
}

.editorial-search > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.editorial-search-control {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 4px;
    min-height: 54px;
    padding: 4px 5px 4px 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .48);
    border-radius: 999px;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .42), transparent 35%),
        linear-gradient(180deg, rgba(255, 255, 250, .22), rgba(255, 255, 250, .07)),
        color-mix(in srgb, var(--canvas) 36%, transparent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .64),
        0 10px 28px rgba(18, 21, 16, .045);
    backdrop-filter: blur(17px) saturate(128%);
    -webkit-backdrop-filter: blur(17px) saturate(128%);
}

.editorial-search-control input {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 8px 0 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(16px, 1.2vw, 18px);
    letter-spacing: -.012em;
}

.editorial-search-control input::placeholder {
    color: color-mix(in srgb, var(--ink) 38%, transparent);
}

.editorial-search-control input:focus,
.editorial-search-control input:focus-visible {
    outline: none;
}

.editorial-search-control button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border: 1px solid rgba(18, 21, 16, .16);
    border-radius: 999px;
    background: rgba(255, 255, 250, .18);
    color: transparent;
    font-size: 0;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .46);
}

.editorial-search-control button:focus,
.editorial-search-control button:focus-visible {
    outline: none;
}

.editorial-search-control button::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 1.7px solid color-mix(in srgb, var(--ink) 62%, transparent);
    border-radius: 50%;
    transform: translate(-1px, -1px);
}

.editorial-search-control button::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 1.8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 62%, transparent);
    transform: translate(8px, 8px) rotate(45deg);
}

.editorial-search-control:focus-within {
    border-color: rgba(18, 21, 16, .18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .64),
        0 0 0 2px rgba(18, 21, 16, .055),
        0 12px 32px rgba(18, 21, 16, .06);
}

.editorial-search-status {
    min-height: 18px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.metrics-heading,
.hero-metrics,
.next-feature,
.routes-section,
.workflow-section {
    width: 100%;
    margin-inline: auto;
}

.metrics-heading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 16px;
}

.metrics-heading .eyebrow {
    margin: 0;
}

.metrics-heading > p:last-child {
    justify-self: start;
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: left;
}

.hero-metrics {
    display: grid;
    grid-template-columns: minmax(230px, 1.24fr) repeat(4, minmax(132px, 1fr));
    overflow: hidden;
    border: 1px solid rgba(18, 21, 16, .13);
    border-radius: 22px;
    background: rgba(255, 255, 250, .16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42);
    backdrop-filter: blur(8px) saturate(108%);
    -webkit-backdrop-filter: blur(8px) saturate(108%);
}

.hero-metrics > div {
    display: flex;
    min-height: 112px;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 20px;
    border-right: 1px solid rgba(18, 21, 16, .10);
}

.hero-metrics > div:last-child {
    border-right: 0;
}

.hero-metrics span {
    color: var(--muted);
    font: 700 10px/1 var(--mono);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.hero-metrics strong {
    font-size: clamp(28px, 2.8vw, 46px);
    line-height: 1;
}

.metric-primary strong {
    font-size: clamp(44px, 4.2vw, 66px);
}

.editorial-progress {
    height: 3px;
    border-radius: 999px;
}

.editorial-progress i {
    background: var(--route-accent, var(--accent));
}

@keyframes editorialTicker {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0);
    }
}

.editorial-marquee {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 8px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .78);
    border-bottom: 1px solid rgba(18, 21, 16, .10);
    background: rgba(255, 255, 250, .16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 14px 34px rgba(18, 21, 16, .055);
    backdrop-filter: blur(22px) saturate(135%);
    -webkit-backdrop-filter: blur(22px) saturate(135%);
    mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
}

.editorial-hero .editorial-marquee {
    margin: clamp(-28px, -2.4vw, -14px) 0 clamp(42px, 4.5vw, 60px);
}

.marquee-track {
    --marquee-distance: 0px;
    --marquee-duration: 5s;
    display: flex;
    width: max-content;
    padding: 16px 0;
    animation: editorialTicker var(--marquee-duration) linear infinite;
    will-change: transform;
}

.marquee-track:not([data-marquee-ready="true"]) {
    visibility: hidden;
    animation-play-state: paused;
}

.editorial-marquee:hover .marquee-track,
.editorial-marquee:focus-within .marquee-track {
    animation-play-state: paused;
}

.marquee-group {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.marquee-group + .marquee-group {
    margin-left: 8px;
}

.marquee-group[data-marquee-clone="true"] {
    pointer-events: none;
}

.editorial-marquee button,
.editorial-marquee span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, .46);
    border-radius: 999px;
    background: rgba(255, 255, 250, .22);
    color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 8px 18px rgba(18, 21, 16, .06);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.next-feature {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(288px, 316px);
    grid-template-areas:
        "top top"
        "copy panel";
    align-items: center;
    gap: 12px clamp(18px, 2.2vw, 32px);
    min-height: 286px;
    margin-top: clamp(30px, 4vw, 54px);
    padding: clamp(24px, 2.8vw, 36px) clamp(24px, 3vw, 38px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 26px;
    background:
        radial-gradient(circle at 16% 18%, rgba(201, 255, 56, .075), transparent 22%),
        radial-gradient(ellipse at 32% 44%, rgba(255, 255, 250, .44), transparent 42%),
        linear-gradient(135deg, rgba(255, 255, 250, .32), rgba(255, 255, 250, .12) 62%, rgba(18, 21, 16, .025));
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .54);
    backdrop-filter: blur(14px) saturate(118%);
    -webkit-backdrop-filter: blur(14px) saturate(118%);
}

.next-feature::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 42px 42% 42px 26px;
    border-radius: 999px;
    background: radial-gradient(ellipse at 22% 34%, rgba(255, 255, 255, .38), rgba(255, 255, 255, .16) 46%, transparent 74%);
    opacity: .72;
    pointer-events: none;
}

.next-feature-copy .eyebrow,
.next-lesson-context {
    display: none;
}

.next-feature-top,
.next-feature-copy,
.next-feature-panel {
    position: relative;
    z-index: 1;
}

.next-feature-top {
    grid-area: top;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
    padding-bottom: 4px;
}

.next-feature-top::after {
    content: "";
    order: 1;
    flex: 0 1 clamp(62px, 9vw, 140px);
    height: 1px;
    background: linear-gradient(90deg, rgba(18, 21, 16, .075), rgba(18, 21, 16, .026) 58%, transparent);
}

.next-feature-top p {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font: 850 12px/1.2 var(--mono);
    letter-spacing: .095em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-feature-top a {
    order: 2;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 9px 14px;
    border: 1px solid rgba(18, 21, 16, .14);
    border-radius: 999px;
    background: rgba(255, 255, 255, .34);
    color: var(--ink);
    font-size: 12px;
    font-weight: 760;
    white-space: nowrap;
}

.next-feature-copy {
    grid-area: copy;
    min-width: 0;
}

.next-feature-copy h2 {
    max-width: 640px;
    margin: 0;
    font-size: clamp(38px, 4vw, 62px);
    line-height: .96;
    text-wrap: balance;
}

.next-feature-copy > p:last-of-type {
    max-width: 60ch;
    margin: 16px 0 0;
    color: color-mix(in srgb, var(--ink) 68%, transparent);
    font-size: clamp(14px, 1.12vw, 16px);
    line-height: 1.72;
}

.next-benefits,
.next-feature-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.next-benefits {
    margin-top: 18px;
}

.next-benefits span,
.next-feature-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(18, 21, 16, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .38);
    color: var(--muted);
    font: 760 11px/1.2 var(--mono);
    letter-spacing: .03em;
}

.next-feature-panel {
    grid-area: panel;
    display: flex;
    width: min(100%, 316px);
    min-height: 208px;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .44);
    border-radius: 22px;
    background: rgba(255, 255, 250, .24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .54), 0 10px 26px rgba(18, 21, 16, .055);
    backdrop-filter: blur(14px) saturate(118%);
    -webkit-backdrop-filter: blur(14px) saturate(118%);
}

.next-panel-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.next-panel-top span {
    max-width: 13ch;
    color: color-mix(in srgb, var(--ink) 70%, transparent);
    font: 820 11px/1.35 var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.next-panel-top strong {
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(42px, 3.75vw, 58px);
    font-weight: 400;
    line-height: .92;
    letter-spacing: -.046em;
    font-variant-numeric: tabular-nums;
}

.next-panel-bar {
    height: 7px;
    border: 1px solid rgba(18, 21, 16, .08);
}

.next-panel-bar i {
    background: #bfe83c;
}

.next-feature-panel p {
    margin: 0;
    color: color-mix(in srgb, var(--ink) 72%, transparent);
    font-size: 13px;
    line-height: 1.76;
}

.circle-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 50px;
    padding: 0 16px 0 18px;
    border: 1px solid rgba(18, 21, 16, .18);
    border-radius: 999px;
    background: rgba(255, 255, 250, .36);
    color: var(--ink);
    font-size: 14px;
    font-weight: 780;
}

.circle-link::after {
    content: ">";
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--canvas);
}

.routes-section {
    padding: clamp(82px, 8vw, 120px) 0 clamp(76px, 7vw, 112px);
    border-bottom: 1px solid rgba(18, 21, 16, .09);
}

.overview-progress-section {
    padding: clamp(76px, 8vw, 118px) 0 clamp(86px, 8vw, 128px);
    border-bottom: 1px solid rgba(18, 21, 16, .09);
}

.overview-progress-section .section-intro {
    grid-template-columns: minmax(0, .78fr) minmax(360px, .7fr);
    align-items: end;
    gap: clamp(44px, 6vw, 92px);
    margin-bottom: clamp(38px, 5vw, 64px);
}

.overview-progress-section .section-intro h2 {
    max-width: 620px;
    font-size: clamp(38px, 4.8vw, 62px);
    line-height: 1.02;
}

.overview-progress-section .section-intro > p {
    max-width: 46ch;
    padding-bottom: 10px;
    font-size: 16px;
}

.overview-progress-section .progress-cards {
    gap: clamp(18px, 2vw, 28px);
    margin: 0 0 clamp(22px, 3vw, 36px);
}

.overview-progress-section .insight {
    margin-bottom: clamp(22px, 3vw, 36px);
    padding: clamp(24px, 3vw, 34px);
}

.section-intro {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(280px, .54fr);
    align-items: center;
    gap: clamp(28px, 4vw, 56px);
    margin: 0 0 24px;
}

.section-intro h2,
.workflow-heading h2 {
    max-width: 820px;
    margin: 0;
    font-size: clamp(36px, 4.2vw, 58px);
    line-height: 1.02;
}

.section-intro > p {
    max-width: 430px;
    margin: 0;
    color: color-mix(in srgb, var(--ink) 62%, transparent);
    font-size: 15px;
    line-height: 1.72;
}

.route-order-note {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 0 10px;
    padding: 12px 16px;
    border: 1px solid rgba(18, 21, 16, .08);
    border-radius: 16px;
    background: rgba(255, 255, 250, .34);
    color: color-mix(in srgb, var(--ink) 66%, transparent);
    font-size: 12px;
}

.route-order-note strong {
    color: color-mix(in srgb, var(--ink) 84%, transparent);
}

.editorial-routes {
    overflow: hidden;
    border: 1px solid rgba(18, 21, 16, .10);
    border-radius: 20px;
    background: rgba(255, 255, 250, .32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .54), var(--shadow);
}

.editorial-route {
    display: grid;
    grid-template-columns: minmax(190px, .62fr) minmax(260px, .95fr) minmax(290px, .9fr);
    grid-template-areas:
        "title copy status"
        "title copy progress"
        "title copy footer";
    align-items: center;
    gap: 11px clamp(20px, 2.5vw, 34px);
    padding: clamp(18px, 2vw, 24px) clamp(18px, 2.3vw, 26px);
    border-bottom: 1px solid rgba(18, 21, 16, .09);
}

.editorial-route:last-child {
    border-bottom: 0;
}

.editorial-route:hover {
    background: rgba(255, 255, 250, .42);
}

.route-title-wrap {
    grid-area: title;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.route-index {
    color: color-mix(in srgb, var(--ink) 56%, transparent);
    font: 760 12px/1 var(--mono);
    letter-spacing: .08em;
}

.route-title-main {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.route-title-wrap h3 {
    margin: 0;
    font-size: clamp(23px, 1.9vw, 30px);
    line-height: 1.06;
    white-space: nowrap;
}

.route-requirement {
    color: color-mix(in srgb, var(--ink) 55%, transparent);
    font-size: 12px;
    font-weight: 700;
}

.editorial-route > p {
    grid-area: copy;
    max-width: 48ch;
    margin: 0;
    color: color-mix(in srgb, var(--ink) 68%, transparent);
    font-size: 14px;
    line-height: 1.64;
}

.route-status {
    grid-area: status;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.route-status span {
    min-width: 0;
    color: color-mix(in srgb, var(--ink) 68%, transparent);
    font-size: 15px;
    font-weight: 720;
    line-height: 1.38;
}

.route-status strong {
    flex: 0 0 auto;
    font-size: 22px;
    line-height: 1;
}

.editorial-route .editorial-progress {
    grid-area: progress;
}

.route-footer {
    grid-area: footer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    color: color-mix(in srgb, var(--ink) 58%, transparent);
    font-size: 12px;
    font-weight: 700;
}

.route-link-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 13px;
    border: 1px solid color-mix(in srgb, var(--route-accent) 24%, rgba(18, 21, 16, .13));
    border-radius: 999px;
    background: rgba(255, 255, 250, .44);
    color: color-mix(in srgb, var(--ink) 78%, var(--route-accent));
    white-space: nowrap;
}

.workflow-section {
    display: grid;
    grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr);
    gap: clamp(36px, 6vw, 86px);
    padding: clamp(84px, 8vw, 124px) 0;
    border-top: 1px solid var(--line);
}

.section-number {
    color: var(--muted);
    font: 760 10px/1 var(--mono);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.workflow-heading {
    position: sticky;
    top: 104px;
    grid-column: 1;
}

.workflow-list {
    grid-column: 2;
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0 0 0 24px;
    border-left: 1px solid var(--line);
    list-style: none;
}

.workflow-list li {
    padding: 8px 0 38px 24px;
}

.workflow-list li:last-child {
    padding-bottom: 0;
}

.workflow-list span {
    color: var(--muted);
    font: 760 11px/1 var(--mono);
}

.workflow-list strong {
    display: block;
    margin-top: 12px;
    color: var(--ink);
    font-size: clamp(22px, 2.2vw, 30px);
}

.workflow-list p {
    max-width: 58ch;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.editorial-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    width: min(var(--page-width), calc(100% - 72px));
    margin-inline: auto;
    padding: 28px 0 64px;
    color: var(--muted);
    font: 700 10px/1 var(--mono);
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* Route and settings pages */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(var(--page-width), calc(100% - 72px));
    margin-inline: auto;
    padding: 24px 0 0;
}

.topbar h1 {
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(34px, 4vw, 54px);
    font-weight: 400;
    line-height: .98;
    letter-spacing: -.045em;
}

.topbar p {
    max-width: 58ch;
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.main {
    width: min(var(--page-width), calc(100% - 72px));
    margin-inline: auto;
    padding: 20px 0 88px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) repeat(3, minmax(132px, .5fr));
    gap: 0;
    margin: 18px 0 30px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.hero-main {
    grid-row: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    min-height: 226px;
    padding: 30px 32px 30px 0;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    backdrop-filter: none;
}

.hero-main h2 {
    max-width: 760px;
    margin: 0 0 12px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(40px, 4.4vw, 64px);
    font-weight: 400;
    line-height: .96;
    letter-spacing: -.045em;
    text-wrap: balance;
}

.hero-main p {
    max-width: 60ch;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.72;
}

.hero-progress {
    min-width: 150px;
    text-align: right;
}

.hero-progress strong {
    display: block;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(34px, 3.4vw, 54px);
    font-weight: 400;
    line-height: .9;
    letter-spacing: -.05em;
    font-variant-numeric: tabular-nums;
}

.hero-progress span {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
}

.metric {
    display: flex;
    min-height: 226px;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px 18px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.metric:last-child {
    border-right: 0;
}

.metric strong {
    display: block;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(34px, 3.4vw, 54px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -.05em;
    font-variant-numeric: tabular-nums;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(286px, 310px);
    align-items: start;
    gap: 24px;
}

.panel-head {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) minmax(230px, .72fr) auto;
    align-items: center;
    gap: 14px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
}

.panel-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.search,
.input-row input,
.practice-list textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 250, .52);
    color: var(--text);
}

.search {
    padding: 10px 12px;
}

.search::placeholder,
.practice-list textarea::placeholder {
    color: var(--faint);
}

.search:focus,
.input-row input:focus,
.practice-list textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.filters {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 250, .30);
}

.filters button {
    padding: 8px 11px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}

.filters button.active,
.stage-chip.current {
    background: var(--ink);
    color: var(--canvas);
}

.stage-map {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
}

.stage-chip {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
}

.stage-chip.complete:not(.current) {
    background: var(--success-soft);
    color: var(--success);
}

.stage {
    border-bottom: 1px solid var(--line);
}

.stage:last-child {
    border-bottom: 0;
}

.stage-btn {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 18px 20px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.stage-btn:hover {
    background: rgba(255, 255, 250, .32);
}

.stage-num {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    color: var(--muted);
    font: 750 11px/1 var(--mono);
}

.stage.complete .stage-num {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.stage-copy strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
}

.stage-copy span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.tasks {
    padding: 0 20px 17px 76px;
}

.task {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
    cursor: pointer;
}

.task input {
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    accent-color: var(--accent);
}

.task strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 680;
}

.task small,
.task .desc {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.task small {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.task:hover strong {
    color: var(--accent);
}

.task:has(input:checked) strong {
    color: var(--faint);
    text-decoration: line-through;
}

.lesson-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 760;
}

.rail {
    position: sticky;
    top: 104px;
    display: grid;
    gap: 14px;
}

.status-card,
.mini {
    padding: 20px;
}

.status-card {
    border-top: 4px solid var(--ink);
}

.status-card h3,
.mini h3,
.insight h3 {
    margin: 12px 0 8px;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.25;
}

.status-card p,
.mini p,
.insight p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.status-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 16px 0;
}

.status-meta div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 250, .34);
}

.status-meta span {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.status-meta strong {
    display: block;
    margin-top: 4px;
    color: var(--ink);
    font-size: 12px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.input-row label {
    color: var(--muted);
    font-size: 11px;
}

.input-row input {
    margin-top: 6px;
    padding: 9px;
}

.week-bar {
    margin-top: 16px;
}

.empty {
    display: none;
    padding: 48px 20px;
    color: var(--muted);
    text-align: center;
}

.empty.show {
    display: block;
}

.progress-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.progress-route {
    display: flex;
    min-height: 186px;
    flex-direction: column;
    padding: 20px;
}

.progress-route header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.progress-route h3 {
    margin: 0;
    color: var(--ink);
    font-size: 21px;
}

.progress-route header strong {
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(34px, 3.4vw, 54px);
    font-weight: 400;
    letter-spacing: -.05em;
}

.progress-route p {
    margin: 14px 0;
    color: var(--muted);
    font-size: 12px;
}

.progress-route .button {
    width: max-content;
    margin-top: auto;
}

.insight {
    margin-block: 16px;
    padding: 20px 22px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.table tr:last-child td {
    border-bottom: 0;
}

.table td:last-child {
    text-align: right;
}

.settings {
    max-width: 920px;
}

.settings::before {
    content: "本地数据管理";
    display: block;
    margin: 2px 0 15px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 106px;
    padding: 22px 23px;
    border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
    border-bottom: 0;
}

.setting-row strong {
    color: var(--ink);
    font-size: 15px;
}

.setting-row p {
    max-width: 52ch;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

/* Lesson page */
.lesson-layout {
    display: grid;
    grid-template-columns: minmax(220px, 250px) minmax(0, 840px);
    justify-content: center;
    gap: clamp(34px, 5vw, 58px);
    width: min(var(--page-width), calc(100% - 72px));
    margin-inline: auto;
    padding: 44px 0 104px;
}

.lesson-toc {
    position: sticky;
    top: 104px;
    align-self: start;
    max-height: calc(100dvh - 130px);
    overflow: auto;
    padding-right: 18px;
}

.lesson-toc h2 {
    margin: 13px 0 22px;
    color: var(--ink);
    font-size: 20px;
    line-height: 1.25;
}

.lesson-toc nav {
    display: grid;
    border-left: 1px solid var(--line);
}

.lesson-toc nav a {
    padding: 8px 0 8px 16px;
    color: var(--muted);
    font-size: 12px;
}

.lesson-toc nav a:hover {
    color: var(--accent);
}

.lesson-progress-box {
    margin-top: 28px;
    padding: 15px;
}

.lesson-progress-box > span {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 10px;
}

.lesson-progress-box .button {
    width: 100%;
    font-size: 11px;
}

.lesson-article {
    min-width: 0;
}

.lesson-hero {
    padding: 10px 0 38px;
    border-bottom: 1px solid var(--line);
}

.lesson-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
}

.lesson-breadcrumb a {
    color: var(--accent);
}

.lesson-hero h1 {
    max-width: 780px;
    margin: 24px 0 16px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(40px, 4.4vw, 64px);
    font-weight: 400;
    line-height: .98;
    letter-spacing: -.045em;
    text-wrap: balance;
}

.lesson-hero > p {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.75;
}

.lesson-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 26px;
}

.lesson-meta span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
}

.lesson-section {
    padding: 44px 0;
    border-bottom: 1px solid var(--line);
}

.lesson-section h2 {
    margin: 12px 0 24px;
    color: var(--ink);
    font-size: 32px;
}

.lesson-section p {
    color: color-mix(in srgb, var(--text) 90%, var(--muted));
    font-size: 15px;
    line-height: 1.9;
}

.lesson-section p.lead {
    color: var(--ink);
    font-size: 18px;
    line-height: 1.75;
}

.lesson-section .section-intro {
    max-width: 650px;
    color: var(--muted);
    font-size: 13px;
}

.lesson-section code:not(pre code) {
    padding: .12em .35em;
    border-radius: 6px;
    background: var(--surface-3);
    color: #9b3c43;
    font-family: var(--mono);
    font-size: .9em;
}

.concept-flow {
    display: grid;
    border-top: 1px solid var(--line);
}

.concept-flow div {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.concept-flow span {
    color: var(--accent);
    font: 760 11px/1.5 var(--mono);
}

.concept-flow p {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
}

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

.knowledge-grid article {
    min-height: 210px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42);
}

.knowledge-grid article > span {
    color: var(--accent);
    font: 760 10px/1 var(--mono);
}

.knowledge-grid h3 {
    margin: 24px 0 10px;
    color: var(--ink);
    font-size: 17px;
    line-height: 1.35;
}

.knowledge-grid p {
    margin: 0;
    color: color-mix(in srgb, var(--text) 88%, var(--muted));
    font-size: 13px;
    line-height: 1.85;
}

.code-panel {
    overflow: hidden;
    border: 1px solid #252b28;
    border-radius: 16px;
    background: #171b19;
    box-shadow: var(--shadow-small);
}

.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 15px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: #aeb7b0;
    font: 700 10px/1 var(--mono);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.code-head button {
    border: 0;
    background: transparent;
    color: #d9e4dc;
    font-size: 11px;
    cursor: pointer;
}

.code-panel pre {
    margin: 0;
    padding: 24px;
    overflow: auto;
    color: #e8eee9;
    font: 13px/1.8 var(--mono);
    tab-size: 4;
}

.code-explain {
    margin-top: 14px;
    padding: 17px 18px;
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: var(--accent-soft);
}

.code-explain strong {
    color: var(--ink);
    font-size: 12px;
}

.code-explain p {
    margin: 5px 0 0;
    font-size: 13px;
    line-height: 1.7;
}

.mistake-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mistake-grid article,
.practice-list article {
    padding: 18px;
}

.mistake-grid article {
    min-height: 190px;
}

.mistake-grid article > span {
    color: var(--danger);
    font: 760 10px/1 var(--mono);
}

.mistake-grid h3 {
    margin: 28px 0 8px;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.35;
}

.mistake-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.practice-list {
    display: grid;
    gap: 12px;
}

.practice-list header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.practice-list header span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font: 760 10px/1 var(--mono);
}

.practice-list header strong {
    color: var(--ink);
    font-size: 14px;
}

.practice-list p {
    margin: 13px 0;
    font-size: 13px;
    line-height: 1.7;
}

.practice-list textarea {
    min-height: 104px;
    padding: 12px;
    resize: vertical;
    font: 13px/1.6 var(--font);
}

.answers-section details {
    border-top: 1px solid var(--line);
}

.answers-section details:last-child {
    border-bottom: 1px solid var(--line);
}

.answers-section summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 0;
    color: var(--ink);
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}

.answers-section summary::-webkit-details-marker {
    display: none;
}

.answers-section summary span {
    color: var(--accent);
    font: 760 10px/1 var(--mono);
}

.answers-section details > div {
    padding: 0 0 20px 24px;
    color: var(--muted);
}

.answers-section pre {
    overflow: auto;
    padding: 16px;
    border-radius: 12px;
    background: #171b19;
    color: #e8eee9;
    font: 12px/1.7 var(--mono);
}

.lesson-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 34px;
}

/* Feedback and mobile navigation */
.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--canvas);
    box-shadow: var(--shadow-small);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: .22s ease;
}

.toast.show {
    opacity: 1;
    transform: none;
}

.mobile-nav,
.settings-nav {
    display: none;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity .55s ease, transform .55s cubic-bezier(.2, .8, .2, 1);
    }

    .reveal.visible {
        opacity: 1;
        transform: none;
    }

    .main > .hero,
    .progress-route,
    .insight,
    .settings > .card {
        animation: rise .5s both;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .card,
    .editorial-search-control,
    .editorial-marquee,
    .next-feature,
    .next-feature-panel,
    .editorial-header,
    .sidebar,
    .course-header {
        background: var(--surface-solid);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

@media (max-width: 1120px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .hero-summary {
        justify-self: start;
        width: min(100%, 760px);
    }

    .hero-metrics {
        grid-template-columns: repeat(4, 1fr);
    }

    .metric-primary {
        grid-column: span 2;
    }

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

    .hero-main {
        grid-column: 1 / -1;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .metric {
        min-height: 150px;
    }

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

    .progress-cards {
        grid-template-columns: 1fr;
    }

    .progress-route {
        min-height: 0;
    }
}

@media (max-width: 980px) {
    .editorial-main,
    .topbar,
    .main,
    .lesson-layout,
    .editorial-footer {
        width: min(100% - 40px, var(--page-width));
    }

    .editorial-header,
    .sidebar,
    .course-header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .editorial-nav,
    .nav,
    .course-nav {
        display: none;
    }

    .metrics-heading,
    .section-intro,
    .editorial-route,
    .workflow-section,
    .next-feature {
        grid-template-columns: 1fr;
    }

    .metrics-heading > p:last-child {
        justify-self: start;
        text-align: left;
    }

    .next-feature {
        grid-template-areas:
            "top"
            "copy"
            "panel";
        min-height: 0;
        gap: 22px;
    }

    .next-feature-panel {
        width: 100%;
    }

    .editorial-route {
        grid-template-areas:
            "title"
            "copy"
            "status"
            "progress"
            "footer";
    }

    .workflow-heading,
    .workflow-list,
    .section-number {
        grid-column: 1;
    }

    .workflow-heading {
        position: static;
    }

    .lesson-layout {
        grid-template-columns: 1fr;
    }

    .lesson-toc {
        position: static;
        max-height: none;
        padding: 0 0 18px;
        border-bottom: 1px solid var(--line);
    }

    .lesson-toc nav {
        display: flex;
        gap: 6px;
        overflow: auto;
        border-left: 0;
    }

    .lesson-toc nav a {
        flex: 0 0 auto;
        padding: 8px 11px;
        border-radius: 999px;
        background: var(--surface-3);
    }

    .lesson-progress-box {
        display: none;
    }

    .knowledge-grid,
    .mistake-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .editorial-header,
    .course-header {
        min-height: 68px;
        height: 68px;
        padding-inline: 20px;
    }

    .sidebar {
        display: none;
    }

    .brand-copy {
        display: none;
    }

    .editorial-main,
    .topbar,
    .main,
    .lesson-layout,
    .editorial-footer {
        width: calc(100% - 32px);
    }

    .editorial-hero {
        padding-top: 24px;
    }

    .hero-grid {
        padding-top: 0;
        padding-bottom: 18px;
    }

    .hero-title-main {
        font-size: clamp(40px, 11vw, 58px);
    }

    .hero-actions,
    .route-footer,
    .next-benefits,
    .setting-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .editorial-button,
    .route-link-label,
    .next-feature-top a {
        width: 100%;
    }

    .hero-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .hero-metrics > div {
        min-height: 104px;
    }

    .metric-primary {
        grid-column: 1 / -1;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 18px;
    }

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

    .hero-main,
    .metric {
        min-height: auto;
        padding: 20px 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .hero-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .hero-progress {
        min-width: 0;
        text-align: left;
    }

    .panel-head {
        grid-template-columns: 1fr;
        padding-inline: 18px;
    }

    .stage-btn {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        gap: 10px;
        padding-inline: 16px;
    }

    .tasks {
        padding: 0 16px 14px 60px;
    }

    .task {
        grid-template-columns: 20px minmax(0, 1fr);
    }

    .task small {
        grid-column: 2;
    }

    .setting-row {
        align-items: flex-start;
        padding-inline: 18px;
    }

    .mobile-nav {
        position: fixed;
        right: 9px;
        bottom: 9px;
        left: 9px;
        z-index: 50;
        display: flex;
        gap: 4px;
        overflow-x: auto;
        padding: 5px;
        border: 1px solid color-mix(in srgb, var(--line-strong) 88%, transparent);
        border-radius: 16px;
        background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
        box-shadow: var(--shadow-small);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .mobile-nav a {
        flex: 1 0 58px;
        padding: 9px 5px;
        border-radius: 11px;
        color: var(--muted);
        font-size: 10px;
        text-align: center;
        white-space: nowrap;
    }

    .mobile-nav a.active,
    .mobile-nav a.active-route {
        background: var(--ink);
        color: var(--canvas);
    }

    .settings-nav {
        display: block;
    }

    .toast {
        right: 14px;
        bottom: 82px;
        left: 14px;
        text-align: center;
    }
}

@media (max-width: 560px) {
    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .hero-metrics > div,
    .hero-metrics > div:last-child {
        border-right: 0;
        border-bottom: 1px solid rgba(18, 21, 16, .10);
    }

    .editorial-search-control {
        min-height: 50px;
        padding-left: 14px;
    }

    .editorial-search-control input {
        font-size: 15px;
    }

    .hero-main h2,
    .lesson-hero h1 {
        font-size: clamp(34px, 9.4vw, 44px);
    }

    .table {
        display: block;
        min-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
}

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