.atlas-musical {
  --am-bg: #f4f1ea;
  --am-surface: #fffdf8;
  --am-surface-2: #ebe7de;
  --am-ink: #171814;
  --am-muted: #686a62;
  --am-line: rgba(23, 24, 20, .13);
  --am-line-strong: rgba(23, 24, 20, .25);
  --am-accent: #ad2f4f;
  --am-accent-2: #df9b41;
  --am-teal: #176d68;
  --am-blue: #335f8d;
  --am-purple: #73538d;
  --am-shadow: 0 18px 60px rgba(39, 33, 20, .12);
  --am-radius: 22px;
  --am-radius-sm: 13px;
  color: var(--am-ink);
  background: var(--am-bg);
  border: 1px solid var(--am-line);
  border-radius: 28px;
  box-shadow: var(--am-shadow);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  margin: 28px auto;
  max-width: 1540px;
  min-height: 760px;
  overflow: hidden;
  position: relative;
  text-align: left;
}

.atlas-musical[data-am-theme="dark"] {
  --am-bg: #11120f;
  --am-surface: #191b17;
  --am-surface-2: #242620;
  --am-ink: #f4f0e7;
  --am-muted: #aaa99f;
  --am-line: rgba(245, 240, 230, .13);
  --am-line-strong: rgba(245, 240, 230, .26);
  --am-accent: #e45d7c;
  --am-accent-2: #f3b865;
  --am-teal: #59b9af;
  --am-blue: #78a7d4;
  --am-purple: #b394ca;
  --am-shadow: 0 18px 70px rgba(0, 0, 0, .4);
}

.atlas-musical *, .atlas-musical *::before, .atlas-musical *::after { box-sizing: border-box; }
.atlas-musical button, .atlas-musical input, .atlas-musical select, .atlas-musical audio { font: inherit; }
.atlas-musical button { color: inherit; }
.atlas-musical a { color: var(--am-accent); }
.atlas-musical h1, .atlas-musical h2, .atlas-musical h3, .atlas-musical p { margin-top: 0; }
.atlas-musical h1, .atlas-musical h2, .atlas-musical h3 { color: var(--am-ink); font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; line-height: 1.05; }
.atlas-musical h1 { font-size: clamp(2.5rem, 5.2vw, 5.8rem); }
.atlas-musical h2 { font-size: clamp(2rem, 3.4vw, 3.5rem); }
.atlas-musical h3 { font-size: 1.45rem; }
.atlas-musical :focus-visible { outline: 3px solid color-mix(in srgb, var(--am-accent) 75%, white); outline-offset: 3px; }
.atlas-musical .screen-reader-text { clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute !important; width: 1px; word-wrap: normal !important; }
.am-no-scroll { overflow: hidden !important; }

.am-skip-link { background: var(--am-ink); color: var(--am-bg) !important; left: 18px; padding: 10px 15px; position: absolute; top: -100px; z-index: 100000; }
.am-skip-link:focus { top: 12px; }

.am-topbar {
  align-items: center;
  background: color-mix(in srgb, var(--am-surface) 92%, transparent);
  border-bottom: 1px solid var(--am-line);
  display: grid;
  gap: 26px;
  grid-template-columns: auto minmax(280px, 660px) auto;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 52px);
  position: relative;
  z-index: 10;
}

.am-brand { align-items: center; display: flex; gap: 12px; min-width: max-content; }
.am-brand-mark { align-items: center; background: var(--am-ink); border-radius: 50%; color: var(--am-bg); display: flex; height: 43px; justify-content: center; width: 43px; }
.am-brand-mark svg { fill: currentColor; height: 30px; width: 30px; }
.am-brand strong, .am-brand small { display: block; }
.am-brand strong { font-family: Georgia, serif; font-size: 1.13rem; line-height: 1; }
.am-brand small { color: var(--am-muted); font-size: .69rem; letter-spacing: .08em; margin-top: 4px; text-transform: uppercase; }

.am-search-wrap { align-items: center; background: var(--am-surface-2); border: 1px solid transparent; border-radius: 999px; display: grid; grid-template-columns: 23px 1fr auto; padding: 2px 13px 2px 16px; transition: .2s ease; }
.am-search-wrap:focus-within { background: var(--am-surface); border-color: var(--am-line-strong); box-shadow: 0 0 0 4px color-mix(in srgb, var(--am-accent) 11%, transparent); }
.am-search-wrap svg { fill: none; height: 20px; stroke: var(--am-muted); stroke-linecap: round; stroke-width: 1.8; width: 20px; }
.am-search-wrap input { background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--am-ink) !important; min-width: 0; outline: 0 !important; padding: 10px 12px !important; width: 100%; }
.am-search-wrap input::placeholder { color: var(--am-muted); opacity: .84; }
.am-search-wrap kbd { background: var(--am-surface); border: 1px solid var(--am-line); border-radius: 6px; color: var(--am-muted); font-size: .72rem; line-height: 1; padding: 5px 8px; }
.am-actions { display: flex; gap: 8px; }
.am-icon-button { align-items: center; background: transparent; border: 1px solid var(--am-line); border-radius: 50%; cursor: pointer; display: inline-flex; height: 42px; justify-content: center; padding: 0; transition: .2s ease; width: 42px; }
.am-icon-button:hover, .am-icon-button.is-active { background: var(--am-ink); border-color: var(--am-ink); color: var(--am-bg); transform: translateY(-1px); }
.am-icon-button svg { fill: none; height: 20px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 20px; }

