@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/Press_Start_2P/PressStart2P-Regular.ttf");
}

/* === Reset и базовые настройки === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

/* === Общий layout === */
body {
  text-align: center;
  background-color: #021b20;
  color: #e37fd3;
  font-family: "Press Start 2P", monospace;
  margin: 0;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.hero-art {
  position: relative;
  display: inline-block;
  width: min(400px, 92vw);
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.robot-light {
  position: absolute;
  width: 3.2%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff6b0;
  box-shadow:
    0 0 4px #fff6b0,
    0 0 10px #ffdd62,
    0 0 18px #ff8c2f;
  mix-blend-mode: screen;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0.18;
  filter: brightness(0.45);
  animation: robot-headlight-morse 14.76s infinite steps(1, end);
}

.robot-light-left {
  top: 78.3%;
  left: 46.5%;
}

.robot-light-right {
  top: 79.7%;
  left: 51.2%;
}

@keyframes robot-headlight-morse {
  0.000%,
  0.813%,
  1.626%,
  2.439%,
  3.252%,
  4.065%,
  4.878%,
  5.691%,
  8.130%,
  8.943%,
  11.382%,
  12.195%,
  13.008%,
  15.447%,
  16.260%,
  17.073%,
  17.886%,
  18.699%,
  21.138%,
  21.951%,
  22.764%,
  25.203%,
  26.016%,
  26.829%,
  27.642%,
  28.455%,
  30.894%,
  33.333%,
  34.146%,
  36.585%,
  37.398%,
  39.837%,
  45.528%,
  46.341%,
  47.154%,
  49.593%,
  50.407%,
  52.846%,
  55.285%,
  57.724%,
  58.537%,
  60.976%,
  61.789%,
  64.228%,
  66.667%,
  67.480%,
  68.293%,
  70.732%,
  71.545%,
  72.358%,
  74.797%,
  75.610%,
  76.423%,
  78.862%,
  79.675%,
  80.488%,
  81.301%,
  82.114%,
  84.553%,
  86.992%,
  87.805%,
  88.618%,
  89.431%,
  90.244% {
    opacity: 0.96;
    filter: brightness(1.3);
  }

  0.814%,
  2.440%,
  4.066%,
  5.692%,
  8.944%,
  12.196%,
  15.448%,
  17.074%,
  18.700%,
  21.952%,
  25.204%,
  26.830%,
  28.456%,
  33.334%,
  36.586%,
  39.838%,
  46.342%,
  49.594%,
  52.847%,
  57.725%,
  60.977%,
  64.229%,
  67.481%,
  70.733%,
  72.359%,
  75.611%,
  78.863%,
  80.489%,
  82.115%,
  86.993%,
  88.619%,
  90.245%,
  100.000% {
    opacity: 0.18;
    filter: brightness(0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .robot-light {
    animation: none;
    opacity: 0.82;
  }
}

/* === Ссылки === */
.home-link {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 30;
  color: #c3ccaf;
  font-size: 0.85rem;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
}

.home-link:link,
.home-link:visited {
  color: #c3ccaf;
}

.home-link:hover {
  color: #ffffff;
  text-decoration: none;
}

.home-link:focus-visible {
  border-radius: 2px;
  outline: 3px solid #e37fd3;
  outline-offset: 5px;
}

a:link {
  text-decoration: none;
  color: #808000;
}

a:visited {
  color: #0f7afc;
}

a:hover {
  color: #cf0000;
  text-decoration: underline;
}

a:active {
  color: #00aa00;
}

/* === Навигация === */
nav {
  font-size: 30px;
  line-height: 1.8;
  padding: 0 1rem;
  overflow-wrap: anywhere;
}

/* === Заголовок === */
header h1 {
  line-height: 1;
  margin-top: 40px;
  margin-bottom: 10px;
}

/* === Неоновый текст (класс neon-text) === */
.neon-text {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: #fff;
  text-shadow:
    0 0 5px #ff005e,
    0 0 10px #ff005e,
    0 0 20px #ff005e,
    0 0 40px #ff005e,
    0 0 80px #ff005e;
}

/* === Rubik-линк (3D куб) === */
.rubik {
  position: relative;
  width: 150px;
  height: 50px;
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 4s;
  transform: perspective(1000px) rotateX(0deg);
  -webkit-tap-highlight-color: transparent;
}

.rubik:hover,
.rubik:focus,
.rubik:active {
  text-decoration: none;
  transform: perspective(1000px) rotateX(360deg);
}

.rubik span {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  background: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
  transition: 0.5s;
  border: 0;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.rubik:hover span,
.rubik:focus span,
.rubik:active span {
  color: #fff;
  background: rgba(3, 169, 244, 0.8);
}

.rubik span:nth-child(1) {
  transform: rotateX(0deg) translateZ(25px);
}

.rubik span:nth-child(2) {
  transform: rotateX(90deg) translateZ(25px);
}

.rubik span:nth-child(3) {
  transform: rotateX(180deg) translateZ(25px);
}

.rubik span:nth-child(4) {
  transform: rotateX(270deg) translateZ(25px);
}

/* Позиционирование Rubik на главной */
article sub .rubik {
  display: inline-block;
  margin-top: 150px;
}

/* === Футер и лицензия CC === */
footer {
  padding: 0.35rem 0 0.5rem;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

footer a.cc-link {
  text-decoration: none;
  color: inherit;
}

footer img.cc-icon {
  max-width: 1em;
  max-height: 1em;
  margin-left: 0.2em;
  vertical-align: middle;
}

footer .brand-label img {
  height: 48px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

footer .github-footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(195, 204, 175, 0.45);
  border-radius: 6px;
  background: rgba(255, 252, 245, 0.08);
  text-decoration: none;
}

footer .github-footer-link:visited {
  color: #fffcf5;
}

footer .github-footer-link:hover {
  border-color: #fffcf5;
  color: #ffffff;
  text-decoration: none;
}

footer .github-footer-link img {
  display: block;
  width: 86px;
  height: auto;
}

footer p {
  margin: 0;
}

@media (max-width: 640px) {
  header h1 {
    font-size: clamp(1.75rem, 11vw, 2.8rem);
  }

  .neon-text {
    text-shadow:
      0 0 6px #ff005e,
      0 0 12px #ff005e,
      0 0 24px #ff005e,
      0 0 42px #ff005e;
  }

  nav {
    font-size: clamp(0.82rem, 4.9vw, 1.25rem);
  }

  .home-link {
    top: 1rem;
    left: 1rem;
    font-size: 0.62rem;
  }

  .copyright {
    font-size: 0.58rem;
    line-height: 1.7;
  }
}
