:root {
  --bg: #FBFBFA;
  --card: #FFFFFF;
  --dark: #111111;
  --yellow: #F5C518;
  --yellow-hover: #FFD84D;
  --yellow-active: #E0B300;
  --yellow-glow: rgba(245, 197, 24, 0.45);
  --gray: #666666;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.12);
  --radius-card: 24px;
  --radius-icon: 20px;
  --radius-pill: 50px;
  --transition: 200ms ease;
  --focus-ring: 0 0 0 3px rgba(245, 197, 24, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html, body {
  min-height: 100%;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  /* Едва заметный gradient-mesh: три мягких пятна, суммарно не выше 7% альфы —
     даёт глубину, но не спорит с контентом и не мешает читаемости текста. */
  background-image:
    radial-gradient(circle at 12% 16%, rgba(245, 197, 24, 0.07), transparent 42%),
    radial-gradient(circle at 88% 6%, rgba(110, 130, 245, 0.05), transparent 40%),
    radial-gradient(circle at 74% 94%, rgba(245, 197, 24, 0.05), transparent 45%);
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.page {
  width: 100%;
  max-width: 520px;
  background: transparent;   /* меш с body должен просвечивать */
  padding: 20px 0;
}

@media (min-width: 600px) {
  body {
    background-color: #EFEFED;
  }
  .page {
    background: var(--card);
    padding: 40px 32px;
    border-radius: 28px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  }
}

/* Logo */
.logo {
  text-align: center;
  margin-bottom: 24px;
}

.logo__link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  transition: transform var(--transition);
  animation: logoFloat 4s ease-in-out infinite;
}

.logo__link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.logo__img {
  width: 84px;
  height: auto;
  /* портрет кадрирован по лицу из середины снимка — там серый фон студии,
     поэтому показываем круглым, как и был исходный кадр */
  border-radius: 50%;
  margin-bottom: 10px;
  display: block;
}

.logo__text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--dark);
}

/* Title */
.title {
  font-family: 'Montserrat', 'Manrope', sans-serif;
  font-size: clamp(30px, 9.5vw, 48px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 24px;
  /* страховка: длинное неразрывное слово скорее перенесётся, чем вылезет за экран */
  overflow-wrap: break-word;
}

.title__black {
  color: var(--dark);
}

.title__yellow {
  color: var(--yellow);
  display: inline-block;
  animation: titlePulse 3s ease-in-out infinite;
}

/* Подзаголовок: объясняем человеку, куда он попал */
.lead {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray);
  line-height: 1.55;
  text-align: center;
  margin: -8px 0 24px;
  animation: fadeInUp 0.8s ease-out 0.25s backwards;
}

.lead strong {
  color: var(--dark);
  font-weight: 800;
}

/* Cards */
.channels {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.channel-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  animation: cardEnter 0.6s ease-out backwards;
}

.channel-card:nth-child(1) { animation-delay: 0.1s; }
.channel-card:nth-child(2) { animation-delay: 0.25s; }
.channel-card:nth-child(3) { animation-delay: 0.4s; }

.channel-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  box-shadow: 0 0 0 0 var(--yellow-glow);
  opacity: 0;
  transition: opacity var(--transition), box-shadow 0.4s ease;
  pointer-events: none;
}

.channel-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-hover);
}

.channel-card:hover::before {
  opacity: 1;
  box-shadow: 0 0 24px 4px var(--yellow-glow);
}

.channel-card:active {
  transform: scale(0.985);
}

.channel-card:focus-visible {
  outline: none;
  box-shadow: var(--shadow-hover), var(--focus-ring);
}

.channel-card__icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: var(--radius-icon);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.channel-card:hover .channel-card__icon {
  transform: scale(1.08) rotate(-3deg);
}

.channel-card__icon img,
.channel-card__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.channel-card__info {
  flex: 1;
  min-width: 0;
}

.channel-card__name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  margin-bottom: 4px;
  line-height: 1.2;
  color: var(--dark);
}

.channel-card__desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray);
  line-height: 1.35;
}

.channel-card__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
  background: var(--yellow);
  color: var(--dark);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(245, 197, 24, 0.35);
  animation: btnPulse 2.5s ease-in-out infinite;
  /* для ripple: круг растёт внутри пилюли и обрезается по её форме */
  position: relative;
  overflow: hidden;
}

