body {
  display: flex;
  flex-direction: column;
}

#wrap {
  padding: var(--g) 0;
  flex: 1 0 auto;
  min-height: 100dvh;
}

footer {
  flex-shrink: 0;
}

body > header {
  position: fixed;
  z-index: 10;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
}

@media screen and (max-width: 1080px) {
  body > header {
    bottom: 20px;
  }
}

.header-inner {
  display: flex;
  gap: 7px;
  justify-content: center;
  align-items: center;
}

.e-item {
  width: 34px;
  height: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border: 1.5px solid var(--theme-bk);
  position: relative;
  transition: border-color 0.3s ease;
}

#e-open,
#e-closed {
  width: 20px;
  transition: opacity 0.2s;
  position: absolute;
}

.e-item.no-anim #e-open,
.e-item.no-anim #e-closed {
  transition: none;
}

#e-open *,
#e-closed * {
  stroke: var(--theme-bk);
  transition: stroke 0.3s ease;
}

#e-closed {
  opacity: 0;
  margin-top: 5px;
}

.e-item.closed #e-open {
  opacity: 0;
}

.e-item.closed #e-closed {
  opacity: 1;
}

.m-btn {
  width: 34px;
  height: 34px;
  background: var(--theme-bk);
  position: relative;
  cursor: pointer;
  border: 1.5px solid var(--theme-bk);
  border-radius: 0;
  transition: all 0.4s ease;
}

.m-line {
  position: absolute;
  left: 8px;
  height: 1.5px;
  background: var(--theme-wh);
  transition: all 0.4s ease;
}

.m-top {
  width: 15px;
  top: 9px;
}

.m-mid {
  width: 10px;
  top: 15px;
}

.m-bot {
  width: 15px;
  top: 21px;
}

.m-btn.m-active {
  background: var(--theme-wh);
  border: 1.5px solid var(--theme-wh);
}

.m-btn.m-active .m-top {
  transform: translateY(6px) rotate(45deg);
  background: var(--keyColor);
}

.m-btn.m-active .m-mid {
  opacity: 0;
}

.m-btn.m-active .m-bot {
  transform: translateY(-6px) rotate(-45deg);
  background: var(--keyColor);
}

.d-scene {
  width: 34px;
  height: 34px;
  cursor: pointer;
  perspective: 300px;
}

.d-dice {
  width: 34px;
  height: 34px;
  transform-style: preserve-3d;
  transform: translateZ(-17px) rotateX(var(--dice-x)) rotateY(var(--dice-y));
  transition: transform 0.6s ease-out;
  position: relative;
}

.d-face {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--keyColor);
  box-sizing: border-box;
  display: grid;
  grid-template-columns:repeat(3, 1fr);
  grid-template-rows:repeat(3, 1fr);
  padding: 7px;
  backface-visibility: hidden;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.d-front {
  display: flex;
  justify-content: center;
  align-items: center;
}

.d-dot {
  width: 3px;
  height: 3px;
  background: var(--keyColor);
  border-radius: 50%;
  justify-self: center;
  align-self: center;
  transition: background-color 0.3s ease;
}

.d-tl {
  grid-area: 1 / 1;
}

.d-tr {
  grid-area: 1 / 3;
}

.d-ml {
  grid-area: 2 / 1;
}

.d-mr {
  grid-area: 2 / 3;
}

.d-bl {
  grid-area: 3 / 1;
}

.d-br {
  grid-area: 3 / 3;
}

.d-center {
  grid-area: 2 / 2;
}

.d-front {
  transform: rotateY(0deg) translateZ(17px);
}

.d-back {
  transform: rotateY(180deg) translateZ(17px);
}

.d-right {
  transform: rotateY(90deg) translateZ(17px);
}

.d-left {
  transform: rotateY(-90deg) translateZ(17px);
}

.d-top {
  transform: rotateX(90deg) translateZ(17px);
}

