/* Card expansion inspired by Moxen Despliegue; license in vendor/moxen-despliegue. */
.motion-chapter[role=button]{cursor:pointer}.motion-chapter[role=button]:focus{outline:none}.motion-chapter[role=button]:focus-visible h3{text-decoration:underline;text-underline-offset:6px}
.level-unfold{position:fixed;inset:0;max-width:none;max-height:none;width:100vw;height:100dvh;margin:0;border:0;padding:0;color:#202341;background:#fff;overflow:auto}
.level-unfold::backdrop{background:transparent}.level-unfold[data-level=ready]{background:#fff5cf}.level-unfold[data-level=go]{background:#2f3984;color:#fff}
.level-unfold-inner{min-height:100%;width:min(100% - 48px,1050px);margin:auto;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding:100px 0;position:relative;isolation:isolate}
.level-unfold-inner::after{content:"";position:absolute;width:55vw;height:55vw;max-width:650px;max-height:650px;border:1px solid currentColor;opacity:.12;border-radius:50%;right:-10vw;top:20%;z-index:-1;pointer-events:none}
.level-unfold-close{position:fixed;top:24px;right:24px;border:1px solid currentColor;border-radius:999px;padding:12px 20px;background:transparent;color:inherit;font:600 16px/1.4 inherit;cursor:pointer;z-index:1}
.level-unfold-kicker{font-size:20px;font-weight:700}.level-unfold h2{font-size:clamp(64px,12vw,140px);font-weight:800;line-height:1.1;margin:12px 0 32px;letter-spacing:-.04em}.level-unfold-copy{font-size:clamp(20px,3vw,30px);line-height:1.7;margin:0 0 40px;word-break:keep-all}.level-unfold a{color:inherit;font-size:18px;font-weight:700;text-decoration:none}
@media(max-width:600px){.level-unfold-inner{width:calc(100% - 40px)}.level-unfold-close{top:16px;right:16px}.level-unfold-kicker{font-size:16px}}

html .motion-demo .levels-static{position:relative!important;top:auto!important;transform:none!important}
html .motion-demo .levels-static .motion-heading{position:relative!important;top:auto!important;transform:none!important}
html .motion-demo .levels-static .motion-stack{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:19.2px;width:100%;padding:0;margin:38.4px 0 0;zoom:1}
html .motion-demo .levels-static .motion-chapter{position:relative!important;top:auto!important;transform:none!important;animation:none!important;transition:none!important;zoom:1;width:100%;min-height:288px;height:auto;padding:25.6px 19.2px;margin:0;display:flex;align-items:stretch;border-radius:19.2px}
html .motion-demo .levels-static .motion-chapter>div{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:16px;width:100%;zoom:1}
html .motion-demo .levels-static .motion-chapter>div>p:first-child{font-size:12.8px;margin:0}
html .motion-demo .levels-static .motion-chapter h3{font-size:51.2px;line-height:1.1;margin:0}
html .motion-demo .levels-static .motion-chapter>div>p:nth-of-type(2){font-size:16px;line-height:1.7;margin:0;padding:0;align-self:auto}
html .motion-demo .levels-static .motion-chapter>div::after{content:none}
html .motion-demo .levels-static .motion-orbit{width:224px;height:224px;right:-136px;pointer-events:none}
html .motion-demo .levels-static .motion-curriculum-action{width:100%}
@media(max-width:866px){html .motion-demo .levels-static .motion-stack{grid-template-columns:1fr;gap:19.2px}html .motion-demo .levels-static .motion-chapter{min-height:240px;padding:25.6px}html .motion-demo .levels-static .motion-chapter h3{font-size:48px}}

html .motion-demo .levels-static .motion-chapter>div>p:nth-of-type(2){display:none}
html .motion-demo .levels-static .motion-chapter{min-height:208px}
html .motion-demo .levels-static .level-open-hint{display:inline-flex;align-items:center;gap:9.6px;font-size:14.4px;font-weight:800;line-height:1.5;color:#2f3984;background:transparent;padding:0;border-radius:0;margin:19.2px 0 0}
@media(max-width:866px){html .motion-demo .levels-static .motion-chapter{min-height:176px}html .motion-demo .levels-static .level-open-hint{font-size:12.8px}}

@media(min-width:867px){html .motion-demo .levels-static .motion-chapter{min-height:416px}}
@media(max-width:866px){
 html .motion-demo .levels-static .motion-chapter{min-height:128px;padding:22.4px}
 html .motion-demo .levels-static .motion-chapter>div{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto;align-items:center;gap:16px}
 html .motion-demo .levels-static .motion-chapter h3{grid-column:1;grid-row:1;font-size:clamp(35.2px,8vw,48px)}
 html .motion-demo .levels-static .motion-chapter>div>p:first-child{grid-column:2;grid-row:1;white-space:nowrap;font-size:12.8px}
}

.level-unfold-inner{justify-content:flex-start;padding-top:100px}
.level-unfold h2{transform-origin:0 0}
html .motion-demo .levels-static .motion-chapter.level-origin>div{visibility:hidden}
.level-unfold.is-closing .level-unfold-kicker,.level-unfold.is-closing .level-unfold-copy,.level-unfold.is-closing .level-unfold-inner>a,.level-unfold.is-closing .level-unfold-close{visibility:hidden}
@media(max-width:600px){.level-unfold-inner{padding-top:88px}}

.level-unfold-details{width:100%;margin:0 0 40px}
.level-unfold-details>section{margin:0 0 36px}
.level-unfold-details h3{font-size:25px;font-weight:800;line-height:1.4;margin:0 0 16px;color:inherit}
.level-times{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;margin:0;padding:24px;border:1px solid currentColor;border-radius:18px}
.level-times dt{font-size:14px;opacity:.75;margin-bottom:8px}.level-times dd{margin:0;font-size:21px;font-weight:700}.level-times small{font-size:15px}
.level-parts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.level-parts>div{padding:24px 0;border-top:1px solid currentColor}.level-parts h4{font-size:25px;font-weight:800;margin:0 0 12px;color:inherit}
.level-parts p,.level-subjects p,.level-unfold-details>.course-panel-note{font-size:20px;line-height:1.8;word-break:keep-all;margin:0;color:inherit}
.level-subjects{margin:0}.level-subjects>div{padding:20px 0;border-top:1px solid currentColor;display:grid;grid-template-columns:150px 1fr;gap:20px}.level-subjects dt{font-size:17px}.level-subjects dd{margin:0}.level-subjects h3{font-size:22px;margin:0 0 12px}
.level-unfold.is-closing .level-unfold-details{visibility:hidden}
@media(max-width:600px){.level-parts{grid-template-columns:1fr;gap:0}.level-subjects>div{grid-template-columns:1fr;gap:12px}.level-times{grid-template-columns:1fr}.level-parts p,.level-subjects p,.level-unfold-details>.course-panel-note{font-size:18px}.level-unfold-copy{margin-bottom:32px}}

/* Portrait panel: keep the homepage visible around the dialog. */
.level-unfold{inset:0;width:min(90vw,calc(88dvh * 9 / 16));height:auto;aspect-ratio:9/16;max-height:88dvh;margin:auto;border-radius:24px;box-shadow:0 24px 80px #151c4840;overflow:auto}
.level-unfold::backdrop{background:rgba(20,26,57,.4)}
.level-unfold-inner{width:calc(100% - 40px);min-height:100%;padding:72px 0 32px}
.level-unfold-close{position:sticky;top:16px;float:right;right:auto;margin:16px 16px -56px 0;padding:8px 14px;background:inherit;font-size:14px}
.level-unfold h2{font-size:clamp(48px,8vw,76px);margin:8px 0 24px}
.level-unfold-kicker{font-size:16px}.level-unfold-copy{font-size:18px;line-height:1.7;margin-bottom:28px}
.level-unfold-details h3{font-size:22px}.level-times{grid-template-columns:1fr;padding:18px;gap:14px}.level-times dd{font-size:19px}
.level-parts{grid-template-columns:1fr;gap:0}.level-parts h4{font-size:22px}.level-parts p,.level-subjects p,.level-unfold-details>.course-panel-note{font-size:17px}
.level-subjects>div{grid-template-columns:1fr;gap:10px}.level-subjects h3{font-size:19px}.level-unfold-inner::after{width:min(100%,320px);height:320px;right:0}
@media(max-width:600px){.level-unfold-inner{width:calc(100% - 32px);padding-top:72px}.level-unfold{border-radius:20px}}

html .motion-demo .levels-static .motion-chapter>div{position:relative;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr auto;align-items:center;gap:12.8px}
.level-card-number{font-size:12.8px;font-weight:700;opacity:.65}
html .motion-demo .levels-static .motion-chapter>div>p:first-child{grid-column:2;grid-row:1;text-align:right}
html .motion-demo .levels-static .motion-chapter h3{grid-column:1/-1;grid-row:2;align-self:center;font-size:clamp(38.4px,4vw,57.6px)}
.level-card-range{grid-column:1;grid-row:3;font-size:17.6px;font-weight:700;letter-spacing:.03em}
.level-card-arrow{grid-column:2;grid-row:3;justify-self:end;font-size:24px;line-height:1}
@media(max-width:866px){
 html .motion-demo .levels-static .motion-chapter{min-height:144px}
 html .motion-demo .levels-static .motion-chapter>div{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;gap:11.2px 16px}
 .level-card-number{grid-column:1;grid-row:1;font-size:10.4px}
 html .motion-demo .levels-static .motion-chapter>div>p:first-child{grid-column:2;grid-row:1;font-size:12px}
 html .motion-demo .levels-static .motion-chapter h3{grid-column:1;grid-row:2;font-size:clamp(35.2px,8vw,48px)}
 .level-card-range{grid-column:2;grid-row:2;font-size:16px;justify-self:start;margin-right:32px}
 .level-card-arrow{grid-column:2;grid-row:2;font-size:20px;justify-self:end}
}

.level-card-plus{grid-column:2;grid-row:3;justify-self:end;display:grid;place-items:center;width:35.2px;height:35.2px;border:0.8px solid currentColor;border-radius:50%;font-size:24px;font-weight:400;line-height:1}
@media(max-width:866px){.level-card-plus{grid-column:2;grid-row:2;width:28.8px;height:28.8px;font-size:20.8px}}

html .motion-demo .levels-static .motion-chapter h3{justify-self:start;text-align:left}

@media(max-width:866px){
 html .motion-demo .levels-static .motion-chapter>div{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:1fr auto;align-items:center}
 html .motion-demo .levels-static .motion-chapter h3{grid-column:1;grid-row:1;align-self:center}
 html .motion-demo .levels-static .motion-chapter>div>p:first-child{grid-column:2;grid-row:1;align-self:center}
 .level-card-plus{grid-column:2;grid-row:2}
}

@media(max-width:866px){
 html .motion-demo .levels-static .motion-chapter>div{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:1fr;align-items:center}
 html .motion-demo .levels-static .motion-chapter h3{grid-column:1;grid-row:1;align-self:center;margin:0;justify-self:start}
 html .motion-demo .levels-static .motion-chapter>div>p:first-child{grid-column:2;grid-row:1;align-self:center;margin:0}
 .level-card-plus{position:absolute;right:0;bottom:-9.6px;width:22.4px;height:22.4px;font-size:17.6px}
}






/* Original typography-led layout. */
html .motion-demo .levels-static .motion-stack{gap:22.4px;padding:0}
html .motion-demo .levels-static .motion-stack::before{content:none}
html .motion-demo .levels-static .motion-chapter{border-radius:19.2px;padding:25.6px;box-shadow:none;overflow:hidden}
html .motion-demo .levels-static .motion-chapter::before{content:attr(data-level-word);position:absolute;left:auto;right:0;bottom:-16px;font-size:clamp(120px,14.4vw,228px);font-weight:900;line-height:1;letter-spacing:-.08em;color:currentColor;opacity:.055;pointer-events:none;z-index:-1}
html .motion-demo .levels-static .motion-chapter::after{content:none}
html .motion-demo .levels-static .motion-orbit{display:none}
@media(min-width:867px){
 html .motion-demo .levels-static .motion-chapter>div{grid-template-columns:1fr;grid-template-rows:auto 1fr auto}
 html .motion-demo .levels-static .motion-chapter>div>p:first-child{grid-column:1;grid-row:1;text-align:left;justify-self:start;font-size:12.8px}
 html .motion-demo .levels-static .motion-chapter h3{grid-column:1;grid-row:2;font-size:clamp(43.2px,4.8vw,70.4px);letter-spacing:-.055em;font-weight:800}
 .level-card-plus{grid-column:1;grid-row:3;justify-self:end}
}
@media(max-width:866px){
 html .motion-demo .levels-static .motion-chapter{min-height:137.6px;padding:22.4px}
 html .motion-demo .levels-static .motion-chapter::before{font-size:144px;left:auto;right:0;bottom:-14.4px}
 html .motion-demo .levels-static .motion-chapter h3{font-size:clamp(38.4px,8.8vw,52.8px);letter-spacing:-.055em}
 .level-card-plus{right:0;bottom:-12.8px}
}

@media(min-width:867px){html .motion-demo .levels-static .motion-chapter{min-height:291.2px}}

@media(min-width:867px){html .motion-demo .levels-static .motion-chapter{min-height:384px}}


@media(max-width:866px){html .motion-demo .levels-static .motion-chapter>div>p:first-child{font-size:16.64px}}

/* Keep browser toolbars outside the panel and its close control outside the scroller. */
.level-unfold{width:min(90vw,49.5svh);height:min(160vw,88svh);max-height:88svh;overflow:hidden}
.level-unfold-inner{height:calc(100% - 64px);margin-top:64px;padding-top:8px;min-height:0;box-sizing:border-box;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.level-unfold-close{position:absolute;top:16px;right:16px;float:none;margin:0;z-index:2;background:inherit}

/* Group the level and stage into one reading path. */
html .motion-demo .levels-static .motion-chapter>div{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:9.6px;padding-right:48px}
html .motion-demo .levels-static .motion-chapter h3{order:0;align-self:flex-start;margin:0}
html .motion-demo .levels-static .motion-chapter>div>p:first-child{order:1;align-self:flex-start;justify-self:start;text-align:left;font-size:16.64px;font-weight:800;margin:0}
html .motion-demo .levels-static .motion-chapter::before{opacity:.025}
html .motion-demo .levels-static .level-card-plus{position:absolute;right:0;top:50%;bottom:auto;transform:translateY(-50%);width:38.4px;height:38.4px;font-size:24px;order:2}

@media(min-width:867px){html .motion-demo .levels-static .motion-chapter{container-type:inline-size}html .motion-demo .levels-static .motion-chapter h3{font-size:clamp(25.6px,20cqw,51.2px)}}

html .motion-demo .levels-static #motion-journey-title{font-size:clamp(33.28px,4.992vw,66.56px)}

html .motion-demo .levels-static .motion-chapter::before{left:0;right:auto;top:100%;bottom:auto;transform:translateY(-85%);text-align:left}

/* Anchor the desktop controls to the card rather than the shortened heading. */
html .motion-demo .levels-static .level-card-plus{border-width:1.56px}
@media(min-width:867px){
 html .motion-demo .levels-static .motion-chapter>div{position:static;flex:none;height:130px;padding-left:10px;padding-right:0;box-sizing:border-box;justify-content:center}
 html .motion-demo .levels-static .level-card-plus{top:auto;right:25.6px;bottom:25.6px;transform:none;margin-top:0}
}

/* Keep keyboard focus visible without an outer ring around the close control. */
.level-unfold-close:focus{outline:none;box-shadow:none}
.level-unfold-close:focus-visible{text-decoration:underline;text-underline-offset:4px}

@media(max-width:866px){
 html .motion-demo .levels-static .motion-chapter::before{left:auto;right:calc(50% - 1.3415em);text-align:right}
}

html .motion-demo .levels-static .level-card-plus{outline:none;box-shadow:none}

/* Separate level-system preview; preserve the existing card and panel surfaces. */
html .motion-demo .levels-static .motion-chapter.level-star{grid-column:1/-1;min-height:160px}
.level-unfold[data-level=star]{background:#2f3984;color:#fff}
.level-description-pending{opacity:.65}
@media(min-width:867px){html .motion-demo .levels-static .motion-stack{grid-template-columns:repeat(2,minmax(0,1fr))}}
