/* =========================
   Base (system UI)
   ========================= */
:root {
  color-scheme: light dark; /* allows native form controls to match */
  
  /* Accent system */
  --accent-link: #0969da;
  --accent-link-hover: #0969da;
  --accent-muted: #8b949e;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Ubuntu, Cantarell, "Noto Sans", Arial, sans-serif,
    "Apple Color Emoji","Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 16px;
}

/* =========================
   Site header
   ========================= */
.site-header {
  position: relative;
  padding-top: 16px;
  margin-bottom: 2em;
}

.site-header h1 {
  margin-top: 0;
  margin-bottom: 0.15em;
}

.site-header hr {
  width: 100%;
}

/* =========================
   Content typography rhythm
   ========================= */
.content section + section {
  margin-top: 3.5em;
}

.content h1,
.content h2,
.content h3,
.content h4 {
  margin: 1.2em 0 0.5em;
}

.content hr {
  border: 0;
  border-top: 1px solid #30363d;
  margin: 0.2em 0 0.9em;
}

.content hr + h4 {
  margin-top: 2em;
}

.content h1 + hr,
.content h2 + hr,
.content h3 + hr,
.content h4 + hr {
  margin-top: 0.25em;
}

h4 + p,
h4 + ul,
h4 + ol {
  margin-top: 0.3em;
  margin-bottom: 2em;
}

.content h2 + h3,
.content h3 + h3,
.content h3 + h4 {
  margin-top: 2em;
}

/* =========================
   Lists
   ========================= */
.content ul {
  list-style: none;
  padding-left: 2em;
  margin-left: 0;
}

li {
  margin: 0.2em 0;
  line-height: 1.4;
}

/* =========================
   Links
   ========================= */
a {
  color: var(--accent-link);
  text-decoration: none;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration: underline;
}

/* =========================
   External link icon
   ========================= */
a.external:not(.profile-icon)::after {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.22em;
  vertical-align: 0.05em;

  background-color: currentColor;

  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M18 13v6a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 3h6v6'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10 14 21 3'/%3E%3C/svg%3E");

  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M18 13v6a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 3h6v6'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10 14 21 3'/%3E%3C/svg%3E");

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;

  -webkit-mask-size: contain;
  mask-size: contain;
}

/* =========================
   Profile icon
   ========================= */
.profile-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}

.profile-icon img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(27, 31, 36, 0.15);
  background: transparent;
  display: block;
}


.profile-icon img:hover {
  border-color: var(--accent-link);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-link) 25%, transparent);
}

@media (max-width: 600px) {
  .profile-icon img {
    width: 40px;
    height: 40px;
  }
}

/* =========================
   Code (inline + blocks)
   ========================= */
/* inline code */
.content :not(pre) > code {
  font-family: ui-monospace, SFMono-Regular, SFMono, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  padding: 0.2em 0.35em;
  border-radius: 6px;
  background: rgba(175, 184, 193, 0.2);
}

/* code blocks: works for plain <pre><code> AND Rouge wrappers */
.content pre,
.content .highlight {
  border-radius: 6px;
  overflow-x: auto;
}

.content pre {
  padding: 16px;
  margin: 16px 0;
  background: #f6f8fa;
  border: 1px solid rgba(27, 31, 36, 0.15);
}

.content pre code {
  background: transparent;
  padding: 0;
}

.content .highlight {
  margin: 16px 0;
  background: #f6f8fa;
  border: 1px solid rgba(27, 31, 36, 0.15);
}

.content .highlight pre {
  margin: 0;
  border: 0;
  background: transparent;
}

/* =========================
   Blockquotes
   ========================= */
blockquote {
  margin: 0.75em 0;
  padding: 0.3em 1em;
  background-color: transparent;
  border-left: 3px solid #c9d1d9;
  color: #8b949e;
}

blockquote p {
  margin: 0;
}

/* =========================
   Tables
   ========================= */
.content table {
  border-collapse: collapse;
  background: transparent;
  width: max-content;
  max-width: 100%;
}

.content thead,
.content tbody,
.content tr,
.content th,
.content td {
  background: transparent;
}

.content th,
.content td {
  padding: 0 10px;
  line-height: 0.9;
  white-space: nowrap;
  border: 0;
}

.content thead th {
  padding-bottom: 10px;
}

.content tbody td {
  padding-top: 0;
  padding-bottom: 0;
}

/* Default alignment */
.content th {
  font-size: 1.15em;
  font-weight: 600;
  text-align: center;
}

.content td {
  text-align: left;
}

