*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #020209;
  --glass: rgba(255, 255, 255, 0.025);
  --glass-hover: rgba(255, 255, 255, 0.055);
  --glass-active: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text: #e8e8f0;
  --text-dim: #4a4a60;
  --text-mid: #888899;
  --cyan: #00f5d4;
  --violet: #7b61ff;
  --pink: #ff6bcb;
  --vk: #5181b8;
  --tg: #29a9eb;
  --ig: #e4405f;
  --yt: #ff0033;
  --max: #ff6200;
  --radius: 16px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Syne', var(--font);
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── Background ── */
.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background: var(--bg);
}

/* Hex grid */
.bg__hex {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='104'%3E%3Cpolygon points='30,2 58,17 58,47 30,62 2,47 2,17' fill='none' stroke='rgba(123,97,255,0.18)' stroke-width='0.8'/%3E%3Cpolygon points='30,62 58,77 58,107 30,122 2,107 2,77' fill='none' stroke='rgba(0,245,212,0.1)' stroke-width='0.8'/%3E%3C/svg%3E");
  background-size: 60px 104px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 70%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 70%);
  animation: hex-drift 40s linear infinite;
}

@keyframes hex-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 60px 104px; }
}

.bg__mesh {
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, rgba(123, 97, 255, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 45% 35% at 80% 70%, rgba(0, 245, 212, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 35% 30% at 60% 20%, rgba(255, 107, 203, 0.1) 0%, transparent 70%);
  animation: mesh-shift 18s ease-in-out infinite alternate;
}

@keyframes mesh-shift {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate(3%, -2%) rotate(2deg) scale(1.04); }
  100% { transform: translate(-2%, 3%) rotate(-1deg) scale(1.02); }
}

/* Aurora */
.aurora { position: absolute; inset: 0; }

.aurora__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  mix-blend-mode: screen;
  will-change: transform;
}

.aurora__blob--1 {
  width: 65vw; height: 65vw;
  max-width: 520px; max-height: 520px;
  top: -25%; left: -15%;
  background: radial-gradient(circle, rgba(123, 97, 255, 0.65) 0%, transparent 70%);
  animation: blob-1 14s ease-in-out infinite;
}
.aurora__blob--2 {
  width: 55vw; height: 55vw;
  max-width: 460px; max-height: 460px;
  bottom: -20%; right: -15%;
  background: radial-gradient(circle, rgba(0, 245, 212, 0.55) 0%, transparent 70%);
  animation: blob-2 18s ease-in-out infinite;
}
.aurora__blob--3 {
  width: 40vw; height: 40vw;
  max-width: 340px; max-height: 340px;
  top: 35%; left: 55%;
  background: radial-gradient(circle, rgba(255, 107, 203, 0.4) 0%, transparent 70%);
  animation: blob-3 22s ease-in-out infinite;
}
.aurora__blob--4 {
  width: 30vw; height: 30vw;
  max-width: 260px; max-height: 260px;
  top: 60%; left: 10%;
  background: radial-gradient(circle, rgba(99, 179, 255, 0.35) 0%, transparent 70%);
  animation: blob-4 20s ease-in-out infinite;
}

@keyframes blob-1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.55; }
  25%      { transform: translate(60px, 40px) scale(1.1); opacity: 0.7; }
  50%      { transform: translate(30px, 80px) scale(0.95); opacity: 0.5; }
  75%      { transform: translate(-20px, 30px) scale(1.05); opacity: 0.65; }
}
@keyframes blob-2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  33%      { transform: translate(-50px, -60px) scale(1.12); opacity: 0.65; }
  66%      { transform: translate(-80px, 20px) scale(0.9); opacity: 0.45; }
}
@keyframes blob-3 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.35; }
  40%      { transform: translate(-70px, -40px) scale(1.15); opacity: 0.5; }
  70%      { transform: translate(40px, -60px) scale(0.88); opacity: 0.3; }
}
@keyframes blob-4 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50%      { transform: translate(50px, -50px) scale(1.2); opacity: 0.45; }
}

/* Orbs */
.bg__orbs { position: absolute; inset: 0; overflow: hidden; }

.orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 10px currentColor;
  animation: orb-float linear infinite;
  will-change: transform, opacity;
}
.orb--violet { background: var(--violet); color: var(--violet); }
.orb--pink   { background: var(--pink); color: var(--pink); }
.orb--cyan   { background: var(--cyan); color: var(--cyan); }

