/* Примерка профессий со Skillbox — каталог.
   Токены и правила: style-pack (TOKENS.json / STYLE_RULES.md). */

@font-face {
  font-family: 'Graphik';
  src: url('fonts/Graphik-Regular-Web.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Graphik';
  src: url('fonts/Graphik-Semibold-Web.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Graphik';
  src: url('fonts/Graphik-Bold-Web.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FFFFFF;
  --surface: #F5F5F5;
  --text: #000000;
  --text-on-dark: #FFFFFF;
  --primary: #3D3BFF;
  --primary-hover: #302EE6;
  --accent-lime: #D8FF28;
  --accent-pink: #F7C8FF;
  --accent-mint: #B8E8B6;

  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;
  --sp-3xl: 72px;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-pill: 999px;

  --motion: 220ms cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1160px;
}

* { box-sizing: border-box; }

/* Убираем задержку тапа: чистый выигрыш по отклику, вид не меняет. */
a, .btn { touch-action: manipulation; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Graphik', 'Segoe UI', sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

/* ── Buttons ────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r-pill);
  padding: var(--sp-sm) var(--sp-lg);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--motion), transform var(--motion);
}

.btn--primary {
  background: var(--primary);
  color: var(--text-on-dark);
}

.btn--light {
  background: var(--bg);
  color: var(--primary);
}

.btn--lg {
  padding: var(--sp-md) var(--sp-xl);
  font-size: 18px;
}

/* ── Первый экран: заголовок, под ним сразу профессии ── */

/* Синий фон с орбами и 3D-объектом. Высота по контенту, не 100svh:
   карточки должны попадать в первый экран. Низ с запасом —
   на него наезжает сетка (см. .catalog). */
.hero {
  --hero-overlap: 120px;
  position: relative;
  background: var(--primary);
  color: var(--text-on-dark);
  overflow: hidden;
  isolation: isolate;
  /* запас под наезд сетки + воздух между подзаголовком и карточками */
  padding-bottom: calc(var(--hero-overlap) + var(--sp-2xl));
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

/* Мягкие пятна: сама радиальная заливка уже даёт размытие,
   поэтому без filter: blur — иначе слой тяжёлый и подтормаживает. */
.orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: 0.75;
  will-change: transform;
}

.orb--1 {
  width: 46vmax; height: 46vmax;
  top: -18vmax; left: -10vmax;
  background: radial-gradient(circle at 35% 35%, #8F8DFF, #3D3BFF 60%, transparent 72%);
  animation: drift-1 22s ease-in-out infinite;
}

.orb--2 {
  width: 38vmax; height: 38vmax;
  right: -10vmax; top: -6vmax;
  background: radial-gradient(circle at 60% 40%, var(--accent-pink), #6A5BFF 55%, transparent 70%);
  animation: drift-2 27s ease-in-out infinite;
}

.orb--3 {
  width: 34vmax; height: 34vmax;
  left: 30%; bottom: -20vmax;
  background: radial-gradient(circle at 50% 50%, var(--accent-mint), #3D3BFF 58%, transparent 72%);
  animation: drift-3 31s ease-in-out infinite;
}

@keyframes drift-1 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(8vmax, 6vmax, 0) scale(1.12); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
  50%      { transform: translate3d(-9vmax, 8vmax, 0) scale(0.92); }
}
@keyframes drift-3 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.95); }
  50%      { transform: translate3d(6vmax, -7vmax, 0) scale(1.15); }
}

/* 3D-объект из библиотеки Skillbox Elements: справа от заголовка,
   частично уходит под сетку карточек */
.figure {
  position: absolute;
  z-index: -1;
  top: 6%;
  right: max(2%, calc((100% - var(--container)) / 2 - 4vw));
  width: clamp(220px, 26vw, 400px);
  pointer-events: none;
  will-change: transform;
  opacity: 0;
  animation:
    figure-in 1100ms cubic-bezier(0.22, 1, 0.36, 1) 320ms forwards,
    float 11s ease-in-out 1400ms infinite;
}

@keyframes figure-in {
  from { opacity: 0; transform: translateY(40px) scale(0.86); filter: blur(10px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-3.5deg); }
  50%      { transform: translate3d(0, -26px, 0) rotate(3.5deg); }
}

.hero__inner {
  position: relative;
  padding-top: var(--sp-xl);
}

.hero__logo { display: inline-block; margin-bottom: var(--sp-2xl); }
.hero__logo img { height: 22px; width: auto; }

.hero__title {
  margin: 0;
  font-size: clamp(40px, 6.2vw, 84px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.98;
  max-width: 13ch;
}

.word {
  display: block;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(0.32em);
  animation: reveal 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.word:nth-child(1) { animation-delay: 120ms; }
.word:nth-child(2) { animation-delay: 260ms; }
.word:nth-child(3) { animation-delay: 400ms; }

@keyframes reveal {
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

.hero__subtitle {
  margin: var(--sp-lg) 0 0;
  max-width: 34ch;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.35;
  opacity: 0;
  animation: reveal 700ms cubic-bezier(0.22, 1, 0.36, 1) 560ms forwards;
}

/* ── Экран 2: профессии ─────────────────────────────── */

.catalog {
  position: relative;
  z-index: 1;
  margin-top: -120px;
  padding-bottom: var(--sp-3xl);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-lg);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--sp-md) var(--sp-md) var(--sp-lg);
  color: var(--text);
  text-decoration: none;
  transition: transform var(--motion);
}

.card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.card__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__3d {
  position: relative;
  width: 62%;
  max-height: 78%;
  object-fit: contain;
  will-change: transform;
  animation: float-card 7s ease-in-out infinite;
}

/* объекты качаются вразнобой */
.card:nth-child(2) .card__3d { animation-duration: 8.2s; animation-delay: -1.4s; }
.card:nth-child(3) .card__3d { animation-duration: 6.4s; animation-delay: -3.1s; }
.card:nth-child(4) .card__3d { animation-duration: 9s;   animation-delay: -0.7s; }
.card:nth-child(5) .card__3d { animation-duration: 7.6s; animation-delay: -4.2s; }
.card:nth-child(6) .card__3d { animation-duration: 8.8s; animation-delay: -2.3s; }
.card:nth-child(7) .card__3d { animation-duration: 6.9s; animation-delay: -5.5s; }

@keyframes float-card {
  0%, 100% { transform: translate3d(0, 4px, 0) rotate(-2.5deg) scale(1); }
  50%      { transform: translate3d(0, -12px, 0) rotate(2.5deg) scale(1.02); }
}

/* Направление: чип слева сверху на картинке */
.card__tag {
  position: absolute;
  z-index: 1;
  top: var(--sp-sm);
  left: var(--sp-sm);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-radius: var(--r-pill);
  padding: 6px var(--sp-sm);
  font-size: 14px;
  font-weight: 600;
}

.card__badge {
  position: absolute;
  z-index: 1;
  top: var(--sp-sm);
  right: var(--sp-sm);
  background: var(--accent-lime);
  color: var(--text);
  border-radius: var(--r-pill);
  padding: 6px var(--sp-sm);
  font-size: 14px;
  font-weight: 600;
}

.card__body {
  display: block;
  padding: var(--sp-lg) var(--sp-xs) 0;
  flex: 1;
}

.card__title {
  display: block;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* Короткий слоган «кто это» */
.card__tagline {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.card__desc {
  display: block;
  margin-top: var(--sp-sm);
  font-size: 16px;
  font-weight: 400;
}

.card__go {
  display: block;
  padding: var(--sp-lg) var(--sp-xs) 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.card__arrow {
  display: inline-block;
  transition: transform var(--motion);
}

/* ── Экран 3: баннер ────────────────────────────────── */

.banner {
  background-image: url('assets/gradients/06_Gradient.png');
  background-size: cover;
  background-position: center;
  padding: var(--sp-3xl) 0;
}

.banner__title {
  margin: 0 0 var(--sp-xl);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-on-dark);
}

.banner__offers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-lg);
}

.offer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  color: var(--text);
  text-decoration: none;
  transition: transform var(--motion);
}

.offer__body { display: block; }

.offer__title {
  display: block;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.offer__desc {
  display: block;
  margin-top: var(--sp-sm);
  font-size: 18px;
  font-weight: 400;
}

.offer__go {
  display: block;
  margin-top: var(--sp-xl);
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

/* ── Ввод: мышь или палец ───────────────────────────── */

/* Наведение есть только там, где есть курсор. На сенсорной панели
   эти правила не применяются — иначе состояние залипает после тапа. */
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--primary-hover); }
  .btn--light:hover { transform: translateY(-2px); }
  .card:hover { transform: translateY(-4px); }
  .offer:hover { transform: translateY(-4px); }

  /* объект выходит вперёд и замирает */
  .card:hover .card__3d {
    animation-play-state: paused;
    transform: translate3d(0, -10px, 0) rotate(0deg) scale(1.12);
    transition: transform var(--motion);
  }

  .card:hover .card__arrow,
  .offer:hover .card__arrow { transform: translateX(4px); }
}

/* Отдача на нажатие: палец должен видеть, что тап засчитан.
   Наведения на панели нет, поэтому это единственный отклик. */
.card:active,
.offer:active { transform: scale(0.98); }
.btn:active { transform: scale(0.96); }

.card:active .card__3d {
  animation-play-state: paused;
  transform: translate3d(0, -10px, 0) rotate(0deg) scale(1.12);
  transition: transform var(--motion);
}

/* ── Adaptive ───────────────────────────────────────── */

/* Сенсорная панель на мероприятии: Full HD 1920x1080, горизонтальная.
   Включается классом is-panel (см. app.js), а не шириной окна — иначе
   обычный десктопный монитор 1920 получил бы киоск-вёрстку.
   Смотрят с расстояния вытянутой руки и тыкают пальцем: шире контейнер,
   крупнее текст, заметно больше цели нажатия. */
html.is-panel { --container: 1600px; }

/* Киоск: без серой вспышки по тапу, без выделения текста длинным
   нажатием и без оттягивания страницы за край. */
html.is-panel body { overscroll-behavior: none; }
html.is-panel a,
html.is-panel .btn {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

html.is-panel body { font-size: 20px; }

html.is-panel .btn { font-size: 20px; min-height: 64px; padding: var(--sp-md) var(--sp-xl); }
html.is-panel .btn--lg { font-size: 24px; min-height: 76px; padding: var(--sp-lg) 44px; }

html.is-panel .hero__logo img { height: 30px; }
html.is-panel .hero__logo { margin-bottom: var(--sp-lg); }
html.is-panel .hero__title { font-size: 64px; }
html.is-panel .hero__subtitle { font-size: 24px; }
html.is-panel .catalog { padding-bottom: var(--sp-md); }

/* 7 карточек в 4 колонки: оба ряда попадают в 1080 по высоте,
   листать почти не приходится */
html.is-panel .grid { grid-template-columns: repeat(4, 1fr); gap: var(--sp-lg); }

html.is-panel .card { padding: var(--sp-md) var(--sp-md) var(--sp-md); }
html.is-panel .card__media { aspect-ratio: 16 / 9; }
html.is-panel .card__title { font-size: 26px; }
html.is-panel .card__tagline { font-size: 20px; }
html.is-panel .card__desc { font-size: 18px; }
html.is-panel .card__go { font-size: 18px; padding-top: var(--sp-md); }

html.is-panel .banner__title { font-size: 52px; }
html.is-panel .offer { padding: var(--sp-2xl); }
html.is-panel .offer__title { font-size: 34px; }
html.is-panel .offer__desc { font-size: 20px; }
html.is-panel .offer__go { font-size: 18px; }

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .figure { width: clamp(180px, 24vw, 260px); right: -2%; top: 4%; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .container { padding: 0 var(--sp-md); }

  .hero { --hero-overlap: 72px; }
  .hero__inner { padding-top: var(--sp-lg); }
  .hero__logo { margin-bottom: var(--sp-xl); }
  .hero__title { font-size: clamp(38px, 11vw, 64px); max-width: 11ch; }
  .hero__subtitle { font-size: 17px; margin-top: var(--sp-md); }
  /* объект в правом верхнем углу, на уровне логотипа, чтобы не залезать на заголовок */
  .figure { width: 44vw; right: -10vw; top: 4px; }

  .catalog { margin-top: -72px; padding-bottom: var(--sp-2xl); }
  .banner__title { font-size: 28px; margin-bottom: var(--sp-lg); }
  .grid { grid-template-columns: 1fr; gap: var(--sp-md); }
  .card__title { font-size: 20px; }
  .banner { padding: var(--sp-2xl) 0; }
  .banner__offers { grid-template-columns: 1fr; gap: var(--sp-md); }
  .offer { padding: var(--sp-lg); }
  .offer__title { font-size: 22px; }
  .offer__desc { font-size: 16px; }
  .offer__go { margin-top: var(--sp-lg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .word, .hero__subtitle, .figure { opacity: 1; filter: none; transform: none; }
}
