@font-face {
  font-family: "Artifika";
  src: url("fonts/artifika-regular.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Bellota";
  src: url("fonts/bellota-light.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 300;
}

@font-face {
  font-family: "Bellota";
  src: url("fonts/bellota-regular.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Bellota";
  src: url("fonts/bellota-bold.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

:root {
  --black: #050505;
  --ink: #0a0a09;
  --paper: #d8d2c8;
  --paper-dark: #b6aea3;
  --white: #f3f0ea;
  --muted: #a9a39b;
  --red: #d30b17;
  --red-bright: #f11522;
  --red-dark: #62050b;
  --line: rgba(255, 255, 255, 0.16);
  --display: "Artifika", Georgia, serif;
  --body: "Bellota", "Trebuchet MS", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
  scroll-behavior: smooth;
  scrollbar-color: var(--red-dark) var(--black);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
  color: var(--white);
  font-family: var(--body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

::selection {
  background: var(--red);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 11px 16px;
  color: #fff;
  background: var(--red);
  font-size: 0.875rem;
  transform: translateY(-160%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

.micro-label {
  margin: 0;
  color: var(--red-bright);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  line-height: 1.45;
  text-transform: uppercase;
}

.display-title {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin: 12px 0 0;
  font-family: var(--display);
  font-size: clamp(3.25rem, 10vw, 9.75rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.86;
  text-wrap: balance;
}

.button {
  position: relative;
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  overflow: hidden;
  padding: 0 23px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  transition:
    color 0.35s,
    border-color 0.35s,
    background 0.35s,
    transform 0.35s var(--ease);
}

.button::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.2), transparent 75%);
  content: "";
  transform: translateX(-120%);
  transition: transform 0.55s var(--ease);
}

.button:hover::before {
  transform: translateX(120%);
}

.button:hover {
  transform: translateY(-2px);
}

.button--red {
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 12px 45px rgba(160, 0, 11, 0.22);
  color: #fff;
}

.button--red:hover {
  border-color: var(--red-bright);
  background: var(--red-bright);
}

.button--line {
  border-color: rgba(255, 255, 255, 0.33);
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  color: #fff;
}

.button--line:hover {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
}

#emberCanvas,
.grain,
.scanlines,
.cursor-aura,
.scroll-progress {
  position: fixed;
  pointer-events: none;
}

#emberCanvas {
  z-index: 70;
  inset: 0;
  width: 100%;
  height: 100%;
}

.grain {
  z-index: 80;
  inset: -70%;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.83' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  animation: grainShift 0.18s steps(2) infinite;
  mix-blend-mode: soft-light;
}

.scanlines {
  z-index: 79;
  inset: 0;
  opacity: 0.065;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.34) 4px);
}

.cursor-aura {
  z-index: 75;
  top: 0;
  left: 0;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgba(222, 15, 26, 0.1), transparent 66%);
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 0.3s;
  mix-blend-mode: screen;
}

.cursor-aura.visible {
  opacity: 1;
}

.scroll-progress {
  z-index: 151;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--red-bright);
  box-shadow: 0 0 12px var(--red);
  transform: scaleX(0);
  transform-origin: left;
}

.site-header {
  position: fixed;
  z-index: 150;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  min-height: 86px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 clamp(20px, 3.4vw, 62px);
  border-bottom: 1px solid transparent;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.76), transparent);
  transition:
    min-height 0.35s,
    background 0.35s,
    border-color 0.35s;
}

.site-header.scrolled {
  min-height: 70px;
  border-color: var(--line);
  background: rgba(5, 5, 5, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

.header-left,
.header-actions,
.official-links,
.official-link,
.brand {
  display: flex;
  align-items: center;
}

.header-left {
  min-width: 0;
  gap: clamp(14px, 2.1vw, 34px);
}

.brand {
  flex: 0 0 auto;
  gap: 10px;
  color: #fff;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand span {
  font-family: var(--display);
  font-size: 1.02rem;
  letter-spacing: 0.13em;
}

.official-links {
  gap: 8px;
}

.official-link {
  min-height: 36px;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.24);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    color 0.25s,
    border-color 0.25s,
    background 0.25s;
}

.official-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.official-link:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.official-link--discord:hover {
  border-color: #5865f2;
  background: rgba(88, 101, 242, 0.2);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.3vw, 38px);
}

.desktop-nav a {
  position: relative;
  padding: 28px 0;
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  transition: color 0.25s;
}

.desktop-nav a::after {
  position: absolute;
  right: 100%;
  bottom: 22px;
  left: 0;
  height: 1px;
  background: var(--red-bright);
  content: "";
  transition: right 0.3s var(--ease);
}

.desktop-nav a:hover,
.desktop-nav a.active {
  color: #fff;
}

.desktop-nav a:hover::after,
.desktop-nav a.active::after {
  right: 0;
}

.header-actions {
  justify-content: flex-end;
  gap: 10px;
}

.menu-button {
  position: relative;
  display: none;
  width: 43px;
  height: 43px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}

.menu-button i {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 1px;
  background: #fff;
  transition:
    top 0.25s,
    transform 0.25s;
}

.menu-button i:first-child {
  top: 17px;
}

.menu-button i:last-child {
  top: 24px;
}

.menu-button.open i:first-child {
  top: 20px;
  transform: rotate(45deg);
}

