:root{
  --stroke-width: 1.7px;
  --underline: calc(var(--stroke-width) * 0.85);
  --border: var(--stroke-width) solid var(--clr-stroke);

  --fs-logo: min(4rem, 11vw);
  --fs-up: 1.5rem;
  --fs-svg: 11px;
  --lh: 1.4rem;

  --mono: 0.925rem;
  /* (matches Deja vu with Deja vu Mono */

  --pad: 1rem;

  /* --ff: 'DejaVu Serif', 'FreeSerif', serif; */
  /* --ff: 'extrasmall',DejaVu', sans-serif; */
  --ff: 'raw';

  --animation-duration: 5s;
}

/*  GLOBAL
    ----------------------------------------------------- */

html{
  font-family: var(--ff);
  scroll-behavior: smooth;
  
  font-size: 1.0625em;
  /* 16px --> 17px */
}

body{
  background: var(--clr-back);
  color: var(--clr-main);
  line-height: var(--lh);
}

/* selection color */
*::selection{
  background: var(--c6);
  color: var(--clr-main);
}

em, strong{
  font-weight: bold;
}

/* links in mono */
a, a:visited{
  color: currentColor;
  font-family: 'DejaVu Sans Mono', 'FreeMono', monospace;
  font-size: var(--mono);
  
  text-decoration: none;
  border-bottom: var(--border);
  font-style: normal;
  
  background-color: var(--clr-surface);
}
a:hover{
  background-color: var(--clr-hover);
}

a.external{
  position: relative;
  margin-right: 0.8em;
}
a.external::after{
  content: "↗";
  position: absolute;
  left: calc(100% + 0.1em);
  bottom: 0em;
  font-size: 1.5em;
  font-family: monospace;
}

@media only screen and (max-width: 40rem) {
  :root{
    --stroke-width: 1.7px;
    --fs-svg: 13px;
  }
  html{
    /* back to 16px on mobile */
    font-size: 1em;
  }
}

/*  TYPO VERTICAL RYTHM
    ----------------------------------------------------- */

h2, h3{
  margin: calc(var(--lh) * 2) 0 var(--lh);
  font-weight: bold;
  font-size: var(--fs-up);
}
article h3{
  margin: calc(var(--lh) * 2) 0 var(--lh);
  text-transform: uppercase;
  border-bottom: var(--border);
  font-weight: normal;
  font-size: 1rem;
}


/* images */

figure,
.gallery > *{
  display: block;
  max-width: 100%;
  margin: var(--lh) auto;
  width: fit-content;
  position: relative;

  display: table;
}
.gallery > *{
  margin: 0;
}

img{
  display: block;
  max-width: 100%;
  max-height: 60vh;
  box-sizing: border-box;
}
img.thumbnail{
  max-height: 10rem;
  max-width: 10rem;
}


article blockquote{
  padding: var(--lh);
  margin: var(--lh) 0;
  border: var(--border);
  background-color: var(--c2);
  border-radius: var(--lh);
}
figcaption {
  display: table-caption;
  caption-side: bottom;

	padding: var(--pad);
	font-size: 0.825rem;
	line-height: 1.35;
	text-align: center;
}
figcaption:empty{
  display: none;
}

.gallery{
  margin: var(--lh) 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.gallery.vertical{
  display: grid;
  grid-template-columns: 1fr;
}


p{
  margin: 0;
}

h2 + h3{
  margin-top: var(--lh);
}

h1 + p,
h2 + p,
h3 + p,
img + p,
p + p{
  margin: var(--lh) 0;
}

h1 + h2{
  margin-top: var(--lh);
}

:is(h2,h3,h4,h5,h6,p):first-child{
  /* no top margin to first child */
  margin-top: 0;
}
:is(h2,h3,h4,h5,h6,p):last-child{
  /* no top margin to first child */
  margin-bottom: 0;
}

article ul{
  list-style: initial;
  padding-left: var(--lh);
  margin: var(--lh) 0;
}

/* --- main title ---*/
h1{
  font-size: var(--fs-logo);
  color: var(--c5);
  -webkit-text-stroke: var(--clr-global-stroke) var(--stroke-width);
  
  text-align: center;
  margin: 0;

  margin-top: 0;
  line-height: 0.75;
  font-weight: bold;
  margin-bottom: var(--pad);
}
h1 a{
  font-size: inherit;
  border-bottom: none;
  font-family: inherit;
  text-decoration: none;
  background-color: initial;
}
h1 a::after{
  content: none !important;
}
h1 a:hover{
  background-color: initial;
  color: var(--c3);
}
article h1{
  text-align: left;
  color: var(--c1);
}

.svg-container h1 {
  text-align: center;
  color: hotpink;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -82%) rotate(-10deg);
  transform-origin: center;
}