@keyframes orb-float {
  0%   { opacity: 0; transform: translateY(0) scale(0); }
  8%   { opacity: 0.6; transform: scale(1); }
  85%  { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(-110vh) scale(0.4); }
}

/* Scan beam */
.bg__scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 245, 212, 0.025) 48%,
    rgba(123, 97, 255, 0.04) 50%,
    rgba(0, 245, 212, 0.025) 52%,
    transparent 100%
  );
  background-size: 100% 200%;
  animation: scan 10s ease-in-out infinite;
}
@keyframes scan {
  0%   { background-position: 0 -100%; }
  100% { background-position: 0 200%; }
}

/* Scanlines overlay */
.bg__scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  animation: noise-shift 0.5s steps(2) infinite;
}
@keyframes noise-shift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-2%, -2%); }
}

/* ── HUD corners ── */
.hud {
  position: absolute;
  width: 32px;
  height: 32px;
}
.hud--tl { top: 16px; left: 16px; border-top: 1px solid rgba(0,245,212,0.3); border-left: 1px solid rgba(0,245,212,0.3); }
.hud--tr { top: 16px; right: 16px; border-top: 1px solid rgba(123,97,255,0.3); border-right: 1px solid rgba(123,97,255,0.3); }
.hud--bl { bottom: 16px; left: 16px; border-bottom: 1px solid rgba(0,245,212,0.3); border-left: 1px solid rgba(0,245,212,0.3); }
.hud--br { bottom: 16px; right: 16px; border-bottom: 1px solid rgba(123,97,255,0.3); border-right: 1px solid rgba(123,97,255,0.3); }

.hud__dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.7;
}
.hud--tl .hud__dot { top: -2px; left: -2px; }
.hud--tr .hud__dot { top: -2px; right: -2px; background: var(--violet); }
.hud--bl .hud__dot { bottom: -2px; left: -2px; }
.hud--br .hud__dot { bottom: -2px; right: -2px; background: var(--violet); }

/* ── Status bar ── */
.status-bar {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  white-space: nowrap;
}
.status-bar__sep { color: rgba(123,97,255,0.4); }
.status-bar__item--blink {
  color: var(--cyan);
  opacity: 0.8;
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 0.8; }
  50%       { opacity: 0.3; }
}

/* ── Layout ── */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding:
    calc(40px + var(--safe-top))
    calc(20px + var(--safe-right))
    calc(32px + var(--safe-bottom))
    calc(20px + var(--safe-left));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

/* ── Hero ── */
.hero { text-align: center; }

/* Logo ring animation */
.logo-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
}

.logo-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
}
.logo-ring--outer {
  inset: -8px;
  border-color: rgba(0,245,212,0.15);
  animation: spin-slow 12s linear infinite;
}
.logo-ring--outer::before {
  content: '';
  position: absolute;
  top: -2px; left: 30%;
  width: 10px; height: 3px;
  background: var(--cyan);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--cyan);
}
.logo-ring--inner {
  inset: -3px;
  border-color: rgba(123,97,255,0.2);
  animation: spin-slow 8s linear infinite reverse;
}
.logo-ring--inner::before {
  content: '';
  position: absolute;
  bottom: -2px; right: 25%;
  width: 6px; height: 3px;
  background: var(--violet);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--violet);
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

.logo {
  position: absolute;
  inset: 0;
  color: var(--cyan);
  filter: drop-shadow(0 0 20px rgba(0, 245, 212, 0.3));
}
.logo svg { width: 100%; height: 100%; }

/* Badge */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 100px;
  padding: 5px 12px;
  margin-bottom: 14px;
}
.hero__badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation: blink 2s ease-in-out infinite;
}

/* Rainbow animated title */
.hero__title {
  font-family: var(--display);
  font-size: clamp(1.85rem, 8vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
  position: relative;
  background: linear-gradient(
    90deg,
    #00f5d4,
    #7b61ff,
    #ff6bcb,
    #ff3cac,
    #ffdd00,
    #00f5d4,
    #00c3ff,
    #7b61ff,
    #ff6bcb,
    #00f5d4
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: title-rainbow 6s linear infinite;
}
.hero__title::before,
.hero__title::after { display: none; }

@keyframes title-rainbow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.hero__sub {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.hero__sub-prefix { color: var(--cyan); opacity: 0.6; }

.hero__desc {
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.5;
  max-width: 280px;
  margin: 0 auto;
}

/* ── Links ── */
.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 16px 0 6px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

/* Left accent bar */
.link__accent {
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity 0.25s ease, height 0.25s ease;
}
.link--vk .link__accent  { background: var(--vk); }
.link--tg .link__accent  { background: var(--tg); }
.link--ig .link__accent  { background: var(--ig); }
.link--yt .link__accent  { background: var(--yt); }
.link--max .link__accent { background: var(--max); }

/* Shimmer on hover */
.link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.03) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
  pointer-events: none;
}

.link:active {
  background: var(--glass-active);
  transform: scale(0.975);
}

.link__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease;
}
.link__icon svg { width: 20px; height: 20px; }

