/* =====================================================================
   SOLIZ — shared system
   One family (Arimo, 400/700). 8px baseline. 12-column grid.
   Every size below is a token; pages only choose columns + colours.
   ===================================================================== */
:root {
  /* spacing: multiples of the 8px baseline only */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s6: 48px; --s8: 64px;
  /* grid */
  --m: 32px; --gut: 16px;
  /* fixed component sizes */
  --bar: 48px; --status: 24px; --modh: 24px; --row: 64px; --btn: 32px; --cov: 48px; --cov-l: 192px; --drawer: 384px;
  /* type scale: 5 sizes, every line-height on the 8px baseline */
  --t0: 10px; --l0: 16px;   /* labels, meta (caps) */
  --t1: 13px; --l1: 16px;   /* text, titles in rows */
  --t2: 24px; --l2: 32px;   /* prices, sub-heads */
  --t3: 40px; --l3: 48px;   /* display (small screens) */
  --t4: 64px; --l4: 64px;   /* display */
  --font: "Arimo", Arial, Helvetica, sans-serif;
  --track: .16em;           /* caps tracking, used everywhere caps appear */
  /* stepped motion (2Advanced-style): 1 frame = 33ms at 30fps */
  --f: 33ms;
  /* colour — each page overrides these, nothing else */
  --bg: #04060d; --fg: #e9f1ff; --dim: rgba(233,241,255,.56); --line: rgba(233,241,255,.18);
  --panel: rgba(6,12,30,.66); --modh-bg: rgba(233,241,255,.06); --flash: #dfe6f2;
  --verm: #e8432e; --verm-glow: rgba(232,67,46,.5);
  --kick: 0;
}
@media (max-width: 1023px) { :root { --m: 24px; } }
@media (max-width: 639px)  { :root { --m: 16px; --t4: 40px; --l4: 48px; --t3: 24px; --l3: 32px; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
body { font: 400 var(--t1)/var(--l1) var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
.label { font-size: var(--t0); line-height: var(--l0); letter-spacing: var(--track); text-transform: uppercase; color: var(--dim); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
.no-gl .gl { background: radial-gradient(circle at 40% 40%, #1d3fbf, #04060d 70%); }

/* ---------------- grid ---------------- */
.cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); }
@media (max-width: 639px) { .cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* top bar: logo 1–3 · designs 6–11 · cart 12 */
.bar { position: fixed; z-index: 40; top: 0; left: 0; right: 0; height: var(--bar); padding: 0 var(--m); align-items: center; border-bottom: 1px solid var(--line); background: var(--bar-bg, rgba(0,0,0,.35)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.bar-logo { grid-column: 1 / 4; display: flex; gap: var(--s2); align-items: baseline; text-decoration: none; color: var(--fg); }
.bar-logo b { font-size: var(--t1); letter-spacing: var(--track); }
.bar-nav { grid-column: 6 / 12; display: grid; grid-template-columns: repeat(10, 1fr); height: var(--bar); }
.bar-nav a { display: grid; place-items: center; border-left: 1px solid var(--line); color: var(--dim); text-decoration: none; font-size: var(--t0); letter-spacing: var(--track); }
.bar-nav a:last-child { border-right: 1px solid var(--line); }
.bar-nav a:hover { color: var(--fg); background: var(--modh-bg); }
.bar-nav a[aria-current] { color: var(--bg); background: var(--fg); }
.bar-cart { grid-column: 12 / 13; justify-self: end; display: flex; gap: var(--s1); align-items: center; }
.count { min-width: 24px; height: 16px; padding: 0 4px; display: inline-grid; place-items: center; font-size: var(--t0); line-height: var(--l0); box-shadow: inset 0 0 0 1px var(--line); }
.count.has { background: var(--verm); color: #fff; box-shadow: 0 0 16px var(--verm-glow); }
@media (max-width: 639px) { .bar-logo { grid-column: 1 / 3; } .bar-nav { display: none; } .bar-cart { grid-column: 3 / 5; } }

/* status line (L5): left 1–6, right 7–12 */
.status { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: var(--status); padding: 0 var(--m); align-items: center; border-top: 1px solid var(--line); background: var(--bar-bg, rgba(0,0,0,.35)); }
.status-l { grid-column: 1 / 7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-r { grid-column: 7 / 13; justify-self: end; display: flex; gap: var(--s3); }
.status-r button:hover { color: var(--fg); }
@media (max-width: 639px) { .status-l { grid-column: 1 / 3; } .status-r { grid-column: 3 / 5; } }

/* the frame: everything a page places lives on these 12 columns, between bar and status */
.frame { position: fixed; z-index: 10; top: calc(var(--bar) + var(--s4)); bottom: calc(var(--status) + var(--s4)); left: var(--m); right: var(--m); grid-template-rows: minmax(0, 1fr); row-gap: var(--gut); }
.frame.flow { position: relative; inset: auto; padding: calc(var(--bar) + var(--s8)) var(--m) calc(var(--status) + var(--s8)); grid-template-rows: none; row-gap: var(--s4); }
.focus { pointer-events: none; }
@media (max-width: 639px) {
  .frame { position: relative; inset: auto; padding: calc(var(--bar) + var(--s3)) var(--m) calc(var(--status) + var(--s6)); grid-template-rows: none; row-gap: var(--s2); }
  .frame > * { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .frame > .focus { height: 40vh; }
}

/* ---------------- module (2Advanced-style panel) ---------------- */
.mod { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.mod.bare { background: none; box-shadow: none; }
.mod.bare .mod-h { background: none; box-shadow: inset 0 -1px 0 var(--line); }
.mod-h { flex: none; height: var(--modh); display: flex; justify-content: space-between; align-items: center; padding: 0 var(--s1); background: var(--modh-bg); box-shadow: inset 0 -1px 0 var(--line); }
.mod-h .label b { color: var(--fg); font-weight: 400; }
.mod-b { position: relative; min-height: 0; padding: var(--s2); }
.mod-f { flex: none; height: var(--modh); display: flex; justify-content: space-between; align-items: center; padding: 0 var(--s1); box-shadow: inset 0 1px 0 var(--line); }

/* ---------------- hero (L1 → L4) ---------------- */
.hero-b { display: grid; row-gap: var(--s2); }
.hero-b.has-cover { grid-template-columns: var(--cov-l) minmax(0, 1fr); column-gap: var(--s2); align-items: start; }
.hero-b.has-cover > .hero-cover { grid-row: 1 / span 5; width: var(--cov-l); height: var(--cov-l); }
.hero-t { font-size: var(--t4); line-height: var(--l4); font-weight: 700; letter-spacing: -.03em; text-transform: lowercase; overflow-wrap: anywhere; }
.hero-m { color: var(--dim); }
.buy { display: flex; align-items: center; column-gap: var(--s2); }
.price { font-size: var(--t2); line-height: var(--l2); font-weight: 700; color: var(--verm); }
.btn-add { height: var(--btn); padding: 0 var(--s2); background: var(--verm); color: #fff; font-size: var(--t0); letter-spacing: var(--track); text-transform: uppercase; font-weight: 700; box-shadow: 0 0 16px var(--verm-glow); }
.btn-add.saved { background: none; color: var(--verm); box-shadow: inset 0 0 0 1px var(--verm); }

/* ---------------- the player: identical everywhere ---------------- */
.ply { display: grid; grid-template-columns: var(--btn) minmax(0, 1fr) auto; column-gap: var(--s2); align-items: center; }
.pbtn { width: var(--btn); height: var(--btn); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); flex: none; }
.pbtn:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.pbtn svg { width: 10px; height: 10px; fill: currentColor; }
.pbtn .i-pause { display: none; }
.is-playing .pbtn .i-play, .pbtn.is-playing .i-play { display: none; }
.is-playing .pbtn .i-pause, .pbtn.is-playing .i-pause { display: block; }
.is-playing .pbtn, .pbtn.is-playing { background: var(--fg); color: var(--bg); box-shadow: 0 0 calc(var(--kick) * 24px) var(--fg); }
.rail { display: block; height: 2px; background: var(--line); position: relative; }
.is-playing .rail { cursor: pointer; }
.rail::before { content: ""; position: absolute; left: 0; right: 0; top: -7px; bottom: -7px; }   /* 16px hit area on the 2px line */
.rail > b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--fg); box-shadow: 0 0 calc(var(--kick) * 12px) var(--fg); }
.time { font-size: var(--t0); line-height: var(--l0); letter-spacing: var(--track); color: var(--dim); min-width: 72px; text-align: right; }

/* ---------------- track row: identical everywhere ----------------
   [index 24] [play 32] [cover 48] [title + meta / rail] [price] [add 32] */
.rows { container-type: inline-size; overflow: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.row { display: grid; grid-template-columns: 24px var(--btn) var(--cov) minmax(0, 1fr) auto var(--btn); column-gap: var(--s2); align-items: center; height: var(--row); padding: 0 var(--s1); box-shadow: inset 0 -1px 0 var(--line); cursor: pointer; position: relative; }
.row:hover { background: var(--modh-bg); }
.row[aria-current="true"] { background: var(--modh-bg); box-shadow: inset 2px 0 0 var(--fg), inset 0 -1px 0 var(--line); }
.row-i { font-size: var(--t0); letter-spacing: var(--track); color: var(--dim); }
.row img { width: var(--cov); height: var(--cov); }
.row-tx { min-width: 0; display: grid; row-gap: 0; }
.row-t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-m { display: grid; grid-template-columns: minmax(0, 1fr); height: var(--l0); align-items: center; }
.row-m .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-m .ply-mini { display: none; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s1); align-items: center; }
.row-m .time { min-width: 0; }
.row.is-playing .row-m .label { display: none; }
.row.is-playing .row-m .ply-mini { display: grid; }
.row-p { font-weight: 700; text-align: right; }
.row[aria-current="true"] .row-p { color: var(--verm); }
.row-a { width: var(--btn); height: var(--btn); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--t1); }
.row-a:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.row-a.saved { color: var(--verm); box-shadow: inset 0 0 0 1px var(--verm); }
.row.off { display: none; }
@container (max-width: 440px) {
  .row { grid-template-columns: var(--btn) var(--cov) minmax(0, 1fr) auto var(--btn); column-gap: var(--s1); }
  .row-i { display: none; }
}

/* filters inside the shop module header */
.filters { display: flex; gap: var(--s2); }
.filters button { font-size: var(--t0); line-height: var(--modh); letter-spacing: var(--track); text-transform: uppercase; color: var(--dim); }
.filters button[aria-pressed="true"] { color: var(--fg); box-shadow: inset 0 -1px 0 var(--fg); }

/* ---------------- stepped motion ---------------- */
/* build-in: hairlines draw, module heads flash, rows step in (each step = 2 frames) */
.build .mod { animation: b-frame calc(var(--f) * 8) steps(4, end) both; animation-delay: calc(var(--i, 0) * var(--f) * 2); }
.build .mod-h { animation: b-head calc(var(--f) * 6) steps(3, end) both; animation-delay: calc(var(--i, 0) * var(--f) * 2 + var(--f) * 8); }
.build .row { animation: b-in calc(var(--f) * 4) steps(2, end) both; animation-delay: calc(var(--f) * 14 + var(--r, 0) * var(--f)); }
@keyframes b-frame { from { clip-path: inset(0 100% 100% 0); background: transparent; } 50% { clip-path: inset(0 0 calc(100% - 1px) 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes b-head { from { background: var(--flash); } 66% { background: var(--line); } }
@keyframes b-in { from { opacity: 0; } }

/* engage: the 2001 module transition — angled plate → flash → ring contracts → label → inset grows → overexposed fade */
.engage { position: absolute; inset: var(--modh) 0 0 0; pointer-events: none; z-index: 5; display: none; overflow: hidden; }
.engage.on { display: block; animation: e-bg calc(var(--f) * 18) step-end forwards; }
.engage::before { content: ""; position: absolute; inset: 0; background: var(--flash); animation: e-plate calc(var(--f) * 18) step-end forwards; }
.engage i { position: absolute; left: 50%; top: 50%; width: var(--s6); height: var(--s6); margin: -24px 0 0 -24px; border-radius: 50%; border: 3px solid var(--ring, var(--bg)); border-left-color: transparent; border-right-color: transparent; opacity: 0; animation: e-ring calc(var(--f) * 18) step-end forwards; }
.engage span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding-bottom: 2px; border-bottom: 1px solid var(--fg); opacity: 0; animation: e-label calc(var(--f) * 18) step-end forwards; color: var(--fg); }
@keyframes e-plate {
  0%   { clip-path: polygon(0 60%, 96% 56%, 100% 100%, 0 100%); opacity: .55; }
  11%  { clip-path: polygon(0 30%, 96% 24%, 100% 100%, 0 100%); opacity: .9; }
  22%  { clip-path: polygon(0 8%, 98% 2%, 100% 100%, 0 100%); opacity: .55; }
  33%  { clip-path: inset(0); opacity: .9; }
  44%  { clip-path: inset(0); opacity: .6; }
  55%  { clip-path: inset(0); opacity: 0; }
  72%  { clip-path: inset(var(--s2)); opacity: .5; }
  83%  { clip-path: inset(var(--s1)); opacity: .8; }
  89%  { clip-path: inset(0); opacity: .45; }
  100% { clip-path: inset(0); opacity: 0; }
}
@keyframes e-bg { 0% { background: transparent; } 33% { background: var(--bg); } 89% { background: transparent; } }
@keyframes e-ring { 0% { opacity: 0; } 33% { opacity: 1; transform: scale(1); } 44% { transform: scale(.66); } 50% { transform: scale(.33); } 55% { opacity: 0; } }
@keyframes e-label { 0% { opacity: 0; } 55% { opacity: 1; } 72% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .build .mod, .build .mod-h, .build .row, .engage.on { animation: none; } .engage.on { display: none; } }

/* ---------------- fx overlays ---------------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.fx > * { position: absolute; inset: 0; }
.fx-blob { inset: auto; transform: translate(-50%, -50%); animation: drift linear infinite alternate; }
.fx-blob svg { width: 100%; height: 100%; display: block; }
@keyframes drift { 0% { transform: translate(-50%, -50%) rotate(0) scale(1); } 50% { transform: translate(-30%, -64%) rotate(140deg) scale(1.25); } 100% { transform: translate(-66%, -40%) rotate(300deg) scale(.85); } }
.fx-grain { background-image: var(--noise); opacity: .09; mix-blend-mode: overlay; animation: grain .5s steps(6) infinite; inset: -50%; }
@keyframes grain { 0% { transform: translate(0, 0) } 20% { transform: translate(-7%, 4%) } 40% { transform: translate(5%, -6%) } 60% { transform: translate(-3%, 8%) } 80% { transform: translate(8%, 2%) } 100% { transform: translate(-5%, -3%) } }
.fx-scan { background: repeating-linear-gradient(to bottom, rgba(0,0,0,.26) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.fx-mask { background: repeating-linear-gradient(90deg, rgba(255,0,60,.05) 0 1px, rgba(0,255,120,.04) 1px 2px, rgba(40,90,255,.06) 2px 3px); mix-blend-mode: screen; }
.fx-vig { background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.6) 100%); }
@media (prefers-reduced-motion: reduce) { .fx-blob, .fx-grain { animation: none; } }

/* ---------------- cart drawer (6 × 64px rows of the same system) ---------------- */
.cart { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(var(--drawer), 100vw); display: flex; flex-direction: column; background: var(--bg); box-shadow: -1px 0 0 var(--line); transform: translateX(100%); visibility: hidden; }
.cart.open { transform: none; visibility: visible; animation: c-in calc(var(--f) * 6) steps(3, end); }
@keyframes c-in { from { transform: translateX(100%); } }
.cart-h { height: var(--bar); display: flex; justify-content: space-between; align-items: center; padding: 0 var(--s2); box-shadow: inset 0 -1px 0 var(--line); }
.cart-l { flex: 1; overflow: auto; }
.cart-row { display: grid; grid-template-columns: var(--cov) minmax(0, 1fr) auto var(--btn); column-gap: var(--s2); align-items: center; height: var(--row); padding: 0 var(--s2); box-shadow: inset 0 -1px 0 var(--line); }
.cart-row img { width: var(--cov); height: var(--cov); }
.cart-row b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-row button { width: var(--btn); height: var(--btn); color: var(--dim); }
.cart-empty { padding: var(--s2); color: var(--dim); }
.cart-f { padding: var(--s2); display: grid; row-gap: var(--s2); box-shadow: inset 0 1px 0 var(--line); }
.cart-sum { display: flex; justify-content: space-between; align-items: baseline; }
.cart-sum b { font-size: var(--t2); line-height: var(--l2); }
.cart-go { height: var(--s6); background: var(--verm); color: #fff; font-weight: 700; letter-spacing: var(--track); text-transform: uppercase; font-size: var(--t0); }
.cart-go:disabled { opacity: .35; cursor: default; }

.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--status) + var(--s4)); transform: translateX(-50%); height: var(--btn); padding: 0 var(--s2); display: flex; align-items: center; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); visibility: hidden; max-width: calc(100vw - 2 * var(--m)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.on { visibility: visible; animation: b-in calc(var(--f) * 4) steps(2, end); }

/* ---------- invisible-grid designs share only measurements ---------- */
:root { --t5: 128px; --l5: 128px; --cov-m: 96px; }
@media (max-width: 639px) { :root { --t5: 64px; --l5: 64px; } }
[data-nav] { display: flex; flex-wrap: wrap; column-gap: var(--s2); }
[data-nav] a { color: inherit; text-decoration: none; opacity: .5; }
[data-nav] a:hover, [data-nav] a[aria-current] { opacity: 1; }
[data-nav] a[aria-current] { text-decoration: underline; text-underline-offset: 4px; }
.is-off { display: none !important; }
.glyph-play::before { content: "▶"; }
.is-playing .glyph-play::before, .sel-playing .glyph-sel::before { content: "❚❚"; letter-spacing: -.1em; }
.glyph-sel::before { content: "▶"; }

/* ---------- now-playing header (shared; each design only re-places the three parts) ---------- */
.nd { align-items: end; row-gap: var(--s1); }
.nd > * { min-width: 0; }
.nd-l { grid-column: 1 / 5; }
.nd-t { font-size: var(--t3); line-height: var(--l3); font-weight: 700; letter-spacing: -.02em; text-transform: lowercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-by { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-w { grid-column: 5 / 11; }
.nd-cv { display: block; width: 100%; height: var(--s8); cursor: pointer; color: var(--fg); }
.nd-tm { display: flex; justify-content: space-between; }
.nd-r { grid-column: 11 / 13; justify-self: end; text-align: right; }
.nd-bb { font-size: var(--t3); line-height: var(--l3); font-weight: 700; letter-spacing: -.02em; }
.nd-c { display: flex; column-gap: var(--s1); justify-content: flex-end; align-items: baseline; white-space: nowrap; }
.nd-c button { color: inherit; }
.nd-pr, .nd-add { font-weight: 700; color: var(--verm); }
.sel-saved .nd-add { opacity: .5; }
.cart-n { width: var(--cov); height: var(--cov); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); font-size: var(--t0); letter-spacing: var(--track); }
@media (max-width: 639px) { .nd-l, .nd-w, .nd-r { grid-column: 1 / 5; justify-self: stretch; text-align: left; } .nd-c { justify-content: flex-start; } }

/* ---------- no browser-default colours (the purple was the system accent on text selection) ---------- */
:root { accent-color: var(--fg); -webkit-tap-highlight-color: transparent; }
::selection { background: var(--fg); color: var(--bg); }
a, a:visited { color: inherit; }
:focus:not(:focus-visible) { outline: none; }
[data-id], [data-id] *, .tile, button { -webkit-user-select: none; user-select: none; }