.d-bottom {
  transform: rotateX(-90deg) translateZ(17px);
}

.footer-row {
  width: 100%;
  aspect-ratio: 1680 / 1696;
  overflow: hidden;
}

.f-hr {
  width: 100%;
  height: 100%;
  transform-origin: 50% 0;
  transform: rotateX(90deg);
  will-change: transform;
  background-position: center bottom;
  background-size: cover;
  background-repeat: no-repeat;
}

:root[data-theme="light"][data-dice="1"] .f-hr {
  background-image: url('../footer-colors/red-lt.png');
}

:root[data-theme="light"][data-dice="2"] .f-hr {
  background-image: url('../footer-colors/org-lt.png');
}

:root[data-theme="light"][data-dice="3"] .f-hr {
  background-image: url('../footer-colors/yel-lt.png');
}

:root[data-theme="light"][data-dice="4"] .f-hr {
  background-image: url('../footer-colors/grn-lt.png');
}

:root[data-theme="light"][data-dice="5"] .f-hr {
  background-image: url('../footer-colors/blu-lt.png');
}

:root[data-theme="light"][data-dice="6"] .f-hr {
  background-image: url('../footer-colors/cyn-lt.png');
}

:root[data-theme="dark"][data-dice="1"] .f-hr {
  background-image: url('../footer-colors/red-dk.png');
}

:root[data-theme="dark"][data-dice="2"] .f-hr {
  background-image: url('../footer-colors/org-dk.png');
}

:root[data-theme="dark"][data-dice="3"] .f-hr {
  background-image: url('../footer-colors/yel-dk.png');
}

:root[data-theme="dark"][data-dice="4"] .f-hr {
  background-image: url('../footer-colors/grn-dk.png');
}

:root[data-theme="dark"][data-dice="5"] .f-hr {
  background-image: url('../footer-colors/blu-dk.png');
}

:root[data-theme="dark"][data-dice="6"] .f-hr {
  background-image: url('../footer-colors/cyn-dk.png');
}

.footer-inner {
  max-width: calc(920px + var(--h) * 2);
  margin: var(--g-l) auto 0;
  padding: var(--g);
}

.footer-cols {
  display: flex;
  justify-content: space-around;
  gap: 128px;
}

.f-links {
  display: flex;
  gap: 128px;
}

.f-col {
  display: flex;
  flex-direction: column;
}

.f-info {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.f-info-row {
  display: flex;
  gap: 32px;
}

.f-col .roll,
.f-col a,
.f-info-key,
.f-info-val,
.f-info .roll,
.f-info a {
  font-family: 'AOT Serial Mono', 'Gothic A1', sans-serif;
  font-size: var(--fz-s);
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.36px;
  text-transform: uppercase;
  color: var(--theme-bk);
}

.f-col .roll,
.f-info .roll {
  height: 24px;
  line-height: 24px;
}

.copyright {
  margin-top: 64px;
  margin-bottom: 128px;
  font-family: 'AOT Serial Mono', 'Gothic A1', sans-serif;
  color: var(--theme-bk);
  font-size: var(--fz-s);
  line-height: 24px;
  letter-spacing: -0.36px;
  text-transform: uppercase;
  color: var(--theme-gr-40);
  width: 100%;
  text-align: center;
}

@media screen and (max-width: 1080px) {
  .footer-cols {
    flex-direction: column;
    align-items: flex-start;
    gap: 48px;
  }

  .f-links {
    gap: 64px;
  }

  .f-info {
    gap: 24px;
  }

  .f-info-row {
    gap: 24px;
  }

  .f-col .roll,
  .f-col a,
  .f-info-key,
  .f-info-val,
  .f-info .roll,
  .f-info a {
    line-height: 20px;
  }

  .f-col .roll,
  .f-info .roll {
    height: 20px;
    line-height: 20px;
  }

  .copyright {
    margin-top: 64px;
    line-height: 20px;
  }
}
