/* sol · web: the composers page (docs/ESPEC.md 4.2). Owner: pages. Shared parts are in paginas.css. */

/* ---------- the timeline: life spans as brass bars on a 1650 to 1950 axis ---------- */
.tl { position: relative; padding: 4px 0 8px; }
.tl-frame {
  position: relative; padding: 0 clamp(8px, 1.4vw, 20px) 24px; border-radius: var(--radius-lg);
  border: 1px solid var(--line); background: var(--lacquer-sheen), linear-gradient(180deg, #0d0d10, #08080a);
  --lane-h: 44px;
}
.tl-axis { position: relative; height: 46px; margin: 0; border-bottom: 1px solid var(--line-2); }
.tl-tick { position: absolute; left: calc(var(--x) * 100%); bottom: 0; width: 1px; height: 6px; background: rgba(244, 241, 234, .14); }
.tl-tick.major { height: 10px; background: rgba(244, 241, 234, .34); }
.tl-tick-l { position: absolute; bottom: 16px; left: 0; transform: translateX(-50%); font-size: .875rem; color: var(--text-3); white-space: nowrap; letter-spacing: .02em; }
.tl-list { position: relative; list-style: none; margin: 0; padding: 18px 0 0; }
/* every fifty years runs down through the lanes, faintly */
.tl.is-lanes .tl-list {
  background: linear-gradient(90deg, rgba(244, 241, 234, .055) 1px, transparent 1px) 0 0 / calc(100% / 6) 100% repeat-x;
  box-shadow: inset -1px 0 0 rgba(244, 241, 234, .055);
}
.tl-item { min-width: 0; }
.tl-btn {
  position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; color: inherit;
  text-align: left; cursor: pointer; border-radius: 10px;
}
.tl-label { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.tl-name { font: 600 .9375rem/1.15 var(--font-display); letter-spacing: -.01em; color: var(--text); transition: color .2s var(--ease); }
.tl-years { font-size: .875rem; color: var(--text-3); }
.tl-track { position: relative; display: block; }
.tl-bar {
  position: absolute; display: block; height: 6px; border-radius: 6px;
  background: linear-gradient(90deg, var(--gold-lo), var(--gold) 45%, var(--gold-hi));
  box-shadow: 0 0 0 1px rgba(234, 211, 154, .08), 0 0 16px -2px rgba(201, 169, 97, .55);
  transition: box-shadow .25s var(--ease), filter .25s var(--ease), opacity .25s var(--ease);
}
.tl-item.unknown .tl-bar { background: linear-gradient(90deg, rgba(140, 114, 57, 0), var(--gold) 60%, var(--gold-hi)); box-shadow: none; }
.tl-btn:hover .tl-name, .tl-btn:focus-visible .tl-name { color: var(--gold-hi); }
.tl-btn:hover .tl-bar, .tl-btn:focus-visible .tl-bar { filter: brightness(1.18); box-shadow: 0 0 0 1px rgba(234, 211, 154, .25), 0 0 26px rgba(234, 211, 154, .7); }
.tl-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* wide: lanes, each bar where it falls in time, its name just above */
.tl.is-lanes .tl-list { height: calc(var(--lanes, 1) * var(--lane-h) + 18px); }
.tl.is-lanes .tl-item { position: absolute; left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); top: calc(18px + var(--lane) * var(--lane-h)); height: calc(var(--lane-h) - 6px); }
.tl.is-lanes .tl-btn { display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; padding-bottom: 8px; }
.tl.is-lanes .tl-track { height: 6px; }
.tl.is-lanes .tl-bar { inset: 0; }
.tl.is-lanes .tl-label { overflow: visible; }
.tl.is-lanes .tl-btn::after { content: ""; position: absolute; inset: -4px -6px 0; } /* a generous hit area */
.tl.is-scanning .tl-item:not(.is-alive) .tl-bar { opacity: .28; box-shadow: none; }
.tl.is-scanning .tl-item:not(.is-alive) .tl-name { color: var(--text-3); }
.tl.is-scanning .tl-item.is-alive .tl-bar { box-shadow: 0 0 0 1px rgba(234, 211, 154, .3), 0 0 24px rgba(234, 211, 154, .75); }

/* narrow: one composer per row, the name on the left and the life on a small axis */
.tl.is-rows .tl-frame { padding: 0 12px 16px; }
.tl.is-rows .tl-axis { margin-left: 42%; }
.tl.is-rows .tl-tick-l { font-size: .875rem; }
.tl.is-rows .tl-tick:not(.major) { display: none; }
.tl.is-rows .tl-tick.major:nth-child(10n + 1) .tl-tick-l { display: none; } /* 1700, 1800, 1900 stay */
.tl.is-rows .tl-list { padding-top: 6px; }
.tl.is-rows .tl-item { position: relative; }
.tl.is-rows .tl-btn { display: grid; grid-template-columns: 42% 1fr; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); border-radius: 0; }
.tl.is-rows .tl-label { flex-direction: column; align-items: flex-start; gap: 2px; padding-right: 10px; overflow: hidden; }
.tl.is-rows .tl-name { font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tl.is-rows .tl-track { height: 6px; }
.tl.is-rows .tl-bar { top: 0; bottom: 0; left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); min-width: 6px; }
.tl.is-rows .tl-btn:focus-visible { outline-offset: -2px; border-radius: 8px; }

