/* Font Definitions */
@font-face {
  font-family: "AkkuratLL-Regular";
  src: url("/content/dam/spglobal/commodity-insights/en/content-design/infographics/common/fonts/AkkuratLL-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "AkkuratLL-Light";
  src: url("/content/dam/spglobal/commodity-insights/en/content-design/infographics/common/fonts/AkkuratLL-Light.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "AkkuratLL-Bold";
  src: url("/content/dam/spglobal/commodity-insights/en/content-design/infographics/common/fonts/AkkuratLL-Bold.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

/* @font-face {
  font-family: "AkkuratLL-Regular";
  src: url("../akkurat/AkkuratLL-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "AkkuratLL-Light";
  src: url("../akkurat/AkkuratLL-Light.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "AkkuratLL-Bold";
  src: url("../akkurat/AkkuratLL-Bold.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
} */

/* Global Resets */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

p {
  margin-block-start: 0;
  margin-block-end: 0;
}

html,
body {
  background-color: #0a0a0a;
  overflow: hidden;
  line-height: 1.1 !important;
}

.final-wrapper {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.final-wrapper button {
  background: none;
  border: none;
  padding: 0;
}

.final-wrapper iframe {
  border: none;
}

.final-wrapper .hero {
  display: flex;
  height: 100%;
  width: 100%;
}

.navigation-panel {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 14%;
  height: 100%;

  padding: clamp(0.9rem, 0.6rem + 0.75vw, 1.5rem) 0 0
    clamp(0.9rem, 0.6rem + 0.75vw, 1.5rem);
  background-color: rgba(10, 10, 10, 0.7);

  display: flex;
  flex-direction: column;
}

body.map-active .navigation-panel {
  position: relative;
  width: 14%;
  height: 100%;
  background-color: #0a0a0a;
}

.navigation-panel .brand-logo {
  width: clamp(3rem, 1.5rem + 3.75vw, 6rem);
  margin-bottom: clamp(0.7rem, 0.55rem + 0.375vw, 1rem);
}

.brand-logo img {
  width: 100%;
  padding-left: 0.2rem;
}

.navigation-panel .title {
  font-family: "AkkuratLL-Bold";
  font-size: clamp(0.75rem, 0.125rem + 1.5625vw, 2rem) !important;
  padding-bottom: clamp(0.5rem, 0.25rem + 0.625vw, 1rem);
  line-height: 1.1 !important;
  color: #fff;
  cursor: pointer;
}

.navigation-panel .title:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.1rem;
  text-underline-offset: 0.2rem;
}

/* List Styles */
.timeline-list {
  width: 100%;
  height: 100%;
  list-style: none;
  overflow-y: auto;
  transition: all 0.5s cubic-bezier(0.33, 1, 0.68, 1);
  display: flex;
  flex-direction: column;
  gap: clamp(0.3rem, 0.15rem + 0.375vw, 0.6rem);
}

.timeline-list li {
  cursor: pointer;
  width: fit-content;
}

.timeline-list li > p:first-of-type {
  position: relative;
  display: inline-block;
  font-family: "AkkuratLL-Bold";
  font-size: clamp(0.75rem, 0.575rem + 0.4375vw, 1.1rem);
  color: #edf86f;
  transition: all 0.3s ease;
}

.timeline-list li > p:first-of-type::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0.09375rem;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
  transition: transform 0.5s ease;
}

.timeline-list li > p:nth-of-type(2) {
  color: #fff;
  margin-top: 0.2rem;
  font-size: clamp(0.65rem, 0.525rem + 0.3125vw, 0.9rem);
  font-family: "AkkuratLL-Regular";
  transition: all 0.3s ease;
}

.timeline-list li:hover > p:first-of-type {
  color: #fff;
  font-size: clamp(0.8125rem, 0.6188rem + 0.4844vw, 1.2rem);
}

.timeline-list li.active > p:first-of-type {
  font-family: "AkkuratLL-Bold";
  font-size: clamp(0.875rem, 0.6625rem + 0.5313vw, 1.3rem);
  color: #fff;
}

.timeline-list li.active > p:first-of-type::after,
.timeline-list li:hover > p:first-of-type::after {
  transform: scaleX(1);
}

.timeline-info-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14%;
  width: 18%;
  z-index: 2;
  color: #fff;
}

.timeline-info-content {
  flex: 1;
  overflow-y: auto;
  padding: 5.5rem 0.5rem 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: clamp(0.7rem, 0.6rem + 0.4444vw, 1rem);
}

.timeline-list::-webkit-scrollbar,
.timeline-info-content::-webkit-scrollbar {
  display: none;
}

.timeline-info-content::-webkit-scrollbar {
  display: none;
}

.item-title {
  font-family: "AkkuratLL-Bold";
  font-size: clamp(0.8125rem, 0.6188rem + 0.4844vw, 1.2rem);
}

.item-desc {
  font-family: "AkkuratLL-Light";
  font-size: clamp(0.65rem, 0.525rem + 0.3125vw, 0.9rem);
}

.trade-totals {
  font-family: "AkkuratLL-Bold";
  font-size: clamp(0.65rem, 0.525rem + 0.3125vw, 0.9rem);
  line-height: 0.9rem;
}

/* Base Panel Styles */
.base-panel {
  position: relative;
  width: 100%;
  height: 100%;
}

body.map-active .base-panel {
  position: relative;
  width: 86%;
}

#globe,
#map {
  width: 100%;
  height: 100%;
}

.base-panel .molecule-video {
  position: absolute;
  bottom: 1%;
  left: 14% !important;

  display: flex;
  flex-direction: column;
  align-items: center;

  width: 35%;
  height: auto;
  cursor: pointer;
  z-index: 2;
  /* opacity: 1; */
  transition: all 0.4s ease;
}

.base-panel .molecule-video.timeline-view {
  width: 28%;
}

.base-panel .molecule-video video {
  width: 100%;
  height: auto;
  display: block;
  transition: all 0.4s ease;
}

.base-panel .molecule-video video:hover {
  transform: scale(1.14);
}

.base-panel .molecule-video .video-label {
  font-family: "AkkuratLL-Light";
  font-size: 1rem;
  color: #fff;
}

.molecule-video.hidden {
  display: none;
}

/* .molecule-video.left-mode {
  left: 14%;
  right: auto;
  width: 30%;
}

.molecule-video.switching {
  animation: fade-swap 0.75s ease forwards;
}

@keyframes fade-swap {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
} */

.intro-section {
  position: fixed;
  top: 20%;
  right: 20%;
  padding: 0.5rem;
  width: 28%;
  cursor: default;
  gap: clamp(0.7rem, 0.6rem + 0.4444vw, 1rem);
}

.intro-section > p {
  font-size: clamp(0.8125rem, 0.6188rem + 0.4844vw, 1.2rem);
  line-height: clamp(1.0125rem, 0.8188rem + 0.4844vw, 1.4rem);
  font-family: "AkkuratLL-Bold";
  color: #fff;
  margin-bottom: 0.5rem;
  background-color: #0a0a0a;
  display: inline-block;
}

#map {
  display: none;
  position: relative;
  top: 0;
  opacity: 0;
  border: none;
  overflow: hidden;
}

