/* Mabsan History Timeline */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;900&family=Anybody:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');

/* ─── Container ─── */
.msh-history {
  --msh-card-w: 322px;
  --msh-card-h: 504px;
  --msh-card-w-expanded: 550px;
  --msh-prefix-size: clamp(220px, 26vw, 380px);
  --msh-suffix-size: clamp(150px, 18vw, 260px);
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background-color: #000;
}

/* ─── Year header: flex row for prefix + suffix side by side ─── */
.msh-year-header {
  position: absolute;
  top: 5%;
  left: 10px;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
}

.msh-year-prefix {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: var(--msh-prefix-size);
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(317.85deg, rgb(250, 0, 0) -41.59%, rgba(250, 0, 0, 0) 143.46%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: block;
}

/* Suffix inside header (added by JS on hover): matches prefix */
.msh-year-header .msh-year-suffix {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: var(--msh-prefix-size) !important;
  line-height: 1 !important;
  letter-spacing: -0.02em !important;
  background: linear-gradient(317.85deg, rgb(250, 0, 0) -41.59%, rgba(250, 0, 0, 0) 143.46%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  opacity: 1 !important;
  filter: none !important;
  margin-left: -8px;
}

/* White-to-red color transition during climb */
.msh-year-header .msh-year-suffix.msh-suffix-climbing {
  animation: msh-suffix-color 0.6s ease forwards !important;
}

@keyframes msh-suffix-color {
  0% {
    -webkit-text-fill-color: #fff;
    color: #fff;
    background: none;
  }

  60% {
    -webkit-text-fill-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.4);
  }

  100% {
    -webkit-text-fill-color: transparent;
    color: transparent;
    background: linear-gradient(317.85deg, rgb(250, 0, 0) -41.59%, rgba(250, 0, 0, 0) 143.46%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

/* ─── Viewport ─── */
.msh-viewport {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 30px;
  padding-left: 10px;
  overflow: visible;
  min-height: var(--msh-card-h);
}

/* ─── Items ─── */
.msh-item {
  display: none;
  flex-direction: row;
  align-items: flex-end;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}

.msh-item.is-visible {
  display: flex;
}

/* ─── Year suffix wrap (absolutely positioned at bottom-left of item) ─── */
.msh-year-wrap {
  position: absolute;
  bottom: 0;
  left: -140px;
  z-index: 2;
}

.msh-year-suffix {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: var(--msh-suffix-size);
  line-height: 1;
  color: #fff;
  -webkit-text-fill-color: #fff;
  filter: blur(0.5px);
  opacity: 0.85;
  display: block;
}

/* ─── Card ─── */
.msh-card {
  position: relative;
  z-index: 5;
  width: 350px;
  height: var(--msh-card-h);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  background-color: rgba(146, 43, 43, 0.263);
  border-radius: 50px 0 50px 0;
  transform: translateX(100px);
  transition: width 0.3s ease;
  padding: 0 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.msh-card-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 24px;
  transition: padding-left 0.4s ease;
}

.msh-card-title {
  margin: 0 0 12px 0;
  font-family: 'Anybody', sans-serif;
  font-size: 35px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.15;
  color: #fff;
}

.msh-card-text {
  margin: 0;
  font-family: 'Anybody', sans-serif;
  font-size: 23px;
  font-weight: 300;
  font-style: italic;
  line-height: 34.5px;
  color: #fff;
}

/* ─── Arrows ─── */
.msh-history .msh-arrow {
  position: relative;
  z-index: 10;
  display: none !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 20px;
  line-height: 1;
  color: #fff;
  opacity: 0.7;
  background: transparent;
  border: 0;
  padding: 14px 0;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
  user-select: none;
}

.msh-arrow:hover {
  opacity: 1;
  transform: scale(1.2);
}

.msh-arrow:disabled {
  opacity: 0.15;
  cursor: default;
  transform: none;
}

.msh-arrow-up {
  padding-top: 20px;
}

.msh-arrow-down {
  padding-bottom: 20px;
  margin-top: auto;
}

/* ═══ HOVER / ACTIVE ═══ */
.msh-item.is-hovered .msh-card {
  width: var(--msh-card-w-expanded);
}

.msh-history .msh-item.is-hovered .msh-arrow {
  display: flex !important;
}

/* When hovered, hide the suffix inside the item (it moved to header) */
.msh-item.is-hovered .msh-year-wrap {
  visibility: hidden;
}

/* ═══ Animations ═══ */
@keyframes msh-exit-up {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-100%);
  }
}

@keyframes msh-enter-up {
  from {
    opacity: 0;
    transform: translateY(80px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msh-item.is-exiting {
  display: flex !important;
  animation: msh-exit-up 0.5s ease-in forwards;
  pointer-events: none;
}

.msh-item.is-entering {
  animation: msh-enter-up 0.5s ease-out forwards;
}

/* ═══ Responsive ═══ */
@media (max-width: 1024px) and (min-width: 768px) {
  .msh-history {
    min-height: 80vh;
    --msh-card-w-expanded: 460px;
    --msh-prefix-size: clamp(160px, 25vw, 280px);
    --msh-suffix-size: clamp(110px, 16vw, 180px);
  }

  .msh-card {
    width: 260px;
    height: 420px;
    padding: 0 20px;
  }

  .msh-card-title {
    font-size: 28px;
  }

  .msh-card-text {
    font-size: 18px;
    line-height: 28px;
  }
}

@media (max-width: 767px) {
  .msh-history {
    min-height: 100vh;
    --msh-card-w-expanded: 85vw;
    --msh-prefix-size: clamp(110px, 30vw, 200px);
    --msh-suffix-size: clamp(80px, 22vw, 140px);
  }

  .msh-card {
    width: 200px;
    height: 340px;
    padding: 0 16px;
    border-radius: 34px 0px;
  }

  .msh-card-title {
    font-size: 22px;
  }

  .msh-card-text {
    font-size: 16px;
    line-height: 24px;
  }
}