body {
    font-family: sans-serif;
    background-color: #050510;
    color: #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 60px 20px 20px 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

/* --- Listen-first landing --- */
.listen-landing {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.listen-tagline {
    font-size: 1.05em;
    color: #9ab;
    text-align: center;
    max-width: 620px;
    margin: 0 auto 28px;
    line-height: 1.55;
}

.media-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.listen-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 8px 0 20px;
}

.site-links {
    margin: 0 0 40px;
    text-align: center;
}

.site-link {
    color: #9cf;
    text-decoration: none;
    font-size: 0.95em;
    border-bottom: 1px solid rgba(153, 204, 255, 0.35);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.site-link:hover {
    color: #cef;
    border-bottom-color: #cef;
}

.primary-cta,
.secondary-cta {
    border-radius: 999px;
    padding: 12px 24px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-cta {
    background: linear-gradient(135deg, #2a4365, #3182ce);
    color: #fff;
    border-color: #4299e1;
    box-shadow: 0 4px 16px rgba(66, 153, 225, 0.35);
}

.primary-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(66, 153, 225, 0.45);
}

.secondary-cta {
    background: transparent;
    color: #9cf;
    border-color: #579;
}

.secondary-cta:hover {
    background: rgba(100, 150, 200, 0.12);
    transform: translateY(-1px);
}

/* --- Score download modal --- */
.score-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.score-modal[hidden] {
    display: none !important;
}

.score-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
}

.score-modal__panel {
    position: relative;
    width: min(520px, 100%);
    max-height: min(90dvh, 640px);
    display: flex;
    flex-direction: column;
    background: rgba(8, 8, 20, 0.98);
    border: 1px solid #3a5a80;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.score-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1a2a40, #243650);
    border-bottom: 1px solid #2a3a55;
}

.score-modal__title {
    margin: 0;
    font-size: 1.05em;
    font-weight: 600;
    color: #aaccff;
}

.score-modal__close {
    background: rgba(16, 16, 24, 0.9);
    border: 1px solid #579;
    color: #9cf;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    flex-shrink: 0;
}

.score-modal__close:hover {
    background: rgba(100, 150, 200, 0.2);
}

.score-modal__body {
    overflow-y: auto;
    padding: 18px 20px 8px;
    -webkit-overflow-scrolling: touch;
}

.score-modal__note-title {
    margin: 0 0 10px;
    font-size: 0.95em;
    font-weight: 600;
    color: #9cf;
}

.score-modal__note {
    margin: 0;
    line-height: 1.6;
    color: #ccc;
    font-size: 0.92em;
}

.score-modal__note a {
    color: #9cf;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.score-modal__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 16px 16px;
    border-top: 1px solid #2a3a55;
}

.score-modal__download {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- Floating panels (program notes, listening guide) --- */
.floating-panels {
    position: fixed;
    inset: 0;
    z-index: 1050;
    pointer-events: none;
}

.float-panel {
    position: fixed;
    pointer-events: auto;
    width: min(340px, calc(100vw - 24px));
    height: min(420px, 45dvh);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    display: flex;
    flex-direction: column;
    background: rgba(8, 8, 20, 0.96);
    border: 1px solid #3a5a80;
    border-radius: 10px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    min-width: 240px;
    min-height: 160px;
}

.float-panel[hidden] {
    display: none !important;
}

.float-panel--notes {
    top: clamp(88px, 14dvh, 120px);
    right: 12px;
}

.float-panel--guide {
    top: clamp(88px, 14dvh, 120px);
    left: 12px;
}

.float-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #1a2a40, #243650);
    border-bottom: 1px solid #2a3a55;
    cursor: grab;
    touch-action: none;
    user-select: none;
    flex-shrink: 0;
}

.float-panel.is-dragging .float-panel__header {
    cursor: grabbing;
}

.float-panel__title {
    font-size: 0.95em;
    font-weight: 600;
    color: #aaccff;
    margin: 0;
}

.float-panel__close {
    background: rgba(16, 16, 24, 0.9);
    border: 1px solid #579;
    color: #9cf;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    flex-shrink: 0;
}

.float-panel__close:hover {
    background: rgba(100, 150, 200, 0.2);
}

.float-panel__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px 16px;
    -webkit-overflow-scrolling: touch;
    font-size: 0.9em;
}

.float-panel__resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    touch-action: none;
    user-select: none;
    z-index: 2;
    border-bottom-right-radius: 10px;
    background:
        linear-gradient(135deg, transparent 0 42%, rgba(120, 160, 220, 0.35) 42% 48%, transparent 48% 58%, rgba(120, 160, 220, 0.55) 58% 64%, transparent 64%);
}

