:root {
  --rounded-corner: 12px;
  --gnomeblue: #4a86cf;
  --blue1: rgb(153, 193, 241);
  --blue2: rgb(98, 160, 234);
  --blue3: rgb(53, 132, 228);
  --blue4: rgb(28, 113, 216);
  --blue5: rgb(26, 95, 180);
  --green1: rgb(143, 240, 164);
  --green2: rgb(87, 227, 137);
  --green3: rgb(51, 209, 122);
  --green4: rgb(46, 194, 126);
  --green5: rgb(38, 162, 105);
  --yellow1: rgb(249, 240, 107);
  --yellow2: rgb(248, 228, 92);
  --yellow3: rgb(246, 211, 45);
  --yellow4: rgb(245, 194, 17);
  --yellow5: rgb(229, 165, 10);
  --orange1: rgb(255, 190, 111);
  --orange2: rgb(255, 163, 72);
  --orange3: rgb(255, 120, 0);
  --orange4: rgb(230, 97, 0);
  --orange5: rgb(198, 70, 0);
  --red1: rgb(246, 97, 81);
  --red2: rgb(237, 51, 59);
  --red3: rgb(224, 27, 36);
  --red4: rgb(192, 28, 40);
  --red5: rgb(165, 29, 45);
  --purple1: rgb(220, 138, 221);
  --purple2: rgb(192, 97, 203);
  --purple3: rgb(145, 65, 172);
  --purple4: rgb(129, 61, 156);
  --purple5: rgb(97, 53, 131);
  --brown1: rgb(205, 171, 143);
  --brown2: rgb(181, 131, 90);
  --brown3: rgb(152, 106, 68);
  --brown4: rgb(134, 94, 60);
  --brown5: rgb(99, 69, 44);
  --light1: rgb(255, 255, 255);
  --light2: rgb(246, 245, 244);
  --light3: rgb(222, 221, 218);
  --light4: rgb(192, 191, 188);
  --light5: rgb(154, 153, 150);
  --dark1: rgb(119, 118, 123);
  --dark2: rgb(94, 92, 100);
  --dark3: rgb(61, 56, 70);
  --dark4: rgb(36, 31, 49);
  --dark5: rgb(0, 0, 0);
  --text: #f6f5f4;
  --pill: 64px;
  --cantarell: "Cantarell", sans-serif;
  --inter: InterVariable, sans-serif;
  --pagewidth: 50rem;
  --pagepad: 2rem;
  --btnround: 500px;
  --btn-fg: #000;
  --btn-bg: rgba(0,0,0,0.2);
  --fg-color: #000;
  --bg-color: #eee;
  --narrowwidth: 45%;
  --defaultsize: 18px;
  --slickease: cubic-bezier(.17,.89,.32,1.28);
  --tile-bg: var(--light1);
  --tile-mid: #ddd;
  --osdfgcolor: var(--light1);
  --osdbgcolor: rgba(0, 0, 0, 0.3);
  --nobody: url(img/nobody.svg);
  --code-bg: #ddd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg-color: #eee;
    --bg-color: #111;
    --btn-fg: #fff;
    --btn-bg: rgba(255,255,255,0.05);    
    --tile-bg: var(--dark5);
    --tile-mid: var(--dark3);
    --nobody: url(img/nobody-d.svg);
    --code-bg: #333;
  }
}

@media only screen and (max-width: 600px) {
  :root {
      --narrowwidth: 100%;
      --defaultsize: 1.1em;
      --pagepad: 1rem;
    }
}
    
* {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-size: var(--defaultsize);
  font-family: var(--inter);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.01em;
  word-spacing: -0.01em;
  scroll-behavior: smooth;
}

body {
  color: var(--fg-color);
  background-color: var(--bg-color);
}

  

strong {
	font-weight: 600;
}
h1, h2, h3, h4, h5, h6 {
  margin: 3rem 0 1rem;
  font-weight: 800;
  line-height: 1.25;
}