.am-primary-nav { align-items: stretch; background: var(--am-surface); border-bottom: 1px solid var(--am-line); display: flex; gap: 2px; overflow-x: auto; padding: 0 clamp(12px, 4vw, 52px); scrollbar-width: thin; }
.am-primary-nav button { align-items: center; background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--am-muted); cursor: pointer; display: inline-flex; flex: 0 0 auto; font-size: .84rem; font-weight: 700; gap: 7px; letter-spacing: .015em; padding: 16px 14px 14px; }
.am-primary-nav button:hover { color: var(--am-ink); }
.am-primary-nav button.is-active { border-bottom-color: var(--am-accent); color: var(--am-ink); }
.am-primary-nav button > span:first-child { font-size: 1rem; }
.am-count-badge { align-items: center; background: var(--am-surface-2); border-radius: 999px; display: inline-flex; font-size: .68rem !important; height: 21px; justify-content: center; min-width: 21px; padding: 0 5px; }

.am-main { min-height: 680px; outline: none; padding: clamp(30px, 5vw, 72px) clamp(18px, 5vw, 72px) 80px; }
.am-footer { align-items: center; background: var(--am-surface); border-top: 1px solid var(--am-line); color: var(--am-muted); display: flex; font-size: .76rem; gap: 30px; justify-content: space-between; padding: 24px clamp(18px, 5vw, 72px); }
.am-footer p { margin: 0; }

.am-loading { align-items: center; display: flex; flex-direction: column; justify-content: center; min-height: 520px; text-align: center; }
.am-loader { height: 80px; position: relative; width: 80px; }
.am-loader span { animation: am-pulse 1.5s ease-in-out infinite; background: var(--am-accent); border-radius: 50%; height: 11px; left: 35px; position: absolute; top: 35px; transform-origin: 5px 5px; width: 11px; }
.am-loader span:nth-child(1) { transform: translateY(-28px); }
.am-loader span:nth-child(2) { animation-delay: .15s; transform: translateX(28px); }
.am-loader span:nth-child(3) { animation-delay: .3s; transform: translateY(28px); }
.am-loader span:nth-child(4) { animation-delay: .45s; transform: translateX(-28px); }
@keyframes am-pulse { 0%,100% { opacity: .22; } 50% { opacity: 1; transform: scale(1.35); } }

.am-eyebrow { color: var(--am-accent); display: block; font-size: .71rem; font-weight: 800; letter-spacing: .15em; margin-bottom: 12px; text-transform: uppercase; }
.am-button { align-items: center; border: 1px solid var(--am-line-strong); border-radius: 999px; cursor: pointer; display: inline-flex; font-size: .87rem; font-weight: 750; gap: 9px; justify-content: center; padding: 12px 20px; text-decoration: none; transition: .2s ease; }
.am-button:hover { transform: translateY(-2px); }
.am-button-primary { background: var(--am-ink); border-color: var(--am-ink); color: var(--am-bg) !important; }
.am-button-primary:hover { box-shadow: 0 12px 30px color-mix(in srgb, var(--am-ink) 20%, transparent); }
.am-button-ghost { background: transparent; color: var(--am-ink); }
.am-button-ghost:hover { background: var(--am-surface); }
.am-text-button { background: transparent; border: 0; color: var(--am-accent); cursor: pointer; font-size: .82rem; font-weight: 800; padding: 6px 0; }
.am-back-button { background: transparent; border: 0; color: var(--am-muted); cursor: pointer; font-weight: 700; margin-bottom: 28px; padding: 4px 0; }

.am-hero { align-items: center; background: var(--am-surface); border: 1px solid var(--am-line); border-radius: 34px; display: grid; gap: 30px; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); min-height: 520px; overflow: hidden; padding: clamp(32px, 6vw, 82px); position: relative; }
.am-hero::before { background: radial-gradient(circle, color-mix(in srgb, var(--am-accent-2) 30%, transparent), transparent 66%); content: ""; height: 560px; position: absolute; right: -130px; top: -180px; width: 560px; }
.am-hero-copy { max-width: 840px; position: relative; z-index: 2; }
.am-hero h1 { margin-bottom: 24px; }
.am-hero h1 em { color: var(--am-accent); font-weight: normal; }
.am-hero p { color: var(--am-muted); font-size: clamp(1rem, 1.5vw, 1.22rem); max-width: 680px; }
.am-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.am-hero-orbit { aspect-ratio: 1; margin: auto; max-width: 410px; position: relative; width: 100%; z-index: 2; }
.am-orbit { animation: am-rotate 26s linear infinite; border: 1px solid var(--am-line-strong); border-radius: 50%; inset: 4%; position: absolute; }
.am-orbit span { background: var(--am-surface); border: 1px solid var(--am-line); border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 7px 11px; position: absolute; }
.am-orbit span:nth-child(1) { left: 7%; top: 12%; }
.am-orbit span:nth-child(2) { right: -4%; top: 44%; }
.am-orbit span:nth-child(3) { bottom: 4%; left: 35%; }
.am-orbit-two { animation-direction: reverse; animation-duration: 34s; inset: 18%; }
.am-orbit-two span:nth-child(1) { left: -19%; top: 44%; }
.am-orbit-two span:nth-child(2) { right: -8%; top: 7%; }
.am-orbit-two span:nth-child(3) { bottom: -3%; left: 42%; }
.am-orbit-core { align-items: center; background: var(--am-ink); border-radius: 50%; color: var(--am-bg); display: flex; flex-direction: column; height: 42%; inset: 29%; justify-content: center; position: absolute; text-align: center; width: 42%; }
.am-orbit-core strong { font-family: Georgia, serif; font-size: clamp(2.4rem, 5vw, 4.8rem); line-height: .85; }
.am-orbit-core small { font-size: .63rem; letter-spacing: .08em; margin-top: 10px; text-transform: uppercase; }
@keyframes am-rotate { to { transform: rotate(360deg); } }