.float-panel__resize:hover,
.float-panel.is-resizing .float-panel__resize {
    background:
        linear-gradient(135deg, transparent 0 42%, rgba(150, 190, 255, 0.5) 42% 48%, transparent 48% 58%, rgba(150, 190, 255, 0.75) 58% 64%, transparent 64%);
}

.float-panel.is-resizing {
    user-select: none;
}

.float-panel__body p,
.float-panel__body li {
    line-height: 1.55;
    color: #ccc;
}

.float-panel__body ul {
    padding-left: 1.2em;
    margin: 0.5em 0;
}

.float-panel__body .program-notes-image {
    max-width: 100%;
    height: auto;
}

/* --- Guided experience --- */
.guided-experience {
    position: fixed;
    inset: 0;
    z-index: 920;
    display: flex;
    flex-direction: column;
    background: transparent;
    pointer-events: none;
    padding: 0;
    box-sizing: border-box;
}

.guided-chrome {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 72px 16px 12px;
    background: linear-gradient(to bottom, #050510 85%, transparent);
    pointer-events: auto;
    flex-shrink: 0;
}

.guided-chrome-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.guided-chrome-center {
    text-align: center;
    min-width: 0;
}

.guided-chapter-title {
    margin: 0 0 10px;
    font-size: 1rem;
    color: #aaccff;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guided-steps {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.guided-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #579;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.guided-step-dot.is-complete {
    background: #3182ce;
}

.guided-step-dot.is-active {
    background: #4ecdc4;
    transform: scale(1.2);
    border-color: #4ecdc4;
}

.guided-exit-btn {
    background: linear-gradient(135deg, #2a4365, #3182ce);
    border: 1px solid #4299e1;
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(66, 153, 225, 0.35);
}

.guided-exit-btn:hover {
    background: linear-gradient(135deg, #3182ce, #4299e1);
    transform: translateY(-1px);
}

.guided-mini-player {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 6px 12px;
    background: rgba(16, 16, 28, 0.92);
    border: 1px solid #334860;
    border-radius: 999px;
    box-sizing: border-box;
}

.guided-mini-player__label {
    font-size: 0.75em;
    color: #8ab;
    white-space: nowrap;
    flex-shrink: 0;
}

.guided-audio-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #579;
    background: rgba(40, 80, 120, 0.6);
    color: #eef;
    cursor: pointer;
    font-size: 0.85em;
    flex-shrink: 0;
}

.guided-audio-btn.is-playing {
    background: rgba(66, 153, 225, 0.5);
    border-color: #4299e1;
}

.guided-audio-progress {
    flex: 1;
    min-width: 60px;
    accent-color: #4299e1;
}

.guided-audio-time {
    font-size: 0.75em;
    color: #8ab;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

.guided-step-label {
    font-size: 0.8em;
    color: #8ab;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    background: rgba(16, 16, 24, 0.9);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #333348;
}

.guided-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    position: relative;
    pointer-events: none;
}

body.mode-guided .guided-experience--viz .guided-stage {
    pointer-events: none;
    overflow: hidden;
}

.guided-panel {
    display: none;
    width: 90%;
    max-width: 640px;
    text-align: center;
    padding: 20px;
}

.guided-panel.is-active {
    display: block;
    background: rgba(5, 5, 16, 0.94);
    border: 1px solid #2a2a40;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}

.guided-panel-title {
    font-size: 1.5em;
    color: #aaccff;
    margin: 0 0 16px;
}

.guided-panel-caption {
    font-size: 1em;
    color: #aab;
    line-height: 1.6;
    margin: 0 0 20px;
}

.guided-start-btn {
    margin-top: 8px;
}

.guided-complete-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
}

.guided-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 12px 16px 20px;
    background: linear-gradient(to top, #050510 75%, transparent);
    pointer-events: auto;
}

.guided-hint {
    font-size: 0.82em;
    color: #7a9ab8;
    font-style: italic;
    margin: 0 0 12px;
}

.guided-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.guided-nav-btn {
    min-width: 130px;
    padding: 12px 24px;
    border-radius: 999px;
    border: 1px solid #579;
    background: rgba(16, 16, 24, 0.9);
    color: #9cf;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
}

.guided-nav-btn:hover {
    background: rgba(100, 150, 200, 0.15);
}

.guided-nav-btn--primary {
    background: linear-gradient(135deg, #2a4365, #3182ce);
    color: #fff;
    border-color: #4299e1;
}

.guided-nav-btn--primary:hover {
    background: linear-gradient(135deg, #3182ce, #4299e1);
}

.guided-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* --- Deep dive / free explore --- */
.deep-dive {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.explore-return {
    margin: 20px 0 40px;
}

.experience-demos {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.experience-demos-heading {
    font-size: 1.5em;
    color: #9acfff;
    margin: 20px 0 8px;
}

.experience-demos-intro {
    max-width: 620px;
    margin-bottom: 32px;
}

.demo-guided-caption {
    display: none;
    font-size: 0.95em;
    color: #bcd;
    text-align: center;
    max-width: 560px;
    margin: 0 auto 12px;
    line-height: 1.5;
}

/* --- Site modes --- */
body.mode-listen #guided-experience,
body.mode-listen #experience-demos {
    display: none !important;
}

body.mode-guided {
    padding: 0;
    overflow: hidden;
    --guided-header-offset: clamp(168px, 26dvh, 210px);
    --guided-footer-offset: clamp(118px, 17dvh, 142px);
}

body.mode-guided #listen-landing {
    display: none !important;
}

body.mode-guided .home-button {
    display: none !important;
}

body.mode-guided #guided-experience {
    display: flex !important;
}

body.mode-guided #experience-demos {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 870;
    pointer-events: none;
}

body.mode-guided #experience-demos .demo-container {
    display: none;
    position: fixed;
    top: var(--guided-header-offset);
    bottom: var(--guided-footer-offset);
    left: 0;
    right: 0;
    z-index: 871;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 8px 20px 12px;
    box-sizing: border-box;
    pointer-events: auto;
    align-items: center;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.mode-guided #experience-demos .demo-container.guided-active {
    display: flex;
    flex-direction: column;
}

body.mode-guided #experience-demos .demo-container.guided-active > * {
    flex: 0 0 auto;
    flex-shrink: 0;
}

