/* ATLAS hub — главная */
:root {
  --hub-bg: #02060c;
  --hub-ink: #06101a;
  --hub-cyan: #3de7ff;
  --hub-cyan-dim: rgba(61, 231, 255, 0.55);
  --hub-mist: #9eb6c9;
  --hub-sand: #e8eef4;
  --hub-line: rgba(61, 231, 255, 0.22);
  --font-display: "Orbitron", system-ui, sans-serif;
  --font-body: "Exo 2", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--hub-bg);
  color: var(--hub-sand);
  font-family: var(--font-body);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hub-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* —— topbar —— */
.hub-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  /* Логотип и языки в колонке 880px — слоты рекламы по бокам */
  padding: 0.9rem max(1rem, calc((100vw - min(92vw, var(--atlas-content-max, 880px))) / 2));
  background: linear-gradient(180deg, rgba(2, 6, 12, 0.92) 0%, rgba(2, 6, 12, 0.35) 70%, transparent 100%);
}

.hub-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}

.hub-brand strong {
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  font-weight: 600;
}

.hub-topbar-end {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem 1.1rem;
}

.hub-skip {
  display: inline-flex;
  align-items: center;
  color: var(--hub-sand);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.48rem 0.85rem;
  border: 1px solid rgba(61, 231, 255, 0.38);
  border-radius: 4px;
  background: rgba(61, 231, 255, 0.08);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.hub-skip:hover,
.hub-skip:focus-visible {
  color: var(--hub-ink);
  background: var(--hub-cyan);
  border-color: var(--hub-cyan);
  outline: none;
  transform: translateY(-1px);
}

.hub-lang {
  display: inline-flex;
  gap: 0.3rem;
}

.hub-lang button {
  border: 1px solid var(--hub-line);
  background: transparent;
  color: var(--hub-mist);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  padding: 0.32rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hub-lang button.active {
  color: var(--hub-ink);
  background: var(--hub-cyan);
  border-color: var(--hub-cyan);
}

/* —— hero (first viewport) —— */
.hub-hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
  background: var(--hub-bg);
}

.hub-hero-media {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, var(--atlas-content-max, 880px));
  margin-left: calc(min(100%, var(--atlas-content-max, 880px)) / -2);
  background: var(--hub-ink);
  animation: hub-media-in 1.4s ease-out both;
}

.hub-hero-slide {
  position: absolute;
  inset: 0;
  background: var(--hub-ink) center / cover no-repeat;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.25s ease, transform 8s ease-out;
  will-change: opacity, transform;
}

.hub-hero-slide.is-active {
  opacity: 1;
  transform: scale(1.02);
}

.hub-hero-veil {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, var(--atlas-content-max, 880px));
  margin-left: calc(min(100%, var(--atlas-content-max, 880px)) / -2);
  background:
    linear-gradient(90deg, rgba(2, 6, 12, 0.88) 0%, rgba(2, 6, 12, 0.55) 42%, rgba(2, 6, 12, 0.25) 100%),
    linear-gradient(0deg, rgba(2, 6, 12, 0.95) 0%, rgba(2, 6, 12, 0.2) 45%, rgba(2, 6, 12, 0.45) 100%);
  pointer-events: none;
}

.hub-hero-copy {
  position: relative;
  z-index: 2;
  width: min(var(--atlas-content-max, 880px), 92vw);
  padding: 7rem 1.25rem 4.5rem;
  box-sizing: border-box;
  animation: hub-copy-in 0.9s ease-out 0.15s both;
}

.hub-hero-brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 12vw, 6.5rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 0.95;
  color: var(--hub-sand);
  text-shadow: 0 0 40px rgba(61, 231, 255, 0.18);
}

.hub-hero-slogan {
  margin: 0 0 0.75rem;
  max-width: 22rem;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.35;
  color: var(--hub-cyan);
}

.hub-hero-lead {
  margin: 0 0 1.75rem;
  max-width: 28rem;
  color: var(--hub-mist);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.55;
}