.race-chart-toggle {
  display: none;
  position: absolute;
  font-family: "AkkuratLL-Regular";
  right: clamp(0.5rem, -1.75rem + 5.625vw, 5rem);
  bottom: clamp(0.5rem, -4.25rem + 11.875vw, 10rem);
  border: none;
  background: none;
  color: #edf86f;
  font-size: clamp(0.7rem, 0.6rem + 0.4444vw, 1rem);
  cursor: pointer;
  z-index: 2;
}

.race-chart-close-button {
  border: none;
  background: none;
  cursor: pointer;
  align-self: flex-end;
  width: clamp(1rem, 0.5rem + 1.25vw, 2rem);
  padding: 0.5rem 0.5rem 0 0;
}

.race-chart-modal {
  position: absolute;
  display: none;
  flex-direction: column;
  background-color: #0a0a0a;
  right: clamp(0.9rem, 0.6rem + 0.75vw, 1.5rem);
  bottom: clamp(0.9rem, 0.6rem + 0.75vw, 1.5rem);
  z-index: 2;
  width: 30.5%;
  aspect-ratio: 15 / 10;
}

.racing-chart {
  border: none;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.race-chart-toggle.open,
.race-chart-modal.open {
  display: flex;
}

.price-chart-toggle {
  display: none;
  position: absolute;
  font-size: clamp(0.8125rem, 0.6188rem + 0.4844vw, 1.2rem);
  font-family: "AkkuratLL-Regular";
  cursor: pointer;
  left: 3%;
  top: 5rem;
  z-index: 2;
}

body.map-active .price-chart-toggle {
  display: block;
}

body.map-active .price-chart-toggle.open {
  display: none;
}

.price-chart-toggle .text {
  color: #edf86f;
}

.price-chart-modal {
  display: none;
  border: none;
  position: absolute;
  flex-direction: column;
  background-color: #0a0a0a;
  z-index: 2;
  left: 3%;
  top: 5rem;
  width: 26%;
  padding: 0 0.5rem;
  aspect-ratio: 16 / 9;
}

body.map-active dialog.price-chart-modal[open] {
  display: flex;
}

.price-chart-frame {
  border: none;
  width: 100%;
  height: 100%;
}

.price-chart-close-button {
  width: clamp(0.9rem, 0.35rem + 1.375vw, 2rem);
  align-self: flex-end;
  cursor: pointer;
}

.trade-flow-toggle {
  position: absolute;
  top: clamp(0.9rem, 0.6rem + 0.75vw, 1.5rem);
  right: clamp(0.9rem, 0.6rem + 0.75vw, 1.5rem);
  transform: translateX(17rem);
  cursor: pointer;
  color: #edf86f;
  display: flex;
  align-items: center;
  transition: all 0.8s cubic-bezier(0.7, 0, 0.14, 1);
  pointer-events: none;
}

.trade-flow-toggle.open {
  transform: translateX(0);
  pointer-events: auto;
}

.trade-flow-close {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #edf86f;
}

.trade-flow-arrow,
.trade-flow-close-button {
  margin-right: 0.7rem;
  color: #edf86f;
  height: clamp(0.9rem, 0.6rem + 0.75vw, 1.5rem);
}

.trade-flow-close-button {
  transform: rotate(180deg);
}

.trade-flow-label {
  color: #edf86f;
  font-family: "AkkuratLL-Regular";
  font-size: clamp(0.65rem, 0.525rem + 0.3125vw, 0.9rem);
}

.trade-flow-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(7rem, 2.5rem + 11.25vw, 16rem);
  height: 100%;
  background-color: transparent;
  padding: clamp(0.9rem, 0.6rem + 0.75vw, 1.5rem) 0.5rem 0;
  z-index: 1;
  transition: all 0.8s cubic-bezier(0.7, 0, 0.14, 1);
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.trade-flow-panel.open {
  transform: translateX(0);
}

.trade-flow-content {
  opacity: 0;
  flex: 1;
  pointer-events: none;
  transition: all 0.8s cubic-bezier(0.7, 0, 0.14, 1);
  width: fit-content;
  white-space: normal;
  overflow-y: auto;
}

.trade-flow-panel.open .trade-flow-content {
  opacity: 1;
  pointer-events: auto;
}

.trade-flow-heading {
  position: relative;
  font-family: "AkkuratLL-Bold";
  font-size: clamp(0.875rem, 0.6625rem + 0.5313vw, 1.3rem);
  color: #fff;
  padding-top: clamp(0.7rem, -0.2rem + 2.25vw, 2.5rem);
}

.trade-flow-section {
  color: #fff;
  font-size: clamp(0.75rem, 0.575rem + 0.4375vw, 1.1rem);
  font-family: "AkkuratLL-Bold";
  margin: clamp(0.2rem, 0.075rem + 0.3125vw, 0.45rem) 0;
}

.trade-flow-list {
  list-style: none;
  color: #edf86f;
  font-family: "AkkuratLL-Regular";
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-y: auto;
  gap: clamp(0.2rem, 0.1rem + 0.25vw, 0.4rem);
}

.trade-flow-list li {
  position: relative;
  cursor: pointer;
  font-size: clamp(0.65rem, 0.525rem + 0.3125vw, 0.9rem);
  transition: all 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

.trade-flow-list li:hover {
  color: #fff;
  font-size: clamp(0.7rem, 0.6rem + 0.4444vw, 1rem);
}

.trade-flow-list li.active {
  color: #fff;
  font-size: clamp(0.75rem, 0.575rem + 0.4375vw, 1.1rem);
}

.trade-flow-list li::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0.09375rem;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
  transition: transform 0.5s ease;
}

.trade-flow-list li:hover::after,
.trade-flow-list li.active::after {
  transform: scaleX(1);
}

.orientation-dialog {
  display: none;
  font-family: "AkkuratLL-Regular";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  background-color: rgba(10, 10, 10, 1);
  color: #fff;
  border: none;
  padding: 2rem;
  z-index: 4;
}

.dialog-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.orientation-video {
  width: 150px;
  height: auto;
}

@media (orientation: portrait) {
  .final-wrapper .orientation-dialog {
    display: flex;
  }
}

@media (max-width: 1024px) {
  .race-chart-modal {
    width: 50%;
  }
}

@media (max-width: 768px) {
  .race-chart-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    bottom: auto;
    width: 65%;
    z-index: 3;
  }
}