body.mode-guided #experience-demos .demo-container .demo-title {
    display: block;
    width: 100%;
    max-width: 720px;
    text-align: center;
    font-size: 1.35em;
    margin: 0 0 12px;
}

body.mode-guided #experience-demos .demo-container .demo-description {
    display: block;
    width: 100%;
    max-width: 720px;
    margin: 0 auto 20px;
    text-align: left;
}

body.mode-guided #experience-demos .demo-container .demo-description p {
    max-width: none;
}

body.mode-guided #experience-demos .demo-container .visualization-container,
body.mode-guided #experience-demos .demo-container .three-js-container {
    --viz-side: max(240px, min(
        94vw,
        calc(100dvh - var(--guided-header-offset) - var(--guided-footer-offset) - 28px),
        calc(100dvw - 24px)
    ));
    width: var(--viz-side) !important;
    height: var(--viz-side) !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: 1 / 1;
    margin: 0 auto 12px;
    flex-shrink: 0;
}

body.mode-guided #experience-demos #visualization-container-epr {
    height: var(--viz-side) !important;
    margin-top: 0;
}

body.present-mode #experience-demos {
    display: block !important;
}

.home-button {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 1001;
    background: linear-gradient(45deg, #3498db, #2ecc71);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.45);
}

h1 {
    font-size: clamp(1.25rem, 4.5vw, 1.8em);
    color: #aaccff;
    text-align: center;
    margin-bottom: 5px;
    padding: 0 8px;
}

h2 {
    font-size: 1.3em;
    color: #8ac;
    margin-top: 30px;
    margin-bottom: 5px;
    text-align: center;
}

h3 {
    font-size: 1.4em;
    color: #9acfff;
    text-align: center;
    margin-top: 0;
    margin-bottom: 0;
}

h4 {
    color: #8ac;
    margin-top: 5px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

p {
    font-size: 0.9em;
    color: #aaa;
    text-align: center;
    max-width: 600px;
    margin-bottom: 15px;
    line-height: 1.5;
}

body > p {
    margin-bottom: 25px;
}

.subtitle {
    font-size: 0.95em;
    color: #8ab;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 28px;
    line-height: 1.5;
}

.subtitle a {
    color: #9cf;
}

.intro-copy {
    width: 90%;
    max-width: 700px;
    margin-bottom: 10px;
}

.intro-copy p {
    max-width: none;
    text-align: left;
}

.section-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
}

.section-heading--sub {
    justify-content: flex-start;
}

.section-heading-text {
    line-height: 1.3;
}

.audio-player-heading {
    margin-bottom: 4px;
}

.audio-player-container {
    width: 90%;
    max-width: 700px;
    margin-bottom: 40px;
    padding: 18px 20px 20px;
    background-color: #101018;
    border-radius: 8px;
    border: 1px solid #2a2a40;
    box-shadow: 0 0 15px rgba(80, 100, 180, 0.15);
    text-align: center;
}

.audio-player-container h3 {
    margin-bottom: 0;
}

.audio-player-subtitle {
    font-size: 0.85em;
    color: #8ab;
    margin: 0 auto 16px !important;
    font-style: italic;
    max-width: none;
    text-align: center;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.audio-play-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #579;
    background: linear-gradient(135deg, #2a4365, #3182ce);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.25);
}

.audio-play-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(66, 153, 225, 0.35);
}

.audio-play-btn.is-playing {
    background: linear-gradient(135deg, #3182ce, #4299e1);
}

.audio-controls {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.audio-time {
    flex: 0 0 auto;
    font-size: 0.8em;
    color: #9cf;
    font-variant-numeric: tabular-nums;
    min-width: 2.8em;
}

.audio-progress {
    flex: 1;
    width: 100%;
    height: 6px;
    accent-color: #4299e1;
    cursor: pointer;
}

.video-player-heading {
    margin-bottom: 4px;
}

.video-player-container {
    width: 90%;
    max-width: 700px;
    margin-bottom: 40px;
    padding: 18px 20px 20px;
    background-color: #101018;
    border-radius: 8px;
    border: 1px solid #2a2a40;
    box-shadow: 0 0 15px rgba(80, 100, 180, 0.15);
    text-align: center;
}

.video-player-container h3 {
    margin-bottom: 0;
}

.video-player-subtitle {
    font-size: 0.85em;
    color: #8ab;
    margin: 0 auto 16px !important;
    font-style: italic;
    max-width: none;
    text-align: center;
}

.video-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 6px;
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.explanation-container {
    width: 90%;
    max-width: 700px;
    margin-bottom: 40px;
    padding: 15px 20px;
    background-color: #101018;
    border-radius: 8px;
    border: 1px solid #2a2a40;
    box-shadow: 0 0 15px rgba(80, 100, 180, 0.15);
    text-align: center;
}

.explanation-container .toggle-button {
    margin-left: 0;
    flex: 0 0 auto;
}

.explanation-container p {
    text-align: left;
    margin-bottom: 10px;
    max-width: none;
}

.explanation-container ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0;
    text-align: left;
}

.explanation-container li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    color: #bbb;
    line-height: 1.5;
}

.explanation-container li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #79c;
    font-size: 1.2em;
    line-height: 1;
}