h2:first-child { margin: 1rem 0 1rem; }

.narrow { max-width: var(--narrowwidth); margin: 1rem auto; }


/* LINKS */
a {
  font-weight: 600;
  text-decoration: none;
  color: var(--blue3);
  cursor: pointer;
  font-variation-settings: "wght" 600; /* needed for webkit */
}

a:hover {
  text-decoration: underline;
}

a[href^="http"]:after {
  display: inline-block;
  margin-left: 3px;
  content: url('img/extlink.svg');
}

a[href^="http"]:has(img,svg):after,
a.btn[href^="http"]:after { content: none; }

img {
  max-width: 100%; /* scale down blog post images to fit */
  height: auto;
  width: auto; /* avoid html force `width` attr */
  margin: 0 auto;
  
  &.aligncenter {
    display: block;
  }
}
/* mostly wordpress specifics */

video,.wp-video {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  width: unset !important; /* wp sets with attr */
}

figure, .wp-block-cover {
  display: block;
  margin: 0 auto;
  max-width: calc(4/5 * 100vw - 2*var(--pagepad));
  
  & img, & a { display: block; object-fit: contain; aspect-ratio: auto; }
  
  & figcaption { text-align: center; }
}

.wp-caption { width: auto !important; } /* WP likes to add that to figure and div */

picture {
  display: block;
  
  & img {
    display: block;
  }
}

pre, code, .codehilite {
  font-size: 80%;
  padding: .4rem;
  border-radius: 12px;
  margin: 1rem 0 2rem;
  background-color: var(--code-bg);
  overflow: scroll hidden;
  white-space: pre-wrap;
  white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
  white-space: -pre-wrap;      /* Opera 4-6 */
  white-space: -o-pre-wrap;    /* Opera 7 */
  word-break: break-all; /* webkit */
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-overflow: ellipsis;
  max-width: 100%;
  height: auto;
}
  pre { display: block; }

section {  margin: 0; }

kbd {
  font-family: monospace;
  font-size: 70%;
  padding: 0.2rem 0.4rem;
  background-color: var(--osdbgcolor);
  color: var(--osdfgcolor);
  border-radius: var(--rounded-corner);
}

blockquote {
  border-left: 0.25em solid var(--tile-mid);
  margin-left: 0.25em;
  opacity: 0.85;
  padding-left: 1em;
}

/* buttons */
.btn {
  font-weight: 600;
  font-variation-settings: "wght" 600;
  color: var(--btn-fg);
  background-color: var(--btn-bg);
  display: inline-block;
  font-size: 100%;
  padding: 0.6rem 2rem;
  margin: .3rem;
  max-width: 20rem;
  text-align: center;
  text-decoration: none;  
  border-radius: var(--btnround);
  box-shadow: 0 0 0 0 var(--btn-bg);
  min-width: 6rem;
  transition: box-shadow 200ms var(--slickease);
  
  &:hover { box-shadow: 0 0 0 2px var(--btn-bg); }

  aside & { /* asides are always dark */
    --btn-fg: #fff;
    --btn-bg: rgba(255,255,255,0.05);
  }
}
.btn.standalone {
  display: block;
  padding: 0.6rem 2rem;
  margin: 1rem auto;
}
  
  p>.btn { margin: .5rem .5rem 0 0; } 
  
  .btn.suggested {
    font-weight: 700;
    font-variation-settings: "wght" 700;
    background-color: var(--gnomeblue);
    color: var(--light1);
    box-shadow: 0 0 0 0 var(--gnomeblue);
    transition: box-shadow 200ms var(--slickease);
  }
  .btn.suggested:hover {
    background-color: var(--blue3);
    box-shadow: 0 0 0 2px var(--blue3);
  }
  .btn.suggested:active {
    background-color: var(--blue2);
  }
  
  .btn.heavy { background-color: var(--dark4); }
  .btn.heavy:hover { box-shadow: 0 0 0 2px var(--dark4); }


