/* The remix mode of the home page: the paper turns to ink and the ink to paper, smoothly (the colours are registered properties,
   so the browser animates the very tokens every element reads). /remix/ is the same page already in this mode. */
@property --paper  { syntax:'<color>'; inherits:true; initial-value:#f4f1ea; }
@property --ink    { syntax:'<color>'; inherits:true; initial-value:#141414; }
@property --soft   { syntax:'<color>'; inherits:true; initial-value:rgba(20,20,20,.68); }
@property --rule   { syntax:'<color>'; inherits:true; initial-value:rgba(20,20,20,.28); }
@property --accent { syntax:'<color>'; inherits:true; initial-value:#b3361a; }
:root { transition:--paper .9s var(--ease), --ink .9s var(--ease), --soft .9s var(--ease), --rule .9s var(--ease), --accent .9s var(--ease); }
html.remix { --paper:#141414; --ink:#f4f1ea; --soft:rgba(244,241,234,.68); --rule:rgba(244,241,234,.28); --accent:#4cc9e5; }
html.remix ::selection { background:rgba(76,201,229,.3); }

/* the art and the logo are inverted with the page */
.cover, h1 img { transition:filter .9s var(--ease), box-shadow .9s var(--ease); }
html.remix .cover, html.remix h1 img { filter:invert(1); }
html.remix .cover { box-shadow:0 18px 40px rgba(244,241,234,.07); }

/* two texts in one place: they cross-fade */
.swap { display:grid; }
.swap > span { grid-area:1 / 1; transition:opacity .7s var(--ease); }
html:not(.remix) .swap > .r, html.remix .swap > .o { opacity:0; pointer-events:none; }

/* the switch: one more item of the top menu, in the accent colour */
.navmode { display:inline-flex; align-items:center; padding:6px 0 6px .3em; border:0; border-bottom:1px solid var(--accent); background:none; color:var(--accent); font:inherit; letter-spacing:inherit; text-transform:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; transition:color var(--t) var(--ease), border-color var(--t) var(--ease), opacity var(--press) var(--ease); position:relative; }
.navmode::after { content:''; position:absolute; inset:-10px -8px; }
@media (hover:hover) { .navmode:hover { color:var(--ink); border-bottom-color:var(--ink); } }
.navmode:focus-visible { color:var(--ink); border-bottom-color:var(--ink); }
.navmode:active { opacity:.55; }

/* the streaming links and the remix tracklist share one place and cross-fade as whole blocks (nothing is clipped, so no button is ever seen cut);
   the box around them changes its height smoothly, JS sets it to the height of the block that is shown */
.folds { display:grid; align-items:start; }
.folds.anim { transition:height .9s var(--ease); }
.fold { grid-area:1 / 1; opacity:1; transform:none; visibility:visible; transition:opacity .6s var(--ease) .32s, transform .8s var(--ease) .32s, visibility 0s; }          /* the block that comes waits until the other one is gone */
html.remix .fold.fo, html:not(.remix) .fold.fr { opacity:0; transform:translateY(14px); visibility:hidden; pointer-events:none; transition:opacity .3s var(--ease), transform .5s var(--ease), visibility 0s .3s; }

/* the tracklist */
.rlist { list-style:none; margin:40px 0 0; padding:0; text-align:left; border-top:1px solid var(--rule); }
.rt { position:relative; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:14px; padding:13px 0 13px; border-bottom:1px solid var(--rule); }
.rplay { flex:none; width:40px; height:40px; padding:0; border:1px solid var(--rule); border-radius:50%; background:none; color:var(--ink); display:grid; place-items:center; cursor:pointer; -webkit-tap-highlight-color:transparent; transition:border-color var(--t) var(--ease), background-color var(--t) var(--ease), color var(--t) var(--ease), opacity var(--press) var(--ease); }
@media (hover:hover) { .rplay:hover:not(:disabled) { border-color:var(--ink); } }
.rplay:focus-visible { border-color:var(--ink); }
.rplay:active:not(:disabled) { opacity:.6; }
.rplay svg { width:14px; height:14px; fill:currentColor; }
.rplay .ps { display:none; } .rt.playing .rplay .pl { display:none; } .rt.playing .rplay .ps { display:block; }
.rt.playing .rplay { background:var(--ink); border-color:var(--ink); color:var(--paper); }
.rname { min-width:0; display:flex; flex-direction:column; gap:2px; }
.rname b { font-weight:400; font-size:1.06rem; line-height:1.25; overflow-wrap:anywhere; }
.rname i { font-size:.86rem; color:var(--soft); }
.rt.current .rname b { color:var(--accent); }
.rdur { font-size:.8rem; letter-spacing:.14em; color:var(--soft); font-variant-numeric:tabular-nums; white-space:nowrap; }
.rbar { position:absolute; left:0; right:0; bottom:-1px; height:2px; background:var(--accent); transform:scaleX(0); transform-origin:left; pointer-events:none; }
.rt.soon { opacity:.5; }
.rt.soon .rplay { cursor:default; }
@media (prefers-reduced-motion: reduce) { :root, .cover, h1 img, .swap > span, .fold, .folds.anim, .navmode, .rplay { transition:none; } }
@media (min-width:620px) { .top { margin-left:-90px; margin-right:-90px; } }       /* four items fit on one line when there is room */
/* a phone: the switch floats over the page, in the corner of the thumb */
@media (max-width:619px) {
  .navmode { position:fixed; right:16px; bottom:max(16px, env(safe-area-inset-bottom)); z-index:30; padding:15px 24px 14px calc(24px + .24em); border:0; border-radius:999px; background:var(--accent); color:var(--paper); font-size:.8rem; letter-spacing:.24em; box-shadow:0 8px 24px rgba(0,0,0,.28); transition:background-color .9s var(--ease), color .9s var(--ease), opacity var(--press) var(--ease), transform var(--press) var(--ease); }
  .navmode::after { inset:-6px; }
  .navmode:hover, .navmode:focus-visible { background:var(--accent); color:var(--paper); border-bottom-color:transparent; }
  .navmode:active { opacity:1; transform:scale(.96); }
  main { padding-bottom:110px; }
}
