:root {
  --bg: #060708;
  --surface: #0f1012;
  --elevated: #17181c;
  --elevated-2: #1e2026;
  --fg: #ececee;
  --muted: #8b8d93;
  --subtle: #5c5e66;
  --accent: #c4544a;
  --accent-soft: rgb(196 84 74 / 0.14);
  --accent-fg: #fff7f6;
  --ok: #7a9e82;
  --ok-soft: rgb(122 158 130 / 0.14);
  --border: rgb(236 236 238 / 0.09);
  --border-hover: rgb(236 236 238 / 0.16);
  --shadow: 0 0 0 1px var(--border);
  --shadow-hover: 0 0 0 1px var(--border-hover), 0 12px 40px rgb(0 0 0 / 0.35);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

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

::selection {
  background: color-mix(in oklab, var(--accent) 35%, transparent);
}

.surface {
  position: relative;
  min-height: 100dvh;
  overflow-x: hidden;
}

.surface__bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.surface__gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 500px at 50% -10%, rgb(196 84 74 / 0.12), transparent 60%),
    linear-gradient(180deg, rgb(6 7 8 / 0.4) 0%, rgb(6 7 8 / 0.92) 45%, var(--bg) 100%);
}

.surface__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgb(236 236 238 / 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(236 236 238 / 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 15%, black 15%, transparent 70%);
  animation: grid-drift 60s linear infinite;
}

.surface__spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 18%), rgb(196 84 74 / 0.08), transparent 46%);
}

.surface__scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgb(255 255 255 / 0.012) 2px,
    rgb(255 255 255 / 0.012) 4px
  );
  opacity: 0.35;
}

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

.page {
  position: relative;
  z-index: 10;
  margin: 0 auto;
  width: min(100%, 640px);
  min-height: 100dvh;
  padding: 1.25rem 1.25rem 2.5rem;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand__name {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ok);
}

.status-pill--hold { color: var(--accent); }

.status-pill__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

.clock {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgb(196 84 74 / 0.35), 0 0 18px rgb(196 84 74 / 0.28);
  animation: icon-glow 2.8s ease-in-out infinite;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 0;
}

.kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  margin: 0.75rem 0 0;
  font-family: var(--font-mono);
  font-size: clamp(4.5rem, 18vw, 8.5rem);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.07em;
}

.hero__num { color: var(--fg); }
.hero__accent { color: var(--accent); }

.hero__cloud {
  margin: 0.15rem 0 0;
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 5vw, 2.1rem);
  font-weight: 500;
  letter-spacing: 0.34em;
  color: rgb(236 236 238 / 0.9);
}

.hero__tagline {
  margin: 1.5rem 0 0;
  max-width: 28rem;
  font-size: 1rem;
  color: var(--muted);
}

.hero__bio {
  margin: 0.75rem 0 0;
  max-width: 30rem;
  font-size: 0.92rem;
  color: var(--subtle);
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--elevated);
  box-shadow: var(--shadow);
}

.badge--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.telegram-link {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: color 0.15s var(--ease);
}

.telegram-link:hover { color: var(--fg); }

.banner {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--elevated);
  box-shadow: var(--shadow);
  font-size: 0.92rem;
}

.link-board {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  perspective: 900px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 4rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-lg);
  background: rgb(15 16 18 / 0.75);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.link-card:hover {
  transform: translateY(-1px);
  background: var(--elevated);
  box-shadow: var(--shadow-hover);
}

.link-card:active { transform: scale(0.99); }

.link-card__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--elevated-2);
  flex-shrink: 0;
}

.link-card__icon svg { width: 1rem; height: 1rem; }

.link-card__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.link-card__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.link-card__hint {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card__arrow {
  color: var(--subtle);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

.link-card__arrow svg { width: 1rem; height: 1rem; }
.link-card:hover .link-card__arrow {
  color: var(--fg);
  transform: translate(2px, -2px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 2.5rem 0 0;
}

.stat {
  padding: 0.85rem 0.65rem;
  border-radius: var(--radius-md);
  background: rgb(15 16 18 / 0.65);
  box-shadow: var(--shadow);
  text-align: center;
}

.stat dt {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--subtle);
}

.stat dd {
  margin: 0.35rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--subtle);
}

.footer__ops {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.15s var(--ease);
}

.footer__ops:hover { color: var(--fg); }

.footer__forum {
  color: var(--muted);
  transition: color 0.15s var(--ease);
}

.footer__forum:hover { color: var(--fg); }

.page--login {
  width: min(100%, 420px);
  justify-content: center;
}

.login-back {
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.login-card {
  padding: 1.75rem;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-hover);
}

.login-card__head h1 {
  margin: 0.75rem 0 0.35rem;
  font-size: 1.35rem;
}

.login-card__head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.alert {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.alert--error {
  background: var(--accent-soft);
  color: var(--accent-fg);
}

.form { margin-top: 1.25rem; display: grid; gap: 0.85rem; }

.field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--elevated);
  box-shadow: var(--shadow);
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  box-shadow: 0 0 0 1px var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--elevated);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}

.btn:hover { background: var(--elevated-2); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
}

.btn--primary:hover { background: color-mix(in oklab, var(--accent) 88%, white); }

.btn--ghost {
  background: transparent;
  box-shadow: none;
}