.explanation-container li strong {
    color: #cce;
}

.explanation-container .sub-explanation-section {
    margin-top: 15px;
    text-align: left;
    background-color: #181822;
    border: 1px solid #333348;
    border-radius: 5px;
    padding: 10px 15px;
}

.explanation-container .sub-explanation-section h4 {
    margin: 0;
    padding: 0;
    color: #9acfff;
    font-weight: bold;
}

.explanation-container .sub-explanation-section .toggle-button {
    margin-left: 0;
}

.toggle-button {
    background: none;
    border: 1px solid #579;
    color: #9cf;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    margin-left: 8px;
    vertical-align: middle;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.toggle-button:hover {
    background-color: rgba(100, 150, 200, 0.2);
    color: #adf;
}

.toggle-button:active {
    background-color: rgba(100, 150, 200, 0.4); 
}

.collapsible-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.4s ease-out, margin-top 0.5s ease-out, padding 0.5s ease-out;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

.collapsible-content.expanded {
    max-height: 2000px; 
    opacity: 1;
    margin-top: 15px;
    padding-top: 10px;
    padding-bottom: 10px;
    overflow: visible; 
}

.sub-explanation-section .collapsible-content.expanded {
    max-height: 2500px; 
}

#epr-paradox-content.expanded {
    max-height: 3000px; 
}

