:root{
  --p:20px;
  --c:#444;
  --hh:50px;
  --textcol:#222;
  --medgray: #eee;
  --darkgray:#888;
  --green:#08a235;
  --col:4;
  --row:4;
  --gutter:calc(var(--p) / 20);
}
body{
  background: var(--medgray);
  color:black;
  font-size:clamp(1rem, 1.3vw, 1.5rem);
  line-height: 1.3em;
  overflow-x:hidden;
  font-family:"freesans", arial,sans-serif;
}

header{
  height: var(--hh);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding:calc(var(--p)/2) var(--p);
  letter-spacing: 1px;
  align-items: center;
}
header h1{
  width: 50%;
  font-weight: bold;
  font-size: 1.3em;
  color: var(--green);
}
.btn-list{
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 300px;
}
button{
  display: flex;
  justify-content: center;
  align-items: center;
  background:white;
  color:var(--textcol);
  border:0;
  height: 2em;
  border-radius: var(--p);
  padding: 0 1em;
  margin: 0;
  line-height: normal;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--darkgray);
  cursor: pointer;
  transition: all .1s linear;
}
button:hover{
  background: var(--medgray);
}
button:active{
  background: var(--green);
  color: white;
}
button.close:active svg path{
  stroke: white!important;
}
body>main{
  display: flex;
  flex-wrap: wrap ;
  justify-content: space-evenly;
  align-content: space-evenly;
  height: calc(100vh - var(--hh));
}
.full{
  width:100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top:0;
  left:0;
  z-index: 1;
}
.splash{
  pointer-events: none;
}
.splash img{
  width:50%;
  height: auto;
  animation: anim 6s ease-in 0s  forwards running;
}
.viewer{
  display: none;
}

.viewer{
  background:black;
  transition: all .2s ease;
  opacity: 0;
}
.viewer .content{
  width:100%;
}

.viewer iframe {
  display: none;
  width: calc(177.78vh);
  height: calc(100vh);
}
@media (max-aspect-ratio: 16/9) {
  .viewer iframe {
    width: calc(100vw);
    height: calc(56.25vw);
  }
}

.viewer iframe.active{
  display: block;
}

[data-state="viewer"] .viewer{
  display: flex;
}
[data-state="about"] .about,
[data-state="sources"] .sources{
  width:50%;
  padding: calc(var(--hh) + var(--gutter) * 4) var(--p);
}
[data-state="about"] .about .close,
[data-state="sources"] .sources .close{
  display: flex;
}
/* Lang */
.en{display: none;}
[data-lang="lang-en"] .fr{display: none;}
[data-lang="lang-en"] .en{display: block;}

.popup{
  transition: all .2s ease-in-out;
  background-color: white;
  position: absolute;
  right:0;
  top:0;
  width:0px;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  line-height: 1.7em;
  padding:0;
  color: var(--green);
  padding: calc(var(--hh) + var(--gutter) * 4) 0;
  box-shadow: 0 0 40px var(--green), 0 0 140px var(--green);
}
.popup h2, .popup p, .popup ul{
  margin:0 0 .8em;
}
.popup h2{
  font-weight: bold;
  letter-spacing: 1px;
}
.popup h2:not(:first-child){
  margin-top: 1em;
}
.popup li{
  margin-bottom:.5em;
  list-style: "◼ ";
  margin-left: 1em;
}
.popup li::marker{
  color:var(--green);
}
body[data-transition="done"] .viewer{
  opacity: 1;
}

@keyframes anim{
  0%   {width:90%;}
  40%   {width:90%; opacity: 1;}
  100% {width:85%; opacity: 0;}
}
.video-thumb{
  width: calc(100vw / var(--col) - ((var(--col) + 1) * var(--gutter)));
  height:calc((100%) / var(--row) - ((var(--row) + 1) * var(--gutter)));
  color: var(--textcol);
  background: var(--green);
  position: relative;
  display: flex;
  justify-content: center;
  cursor: pointer;
}
.video-thumb img{
  width:100%;
  height: 100%;
  object-fit: cover;
}
.video-thumb:after{
  content:attr(data-nbr);
  position: absolute;
  font-size: 1em;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--textcol);
  margin-top:7px;
  width:calc(var(--p) * 2);
  height: calc(var(--p) * 2);
  text-align: center;
  background:white;
  border-radius: 100%;
  transition: box-shadow .1s linear;
  /* border: 1px solid var(--darkgray) */
  box-shadow: 0px 10px 40px var(--green);
}
.video-thumb:hover:after{
  content:"▶";
  background:var(--medgray);
  color: #444;
  padding-left: .2em;
  box-shadow: 0 0 10px var(--green);
}
.close{
  position: fixed;
  top:calc(var(--p) / 3);
  right: var(--p);
  padding: .7em;
  height: auto;
}
.close svg{
  height:1.4em;
  width:1.4em;
}
.close svg path{
  stroke: var(--textcol)!important;
  stroke-width: 12px!important;
}
.popup .close{
  display: none;
}
.popup .close svg path{
  stroke: var(--green)!important;
}
.popup .close{
  border-color: var(--green);
  stroke: var(--green)!important;
}
a{
  color: inherit;
}
.next{
  display: none;
  background: var(--green);
  position: absolute;
  top: calc(50% - 4em);
  left: calc(50% - 4em);
  height: 7em;
  width: 8em;
  font-size: 2em;
  border-radius: 100%;
  padding: 2.2em 1em 0 1em;
  color: white;
  text-align: center;
  box-shadow: 0px 0px 20px var(--green),0px 0px 20px var(--green),0px 0px 5px var(--green),0px 0px 70px var(--green);
  animation: next 4s ease-in-out 0s infinite alternate-reverse forwards running;
  cursor: pointer;
  transition: all .8s ease;
  scale: 1;
  line-height: 1.2em;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.next:hover{
  filter: hue-rotate(210deg);
}
@keyframes next{
  100% {scale: 1.2;}
}
@media only screen and (max-width: 700px) {
  :root{
    --col:2;
    --row:6;
    --hh:100px;
  }
  header h1{
    width: 100%;
  }
  .popup{
    transition: none;
    display: none;
  }
  [data-state="about"] .about,
  [data-state="sources"] .sources{
    display: block;
    width: 100%;
  }
  .close{
    top: calc(var(--hh) / 4);
  }
  /* hide video list on popup and small width to avoid double scrolling */
  [data-state="viewer"] main,
  [data-state="about"] main,
  [data-state="sources"] main{
    display: none;
  }
  .btn-list{
    width: 100%;
    margin-top: .5em;
  }
  body>main{
    height: auto;
  }
  .video-thumb{
    height: 20vh;
  }
}

:-moz-any-link:focus, a:active {text-decoration: none; outline:0;}
::selection {background:var(--green); color:white;}
::-moz-selection {background:var(--green); color:white;}