/*  LAYOUT
    ----------------------------------------------------- */

body{
  margin: 0;
  display: flex;
  justify-content: center;
}

.grid{
  display: grid;
  grid-template-columns: 50% 50%;
}

.full-h-sticky{
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
}
.pad{
  padding: var(--pad);
}

/* intro style */
section#descriptions header{
  margin-bottom: calc(var(--pad) * 2);
}
.global-bio {
  margin: var(--pad) 0;
}
.global-bio p{
  border: var(--stroke-width) solid var(--clr-global-stroke);
  background: var(--c3);
  padding: var(--pad);
}
.global-bio p:nth-of-type(2){
  background-color: var(--c2);
}

/* both sections are limited in width */
section#map{
  max-width: min(46rem, 100%);
  box-sizing: border-box;
}
section#descriptions{
  max-width: min(46rem, 100%);
  box-sizing: border-box;
}

/* description has bigger right padding */
section#descriptions{
  padding-right: calc(var(--pad) * 2);
}

/* map is centered */
section#map{
  display: flex;
  flex-direction: column;
}
section#map > *{
  flex-grow: 0;
  flex-shrink: 0;
}

.svg-container svg{
  cursor: crosshair;
  max-width: 100%;
  margin: 0 auto;
  max-height: 56vh;
  position: relative;
}

/* logos flows below */
.logos{
  display: flex;
  justify-content: flex-end;
  gap: var(--lh);
  margin-top: var(--lh);
}
.logos > img.logo{
  max-width: 2rem;
}

footer {
  background-color: var(--c5);
  border-radius: calc(var(--pad) * 2);
	border: var(--border);
  padding: var(--pad);
}
header + footer{
  margin-top: var(--pad);
}

/* NEWS */

.news{
  padding: calc(var(--pad) * 4) var(--pad);
  text-align: center;
  position: relative;
}
.news .emoji{
  position: absolute;
  inset: 0;
  font-size: 14em;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 0;
  opacity: 0.25;
  filter: blur(2px) contrast(4) grayscale(1);
  line-height: 0;
  top: -0.2em;
  pointer-events: none;
}
.news :not(.emoji){
  position: relative;
  z-index: 1;
}
.news h2{
  margin-top: 0;
}


/* hide by default */
.nav-details summary {
	display: none;
  cursor: pointer;
  width: 100%;
  border-radius: 2rem;
  box-sizing: border-box;
  background-color: var(--clr-active);
  border: var(--border);
  position: relative;
  z-index: 99999999;

  margin: auto;
  padding: calc(var(--pad) / 4) calc(var(--pad) / 2);
  width: fit-content;
}

/* back on nav */
@media screen and (max-width: 60rem) {
  .nav-details summary{
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

/* remove default cursor */
.nav-details summary::-webkit-details-marker {
  display:none;
}
::marker{ display:none; } 
summary{ list-style: none }

/* replace with custom */
.nav-details[open] summary::after{
  content: 'hide projects list';
}
.nav-details[open] summary{
  border-radius: var(--lh) var(--lh) 0 0;
}
.nav-details:not([open]) summary::after{
  content: 'see projects list';
}
.nav-details:not([open]) summary{
  background-color: var(--clr-hover);
}

/* LAYOUT BREAKING */
@media only screen and (max-width: 60rem) {
  body{
    display: block;
  }
  .grid{
    display: contents;
  }
  .full-h-sticky{
    position: static;
    height: auto;
  }
  
  .grid > section{
    margin: 0 auto;
  }
}

/* MOBILE */
@media only screen and (max-width: 40rem) {
  
  .pad{
    /* economising width space */
    padding: var(--pad) calc(var(--pad) * 0.5) !important;
  }
  section#descriptions{
    padding-top: 0 !important;
  }

  /* keep map nice and big */
  .svg-container{
    box-sizing: border-box;
    display: flex;
    margin: var(--pad) calc(var(--pad) * -0.5);
    border-top: var(--stroke-width) solid var(--clr-main);
    border-bottom: var(--stroke-width) solid var(--clr-main);
    width: 100vw;
    overflow-y: scroll;
  }
  .svg-container > svg{
    min-width: 38rem;
  }
}

/*  NAVIGATION
    ----------------------------------------------------- */

nav ul{
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--pad) / 2);
  margin-top: calc(var(--pad) * 2);
  margin-bottom: calc(var(--pad) / 2);
}
nav li a{
  display: block;
  padding: calc(var(--pad) / 4) calc(var(--pad) / 2);
  border: var(--border);
}
li.active a{
  background-color: var(--clr-active);
}

