/*
font-family: 'Rokkitt', serif;
font-family: 'Zilla Slab', serif;
font-family: 'Open Sans', sans-serif;
font-family: 'Source Code Pro', monospace;
*/

:root {
    /* colors */
    --pale-yellow:  #f6f5ee;
    --banana:       #F5F2D9;
    --desat-yellow: #d1c369;
    
    --lt-blue: #B3F0F5;
    --sky:     #5BBBC9;
    --mint:    #83D4A7;
    --cyan:    #42ecf5;
    --teal:    #149198;
    
    --orange-red: #C14721;
    --sienna:     #C95B36;
    
    --wine:  #de3a7f;
    --grape: #8F77BF;

    --dark-green: #2f383b;
    --olive:      #6E6C4D;

    --light-gray : #ccc;
    --dark-gray  : #444;
    --darker-gray: #222;
    --darken1: rgba(0,0,0,.1);
    --darken3: rgba(0,0,0,.3);
    
        
    --cta :         var(--orange-red);
    --bkg :         var(--pale-yellow); 
    --text :        var(--dark-gray);
    --section-bkg:  var(--darken1);
    --section-text: var(--light-gray);
    
    --tag-color  : var(--cta);
    
    --tag-1: var(--desat-yellow);
    --tag-2: var(--sienna);
    --tag-3: var(--sky);
    --tag-4: var(--mint);
    --tag-5: var(--grape);
     
    
    /* typography */
    --body-text   : 'Open Sans', sans-serif;
    --header-text : 'Zilla Slab', sans-serif;
    --code-text   : 'Source Code Pro', monospace;
    
    /* units */
    --page-width: calc(100vw - 4.8rem);
    --max-page-width: 72ch;
    
}



html {
	font-size: 62.5%;
}

body {
	font-family: var(--body-text);
	color: var(--text);
	background: var(--bkg);
	font-size: 1.6rem;
}

body.home {
	margin: 2.4rem;
    --bkg : var(--dark-green);
    --text : var(--light-gray);
}

h1, h2, h3 {
    font-family: var(--header-text);
    font-weight: 400;
    margin: .25em 0;
}


code {
    font-family: var(--code-text);
    color: var(--teal);
}

pre.inlined {
    padding-bottom: .5em;
}

pre.inlined code{
    font-size: .9em;
    color: var(--wine);
}

a:not(.card) {
    color: var(--orange-red);
    text-decoration: none;
    position: relative;
    border-bottom: 2px solid transparent;
}

/*
a::after {
    content:'';
    background: var(--wine);
    height: 2px;
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -.15em;
    transition: right .3s;
    
    -webkit-box-decoration-break: clone;
            box-decoration-break: clone;
}
*/

a:visited {
    color: var(--sienna);
}
a:not(.card):hover:not(.jparts):hover:not(.codelab):hover {
    color: var(--wine);
    border-bottom-color: var(--wine);
}

a:hover::after {
    right: 0;
}
 
a.article,
a.article:visited {
    color: var(--sky);
    display: inline-block;

    background: linear-gradient(to right, var(--sky) 50%, white);
    background-size: 200% 100%;
    background-position: 0 0;

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    
    border-bottom: 1px solid transparent;
    border-image-slice: 0 0 1 0;
    border-image-source: linear-gradient(to right, var(--sky), white);
    border-image-width: 0;

    transition: background-position .3s, border-image-width .2s ;
}
a.article:hover {
    border-image-width: 1;
    background-position: -100% 0;
}

#main-title {
    max-width: 124rem;
    margin: 0 auto;
    position: relative;
    height: 20rem;
}


#main-title h1{
	font-size: 20rem;
	font-weight: 700;
	line-height: 16rem;
	margin: 0;
	margin-left: 2.4rem;
	margin-bottom: 2.4rem;
    color: var(--darken3);
	transform: rotate(-12.5deg);
	position: absolute;
    left: -16rem;
    top: -2rem;
    z-index: 1;
	transition: left .3s, font-size .3s;
}

#main-title h1 em {
    font-style: normal;    
	z-index: -1;
}

#main-title h1 a {
    font-size: .39em;
    font-family: var(--header-text);
    font-weight: 700;
    transform: rotate(12.5deg);
    display: inline-block;
    position: absolute;
    left: 1.2em;
    top: -.441em;
    color: var(--banana);
    font-style: normal;
    z-index: 3;
}

#main-title h1 span{
	display: block;
	color:rgba(166, 164, 156, 0.25);
	position: relative;
	left: .55em;
	top: -.5em;
	z-index: 2;
}

#main-title h2 {
    font-family: var(--header-text);
    font-style: italic;
    text-align: right;
    margin: 0;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 4;
    pointer-events: none;
}

#main-title a,
#main-title a:visited {
    opacity: .7;
    transition: opacity .3s;
}
#main-title a:hover {
    opacity: 1;
    border-bottom-color: transparent;
}
#main-title a::after,
#main-title a:hover::after {
    background: none;
}

#main-title .header-logo {
    width: 10rem;
    margin-left: auto;
    margin-top: 2.4rem;
}

#main-title span.b2 {
    display: block;
}


/* all this, just to make sure the 
    description tag breaks evenly
    on window resize */

@media (max-width: 1420px) {
    #main-title h1      {left: -.3em;}
}

@media (max-width: 712px) {
    #main-title         {height: 16rem;}
    #main-title h1      {font-size: 14rem;}    
    #main-title h1 a    {top: -.9em}
    #main-title h1 span {top: -.85em;}    
    #main-title h2      {font-size: 1.125em;}
}

/*
@media (max-width: 560px) {
    #main-title span.b1 {display: block;}
}
*/

