/* Styles for the symphony blog post (templates/pages/blog/posts/opus-symphony.html).
   Everything is scoped under .sy so it cannot affect other pages.
   The dark panels use the colours of the score video: ink page, cream notes, gold labels. */

.sy {
  --sy-ink: #121318;
  --sy-ink-2: #1b1d25;
  --sy-ink-3: #2a2d38;
  --sy-slate: #626570;
  --sy-line: rgba(255, 240, 215, 0.16);
  --sy-cream: #fff0d7;
  --sy-muted: #b5afa1;
  --sy-gold: #ffd696;
  --sy-accent: #ea580c;
  --sy-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sy-display: "Syne", system-ui, sans-serif;
}

.sy [hidden] { display: none !important; }

/* ---------- Opening quote ---------- */
.sy-epigraph {
  margin: 0 0 2rem;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--sy-accent);
}
.sy-epigraph p {
  margin: 0;
  font-family: var(--sy-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem);
  line-height: 1.35;
  color: #0f172a;
  text-wrap: balance;
}
.sy-epigraph footer {
  margin-top: 0.6rem;
  font-size: 1rem;
  color: #64748b;
}

.sy-meme { margin: 2rem auto; max-width: 26rem; }
.sy-meme img { display: block; width: 100%; height: auto; border-radius: 0.75rem; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18); }

.sy-tldr {
  margin: 2rem 0;
  padding: 1.1rem 1.25rem;
  border-radius: 0.9rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  font-size: 1.05rem;
  line-height: 1.55;
}
.sy-tldr strong { color: #7c2d12; font-family: var(--sy-mono); font-size: 0.85em; letter-spacing: 0.02em; }

/* ---------- Shared panel ---------- */
.sy-panel {
  margin: 2rem -0.5rem;
  padding: 1.1rem 1rem 1.25rem;
  border-radius: 1.1rem;
  background: var(--sy-ink);
  color: var(--sy-cream);
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.22);
}
@media (min-width: 640px) {
  .sy-panel { margin: 2.25rem 0; padding: 1.5rem 1.5rem 1.6rem; }
}
.sy-panel__title {
  margin: 0;
  font-family: var(--sy-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--sy-cream);
  text-wrap: balance;
}
.sy-panel__help { margin: 0.4rem 0 1rem; color: var(--sy-muted); max-width: 46rem; }
.sy-panel__note { margin: 0.9rem 0 0; color: var(--sy-muted); font-size: 0.85rem; max-width: 46rem; }
.sy-panel a { color: var(--sy-gold); }

.sy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.sy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 2.5rem; padding: 0.45rem 1rem;
  border-radius: 999px; border: 1px solid var(--sy-line);
  background: transparent; color: var(--sy-cream);
  font: inherit; font-weight: 600; font-size: 0.9rem; line-height: 1.1;
  cursor: pointer; text-decoration: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.sy-btn:hover { border-color: var(--sy-cream); }
.sy-btn--primary { background: var(--sy-gold); border-color: var(--sy-gold); color: var(--sy-ink); }
.sy-btn--primary:hover { background: var(--sy-cream); border-color: var(--sy-cream); }
.sy-btn[aria-pressed="true"], .sy-btn[aria-selected="true"] { background: var(--sy-cream); border-color: var(--sy-cream); color: var(--sy-ink); }
.sy-btn:disabled { opacity: 0.45; cursor: default; }
.sy-btn:focus-visible, .sy-seg button:focus-visible, .sy-focusable:focus-visible, .sy-video__poster:focus-visible, .sy-chip:focus-visible {
  outline: 2px solid var(--sy-gold); outline-offset: 2px;
}
.sy-icon { width: 0.8rem; height: 0.8rem; flex: none; fill: currentColor; }

.sy-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; border: 1px solid var(--sy-line); background: var(--sy-ink-2); }
.sy-seg button {
  min-width: 2.6rem; min-height: 2.1rem; padding: 0.3rem 0.85rem;
  border: 0; border-radius: 999px; background: transparent; color: var(--sy-muted);
  font: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer;
}
.sy-seg button:hover { color: var(--sy-cream); }
.sy-seg button[aria-selected="true"], .sy-seg button[aria-pressed="true"] { background: var(--sy-cream); color: var(--sy-ink); }

