.ys-page { width: var(--page); margin: 0 auto; }
.ys-page [hidden] { display: none !important; }
.ys-page.page-columns, .ys-page .page-columns, #ys-explorer.page-columns { display: block !important; }
.ys-page .page-columns > * { grid-column: auto !important; }
.ys-heading { max-width: 820px; margin: 3rem 0 1.5rem; }
.ys-heading .eyebrow { color: var(--gold); margin-bottom: .7rem; }
.ys-heading h1 { color: var(--paper); font-size: clamp(2.2rem, 7vw, 4.6rem); line-height: 1.06; margin: 0 0 1rem; }
.ys-heading h1 em { color: var(--gold); }
.ys-heading > p:last-child { color: var(--soft); font-size: 1.05rem; max-width: 64ch; }
.ys-loading { color: var(--soft); }
.ys-page button { font-family: var(--sans); }
.ys-page button:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }

.ys-panel { position: relative; margin-bottom: 1.5rem; padding: clamp(1.2rem, 3vw, 1.9rem); border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.ys-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; border-radius: var(--radius) var(--radius) 0 0; background: var(--rainbow); }
.ys-panel .eyebrow { margin-bottom: .3rem; }
.ys-panel h2 { margin: 0 0 .5rem; padding: 0; border: 0; color: var(--ink); font-size: clamp(1.7rem, 3vw, 2.3rem); }
.ys-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .8rem 1.5rem; }
.ys-transport { display: flex; flex-wrap: wrap; gap: .5rem; }
.ys-play { min-width: 8rem; padding: .6rem 1.4rem; border: 0; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 1rem; font-weight: 650; cursor: pointer; }
.ys-btn { padding: .55rem 1rem; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: .88rem; cursor: pointer; }
.ys-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ys-group-label { margin: 0 0 .4rem; color: var(--muted); font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.ys-group-label span { margin-left: .4rem; color: var(--muted); letter-spacing: 0; text-transform: none; }

/* The studio */
.ys-stage { position: relative; margin-top: 1rem; border-radius: 16px; overflow: hidden; background: #1c1513; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.ys-svg { display: block; width: 100%; height: auto; }
.ys-fig { opacity: .3; transition: opacity .4s; }
.ys-fig.is-on { opacity: 1; }
.ys-spot { opacity: 0; transition: opacity .4s; }
.ys-fig.is-on .ys-spot { opacity: 1; }
.ys-band { opacity: 0; transition: opacity .4s; }
.ys-band.is-on { opacity: .92; }
.ys-cone { transition: fill .4s; }
.ys-spk.is-on .ys-cone { fill: #7a6440; }
.ys-name { fill: #f6efe0; font-family: var(--serif); font-size: 17px; font-weight: 650; }
.ys-sub { fill: #b8aca0; font-family: var(--mono); font-size: 11px; }
.ys-band-label { fill: #ffd76a; }
.ys-sing { fill: #ffd76a; font-size: 26px; opacity: 0; }
.ys-stage.is-playing.voice-on .ys-sing { opacity: 1; animation: ys-float 1.6s ease-out infinite; }
.ys-stage.is-playing .ys-fig.is-on .ys-bow { animation: ys-bow 1.3s ease-in-out infinite alternate; }
.ys-stage.is-playing .ys-fig.is-on .ys-strum { animation: ys-strum .326s ease-in-out infinite alternate; }
@keyframes ys-bow { from { transform: translateX(-16px); } to { transform: translateX(16px); } }
@keyframes ys-strum { from { transform: translateY(-3px); } to { transform: translateY(4px); } }
@keyframes ys-float { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-34px); opacity: 0; } }
.ys-readout { position: absolute; top: .7rem; left: .9rem; display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: baseline; pointer-events: none; }
.ys-chord { padding: .15rem .6rem; border-radius: 8px; background: rgba(0,0,0,.45); color: #ffd76a; font-family: var(--serif); font-size: 1.3rem; font-weight: 650; }
.ys-shape, .ys-bar { color: #d8cfc4; font-family: var(--mono); font-size: .78rem; }

/* The players */
.ys-parts-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem 1rem; margin-top: 1rem; }
.ys-parts-head .ys-group-label { margin: 0; }
.ys-presets, .ys-seg { display: flex; flex-wrap: wrap; gap: .3rem; }
.ys-presets button, .ys-seg button { padding: .3rem .75rem; border: 1.5px solid var(--paper-line); border-radius: 999px; background: #fffaf0; color: var(--ink); font-size: .8rem; cursor: pointer; }
.ys-seg button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.ys-presets button:hover, .ys-seg button:hover { border-color: var(--ink); }
.ys-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: .5rem; }
.ys-part { display: flex; flex-direction: column; gap: .15rem; padding: .65rem .8rem; border: 1.5px dashed var(--paper-line); border-left: 6px solid #d8cfbf; border-radius: 12px; background: #f4eee2; color: var(--ink); text-align: left; cursor: pointer; transition: background .2s, border-color .2s; }
.ys-part[aria-pressed="true"] { border-style: solid; border-color: var(--paper-line); border-left-color: var(--pc); background: #fffaf0; box-shadow: 0 0 0 2px var(--pc) inset; }
.ys-part-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.ys-part strong { font-size: 1rem; }
.ys-part em { color: var(--muted); font-size: .78rem; font-style: normal; }
.ys-role { font-size: .84rem; line-height: 1.35; }
.ys-state::after { content: "+ Add"; color: var(--muted); font-family: var(--mono); font-size: .7rem; white-space: nowrap; }
.ys-part[aria-pressed="true"] .ys-state::after { content: "In ✓"; color: var(--pc); font-weight: 700; }

.ys-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: 1rem; }
.ys-opt { padding: .7rem .8rem; border: 1.5px solid var(--paper-line); border-radius: 12px; background: #fffaf0; }

.ys-status { margin: 1rem 0 0; padding: .55rem .8rem; border-radius: 8px; background: #fdf0cf; font-size: .88rem; }
.ys-fine { margin: .8rem 0 0; color: var(--muted); font-size: .78rem; }

/* The story */
.ys-story > p:not(.eyebrow) { max-width: 80ch; }
.ys-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 1.2rem; }
.ys-step { padding: 1rem 1.1rem; border: 1px solid var(--paper-line); border-radius: 10px; background: #fffaf0; font-size: .9rem; }
.ys-step h3 { margin: .4rem 0 .3rem; color: var(--ink); font-size: 1.15rem; }
.ys-step p { margin: 0; }
.ys-n { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--ink); color: var(--gold); font-family: var(--mono); font-size: .72rem; }
.ys-story a { color: var(--pink-ink); }
.ys-method { max-width: 90ch; margin: 1.75rem 0; color: var(--soft); font-size: .82rem; }
.ys-method a { color: var(--gold); }
.ys-signoff { margin: 2rem 0; text-align: center; font-family: var(--serif); font-size: 1.2rem; }

@media (max-width: 1000px) { .ys-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ys-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .ys-options { grid-template-columns: minmax(0, 1fr); }
  .ys-name { font-size: 24px; } .ys-sub, .ys-spk-label { display: none; }
  .ys-readout { top: .35rem; left: .4rem; } .ys-chord { padding: .05rem .4rem; font-size: .9rem; } .ys-shape, .ys-bar { font-size: .62rem; }
}
@media (max-width: 560px) { .ys-steps, .ys-parts { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) {
  .ys-stage.is-playing .ys-fig.is-on .ys-bow, .ys-stage.is-playing .ys-fig.is-on .ys-strum, .ys-stage.is-playing.voice-on .ys-sing { animation: none; }
  .ys-fig, .ys-spot, .ys-band, .ys-cone, .ys-part { transition: none; }
}