#key-concepts-content.expanded {
    max-height: 3000px; 
}

.demo-container {
    width: 90%;
    max-width: 700px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.demo-title {
    width: 100%;
    text-align: center;
}

.demo-description p {
    font-size: 0.9em;
    color: #aaa;
    text-align: left;
    max-width: 600px;
    margin-bottom: 8px;
    margin-top: 0;
    line-height: 1.5;
}

.demo-description p:last-child {
    margin-bottom: 15px;
}

.demo-description p.directions {
    color: #bee;
    font-style: italic;
}

.demo-description p strong {
    color: #ccc;
    font-weight: 600;
}

.demo-description {
    width: 100%;
    max-width: 600px;
    margin-bottom: 10px;
}

.visualization-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background-color: #101020;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(100, 150, 255, 0.2);
    touch-action: none;
    position: relative;
    overflow: hidden;
}

.three-js-container {
    height: 400px;
    overflow: hidden;
}

.three-js-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
}

#visualization-container-epr {
    height: 400px; 
    margin-top: 15px; 
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.epr-controls {
    position: absolute; 
    bottom: 20px; 
    left: 50%; 
    transform: translateX(-50%); 
    z-index: 10; 
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

body.mode-guided.guided-chapter-epr .epr-controls {
    position: fixed;
    bottom: calc(var(--guided-footer-offset) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 930;
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100vw - 24px);
}

body.mode-guided.guided-chapter-epr .epr-button {
    pointer-events: auto;
}

.epr-button {
    background-color: rgba(40, 80, 120, 0.7); 
    color: #eef; 
    border: 1px solid #79c; 
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease; 
}

.epr-button:hover {
    background-color: rgba(60, 100, 160, 0.8);
}

.epr-button:active {
    transform: translateX(-50%) scale(0.95); 
}

.epr-info {
    position: absolute; 
    top: 10px;
    left: 10px;
    right: 10px;
    background-color: rgba(0, 10, 30, 0.85); 
    color: #eef;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
    text-align: center;
    border: 1px solid rgba(120, 160, 220, 0.35);
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.epr-info--measured {
    background-color: rgba(20, 40, 80, 0.92);
    border-color: #ffd700;
    color: #fff8dc;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.35);
}

.demo-caption {
    font-size: 0.85em;
    color: #adf;
    font-style: italic;
    margin-top: 5px;
    text-align: center;
}

.demo-description img {
    display: block; 
    margin: 10px auto; 
    max-width: 100%; 
    height: auto; 
    border: 1px solid #444; 
    border-radius: 5px;
}

#language-toggle-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.language-toggle-btn {
    background: linear-gradient(135deg, #2a4365, #3182ce);
    border: 2px solid #4299e1;
    border-radius: 25px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.language-toggle-btn:hover {
    background: linear-gradient(135deg, #3182ce, #4299e1);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(66, 153, 225, 0.4);
}

.language-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.3);
}

.flag-icon {
    font-size: 18px;
    line-height: 1;
}

.language-text {
    font-family: inherit;
    font-size: 14px;
    white-space: nowrap;
}

.program-notes-image-container {
    margin: 20px 0;
    text-align: center;
}

.program-notes-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #444;
    box-shadow: 0 4px 12px rgba(100, 150, 255, 0.1);
    opacity: 1.0;
    max-height: 600px;
}

.program-notes-title {
    display: block;
    text-align: center;
    margin: 16px 0 12px;
    line-height: 1.35;
}

/* @tweakable responsive adjustments for translation button on smaller screens */
@media (max-width: 768px) {
    body {
        padding-top: 80px;
    }
    
    #language-toggle-container {
        top: 15px;
        left: 15px;
    }

    .home-button {
        top: 15px;
        right: 15px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .language-toggle-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .audio-player {
        flex-direction: column;
        align-items: stretch;
    }

    .audio-play-btn {
        align-self: center;
    }

    body.mode-guided {
        --guided-header-offset: clamp(158px, 28dvh, 200px);
        --guided-footer-offset: clamp(112px, 18dvh, 136px);
    }

    body.mode-guided #experience-demos .demo-container {
        padding: 6px 12px 10px;
    }

    body.mode-guided #experience-demos .demo-container .visualization-container,
    body.mode-guided #experience-demos .demo-container .three-js-container {
        --viz-side: max(220px, min(
            96vw,
            calc(100dvh - var(--guided-header-offset) - var(--guided-footer-offset) - 20px),
            calc(100dvw - 16px)
        ));
    }

    .float-panel {
        width: min(320px, calc(100vw - 20px));
        max-height: min(360px, 40dvh);
    }

    .float-panel--notes {
        top: auto;
        bottom: 12px;
        right: 10px;
        left: auto;
    }

    .float-panel--guide {
        top: auto;
        bottom: 12px;
        left: 10px;
        right: auto;
    }

    .guided-chrome {
        padding-top: clamp(64px, 12dvh, 72px);
    }

    .listen-actions {
        flex-direction: column;
        align-items: stretch;
        width: 90%;
        max-width: 320px;
    }
}

