/* Lesson 1: designed for a 1280 x 720 stage */
html { background: var(--lake-950); }
body { overflow: hidden; }
.stage { position: relative; width: 1280px; height: 720px; margin: 0 auto; overflow: hidden; background: var(--lake-900); }
#bg { position: absolute; inset: 0; width: 100%; height: 100%; }

.top { position: absolute; left: 64px; right: 64px; top: 40px; display: flex; justify-content: space-between; align-items: baseline; }

.copy { position: absolute; left: 64px; top: 118px; width: 470px; }
.copy h1 { font-size: 46px; margin: 14px 0 18px; }
.copy .body { font-size: 18px; line-height: 1.65; color: var(--lake-100); }

.legend { position: absolute; left: 0; right: 0; top: 330px; list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(182, 210, 230, .22); }
.legend li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(182, 210, 230, .22); font-size: 14px; color: var(--lake-100); }
.legend li[hidden] { display: none; }
.legend .sw { width: 22px; display: flex; justify-content: center; flex: none; }
.legend .name { flex: 1; }
.legend .dl-chip { min-width: 78px; justify-content: center; }
.legend .dl-chip.on { background: var(--success-soft); color: var(--success); border-color: #b9d9c6; }
.sw i { display: block; }
.sw .sand { width: 9px; height: 9px; background: var(--sand-400); transform: rotate(18deg); }
.sw .chem { width: 5px; height: 5px; border-radius: 50%; background: var(--lake-300); }
.sw .germ { width: 15px; height: 8px; border-radius: 50%; border: 1.5px solid #fff; }
.sw .virus { width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .15); }

.diagram { position: absolute; left: 570px; top: 130px; width: 656px; height: 460px; }
.diagram svg, .diagram canvas { position: absolute; inset: 0; }
.diagram svg .pipe { fill: none; stroke: var(--lake-300); stroke-opacity: .65; stroke-width: 1.5; }
.stg .frame { fill: none; stroke: var(--lake-300); stroke-opacity: .35; stroke-width: 1.5; stroke-dasharray: 5 5; transition: stroke .5s, stroke-opacity .5s; }
.stg { opacity: .45; transition: opacity .5s; }
.stg.on { opacity: .85; }
.stg.on .frame { stroke-opacity: .7; stroke-dasharray: none; }
.stg.active { opacity: 1; }
.stg.active .frame { stroke: var(--sand-500); stroke-opacity: 1; stroke-width: 2; stroke-dasharray: none; }
.tag text { fill: var(--lake-300); transition: fill .4s; }
.tag .num { font: 500 30px var(--font-serif); }
.tag .lab { font: 500 11px var(--font-sans); letter-spacing: .28em; }
.tag.active text, .tag.on text { fill: #fff; }
.tag.active .num { fill: var(--sand-400); }
#svg .lab { font: 500 11px var(--font-sans); letter-spacing: .28em; fill: var(--lake-300); }

.callout { position: absolute; left: 300px; top: 6px; width: 350px; padding-left: 14px; border-left: 1px solid var(--sand-500); opacity: 0; transform: translateY(8px); transition: opacity .6s .3s, transform .6s .3s; pointer-events: none; }
.callout p { font-family: var(--font-serif); font-size: 18px; line-height: 1.3; color: #fff; margin-top: 6px; }
.callout.show { opacity: 1; transform: none; }

.controls { position: absolute; left: 64px; right: 64px; bottom: 44px; display: flex; align-items: flex-end; gap: 24px; }
.controls .dots { margin-left: auto; margin-right: 8px; margin-bottom: 18px; display: flex; gap: 10px; order: 2; }
.next-wrap { order: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.controls #next { min-width: 168px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--lake-300); transition: background-color .3s, border-color .3s; }
.dots i.on { background: var(--sand-500); border-color: var(--sand-500); }

/* sound and captions */
.top-right { display: flex; align-items: center; gap: 18px; }
.captions { position: absolute; left: 570px; top: 532px; width: 656px; margin: 0; font-size: 17px; line-height: 1.45; color: #fff; text-align: center; }
.captions[hidden] { display: none; }
@keyframes frame-pulse { 0% { stroke-width: 2; } 40% { stroke-width: 5; } 100% { stroke-width: 2; } }
.stg.pulse .frame { stroke: var(--sand-400); stroke-opacity: 1; stroke-dasharray: none; animation: frame-pulse 1.1s var(--ease); }
.stg.pulse { opacity: 1; }
.legend li { transition: background-color .4s; }
.legend li.pulse { background: rgba(179, 152, 104, .16); }
