/* ============================================================================
   EmberMine — стили
   Структура: токены → сброс → база → компоненты → секции → адаптив
   ============================================================================ */

/* ---------- Токены ---------- */
:root {
  /* фон, тёплый тёмно-коричневый, не чёрно-серый */
  --bg: #14100c;
  --bg-alt: #1b1510;
  --bg-card: #211a14;
  --bg-card-hover: #29211a;

  --border: #362a20;
  --border-strong: #4a3a2b;

  --text: #f2e9dd;
  --text-secondary: #bdaa96;
  --text-muted: #8a7865;

  --accent: #e2833c;
  --accent-hover: #f0964f;
  --accent-dim: #a35f28;
  --accent-soft: rgba(226, 131, 60, 0.12);
  --accent-soft-strong: rgba(226, 131, 60, 0.22);

  --online: #8fbf7a;
  --offline: #c1594f;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;

  --font-display: "Unbounded", "Golos Text", sans-serif;
  --font-body: "Golos Text", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --container: 1180px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Сброс ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, p, ul, figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

.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;
}

/* ---------- База ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-soft-strong);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: #1a1108;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 999;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Утилиты ---------- */
.section {
  position: relative;
  padding: 80px 20px;
}

.section--alt {
  background: var(--bg-alt);
}

.section--alt + .section:not(.section--alt)::before,
.section:not(.section--alt) + .section--alt::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 50%, transparent);
}

.section__inner {
  max-width: var(--container);
  margin: 0 auto;
}

.section__eyebrow.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.section__eyebrow-num {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}

.section__lead {
  color: var(--text-secondary);
  max-width: 60ch;
  margin-top: -16px;
  margin-bottom: 32px;
  font-size: 15px;
}

/* ============================================================================
   ШАПКА
   ============================================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 16, 12, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand__logo {
  height: 30px;
  width: auto;
}

.brand__logo:not([src]),
.brand__logo.is-hidden {
  display: none;
}

.brand__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--text);
  border-color: var(--accent-dim);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.nav-toggle__box {
  width: 22px;
  height: 16px;
  position: relative;
}

.nav-toggle__line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}

.nav-toggle__line:nth-child(1) { top: 0; }
.nav-toggle__line:nth-child(2) { top: 7px; }
.nav-toggle__line:nth-child(3) { top: 14px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

@media (max-width: 719px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px 16px;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .site-nav.is-open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav a {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }
}

/* ============================================================================
   HERO
   ============================================================================ */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 12% -6%, rgba(226, 131, 60, 0.16), transparent 62%),
    radial-gradient(ellipse 40% 45% at 88% 14%, rgba(226, 131, 60, 0.08), transparent 58%),
    var(--bg);
}

.divider {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: 16px;
  fill: var(--bg-alt);
}

.hero__sparks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 72px 20px 88px;
  display: grid;
  gap: 48px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 10vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.hero__title-accent {
  color: var(--accent);
}

.hero__slogan {
  margin-top: 20px;
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--text-secondary);
  max-width: 40ch;
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.tag--accent {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: var(--accent-soft);
}

.hero__ip-col {
  display: flex;
}

.ip-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-md), 0 0 0 rgba(226, 131, 60, 0);
  animation: ember-glow 5s ease-in-out infinite;
}

@keyframes ember-glow {
  0%, 100% { box-shadow: var(--shadow-md), 0 0 0 rgba(226, 131, 60, 0); }
  50% { box-shadow: var(--shadow-md), 0 0 32px rgba(226, 131, 60, 0.14); }
}

.ip-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-dim), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

.ip-card__label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.ip-card__row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ip-card__value {
  font-family: var(--font-mono);
  font-size: clamp(19px, 3.6vw, 24px);
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}

.ip-card__copy {
  flex-shrink: 0;
  margin-left: auto;
  background: var(--accent);
  color: #1a1108;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.25s var(--ease), transform 0.2s var(--ease);
}

.ip-card__copy:hover {
  background: var(--accent-hover);
}

.ip-card__copy:active {
  transform: scale(0.97);
}

.ip-card__copy.is-copied {
  background: var(--online);
}

.ip-card__status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.status-dot.is-online {
  background: var(--online);
  box-shadow: 0 0 0 3px rgba(143, 191, 122, 0.18);
}

.status-dot.is-offline {
  background: var(--offline);
  box-shadow: 0 0 0 3px rgba(193, 89, 79, 0.18);
}

@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: 1.2fr 0.9fr;
    align-items: start;
    padding-top: 100px;
    padding-bottom: 120px;
  }

  .hero__ip-col {
    margin-top: 56px;
    justify-content: flex-end;
  }
}

/* ============================================================================
   О СЕРВЕРЕ
   ============================================================================ */

.about-grid {
  display: grid;
  gap: 40px;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 15.5px;
  max-width: 58ch;
}

.about-text p + p {
  margin-top: 16px;
}

