/* ----- fonts ----- */
@font-face {
  font-family: 'Bai Jamjuree';
  src: url("../fonts/Bai_Jamjuree/BaiJamjuree-SemiBold.ttf") format('truetype');
}
@font-face {
  font-family: 'Poppins';
  src: url("../fonts/Poppins/Poppins-Regular.ttf") format('truetype');
}
@font-face {
  font-family: 'Roboto';
  src: url("../fonts/Roboto/Roboto-Regular.ttf") format('truetype');
}

/* ----- vars ----- */
:root {
  --pirate-doubloon: #BB9645;
  --pirate-neon: #ffbd30;
  --pirate-gold: #e3cb80;
  --pirate-cloud: #ffffff;
  --pirate-font-primary: 'Bai Jamjuree';
  --pirate-font-secondary: 'Roboto', sans-serif;
  --pirate-font-alternative: 'Poppins';
  --darkest: #14131c;
  --text-main: #a2a6ad;
}

/* ----- main ----- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  background-color: var(--darkest);
  width: 100%;
  height: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
body {
  font-size: 16px;
  letter-spacing: 0.7px;
  color: var(--text-main);
  font-family: var(--pirate-font-alternative);
  overflow-x: hidden;
  isolation: isolate;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(255, 255, 255, 0.06), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
a {
  color: var(--pirate-doubloon);
  text-decoration: none;
}
a:hover {
  color: var(--pirate-neon);
}
a:-webkit-any-link {
  cursor: pointer;
}
h1 {
  color: var(--pirate-doubloon);
  font-size: 48px;
  font-family: var(--pirate-font-primary);
}
h2 {
  font-size: 29px;
  font-weight: 200;
  color: var(--pirate-cloud);
  font-family: var(--pirate-font-primary);
}
h3 {
  color: var(--pirate-cloud);
  font-family: var(--pirate-font-secondary);
}
.content {
  max-width: 1800px;
  margin: auto;
  height: auto;
  padding: 0px 15px;
}
.btn {
  padding: 10px 18px;
  border: 2px solid var(--pirate-doubloon);
  display: inline-block;
  width: 240px;
  margin: 8px 6px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-align: center;
  background-color: #272727;
  color: var(--pirate-neon);
}
.btn .button-text {
  background: linear-gradient(to right, var(--pirate-doubloon), var(--pirate-gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.btn:hover {
  border: 2px solid var(--pirate-doubloon);
  outline: 2px solid var(--pirate-gold);
  outline-offset: 6px;
}

/* ----- backtotop button ----- */
#return-to-top {
  opacity: 0;
  position: fixed;
  bottom: 40px;
  right: 30px;
  z-index: 1000;
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 4px;
  width: 40px;
  height: 40px;
  background-image: url(../img/site/circle-up.svg);
  background-size: cover;
  transition: all 0.5s ease-in-out;
}

/* ----- scrollbar ----- */
* {
  scrollbar-width: auto;
  scrollbar-color: var(--pirate-doubloon) #262626;
}
*::-webkit-scrollbar {
  width: 15px;
  background: #262626;
}
*::-webkit-scrollbar-track {
  background: #262626;
  border-radius: 3px;
}
*::-webkit-scrollbar-thumb {
  background-color: #393939;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--pirate-doubloon) !important;
}
::-webkit-scrollbar-corner {
  background: rgba(0,0,0,0);
}

/* ---- 404 Page ----- */
.container-404 {
  margin: 10px auto;
  max-width: 600px;
  text-align: center;
}
.container-404 h1 {
  margin: 100px 0 20px;
  font-size: 7em;
  line-height: 1;
  letter-spacing: -1px;
}
.container-404 .btn {
  margin-top: 60px;
}

/* ----- footer ----- */
footer {
  background-color: #272727;
  width: 100%;
  overflow: hidden;
  text-align: center;
  padding-bottom: 100px;
  padding-top: 40px;
  margin-top: 120px;
}
footer div {
  width: 100%;
  max-width: 240px;
  font-size: 12px;
  text-align: left;
  margin: 40px 6% 0px;
  display: inline-block;
  vertical-align: top;
}
footer .piratechain {
  width: 100%;
  max-width: 150px;
  display: block;
  margin-bottom: 20px ;
}
footer .discord {
  width: 100%;
  max-width: 150px;
  display: block;
  margin-top: 5px;
  margin-bottom: 20px ;
}

/* ----- hero-section ----- */
.hero-section::after {
  content: '';
  position: absolute;
  inset: -25% 0;
  background: var(--hero-background) center / cover no-repeat;
  transform: translate3d(0, var(--parallax-offset, 0px), 0);
  z-index: 0;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}