.link--vk .link__icon  { background: rgba(81, 129, 184, 0.12); color: var(--vk); }
.link--tg .link__icon  { background: rgba(41, 169, 235, 0.12); color: var(--tg); }
.link--ig .link__icon  { background: rgba(228, 64, 95, 0.12); color: var(--ig); }
.link--yt .link__icon  { background: rgba(255, 0, 51, 0.1); color: var(--yt); }
.link--max .link__icon { background: rgba(255, 98, 0, 0.12); color: var(--max); }

.link__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  z-index: 1;
}
.link__name {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  line-height: 1;
}
.link__label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.link__arrow {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  opacity: 0.4;
  transition: transform 0.2s ease, opacity 0.2s ease;
  position: relative;
  z-index: 1;
}

/* ── Footer ── */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.footer__sep { opacity: 0.3; }
.footer__text { color: var(--text-dim); opacity: 0.7; }

/* ── Small phones ── */
@media (max-width: 360px) {
  .container {
    padding-left: calc(16px + var(--safe-left));
    padding-right: calc(16px + var(--safe-right));
    gap: 24px;
  }
  .logo-wrap { width: 96px; height: 96px; }
  .link { min-height: 54px; padding-right: 12px; }
}

/* ── Tablets ── */
@media (min-width: 600px) {
  .container { max-width: 420px; gap: 40px; }
  .logo-wrap { width: 130px; height: 130px; }
  .links { gap: 10px; }
  .link { min-height: 64px; }
}

/* ── Desktop hover ── */
@media (hover: hover) and (pointer: fine) {
  .link:hover {
    background: var(--glass-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
  .link:hover .link__accent { opacity: 1; }
  .link:hover::before { transform: translateX(100%); }
  .link:active { transform: translateY(0); box-shadow: none; }
  .link:hover .link__arrow { transform: translateX(4px); opacity: 0.8; }
  .link:hover .link__icon { transform: scale(1.06); }

  .link--vk:hover { box-shadow: 0 8px 32px rgba(81,129,184,0.12), 0 0 0 1px rgba(81,129,184,0.1); }
  .link--tg:hover { box-shadow: 0 8px 32px rgba(41,169,235,0.12), 0 0 0 1px rgba(41,169,235,0.1); }
  .link--ig:hover { box-shadow: 0 8px 32px rgba(228,64,95,0.12), 0 0 0 1px rgba(228,64,95,0.1); }
  .link--yt:hover { box-shadow: 0 8px 32px rgba(255,0,51,0.1), 0 0 0 1px rgba(255,0,51,0.08); }
  .link--max:hover { box-shadow: 0 8px 32px rgba(255,98,0,0.12), 0 0 0 1px rgba(255,98,0,0.1); }
}

/* ── Desktop card ── */
@media (min-width: 900px) {
  body { display: flex; align-items: center; justify-content: center; }

  .container {
    max-width: 400px;
    min-height: auto;
    margin: 48px auto;
    padding: 48px 28px;
    background: rgba(255, 255, 255, 0.018);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 24px;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.025) inset,
      0 40px 100px rgba(0, 0, 0, 0.6),
      0 0 80px rgba(123, 97, 255, 0.04);
  }

  .hud--tl, .hud--tr, .hud--bl, .hud--br { display: none; }
  .status-bar { display: none; }
}

/* ── Landscape ── */
@media (max-height: 500px) and (orientation: landscape) {
  .container { gap: 16px; justify-content: flex-start; padding-top: calc(16px + var(--safe-top)); padding-bottom: calc(16px + var(--safe-bottom)); }
  .logo-wrap { width: 64px; height: 64px; margin-bottom: 10px; }
  .hero__title { font-size: 1.5rem; }
  .hero__desc { display: none; }
}

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .bg__orbs, .bg__scan { display: none; }
}