.hub-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
  margin-top: 0.35rem;
  max-width: 28rem;
}

.hub-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.35rem;
  background: var(--hub-cyan);
  color: var(--hub-ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 4px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.hub-cta:hover,
.hub-cta:focus-visible {
  background: #9fefff;
  transform: translateY(-2px);
  outline: none;
}

.hub-cta-ghost {
  color: var(--hub-sand);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--hub-cyan-dim);
  padding-bottom: 0.15rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.hub-cta-ghost:hover,
.hub-cta-ghost:focus-visible {
  color: var(--hub-cyan);
  border-bottom-color: var(--hub-cyan);
  outline: none;
}

/* —— games —— */
.hub-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(var(--atlas-content-max, 880px), 92vw);
  margin: 0 auto;
  padding: 4rem 0 3.5rem;
}

.hub-head {
  margin-bottom: 1.75rem;
}

.hub-head h1 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hub-head p {
  margin: 0;
  color: var(--hub-mist);
  max-width: 34rem;
  line-height: 1.5;
}

.hub-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.35rem;
}

.hub-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--hub-line);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(6, 16, 26, 0.65);
  transition: border-color 0.22s ease, transform 0.22s ease;
}

a.hub-card:hover,
a.hub-card:focus-visible {
  border-color: rgba(61, 231, 255, 0.55);
  transform: translateY(-4px);
  outline: none;
}

.hub-card.is-soon {
  pointer-events: none;
  opacity: 0.5;
}

.hub-card-cover {
  aspect-ratio: 16 / 10;
  background: #0a1624 center / cover no-repeat;
  position: relative;
  overflow: hidden;
}

.hub-card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(2, 6, 12, 0.75) 100%);
  pointer-events: none;
}

a.hub-card:hover .hub-card-cover,
a.hub-card:focus-visible .hub-card-cover {
  background-size: 105% auto;
}

.hub-card-badge {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  z-index: 1;
  padding: 0.22rem 0.45rem;
  border-radius: 3px;
  background: var(--hub-cyan);
  color: var(--hub-ink);
  font-size: 0.65rem;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hub-card.is-wip .hub-card-badge {
  background: #e85a2a;
  color: #140606;
}

.hub-card-body {
  padding: 0.95rem 1rem 1.15rem;
  display: grid;
  gap: 0.3rem;
}

.hub-card-body h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
  font-weight: 600;
}

.hub-card-meta {
  margin: 0;
  color: var(--hub-mist);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.hub-card-blurb {
  margin: 0.2rem 0 0;
  color: rgba(232, 238, 244, 0.78);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* —— forum —— */
.hub-forum-wrap {
  position: relative;
  z-index: 1;
  width: min(var(--atlas-content-max, 880px), 92vw);
  margin: 0 auto;
  padding: 0 0 4rem;
}

.hub-forum-wrap.is-page {
  flex: 1;
  width: min(var(--atlas-content-max, 880px), 92vw);
  padding: 5.5rem 0 3.5rem;
}

.forum-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hub-forum-form h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hub-forum-status {
  margin: 0 0 1rem;
  color: var(--hub-mist);
  font-size: 0.9rem;
}

.hub-forum-status.is-error {
  color: #f0a070;
}

.hub-forum-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.hub-forum-col {
  display: grid;
  gap: 1.25rem;
}

.hub-forum-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.hub-forum-empty {
  color: var(--hub-mist);
  padding: 1rem;
  border: 1px dashed var(--hub-line);
  border-radius: 6px;
}

.hub-forum-item {
  width: 100%;
  display: grid;
  gap: 0.35rem;
  text-align: left;
  padding: 0.9rem 1rem;
  border: 1px solid var(--hub-line);
  border-radius: 6px;
  background: rgba(6, 16, 26, 0.55);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.hub-forum-item:hover,
.hub-forum-item:focus-visible,
.hub-forum-item.is-active {
  border-color: rgba(61, 231, 255, 0.5);
  outline: none;
}

.hub-forum-item:hover,
.hub-forum-item:focus-visible {
  transform: translateY(-2px);
}

.hub-forum-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--hub-mist);
  text-transform: uppercase;
}

.hub-forum-item strong {
  font-size: 1.02rem;
  line-height: 1.3;
}

.hub-forum-item-preview {
  color: rgba(232, 238, 244, 0.72);
  font-size: 0.88rem;
  line-height: 1.4;
}

.hub-forum-item-author {
  color: var(--hub-cyan-dim);
  font-size: 0.82rem;
}

.hub-forum-form {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem 1.25rem;
  border: 1px solid var(--hub-line);
  border-radius: 6px;
  background: rgba(6, 16, 26, 0.55);
}

.hub-forum-form h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hub-forum-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.hub-forum-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--hub-mist);
}

