:root {
  --night: #070a10;
  --night-soft: #0d121b;
  --steel: #d6d9dd;
  --steel-dim: #8f969f;
  --gold: #c99a50;
  --gold-light: #efd18e;
  --blood: #8b211b;
  --line: rgba(213, 184, 126, .25);
  --display: "Cinzel", Georgia, serif;
  --body: "Manrope", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--night); scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; overflow-x: hidden; color: var(--steel); background: var(--night); font: 400 1rem/1.6 var(--body); }
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
::selection { color: #100d08; background: var(--gold-light); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; left: 1rem; top: 1rem; transform: translateY(-160%); padding: .75rem 1rem; color: #100d08; background: var(--gold-light); }
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: 82px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.5rem);
  padding-inline: clamp(18px, 3vw, 54px);
  border-bottom: 1px solid rgba(201, 154, 80, .22);
  background: linear-gradient(180deg, rgba(6, 9, 14, .97), rgba(6, 9, 14, .75));
  box-shadow: 0 10px 35px rgba(0, 0, 0, .28);
  backdrop-filter: blur(12px);
  transition: height .25s, background .25s;
}
.site-header::after { content: ""; position: absolute; left: 7%; right: 7%; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .58; }
.site-header.is-scrolled { height: 70px; background: rgba(6, 9, 14, .96); }

