
@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/Entities/entitylorebackground.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 */
.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);
}

/* entity render section */
.character-section {
  position: absolute;
  left: 3%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

/* entity name placement */
.character-name {
  position: relative;
  max-width: 945px;
  left: -3%;
  margin-bottom: -20px;
  z-index: 3;
}

/* entity render placement */
.character-render {
  height: auto;
  width: 700px;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
  left: 4%;
}

/* main container */
.content-container {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  width: 50%;
  max-width: 975px;
  max-height: 95vh;
  height: auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* tabs */
.tab-nav {
  display: flex;
  gap: 1px;
  margin-bottom: -90px;
  justify-content: center;
  z-index: 4;
  transform: scale(1.1);
}

.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 box */
.content-box {
  position: relative;
  width: 100%;
  max-width: 975px;
  height: min(836px, 75vh);
  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;
}

/* content header */
.content-header {
  text-align: center;
  font-family: '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);
}

/* scroll area */
.scroll-gradient {
  height: calc(min(836px, 75vh) - 236px);
  overflow-y: scroll;
  padding-right: 40px;
  padding-left: 40px;
  padding-top: 10px;
  font-family: '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;
}

/* 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;
}

/* scroll gradient masks */
.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 show/hide */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* gallery grid */
.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', monospace;
  font-size: 16px;
  color: rgb(221, 206, 191);
  line-height: 1.4;
}

/* lightbox */
.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-nav-horizontal {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: -30px;
  z-index: 9;
  width: 100%;
}

.portrait-nav-bg {
  position: absolute;
  top: 90%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: auto;
  z-index: -1;
  pointer-events: none;
}



.portrait-dot-horizontal {
  cursor: pointer;
  width: 50px;
  height: auto;
  filter: brightness(0.9);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.portrait-dot-horizontal:hover {
  filter: brightness(1.2);
  transform: scale(1.1);
}

.portrait-grid-horizontal {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  gap: 0;
}

.portrait-page-horizontal {
  display: none;
  flex-direction: row;
  gap: 14px;
}

.portrait-page-horizontal.active {
  display: flex;
}

/* portrait size */
.portrait-link-horizontal {
  display: block;
  width: 170px;
  height: 170px;
  cursor: pointer;
  transition: all 0.3s ease;
  filter: brightness(0.85);
  flex-shrink: 0;
}

.portrait-link-horizontal:hover {
  filter: brightness(1.1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
  transform: translateY(-5px);
}

.portrait-link-horizontal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}



@media (max-height: 900px) {
  .content-box {
    height: min(750px, 80vh);
    padding: 55px;
  }
  .scroll-gradient {
    height: calc(min(750px, 80vh) - 220px);
  }
  .tab-nav {
    margin-bottom: -82px;
  }
  .portrait-nav-horizontal {
    margin-top: -50px;
  }
  .portrait-link-horizontal {
    width: 155px;
    height: 155px;
  }
}

@media (max-height: 750px) {
  .content-box {
    height: min(640px, 82vh);
    padding: 45px;
  }
  .scroll-gradient {
    height: calc(min(640px, 82vh) - 205px);
  }
  .tab-nav {
    transform: scale(1.0);
    margin-bottom: -78px;
  }
  .portrait-nav-horizontal {
    margin-top: -42px;
  }
  .portrait-link-horizontal {
    width: 135px;
    height: 135px;
  }
  .portrait-dot-horizontal {
    width: 40px;
  }
}

@media (max-height: 620px) {
  .content-box {
    height: min(530px, 84vh);
    padding: 35px;
  }
  .scroll-gradient {
    height: calc(min(530px, 84vh) - 190px);
    font-size: 17px;
  }
  .tab-nav {
    transform: scale(0.9);
    margin-bottom: -74px;
  }
  .portrait-nav-horizontal {
    margin-top: -35px;
  }
  .portrait-link-horizontal {
    width: 110px;
    height: 110px;
  }
  .portrait-dot-horizontal {
    width: 34px;
  }
  .content-header {
    font-size: 21px;
    margin-bottom: 12px;
    padding-top: 6px;
  }
}



/* large desktop */
@media (max-width: 1440px) {
  .page-title {
    max-width: 600px;
  }

  .character-section {
    left: -8%;
    transform: translateY(-47%) scale(0.82);
  }

  .content-container {
    right: -4%;
    width: 65%;
    transform: translateY(-47%) scale(0.95);
  }

  .tab-nav {
    transform: scale(0.95);
    margin-bottom: -85px;
  }

  .portrait-nav-horizontal {
    margin-top: -59px;
  }

  .portrait-link-horizontal {
    width: 155px;
    height: 155px;
  }

  .portrait-dot-horizontal {
    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%;
  }

  .tab-nav {
    transform: scale(0.85);
    margin-bottom: -85px;
  }

  .portrait-link-horizontal {
    width: 140px;
    height: 140px;
  }

  .portrait-dot-horizontal {
    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: -25%;
    transform: translateY(-46%) scale(0.70);
  }

  .content-container {
    right: -3%;
    width: 75%;
  }

  .content-box {
    height: min(700px, 78vh);
    padding: 50px;
  }

  .scroll-gradient {
    height: calc(min(700px, 78vh) - 215px);
  }

  .tab-nav {
    transform: scale(0.80);
    margin-bottom: -80px;
  }

  .portrait-link-horizontal {
    width: 150px;
    height: 150px;
  }
}

/* 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;
  }

  .character-section {
    position: relative;
    left: 50%;
    top: auto;
    transform: translateX(-50%) scale(0.8);
    margin: -100px auto;
  }

  .content-container {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: 800px;
    margin: 20px auto 40px;
  }

  .content-box {
    height: 600px;
    padding: 40px 30px;
  }

  .scroll-gradient {
    height: 400px;
    padding-left: 20px;
    padding-right: 20px;
    font-size: 18px;
  }

  .content-header {
    font-size: 22px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .portrait-nav-horizontal {
    margin-top: 10px;
  }

  .portrait-link-horizontal {
    width: 150px;
    height: 150px;
  }

  .portrait-dot-horizontal {
    width: 40px;
  }
}

/* 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-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .gallery-caption {
    font-size: 14px;
  }

  .portrait-link-horizontal {
    width: 80px;
    height: 80px;
  }

  .portrait-dot-horizontal {
    width: 28px;
  }
}

@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-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .gallery-caption {
    font-size: 14px;
  }

  .portrait-link-horizontal {
    width: 68px;
    height: 68px;
  }

  .portrait-dot-horizontal {
    width: 22px;
  }
}