/* Local copies of the fonts CurseForge actually uses. */
@font-face {
  font-family: latoLocalFont;
  src: url("media/LatoLatin_Regular-s.p.2610-s-q70020.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: latoLocalFont;
  src: url("media/LatoLatin_Bold-s.p.223lmogc8cqfs.woff2") format("woff2");
  font-display: swap;
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: latoLocalFont;
  src: url("media/LatoLatin_Italic-s.p.2sqanm4y8_9te.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: "latoLocalFont Fallback";
  src: local("Arial");
  ascent-override: 99.53%;
  descent-override: 21.48%;
  line-gap-override: 0%;
  size-adjust: 99.17%;
}

@font-face {
  font-family: montserratLocalFont;
  src: url("media/Montserrat_Regular-s.p.2c5pn5ih373s_.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: montserratLocalFont;
  src: url("media/Montserrat_Medium-s.p.05p9056zv0wji.woff2") format("woff2");
  font-display: swap;
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: montserratLocalFont;
  src: url("media/Montserrat_Bold-s.p.0b96em-4aymv9.woff2") format("woff2");
  font-display: swap;
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "montserratLocalFont Fallback";
  src: local("Arial");
  ascent-override: 84.95%;
  descent-override: 22.03%;
  line-gap-override: 0%;
  size-adjust: 113.95%;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Keep the fake download page focused on the downloading state. */
.download-state .art-flame-anvil {
  background-image: url("images/icons/cf-flame-anvil.svg");
}

/* ============================================================
   Interaction layer reconstructed from CurseForge's own CSS/JS
   ============================================================ */

/* Theme swap, limited to the properties that actually repaint. */
html.theme-transition,
html.theme-transition body,
html.theme-transition .curseforge-header,
html.theme-transition .site-footer,
html.theme-transition .nav-links .sub-nav-inner,
html.theme-transition .header-kebab .menu,
html.theme-transition .project-page aside .aside-box {
  transition: background-color 0.25s ease, color 0.25s ease,
    border-color 0.25s ease, box-shadow 0.25s ease;
}

/* ---------- Navigation submenus ---------- */
.nav-link-container {
  position: relative;
}

.nav-link-container > .nav-link svg {
  transition: transform 0.2s ease;
}

.nav-link-container > .nav-link.is-active svg {
  transform: rotate(180deg);
}

.sub-nav-container .sub-nav-block-title-container {
  display: none;
}

.sub-nav-inner .sub-nav-block-title .more-link {
  color: var(--text-brand);
  align-items: center;
  gap: 4px;
  font-family: var(--montserrat-font);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-flex;
}

.sub-nav-inner .sub-nav-block-title .more-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.sub-nav-inner .sub-nav-block-title .more-link:hover svg {
  transform: translateX(3px);
}

.sub-nav-inner .sub-nav-block-title:has(.more-link) {
  margin-bottom: 20px;
}

.sub-nav-inner .sub-nav-links-list {
  grid-template-rows: repeat(6, 24px);
  grid-auto-flow: column;
  gap: 10px 48px;
}

.sub-nav-inner .sub-nav-links-list li {
  min-width: 150px;
}

.sub-nav-inner .sub-nav-promo a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border-tertiery);
}

.sub-nav-inner .sub-nav-promo img {
  transition: transform 0.45s cubic-bezier(0.2, 0, 0, 1);
}

.sub-nav-inner .sub-nav-promo a:hover img {
  transform: scale(1.045);
}

.sub-nav-inner .sub-nav-divider {
  background-color: var(--border-tertiery);
}

/* Animate the panel and stagger its links, using the same reveal easing
   the real header uses for dropdown content. */
@keyframes cf-subnav-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cf-subnav-item-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner {
  animation: cf-subnav-in 0.22s cubic-bezier(0.2, 0, 0, 1) both;
}

.nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner li,
.nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner .sub-nav-promo {
  animation: cf-subnav-item-in 0.24s cubic-bezier(0.2, 0, 0, 1) both;
}

.nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner li:nth-child(6n + 2) {
  animation-delay: 0.025s;
}
.nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner li:nth-child(6n + 3) {
  animation-delay: 0.05s;
}
.nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner li:nth-child(6n + 4) {
  animation-delay: 0.075s;
}
.nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner li:nth-child(6n + 5) {
  animation-delay: 0.1s;
}
.nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner li:nth-child(6n + 6) {
  animation-delay: 0.125s;
}

.nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner .social-links-block li:nth-child(n) {
  animation-delay: 0.03s;
}

/* The CSS in the saved bundle keeps the submenu clickable but invisible.
   Some browsers need the container to accept the pointer while active. */
.nav-link-container:has(> .nav-link.is-active) > .sub-nav-container {
  pointer-events: none;
}

/* ---------- Mobile drawer ---------- */
@media (max-width: 900px) {
  .nav-links .sub-nav-block-title-container {
    display: flex;
  }

  .nav-link-container > .nav-link.is-active + .sub-nav-container {
    pointer-events: all;
  }

  .nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner {
    animation: cf-drawer-in 0.24s cubic-bezier(0.2, 0, 0, 1) both;
  }

  .nav-links.is-mobile-open .nav-link-container {
    width: 100%;
  }

  .nav-links.is-mobile-open .nav-link {
    width: 100%;
    justify-content: space-between;
  }

  .sub-nav-inner .sub-nav-links-list {
    grid-template-rows: none;
    grid-auto-flow: row;
    gap: 0;
  }

  .sub-nav-inner .sub-nav-links-list li {
    min-width: 0;
  }

  .sub-nav-inner .sub-nav-block {
    width: 100%;
  }

  .sub-nav-inner .sub-nav-block:not(:first-child) {
    margin-left: 0;
  }

  .sub-nav-inner .sub-nav-promo {
    width: 100% !important;
    margin-top: 16px;
  }

  .sub-nav-inner .sub-nav-block-title .more-link {
    margin-bottom: 4px;
  }
}

@keyframes cf-drawer-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---------- Kebab menu ---------- */
@keyframes cf-kebab-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.header-kebab.is-open .menu {
  animation: cf-kebab-in 0.18s cubic-bezier(0.2, 0, 0, 1) both;
  transform-origin: top right;
}

.header-kebab .menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-kebab .menu .menu a,
.header-kebab .menu .menu button {
  font-family: var(--lato-font);
  font-size: 16px;
  line-height: 24px;
}

.header-kebab .menu .menu a:focus-visible,
.header-kebab .menu .menu button:focus-visible {
  outline: 2px solid var(--text-brand);
  outline-offset: -2px;
}

/* Theme rows: fade only the icon/label of the mode that is not active. */
[data-theme="light"] .theme-toggle-to-light,
[data-theme="dark"] .theme-toggle-to-dark {
  display: none !important;
}

/* ---------- Tooltips (same 0.5s reading delay as the saved CSS) ---------- */
[data-tooltip] {
  position: relative;
}

@media (min-width: 901px) {
  [data-tooltip]:before,
  [data-tooltip]:after {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    transition-delay: 0s;
  }

  [data-tooltip]:hover:before,
  [data-tooltip]:hover:after,
  [data-tooltip]:focus-visible:before,
  [data-tooltip]:focus-visible:after {
    opacity: 1;
    transition-delay: 0.5s;
  }
}

/* ---------- Download page ---------- */
.download-state {
  animation: cf-fade-up 0.45s cubic-bezier(0.2, 0, 0, 1) both;
}

@keyframes cf-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Floating header ---------- */
.floating-header {
  transform: translateY(100%);
  transition: opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.floating-header.is-floating {
  transform: translateY(0);
}

/* ---------- Related project tiles: screenshot shuffle + reveal ---------- */
.project-tile .art {
  overflow: hidden;
}

.project-tile .art > img {
  transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.2, 0, 0, 1);
}

.project-tile .art .screenshots {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.project-tile .art .screenshots img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
}

.project-tile:hover .art .screenshots,
.project-tile:focus-within .art .screenshots {
  opacity: 1;
}

.project-tile:hover .art > img,
.project-tile:focus-within .art > img {
  opacity: 0;
  transform: scale(1.04);
}

.project-tile:hover .art .screenshots img,
.project-tile:focus-within .art .screenshots img {
  animation: cf-tile-shots 6s steps(1, end) infinite;
}

.project-tile .art .screenshots img:nth-child(2) {
  animation-delay: 2s !important;
}

.project-tile .art .screenshots img:nth-child(3) {
  animation-delay: 4s !important;
}

@keyframes cf-tile-shots {
  0%,
  32% {
    opacity: 1;
    transform: scale(1);
  }
  33%,
  100% {
    opacity: 0;
    transform: scale(1.02);
  }
}

/* ---------- Screenshot lightbox ---------- */
.screenshots-popup {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.screenshots-popup.is-open {
  opacity: 1;
}

.screenshots-popup.is-closing {
  opacity: 0;
  animation: none;
}

.screenshots-popup .screenshots-slider {
  grid-template-rows: 1fr 109px auto;
  padding-top: 64px;
}

.screenshots-popup .screenshots-slider .slider {
  overflow: hidden;
}

.screenshots-popup .slide {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transform: translateX(0) scale(0.985);
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.2, 0, 0, 1);
  z-index: 1;
}

.screenshots-popup .slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
  z-index: 2;
}

.screenshots-popup .slide.leave-left {
  opacity: 0;
  transform: translateX(-7%) scale(0.985);
}

.screenshots-popup .slide.leave-right {
  opacity: 0;
  transform: translateX(7%) scale(0.985);
}

.screenshots-popup .slide.enter-left {
  opacity: 0;
  transform: translateX(-7%) scale(0.985);
}

.screenshots-popup .slide.enter-right {
  opacity: 0;
  transform: translateX(7%) scale(0.985);
}

.screenshots-popup .thumbnails li button {
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.screenshots-popup .thumbnails li button:hover {
  transform: translateY(-2px);
}

.screenshots-popup .screenshots-slider .slide-prev,
.screenshots-popup .screenshots-slider .slide-next {
  z-index: 5;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.screenshots-popup .slide-prev:hover,
.screenshots-popup .slide-next:hover {
  transform: translateY(-50%) scale(1.06);
}

.screenshots-popup .btn-close {
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.screenshots-popup .btn-close:hover {
  transform: rotate(90deg);
}

body.lightbox-open,
body.drawer-open {
  overflow: hidden;
}

/* ---------- Read more ---------- */
.project-description {
  transition: max-height 0.45s cubic-bezier(0.2, 0, 0, 1);
}

.read-more {
  margin-top: 20px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.read-more:hover {
  background-color: var(--surface-on-surface);
}

/* ---------- Mobile project details drawer ---------- */
@media (max-width: 900px) {
  .project-page aside {
    z-index: 105;
  }

  .project-page aside .aside-box {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 104;
    overflow-y: auto;
    padding: 24px;
    background-color: var(--surface-primary);
  }

  .project-page aside .aside-box:has(> .close-container.is-modal-open) {
    display: block;
    animation: slide-from-right 0.3s cubic-bezier(0.2, 0, 0, 1) both;
  }

  .project-page aside .aside-box.is-closing {
    animation: cf-drawer-out 0.25s ease both;
  }

  .project-page aside .close-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
  }

  .project-page aside .close-container .btn-close {
    width: 36px;
    height: 36px;
    color: var(--text-primary);
    background: var(--surface-secondary);
    border: 1px solid var(--border-tertiery);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
  }

  .project-page aside .close-container .btn-close svg {
    width: 18px;
    height: 18px;
  }
}

@keyframes cf-drawer-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ---------- Toast host ---------- */
.toast-container .toast .btn-close {
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.toast-container .toast .btn-close svg {
  width: 16px;
  height: 16px;
  margin: 8px;
}

.toast-container .toast.is-leaving {
  animation: cf-toast-out 0.2s ease forwards;
}

@keyframes cf-toast-out {
  to {
    opacity: 0;
    transform: translateY(24px);
  }
}

/* ---------- Favorites / follow ---------- */
.btn-favorite.is-favorited .icon-heart,
.btn-favorite.is-favorited svg {
  color: var(--text-brand);
}

.btn-favorite.is-favorited,
.btn-follow.is-following {
  animation: cf-heart-pop 0.32s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes cf-heart-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

/* ---------- Scroll reveal ---------- */
.js .cf-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0, 0, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .cf-reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Focus polish ---------- */
:focus-visible {
  outline: 2px solid var(--text-brand);
  outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .js .cf-reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Narrow desktop header (901–1200px) ---------- */
@media (min-width: 901px) and (max-width: 1200px) {
  .curseforge-header nav {
    gap: 8px;
  }

  .game-navbar-search {
    flex: 1 1 240px;
    width: auto;
    min-width: 160px;
    margin-left: 12px;
  }

  .game-navbar-search .search-bar {
    width: 100%;
  }

  .nav-links {
    gap: 12px;
    margin-left: 4px;
    padding-right: 8px;
  }

  .nav-links-container {
    max-width: 46%;
  }

  .header-kebab {
    margin-left: 4px;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .curseforge-header .header-actions,
  .curseforge-header .user-actions {
    display: none;
  }

  .game-navbar-search {
    flex-basis: 320px;
    max-width: none;
  }
}

@media (min-width: 901px) and (max-width: 1000px) {
  .nav-link-container:has(#sub-nav-inner-our\ socials) {
    display: none;
  }
}

/* Only the open mobile submenu may capture the pointer. */
@media (max-width: 900px) {
  .nav-link-container > .sub-nav-container .sub-nav-inner,
  .nav-link-container > .sub-nav-container .sub-nav-block-title-container {
    pointer-events: none;
  }

  .nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner,
  .nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-block-title-container {
    pointer-events: all;
  }
}

/* The React header swaps the hamburger for a close icon; the saved DOM
   only has the hamburger, so draw the close state ourselves. */
@media (max-width: 900px) {
  .curseforge-header .mobile-menu-opener.is-open {
    display: flex;
    order: 99;
    margin-left: auto;
    margin-right: 0;
    position: relative;
  }

  .curseforge-header .mobile-menu-opener.is-open svg {
    visibility: hidden;
  }

  .curseforge-header .mobile-menu-opener.is-open:before,
  .curseforge-header .mobile-menu-opener.is-open:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background-color: currentColor;
    border-radius: 1px;
  }

  .curseforge-header .mobile-menu-opener.is-open:before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .curseforge-header .mobile-menu-opener.is-open:after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }
}

/* Keep the header's search field in the flexible middle column. */
@media (min-width: 901px) and (max-width: 1200px) {
  .desktop-only:has(.game-navbar-search) {
    flex: 1 1 240px;
    min-width: 160px;
    max-width: 710px;
    margin-left: auto;
  }

  .desktop-only .game-navbar-search {
    flex: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-left: 0;
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .game-navbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .game-navbar-inner {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  body > div {
    min-width: 0;
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .project-page {
    min-width: 0;
    grid-template-columns:
      minmax(0, 1fr)
      minmax(240px, 280px);
    column-gap: 28px;
    grid-template-areas:
      "search search"
      "breadcrumbs breadcrumbs"
      "header aside"
      "tabs aside"
      "tab-content aside";
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .sub-nav-inner {
    flex-wrap: wrap;
    max-width: calc(100vw - 190px);
  }

  .sub-nav-inner .sub-nav-links-list {
    grid-template-rows: repeat(6, 24px);
  }

  .project-page aside,
  .project-page aside .aside-box,
  .maho-container {
    width: 100% !important;
    min-width: 0;
  }

  .back-to-top {
    right: 16px;
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .site-footer .site-footer-inner {
    grid-template-columns: 64px minmax(0, 1fr) 214px;
  }

  .site-footer .site-footer-nav nav > ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 24px;
  }

  .site-footer .site-footer-nav nav > ul > li:not(.half) {
    grid-row: auto;
  }
}

@media (min-width: 901px) {
  .nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner {
    flex-wrap: wrap;
    max-width: calc(100vw - 300px);
  }
}

@media (min-width: 901px) and (max-width: 1000px) {
  .nav-link-container > .nav-link.is-active + .sub-nav-container .sub-nav-inner {
    padding: 24px;
    max-width: calc(100vw - 360px);
  }

  .sub-nav-inner .sub-nav-links-list {
    gap: 8px 32px;
  }

  .sub-nav-inner .sub-nav-links-list li {
    min-width: 120px;
  }
}