.sy-readout { font-family: var(--sy-mono); font-size: 0.8rem; color: var(--sy-muted); font-variant-numeric: tabular-nums; }
.sy-readout b { color: var(--sy-cream); font-weight: 600; }

/* ---------- Video ---------- */
.sy-video { margin: 1.5rem -0.5rem 2rem; }
@media (min-width: 640px) { .sy-video { margin: 1.75rem 0 2.25rem; } }
.sy-video__stage {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 1.1rem; background: var(--sy-ink);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.25);
}
/* On large screens the player is wider than the text column. YouTube's embedded player gives a page
   no way to set the picture quality: it picks one from the viewer's connection and from the player's
   size on screen. A player taller than 720 CSS pixels is what gets 1080p on an ordinary monitor. */
@media (min-width: 1100px) and (min-height: 700px) {
  .sy-video__stage {
    width: max(100%, min(100vw - 5rem, (100vh - 7rem) * 16 / 9, 1440px));
    margin-left: 50%;
    transform: translateX(-50%);
  }
}
.sy-video__stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sy-video__poster { position: absolute; inset: 0; display: block; padding: 0; border: 0; background: none; cursor: pointer; color: var(--sy-cream); text-decoration: none; }
.sy-video__poster img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; }
.sy-video__poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(18, 19, 24, 0.85), rgba(18, 19, 24, 0) 45%); }
.sy-video__play {
  position: absolute; left: 50%; top: 50%; z-index: 1; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 4.5rem; height: 4.5rem; border-radius: 50%;
  background: var(--sy-gold); color: var(--sy-ink); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s;
}
.sy-video__poster:hover .sy-video__play { transform: translate(-50%, -50%) scale(1.06); }
.sy-video__play svg { width: 1.5rem; height: 1.5rem; margin-left: 0.2rem; fill: currentColor; }
.sy-video__label { position: absolute; left: 1rem; right: 1rem; bottom: 0.85rem; z-index: 1; font-family: var(--sy-display); font-weight: 700; font-size: clamp(0.95rem, 0.8rem + 0.8vw, 1.3rem); line-height: 1.2; text-align: left; }
.sy-video__label small { display: block; margin-top: 0.15rem; font-family: var(--sy-mono); font-weight: 500; font-size: 0.75rem; color: var(--sy-muted); }