.menu-button.open i:last-child {
  top: 20px;
  transform: rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  z-index: 140;
  top: 70px;
  right: 0;
  left: 0;
  display: grid;
  padding: 22px clamp(20px, 6vw, 44px) 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.97);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-20px);
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease),
    visibility 0.3s;
  backdrop-filter: blur(20px);
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu > a {
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--display);
  font-size: 1.25rem;
}

.mobile-menu__official {
  display: flex;
  gap: 24px;
  padding-top: 24px;
}

.mobile-menu__official a {
  color: var(--red-bright);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chapter-rail {
  position: fixed;
  z-index: 90;
  top: 50%;
  right: 22px;
  display: grid;
  gap: 5px;
  transform: translateY(-50%);
}

.chapter-rail::before {
  position: absolute;
  z-index: -1;
  top: 8px;
  right: 2px;
  bottom: 8px;
  width: 1px;
  background: rgba(255, 255, 255, 0.15);
  content: "";
}

.chapter-rail a {
  display: grid;
  min-height: 27px;
  grid-template-columns: 20px 0;
  align-items: center;
  justify-content: end;
  gap: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition:
    color 0.25s,
    grid-template-columns 0.35s var(--ease),
    gap 0.35s var(--ease);
}

.chapter-rail a::after {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  content: "";
  transition:
    background 0.25s,
    box-shadow 0.25s,
    transform 0.25s;
}

.chapter-rail a span {
  overflow: hidden;
  white-space: nowrap;
}

.chapter-rail a b {
  font-weight: 700;
}

.chapter-rail a:hover,
.chapter-rail a.active {
  grid-template-columns: 20px 55px;
  gap: 7px;
  color: #fff;
}

.chapter-rail a.active::after {
  background: var(--red-bright);
  box-shadow: 0 0 12px var(--red);
  transform: scale(1.35);
}

.site-loader {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #121211, #030303);
  pointer-events: none;
  animation: loaderExit 0.45s ease 1.35s both;
}

.site-loader__content {
  width: min(340px, 72vw);
}

.site-loader__content img {
  width: 100%;
  height: auto;
  mix-blend-mode: screen;
}

.site-loader__track {
  width: min(220px, 60vw);
  height: 2px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--line);
}

.site-loader__track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--red-bright);
  box-shadow: 0 0 12px var(--red);
  transform: scaleX(0);
  transform-origin: left;
  animation: loaderProgress 1.35s ease-in-out forwards;
}

@keyframes loaderProgress {
  to { transform: scaleX(1); }
}

@keyframes loaderExit {
  to { opacity: 0; visibility: hidden; }
}

.modal {
  position: fixed;
  z-index: 400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 36px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.35s,
    visibility 0.35s;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(18px);
}

.modal__close {
  display: grid;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.23);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  transition:
    border-color 0.25s,
    background 0.25s;
}

.modal__close:hover {
  border-color: var(--red);
  background: var(--red);
}

.modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 16px 0;
}

.modal__top h2 {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 400;
}

.trailer-panel {
  position: relative;
  width: min(1180px, 96vw);
  transform: scale(0.96);
  transition: transform 0.45s var(--ease);
}

.modal.open .trailer-panel {
  transform: scale(1);
}

.trailer-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #000;
  box-shadow: 0 24px 100px #000;
  aspect-ratio: 16 / 9;
}

.trailer-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.lightbox__panel {
  position: relative;
  width: min(1420px, 96vw);
  max-height: 92vh;
}

.lightbox__panel .modal__close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
}

.lightbox__panel img {
  width: 100%;
  max-height: 82vh;
  border: 1px solid rgba(255, 255, 255, 0.16);
  object-fit: contain;
}

.lightbox__panel p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.63);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: right;
  text-transform: uppercase;
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  display: grid;
  grid-template-columns: 1.2fr auto auto;
  align-items: center;
  gap: 42px;
  padding: 55px clamp(22px, 5vw, 80px);
  border-top: 1px solid var(--line);
  background: #050505;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.footer-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.footer-brand span {
  display: grid;
  line-height: 1.2;
}

.footer-brand b {
  font-family: var(--display);
  font-size: 1.14rem;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.footer-brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.site-footer nav,
.footer-official {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 17px;
}

.site-footer nav a,
.footer-official a {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.25s;
}

.site-footer a:hover {
  color: #fff;
}

.footer-official a {
  color: var(--red-bright);
}

.site-footer > p {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.75rem;
  text-align: center;
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(3%, -4%); }
  40% { transform: translate(-5%, 2%); }
  60% { transform: translate(4%, 5%); }
  80% { transform: translate(-2%, -5%); }
  100% { transform: translate(0, 0); }
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .desktop-nav {
    display: none;
  }

  .menu-button {
    display: block;
  }

  .official-link span {
    display: none;
  }

  .official-link {
    width: 36px;
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 70px;
    padding: 0 15px;
  }

  .header-left {
    gap: 10px;
  }

  .brand img {
    width: 37px;
    height: 37px;
  }

  .brand span {
    display: none;
  }

  .official-links {
    gap: 5px;
  }

  .chapter-rail {
    display: none;
  }

  .site-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 28px;
    text-align: center;
  }

  .site-footer nav {
    gap: 12px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-loader { animation: loaderExit 0.01ms linear 0.3s both !important; }
  .site-loader__track span { animation: none !important; transform: scaleX(1); }
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .grain,
  #emberCanvas,
  .cursor-aura {
    display: none;
  }
}