.am-stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 18px 0 72px; }
.am-stat-card { background: transparent; border: 1px solid var(--am-line); border-radius: var(--am-radius-sm); cursor: pointer; display: grid; grid-template-columns: auto 1fr; min-height: 154px; padding: 18px; text-align: left; transition: .22s ease; }
.am-stat-card:hover { background: var(--am-surface); box-shadow: 0 10px 28px rgba(20,20,12,.07); transform: translateY(-3px); }
.am-stat-icon { align-items: center; border-radius: 50%; display: inline-flex; font-family: Georgia, serif; height: 34px; justify-content: center; width: 34px; }
.am-stat-card strong { align-self: center; font-family: Georgia, serif; font-size: 2rem; justify-self: end; }
.am-stat-card > span:nth-of-type(2) { font-size: .85rem; font-weight: 800; grid-column: 1 / -1; margin-top: 20px; }
.am-stat-card small { color: var(--am-muted); font-size: .68rem; grid-column: 1 / -1; line-height: 1.35; margin-top: 3px; }

.am-type-composer, .am-type-bg-composer { --type: #9e3656; }
.am-type-work, .am-type-bg-work { --type: #b97828; }
.am-type-instrument, .am-type-bg-instrument { --type: #26756e; }
.am-type-tradition, .am-type-bg-tradition { --type: #3c6590; }
.am-type-concept, .am-type-bg-concept { --type: #72548f; }
.am-type-event, .am-type-bg-event { --type: #73705c; }
.am-stat-icon { background: color-mix(in srgb, var(--type) 14%, transparent); color: var(--type); }

.am-section { margin-top: 72px; }
.am-section-heading { align-items: end; display: flex; gap: 30px; justify-content: space-between; margin-bottom: 26px; }
.am-section-heading h2 { font-size: clamp(2rem, 3.4vw, 3.4rem); margin-bottom: 0; max-width: 820px; }
.am-card-grid { display: grid; gap: 15px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.am-card { background: var(--am-surface); border: 1px solid var(--am-line); border-radius: var(--am-radius); min-width: 0; overflow: hidden; position: relative; transition: .22s ease; }
.am-card:hover { box-shadow: 0 18px 40px rgba(27,25,19,.11); transform: translateY(-4px); }
.am-card-main { background: transparent; border: 0; cursor: pointer; display: block; padding: 0; text-align: left; width: 100%; }
.am-card-visual { background: linear-gradient(145deg, color-mix(in srgb, var(--type) 85%, #111), color-mix(in srgb, var(--type) 45%, var(--am-surface))); display: block; height: 142px; overflow: hidden; position: relative; }
.am-card-visual::before, .am-card-visual::after { border: 1px solid rgba(255,255,255,.24); border-radius: 50%; content: ""; height: 170px; position: absolute; right: -50px; top: -80px; width: 170px; }
.am-card-visual::after { height: 95px; right: 52px; top: 72px; width: 95px; }
.am-card-symbol { bottom: 8px; color: rgba(255,255,255,.9); font-family: Georgia, serif; font-size: 5rem; left: 20px; line-height: 1; position: absolute; text-shadow: 0 8px 30px rgba(0,0,0,.18); }
.am-card-region { background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: white; font-size: .61rem; font-weight: 750; letter-spacing: .06em; padding: 5px 9px; position: absolute; right: 12px; text-transform: uppercase; top: 12px; }
.am-card-body { display: block; min-height: 205px; padding: 18px 18px 20px; }
.am-card-kicker { align-items: center; display: flex; gap: 8px; justify-content: space-between; }
.am-type-pill { background: color-mix(in srgb, var(--type) 13%, transparent); border: 1px solid color-mix(in srgb, var(--type) 20%, transparent); border-radius: 999px; color: var(--type); display: inline-flex; font-size: .61rem; font-weight: 850; letter-spacing: .055em; padding: 4px 8px; text-transform: uppercase; }
.am-card-kicker time { color: var(--am-muted); font-size: .67rem; }
.am-card-body > strong { display: -webkit-box; font-family: Georgia, serif; font-size: 1.25rem; line-height: 1.08; margin-top: 14px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.am-card-body > small { color: var(--am-muted); display: -webkit-box; font-size: .73rem; line-height: 1.45; margin-top: 8px; min-height: 42px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.am-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 15px; }
.am-card-tags span { border: 1px solid var(--am-line); border-radius: 999px; color: var(--am-muted); font-size: .61rem; padding: 3px 7px; }
.am-card-favorite { align-items: center; background: color-mix(in srgb, var(--am-surface) 88%, transparent); border: 1px solid var(--am-line); border-radius: 50%; cursor: pointer; display: flex; height: 34px; justify-content: center; position: absolute; right: 12px; top: 105px; width: 34px; }
.am-card-favorite.is-active { color: var(--am-accent); }
.am-card.is-compact .am-card-visual { height: 105px; }
.am-card.is-compact .am-card-body { min-height: 160px; }
.am-card.is-compact .am-card-favorite { top: 68px; }
.am-card-grid-compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.am-path-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.am-path-card { background: var(--am-surface); border: 1px solid var(--am-line); border-radius: var(--am-radius); cursor: pointer; min-height: 310px; overflow: hidden; padding: 25px; position: relative; text-align: left; transition: .22s ease; }
.am-path-card::after { background: radial-gradient(circle, color-mix(in srgb, var(--path-color, var(--am-accent)) 32%, transparent), transparent 69%); content: ""; height: 330px; position: absolute; right: -140px; top: -140px; width: 330px; }
.am-path-card:hover { border-color: color-mix(in srgb, var(--path-color, var(--am-accent)) 46%, var(--am-line)); transform: translateY(-4px); }
.am-path-1 { --path-color: var(--am-accent); } .am-path-2 { --path-color: var(--am-teal); } .am-path-3 { --path-color: var(--am-blue); } .am-path-4 { --path-color: var(--am-purple); }
.am-path-index { color: var(--path-color); font-family: Georgia, serif; font-size: 2rem; position: relative; z-index: 1; }
.am-path-line { background: var(--am-line); display: block; height: 1px; margin: 25px 0 40px; position: relative; width: 100%; z-index: 1; }
.am-path-line::after { background: var(--path-color); border-radius: 50%; content: ""; height: 9px; left: 24%; position: absolute; top: -4px; width: 9px; }
.am-path-card h3, .am-path-card p, .am-path-card small { position: relative; z-index: 1; }
.am-path-card h3 { margin-bottom: 12px; }
.am-path-card p { color: var(--am-muted); font-size: .76rem; }
.am-path-card small { bottom: 21px; color: var(--path-color); font-size: .67rem; font-weight: 800; left: 25px; position: absolute; text-transform: uppercase; }
.am-path-card small span { font-size: 1rem; margin-left: 8px; }
.am-path-grid-full { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.am-page-header { margin: 0 0 42px; max-width: 1040px; }
.am-page-header h1 { font-size: clamp(2.6rem, 5vw, 5rem); margin-bottom: 20px; }
.am-page-header p { color: var(--am-muted); font-size: 1.02rem; max-width: 780px; }
.am-page-header-row { align-items: end; display: flex; justify-content: space-between; max-width: none; }
.am-inline-filter { color: var(--am-muted); display: grid; font-size: .68rem; font-weight: 800; gap: 6px; min-width: 220px; text-transform: uppercase; }

.am-filter-panel { background: var(--am-surface); border: 1px solid var(--am-line); border-radius: var(--am-radius-sm); display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; padding: 13px; position: sticky; top: 10px; z-index: 5; }
.am-filter-panel label { color: var(--am-muted); display: grid; font-size: .62rem; font-weight: 850; gap: 5px; letter-spacing: .08em; text-transform: uppercase; }
.am-filter-panel select, .am-inline-filter select { appearance: none; background: var(--am-surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; border: 1px solid transparent; border-radius: 9px; color: var(--am-ink); font-size: .78rem; font-weight: 650; outline: none; padding: 10px 34px 10px 11px; text-transform: none; width: 100%; }
.am-filter-panel select:focus, .am-inline-filter select:focus { border-color: var(--am-accent); }
.am-load-more { align-items: center; display: flex; flex-direction: column; gap: 10px; margin: 34px 0; }
.am-load-more small { color: var(--am-muted); }

.am-empty-state, .am-error-state { align-items: center; background: var(--am-surface); border: 1px dashed var(--am-line-strong); border-radius: var(--am-radius); display: flex; flex-direction: column; justify-content: center; min-height: 390px; padding: 40px; text-align: center; }
.am-empty-state > span { color: var(--am-accent); font-family: Georgia, serif; font-size: 4rem; }
.am-empty-state h2 { font-size: 2rem; margin: 10px 0; }
.am-empty-state p { color: var(--am-muted); max-width: 500px; }

.am-timeline-legend { color: var(--am-muted); display: flex; font-size: .71rem; justify-content: space-between; margin-bottom: 20px; }
.am-timeline { border-left: 1px solid var(--am-line-strong); margin-left: 10px; padding-left: 34px; }
.am-timeline-band { border-bottom: 1px solid var(--am-line); padding: 0 0 48px; position: relative; }
.am-timeline-band + .am-timeline-band { padding-top: 50px; }
.am-timeline-band::before { background: var(--am-bg); border: 3px solid var(--am-accent); border-radius: 50%; content: ""; height: 17px; left: -43px; position: absolute; top: 3px; width: 17px; }
.am-timeline-band > header { display: grid; gap: 12px; grid-template-columns: 150px minmax(190px, .55fr) minmax(260px, 1.2fr); margin-bottom: 24px; }
.am-timeline-band > header span { color: var(--am-accent); font-size: .71rem; font-weight: 800; letter-spacing: .08em; padding-top: 7px; text-transform: uppercase; }
.am-timeline-band > header h2 { font-size: 2.1rem; margin: 0; }
.am-timeline-band > header p { color: var(--am-muted); font-size: .78rem; margin: 0; max-width: 630px; }
.am-timeline-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 4px 3px 16px; scroll-snap-type: x proximity; scrollbar-color: var(--am-line-strong) transparent; }
.am-timeline-node { background: var(--am-surface); border: 1px solid var(--am-line); border-top: 4px solid var(--type, var(--am-accent)); border-radius: 10px; cursor: pointer; flex: 0 0 210px; min-height: 150px; padding: 15px; scroll-snap-align: start; text-align: left; transition: .18s ease; }
.am-timeline-node:hover { transform: translateY(-3px); }
.am-type-border-composer { --type: #9e3656; }.am-type-border-work { --type: #b97828; }.am-type-border-instrument { --type: #26756e; }.am-type-border-tradition { --type: #3c6590; }.am-type-border-concept { --type: #72548f; }.am-type-border-event { --type: #73705c; }
.am-timeline-node time { color: var(--type); display: block; font-family: Georgia, serif; font-size: 1.35rem; }
.am-timeline-node strong { display: block; font-size: .81rem; line-height: 1.35; margin-top: 14px; }
.am-timeline-node small { color: var(--am-muted); display: block; font-size: .62rem; margin-top: 9px; }

.am-world-layout { align-items: stretch; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 290px; }
.am-world-map, .am-world-summary { background: var(--am-surface); border: 1px solid var(--am-line); border-radius: var(--am-radius); }
.am-world-map { min-height: 510px; overflow: hidden; padding: 20px; position: relative; }
.am-world-svg { display: block; margin: 10px auto; max-height: 385px; width: 100%; }
.am-world-svg path { cursor: pointer; fill: color-mix(in srgb, var(--am-ink) 12%, transparent); stroke: color-mix(in srgb, var(--am-ink) 35%, transparent); stroke-width: 1.3; transition: .2s ease; }
.am-world-svg path:hover, .am-world-svg path:focus, .am-world-svg path.is-active { fill: color-mix(in srgb, var(--am-accent) 73%, var(--am-surface)); stroke: var(--am-accent); transform: translateY(-3px); }
.am-world-svg .am-map-dots { fill: var(--am-accent-2); }
.am-world-controls { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.am-world-controls button { background: transparent; border: 1px solid var(--am-line); border-radius: 999px; color: var(--am-muted); cursor: pointer; font-size: .66rem; padding: 6px 9px; }
.am-world-controls button.is-active { background: var(--am-ink); color: var(--am-bg); }
.am-world-summary { display: flex; flex-direction: column; justify-content: center; padding: 30px; }
.am-world-summary h2 { font-size: 2.3rem; margin-bottom: 18px; }
.am-world-summary p { color: var(--am-muted); font-size: .78rem; }
.am-world-summary p strong { color: var(--am-accent); font-family: Georgia, serif; font-size: 1.8rem; }
.am-world-mini-stats { border-top: 1px solid var(--am-line); display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-top: 20px; padding-top: 20px; }
.am-world-mini-stats span { color: var(--am-muted); font-size: .6rem; }
.am-world-mini-stats strong { color: var(--am-ink); display: block; font-family: Georgia, serif; font-size: 1.5rem; }

.am-path-hero { background: var(--am-surface); border: 1px solid var(--am-line); border-radius: 30px; margin-bottom: 34px; padding: clamp(35px, 7vw, 95px); position: relative; }
.am-path-hero::after { border: 1px solid var(--am-line); border-radius: 50%; content: ""; height: 260px; position: absolute; right: 5%; top: 13%; width: 260px; }
.am-path-hero h1 { font-size: clamp(3rem, 6vw, 6rem); max-width: 900px; position: relative; z-index: 1; }
.am-path-hero p { color: var(--am-muted); font-size: 1.05rem; max-width: 680px; position: relative; z-index: 1; }
.am-path-steps { counter-reset: steps; list-style: none; margin: 0 auto; max-width: 1050px; padding: 0; }
.am-path-steps li { align-items: stretch; border-bottom: 1px solid var(--am-line); display: grid; grid-template-columns: 70px 1fr; }
.am-step-number { align-items: center; color: var(--am-accent); display: flex; font-family: Georgia, serif; font-size: 1.5rem; justify-content: center; }
.am-path-steps button { align-items: center; background: transparent; border: 0; cursor: pointer; display: grid; gap: 15px; grid-template-columns: 115px minmax(160px, .8fr) minmax(240px, 1.3fr) auto; padding: 26px 10px; text-align: left; width: 100%; }
.am-path-steps button:hover { background: color-mix(in srgb, var(--am-surface) 68%, transparent); }
.am-path-steps button > strong { font-family: Georgia, serif; font-size: 1.15rem; }
.am-path-steps button > small { color: var(--am-muted); font-size: .72rem; }
.am-step-arrow { color: var(--am-accent); font-size: .72rem; font-weight: 800; }
.am-path-tip { background: var(--am-ink); border-radius: var(--am-radius); color: var(--am-bg); margin: 40px auto 0; max-width: 1050px; padding: 28px; }
.am-path-tip p { color: color-mix(in srgb, var(--am-bg) 75%, transparent); margin: 6px 0 0; }

.am-quiz-intro { align-items: center; background: var(--am-surface); border: 1px solid var(--am-line); border-radius: 34px; display: grid; gap: 40px; grid-template-columns: 1fr 350px; min-height: 550px; padding: clamp(35px, 7vw, 90px); }
.am-quiz-intro h1 { max-width: 820px; }
.am-quiz-intro p { color: var(--am-muted); font-size: 1rem; max-width: 620px; }
.am-quiz-disc { align-items: center; aspect-ratio: 1; background: radial-gradient(circle at center, var(--am-ink) 0 17%, transparent 18%), repeating-radial-gradient(circle at center, var(--am-ink) 0 2px, transparent 3px 13px); border-radius: 50%; color: var(--am-bg); display: flex; flex-direction: column; justify-content: center; margin: auto; max-width: 300px; text-align: center; width: 100%; }
.am-quiz-disc span { font-family: Georgia, serif; font-size: 4rem; line-height: .8; }
.am-quiz-disc small { font-size: .64rem; letter-spacing: .1em; margin-top: 10px; text-transform: uppercase; }
.am-quiz-shell { margin: 20px auto; max-width: 940px; }
.am-quiz-progress { background: var(--am-surface-2); border-radius: 999px; height: 6px; overflow: hidden; }
.am-quiz-progress span { background: var(--am-accent); display: block; height: 100%; transition: width .4s ease; }
.am-quiz-meta { color: var(--am-muted); display: flex; font-size: .67rem; justify-content: space-between; margin: 13px 0 55px; text-transform: uppercase; }
.am-quiz-shell h1 { font-size: clamp(2.4rem, 5vw, 4.8rem); margin-bottom: 42px; }
.am-quiz-choices { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.am-quiz-choices button { align-items: center; background: var(--am-surface); border: 1px solid var(--am-line); border-radius: 13px; cursor: pointer; display: flex; gap: 15px; min-height: 70px; padding: 13px 18px; text-align: left; transition: .16s ease; }
.am-quiz-choices button:hover:not(:disabled) { border-color: var(--am-accent); transform: translateY(-2px); }
.am-quiz-choices button span { align-items: center; border: 1px solid var(--am-line); border-radius: 50%; display: inline-flex; flex: 0 0 33px; font-size: .72rem; height: 33px; justify-content: center; }
.am-quiz-choices button.is-correct { background: color-mix(in srgb, var(--am-teal) 14%, var(--am-surface)); border-color: var(--am-teal); }
.am-quiz-choices button.is-wrong { background: color-mix(in srgb, var(--am-accent) 12%, var(--am-surface)); border-color: var(--am-accent); }
.am-quiz-feedback { border-left: 4px solid var(--am-teal); margin-top: 25px; padding: 14px 20px; }
.am-quiz-feedback.is-wrong { border-color: var(--am-accent); }
.am-quiz-feedback p { color: var(--am-muted); margin: 5px 0; }
.am-quiz-next { float: right; margin-top: 25px; }
.am-quiz-result { align-items: center; display: flex; flex-direction: column; min-height: 580px; text-align: center; }
.am-score-ring { align-items: center; background: conic-gradient(var(--am-accent) var(--score), var(--am-surface-2) 0); border-radius: 50%; display: flex; flex-direction: column; height: 220px; justify-content: center; margin: 10px auto 32px; position: relative; width: 220px; }
.am-score-ring::before { background: var(--am-bg); border-radius: 50%; content: ""; inset: 13px; position: absolute; }
.am-score-ring strong, .am-score-ring small { position: relative; }
.am-score-ring strong { font-family: Georgia, serif; font-size: 3.2rem; }
.am-score-ring small { color: var(--am-muted); }
.am-quiz-result h1 { font-size: 3.5rem; }
.am-quiz-result p { color: var(--am-muted); max-width: 580px; }

.am-drawer[hidden] { display: none !important; }
.am-drawer { inset: 0; position: fixed; z-index: 999999; }
.am-drawer-backdrop { animation: am-fade .2s ease both; background: rgba(8, 9, 7, .66); border: 0; inset: 0; position: absolute; width: 100%; }
.am-drawer-panel { animation: am-drawer-in .28s cubic-bezier(.2,.8,.2,1) both; background: var(--am-bg); box-shadow: -20px 0 70px rgba(0,0,0,.25); height: 100%; margin-left: auto; max-width: 950px; overflow-y: auto; position: relative; width: min(950px, 92vw); }
@keyframes am-fade { from { opacity: 0; } }
@keyframes am-drawer-in { from { opacity: 0; transform: translateX(50px); } }
.am-drawer-toolbar { align-items: center; background: color-mix(in srgb, var(--am-surface) 94%, transparent); border-bottom: 1px solid var(--am-line); display: flex; justify-content: space-between; padding: 12px 18px; position: sticky; top: 0; z-index: 5; }
.am-drawer-toolbar > div { align-items: center; color: var(--am-muted); display: flex; font-size: .68rem; gap: 9px; }
.am-drawer-toolbar .am-icon-button { height: 37px; width: 37px; }
.am-drawer-toolbar .am-icon-button span { font-size: 1.6rem; line-height: 1; }
.am-drawer-hero { align-items: end; background: linear-gradient(145deg, color-mix(in srgb, var(--type) 93%, #151515), color-mix(in srgb, var(--type) 48%, #eee)); display: grid; grid-template-columns: minmax(300px, 45%) 1fr; min-height: 390px; overflow: hidden; position: relative; }
.am-drawer-hero::after { border: 1px solid rgba(255,255,255,.25); border-radius: 50%; content: ""; height: 400px; position: absolute; right: -130px; top: -160px; width: 400px; }
.am-detail-image-placeholder { align-items: center; align-self: stretch; display: flex; justify-content: center; min-height: 390px; overflow: hidden; position: relative; }
.am-detail-image-placeholder > span { color: rgba(255,255,255,.85); font-family: Georgia, serif; font-size: 11rem; }
.am-detail-image-placeholder img { height: 100%; inset: 0; object-fit: cover; position: absolute; width: 100%; }
.am-detail-image-placeholder::after { background: linear-gradient(to top, rgba(0,0,0,.7), transparent 45%); content: ""; inset: 0; pointer-events: none; position: absolute; }
.am-detail-image-placeholder small { bottom: 9px; color: rgba(255,255,255,.86); font-size: .58rem; left: 10px; line-height: 1.25; max-width: calc(100% - 20px); position: absolute; z-index: 1; }
.am-detail-image-placeholder small a { color: white; }
.am-drawer-title { color: white; padding: 40px 38px; position: relative; z-index: 2; }
.am-drawer-title .am-eyebrow { color: rgba(255,255,255,.75); }
.am-drawer-title h2 { color: white; font-size: clamp(2.8rem, 5vw, 5.2rem); margin-bottom: 10px; overflow-wrap: anywhere; }
.am-drawer-title p { color: rgba(255,255,255,.82); font-size: .9rem; }
.am-drawer-body { padding: 38px; }
.am-detail-lead { border-bottom: 1px solid var(--am-line); margin-bottom: 34px; padding-bottom: 30px; }
.am-detail-lead p { font-family: Georgia, serif; font-size: clamp(1.25rem, 2vw, 1.65rem); line-height: 1.45; margin: 0; }
.am-detail-grid { display: grid; gap: 42px; grid-template-columns: minmax(0, 1fr) 250px; }
.am-detail-main > section + section, .am-detail-side > section + section { border-top: 1px solid var(--am-line); margin-top: 35px; padding-top: 32px; }
.am-detail-label { color: var(--am-accent); display: block; font-size: .65rem; font-weight: 850; letter-spacing: .14em; margin-bottom: 15px; text-transform: uppercase; }
.am-detail-main p { color: var(--am-muted); font-size: .89rem; line-height: 1.75; }
.am-source-link a { font-size: .72rem; font-weight: 800; }
.am-listen-focus { background: var(--am-surface); border: 1px solid var(--am-line); border-radius: 12px; margin-bottom: 17px; padding: 17px; }
.am-listen-focus strong { font-size: .76rem; }
.am-listen-focus p { font-size: .76rem; margin: 5px 0 0; }
.am-detail-side dl { margin: 0; }
.am-detail-side dl > div { border-bottom: 1px solid var(--am-line); display: grid; gap: 10px; grid-template-columns: 24px 1fr; padding: 11px 0; }
.am-detail-side dt { color: var(--am-accent); font-family: Georgia, serif; }
.am-detail-side dd { color: var(--am-muted); font-size: .7rem; margin: 0; }
.am-side-action { background: transparent; border: 0; border-bottom: 1px solid var(--am-line); cursor: pointer; display: block; font-size: .7rem; font-weight: 700; padding: 11px 0; text-align: left; width: 100%; }
.am-side-action:hover { color: var(--am-accent); }
.am-source-note p { color: var(--am-muted); font-size: .68rem; }
.am-related-grid { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.am-related-grid button { align-items: center; background: var(--am-surface); border: 1px solid var(--am-line); border-radius: 10px; cursor: pointer; display: grid; gap: 5px; grid-template-columns: 35px 1fr; padding: 11px; text-align: left; }
.am-related-grid button > span { align-items: center; background: var(--am-surface-2); border-radius: 50%; display: flex; grid-row: 1 / 3; height: 32px; justify-content: center; width: 32px; }
.am-related-grid button strong { font-size: .68rem; line-height: 1.2; }
.am-related-grid button small { color: var(--am-muted); font-size: .56rem; }

.am-skeleton-lines { display: grid; gap: 9px; }
.am-skeleton-lines i { animation: am-shimmer 1.2s linear infinite; background: linear-gradient(90deg, var(--am-surface-2), var(--am-surface), var(--am-surface-2)); background-size: 200% 100%; border-radius: 5px; display: block; height: 12px; }
.am-skeleton-lines i:nth-child(2) { width: 92%; }.am-skeleton-lines i:nth-child(3) { width: 76%; }.am-skeleton-lines i:nth-child(4) { width: 48%; }
.am-skeleton-lines + small { color: var(--am-muted); display: block; font-size: .64rem; margin-top: 10px; }
@keyframes am-shimmer { to { background-position: -200% 0; } }

.am-audio-list { display: grid; gap: 13px; }
.am-audio-track { background: var(--am-surface); border: 1px solid var(--am-line); border-radius: 13px; overflow: hidden; padding: 14px; }
.am-audio-heading { align-items: center; display: flex; gap: 12px; }
.am-audio-heading > span { align-items: center; background: var(--am-ink); border-radius: 50%; color: var(--am-bg); display: flex; flex: 0 0 35px; font-family: Georgia, serif; height: 35px; justify-content: center; }
.am-audio-heading strong, .am-audio-heading small { display: block; }
.am-audio-heading strong { font-size: .75rem; line-height: 1.2; }
.am-audio-heading small { color: var(--am-muted); font-size: .62rem; margin-top: 3px; }
.am-audio-track audio { height: 36px; margin: 13px 0 10px; width: 100%; }
.am-audio-tools { display: flex; gap: 9px; justify-content: space-between; }
.am-speed-controls, .am-loop-controls { display: flex; flex-wrap: wrap; gap: 4px; }
.am-audio-tools button { background: transparent; border: 1px solid var(--am-line); border-radius: 999px; color: var(--am-muted); cursor: pointer; font-size: .56rem; padding: 4px 7px; }
.am-audio-tools button.is-active { background: var(--am-ink); color: var(--am-bg); }
.am-audio-track footer { border-top: 1px solid var(--am-line); color: var(--am-muted); display: flex; flex-wrap: wrap; font-size: .55rem; gap: 10px; margin-top: 11px; padding-top: 9px; }
.am-audio-track footer a { margin-left: auto; }
.am-audio-disclaimer, .am-audio-empty p { color: var(--am-muted); font-size: .63rem !important; }
.am-external-listen { align-items: center; background: var(--am-surface-2); border-radius: 10px; display: flex; flex-wrap: wrap; font-size: .61rem; gap: 8px; margin-top: 12px; padding: 10px 12px; }
.am-external-listen span { color: var(--am-muted); margin-right: auto; }
.am-external-listen a { border: 1px solid var(--am-line); border-radius: 999px; font-weight: 800; padding: 4px 8px; text-decoration: none; }
.am-audio-empty { background: var(--am-surface); border: 1px dashed var(--am-line-strong); border-radius: 12px; padding: 18px; }

.am-toast-region { bottom: 20px; display: grid; gap: 8px; pointer-events: none; position: fixed; right: 20px; z-index: 1000000; }
.am-toast { background: var(--am-ink); border-radius: 999px; color: var(--am-bg); font-size: .75rem; opacity: 0; padding: 10px 16px; transform: translateY(10px); transition: .2s ease; }
.am-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .am-stat-grid { grid-template-columns: repeat(3, 1fr); }
  .am-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .am-card-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .am-path-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-path-grid-full { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-topbar { grid-template-columns: auto minmax(260px, 1fr) auto; }
  .am-hero { grid-template-columns: 1.3fr .7fr; }
}

@media (max-width: 900px) {
  .atlas-musical { border-left: 0; border-radius: 0; border-right: 0; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: none; width: 100vw; }
  .am-topbar { gap: 11px; grid-template-columns: 1fr auto; }
  .am-search-wrap { grid-column: 1 / -1; grid-row: 2; }
  .am-brand small { display: none; }
  .am-hero { grid-template-columns: 1fr; }
  .am-hero-orbit { max-width: 330px; }
  .am-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-filter-panel { grid-template-columns: 1fr 1fr; position: static; }
  .am-page-header-row { align-items: start; flex-direction: column; }
  .am-world-layout { grid-template-columns: 1fr; }
  .am-world-summary { display: grid; grid-template-columns: 1fr 1fr; }
  .am-world-summary .am-eyebrow, .am-world-summary h2 { grid-column: 1; }
  .am-world-summary p { grid-column: 1; }
  .am-world-mini-stats { grid-column: 2; grid-row: 1 / 4; }
  .am-timeline-band > header { grid-template-columns: 120px 1fr; }
  .am-timeline-band > header p { grid-column: 2; }
  .am-quiz-intro { grid-template-columns: 1fr; }
  .am-quiz-disc { max-width: 240px; }
  .am-path-steps button { grid-template-columns: 100px 1fr; }
  .am-path-steps button > small { grid-column: 2; }
  .am-step-arrow { display: none; }
  .am-drawer-hero { grid-template-columns: 1fr; }
  .am-detail-image-placeholder { min-height: 330px; }
  .am-drawer-title { background: linear-gradient(to top, rgba(0,0,0,.68), transparent); bottom: 0; left: 0; position: absolute; width: 100%; }
}

@media (max-width: 680px) {
  .am-main { padding-bottom: 55px; }
  .am-brand-mark { height: 37px; width: 37px; }
  .am-actions .am-icon-button { height: 37px; width: 37px; }
  .am-primary-nav { padding-left: 7px; }
  .am-primary-nav button { font-size: .71rem; padding-left: 10px; padding-right: 10px; }
  .am-hero { min-height: auto; padding: 30px 22px; }
  .am-hero h1 { font-size: clamp(2.7rem, 13vw, 4.4rem); }
  .am-hero-orbit { display: none; }
  .am-hero-actions .am-button { width: 100%; }
  .am-stat-grid { grid-template-columns: 1fr 1fr; margin-bottom: 55px; }
  .am-stat-card { min-height: 135px; padding: 13px; }
  .am-stat-card strong { font-size: 1.6rem; }
  .am-card-grid, .am-card-grid-compact { grid-template-columns: 1fr; }
  .am-card { display: grid; grid-template-columns: 122px 1fr; }
  .am-card-main { display: grid; grid-column: 1 / -1; grid-template-columns: 122px 1fr; }
  .am-card-visual, .am-card.is-compact .am-card-visual { height: 100%; min-height: 190px; }
  .am-card-symbol { font-size: 4rem; left: 16px; }
  .am-card-region { left: 7px; right: auto; writing-mode: vertical-rl; }
  .am-card-body, .am-card.is-compact .am-card-body { min-height: 190px; padding: 16px; }
  .am-card-favorite, .am-card.is-compact .am-card-favorite { right: 9px; top: 9px; }
  .am-path-grid, .am-path-grid-full { grid-template-columns: 1fr; }
  .am-path-card { min-height: 275px; }
  .am-section-heading { align-items: start; flex-direction: column; }
  .am-section-heading .am-text-button { align-self: end; }
  .am-filter-panel { grid-template-columns: 1fr; }
  .am-page-header h1 { font-size: 3rem; }
  .am-timeline { margin-left: 2px; padding-left: 22px; }
  .am-timeline-band::before { left: -31px; }
  .am-timeline-band > header { display: block; }
  .am-timeline-band > header h2 { margin: 5px 0 10px; }
  .am-timeline-node { flex-basis: 180px; }
  .am-world-map { min-height: auto; padding: 8px; }
  .am-world-summary { display: block; }
  .am-world-mini-stats { margin-top: 20px; }
  .am-quiz-choices { grid-template-columns: 1fr; }
  .am-quiz-shell h1 { font-size: 2.5rem; }
  .am-path-hero { padding: 35px 22px; }
  .am-path-hero::after { display: none; }
  .am-path-steps li { grid-template-columns: 45px 1fr; }
  .am-path-steps button { display: block; padding: 20px 10px; }
  .am-path-steps button > strong, .am-path-steps button > small, .am-path-steps button > span { display: block; margin-top: 8px; }
  .am-drawer-panel { width: 100vw; }
  .am-drawer-body { padding: 24px 18px; }
  .am-detail-grid { grid-template-columns: 1fr; }
  .am-detail-side { border-top: 1px solid var(--am-line); padding-top: 28px; }
  .am-related-grid { grid-template-columns: 1fr; }
  .am-audio-tools { align-items: start; flex-direction: column; }
  .am-footer { align-items: start; flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-musical *, .atlas-musical *::before, .atlas-musical *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}

@media print {
  body * { visibility: hidden !important; }
  .am-drawer, .am-drawer * { visibility: visible !important; }
  .am-drawer { position: absolute; inset: 0; }
  .am-drawer-backdrop, .am-drawer-toolbar, .am-audio-tools, .am-side-action { display: none !important; }
  .am-drawer-panel { box-shadow: none; height: auto; max-width: none; overflow: visible; width: 100%; }
  .am-drawer-hero { min-height: 280px; }
  .am-detail-grid { grid-template-columns: 1fr 220px; }
}
