@font-face {
  font-family:'base';
  src: url('../fonts/CenturyGothicBold.woff2') format('woff2');
  font-weight:300;
  font-style:normal;
  font-display:swap;  
}

@font-face {
  font-family:'base';
  src: url('../fonts/CenturyGothic.woff2') format('woff2');
  font-weight:200;
  font-style:normal;
  font-display:swap;  
}

@font-face {
  font-family:'display';
  src: url('../fonts/PlayfairDisplay-Medium.woff2') format('woff2');
  font-weight:300;
  font-style:normal;
  font-display:swap;  
}

:root {
  /* COLORS */  
  --color-bg-dark:#130602;
  --color-bg-light:rgba(255,255,255,.4);
  /* --color-light:#e1ccbe; */
  --color-light:#FFFFFD;
  --color-dark:#393939;
  --color-mid:#A4A4A4;
  --color-accent:#C8B99C;
  --color-accent-2:#B69667;
  --color-line:rgba(182,159,103,.5);
  /* FONT-SIZE */
	--size-base:21px;
  
  --size-huge:60px;
  /* clamp(30px, 40px, 50px); */
  --size-large:80px;
  --size-medium:25px;
  --size-small:18px;
  --size-tiny:14px;
  
  @media (min-width:1600px) {
    --sizeHuge:5rem; /* 100 */  
    --sizeLarge:3rem; /* 60 */     
  }

  --transition: 0.3s ease;
  --padding: 3rem 0;
  @media (min-width: 1600px) {
    --padding:6rem;    
  }
}

* {
  -webkit-transition:all .5s ease-out;
  padding:0;
  margin:0;
  box-sizing:border-box;
  text-decoration:swap;
}

/* Defaults */

html, body {
  min-height:100vh;
  margin:0;
  -webkit-textsize-adjust:100%;	
  scroll-behavior:smooth;
  font-family:'base', sans-serif;
  font-size:var(--size-base);
  background:var(--color-dark-bg);
  color:var(--color-light);
  overflow-x:hidden;  
}

h2, h3 {
    font-family: 'display', 'Times New Roman', ;
    font-size:var(--size-large);
    font-weight:300;
    color: var(--color-accent);
}

p {
  font-size:var(--size-base);
  small {
    font-size:var(--size-tiny);  
  }
  line-height: 2;
}


img {
  width:100%;
  height:auto;
  display:block;
}

a { text-decoration:none; }

.gallery picture { 
  line-height:0; 
  overflow:hidden;
  img:hover { 
    transform:scale(1.05); 
  }
}

main {
  position: relative;
  z-index: 1;
}

/* Custom */

a.more {
  padding:1.5rem 0;
  margin:1rem 0 0;
  width:100%;  
  display:block;
  text-align:center;
  
  background:transparent;
  color:var(--color-dark);
  border:1px solid var(--color-dark);
  cursor:pointer;
  transition:var(--transition);
  &:hover {
    background:var(--color-dark);
    color:var(--color-bg-light);
  }
  &.dark {
    border-color:var(--color-light);
    color:var(--color-light);
    @media (min-width:1600px) {
      max-width:16rem;
    }
  }
}

.block { display:block; }
.right { text-align:right; }

.banner {
  position: relative;
  height: 450px;
  picture {
    position: absolute;
    top:0;
    left:0;
    width: 100%;
    height: 100%;
    background-size:cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -1;
  }
}

section#about .banner picture {
  background-image: url('../gfx/banner_3.png');
}

section#works .banner picture {
  background-image: url('../gfx/banner_1.png');
}

/* FRAME */

.container {
  --bs-gutter-x:0rem;
  --bs-gutter-y:0;
  width:100%;
  padding-right:calc(var(--bs-gutter-x) * .5);
  padding-left:calc(var(--bs-gutter-x) * .5);
  margin-right:auto;
  margin-left:auto;
  width:90%;
  max-width:600px;
  @media (min-width:1600px) {
    --bs-gutter-x:1.5rem;
    max-width:1640px;
  }
}

/* HEADER */

