:root {
  color-scheme: dark;
  --paper: #101218;
  --ink: #eeebe5;
  --muted: #9ca4b1;
  --line: #303641;
  --ivory: #e5d4b1;
  --panel: #171b23;
  --accent: #cfac73;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  min-width: 280px;
  margin: 0;
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid #f0c991; outline-offset: 4px; }

.masthead, main { width: min(1420px, calc(100% - 104px)); margin: 0 auto; }

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 21px 0 19px;
  border-bottom: 1px solid var(--line);
}

.masthead .brand { color: var(--ink); text-decoration: none; }
.masthead .brand-period { color: var(--accent); }
.masthead .brand-mark { border-color: var(--accent); }
.back { color: #d8d5cb; text-decoration: none; }
.back span { margin-left: 8px; color: var(--accent); }

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 26px;
  padding: 37px 0 28px;
}

.edition { color: var(--accent); margin: 0 0 4px; font-size: 13px; }
.edition span { margin: 0 7px; color: #8d8578; }

h1, h2, p { margin: 0; }
h1, .stage-title h2 {
  font-family: "Songti SC", "AppleMyungjo", "Noto Serif KR", "Batang", Georgia, serif;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.067em;
}
h1 { font-size: clamp(54px, 6.1vw, 91px); }
h1 span { color: var(--accent); }

.intro > p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.85;
}

.concert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(275px, 0.36fr);
  gap: 18px;
  margin-bottom: 38px;
}

.performance, .mix { border: 1px solid var(--line); min-width: 0; }
.performance { background: #131721; }
.stage { position: relative; isolation: isolate; height: clamp(360px, 42vw, 510px); overflow: hidden; background: #121e2b; }
.stage canvas, .frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.frame { border: 1px solid rgba(240,230,207,0.18); inset: 13px; width: auto; height: auto; pointer-events: none; }
.stage-title { position: absolute; z-index: 1; left: 32px; bottom: 27px; text-shadow: 0 2px 18px #07090f; }
.stage-title span {
  color: #f5d9a8;
  font: 11px/1.4 ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.16em;
}
.stage-title h2 { font-size: clamp(42px, 5.25vw, 76px); margin-top: 4px; }
.transport { display: flex; align-items: center; gap: 16px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.play, .sound, #restore {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 14px;
  min-height: 42px;
  border-radius: 2px;
}
.play { color: #201a13; background: var(--ivory); border-color: var(--ivory); font-weight: 700; min-width: 104px; }
#play-icon { margin-right: 7px; font-size: 11px; }
.play:hover { background: #f7e5c2; }
.sound { white-space: nowrap; min-width: 84px; }
.sound[aria-pressed="true"] { color: var(--accent); border-color: #796746; }
.sound:hover, #restore:hover { border-color: var(--accent); }
.progress { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
.progress input { width: 100%; min-width: 35px; margin: 0; accent-color: var(--ivory); cursor: pointer; }
.progress output { min-width: 82px; display: block; text-align: right; white-space: nowrap; color: var(--ivory); font: 12px/1 ui-monospace, SFMono-Regular, monospace; }

.chapters { display: grid; grid-template-columns: repeat(4, 1fr); padding: 10px 18px 14px; gap: 8px; }
.chapter { color: var(--muted); border: 1px solid var(--line); border-top: 2px solid var(--line); background: none; text-align: left; padding: 8px 10px; min-height: 44px; white-space: nowrap; }
.chapter[aria-pressed="true"] { border-top-color: var(--accent); color: var(--ink); background: #232732; }
.chapter:hover { color: var(--ivory); }
.chapter span { color: #beab90; font: 11px/1 ui-monospace, SFMono-Regular, monospace; margin-right: 8px; }

.mix { display: flex; flex-direction: column; background: var(--panel); padding: 20px 18px; }
.mix-header { display: flex; justify-content: space-between; align-items: start; gap: 9px; margin-bottom: 19px; }
.mix h2 { font-size: 22px; line-height: 1.15; letter-spacing: -0.03em; }
.mix-header p { margin-top: 7px; color: var(--muted); font-size: 12px; text-wrap: pretty; }
#restore { min-height: 32px; flex-shrink: 0; font-size: 11px; padding: 4px 7px; }
#restore:disabled { opacity: 0.65; }

.tracks { display: grid; gap: 9px; }
.track {
  width: 100%;
  display: grid;
  gap: 8px;
  text-align: start;
  border: 1px solid var(--line);
  background: #1e232e;
  color: var(--ink);
  padding: 11px;
  transition: background-color 140ms;
  min-width: 0;
}
.track:hover { border-color: var(--track-color); background: #232936; }
.track[aria-pressed="false"] { color: #aeb3be; background: #13171f; }
.track-name { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.2; }
.track-name span:nth-child(2) { margin-left: auto; color: var(--muted); font-size: 11px; }
.track-dot { width: 7px; height: 7px; background: var(--track-color); border-radius: 50%; }
.track[aria-pressed="false"] .track-dot { background: none; border: 1px solid var(--muted); }
.track-score { position: relative; display: block; height: 36px; overflow: hidden; background: repeating-linear-gradient(90deg, #10131b 0, #10131b calc(25% - 1px), #3c424e calc(25% - 1px), #3c424e 25%); }
.track-score i { position: absolute; height: 2px; background: var(--track-color); opacity: 0.6; }
.track-score::after { content: ""; position: absolute; left: var(--position, 0%); height: 100%; width: 1px; background: var(--ivory); opacity: 0.8; }
.track[aria-pressed="false"] .track-score i { opacity: 0.16; }
#chapter-description { color: var(--ivory); font-size: 14px; margin-top: 21px; padding: 16px 2px 2px; border-top: 1px solid var(--line); text-wrap: pretty; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

@media (max-width: 850px) {
  .masthead, main { width: calc(100% - 40px); }
  .concert { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tracks { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .desktop { display: none; }
}

@media (max-width: 520px) {
  .masthead, main { width: calc(100% - 28px); }
  .masthead { padding: 14px 0; }
  .intro { align-items: start; flex-direction: column; gap: 8px; padding: 24px 0 19px; }
  .intro > p { margin: 0; font-size: 13px; }
  .edition { font-size: 12px; }
  h1 { font-size: clamp(42px, 10.8vw, 58px); }
  .stage { height: clamp(275px, 84vw, 415px); }
  .stage-title { left: 21px; bottom: 19px; }
  .frame { inset: 8px; }
  .transport { justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 10px 11px; }
  .progress { order: 1; width: 100%; flex: auto; }
  .play, .sound { min-height: 39px; }
  .chapters { padding: 8px 10px 10px; gap: 4px; }
  .chapter { padding: 7px 5px; text-align: center; }
  .chapter span { display: block; margin: 0 0 2px; }
  .mix { padding: 15px 12px; }
  .mix-header { margin-bottom: 11px; }
  .track { padding: 8px; }
  .track-name { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .track { transition: none; }
}