/* Ripple по нажатию. Карточка целиком — ссылка, поэтому ловим :active на ней;
   сама кнопка с pointer-events: none и событий не получает. */
.channel-card__btn::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.channel-card:active .channel-card__btn::after {
  animation: ripple 0.55s ease-out;
}

.channel-card:hover .channel-card__btn {
  background: var(--yellow-hover);
  transform: scale(1.05);
  box-shadow: 0 6px 22px rgba(245, 197, 24, 0.55);
}

.channel-card:active .channel-card__btn {
  background: var(--yellow-active);
  transform: scale(0.98);
}

/* Footer */
.footer {
  text-align: center;
}

.footer__text {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray);
  line-height: 1.5;
  animation: fadeInUp 0.8s ease-out 0.5s backwards;
}

/* Mini-footer: кто мы, контакты, документы */
.legal {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
  animation: fadeInUp 0.8s ease-out 0.65s backwards;
}

.legal p {
  margin: 0 0 8px;
}

.legal p:last-child {
  margin-bottom: 0;
}

.legal__intro {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray);
  line-height: 1.5;
}

.legal__contacts,
.legal__docs {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  line-height: 1.5;
}

.legal__req {
  font-size: 11px;
  font-weight: 500;
  color: #999999;
  line-height: 1.5;
}

.legal__dot {
  margin: 0 6px;
  color: #BBBBBB;
}

.legal__link {
  color: var(--dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 2px;
  border-radius: 4px;
  transition: color var(--transition);
}

.legal__link:hover {
  color: var(--yellow-active);
}

.legal__link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Animations */
@keyframes logoFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.03); }
}

@keyframes titlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(245, 197, 24, 0.35); }
  50% { box-shadow: 0 4px 22px rgba(245, 197, 24, 0.6); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Параллакс по гироскопу -------------------------------------------
   JS пишет два числа (--tilt-x / --tilt-y, диапазон -1..1) в <html>, а сдвиг
   каждого слоя считает CSS со своим множителем — получается разная глубина.
   Используем ОТДЕЛЬНОЕ свойство translate, а не transform: на .logo__link,
   .title__yellow и .channel-card уже висят свои animation/hover по transform,
   и параллакс бы их перебивал. translate применяется до transform и
   складывается с ним, поэтому конфликта нет.
   Без JS (нет датчика, отказ в разрешении) переменные не заданы — fallback 0,
   слои стоят на своих местах, вёрстка не меняется. */
.logo,
.title,
.channels {
  transition: translate 0.3s ease-out;
}

.logo {
  translate: calc(var(--tilt-x, 0) * 13px) calc(var(--tilt-y, 0) * 13px);
}

.title {
  translate: calc(var(--tilt-x, 0) * 8px) calc(var(--tilt-y, 0) * 8px);
}

.channels {
  translate: calc(var(--tilt-x, 0) * 5px) calc(var(--tilt-y, 0) * 5px);
}

/* Системная настройка «меньше движения»: JS параллакс и не включает,
   но если её переключили на ходу — гасим сдвиг и здесь. */
@media (prefers-reduced-motion: reduce) {
  .logo,
  .title,
  .channels {
    translate: none;
  }
}

@keyframes ripple {
  from { transform: translate(-50%, -50%) scale(0); opacity: 0.8; }
  to   { transform: translate(-50%, -50%) scale(26); opacity: 0; }
}

/* Medium-small screens */
@media (max-width: 430px) {
  .channel-card {
    padding: 16px;
    gap: 12px;
  }
  .channel-card__btn {
    padding: 10px 14px;
  }
}

/* Small screens */
@media (max-width: 359px) {
  body {
    padding: 16px;
  }
  .page {
    padding: 16px 0;
  }
  .title {
    font-size: 32px;
    margin-bottom: 20px;
  }
  .channel-card__name {
    font-size: 14px;
  }
  .channel-card__desc {
    font-size: 12px;
  }
  .channel-card__btn {
    padding: 10px 14px;
    font-size: 11px;
  }
  .channel-card__icon {
    width: 64px;
    height: 64px;
  }
}