/* LAYOUT */
.container {
  margin: 0;
  padding: 0;
  margin-trim: block;
  display: grid;
  gap: var(--pagepad);
  grid-template-columns:  [full-start] 
                            minmax(0, 1fr) 
                            [main-start] 
                              repeat(5,minmax(1rem,calc(var(--pagewidth)/5)))
                            [main-end]
                            minmax(0, 1fr)
                          [full-end];
}
.container * {  grid-column: main; }
.full {  grid-column: full; text-align: center; }

/* COMPONENTS */
.small-print {
  font-size: 0.9em;
  text-align: center;
  max-width: 26em;
  margin: 1rem auto;
}
.warning {
	font-weight: 600;
	color: #c01c28;
	/* background-color: #c01c2828;
	display: inline-block;
	padding: 2px 6px;
	border-radius: 5px; */
}

.icon-shadow {
  filter: /* Sharp drop shadow */
          drop-shadow(0 0.08rem 0.1rem rgba(0,0,0, 0.35))
          /* Diffuse ambient shadow */
          drop-shadow(0 0.4rem 0.7rem rgba(0,0,0, 0.18));
}

/* ONE-OFF */
.hero {
	color: var(--light1);
	text-align: center;
	display: flex;
	flex-direction: column;
	min-height: 60vh;
	align-items: center;
  justify-content: center;
  padding-top: 4rem;
  margin: 0 0 1rem 0; padding: 0;
  background: var(--blue5) url(img/tris.svg) bottom left no-repeat;
  background-size: 1024px;
  
  & .title {
    font-weight: 500;
    font-size: 1.6rem;
  }
  
  & .btn {
    color: #fff;
    background-color: transparent;
    box-shadow: 0 0 0 2px #fff;
    
    &:hover { box-shadow: 0 0 0 4px #fff; }
    
    &.suggested {
      color: var(--light1);
      background-color: var(--blue3);
      border: 2px solid var(--blue3);
      box-shadow: 0 0 0 0 var(--blue3);
    
      &:hover { box-shadow: 0 0 0 3px var(--blue3); }
    }
  }
}

.hero.compact {
  min-height: 20vh;
  background: var(--purple5) url(img/tris.svg) bottom left no-repeat;
}

.hero section.header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: calc(var(--pagewidth) + 2 * var(--pagepad));
  padding: 0 var(--pagepad);
  margin: 0 auto;
}

@media only screen and (max-width: 600px) {
  .hero section.header {
    flex-direction: column;
  }
  .hero section.header .nav {
    justify-content: center;
  }
  .hero section.header #logo { font-size: 1rem; margin-top: 1rem; }
}


  #logo {
    font-weight: 900;
    font-size: 1.4rem;
    
    & a {
      text-decoration: none;
      color: #fff;
      font-weight: inherit;
      font-variation-settings: inherit;
    }
  }
  section.header ul.nav {
    padding: 1rem;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    flex-wrap: wrap;
    align-items: center;
    max-width: var(--pagewidth);
  }
  
    @media only screen and (max-width: 600px) {
      section.header ul.nav { font-size: 60%; gap: 6px; }
    }
  section.header li {
    list-style: none;
  }
  ul.nav a {
    display: inline-block;
    padding: 0.3rem 1rem;
    text-decoration: none;
    font-weight: 500;
    color: rgba(255,255,255,.9);
    border-radius: var(--btnround);
    transition: all 300ms ease-out; 
  }
  ul.nav a[href^="http"]:after { content: ''; } /* all of them are external now */
  ul.nav a:hover {
    color: #fff;
    background-color: rgba(255,255,255, 0.1);
  }

.colored-row {
  background-color: var(--blue5);
  color: #f6f5f4;
  padding: 4rem 0;
  text-align: center;
  margin: 2rem 0 3rem 0;

  & a {
    color: #fff;
  }
  & a[href^="http"]:after { content: url('img/extlink-d.svg'); }
}

  @media (prefers-color-scheme: dark) {
  .colored-row {
      background-color: var(--dark5);
    }
  }