.btn--outline {
  background: transparent;
  box-shadow: var(--shadow);
}

.btn--sm {
  min-height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.85rem;
}

.btn--block { width: 100%; }

.stagger > * {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(3px);
  animation: rise-in 0.45s var(--ease) forwards;
}

.stagger > *:nth-child(2) { animation-delay: 0.05s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.15s; }
.stagger > *:nth-child(5) { animation-delay: 0.2s; }
.stagger > *:nth-child(6) { animation-delay: 0.25s; }
.stagger > *:nth-child(7) { animation-delay: 0.3s; }
.stagger > *:nth-child(8) { animation-delay: 0.35s; }

@keyframes rise-in {
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes grid-drift {
  from { transform: translateY(0); }
  to { transform: translateY(56px); }
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  animation: orb-float 18s ease-in-out infinite;
}

.orb--1 {
  width: 280px;
  height: 280px;
  top: -40px;
  left: 8%;
  background: rgb(196 84 74 / 0.28);
}

.orb--2 {
  width: 220px;
  height: 220px;
  right: 6%;
  top: 28%;
  background: rgb(122 158 130 / 0.16);
  animation-delay: -6s;
}

.orb--3 {
  width: 180px;
  height: 180px;
  left: 40%;
  bottom: 8%;
  background: rgb(196 84 74 / 0.12);
  animation-delay: -11s;
}

.particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cursor-glow {
  pointer-events: none;
  position: fixed;
  z-index: 30;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(196 84 74 / 0.16), transparent 68%);
  transform: translate3d(-200px, -200px, 0);
  transition: opacity 0.3s var(--ease);
}

.kicker--scan {
  position: relative;
  overflow: hidden;
}

.kicker--scan::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -20%;
  width: 18%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.35), transparent);
  animation: sweep 3.6s var(--ease) infinite;
}

.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: "911";
  position: absolute;
  inset: 0;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  pointer-events: none;
  opacity: 0.55;
}

.glitch::before {
  color: #7ad4ff;
  animation: glitch-a 3.2s steps(2, end) infinite;
}

.glitch::after {
  color: var(--accent);
  animation: glitch-b 2.6s steps(2, end) infinite;
}

.hero__tagline.is-typing::after {
  content: "▍";
  color: var(--accent);
  animation: blink 0.8s step-end infinite;
}

.banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow: hidden;
}

.banner.is-empty { display: none; }

.banner__pulse {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgb(196 84 74 / 0.5);
  animation: ping 1.8s ease-out infinite;
  flex-shrink: 0;
}

.banner__text { white-space: nowrap; }
.banner--ticker .banner__text { animation: ticker 14s linear infinite; }

.link-board li {
  animation: rise-in 0.55s var(--ease) both;
  animation-delay: calc(0.08s * var(--i, 0) + 0.28s);
}

.link-card {
  position: relative;
  overflow: hidden;
}

.link-card__shine {
  pointer-events: none;
  position: absolute;
  inset: -40% auto -40% -30%;
  width: 28%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.08), transparent);
  transform: translateX(-120%) skewX(-18deg);
}

.link-card:hover .link-card__shine {
  animation: shine 0.7s var(--ease);
}

.link-card__meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.link-card__clicks {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--subtle);
  min-width: 1.5rem;
  text-align: right;
}

.stat {
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.node-row {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.node-row span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--ok);
  animation: node-pulse 1.6s ease-in-out infinite;
}

.node-row span:nth-child(2) { animation-delay: 0.15s; }
.node-row span:nth-child(3) { animation-delay: 0.3s; }
.node-row span:nth-child(4) { animation-delay: 0.45s; }
.node-row span:nth-child(5) { animation-delay: 0.6s; }

.login-card {
  animation: rise-in 0.5s var(--ease);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -20%;
  width: 20%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.06), transparent);
  animation: shine 4s var(--ease) infinite;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
  transform: scale(0);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes icon-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgb(196 84 74 / 0.35), 0 0 12px rgb(196 84 74 / 0.2); }
  50% { box-shadow: 0 0 0 1px rgb(196 84 74 / 0.55), 0 0 22px rgb(196 84 74 / 0.4); }
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, 18px) scale(1.08); }
}

@keyframes sweep {
  0% { transform: translateX(0); }
  100% { transform: translateX(700%); }
}

@keyframes glitch-a {
  0%, 90%, 100% { transform: none; opacity: 0; }
  91% { transform: translate(3px, -1px); opacity: 0.5; }
  93% { transform: translate(-3px, 1px); opacity: 0.4; }
}

@keyframes glitch-b {
  0%, 86%, 100% { transform: none; opacity: 0; }
  87% { transform: translate(-2px, 1px); opacity: 0.45; }
  89% { transform: translate(2px, -1px); opacity: 0.35; }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes ticker {
  0% { transform: translateX(8%); }
  100% { transform: translateX(-100%); }
}

@keyframes shine {
  to { transform: translateX(420%) skewX(-18deg); }
}

@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgb(196 84 74 / 0.45); }
  100% { box-shadow: 0 0 0 10px transparent; }
}

@keyframes node-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes ripple {
  to { transform: scale(8); opacity: 0; }
}

@media (max-width: 480px) {
  .topbar__meta .status-pill { display: none; }
  .cursor-glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cursor-glow, .particles, .orb { display: none; }
}