/* @tweakable additional spacing for very small screens */
@media (max-width: 480px) {
    body {
        padding-top: 90px;
    }
    
    h1 {
        margin-top: 10px;
    }
}

/* Presentation / video capture mode */
body.present-mode {
    padding: 0;
    min-height: 100vh;
    overflow: hidden;
}

body.present-mode .home-button,
body.present-mode .listen-landing,
body.present-mode .guided-experience,
body.present-mode .audio-player-container,
body.present-mode .video-player-container,
body.present-mode .intro-copy,
body.present-mode > h1,
body.present-mode > .subtitle,
body.present-mode .explanation-container,
body.present-mode .epr-controls,
body.present-mode .epr-info {
    display: none !important;
}

body.present-mode .demo-container {
    display: none !important;
    width: 100vw;
    max-width: none;
    height: 100vh;
    margin: 0;
    padding: 0;
}

body.present-mode .demo-container.present-active {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

body.present-mode .demo-container.present-active .demo-description {
    display: none !important;
}

body.present-mode .demo-container.present-active .visualization-container,
body.present-mode #epr-present-wrap .visualization-container {
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    border-radius: 0;
    box-shadow: none;
}

body.present-mode #epr-present-wrap {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    background: #050510;
}

/* Transparent overlay capture (ProRes alpha export) */
html.overlay-mode,
body.overlay-mode {
    background: transparent !important;
    background-color: transparent !important;
}

body.overlay-mode .visualization-container {
    background: transparent !important;
    background-color: transparent !important;
}

body.overlay-mode .demo-container.present-active .visualization-container,
body.overlay-mode #epr-present-wrap .visualization-container {
    width: 1920px !important;
    height: 1080px !important;
}

html.overlay-capture,
body.present-mode.overlay-capture {
    background: transparent !important;
    background-color: transparent !important;
}

body.present-mode.overlay-capture #epr-present-wrap,
body.present-mode.overlay-capture .demo-container.present-active,
body.present-mode.overlay-capture .demo-container.present-active .visualization-container,
body.present-mode.overlay-capture #epr-present-wrap .visualization-container {
    background: transparent !important;
    background-color: transparent !important;
}