header {
  position:fixed;
  top:0;
  z-index:10;
  width:100%;
  background:rgba(0,0,0,.5);
  border-bottom:5px solid var(--color-accent-2);
  padding:0;
  z-index:11;
  transition:background 0.4s ease, transform 0.4s ease;
  
  .container { position: relative; }
  
  text-transform: uppercase;
  font-size: var(--size-small);
  letter-spacing: 0.025rem;
  
  h1 {
    font-size: var(--size-small);
    color:var(--color-accent);
    opacity: .25;
    line-height: 0;
    justify-content: center;
    display: flex;
    padding: 1rem 0;
    margin: 0;    
    font-weight: 300;  
    @media (min-width:1024px) {
      padding: 3rem 0 2rem;
      display: block;
    }
  }
  nav {
    text-align:right;
    ul { 
      list-style-type:none; 
      display: flex;
      gap: 2rem;
      justify-content: end;   
    }
    li { display:inline-block; }
    a {
        display: block;
        line-height: 0;
        color:var(--color-mid);
        padding: 3rem 0 2rem;
        text-decoration:none;
        position: relative;
        &.active::after {
          content: '';
          width: 100%;
          height: 5px;
          bottom: -5px;
          position: absolute;
          display: block;
          background: var(--color-accent);
        }
      }        
  }
  .outer {
    position: absolute;
    right: 0;
    top: 0;
    transform: translate(4.5rem, 0.4rem);
    @media (min-width:1024px) {
      transform: translate(5rem, 2.2rem);
    }
  }

}

.down header { 
  background:var(--color-bg-dark);
}

.down.scroll-end header { transform:translateY(-100%); }


/* GRIDS */

@media (min-width:1600px) {
  
  .row {
    display:grid;
    grid-template-columns:repeat(12, [col-start] 1fr);    
    gap:1rem;      
    div { grid-column:col-start 1 / span 6; }
  }

  #hero {
    picture { grid-column:col-start 1 / span 5; }
    p { grid-column:col-start 3 / span 4; }
    a { grid-column:col-start 4 / span 2; }
  }

  #about {
    .row {      
      h2 { grid-column:col-start 3 / span 9; }
      p { grid-column:col-start 4 / span 6; }
    }
  }

  header {
    .row { 
      h1 { grid-column:col-start 1 / span 6; }
      nav { grid-column:col-start 7 / span 6; }
    }
  }
  footer {
    .row { 
      p { grid-column:col-start 1 / span 6; }
      nav { grid-column:col-start 7 / span 6; }
    }    
  }
}


/* SECTIONS */

section {

  &#hero {
    height: 100vh;
    position: relative;
    border-bottom: 5px solid var(--color-line);
    &::after {
      content: '';
      position: absolute;
      bottom: -5px;
      height: 5px;
      width: 29vw;
      background: var(--color-accent-2);
    }    
    .container {
      position: relative;
      transform: translateY(-50%);
      top: 50%;
    }    
    picture {
      img { 
        width: 100%; 
        max-width: 675px;
        @media (min-width: 1024px) {
          transform: translateX(1.2rem);   
        }
      }
    }
    p {
      line-height: 1;
      text-align: center;
      margin: 1rem 0 2rem;
      font-size: var(--size-small);
      @media (min-width:1024px) {        
        text-align: initial;
        margin: 1rem 0 2rem;      
        font-size: var(--size-base);
      }
    }
    a {
      background: var(--color-accent-2);
      padding: .5rem 0 .75rem;
      text-align:center;
      color: var(--color-light);
      border-radius: .25rem;
      font-family: display, 'Times New Roman';
      font-size: var(--size-medium);
      display: block;
    }
  }
  
  &#about .text {
    background: var(--color-bg-light);
    padding: 4rem 0 5.5rem;
    position: relative;
    color: var(--color-dark);
    border-bottom: 5px solid var(--color-line);
    h2 {
      font-size: var(--size-large);
      font-family: 'display', 'Times New Roman';
      margin: 0 0 1.5rem;
    }
    &::after {
      content: '';
      position: absolute;
      bottom: -5px;
      height: 5px;
      width: 29vw;
      background: var(--color-accent-2);
    }
  }
  
  &#about .feature {
    background: var(--color-bg-dark);
    padding: 3rem 0;
    
    .grid {
      display: flex;
      justify-content: center;
      gap: 2rem;
      figure {
        width: 100%;
        max-width: 350px;
        border-radius: 5px;
        position: relative;
        overflow:hidden;        
      }
      img {
        opacity:.5;
      }
      figcaption {
        position: absolute;
        z-index: 1;
        transform: translateY(-50%);
        top: 50%;
        width: 100%;
        text-align: center;
        font-family: display, 'Times New Roman';
        line-height: 1;
        color: var(--color-accent);
        font-size: 45px;
        span {
          display: block;
          font-size: var(--size-medium);
          position: absolute;
          transform: translateY(-1rem);
          width: 100%;          
        }
      }
      figure:hover {
        img { opacity: 1;}
        figcaption {opacity: 0;}
      }
    }
  }
  
  &#works .gallery {
    background: var(--color-bg-dark);
    padding: 4rem 0 2.75rem;
    h3 {
      justify-content: center;
      display: flex;
      font-family: display;
      font-size: var(--size-large);
      letter-spacing: .1rem;
    }
    ul {
      display: flex;
      justify-content: center;
      gap: 2rem;
      margin: 2rem 0;
      li {
        list-style-type: none;
        font-size: var(--size-small);
        color: var(--color-line);
        font-weight: 300;
        text-transform: uppercase;
        &.active {
          color: var(--color-accent);
          font-weight: 300;
        }
      }
    }

  }
  
}