.blog-nav{
  padding: 0;
  gap: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
.blog-nav li {
	min-width: 0;
	flex: 1 0 20rem;
}
.blog-nav li a{
  box-sizing: border-box;
  height: 100%;
  font-family: var(--ff);
  font-size: 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: calc(var(--pad) / 2);
  padding: calc(var(--pad) / 2);
  border-bottom: none;
}
.blog-nav a *{
  margin: 0;
  font-size: 1rem;
  line-height: var(--lh);
}
.blog-nav a h2 + p{
  margin-top: calc(var(--pad) / 2);
}

/*  STUDIO BIOS
    ----------------------------------------------------- */

/* --- studio titles */
.studio{
  /* margin-top: calc(var(--lh) * 1); */
  border-top: var(--border);
  border-top-style: dotted;
  scroll-margin-top: calc(var(--lh) * 3);
}
header.studio{
  border-top: none;
  margin-top: calc(var(--lh) * 1);
}
.studio.active summary{
  background-color: var(--clr-active);
}
.studio summary{
  cursor: pointer;
}
.studio summary:hover{
  background-color: var(--clr-hover);
}
.studio summary > div{
  display: inline-flex;
  justify-content: space-between;
  width: calc(100% - 1.66rem);
}
.studio-title{
  text-transform: uppercase;
  font-weight: normal;
}
.studio-name{
  font-weight: bold;
  font-size: var(--fs-up);
  padding-top: calc(var(--pad) / 4);
  padding-bottom: 0.35em;
  display: block;
}
.studio-members{
  line-height: 0;
  font-size: calc(var(--fs-up) * 1.25);
  -webkit-text-stroke: var(--clr-global-stroke) calc(var(--stroke-width) *1.5);
  color: var(--c5);
  paint-order: stroke;
  position: relative;
  bottom: -0.55em;
}

.studio.empty {
	padding-left: 1.25em;
}
.studio.empty .studio-name{
  opacity: 0.25;
}

/* .studio h3{
  font-weight: bold;
  font-size: var(--fs-up);
  border-bottom: ;
} */
.studio main{
  margin-top: calc(var(--lh) * 1);
  margin-bottom: calc(var(--lh) * 2);
}

.studio.former{
  padding-top: calc(var(--pad) * 3);
  border-top: 0;
}
.studio ul{
  padding-top: var(--pad);
  display: flex;
  gap: calc(var(--lh) * 0.25);
  flex-wrap: wrap;
}
.studio li{
  border: var(--border);
  padding: calc(var(--lh) * 0.25);
  background-color: var(--c2);
}
.studio li a{
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  background-color: initial;
  border-bottom: 0;
}


/*  TOP BUTTON STYLE
    ----------------------------------------------------- */

section#descriptions{
  position: relative;
}

.top-button-wrapper{
  position: sticky;
  padding-top: calc(var(--lh) * 2);
  bottom: calc(var(--lh) * 1);
  display: flex;
  justify-content: center;

  pointer-events: none;
}

a.top-button{
  pointer-events: all;

  text-decoration: none;
  font-weight: bold;
  font-size: 2rem;
  width: calc(var(--lh) * 2);
  height: calc(var(--lh) * 2);
  display: flex;
  justify-content: center;
  align-items: center;
  border: var(--stroke-width) solid var(--clr-global-stroke);
  border-radius: 50%;

  background-color: var(--clr-active);
}

@media only screen and (max-width: 40rem) {
  a.top-button{
    background-color: var(--clr-active);
  }

  .global-bio{
    margin-top: 0;
  }
  .blog-nav li a h2{
    font-size: 1rem;
  }
}