.about-list {
  display: grid;
  gap: 2px;
  align-content: start;
}

.about-list li {
  position: relative;
  padding: 14px 0 14px 26px;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
  color: var(--text);
}

.about-list li:first-child {
  border-top: 1px solid var(--border);
}

.about-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 21px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

@media (min-width: 860px) {
  .about-grid {
    grid-template-columns: 1.3fr 0.9fr;
    align-items: start;
    gap: 64px;
  }
}

/* ============================================================================
   БАННЕР ПОДСТРАНИЦЫ (Донат, Карта)
   ============================================================================ */

.page-banner {
  position: relative;
  overflow: hidden;
  padding: 56px 20px 48px;
  background:
    radial-gradient(ellipse 60% 70% at 12% -10%, rgba(226, 131, 60, 0.14), transparent 62%),
    var(--bg);
}

.page-banner .section__inner {
  position: relative;
  z-index: 1;
}

@media (min-width: 720px) {
  .page-banner {
    padding: 72px 20px 64px;
  }
}

/* ============================================================================
   РЕЖИМЫ
   ============================================================================ */

.modes-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .modes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

.mode-card--open:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3), 0 0 24px rgba(226, 131, 60, 0.1);
}

.mode-card--open {
  border-color: var(--accent-dim);
  background: linear-gradient(160deg, var(--bg-card-hover), var(--bg-card));
}

.mode-card--soon {
  opacity: 0.55;
}

.mode-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.mode-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}

.badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}

.badge--open {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}

.badge--soon {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}

.mode-card__text {
  color: var(--text-secondary);
  font-size: 14.5px;
}

/* ============================================================================
   КАРТА
   ============================================================================ */

.map-frame {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 16 / 8;
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 56px 32px;
  background:
    repeating-linear-gradient(135deg, transparent, transparent 18px, var(--bg-card) 18px, var(--bg-card) 19px),
    var(--bg-alt);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.map-placeholder__icon {
  font-size: 32px;
  margin-bottom: 4px;
}

.map-placeholder__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}

.map-placeholder__text {
  color: var(--text-secondary);
  font-size: 14.5px;
  max-width: 48ch;
}

/* ============================================================================
   СОЦСЕТИ
   ============================================================================ */

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.social-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 128px;
  padding: 24px 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14.5px;
  color: var(--text);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

.social-btn:hover {
  border-color: var(--accent-dim);
  background: var(--accent-soft);
  transform: translateY(-3px);
}

.social-btn:active {
  transform: scale(0.98);
}

.social-btn svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--accent);
}

.social-empty {
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================================================
   ДОНАТ
   ============================================================================ */

.donate-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .donate-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.shop-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

a.shop-card:hover {
  border-color: var(--tile-border, var(--accent-dim));
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.32);
}

a.shop-card:active {
  transform: translateY(-1px) scale(0.98);
}

.shop-card.is-disabled {
  opacity: 0.5;
  cursor: default;
}

.shop-card__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  border-radius: var(--radius-sm);
  background: var(--tile-bg, var(--accent-soft));
  box-shadow: inset 0 0 0 1px var(--tile-border, var(--border-strong));
}

.shop-card__name {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.shop-card__price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  margin-top: -8px;
}

.shop-card__soon {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: -6px;
}

.shop-card--gold { --tile-bg: rgba(226, 178, 60, 0.16); --tile-border: rgba(226, 178, 60, 0.35); }
.shop-card--orange { --tile-bg: rgba(226, 131, 60, 0.16); --tile-border: rgba(226, 131, 60, 0.35); }
.shop-card--blue { --tile-bg: rgba(78, 156, 226, 0.14); --tile-border: rgba(78, 156, 226, 0.32); }
.shop-card--red { --tile-bg: rgba(210, 74, 64, 0.16); --tile-border: rgba(210, 74, 64, 0.35); }
.shop-card--cyan { --tile-bg: rgba(66, 186, 189, 0.14); --tile-border: rgba(66, 186, 189, 0.32); }
.shop-card--diamond { --tile-bg: rgba(112, 200, 220, 0.16); --tile-border: rgba(112, 200, 220, 0.35); }
.shop-card--green { --tile-bg: rgba(143, 191, 122, 0.16); --tile-border: rgba(143, 191, 122, 0.34); }
.shop-card--purple { --tile-bg: rgba(163, 112, 210, 0.16); --tile-border: rgba(163, 112, 210, 0.34); }

/* ============================================================================
   ПОДВАЛ
   ============================================================================ */

.site-footer {
  position: relative;
  padding: 40px 20px;
  background: var(--bg-alt);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 50%, transparent);
}

.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.site-footer__admins {
  font-size: 14px;
}

.site-footer__label {
  color: var(--text-muted);
  margin-right: 8px;
}

.site-footer__disclaimer,
.site-footer__copy {
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================================================
   ANIMATIONS / REDUCED MOTION
   ============================================================================ */

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

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
