/* Sidechain (sidechain.site): electronic & DJ culture, designed as sidechain compression.
   Everything live ducks under an invisible 124 BPM kick (period 0.4839 s: 40 ms attack, 380 ms release).
   Loaded only on this title's pages. Every class and keyframe is prefixed sidechain-. */

#site-root[data-site="sidechain"] { --sc-beat: .4839s; --sc-bar: 1.9355s; --sc-ease: cubic-bezier(.12, .72, .22, 1); color-scheme: dark; }
/* Doto is a dot-matrix face: thicken the dots a touch so small numerals stay legible. */
#site-root[data-site="sidechain"] .font-mono { -webkit-text-stroke: .3px currentColor; letter-spacing: .02em; }
#site-root[data-site="sidechain"] ::selection { background: #a58bff; color: #0b0b0e; }

/* ---------- the duck: one concave scooped corner (top-left) ---------- */
.sidechain-scoop {
  --scoop: 28px;
  -webkit-mask: radial-gradient(circle at 0 0, #0000 var(--scoop), #000 calc(var(--scoop) + .5px));
  mask: radial-gradient(circle at 0 0, #0000 var(--scoop), #000 calc(var(--scoop) + .5px));
}
.sidechain-scoop-s { --scoop: 14px; }
.sidechain-scoop-m { --scoop: 20px; }
.sidechain-scoop-l { --scoop: 40px; }
@media (min-width: 1024px) { .sidechain-scoop-l { --scoop: 56px; } }

/* Capsule with a scooped LEFT end (live label, CTA). */
.sidechain-cap {
  -webkit-mask: radial-gradient(circle at 0 50%, #0000 11px, #000 11.5px);
  mask: radial-gradient(circle at 0 50%, #0000 11px, #000 11.5px);
}

/* ---------- violet duotone (cover, article hero, mix of the week) ---------- */
:where(.sidechain-duo) { position: relative; }
.sidechain-duo { overflow: hidden; background: #a58bff; isolation: isolate; }
.sidechain-duo img { filter: grayscale(1) contrast(1.15) brightness(1.04); mix-blend-mode: multiply; }
.sidechain-duo::after { content: ''; position: absolute; inset: 0; background: #1c1235; mix-blend-mode: lighten; pointer-events: none; }
/* Card images keep their colour and duck to violet on hover (40 ms attack, 380 ms release). */
:where(.sidechain-tint) { position: relative; }
.sidechain-tint { overflow: hidden; background: #16161c; }
.sidechain-tint::after { content: ''; position: absolute; inset: 0; background: #8a6cff; mix-blend-mode: color; opacity: 0; transition: opacity .38s var(--sc-ease); pointer-events: none; }
.group:hover .sidechain-tint::after, .group:focus-visible .sidechain-tint::after { opacity: .92; transition-duration: .04s; }
.sidechain-tint img { transition: transform .38s var(--sc-ease); }
.group:hover .sidechain-tint img { transform: scale(1.025); transition-duration: .12s; }

/* Illustrated avatars, in duotone. */
.sidechain-ava { position: relative; display: inline-block; overflow: hidden; border-radius: 9999px; background: #a58bff; isolation: isolate; flex-shrink: 0; }
.sidechain-ava img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1); mix-blend-mode: multiply; }
.sidechain-ava::after { content: ''; position: absolute; inset: 0; background: #241848; mix-blend-mode: lighten; }

/* ---------- the shark-fin envelope: section dividers ---------- */
.sidechain-fin {
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 22'%3E%3Cpath d='M1 21.25V2.5C3.6 11.8 9.5 19.6 55 21.25Z' fill='%23a58bff' fill-opacity='.16'/%3E%3Cpath d='M1 21.25V2.5C3.6 11.8 9.5 19.6 55 21.25' fill='none' stroke='%23a58bff' stroke-width='1.4'/%3E%3C/svg%3E") left bottom / 56px 22px repeat-x;
}
.sidechain-fin-sm { height: 14px; background-size: 36px 14px; }
.sidechain-fin-dim { opacity: .55; }

/* ---------- the beat line under the header (dips on every kick) ---------- */
.sidechain-beat { height: 2px; background: #a58bff; transform-origin: 50% 100%; box-shadow: 0 0 24px rgba(165, 139, 255, .3); animation: sidechain-kick var(--sc-beat) infinite; }
@keyframes sidechain-kick {
  0% { transform: scaleY(1); animation-timing-function: linear; }
  8.3% { transform: scaleY(.2); animation-timing-function: var(--sc-ease); }
  86.8%, 100% { transform: scaleY(1); }
}
.sidechain-kick-s { animation: sidechain-kick-s var(--sc-beat) infinite; transform-origin: 0 50%; }
@keyframes sidechain-kick-s {
  0% { transform: scale(1); animation-timing-function: linear; }
  8.3% { transform: scale(.96); animation-timing-function: var(--sc-ease); }
  86.8%, 100% { transform: scale(1); }
}

/* Gain-reduction meter: segments 3-5 drop out on the kick and recover one by one. */
.sidechain-gr i:nth-child(3) { animation: sidechain-gr-a var(--sc-beat) infinite; }
.sidechain-gr i:nth-child(4) { animation: sidechain-gr-b var(--sc-beat) infinite; }
.sidechain-gr i:nth-child(5) { animation: sidechain-gr-c var(--sc-beat) infinite; }
@keyframes sidechain-gr-a { 0% { opacity: 1; } 8.3% { opacity: .2; } 36% { opacity: .2; } 46%, 100% { opacity: 1; } }
@keyframes sidechain-gr-b { 0% { opacity: 1; } 8.3% { opacity: .2; } 56% { opacity: .2; } 66%, 100% { opacity: 1; } }
@keyframes sidechain-gr-c { 0% { opacity: 1; } 8.3% { opacity: .2; } 76% { opacity: .2; } 86.8%, 100% { opacity: 1; } }

/* 1-2-3-4 beat counter: one cell per quarter of the bar. */
.sidechain-count i { animation: sidechain-count var(--sc-bar) steps(1, end) infinite; }
.sidechain-count i:nth-child(2) { animation-delay: var(--sc-beat); }
.sidechain-count i:nth-child(3) { animation-delay: calc(var(--sc-beat) * 2); }
.sidechain-count i:nth-child(4) { animation-delay: calc(var(--sc-beat) * 3); }
@keyframes sidechain-count {
  0% { background: #a58bff; color: #0b0b0e; box-shadow: 0 0 24px rgba(165, 139, 255, .3); }
  25%, 100% { background: transparent; color: #9b9aa6; box-shadow: none; }
}

/* Envelope line sweeping across the cover. */
.sidechain-sweep path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: sidechain-sweep calc(var(--sc-bar) * 2) var(--sc-ease) infinite; }
@keyframes sidechain-sweep { 0% { stroke-dashoffset: 1400; } 70%, 100% { stroke-dashoffset: 0; } }

/* ---------- links & buttons: 40 ms attack, 380 ms release ---------- */
.sidechain-link {
  background: linear-gradient(#a58bff, #a58bff) 0 100% / 100% 1px no-repeat;
  padding-bottom: 1px; transition: background-size .38s var(--sc-ease), color .38s var(--sc-ease);
}
.sidechain-link:hover { background-size: 100% .5px; color: #c9b8ff; transition-duration: .04s; }
.sidechain-h { background: linear-gradient(#a58bff, #a58bff) 0 100% / 0 1px no-repeat; transition: background-size .38s var(--sc-ease); }
.group:hover .sidechain-h, .group:focus-visible .sidechain-h { background-size: 100% 1px; transition-duration: .04s; }
.sidechain-h { -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.sidechain-btn {
  border: 1px solid #a58bff; border-radius: 9999px; color: #f0efe9;
  background: linear-gradient(#a58bff, #a58bff) 0 0 / 0 100% no-repeat;
  transition: background-size .38s var(--sc-ease), color .38s var(--sc-ease), box-shadow .38s var(--sc-ease);
}
.sidechain-btn:hover, .sidechain-btn:focus-visible, .sidechain-btn[aria-current="page"] { background-size: 100% 100%; color: #0b0b0e; box-shadow: 0 0 24px rgba(165, 139, 255, .3); transition-duration: .04s; }
.sidechain-btn-solid { background-size: 100% 100%; color: #0b0b0e; }

/* Nav library tags. */
.sidechain-tag { transition: color .38s var(--sc-ease), background-color .38s var(--sc-ease); }
.sidechain-tag:hover { transition-duration: .04s; }
.sidechain-tag[aria-current="page"] { color: #0b0b0e; background: #a58bff; box-shadow: 0 0 24px rgba(165, 139, 255, .3); }

/* ---------- the crate table ---------- */
.sidechain-row { transition: background-color .38s var(--sc-ease); }
.sidechain-row:hover { background-color: #16161c; transition-duration: .04s; }
.sidechain-row:hover .sidechain-play { opacity: 1; }
.sidechain-play { opacity: 0; transition: opacity .2s; }

/* Crate length filter (pure CSS: radio + :has). */
.sidechain-filter input { position: absolute; opacity: 0; pointer-events: none; }
.sidechain-filter label { cursor: pointer; }
.sidechain-filter input:checked + label { background-size: 100% 100%; color: #0b0b0e; }
.sidechain-filter input:focus-visible + label { outline: 2px solid #f0efe9; outline-offset: 2px; }
.sidechain-crate:has(#sc-len-short:checked) [data-len]:not([data-len="short"]),
.sidechain-crate:has(#sc-len-mid:checked) [data-len]:not([data-len="mid"]),
.sidechain-crate:has(#sc-len-long:checked) [data-len]:not([data-len="long"]) { display: none; }
.sidechain-crate .sidechain-none { display: none; }
.sidechain-crate:has(#sc-len-short:checked):not(:has([data-len="short"])) .sidechain-none,
.sidechain-crate:has(#sc-len-mid:checked):not(:has([data-len="mid"])) .sidechain-none,
.sidechain-crate:has(#sc-len-long:checked):not(:has([data-len="long"])) .sidechain-none { display: block; }

/* ---------- carousel edge fade ---------- */
.sidechain-fade { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), #0000); mask-image: linear-gradient(to right, #000 calc(100% - 48px), #0000); }
@media (min-width: 1024px) { .sidechain-fade { -webkit-mask-image: none; mask-image: none; } }
.sidechain-ring { box-shadow: 0 0 0 1px #2a2a34, 0 0 0 6px #0b0b0e, 0 0 0 7px #a58bff; }
.group:hover .sidechain-ring { box-shadow: 0 0 0 1px #2a2a34, 0 0 0 6px #0b0b0e, 0 0 0 7px #a58bff, 0 0 24px 6px rgba(165, 139, 255, .3); }

/* ---------- menu: the Camelot wheel ---------- */
.sidechain-wheel { animation: sidechain-spin .55s var(--sc-ease) both; }
@keyframes sidechain-spin { from { transform: rotate(-30deg) scale(.94); } to { transform: none; } }
.sidechain-sheet { animation: sidechain-rise .38s var(--sc-ease) both; }
@keyframes sidechain-rise { from { transform: translateY(24px); } to { transform: none; } }

/* ---------- article prose ---------- */
#site-root[data-site="sidechain"] .sidechain-prose { font-size: 18px; line-height: 1.72; color: #e4e3dc; }
@media (min-width: 768px) { #site-root[data-site="sidechain"] .sidechain-prose { font-size: 19px; } }
.sidechain-prose > * + * { margin-top: 1.15em; }
.sidechain-prose h2 { font-family: var(--font-head), system-ui, sans-serif; font-weight: 700; font-size: 1.42em; line-height: 1.18; color: #f0efe9; margin-top: 2.1em; scroll-margin-top: 6rem; display: flex; gap: .6em; align-items: baseline; }
.sidechain-prose h2::before { content: ''; flex: none; width: .55em; height: .55em; border: 2px solid #a58bff; border-radius: 9999px; transform: translateY(-.05em); }
.sidechain-prose h3 { font-family: var(--font-head), system-ui, sans-serif; font-weight: 600; font-size: 1.15em; margin-top: 1.8em; color: #f0efe9; }
.sidechain-prose a { color: #f0efe9; background: linear-gradient(#a58bff, #a58bff) 0 100% / 100% 1px no-repeat; padding-bottom: 1px; transition: background-size .38s var(--sc-ease), color .38s var(--sc-ease); text-decoration: none; }
.sidechain-prose a:hover { background-size: 100% .5px; color: #c9b8ff; transition-duration: .04s; }
.sidechain-prose strong { color: #fff; font-weight: 600; }
.sidechain-prose em { font-style: italic; }
.sidechain-prose ul { list-style: none; padding-left: 1.4em; }
.sidechain-prose ul li { position: relative; }
.sidechain-prose ul li::before { content: ''; position: absolute; left: -1.25em; top: .62em; width: .48em; height: .48em; border: 1.5px solid #a58bff; border-radius: 9999px; }
.sidechain-prose ol { list-style: none; counter-reset: sc; padding-left: 2.4em; }
.sidechain-prose ol li { position: relative; counter-increment: sc; }
.sidechain-prose ol li::before { content: counter(sc) "A"; position: absolute; left: -2.4em; top: .1em; font-family: var(--f-mono), monospace; font-weight: 800; font-size: .82em; color: #a58bff; }
.sidechain-prose li + li { margin-top: .45em; }
.sidechain-prose blockquote {
  margin: 2em 0; padding: 18px 0 34px; border: 0; border-top: 2px solid #a58bff; position: relative;
  font-family: var(--font-head), system-ui, sans-serif; font-weight: 600; font-size: 1.36em; line-height: 1.24; color: #f0efe9; font-style: normal;
}
@media (min-width: 768px) { .sidechain-prose blockquote { font-size: 1.6em; } }
.sidechain-prose blockquote::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 22'%3E%3Cpath d='M1 21.25V2.5C3.6 11.8 9.5 19.6 55 21.25Z' fill='%23a58bff' fill-opacity='.16'/%3E%3Cpath d='M1 21.25V2.5C3.6 11.8 9.5 19.6 55 21.25' fill='none' stroke='%23a58bff' stroke-width='1.4'/%3E%3C/svg%3E") left bottom / 56px 22px repeat-x; }
.sidechain-prose blockquote p { margin: 0; }
.sidechain-prose hr { border: 0; height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 22'%3E%3Cpath d='M1 21.25V2.5C3.6 11.8 9.5 19.6 55 21.25' fill='none' stroke='%23a58bff' stroke-width='1.4'/%3E%3C/svg%3E") left bottom / 36px 14px repeat-x; margin: 2.4em 0; }
.sidechain-prose code { font-family: ui-monospace, monospace; font-size: .86em; background: #16161c; padding: .1em .35em; border-radius: 4px; }
/* "The intro": the first three words, set in Doto. */
.sidechain-intro { font-family: var(--f-mono), monospace; font-weight: 800; font-size: 1.12em; letter-spacing: .01em; color: #a58bff; }

/* Comments: restyle the shared thread in the Sidechain idiom. */
.sidechain-comments h2 { font-family: var(--font-head), system-ui, sans-serif; }
.sidechain-comments form { border-radius: 0; border: 0; background: #16161c; }
.sidechain-comments input, .sidechain-comments textarea { border-radius: 14px; background: #0b0b0e; }
.sidechain-comments ul { counter-reset: sc-c; }
.sidechain-comments ul > li { counter-increment: sc-c; position: relative; }
.sidechain-comments ul > li > span:first-child { border-radius: 9999px; }

/* Waveform rail (article deck). */
.sidechain-wave i { transition: background-color .38s var(--sc-ease); }

@media (prefers-reduced-motion: reduce) {
  .sidechain-beat, .sidechain-kick-s, .sidechain-gr i, .sidechain-count i, .sidechain-sweep path, .sidechain-wheel, .sidechain-sheet { animation: none !important; }
  .sidechain-sweep path { stroke-dashoffset: 0; }
  .sidechain-count i:first-child { background: #a58bff; color: #0b0b0e; }
  .sidechain-tint::after, .sidechain-tint img, .sidechain-btn, .sidechain-link, .sidechain-h, .sidechain-row { transition: none; }
}

/* The drop: on desktop the mid-article image runs from the text column to the right edge of the screen. */
@media (min-width: 1024px) { .sidechain-drop { margin-right: calc(-1 * max(16px, (100vw - 1208px) / 2)); } }

/* Review fix: on the cover the lavender kicker sat straight on the lavender duotone sky when a long
   headline pushed it up (desktop); give it the same smoked chip as the tag above. */
.sidechain-sweep ~ div.bottom-0 > span:first-child {
  padding: 5px 11px 5px 9px; border-radius: 9999px; background: rgba(0, 0, 0, .58);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