.content th.center,
.content td.center {
  text-align: center;
}

.content th.num,
.content td.num {
  text-align: right;
}

/* =========================
   Table copy button
   ========================= */
/* Keep the Copy column a stable width (prevents table jiggle) */
.content th.copy-col,
.content td.copy-col {
  width: 44px;
  padding: 0 6px;
  text-align: center;
}

/* Align the "Copy" header with the other headers */
.content thead th.copy-col {
  vertical-align: middle;
  line-height: 1.2;      /* override global 0.9 */
  padding-bottom: 10px;  /* match .content thead th */
}

/* Fixed-size button so icon/✓/✕ never changes row height */
.content .copy-row-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent-link);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  position: relative;
}

.content .copy-row-btn:disabled {
  cursor: default;
  opacity: 0.8;
}

/* Base icon geometry */
.copy-icon,
.status-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
}

/* Copy icon: rounded */
.copy-icon {
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Status icons: ultra-sharp */
.status-icon {
  stroke-width: 2;
  stroke-linecap: butt;
  stroke-linejoin: miter;
}

/* =========================
   Legend
   ========================= */
.console-legend {
  font-size: 0.9em;
  color: #8b949e;
  margin: 1em 0 1.25em 1.75em;
}

.console-legend ul {
  padding-left: 1.25em;
}

.console-legend li {
  margin: 0.15em 0;
  line-height: 1.3;
}

.console-legend summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.console-legend summary::-webkit-details-marker {
  display: none;
}

.console-legend summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 6px solid #8b949e;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.console-legend[open] > summary::before,
.console-legend details[open] > summary::before {
  transform: rotate(90deg);
}

/* ==================
   Section meta links
   ================== */
.music-section .section-meta {
 /* display: inline-block; */
  display: block;
  width: fit-content;
  font-size: 0.9em;
  color: var(--accent-link);
  margin: 1em 0 1.25em 1.75em;
}

/* =========================
   Collapsible music sections
   ========================= */
.music-section {
  margin: 0.1em 0;
}

.music-section > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.music-section > summary::-webkit-details-marker {
  display: none;
}

.music-section > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 6px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.music-section[open] > summary::before {
  transform: rotate(90deg);
}

/* prevent <h1>/<h2> default margins from pushing layout around */
.music-section > summary > h1,
.music-section > summary > h2,
.music-section > summary > h3 {
  margin: 0;
}

.music-section > table {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

/* =========================
   Page: Music
   ========================= */
.page-music .content.container {
  max-width: none;
  margin-left: 0;
  padding-left: 0;
  padding-right: 0;
}

.music-block {
  width: fit-content;
  overflow-x: auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.music-block .site-header hr {
  margin-top: 0.15em;
  margin-bottom: 1.1em;
}

.music-block > .site-header,
.music-block > section {
  padding: 0;
}

/* Use JS to set the "target width" for the header/hr */
.music-block {
  /* fallback: normal behavior until JS runs */
  --music-max-width: auto;
}

.music-block > .site-header {
  width: var(--music-max-width);
}

.music-block > .site-header hr {
  width: 100%;
}

/* =========================
   Random pick
   ========================= */
.random-pick {
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#randomPickBtn {
  appearance: none;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 5px;
  padding: 0.35rem 0.8rem;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.2;
  cursor: pointer;
}

#randomPickBtn:active {
  color: var(--accent-muted);
  border-color: var(--accent-muted);
}

.random-pick-result {
  margin-top: 0.75rem;
  min-height: var(--random-pick-reserve, 0px);
}

/* =========================
   Footer
   ========================= */
.site-footer {
  margin-top: 1em;
  padding-top: 0.5em;
  text-align: right;
  color: #8b949e;
  font-size: 0.9em;
}

.site-footer p {
  margin: 0.2em 0;
}

/* =========================
   Dark mode overrides
   ========================= */
@media (prefers-color-scheme: dark) {
  :root {
    --accent-link: #58a6ff;
    --accent-link-hover: #58a6ff;
  }
  
  body {
    background: #0d1117;
    color: #c9d1d9;
  }

  a {
    color: var(--accent-link);
  }
  
  .profile-icon img {
    border-color: #30363d;
    background: #0d1117;
  }
  
  /* inline code */
  .content :not(pre) > code {
    background: rgba(110, 118, 129, 0.4);
  }
  
  /* code blocks + rouge wrappers */
  .content pre,
  .content .highlight {
    background: #161b22;
    border-color: #30363d;
  }

  /* legends */
  .console-legend {
    color: #8b949e;
  }
}

