/* ncard.fun — лендинг-агрегатор сервисов */

:root {
  --bg: #050506;
  --ink: #f5f5f7;
  --ink-2: #a6a6ae;
  --ink-3: #71717a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --lime: #b8f45c;
  --violet: #a98bff;
  --teal: #5ce1c2;
  --radius: 34px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(184, 244, 92, 0.28);
  color: #fff;
}

a {
  color: inherit;
}

/* ── Фон: аврора + зерно ─────────────────────────────── */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.bg__blob--lime {
  width: 780px;
  height: 780px;
  left: -220px;
  top: -300px;
  background: radial-gradient(circle, rgba(184, 244, 92, 0.2), rgba(184, 244, 92, 0) 66%);
  animation: drift-a 30s var(--ease) infinite alternate;
}

.bg__blob--violet {
  width: 860px;
  height: 860px;
  right: -300px;
  top: -180px;
  background: radial-gradient(circle, rgba(169, 139, 255, 0.18), rgba(169, 139, 255, 0) 66%);
  animation: drift-b 38s var(--ease) infinite alternate;
}

.bg__blob--teal {
  width: 680px;
  height: 680px;
  left: 26%;
  bottom: -460px;
  background: radial-gradient(circle, rgba(92, 225, 194, 0.12), rgba(92, 225, 194, 0) 66%);
  animation: drift-c 44s var(--ease) infinite alternate;
}

.bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

@keyframes drift-a {
  to {
    transform: translate3d(70px, 50px, 0) scale(1.1);
  }
}

@keyframes drift-b {
  to {
    transform: translate3d(-60px, 70px, 0) scale(1.06);
  }
}

@keyframes drift-c {
  to {
    transform: translate3d(50px, -70px, 0) scale(1.12);
  }
}

/* ── Шапка ───────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 clamp(18px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(5, 5, 6, 0.86), rgba(5, 5, 6, 0.5));
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.mark {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  width: 30px;
  height: 30px;
  padding: 7px 6.5px;
  border-radius: 9px;
  background: linear-gradient(155deg, #e6ffab, var(--lime) 55%, #7fd94f);
  box-shadow: 0 4px 14px -6px rgba(184, 244, 92, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.mark i {
  flex: 1;
  border-radius: 2px;
  background: #0a0c07;
  height: 40%;
}

.mark i:nth-child(2) {
  height: 92%;
}

.mark i:nth-child(3) {
  height: 64%;
}

.mark i:nth-child(4) {
  height: 30%;
}

.nav__count {
  margin-left: auto;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  color: var(--ink-3);
}

/* ── Контент ─────────────────────────────────────────── */

.page {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 32px);
}

.hero {
  padding: clamp(64px, 10vh, 118px) 0 0;
  text-align: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.44);
}

.hero__eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px 1px rgba(184, 244, 92, 0.9);
}

.hero__title {
  margin: 20px 0 0;
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
  color: #fbfbfd;
}

.hero__title span {
  background: linear-gradient(96deg, #f4ffe0 8%, #d9ffa8 46%, var(--lime) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__sub {
  max-width: 56ch;
  margin: 22px auto 0;
  font-size: clamp(15px, 1.65vw, 18px);
  line-height: 1.6;
  color: var(--ink-2);
}

/* ── Плитки сервисов ─────────────────────────────────── */

.services {
  display: grid;
  gap: 20px;
  margin: clamp(48px, 8vh, 84px) 0 0;
}

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008) 70%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    transform 0.7s var(--ease),
    border-color 0.5s ease,
    box-shadow 0.7s var(--ease);
}

