/* Custom Font - Bulletproof Syntax */
@font-face {
  font-family: 'Underwood1913';
  src: 
       url('https://harrowick.neocities.org/Lore/Candles/Underwood1913.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
/* background image */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  background: url("https://harrowick.neocities.org/Lore/Candles/candlelorebackground.png") no-repeat center center fixed;
  background-size: cover;
  overflow: hidden;
}

/* title */
.page-title {
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  max-width: 800px;
  height: auto;
  pointer-events: none;
}

/* back button (todo: make a variant that doesn't say "return home" */
.home-btn {
  position: fixed;
  cursor: pointer;
  z-index: 5;
  filter: brightness(0.8) contrast(0.9);
  transition: filter 0.3s ease;
}

.home-btn:hover {
  filter: brightness(1) contrast(1);
}




/* the entire candle placement */
.character-section {
  position: absolute;
  left: 8%;
  top: 52%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}



/* candle name placement */
.character-name {
  position: relative;
  max-width: 945px;
  margin-bottom: 5px;
  left: 4%;
  z-index: 3;
}



/* candle render placement */
.character-render {
  height: auto;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
  position: relative;
  z-index: 1; 
  margin-bottom: 10px; 
  left: 2%;
}



/* candle title placement */
.character-title {
  height: auto;
  position: relative;
  z-index: 2;
  margin-bottom: 10px;
}



/* character frame */
.character-frame {
  position: absolute;
  left: 49%;
  bottom: -9%;
  transform: translate(-50%, -50%);
  max-width: 632px; 
  height: auto;
  z-index: 0;
  pointer-events: none; 
}

/* container */
.content-container {
  position: absolute;
  right: 12%;
  top: 52%;
  transform: translateY(-50%);
  width: 50%;
  max-width: 975px;
  height: auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* container tabs (margin-bottom affects distance between container and tabs, gap determines how spread out they are  */
.tab-nav {
  display: flex;
  gap: 1px;
  margin-bottom: -90px;
  justify-content: center;
  z-index: 4;
   transform: scale(1.1);
}



/* hover effect for the tabs */
.tab-btn {
  cursor: pointer;
  filter: brightness(0.7);
  transition: filter 0.3s ease;
  max-width: 200px;
  height: auto;
}

.tab-btn:hover {
  filter: brightness(1);
}

.tab-btn.active {
  filter: brightness(1.2);
}



/* container placement*/


.content-box {
  position: relative;
  width: 100%;
  max-width: 975px;
  height: 836px;
  background-image: url('https://harrowick.neocities.org/Lore/Candles/LoreContainerAnim.png'); 
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  padding: 70px;
  box-sizing: border-box;
}
/* candle's story header/title*/
.content-header {
  text-align: center;
  font-family: 'Underwood1913', 'Underwood1913', monospace;
  font-size: 25px;
  font-weight: normal;
  color: rgb(221, 206, 191);
  text-decoration: underline 0.02em;
  margin-bottom: 20px;
  letter-spacing: 2px;
  padding-top: 10px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* lore text/scroll text */
.scroll-gradient {
  height: 600px;
  overflow-y: scroll;
  padding-right: 40px;
  padding-left: 40px;
  padding-top: 10px;
  font-family: 'Underwood1913', 'Underwood1913', monospace;
  font-size: 20px;
  line-height: 1.5;
  color: rgb(221, 206, 191);
  position: relative;
  text-shadow: 1px 1px 2px rgba(0,0,0,5);
}

.scroll-gradient::after {
  content: '';
  display: block;
  height: 700px; /* this makes room for extra scrollbar space*/
}
/* scrollbar */
.scroll-gradient::-webkit-scrollbar {
  width: 15px;
}

.scroll-gradient::-webkit-scrollbar-track {
  background-image: url('https://harrowick.neocities.org/Lore/Candles/scrollbartrack.png');
  background-size: contain;
  background-repeat: repeat-y;
  background-position: center;
}

.scroll-gradient::-webkit-scrollbar-thumb {
  background-image: url('https://harrowick.neocities.org/Lore/Candles/scrollbarthumb.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center top;
}







/* this is the gradient code for the text*/
.scroll-gradient.scrolled-top {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
}

.scroll-gradient.scrolled-middle {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
}

.scroll-gradient.scrolled-bottom {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%);
}






/* tabs */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}







/* relations tab */
.relation-entry {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(221, 206, 191, 0.2);
}

.relation-entry:last-child {
  border-bottom: none;
}

.relation-name {
  font-family: 'Underwood1913', monospace;
  font-size: 22px;
  color: rgb(221, 206, 191);
  text-decoration: underline 0.02em;
  margin-bottom: 20px;
  letter-spacing: 1.5px;
  text-align: center;
}

.relation-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.relation-text {
  width: 100%;
  font-family: 'Underwood1913', monospace;
  font-size: 18px;
  line-height: 1.6;
  color: rgb(221, 206, 191);
  position: relative;
  text-align: center;
}
  


.relation-text p {
  margin: 0;
}

.relation-image-wrapper {
  flex-shrink: 0;
  width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
  z-index: 1;
  margin: 0 auto;
}

.relation-image {
  width: 200%;
  max-height: 335px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%);
  mask-image: linear-gradient(to top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%);
}















/* outfit tab carousel */
.outfit-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 40px 0;
}

.carousel-arrow {
  width: 50px;
  height: auto;
  cursor: pointer;
  filter: brightness(0.9);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.carousel-arrow:hover {
  filter: brightness(1.2);
  transform: scale(1.1);
}

.carousel-image-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 450px;
  max-height: 300px;
}

.carousel-image {
  width: 75%;
  height: 75%;
  max-height: 425px;
  object-fit: contain;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.carousel-description {
  text-align: center;
  font-family: 'Underwood1913', monospace;
  font-size: 18px;
  color: rgb(221, 206, 191);
  line-height: 1.6;
  padding: 20px 40px;
  margin-top: 20px;
}


.carousel-subtitle {
  text-align: center;
  font-family: 'Underwood1913', monospace;
  font-size: 16px;
  color: rgba(221, 206, 191, 0.8);
  line-height: 1.6;
  padding: 0 40px;
  margin-top: 10px;
  font-style: italic;
}




/* gallery grid */

/* this puts the images into rows of 3*/
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  padding: 20px 0;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}


.gallery-item img {
  width: 100%;
  height: auto;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.gallery-item img:hover {
  transform: scale(1.05);

}

.gallery-caption {
  font-family: 'Underwood1913', 'Underwood1913', monospace;
  font-size: 16px;
  color: rgb(221, 206, 191);
  line-height: 1.4;
}

/* for enlarging items on click  */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}



/* portrait navigation (vertical) */
.portrait-nav-vertical {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 9;
  padding-right: 15px;
}

/*this is the dark fog background thing for the quicknav portraits*/
.portrait-background {
  position: fixed;
  right: -2%;
  top: 0;
  width: 300px; 
  height: 100vh;
  transform: scaleY(150%);
  background-image: url('https://harrowick.neocities.org/Lore/Candles/verticalportraitcontainer.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right center;
  z-index: 8;
  pointer-events: none;
}

/*code for the dots above and below the portraits*/
.portrait-dot-vertical {
  cursor: pointer;
  width: 50px;
  height: auto;
  filter: brightness(0.9);
  transition: all 0.3s ease;
}

.portrait-dot-vertical:hover {
  filter: brightness(1.2);
  transform: scale(1.1);
}

.portrait-grid-vertical {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 900px; 
  overflow: hidden;
}

.portrait-page-vertical {
  display: none;
  flex-direction: column;
  gap: 15px;
}

.portrait-page-vertical.active {
  display: flex;
}

.portrait-link-vertical {
  display: block;
  width: 100%; 
  height: 150px; 
  cursor: pointer;
  transition: all 0.3s ease;
  filter: brightness(0.85);
}

.portrait-link-vertical:hover {
  filter: brightness(1.1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
  transform: translateX(-5px);
}

.portrait-link-vertical img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}





/* large desktop */
@media (max-width: 1440px) {
  
  .page-title {
    max-width: 600px;
  }
  
  .character-section {
    left: -3%;
    transform: translateY(-47%) scale(0.82);
  }
  
  .content-container {
    right: 7%;
    width: 60%;
    transform: translateY(-47%) scale(0.95);
  }
  
  .tab-nav {
    transform: scale(0.95);
    margin-bottom: -85px;
  }
  
  .portrait-background {
    width: 240px;
  }
  
  .portrait-link-vertical {
    height: 140px;
  }
  
  .portrait-dot-vertical {
    width: 45px;
  }
}

/* tablets and small desktop */
@media (max-width: 1200px) {
  .character-section {
    left: -8%;
    transform: translateY(-47%) scale(0.80);
  }
  
  .content-container {
    right: 8%;
    width: 64%;
  }
  
  .portrait-nav-vertical {
    padding-right: 10px;
  }
  
  .tab-nav {
    transform: scale(0.85);
    margin-bottom: -85px;
  }
   .relation-name{
    text-align: center;
  }
  .relation-content {
    flex-direction: column;
    align-items: center;
  }
  
  .relation-image-wrapper {
    width: 250px;
    min-height: 280px;
    
  }
  .portrait-background {
    width: 260px;
  }
  
  .portrait-link-vertical {
    height: 130px;
  }
  
  .portrait-dot-vertical {
    width: 42px;
  }
}

/* tablets*/
@media (max-width: 1024px) {
  .page-title {
    max-width: 600px;
  }
  
   .home-btn {
    position: absolute;
    top: 10px;
    left: 0px;
    width: 270px;
  }
  
  
  .character-section {
    left: -14%;
    transform: translateY(-46%) scale(0.70);
  }
  
  .content-container {
    right: 7%;
    width: 65%;
  }
  
  .content-box {
    height: 700px;
    padding: 50px;
  }
  
  .relation-name{
    text-align: center;
  }
  
  .scroll-gradient {
    height: 500px;
  }
  
  .relation-content {
    flex-direction: column;
    align-items: center;
  }
  
  .relation-image-wrapper {
    width: 250px;
    min-height: 280px;
  }
  .portrait-background {
    width: 250px;
    transform: translateX(17%);
  }
  
  .portrait-link-vertical {
    height: 120px;
    transform: translateX(5%);
  }
  
  .portrait-background {
    transform: scaleY(110%);
    right: -53px;
  }
  
  
  .tab-nav {
    transform: scale(0.80);
    margin-bottom: -80px;
  }
}

/* mobile landscape*/
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    height: auto;
  }
  
  .page-title {
    position: relative;
    max-width: 90%;
    margin: 10px auto;
    display: block;
  }
  
  .home-btn {
    position: absolute;
    top: 10px;
    left: 0px;
    width: 215px;
  }
  
  /* vertical for mobile */
  .character-section {
    position: relative;
    left: 50%;
    top: auto;
    transform: translateX(-50%) scale(0.9);
    margin: -100px auto;
  }
  
  .content-container {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: 800px;
    margin: 20px auto 100px;
  }
  
  .content-box {
    height: 600px;
    padding: 40px 30px;
  }
  
  .scroll-gradient {
    height: 400px;
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .content-header {
    font-size: 22px;
  }
  
  .relation-name {
    text-align: center;
  }
  
  .scroll-gradient {
    font-size: 18px;
  }
  
  /* portraits on the bottom for mobile */
  .portrait-nav-vertical {
    position: fixed;
    right: auto;
    left: 50%;
    top: auto;
    bottom: 10px;
    transform: translateX(-50%);
    flex-direction: row;
    padding: 10px;
    border-radius: 10px;
    max-width: 95vw; 
  }
  
  .portrait-background {
    position: fixed;
    left: -300px;
    right: 0;
    top: auto;
    bottom: 0;
    width: 75vw;
    height: 900px;
    transform: rotate(90deg);
    transform-origin: bottom center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 8;
    pointer-events: none;
  }
  
  .portrait-grid-vertical {
    flex-direction: row;
    max-height: none;
    max-width: 600px;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px; 
  }
  
  .portrait-page-vertical {
    flex-direction: row;
    gap: 8px; 
  }
  
  .portrait-link-vertical {
    width: 100px;
    height: 100px;
    flex-shrink: 0; 
  }
  
  .portrait-dot-vertical {
    width: 40px;
  }
  
  /* relations */
  .relation-content {
    flex-direction: column;
    align-items: center;
  }
  
  .relation-image-wrapper {
    width: 200px;
    min-height: 250px;
  }
  
  /* gallery */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  /* carousel */
  .carousel-arrow {
    width: 40px;
  }
  
  .carousel-image-container {
    max-width: 300px;
  }
}

/* mobile portrait */
@media (max-width: 425px) {
  .page-title {
    max-width: 95%;
    visibility: hidden;
  }
  
  .home-btn {
    width: 150px;
  }
  
  .character-section {
    transform: translateX(-44%) scale(0.8);
  }
  
  .content-container {
    width: 110%;
    transform: translateX(6%) scale(1.2);
  }
  
  .content-box {
    height: 500px;
    padding: 30px 20px;
  }
  
  .tab-nav {
    gap: 0;
    transform: scale(0.56);
    margin-bottom: -70px;
  }
  
  .content-header {
    font-size: 20px;
  }
  
  .scroll-gradient {
    height: 350px;
    font-size: 16px;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* gallery */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .gallery-caption {
    font-size: 14px;
  }
  
  /* carousel */
  .outfit-carousel {
    gap: 10px;
    padding: 20px 0;
  }
  
  .carousel-arrow {
    width: 30px;
  }
  
  .carousel-image-container {
    max-width: 200px;
    max-height: 200px;
  }
  
  .carousel-description,
  .carousel-subtitle {
    font-size: 14px;
    padding: 10px 20px;
  }
  
  /* Portrait nav adjustments */
  .portrait-nav-vertical {
    max-width: 100vw; 
    padding: 10px 5px; 
  }
  
  .portrait-grid-vertical {
    gap: 4px; 
    max-width: 100%; 
  }
  
  .portrait-page-vertical {
    gap: 4px; 
  }
  
  .portrait-link-vertical {
    width: 70px; 
    height: 70px; 
    flex-shrink: 0;
  }
  
  .portrait-dot-vertical {
    width: 20px;
  }
  
  /* relations */
  .relation-name {
    font-size: 20px;
  }
  
  .relation-text {
    font-size: 16px;
  }
  
  .relation-image-wrapper {
    width: 150px;
    min-height: 200px;
  }
}


@media (max-width: 375px) {
  .page-title {
    max-width: 95%;
    visibility: hidden;
  }
  
  .home-btn {
    width: 150px;
  }
  
  .character-section {
    transform: translateX(-37%) scale(0.8);
  }
  
  .content-container {
    width: 110%;
    transform: translateX(8%) scale(1.2);
  }
  
  .content-box {
    height: 500px;
    padding: 30px 20px;
  }
  
  .tab-nav {
    gap: 0;
    transform: scale(0.55) translateX(3%);
    margin-bottom: -70px;
  }
  
  .content-header {
    font-size: 20px;
  }
  
  .scroll-gradient {
    height: 350px;
    font-size: 16px;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* gallery */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .gallery-caption {
    font-size: 14px;
  }
  
  /* carousel */
  .outfit-carousel {
    gap: 10px;
    padding: 20px 0;
  }
  
  .carousel-arrow {
    width: 30px;
  }
  
  .carousel-image-container {
    max-width: 200px;
    max-height: 200px;
  }
  
  .carousel-description,
  .carousel-subtitle {
    font-size: 14px;
    padding: 10px 20px;
  }
  
  /* Portrait nav adjustments */
  .portrait-nav-vertical {
    max-width: 150vw; 
    padding: 10px 5px; 
  }
  
  .portrait-grid-vertical {
    gap: 4px; 
    max-width: 100%; 
  }
  
  .portrait-page-vertical {
    gap: 4px; 
  }
  
  .portrait-link-vertical {
    width: 70px; 
    height: 70px; 
    flex-shrink: 0;
  }
  
  .portrait-dot-vertical {
    width: 20px;
  }
  
  /* relations */
  .relation-name {
    font-size: 20px;
  }
  
  .relation-text {
    font-size: 16px;
  }
  
  .relation-image-wrapper {
    width: 150px;
    min-height: 200px;
  }
}