/* the year under the pointer */
.tl-cursor { position: absolute; top: 0; bottom: 0; left: clamp(8px, 1.4vw, 20px); right: clamp(8px, 1.4vw, 20px); pointer-events: none; }
.tl-cursor::before { content: ""; position: absolute; top: 8px; bottom: 16px; left: calc(var(--x) * 100%); width: 1px; background: linear-gradient(180deg, rgba(234, 211, 154, .9), rgba(234, 211, 154, .12)); box-shadow: 0 0 12px rgba(234, 211, 154, .5); }
.tl-cursor span {
  position: absolute; top: var(--y, 6px); left: calc(var(--x) * 100%); transform: translateX(-50%);
  padding: 4px 9px; border-radius: var(--radius-pill); background: var(--gold-grad); color: var(--on-gold);
  font: 600 .875rem/1 var(--font-display); font-variant-numeric: tabular-nums; box-shadow: var(--shadow-gold-btn);
}
.tl-caption {
  position: sticky; bottom: 14px; z-index: 6; width: fit-content; max-width: min(100%, 92ch); margin: 14px 0 0; padding: 12px 18px;
  border-radius: 14px; border: 1px solid var(--line-2); background: rgba(18, 18, 20, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--text-2); font-size: .9375rem; box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .9);
}
.tl.is-scanning .tl-caption { color: var(--text); border-color: rgba(201, 169, 97, .4); }
.tl.is-rows .tl-caption { display: none; }

/* the card that follows a hovered or focused life */
.tl-tip {
  position: absolute; z-index: 5; left: 0; top: 0; transform: translate(var(--tx, 0), var(--ty, 0));
  display: grid; gap: 3px; min-width: 200px; max-width: 280px; padding: 12px 14px; border-radius: 14px;
  background: rgba(26, 26, 29, .96); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9);
  pointer-events: none; font-size: .9375rem; color: var(--text-2);
}
.tl-tip strong { color: var(--text); font: 600 1rem/1.25 var(--font-display); letter-spacing: -.01em; }
.tl-tip-note { color: var(--gold-hi); font-size: .875rem; }
.tl.is-rows .tl-tip { display: none; }

/* ---------- the composer dialog ---------- */
dialog.cdlg { width: min(1040px, calc(100vw - 32px)); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(244, 241, 234, .2) transparent; }
.cd-bar { position: sticky; top: 0; z-index: 4; height: 0; display: flex; justify-content: flex-end; }
.cd-close { margin: 14px 14px 0 0; background: rgba(5, 5, 6, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-color: rgba(244, 241, 234, .2); }
.cd-art { position: relative; aspect-ratio: 2.9 / 1; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #080a12, #0e0f16 55%, #16130d); }
.cd-art .sol-art { opacity: 0; transition: opacity .8s var(--ease-out); }
.cd-art.sol-art-ready .sol-art { opacity: 1; }
@media (max-width: 700px) { .cd-art { aspect-ratio: 2 / 1; } }
.cd-body { padding: clamp(22px, 3.2vw, 44px) clamp(20px, 3.6vw, 52px) clamp(28px, 3.6vw, 48px); }
.cd-eyebrow { margin: 0 0 10px; }
.cd-name { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.6rem); letter-spacing: -.035em; line-height: 1.02; }
.cd-years { margin: 12px 0 0; font: 600 1.15rem/1.3 var(--font-display); color: var(--gold-hi); letter-spacing: .01em; }
.cd-note { color: var(--text-3); font: 400 .9375rem/1.3 var(--font-body); }
.cd-bio { margin: 16px 0 0; color: var(--text-2); font-size: var(--fs-lead); line-height: 1.55; max-width: 62ch; }
.cd-pieces { margin-top: clamp(28px, 3.4vw, 44px); padding-top: clamp(20px, 2.4vw, 28px); border-top: 1px solid var(--line); }
.cd-h3 { display: flex; align-items: baseline; gap: 10px; font-size: 1.2rem; margin-bottom: 14px; }
.cd-n { color: var(--text-3); font: 500 1rem/1 var(--font-body); }
.cd-list { list-style: none; margin: 0; padding: 0; display: grid; }
.cd-piece { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cd-pt { display: grid; gap: 3px; min-width: 0; }
.cd-ptitle { font: 600 1.02rem/1.3 var(--font-display); letter-spacing: -.01em; }
.cd-pmeta { color: var(--text-3); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-ptags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cd-ptags .chip { font-size: .875rem; height: 28px; }
.cd-ptags .chip .ic { width: 14px; height: 14px; }
.cd-play { --h: 44px; padding: 0 16px; font-size: .9375rem; }
.cd-play .ic { width: 18px; height: 18px; color: var(--gold); }
.cd-loading { padding: 18px 0; color: var(--text-3); }
.cd-more { margin-top: 18px; justify-content: space-between; }
@media (max-width: 640px) {
  .cd-piece { grid-template-columns: minmax(0, 1fr) auto; }
  .cd-ptags { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  /* a round button with the icon only (.cd-piece raises it over .btn-ghost.sm, whose side padding would squeeze the icon) */
  .cd-piece .cd-play { grid-column: 2; grid-row: 1 / span 2; padding: 0; width: 48px; --h: 48px; justify-content: center; }
  .cd-play .ic { width: 22px; height: 22px; }
  .cd-play span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cd-pmeta { white-space: normal; }
}
@media (max-width: 600px) {
  dialog.cdlg { width: 100%; max-width: 100%; max-height: 94vh; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
/* phones held sideways: a slim band of art, so the name and the start of the story fit on the first screen */
@media (max-height: 520px) and (orientation: landscape) {
  .cd-art { aspect-ratio: 4.5 / 1; }
  .cd-body { padding-top: 18px; }
  .cd-name { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); }
}