.colored-row img,
.colored-row canvas
{
  display: block;
  margin: 0 auto;
  max-width: var(--pagewidth);
  width: 100%; height: auto;
}
.colored-row.nogap { margin: 0; }

.quote {
  line-height: 2em;
  font-style: italic;
}

/* AUTHOR */
article.post {
  display: grid;
  grid-template-columns: subgrid;
  margin: 1rem 0 3rem;
  overflow-y: clip;
  overflow-wrap: break-word; /* break super long words such as ComponentwiseGradientBoostingSurvivalAnalysis */
  word-break: break-word;
  
  /* image ddos - too many images get scaled and inlined */
  & .post-content img { grid-column: auto; } /* reset the main column */ 
  & p:has(img ~ img ~ img ~ img) { /* has only a series of 4+ image siblings */
    display: grid;
    grid-template-columns: repeat(4,1fr);
  }
}

.author-box {
  grid-column: 1/2; 
  overflow: hidden; 
  justify-self: center;
  text-align: center;
  font-size: 90%;
  position: sticky;
  top: 1rem;
  padding-bottom: 1rem;
  &>p {
    margin: 2px 0 0;
  }
  &>p:nth-child(3) {
    font-size: 80%;
  }
}

  .author-box picture {
    width: 128px;
    height: 128px;
    background: var(--tile-bg) var(--nobody) center no-repeat;
    background-size: 32px;
    border-radius: var(--btnround);
    overflow: hidden;
    margin: auto;
  }
  
  .author-box picture img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    align-self: center;
    
    &[src="img/nobody.svg/?s=200"] { /* allows to sort dark mode */
      display: none;
    }
    
  }

/* POST */

.container .post-content {
  grid-column: 2/-1; 
  overflow: hidden; 
  justify-self: start;
}

.post-timestamp {
  opacity: .7;
  margin-top: -1rem;
}

@media only screen and (max-width: 600px) {
  .author-box { grid-column: main; position: relative; }
  .container .post-content { grid-column: main; }
}

/* Get listed call for action */

aside {
  background: radial-gradient(at left top, #1a5fb4, #9141ac);
  padding: 5rem;
  text-align: center;
  color: #fff;
  background-color: #eee;

  a {
    text-decoration: none;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
  }

  p {
    margin: 1rem 0;
  }
}


/* FOOTER */
footer {
  background-color: #1a1622;
	padding: 4em 0 4em;
  color: white;
  text-align: center;
  
  a {
    
    text-decoration: none;
    font-weight: 600;
    color: white;
    display: block;
    margin: auto;
    
    .copy & {
      display: inline-block;
      vertical-align: middle;
      & svg {
        vertical-align: middle;
        width: 22px;
        height: 22px;
      }
    }
  }
}

footer 

footer a[href^="http"]:after { content: url('img/extlink-d.svg'); }
footer a[href^="http"]:has(svg):after { content: none; }

ul.bottomlinks {
  column-width: 25ex;
  column-gap: 24px;
  max-width: var(--pagewidth);
  padding: var(--pagepad);
  margin: 0 auto 4rem;
  line-height: 2.5rem;
}

  ul.bottomlinks li {
    display: block;
    list-style: none;
  }
  
  ul.bottomlinks li a {
    font-weight: 400;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0);
    transition: all 200ms ease-out;
  }
   
   ul.bottomlinks li a:hover {
    text-decoration-color: rgba(255,255,255,1);
   }
   
   a.social {
      width: 32px; height: 32px;
      margin: 0;
   }
   
   .socials {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: baseline;
      margin: 24px 6px 0 0;
      gap: 6px;
   }
   .social { fill: rgba(255,255,255,0.6); transition: all 200ms ease-out; }
   .social:hover { fill: rgba(255,255,255,1); }