.grid.images-block picture img {
  aspect-ratio:attr(width) / attr(height);
  width:100%;
  height:auto;
  object-fit:cover;
  @media (min-width:1600px) {
    height:100%;
    width:auto;      
  }
}



footer {
  background: var(--color-dark);
  position: relative;
  z-index: 1;  
  padding: 2rem 0 1rem;
  font-weight: 200;
  font-size: var(--size-tiny);
  text-align:center;
  p { 
    font-size: var(--size-tiny);
    line-height: 1;
    color: var(--color-bg-light);
  }
  li { 
    list-style-type:none; 
    line-height: 1;
    }
  a {
    color: var(--color-light);
    color: var(--color-bg-light);
    display: block;
    margin: 1rem 0;
    &:hover {
      color: var(--color-accent-2);
    }
  }
  @media (min-width:1600px) {

    text-align:left;
    nav {
      display: flex;
      justify-content: right;
      ul {
        display: flex;
        justify-content: right;
        gap: 2rem;
      }
      a { margin: 0; }
    }
  }
}

/* SIDENAV */

.sidebar {
  display:none;
  position:fixed;
  top:50%;
  transform:translateY(-50%);
  right:0;
  z-index:20;  
  ul {
  list-style:none;
  padding:0;
  li {
    margin:1.5rem 0;
    position:relative;
    a {
    display:block;
    width:2rem;
    height:2px;
    background:var(--line);
    transition:var(--transition);
    margin-left:1rem;
    &.active {
      width:3rem;
      margin:0;
    }
    }
   span {
    position:absolute;
    line-height:0;
    text-transform:uppercase;
    text-align:right;
    background:#fff;
    font-size:var(--size-tiny);
    color:var(--color-light);
    right:2.5rem;
    opacity:0;
   }
   a.active span { right:3.5rem; }
   a:hover span { opacity:0; }
  }
  }
  @media (min-width:760px) {
    display: block;
  }
  &.section-hero,
  &.section-about {
    span { color:var(--color-light); }
  }
  &.section-works,
  &.section-figures,
  &.section-drawings  {
    a { background:var(--color-accent); }
    span { color:var(--color-bg-dark); }
  }  
}



section .gallery {
  transition:height .3s ease;
  
  @media (min-width:1024px) {
    /* max-width: 960px; */
  }
  
  margin: 0 auto;

  .wrapper {
    
    max-width: 300px;
    margin: 0 auto;
    
    @media (min-width:700px) {
    column-count: 2;
    column-gap: 1rem;
     max-width: 600px;
    }    
    
    @media (min-width:1024px) {
      column-count: 3;
      max-width: 960px;
    }
    
    @media (min-width:1600px) {
      column-count: 4;
      max-width: 1500px;
    }
    
  }
  
  .wrapper > a {
    overflow: hidden;
    display: block;
    position:relative;
    width: 100%;
    margin-bottom: 1rem;
    transition: all .3s ease; 
        
    @media (min-width:700px) {
      break-inside: avoid;
    }
    img[data-src] { opacity: 0; transition: opacity .3s ease; }    
    img.is-loaded { opacity: 1; }
    &.is-hidden { height: 0; opacity: 0; margin:0;}   

  }

  .wrapper > a > img {
    display: block;
    
    width: 100%;
    @media (min-width:700px) {
      break-inside: avoid;
    }
    
    
   
  }
 
  .wrapper a:before, .wrapper a:after {
    width:100%;
    position:absolute;
    opacity:0;
    transition:opacity 0.3s ease;
  }

  .wrapper a:before {
    content:'';
    height:100%;
    background:rgba(0,0,0,0.8);
  }

  .wrapper a:after {
    content:attr(data-title);
    font-size:24px;
    top:calc(50% - 0.5em);
    left:0;
    text-align:center;
    color:#fff;
    text-transform:uppercase;
  }

  .wrapper a:hover:before, .wrapper a:hover:after {
    opacity:1;
  }

}