.brand { display: inline-flex; align-items: center; gap: .9rem; width: max-content; }
.brand__sigil {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid var(--gold);
  background: radial-gradient(circle, rgba(139, 33, 27, .7), rgba(7, 10, 16, .95) 64%);
  box-shadow: inset 0 0 0 4px rgba(7, 10, 16, .8), 0 0 24px rgba(139, 33, 27, .2);
}
.brand__sigil::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(239, 209, 142, .26); }
.brand__sigil b { transform: rotate(-45deg); color: var(--gold-light); font: 700 .76rem/1 var(--display); letter-spacing: -.08em; }
.brand__name { display: grid; color: #e8e1d4; font: 700 .9rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.brand__name strong { color: var(--gold-light); }
.brand__name small { margin-top: .38rem; color: var(--steel-dim); font: 600 .52rem/1 var(--body); letter-spacing: .18em; }

.primary-nav { display: flex; justify-content: center; align-items: center; gap: .65rem; }
.nav-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.15rem;
  border: 1px solid rgba(201, 154, 80, .2);
  color: #bac0c7;
  background: linear-gradient(180deg, rgba(31, 38, 48, .58), rgba(10, 14, 21, .72));
  font: 600 .69rem/1 var(--body);
  letter-spacing: .13em;
  text-transform: uppercase;
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
  transition: color .2s, border-color .2s, filter .2s, transform .2s;
}
.nav-button:hover, .nav-button:focus-visible { color: #fff; border-color: rgba(239, 209, 142, .62); filter: brightness(1.16); transform: translateY(-1px); }
.nav-button--primary { color: #171008; border-color: var(--gold); background: linear-gradient(180deg, #efc976, #b77b31); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 6px 25px rgba(183, 123, 49, .16); }
.nav-button--primary:hover, .nav-button--primary:focus-visible { color: #171008; }
.nav-button--disabled { opacity: .48; cursor: not-allowed; }

.header-audio { justify-self: end; display: flex; align-items: center; gap: .75rem; padding-left: 1.2rem; border-left: 1px solid var(--line); }
.sound-toggle { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border: 0; color: #a9afb7; background: transparent; cursor: pointer; font: 600 .68rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; }
.sound-toggle__icon { display: flex; align-items: center; gap: 2px; height: 14px; }
.sound-toggle__icon i { width: 2px; height: 5px; background: currentColor; }
.sound-toggle__icon i:nth-child(2) { height: 11px; }
.sound-toggle__icon i:nth-child(3) { height: 7px; }
.sound-toggle[aria-pressed="true"] { color: var(--gold-light); }
.sound-toggle[aria-pressed="true"] .sound-toggle__icon i { animation: soundbar .65s ease-in-out infinite alternate; }
.sound-toggle[aria-pressed="true"] .sound-toggle__icon i:nth-child(2) { animation-delay: -.25s; }
.sound-toggle[aria-pressed="true"] .sound-toggle__icon i:nth-child(3) { animation-delay: -.4s; }
.volume { display: grid; grid-template-columns: 72px 32px; align-items: center; gap: .55rem; }
.volume input { width: 72px; height: 28px; appearance: none; border: 0; background: linear-gradient(rgba(214, 217, 221, .3), rgba(214, 217, 221, .3)) center / 100% 2px no-repeat; }
.volume input::-webkit-slider-thumb { width: 11px; height: 11px; appearance: none; transform: rotate(45deg); border: 1px solid var(--gold-light); background: var(--night); cursor: pointer; }
.volume output { color: var(--steel-dim); font: 500 .63rem/1 var(--body); }
.menu-toggle { display: none; }

.hero { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; isolation: isolate; padding: 104px 24px 36px; }
.hero__art, .hero__veil, .hero__particles { position: absolute; inset: 0; }
.hero__art {
  z-index: -4;
  background: url("assets/factions-v2.jpg") center 48% / cover no-repeat;
  transform: scale(1.02);
  animation: heroBreath 16s ease-in-out infinite alternate;
}
.hero__veil {
  z-index: -3;
  background:
    radial-gradient(circle at 50% 45%, rgba(8, 10, 15, .2) 0 17%, rgba(6, 8, 12, .6) 45%, rgba(5, 7, 11, .94) 100%),
    linear-gradient(90deg, rgba(5, 7, 11, .6), rgba(5, 7, 11, .16) 38%, rgba(5, 7, 11, .2) 62%, rgba(5, 7, 11, .68)),
    linear-gradient(0deg, rgba(5, 7, 11, .94), transparent 38%, rgba(5, 7, 11, .58));
  box-shadow: inset 0 0 180px rgba(0,0,0,.7);
}
.hero__particles {
  z-index: -2;
  opacity: .55;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(239, 209, 142, .72) 0 1px, transparent 1.5px),
    radial-gradient(circle at 81% 18%, rgba(239, 209, 142, .48) 0 1px, transparent 1.5px),
    radial-gradient(circle at 71% 73%, rgba(173, 58, 42, .58) 0 1px, transparent 1.6px),
    radial-gradient(circle at 27% 67%, rgba(239, 209, 142, .42) 0 1px, transparent 1.5px);
  background-size: 230px 190px, 310px 260px, 270px 230px, 180px 220px;
  animation: embers 18s linear infinite;
}
.hero__frame { position: absolute; z-index: 1; inset: 98px 24px 24px; border: 1px solid rgba(201, 154, 80, .15); pointer-events: none; }
.hero__frame i { position: absolute; width: 34px; height: 34px; border-color: var(--gold); opacity: .72; }
.hero__frame i:nth-child(1) { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.hero__frame i:nth-child(2) { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; }
.hero__frame i:nth-child(3) { bottom: -1px; left: -1px; border-bottom: 2px solid; border-left: 2px solid; }
.hero__frame i:nth-child(4) { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

.hero__content { position: relative; z-index: 2; width: min(720px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; text-shadow: 0 3px 18px rgba(0,0,0,.82); }
.cycle { display: flex; align-items: center; gap: .85rem; margin: 0 0 1rem; color: var(--gold-light); font: 600 .72rem/1 var(--body); letter-spacing: .28em; text-transform: uppercase; }
.cycle span { width: 54px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.cycle span:last-child { transform: scaleX(-1); }

.game-mark { position: relative; display: grid; justify-items: center; margin-bottom: .8rem; filter: drop-shadow(0 8px 18px rgba(0,0,0,.72)); }
.game-mark::before, .game-mark::after { content: ""; position: absolute; top: 48%; width: clamp(45px, 8vw, 100px); height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.game-mark::before { right: calc(100% + 18px); }
.game-mark::after { left: calc(100% + 18px); transform: scaleX(-1); }
.game-mark__rf { color: #ece9e0; font: 800 clamp(4rem, 7vw, 6.7rem)/.75 var(--display); letter-spacing: -.12em; -webkit-text-stroke: 1px rgba(239, 209, 142, .45); }
.game-mark__lowrate { margin-top: .75rem; color: var(--gold-light); font: 700 clamp(.85rem, 1.5vw, 1.18rem)/1 var(--display); letter-spacing: .55em; text-transform: uppercase; transform: translateX(.3em); }

.hero h1 { margin: .35rem 0 1rem; color: #f1eee7; font: 600 clamp(2.25rem, 4.2vw, 4.25rem)/1.03 var(--display); letter-spacing: -.04em; text-transform: uppercase; }
.hero h1 span { display: block; color: transparent; -webkit-text-stroke: 1px rgba(239, 209, 142, .9); }
.hero-cta {
  position: relative;
  width: min(330px, 100%);
  min-height: 64px;
  display: grid;
  place-content: center;
  padding: .7rem 2rem;
  color: #160e07;
  background: linear-gradient(180deg, #f0cd83 0%, #c99041 48%, #9d6124 100%);
  clip-path: polygon(13px 0, calc(100% - 13px) 0, 100% 13px, 100% calc(100% - 13px), calc(100% - 13px) 100%, 13px 100%, 0 calc(100% - 13px), 0 13px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 12px 40px rgba(168, 98, 32, .28);
  text-shadow: none;
  transition: filter .2s, transform .2s;
}
.hero-cta::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(64, 34, 11, .45); clip-path: inherit; }
.hero-cta:hover, .hero-cta:focus-visible { filter: brightness(1.12); transform: translateY(-2px); }
.hero-cta span { font: 700 .86rem/1 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.hero-cta small { margin-top: .4rem; font: 700 .59rem/1 var(--body); letter-spacing: .2em; text-transform: uppercase; opacity: .68; }

.factions { display: flex; align-items: flex-start; justify-content: center; gap: clamp(1.6rem, 5vw, 4rem); margin: 1.55rem 0 0; padding: 0; list-style: none; }
.factions li { min-width: 84px; display: grid; justify-items: center; gap: .45rem; color: #c7cbd0; font: 600 .75rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase; }
.faction-emblem { width: 58px; height: 58px; display: block; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,.9)); }
.mmotop-badge { position: fixed; z-index: 3; right: 14px; bottom: 14px; display: block; line-height: 0; opacity: .9; filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .68)); transition: opacity .2s ease, transform .2s ease, filter .2s ease; }
.mmotop-badge:hover, .mmotop-badge:focus-visible { opacity: 1; transform: translateY(-2px); filter: drop-shadow(0 7px 15px rgba(0, 0, 0, .82)); }
.mmotop-badge:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }
.mmotop-badge img { display: block; width: auto; max-width: min(170px, 36vw); height: auto; }
.menu-open .mmotop-badge { opacity: 0; pointer-events: none; }

@keyframes soundbar { to { height: 3px; } }
@keyframes heroBreath { from { transform: scale(1.02); } to { transform: scale(1.055); } }
@keyframes embers { to { background-position: 30px -80px, -50px -100px, 70px -120px, -30px -90px; } }

@media (max-width: 1060px) {
  .site-header { grid-template-columns: auto 1fr auto; }
  .brand__name small { display: none; }
  .nav-button { padding-inline: .85rem; }
  .sound-toggle__text { display: none; }
}

@media (max-width: 860px) {
  .site-header { height: 68px; padding-inline: 16px; gap: .65rem; backdrop-filter: none; }
  .brand__sigil { width: 36px; height: 36px; }
  .brand__name { font-size: .76rem; }
  .menu-toggle { z-index: 5; order: 3; width: 42px; height: 42px; display: grid; place-content: center; gap: 6px; margin-left: .2rem; border: 1px solid rgba(201,154,80,.34); background: rgba(7,10,16,.88); cursor: pointer; }
  .menu-toggle span:not(.sr-only) { width: 18px; height: 1px; background: var(--gold-light); transition: transform .25s; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }
  .primary-nav { position: fixed; z-index: 4; inset: 0; width: 100vw; height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: .9rem; padding: 90px 24px 30px; background: radial-gradient(circle at 50% 25%, rgba(139,33,27,.22), transparent 42%), rgba(5,8,13,.985); visibility: hidden; pointer-events: none; transform: translateX(100%); transition: transform .3s ease, visibility 0s .3s; }
  .primary-nav.is-open { visibility: visible; pointer-events: auto; transform: translateX(0); transition-delay: 0s; }
  .nav-button { width: min(360px, 100%); min-height: 56px; font-size: .875rem; }
  .header-audio { margin-left: auto; padding-left: .65rem; gap: .45rem; }
  .volume { grid-template-columns: 58px; }
  .volume input { width: 58px; }
  .volume output { display: none; }
  .hero { padding-top: 86px; }
  .hero__frame { inset: 80px 14px 14px; }
}

@media (max-width: 620px) {
  .hero { min-height: 100svh; padding: 82px 18px 32px; }
  .hero__art { background-position: 50% center; }
  .hero__veil { background: radial-gradient(circle at 50% 40%, rgba(8,10,15,.12), rgba(5,7,11,.58) 45%, rgba(5,7,11,.96) 100%), linear-gradient(0deg, rgba(5,7,11,.92), transparent 52%, rgba(5,7,11,.66)); }
  .cycle { gap: .5rem; margin-bottom: .75rem; font-size: .62rem; letter-spacing: .2em; }
  .cycle span { width: 30px; }
  .game-mark { margin-bottom: .4rem; }
  .game-mark__rf { font-size: clamp(3.45rem, 18vw, 4.5rem); }
  .game-mark__lowrate { font-size: .72rem; }
  .game-mark::before, .game-mark::after { display: none; }
  .hero h1 { margin: .3rem 0 .8rem; font-size: clamp(2rem, 10.5vw, 3rem); }
  .hero-cta { min-height: 58px; }
  .factions { gap: clamp(.8rem, 7vw, 2rem); margin-top: 1.25rem; }
  .factions li { min-width: 72px; font-size: .75rem; }
  .faction-emblem { width: 47px; height: 47px; }
  .mmotop-badge { right: 10px; bottom: 10px; }
  .mmotop-badge img { max-width: min(140px, 38vw); }
}

@media (max-width: 390px) {
  .brand__name { display: none; }
  .site-header { grid-template-columns: auto 1fr auto; }
  .header-audio { justify-self: end; }
  .volume, .volume input { width: 50px; }
  .hero__content { transform: translateY(-4px); }
}

@media (max-height: 720px) and (min-width: 861px) {
  .hero { padding-top: 92px; padding-bottom: 22px; }
  .cycle { margin-bottom: .6rem; }
  .game-mark__rf { font-size: 4.6rem; }
  .game-mark__lowrate { margin-top: .55rem; }
  .hero h1 { margin-block: .25rem .65rem; font-size: 2.7rem; }
  .hero-cta { min-height: 56px; }
  .factions { margin-top: 1rem; }
}

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