/* Sixteen Bars (sixteenbars.online): hip-hop news as two pads, the producer's 4x4 MPC grid and the writer's
   ruled rhyme notebook. Loaded only on this title's pages; every class and keyframe is prefixed sixteenbars-.
   Wheat #e3a33b, denim #22406b, near-black #121212, REC red #d7332b. No drop shadows anywhere. */

/* ---------- rubber pads: soft-square, inset lip at the bottom, press 2px down ---------- */
.sixteenbars-pad {
  border-radius: 10px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
  transition: transform .09s ease, box-shadow .09s ease, background-color .18s ease, border-color .18s ease;
}
a.sixteenbars-pad:active, button.sixteenbars-pad:active, .sixteenbars-press:active { transform: translateY(2px); box-shadow: none; }
a.sixteenbars-pad:hover, button.sixteenbars-pad:hover { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .24); }
.sixteenbars-pad-lit { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(0, 0, 0, .06); }

/* LED: the tiny square light on chips, bullets and pads */
.sixteenbars-led { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); flex-shrink: 0; }
.sixteenbars-led-red { background: #d7332b; }
.sixteenbars-led-off { background: color-mix(in srgb, currentColor 22%, transparent); }

/* ---------- ruled notebook paper: denim hairline every 32px, one red margin rule ---------- */
.sixteenbars-ruled {
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(34, 64, 107, .12) 31px 32px);
}
.sixteenbars-ruled-dark {
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(249, 248, 244, .09) 31px 32px);
}
.sixteenbars-margin { position: relative; }
.sixteenbars-margin::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: var(--sb-margin, 0px); width: 1px;
  background: rgba(215, 51, 43, .4); pointer-events: none;
}

/* ---------- links: a 3px wheat marker band on the lower third that floods the line on hover ---------- */
.sixteenbars-a {
  color: inherit; text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-size: 100% 3px; background-position: 0 88%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .22s ease;
}
.sixteenbars-a:hover, .sixteenbars-a:focus-visible { background-size: 100% 100%; }

/* Card headlines: no band at rest; on hover a wheat marker sweeps in under the lower part of the line. */
.sixteenbars-u {
  background-image: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 62%, transparent) 58%);
  background-repeat: no-repeat; background-size: 0% 100%; background-position: 0 0;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .32s cubic-bezier(.2, .7, .2, 1);
}
.group:hover .sixteenbars-u, .group:focus-visible .sixteenbars-u { background-size: 100% 100%; }
.sixteenbars-u-dark { background-image: linear-gradient(transparent 60%, rgba(227, 163, 59, .5) 60%); }

/* ---------- pad grid headlines: keep words whole, balance the rag ---------- */
.sixteenbars-balance { text-wrap: balance; }
.sixteenbars-pretty { text-wrap: pretty; }

/* ---------- horizontal pad bank (Bank B): left gutter + right edge fade ---------- */
@media (max-width: 1023px) {
  .sixteenbars-fade { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
}

/* ---------- the 16-tick ruler (dividers): four bars of four, first tick of each bar taller ---------- */
.sixteenbars-ruler {
  background-image:
    repeating-linear-gradient(to right, currentColor 0 2px, transparent 2px 6.25%),
    repeating-linear-gradient(to right, currentColor 0 2px, transparent 2px 25%);
  background-size: 100% 7px, 100% 12px; background-position: 0 100%, 0 100%; background-repeat: no-repeat;
}
.sixteenbars-noscroll { scrollbar-width: none; }
.sixteenbars-noscroll::-webkit-scrollbar { display: none; }

/* ---------- article body: notebook verses on a 32px line ---------- */
#site-root[data-site='sixteenbars'] .sixteenbars-prose { font-size: 18px; line-height: 32px; color: var(--fg); }
#site-root[data-site='sixteenbars'] .sixteenbars-prose > * + * { margin-top: 32px; }
#site-root[data-site='sixteenbars'] .sixteenbars-hook > p:first-of-type::first-line {
  font-family: var(--font-head), system-ui, sans-serif; text-transform: uppercase; font-size: .84em; letter-spacing: .015em;
}
#site-root[data-site='sixteenbars'] .sixteenbars-prose h2 {
  font-family: var(--font-head), system-ui, sans-serif; font-weight: 400; font-size: 22px; line-height: 32px;
  margin-top: 64px; scroll-margin-top: 6.5rem;
}
#site-root[data-site='sixteenbars'] .sixteenbars-prose h2::before {
  content: ''; display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--accent);
  margin-right: 12px; vertical-align: 3px;
}
#site-root[data-site='sixteenbars'] .sixteenbars-prose h2 + * { margin-top: 16px; }
#site-root[data-site='sixteenbars'] .sixteenbars-prose h3 { font-weight: 800; font-size: 19px; line-height: 32px; }
#site-root[data-site='sixteenbars'] .sixteenbars-prose strong { font-weight: 700; }
#site-root[data-site='sixteenbars'] .sixteenbars-prose em { font-style: italic; }
#site-root[data-site='sixteenbars'] .sixteenbars-prose a {
  color: inherit; text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat;
  background-size: 100% 3px; background-position: 0 86%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-size .22s ease;
}
#site-root[data-site='sixteenbars'] .sixteenbars-prose a:hover { background-size: 100% 100%; }