.hub-forum-span {
  grid-column: 1 / -1;
}

.hub-forum-grow textarea {
  min-height: 6rem;
  resize: vertical;
}

.hub-forum-form input,
.hub-forum-form select,
.hub-forum-form textarea {
  width: 100%;
  border: 1px solid rgba(61, 231, 255, 0.22);
  border-radius: 4px;
  background: rgba(2, 6, 12, 0.75);
  color: var(--hub-sand);
  font: inherit;
  padding: 0.55rem 0.65rem;
}

.hub-forum-form input:focus,
.hub-forum-form select:focus,
.hub-forum-form textarea:focus {
  outline: none;
  border-color: var(--hub-cyan);
}

.hub-forum-form .hub-cta {
  justify-self: start;
  border: 0;
  cursor: pointer;
}

.hub-forum-thread {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem 1.15rem 1.25rem;
  border: 1px solid var(--hub-line);
  border-radius: 6px;
  background: rgba(6, 16, 26, 0.55);
  min-height: 12rem;
}

.hub-forum-back {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--hub-cyan);
  font: inherit;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

.hub-forum-back:hover,
.hub-forum-back:focus-visible {
  border-bottom-color: var(--hub-cyan);
  outline: none;
}

.hub-forum-topic h3 {
  margin: 0.35rem 0;
  font-size: 1.25rem;
  line-height: 1.3;
}

.hub-forum-body,
.hub-forum-reply p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
  color: rgba(232, 238, 244, 0.88);
}

.hub-forum-replies {
  display: grid;
  gap: 0.65rem;
}

.hub-forum-reply {
  padding: 0.75rem 0.85rem;
  border-left: 3px solid rgba(61, 231, 255, 0.35);
  background: rgba(2, 6, 12, 0.35);
}

.hub-forum-reply header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: var(--hub-mist);
}

/* —— footer —— */
.hub-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  width: min(var(--atlas-content-max, 880px), 92vw);
  margin: 0 auto;
  padding: 1.5rem 0 2.25rem;
  border-top: 1px solid rgba(158, 182, 201, 0.12);
  color: rgba(158, 182, 201, 0.65);
  font-size: 0.8rem;
}

.hub-footer .build-version {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hub-cyan-dim);
}

.hub-footer p {
  margin: 0;
}

@keyframes hub-copy-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hub-media-in {
  from {
    transform: scale(1.08);
    opacity: 0.65;
  }
  to {
    transform: scale(1.04);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hub-hero-media,
  .hub-hero-copy,
  .hub-hero-slide,
  .hub-card,
  .hub-cta {
    animation: none !important;
    transition: none !important;
  }

  .hub-hero-slide {
    transform: none;
  }
}

@media (max-width: 900px) {
  .hub-forum-layout {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 640px) {
  .hub-topbar {
    padding: 0.75rem 4vw;
  }

  .hub-hero-copy {
    padding: 6.5rem 0.85rem 3.25rem;
  }

  .hub-hero-brand {
    letter-spacing: 0.12em;
  }

  .hub-forum-fields {
    grid-template-columns: 1fr;
  }

  .hub-skip {
    display: none;
  }
}