.tile:hover {
  transform: translateY(-6px);
  border-color: var(--line-2);
  box-shadow: 0 60px 110px -55px rgba(0, 0, 0, 1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tile:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}

.tile__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(60% 50% at 50% 0%, rgba(184, 244, 92, 0.16), rgba(184, 244, 92, 0) 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.tile:hover .tile__glow {
  opacity: 1;
}

.tile__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.tile__icon {
  display: flex;
  align-items: flex-end;
  gap: 3.5px;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 11px 9.5px;
  border-radius: 13px;
  background: linear-gradient(155deg, #e6ffab, var(--lime) 55%, #7fd94f);
  box-shadow: 0 8px 22px -10px rgba(184, 244, 92, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.tile__icon i {
  flex: 1;
  border-radius: 2px;
  background: #0a0c07;
  height: 34%;
}

.tile__icon i:nth-child(2) {
  height: 90%;
}

.tile__icon i:nth-child(3) {
  height: 62%;
}

.tile__icon i:nth-child(4) {
  height: 28%;
}

.tile__titles {
  min-width: 0;
}

.tile__titles h2 {
  margin: 0;
  font-size: clamp(19px, 2vw, 22px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tile__titles p {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tile__go {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.75);
  transition:
    background 0.4s var(--ease),
    border-color 0.4s ease,
    color 0.4s ease,
    transform 0.5s var(--spring, cubic-bezier(0.34, 1.56, 0.64, 1));
}

.tile__go svg {
  transition: transform 0.45s var(--ease);
}

.tile:hover .tile__go {
  background: var(--lime);
  border-color: transparent;
  color: #0a0c07;
  transform: scale(1.05);
}

.tile:hover .tile__go svg {
  transform: translate(1px, -1px);
}

.tile__preview {
  position: relative;
  aspect-ratio: 16 / 10;
  margin-top: clamp(14px, 2vw, 20px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: calc(var(--radius) - 12px);
  background: #0b0b0e;
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
}

.tile__shot {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: saturate(1.02);
  transition: transform 1.6s var(--ease);
}

/* вторая картинка плавно проявляется и уходит — «живое» превью сайта */
.tile__shot--alt {
  z-index: 1;
  animation: crossfade 18s ease-in-out 2s infinite both;
}

.tile:hover .tile__shot {
  transform: scale(1.025);
}

@keyframes crossfade {
  0%,
  42% {
    opacity: 0;
  }
  52%,
  86% {
    opacity: 1;
  }
  96%,
  100% {
    opacity: 0;
  }
}

.tile__chip {
  position: absolute;
  z-index: 2;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(10, 10, 13, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.8);
}

.tile__chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(184, 244, 92, 0.8);
}

/* ── Подвал ──────────────────────────────────────────── */

.footer {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(28px, 5vh, 48px) clamp(20px, 4vw, 32px);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.32);
}

.footer__sep {
  opacity: 0.5;
}

.footer__year {
  margin-left: auto;
}

/* ── Анимации ────────────────────────────────────────── */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero__eyebrow {
  animation: rise 0.9s var(--ease) 0.05s both;
}

.hero__title {
  animation: rise 0.9s var(--ease) 0.12s both;
}

.hero__sub {
  animation: rise 0.9s var(--ease) 0.2s both;
}

.tile {
  animation: rise 1s var(--ease) 0.3s both;
}

/* ── Мобильные ───────────────────────────────────────── */

@media (max-width: 720px) {
  .nav {
    height: 58px;
  }

  .hero {
    padding-top: 56px;
  }

  .hero__title {
    font-size: clamp(30px, 8.2vw, 44px);
  }

  .hero__sub {
    max-width: 34ch;
    font-size: 15px;
  }

  .tile {
    --radius: 26px;
  }

  .tile__titles p {
    font-size: 12px;
  }

  .tile__go {
    width: 36px;
    height: 36px;
  }

  .tile__chip {
    left: 10px;
    bottom: 10px;
    font-size: 10.5px;
  }
}

@media (max-width: 420px) {
  .nav__count {
    display: none;
  }

  .tile__titles h2 {
    font-size: 18px;
  }
}

/* ── Меньше движения ─────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }

  .tile__shot--alt {
    display: none;
  }
}