section#figures .gallery {
  .wrapper {
    column-count: 3;
  }
}

section.show {
  padding: 4rem 0 0 0;
  .container {
    height: 0;
    overflow: hidden;
  }
  .gallery {
    /* left: 0; */
    opacity: 1;
    height: auto;
    overflow-y: auto;
    .close {
      opacity: 1;
      pointer-event: initial;
    }
  }  
}

/* gallery slider */
body.gallery-viewer-open {
  overflow: hidden;
  max-height: 100vh;
}

.gallery-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  transition: opacity 250ms ease;
  background: var(--color-bg-dark);
}

.gallery-viewer.is-open {
  opacity: 1;
}

.gallery-viewer__backdrop {
  position: absolute;
  inset: 0;
}

.gallery-viewer__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  @media (min-width: 901px) {
    width: 60%;
  }
  height: 100%;
  display: grid;
  grid-template-columns: 5rem 1fr 5rem;
  align-items: center;
}

.gallery-viewer__viewport {
  overflow: hidden;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}


/* Fade */

.gallery-viewer__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-viewer__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
  padding: 4.5rem 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: center;
}

.gallery-viewer__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* end */

.gallery-viewer__media {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  z-index: 2;
}

.gallery-viewer__media_bg {
  background-size: cover;
  position: fixed;
  top:0;
  left:0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
}

.gallery-viewer__media img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-viewer__info {
  color: var(--color-mid);
  z-index: 2;
  
  .headline {
    margin: 0;    
    color: var(--color-accent-2);
    line-height: 1.1;
    font-family: display, 'Times New Roman';
    font-size: var(--size-huge);
    position: relative;
    display: inline-block;
    &::after {
      content: '';
      width: 100%;
      height: 3px;
      background: var(--color-line);
      position: absolute;
      bottom: -.5rem;
      left: 25%;
      }
  }
  
  .description {
    max-width: 25rem;
    line-height: 1.4;
    margin: 1.5rem 0 0 0;
    font-size: var(--size-small);
    color: var(--color-accent);
    small {
      display: block;
      margin: .5rem 0 0 0;
      font-weight: 200;
    }
  }
  
  @media (min-width: 901px) {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: 65%;
  }  
  
}


.gallery-viewer__nav,
.gallery-viewer__close {
  appearance: none;
  border: 0;
  background: transparent;
  /* color: rgba(47,47,47,1); */  
  color: rgba(80,80,80,1);
  cursor: pointer;
}

.gallery-viewer__close {
  position: fixed;
  top: .5rem;
  right: 1rem;
  z-index: 3;
  width: 4rem;
  height: 4rem;
  padding: 1rem;
}

.gallery-viewer__nav {
  width: 5rem;
  height: 5rem;
  z-index: 2;
  padding: 1rem;
}

.gallery-viewer__nav:hover,
.gallery-viewer__close:hover {
  /* color: rgba(80,80,80,1); */
  color: rgba(255,255,255,1);
  transform: scale(.8);
}

.gallery-viewer__nav svg,
.gallery-viewer__close svg {
  width: 100%;
  height: 100%;
}

.gallery-viewer__nav:disabled {
  pointer-events: none;
  opacity: 0.1;
}

@media (max-width: 900px) {
  .gallery-viewer__dialog {
  /* grid-template-columns: 48px 1fr 48px; */
  grid-template-columns: 1fr;
  background: #000;
  }
  
  .gallery-viewer__media img {
    max-height: 100vh;
  }
  
  .gallery-viewer__info .headline,
  .gallery-viewer__nav  {
    display: none;
  }

  .gallery-viewer__slide {
  /* padding: 3.5rem 1rem 2rem; */
  padding: 0;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  }

  .gallery-viewer__info {
  text-align: center;
  }

  .gallery-viewer__nav {
  width: auto;
  height: 5rem;
  padding:0;
  }
}


/* ============================================== */

.background {
  position: fixed;
  z-index: 0;
  top:0;
  left:0;
  width: 100%;
  height: 100%;
  overflow:hidden;
  
  img {
    height: 100%;
    width: auto;
    @media (min-width: 1600px) {
      width: 100%;
      height: auto;      
    }
  }
}