/* bullets: tiny filled squares like pad LEDs */
#site-root[data-site='sixteenbars'] .sixteenbars-prose ul { list-style: none; padding-left: 26px; }
#site-root[data-site='sixteenbars'] .sixteenbars-prose ul > li { position: relative; }
#site-root[data-site='sixteenbars'] .sixteenbars-prose ul > li::before {
  content: ''; position: absolute; left: -22px; top: 12px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent);
  outline: 1px solid rgba(18, 18, 18, .55); outline-offset: 0;
}
/* numbered lists: leading zeros in mono */
#site-root[data-site='sixteenbars'] .sixteenbars-prose ol { list-style: none; padding-left: 42px; counter-reset: sixteenbars-ol; }
#site-root[data-site='sixteenbars'] .sixteenbars-prose ol > li { position: relative; counter-increment: sixteenbars-ol; }
#site-root[data-site='sixteenbars'] .sixteenbars-prose ol > li::before {
  content: counter(sixteenbars-ol, decimal-leading-zero); position: absolute; left: -42px; top: 0;
  font-family: var(--f-mono), ui-monospace, monospace; font-size: 13px; font-weight: 600; color: var(--accent2);
}
#site-root[data-site='sixteenbars'] .sixteenbars-prose li + li { margin-top: 0; }

/* quotes: a verse sheet. Ruled lines, each line numbered, underlined in rotating marker colours */
#site-root[data-site='sixteenbars'] .sixteenbars-prose blockquote {
  counter-reset: sixteenbars-q; position: relative; margin-left: 0; padding: 0 0 0 46px;
  font-weight: 600; font-size: 20px; line-height: 32px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(34, 64, 107, .2) 31px 32px);
}
#site-root[data-site='sixteenbars'] .sixteenbars-prose blockquote::after {
  content: ''; position: absolute; left: 34px; top: 0; bottom: 0; width: 1px; background: rgba(215, 51, 43, .45);
}
#site-root[data-site='sixteenbars'] .sixteenbars-prose blockquote p { position: relative; counter-increment: sixteenbars-q; }
#site-root[data-site='sixteenbars'] .sixteenbars-prose blockquote p + p { margin-top: 0; }
#site-root[data-site='sixteenbars'] .sixteenbars-prose blockquote p::before {
  content: counter(sixteenbars-q, decimal-leading-zero); position: absolute; left: -46px; top: 1px;
  font-family: var(--f-mono), ui-monospace, monospace; font-size: 12px; font-weight: 500; color: var(--muted);
}
#site-root[data-site='sixteenbars'] .sixteenbars-prose blockquote p {
  text-decoration-line: underline; text-decoration-thickness: 5px; text-underline-offset: -1px; text-decoration-skip-ink: none;
  text-decoration-color: rgba(227, 163, 59, .75);
}
#site-root[data-site='sixteenbars'] .sixteenbars-prose blockquote p:nth-child(3n + 2) { text-decoration-color: rgba(34, 64, 107, .4); }
#site-root[data-site='sixteenbars'] .sixteenbars-prose blockquote p:nth-child(3n) { text-decoration-color: rgba(215, 51, 43, .38); }

@media (max-width: 639px) {
  #site-root[data-site='sixteenbars'] .sixteenbars-prose { font-size: 17.5px; line-height: 30px; }
  #site-root[data-site='sixteenbars'] .sixteenbars-prose > * + * { margin-top: 26px; }
  #site-root[data-site='sixteenbars'] .sixteenbars-prose blockquote { font-size: 18.5px; line-height: 30px; padding-left: 40px;
    background-image: repeating-linear-gradient(to bottom, transparent 0 29px, rgba(34, 64, 107, .2) 29px 30px); }
  #site-root[data-site='sixteenbars'] .sixteenbars-prose blockquote::after { left: 29px; }
  #site-root[data-site='sixteenbars'] .sixteenbars-prose blockquote p::before { left: -40px; }
  #site-root[data-site='sixteenbars'] .sixteenbars-prose h2 { font-size: 20px; line-height: 28px; margin-top: 48px; }
  #site-root[data-site='sixteenbars'] .sixteenbars-ruled-body {
    background-image: repeating-linear-gradient(to bottom, transparent 0 29px, rgba(34, 64, 107, .1) 29px 30px);
  }
}