.sy-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.sy-video__hint { margin: 0.6rem 0 0; font-size: 0.85rem; line-height: 1.45; color: #64748b; }
.sy-chip {
  display: inline-flex; align-items: baseline; gap: 0.5rem; min-height: 2.5rem; padding: 0.5rem 0.9rem;
  border-radius: 999px; background: var(--sy-ink); color: var(--sy-cream) !important;
  font-weight: 600; font-size: 0.9rem; line-height: 1.2; text-decoration: none !important; cursor: pointer;
  border: 1px solid var(--sy-ink);
  transition: background-color 0.15s;
}
.sy-chip:hover { background: var(--sy-ink-3); }
.sy-chip span { font-family: var(--sy-mono); font-weight: 500; font-size: 0.78rem; color: var(--sy-gold); }

.sy-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.sy-facts .sy-facts__wide { grid-column: 1 / -1; }
@media (min-width: 768px) {
  .sy-facts { grid-template-columns: repeat(5, 1fr); }
  .sy-facts .sy-facts__wide { grid-column: auto; }
}
.sy-facts li { margin: 0; padding: 0.8rem 0.9rem; border-radius: 0.8rem; background: #f8fafc; border: 1px solid #e2e8f0; }
.sy-facts b { display: block; font-family: var(--sy-display); font-weight: 700; font-size: 1.5rem; line-height: 1.1; color: #0f172a; font-variant-numeric: tabular-nums; }
.sy-facts span { display: block; margin-top: 0.2rem; font-size: 0.85rem; color: #64748b; }

/* ---------- Three jobs ---------- */
.sy-jobs { display: grid; gap: 0.6rem; margin: 1.5rem 0 2rem; }
@media (min-width: 640px) { .sy-jobs { grid-template-columns: repeat(3, 1fr); } }
.sy-job {
  display: block; padding: 0.95rem 1rem; border-radius: 0.9rem;
  border: 1px solid #e2e8f0; background: #fff; text-decoration: none !important; color: #0f172a !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sy-job:hover { border-color: var(--sy-accent); box-shadow: 0 6px 18px rgba(234, 88, 12, 0.12); }
.sy-job__n { font-family: var(--sy-mono); font-size: 0.75rem; color: var(--sy-accent); }
.sy-job__t { display: block; margin-top: 0.15rem; font-family: var(--sy-display); font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.sy-job__c { display: block; margin-top: 0.35rem; font-size: 0.88rem; color: #64748b; }

/* ---------- Score demo ---------- */
.sy-swipe { display: none; margin: 0.35rem 0 0; font-size: 0.78rem; color: var(--sy-muted); }
@media (max-width: 639px) { .sy-swipe { display: block; } }
.sy-score__scroll { overflow-x: auto; margin: 0 -0.25rem; padding: 0 0.25rem 0.25rem; -webkit-overflow-scrolling: touch; }
.sy-staff { display: block; width: 100%; min-width: 38rem; height: auto; color: var(--sy-cream); }
.sy-staff .nh { cursor: pointer; transition: color 0.08s; }
.sy-staff .nh.is-hover, .sy-staff .nh.is-on { color: var(--sy-gold); filter: drop-shadow(0 0 0.9px var(--sy-gold)) drop-shadow(0 0 2.2px rgba(255, 214, 150, 0.7)); }
.sy-code {
  margin: 0.9rem 0 1rem; padding: 0.85rem 0.95rem; border-radius: 0.75rem;
  background: var(--sy-ink-2); border: 1px solid var(--sy-line);
  font-family: var(--sy-mono); font-size: 0.8rem; line-height: 1.95; color: #8f8a80;
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
}
.sy-tok { padding: 0.12rem 0.18rem; border-radius: 0.3rem; color: var(--sy-cream); cursor: pointer; transition: background-color 0.08s, color 0.08s; }
.sy-tok.is-hover, .sy-tok.is-on { background: var(--sy-gold); color: var(--sy-ink); }

/* ---------- Round explorer ---------- */
.sy-rounds__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; margin-bottom: 0.85rem; }
.sy-rounds__scroll { overflow-x: auto; padding: 2px 2px 0.4rem; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
.sy-rounds__axis { position: relative; height: 1.1rem; font-family: var(--sy-mono); font-size: 0.68rem; color: var(--sy-muted); }
.sy-rounds__axis span { position: absolute; top: 0; white-space: nowrap; }
.sy-rounds__cells {
  --c: 11px; --g: 2px;
  display: grid; grid-template-rows: repeat(10, var(--c)); grid-auto-columns: var(--c); gap: var(--g);
  width: max-content; min-height: calc(10 * var(--c) + 9 * var(--g));
  border-radius: 4px; touch-action: pan-x pan-y;
}
.sy-cell { display: block; width: var(--c); height: var(--c); border-radius: 2px; box-sizing: border-box; border: 1px solid rgba(255, 240, 215, 0.32); cursor: pointer; }
.sy-cell.is-chg { background: var(--sy-cream); border-color: var(--sy-cream); opacity: 0.82; }
.sy-rounds.has-lens .sy-cell { opacity: 0.16; }
.sy-rounds.has-lens .sy-cell.is-lens { opacity: 1; }
.sy-cell.is-sel, .sy-rounds.has-lens .sy-cell.is-sel { opacity: 1; border-color: var(--sy-gold); box-shadow: 0 0 0 2px var(--sy-gold), 0 0 10px 2px rgba(255, 214, 150, 0.65); }
.sy-cell.is-sel.is-chg { background: var(--sy-gold); }
.sy-rounds__lenses { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.75rem 0 0; }
.sy-lens {
  padding: 0.28rem 0.6rem; min-height: 1.9rem; border-radius: 999px; border: 1px solid var(--sy-line); background: transparent;
  color: var(--sy-muted); font: inherit; font-size: 0.78rem; line-height: 1.2; cursor: pointer;
}
.sy-lens b { font-family: var(--sy-mono); font-weight: 500; margin-right: 0.3rem; opacity: 0.7; }
.sy-lens:hover { color: var(--sy-cream); border-color: var(--sy-cream); }
.sy-lens.is-cur { color: var(--sy-gold); border-color: var(--sy-gold); }
.sy-lens[aria-pressed="true"] { background: var(--sy-cream); border-color: var(--sy-cream); color: var(--sy-ink); }
.sy-rounds__detail { margin-top: 1rem; padding: 0.95rem 1rem; border-radius: 0.8rem; background: var(--sy-ink-2); border: 1px solid var(--sy-line); min-height: 8.5rem; }
.sy-rounds__meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-family: var(--sy-mono); font-size: 0.78rem; color: var(--sy-gold); }
.sy-rounds__meta .is-none { color: var(--sy-muted); }
.sy-rounds__reading { margin: 0.35rem 0 0; font-size: 0.82rem; color: var(--sy-muted); }
.sy-rounds__text { margin: 0.55rem 0 0; font-size: 0.98rem; line-height: 1.5; color: var(--sy-cream); overflow-wrap: anywhere; }
.sy-rounds__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.85rem; }
.sy-rounds__nav .sy-readout { margin-left: auto; }
.sy-key { display: inline-flex; align-items: center; gap: 0.4rem; margin-right: 0.9rem; }
.sy-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; box-sizing: border-box; border: 1px solid rgba(255, 240, 215, 0.4); }
.sy-key i.is-chg { background: var(--sy-cream); border-color: var(--sy-cream); }

/* ---------- Version 1 against the final version ---------- */
.sy-versions__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; margin-bottom: 0.9rem; }
.sy-versions__strip { position: relative; }
.sy-versions canvas { display: block; width: 100%; height: 64px; border-radius: 6px; cursor: pointer; touch-action: pan-y; }
.sy-versions__scale { display: flex; justify-content: space-between; margin-top: 0.3rem; font-family: var(--sy-mono); font-size: 0.68rem; color: var(--sy-muted); }
.sy-versions__legend { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.6rem; font-size: 0.78rem; color: var(--sy-muted); white-space: nowrap; }
.sy-versions__legend i { flex: 0 1 5rem; min-width: 1.5rem; height: 0.55rem; border-radius: 999px; background: linear-gradient(to right, #3a3d49, #ffd696); }
.sy-versions__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 1rem; }
.sy-versions__controls .sy-readout { margin-left: auto; }
.sy-versions__stat { margin: 0.9rem 0 0; color: var(--sy-cream); font-size: 0.92rem; }

/* ---------- Mockup stages ---------- */
.sy-stages__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.45rem; }
@media (min-width: 640px) { .sy-stages__list { grid-template-columns: repeat(6, 1fr); } }
.sy-stage {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  min-height: 3.4rem; padding: 0.55rem 0.7rem; border-radius: 0.7rem;
  border: 1px solid var(--sy-line); background: var(--sy-ink-2); color: var(--sy-cream);
  font: inherit; text-align: left; cursor: pointer;
}
.sy-stage b { font-weight: 600; font-size: 0.9rem; line-height: 1.15; }
.sy-stage span { font-family: var(--sy-mono); font-size: 0.68rem; color: var(--sy-muted); }
.sy-stage:hover { border-color: var(--sy-cream); }
.sy-stage[aria-pressed="true"] { background: var(--sy-cream); border-color: var(--sy-cream); color: var(--sy-ink); }
.sy-stage[aria-pressed="true"] span { color: #5b5648; }
.sy-stages__transport { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.9rem; }
.sy-progress { position: relative; flex: 1; height: 1.6rem; cursor: pointer; touch-action: none; }
.sy-progress::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 999px; background: var(--sy-ink-3); }
.sy-progress__fill { position: absolute; left: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 999px; background: var(--sy-gold); width: 0; }
.sy-stages__caption { margin: 0.8rem 0 0; min-height: 2.9em; color: var(--sy-cream); font-size: 0.92rem; }

/* ---------- Clips from the video ---------- */
.sy-clip { margin: 1.75rem -0.5rem; }
@media (min-width: 640px) { .sy-clip { margin: 2rem 0; } }
.sy-clip video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 1rem; background: var(--sy-ink); box-shadow: 0 14px 40px rgba(15, 23, 42, 0.22); }
.sy-clip figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 0.7rem; padding: 0 0.5rem; font-size: 0.9rem; color: #64748b; }
@media (min-width: 640px) { .sy-clip figcaption { padding: 0; } }

.sy-scores { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.sy-scores li { margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  .sy *, .sy *::before, .sy *::after { transition: none !important; }
}