.hero-section .content,
.map-section .content {
  position: relative;
  z-index: 2;
}
.hero-section {
  position: relative;
  overflow: hidden;
  padding-bottom: 100px;
  padding-top: 120px;
  text-align: center;
}
.hero-section .logo {
  width: 100%;
  max-width: 360px;
  margin-bottom: 40px;
}
.hero-section h1 {
  font-family: var(--pirate-font-primary);
  font-size: 60px;
  margin-top: 5px;
  color: var(--pirate-gold);
}
.hero-section h1 .arrr {
  font-weight: bold;
  background: linear-gradient(to right, var(--pirate-doubloon), var(--pirate-gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero-section strong {
  color: var(--pirate-cloud);
  font-size: 28px;
}
.hero-section p {
  margin-top: 30px;
  margin-bottom: 40px;
  margin-inline: auto;
  font-size: 18px;
  width: 100%;
  max-width: 420px;
  color: #fff;
}
.hero-section strong, .hero-section p {
  text-shadow: 0px 0px 30px rgb(0, 0, 0);
}
@media screen and (max-width: 768px) {
  .hero-section h1 {
    font-size: 40px;
  }
  .hero-section strong {
    font-size: 20px;
  }
  .hero-section p {
    font-size: 14px;
  }
}
@media screen and (max-width: 466px) {
  .hero-section h1 {
    font-size: 30px;
  }
  .hero-section strong {
    font-size: 15px;
  }
}

/* ----- map-section ----- */
.map-section {
  padding-top: 100px;
}
.start-date {
  display: block;
  margin-bottom: 40px;
  font-size: 20px;
}
.setsail {
  position: absolute;
  top: -4px;
  left: 55%;
}
.timeline {
  position: relative;
  width: 100%;
  margin: 0 auto;
  margin-top: 80px;
  padding: 140px 0 100px;
}
.timeline::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  bottom: 0;
  width: 10px;
  background-image: url('../img/site/chainlink.svg');
  background-repeat: repeat-y;
  transform: translateX(-50%);
  z-index: 1;
}
.post {
  position: relative;
  width: 40%;
  margin-bottom: 30px;
  padding: 10px;
  border-radius: 5px;
  scroll-margin-top: 24px;
}
.post .date {
  font-size: 20px;
  color: #fff;
  display: block;
  margin: 5px auto 10px;
}
.milestone-image img {
  display: block;
  max-width: 100%;
  height: auto;
}
.post .milestone-image {
  width: 90%;
  margin: 50px auto 20px;
}
.post .milestone-image a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  pointer-events: none;
}
.post .milestone-image img {
  width: 100%;
  height: auto;
  border-radius: 5px;
  pointer-events: auto;
}
.post.left {
  left: 45%;
  transform: translateX(-100%);
}
.post.right {
  left: 55%;
  transform: translateX(0);
}
.milestone-header h3 {
  color: #fff;
  margin: 30px 0 20px;
  font-size: 26px;
}
.milestone-bookmark {
  color: inherit;
}
.milestone-bookmark:focus-visible {
  outline: 2px solid var(--pirate-doubloon);
  outline-offset: 4px;
}
.milestone-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.milestone-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 8px;
  height: 36px;
  font-size: 13px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 5px;
  flex-shrink: 0;
}
.milestone-link:hover {
  border-color: var(--pirate-doubloon);
  background: #26263d;
}
.milestone-link:focus-visible {
  outline: 2px solid var(--pirate-neon);
  outline-offset: 3px;
}
.milestone-link svg,
.milestone-link img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.post.left .date {
  text-align: right;
}
.post-content {
  padding: 20px;
  background: #202033;
  border: 1px solid #2c2c45;
  border-radius: 5px;
  font-size: 18px;
  cursor: pointer;
}
.post:hover .post-content,
.post.is-selected .post-content {
  border-color: var(--pirate-doubloon);
}
.post.is-selected .post-content {
  box-shadow: 0 0 16px rgba(187, 150, 69, 0.2);
}
.milestone-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-height: 1.5;
  overflow: hidden;
}
.milestone-description.is-expanded {
  display: block;
}
.milestone-toggle {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pirate-doubloon);
  font: inherit;
  cursor: pointer;
}
.milestone-toggle:hover {
  color: var(--pirate-neon);
}
.timeline .item {
  position: relative;
}
.timeline-marker {
  position: absolute;
  width: 40px;
  height: auto;
  z-index: 2;
  top: 8px;
  border-radius: 50%;
  padding: 7px;
  background-color: #3a3a3a;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid var(--pirate-doubloon);
  box-shadow: 0px 0px 24px #8b6d1596;
}
.timeline .start-marker {
  top: 0;
  width: 60px;
}
.timeline .end-marker {
  top: 100%;
  bottom: 100%;
  width: 60px;
}
.map-section .website {
  text-align: center;
}
.map-section .btn {
  margin-bottom: 20px;
  margin-top: 80px;
}
@media screen and (max-width: 1000px) {
  .timeline::after {
    left: 12px;
    transform: translateX(0);
  }
  .post {
    width: 98%;
    padding: 10px;
  }
  .post.left, .post.right {
    transform: translateX(0);
    position: relative;
    display: block;
    left: 28px;
  }
  .post .date {
    margin-left: 20px;
  }
  .post.left .date  {
    text-align: left;
  }
  .timeline-marker {
    left: 16px;
  }
  .map-section .website {
    margin-top: 60px;
  }
  .setsail {
    left: 80px;
  }
  .map-section {
    padding-top: 60px;
  }
}
@media screen and (max-width: 600px) {
  .post-content {
    font-size: 16px;
  }
}

/* ----- milestone image viewer ----- */
html.image-viewer-open {
  overflow: hidden;
}
.milestone-image a {
  display: inline-block;
  max-width: 100%;
  cursor: zoom-in;
}
.milestone-image img {
  cursor: zoom-in;
}
.image-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 72px 24px 24px;
  border: none;
  background: transparent;
  color: var(--pirate-cloud);
  overflow: hidden;
}
.image-viewer[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-viewer::backdrop {
  background: rgba(0, 0, 0, 0.88);
}
.image-viewer-image {
  display: block;
  width: min(100%, calc((100vh - 96px) * var(--image-ratio, 1)));
  width: min(100%, calc((100dvh - 96px) * var(--image-ratio, 1)));
  height: auto;
  max-height: 100%;
  object-fit: contain;
}
.image-viewer-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
}
.image-viewer-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: #272727;
  color: var(--pirate-cloud);
  cursor: pointer;
}
.image-viewer-action:hover {
  color: var(--pirate-neon);
  border-color: var(--pirate-doubloon);
}
.image-viewer-action:focus-visible {
  outline: 2px solid var(--pirate-neon);
  outline-offset: 3px;
}
.image-viewer-action svg {
  width: 22px;
  height: 22px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