/* bar numbers in the article gutter: one per two lines (64px), restart after 16 */
.sixteenbars-bars { counter-reset: sixteenbars-bar; }
.sixteenbars-bars > span { display: block; height: 64px; }
.sixteenbars-ticks { background-image: repeating-linear-gradient(to bottom, transparent 0 21px, var(--accent2) 21px 22px, transparent 22px 60px); background-size: 7px 60px; background-repeat: repeat-y; opacity: .45; }

/* ---------- shared pieces restyled into pads ---------- */
.sixteenbars-comments #comments { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sixteenbars-comments form { margin-top: 0; border-radius: 10px; background: var(--surface); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); }
.sixteenbars-comments input, .sixteenbars-comments textarea { border-radius: 8px; }
.sixteenbars-comments button { border-radius: 10px; background: #121212; color: var(--accent); box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .12); }
.sixteenbars-comments button:active { transform: translateY(2px); box-shadow: none; }
.sixteenbars-comments ul { counter-reset: sixteenbars-c; border-top: 1px solid var(--line); }
.sixteenbars-comments ul > li { counter-increment: sixteenbars-c; }
.sixteenbars-comments ul > li > span:first-child { border-radius: 8px; }
.sixteenbars-comments ul > li > div::before {
  content: 'Verse ' counter(sixteenbars-c, decimal-leading-zero); display: block; margin-bottom: 2px;
  font-family: var(--f-mono), ui-monospace, monospace; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent2);
}

.sixteenbars-form input { border-radius: 10px; border-color: rgba(18, 18, 18, .25); background: #fbf6ea; }
.sixteenbars-form button { border-radius: 10px; background: #121212; color: var(--accent); box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .14); }
.sixteenbars-form button:active { transform: translateY(2px); box-shadow: none; }
.sixteenbars-form > div { border-radius: 10px; border-color: #121212; color: #121212; }
.sixteenbars-form span { color: #121212; }

.sixteenbars-share a, .sixteenbars-share button { border-radius: 10px; background: var(--surface); color: var(--fg); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14); }
.sixteenbars-share a:active, .sixteenbars-share button:active { transform: translateY(2px); box-shadow: none; }

/* ---------- live signal: REC at 90 BPM, a 4-step sequencer, the label pad dipping on the beat ---------- */
@keyframes sixteenbars-blink { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: .25; } }
@keyframes sixteenbars-seq { 0%, 24.9% { opacity: 1; } 25%, 100% { opacity: .25; } }
@keyframes sixteenbars-beat { 0% { transform: translateY(1px); } 22%, 100% { transform: translateY(0); } }
.sixteenbars-rec { animation: sixteenbars-blink 667ms infinite; }
.sixteenbars-step { opacity: .25; animation: sixteenbars-seq 2668ms infinite; }
.sixteenbars-step:nth-child(2) { animation-delay: 667ms; }
.sixteenbars-step:nth-child(3) { animation-delay: 1334ms; }
.sixteenbars-step:nth-child(4) { animation-delay: 2001ms; }
.sixteenbars-dip { animation: sixteenbars-beat 667ms ease-out infinite; }

/* menu panel: pads drop in one after another */
@keyframes sixteenbars-in { from { transform: translateY(-6px); } to { transform: none; } }
.sixteenbars-menu-in > * { animation: sixteenbars-in .22s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  .sixteenbars-rec, .sixteenbars-step, .sixteenbars-dip, .sixteenbars-menu-in > * { animation: none; }
  .sixteenbars-step { opacity: .6; }
  .sixteenbars-step:first-child { opacity: 1; }
  .sixteenbars-u, .sixteenbars-a, .sixteenbars-pad { transition: none; }
}

/* Review fix: .sixteenbars-margin's position:relative overrode the Notebook's lg:sticky, so its
   top-24 became a 96px drop below the pad grid (an empty band top right). Sticky where the whole
   notebook fits under the offset, plain in-flow (no offset) elsewhere. */
@media (min-width: 1024px) {
  aside.sixteenbars-margin[aria-labelledby='sb-notebook'] { top: 0; }
}
@media (min-width: 1024px) and (min-height: 920px) {
  aside.sixteenbars-margin[aria-labelledby='sb-notebook'] { position: sticky; top: 6rem; }
}

/* ---------- a story without a photo: the section name on a wheat-tinted pad, ink type (wheat on paper is too faint) ---------- */
#site-root[data-site="sixteenbars"] .sixteenbars-nopic:not(.nopic-deep) { background-color: color-mix(in srgb, var(--accent) 26%, var(--surface)); color: #121212; }
#site-root[data-site="sixteenbars"] .sixteenbars-nopic.nopic-deep { background-color: #1d1d1d; color: var(--accent); }
#site-root[data-site="sixteenbars"] .sixteenbars-nopic .nopic-glyph { opacity: .16; }
#site-root[data-site="sixteenbars"] .sixteenbars-nopic .nopic-rule { background: #d7332b; }