@media (max-width: 446px) {
    #main-title span.b2 {display: inline;}
    #main-title span.b1 {display: block;}
}




main {
    max-width: 60rem;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

@supports (display: grid) {
    main {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
        grid-gap: 2.4rem;
        
        max-width: 124rem;
/*         margin: 0 auto; */
    }
}



section {
    margin: 2.4rem 0;
}

body.home section {
    margin: 0;
    border: 1px solid rgba(255,255,255, .3);
    display: flex;
    flex-direction: column;
}


body.home section > *{
    padding: 1.2rem;
}

body.home section .card {
    width: 400px;
    height: 400px;
}

body.home section .card::after {
    content:none;
    position: static;    
}

@supports (display: grid) {
    
    body.home section .card {
        width: 100%;
        height: auto;
        padding: 0;
        object-fit: cover;
        object-position: 50% 50%;
    }
}

@media (max-width:785px) {
    body.home section .card {
        max-height: 180px;    
    }
}

body.home section .description {
    margin-top: 0;
    margin-bottom: .2rem;
}


.tags {
    margin: 0;
    margin-top: auto;
    list-style-type: none;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    align-items: center;
}

.tag:not(.token) {
    font-size: .8em;
    padding: 0 .75em;
    line-height: 2em;
    background: var(--tag-color);
    margin-left: .5em;
    margin-top: 1em;
    border-radius: 1em;
    color: black;
    min-width: 3.5em;
    text-align: center;
}
.tag:not(.token):first-child{ margin-left: 0;}

.tag-1 {--tag-color: var(--tag-1)} /* css */
.tag-2 {--tag-color: var(--tag-2)} /* no-js */
.tag-3 {--tag-color: var(--tag-3)} /* js */
.tag-4 {--tag-color: var(--tag-4)} /* html */
.tag-5 {--tag-color: var(--tag-5)} /* undecided */

.tag-css  {--tag-color: var(--tag-1)} /* css */
.tag-nojs {--tag-color: var(--tag-2)} /* no-js */
.tag-js   {--tag-color: var(--tag-3)} /* js */
.tag-html {--tag-color: var(--tag-4)} /* html */

.tag-inline {
    font-size: .9em;
    padding: 0 .75em;
    color: var(--tag-color);
    border: 1px solid var(--tag-color);
    border-radius: 1em;
}
.tag-inline.tag-css {
    color:var(--text);  /* not enough contrast otherwise */
}


/* page template */

.content {
    width: 100%;
    max-width: 60rem;
    margin: 0 auto;    
}

@supports (display:grid) {    
    .content {
        width: var(--page-width);
        max-width: var(--max-page-width);
    }
}

.banner {
    display: flex;
    background: var(--dark-green);
    align-items: center;
    margin-bottom: 2.4rem;
}

.banner header {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    margin: 4.8rem 0 2.4rem 0;
    position: relative;
}

@media (max-width: 540px) {
    .banner header {
        flex-direction: column;
    }
}


/*
.banner .logo {
    display: block;
    width: 12.4rem;
    margin-top: 2.4rem;
    opacity: .6;
    transition: opacity .3s;
}

.banner .logo:hover {
    opacity: 1;
}
*/

    
      

.banner h1 {
    font-size: 3.5em;
    margin: 0;
}

.banner a,
.banner a:visited {
    text-decoration: none;
    font-weight: 700;
    font-size: 1em;
    border-bottom: none;
    position: static; /* simple reverse of a::hover */
}
.banner a::after {
    position: static;
}

.banner a.codelab {
    color: var(--olive);
    transition: color .3s;
}

.banner a.codelab span {
/*     color:rgba(166, 164, 156, 0.25); */
    color: var(--pale-yellow);
    transition: color .3s;
}

.banner a.codelab:hover {
    color: var(--pale-yellow);
}
.banner a.codelab:hover span {
    color: var(--olive);
}


.banner .jparts {
    position: absolute;
    top: -0.6em;
    font-size: 0.5em;
    color: var(--banana);
    opacity: .6;
    transition: opacity .3s;
}

.banner .jparts:hover {
    opacity: 1;
}


.banner .tags {
    margin-left: auto;
    margin-bottom: 1em;
}

.banner .tag {
    font-size: .7em;
}



article.content {
    line-height: 1.5em;
}


.nb {
    color: var(--olive);
    padding: .5em;
    padding-left: 1em;
    border-left : .265em solid var(--olive);
    background: rgba(0,0,0,.07);
}

/* code examples formatting */
    
pre[class*="language-"][data-type] {
    padding-top: 3em;
}

pre[data-type]::before {
    content: attr(data-type);
    color: var(--wine);
    position: absolute;
    top: .5em;
    left: .75em;
    font-family: var(--body-text);
    font-size: 1.1em;
}
    

input.disclosure {
    display: none;
}

input.disclosure + label {
    font-family: var(--code-text);
    font-size: .8em;
    cursor: pointer;
    display: inline-block;
}

input.disclosure + label::before {
    content: 'Show';
}

input.disclosure:checked + label::before {
    content: 'Hide';
}

input.disclosure + label::after {
    content:'';
    width: .5em;
    height: .5em;
    border: 1px solid var(--text);
    border-left: none;
    border-bottom: none;
    position: relative;
    display: inline-block;
    right: -.5em;
    top: -.15em;
    transform: rotate(45deg);
    transition: transform .3s;
}

input.disclosure:checked + label::after{
    transform: rotate(135deg);    
}

input.disclosure + label + div.disclosure {
    max-height: 0;
    overflow: hidden;
/*     display: grid; */
    opacity: 0;

    transition: all .4s;
}

input.disclosure:checked + label + div.disclosure {
    max-height: 300vh;
    opacity: 1;
}
