@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');
@import url('https://unpkg.com/normalize.css') layer(normalize);

@layer normalize, base, demo, stick, effect, srollbar, debug;

@layer debug {
  [data-debug='true'] li {
    outline: 0.05em dashed currentColor;
  }
  [data-debug='true'] :is(h2, li:last-of-type) {
    outline: 0.05em dashed canvasText;
  }
}

@layer scrollbar {
  @property --hue {
    initial-value: 0;
    syntax: '<number>';
    inherits: false;
  }
  @property --chroma {
    initial-value: 0;
    syntax: '<number>';
    inherits: true;
  }

  [data-sync-scrollbar='true'] {
    scrollbar-color: oklch(var(--lightness) var(--chroma) var(--hue)) #0000;
  }
  @supports (animation-timeline: scroll()) and (animation-range: 0% 100%) {
    [data-sync-scrollbar='true'][data-animate='true'] {
      timeline-scope: --list;
      scrollbar-color: oklch(var(--lightness) var(--chroma, 0) var(--hue)) #0000;
      -webkit-animation-name: change, chroma-on, chroma-off;
              animation-name: change, chroma-on, chroma-off;
      -webkit-animation-fill-mode: both;
              animation-fill-mode: both;
      -webkit-animation-timing-function: linear;
              animation-timing-function: linear;
      /* animation-timeline: scroll(root); */
      animation-range: entry 50% exit 50%, entry 40% entry 50%,
        exit 30% exit 40%;
      animation-timeline: --list;
      ul {
        view-timeline: --list;
      }
    }
  }

  @-webkit-keyframes change {
    to {
      --hue: var(--end);
    }
  }

  @keyframes change {
    to {
      --hue: var(--end);
    }
  }
  @-webkit-keyframes chroma-on {
    to {
      --chroma: 0.3;
    }
  }
  @keyframes chroma-on {
    to {
      --chroma: 0.3;
    }
  }
  @-webkit-keyframes chroma-off {
    to {
      --chroma: 0;
    }
  }
  @keyframes chroma-off {
    to {
      --chroma: 0;
    }
  }
}

@layer effect {
  :root {
    --start: 0;
    --end: 360;
    --lightness: 65%;
    --base-chroma: 0.3;
  }
  [data-theme='dark'] {
    --lightness: 75%;
  }
  [data-theme='light'] {
    --lightness: 65%;
  }
  @media (prefers-color-scheme: dark) {
    --lightness: 75%;
  }
  ul {
    --step: calc((var(--end) - var(--start)) / (var(--count) - 1));
  }
  li:not(:last-of-type) {
    color: oklch(
      var(--lightness) var(--base-chroma)
        calc(var(--start) + (var(--step) * var(--i)))
    );
  }

  @supports (animation-timeline: scroll()) and (animation-range: 0% 100%) {
    [data-animate='true'] {
      li {
        opacity: 0.2;
        -webkit-animation-name: brighten;
                animation-name: brighten;

        &:first-of-type {
          --start-opacity: 1;
        }
        &:last-of-type {
          --brightness: 1;
          --end-opacity: 1;
        }
        -webkit-animation-fill-mode: both;
                animation-fill-mode: both;
        -webkit-animation-timing-function: linear;
                animation-timing-function: linear;
        animation-range: cover calc(50% - 1lh) calc(50% + 1lh);
        animation-timeline: view();
      }
    }

    @-webkit-keyframes brighten {
      0% {
        opacity: var(--start-opacity, 0.2);
      }
      50% {
        opacity: 1;
        filter: brightness(var(--brightness, 1.2));
      }
      100% {
        opacity: var(--end-opacity, 0.2);
      }
    }

    @keyframes brighten {
      0% {
        opacity: var(--start-opacity, 0.2);
      }
      50% {
        opacity: 1;
        filter: brightness(var(--brightness, 1.2));
      }
      100% {
        opacity: var(--end-opacity, 0.2);
      }
    }
  }
}

@layer stick {
  section:first-of-type {
    --font-level: 6;
    display: flex;
    line-height: 1.25;
    width: 100%;
    padding-left: 5rem;
  }
  section:last-of-type {
    min-height: 100vh;
    display: flex;
    place-items: center;
    width: 100%;
    justify-content: center;

    h2 {
      --font-level: 6;
    }
  }
  main {
    width: 100%;
  }
  section:first-of-type h2 {
    position: sticky;
    top: calc(50% - 0.5lh);
    font-size: clamp(0.85em, 2.2vw, 1.1em); /* Уменьшаем размер шрифта заголовка */
    margin: 0;
    display: inline-block;
    height: -webkit-fit-content;
    height: -moz-fit-content;
    height: fit-content;
    font-weight: 600;
  }
  ul {
    font-weight: 600;
    padding-inline: 0;
    margin: 0;
    list-style-type: none;
    font-size: clamp(0.55em, 1.8vw, 0.7em); /* Еще больше уменьшаем размер шрифта */
  }

  /* Увеличиваем межстрочное расстояние для элементов списка справа */
  ul li {
    line-height: 2.2; /* Увеличенное межстрочное расстояние для выравнивания с левым текстом */
    padding-block: 0.3em; /* Дополнительный вертикальный отступ */
  }

  /* Дополнительная адаптивность для маленьких экранов */
  @media (max-width: 768px) {
    ul {
      font-size: 0.55em;
    }
  }

  @media (max-width: 480px) {
    ul {
      font-size: 0.5em;
    }
  }

  [data-snap='true'] {
    -ms-scroll-snap-type: y proximity;
        scroll-snap-type: y proximity;

    li {
      scroll-snap-align: center;
    }
  }

  h2,
  li:last-of-type {
    background: linear-gradient(
      canvasText 50%,
      color-mix(in oklch, canvas, canvasText 25%)
    );
    -webkit-background-clip: text;
            background-clip: text;
    color: #0000;
  }
}

@layer demo {
  header {
    min-height: 100vh;
    display: flex;
    place-items: center;
    width: 100%;
    padding-inline: 5rem;
    padding-left: 7.5rem;
  }

  footer {
    padding-block: 2rem;
    opacity: 0.5;
  }

  h1 {
    --font-size-min: 24;
    --font-level: 6;
    text-wrap: pretty;
    line-height: 1.15;
    margin: 0;
    background: linear-gradient(
      canvasText 60%,
      color-mix(in oklch, canvas, canvasText)
    );
    -webkit-background-clip: text;
            background-clip: text;
    color: #0000;
  }
}

@layer base {
  :root {
    --font-size-min: 14;
    --font-size-max: 20;
    --font-ratio-min: 1.1;
    --font-ratio-max: 1.33;
    --font-width-min: 375;
    --font-width-max: 1500;
  }

  html {
    color-scheme: light dark;
  }

  [data-theme='light'] {
    color-scheme: light only;
  }

  [data-theme='dark'] {
    color-scheme: dark only;
  }

  :where(.fluid) {
    --fluid-min: calc(
      var(--font-size-min) * pow(var(--font-ratio-min), var(--font-level, 0))
    );
    --fluid-max: calc(
      var(--font-size-max) * pow(var(--font-ratio-max), var(--font-level, 0))
    );
    --fluid-preferred: calc(
      (var(--fluid-max) - var(--fluid-min)) /
        (var(--font-width-max) - var(--font-width-min))
    );
    --fluid-type: clamp(
      (var(--fluid-min) / 16) * 1rem,
      ((var(--fluid-min) / 16) * 1rem) -
        (((var(--fluid-preferred) * var(--font-width-min)) / 16) * 1rem) +
        (var(--fluid-preferred) * var(--variable-unit, 100vi)),
      (var(--fluid-max) / 16) * 1rem
    );
    font-size: var(--fluid-type);
  }
    line-height: 1.5;

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

  body {
    display: grid;
    place-items: center;
    background: light-dark(white, black);
    min-height: 100vh;
    font-family: 'Inter', 'SF Pro Text', 'SF Pro Icons', 'AOS Icons',
      'Helvetica Neue', Helvetica, Arial, sans-serif, system-ui;
  }

  body::before {
    --size: 45px;
    --line: color-mix(in hsl, canvasText, transparent 70%);
    content: '';
    height: 100vh;
    width: 100vw;
    position: fixed;
    background: linear-gradient(
          90deg,
          var(--line) 1px,
          transparent 1px var(--size)
        )
        50% 50% / var(--size) var(--size),
      linear-gradient(var(--line) 1px, transparent 1px var(--size)) 50% 50% /
        var(--size) var(--size);
    -webkit-mask: linear-gradient(-20deg, transparent 50%, white);
            mask: linear-gradient(-20deg, transparent 50%, white);
    top: 0;
    transform-style: flat;
    pointer-events: none;
    z-index: -1;
  }

  .bear-link {
    color: canvasText;
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: 48px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    opacity: 0.8;
  }

  :where(.x-link, .bear-link):is(:hover, :focus-visible) {
    opacity: 1;
  }

  .bear-link svg {
    width: 75%;
  }

  /* Utilities */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
  }
}

div.tp-dfwv {
  position: fixed;
}

/* Стили для логотипа RWPLEX */
.bear-link {
  width: 80px;  /* Увеличиваем с 48px до 80px */
  aspect-ratio: 1;
}

.logo-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: brightness(0.9);
  transition: filter 0.3s ease;
}

.bear-link:hover .logo-img,
.bear-link:focus-visible .logo-img {
  filter: brightness(1.1);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .bear-link {
    width: 60px;
  }
}

/* Стили для анимированного заголовка из референса accessible-text-by-duplication */

/* Стиль для слов после разбивки SplitText */


@-webkit-keyframes type {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes type {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@-webkit-keyframes cursor {
  50% {
    border-color: transparent;
  }
}

@keyframes cursor {
  50% {
    border-color: transparent;
  }
}
EOF'


@-webkit-keyframes type {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes type {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@-webkit-keyframes cursor {
  50% {
    border-color: transparent;
  }
}

@keyframes cursor {
  50% {
    border-color: transparent;
  }
}


@-webkit-keyframes type {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes type {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@-webkit-keyframes cursor {
  50% {
    border-color: transparent;
  }
}

@keyframes cursor {
  50% {
    border-color: transparent;
  }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  h1.type {
    font-size: calc(var(--font-size-min, 24) * 1px + (var(--font-level, 6) - var(--font-size-min, 24)) * ((100vw - 320px) / (768 - 320)));
    white-space: normal;
    word-wrap: break-word;
  }
}

/* Typewriter animation with adaptive text wrapping */
h1.type {
  color: #dbd56e;
  background: -webkit-linear-gradient(25deg, #eee, #333);
  background: linear-gradient(25deg, #eee, #333);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  overflow: hidden;
  white-space: normal; /* Разрешаем перенос текста */
  word-wrap: break-word; /* Перенос длинных слов */
  word-break: break-word; /* Альтернативный перенос */
  hyphens: auto; /* Автоматические переносы */
  border-right: 2px solid;
  -webkit-animation: type 3s steps(120) 1s 1 normal both, cursor 1s step-end infinite;
          animation: type 3s steps(120) 1s 1 normal both, cursor 1s step-end infinite;
  position: relative;
  max-width: 90%; /* Ограничиваем ширину */
  display: inline-block;
}

/* Убираем правую границу после анимации на мобильных */
@media (max-width: 768px) {
  h1.type {
    animation: type 3s steps(120) 1s 1 normal both, cursor 1s step-end 10;
    max-width: 100%;
  }
}

@-webkit-keyframes type {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes type {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@-webkit-keyframes cursor {
  50% {
    border-color: transparent;
  }
}

@keyframes cursor {
  50% {
    border-color: transparent;
  }
}


/* Финальный эффект печатной машинки с JavaScript */
.typewriter-text {
  --text-color-primary: #ffffff;
  --text-color-accent: #0066FF;
  --text-glow: 0 0 20px rgba(0, 102, 255, 0.3);
  background: linear-gradient(25deg, #fff 0%, #666 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  will-change: filter, text-shadow;
}

.typewriter-cursor {
  background: linear-gradient(25deg, #fff 0%, #666 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cursor-blink 1s infinite;
  font-weight: 700;
  display: inline;
  margin-left: 2px;
}

@keyframes cursor-blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

/* Скрытие курсора после завершения анимации */
.typewriter-cursor.hidden {
  opacity: 0 !important;
  animation: none !important;
  transition: opacity 0.5s ease-out;
}

/* Удаляем старую CSS анимацию width для h1.type */
h1.type {
  overflow: visible !important;
  animation: none !important;
  width: auto !important;
  max-width: 90%;
}

/* Анимация перехода от градиента к белому */
.typewriter-text.fade-to-white {
  animation: gradientFade 2.5s ease-out forwards;
}

@keyframes gradientFade {
  0% {
    background: linear-gradient(25deg, #fff 0%, #666 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  100% {
    background: linear-gradient(25deg, #fff 0%, #fff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* Цветовые пятна - активное состояние */

/* Анимированные цветовые пятна */

/* Второй слой для более мягкого эффекта */

@keyframes softPulse {
  0%, 100% { 
    opacity: 0.4;
    transform: scale(0.95);
  }
  50% { 
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* CSS переменные для анимации пятен */

/* Fallback анимация без GSAP */
@supports not (animation-timeline: scroll()) {

@keyframes moveSpots1 {
  0%, 100% {
    background-position: 0% 50%;
  }
  25% {
    background-position: 50% 20%;
  }
  50% {
    background-position: 100% 50%;
  }
  75% {
    background-position: 50% 80%;
  }
}

@keyframes moveSpots2 {
  0%, 100% {
    background-position: 100% 50%;
  }
  50% {
    background-position: 0% 50%;
  }
}
CSSEND'

/* Анимация перехода от градиента к белому */
.typewriter-text.fade-to-white {
  animation: gradientFade 2.5s ease-out forwards;
}

@keyframes gradientFade {
  0% {
    background: linear-gradient(25deg, #fff 0%, #666 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  100% {
    background: transparent;
    -webkit-text-fill-color: #ffffff;
    color: #ffffff;
  }
}

/* Цветовые пятна */


@keyframes softPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* Плавное осветление градиента - эффект проявления */
.typewriter-text {
  position: relative;
  transition: none;
}

.typewriter-text.fade-to-white {
  animation: gradientFadeSmooth 2.5s ease-out forwards;
}

@keyframes gradientFadeSmooth {
  0% {
    background: linear-gradient(25deg, #fff 0%, #666 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: brightness(0.8);
  }
  30% {
    background: linear-gradient(25deg, #fff 0%, #888 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: brightness(0.9);
  }
  60% {
    background: linear-gradient(25deg, #fff 0%, #aaa 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: brightness(0.95);
  }
  80% {
    background: linear-gradient(25deg, #fff 0%, #ddd 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: brightness(0.98);
  }
  100% {
    background: transparent;
    -webkit-text-fill-color: #ffffff;
    color: #ffffff;
    filter: brightness(1);
  }
}

/* Улучшенные цветовые пятна */


/* Анимация плавного осветления градиента */
#typewriter-text.gradient-fading {
  animation: smoothFadeToWhite 2.5s ease-out forwards;
  transition: text-shadow 0.3s ease;
}

/* Класс для GSAP color animation */
#typewriter-text.color-animating {
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  line-height: 1.6; /* Увеличенный межстрочный интервал */
}

/* Контейнер для каждой строки текста */
#typewriter-text .text-line {
  display: block;
  white-space: nowrap; /* Предотвращаем переносы внутри строк */
}

/* Увеличенное расстояние между строками заголовка */
#typewriter-text br {
  display: block !important;
  margin: 3em 0 !important;
  height: 1em !important;
}

/* Стили для отдельных слов в волновой анимации */
#typewriter-text .word {
  display: inline; /* Изменено с inline-block на inline */
  transition: none; /* GSAP управляет анимацией */
  padding: 0 0.1em; /* Небольшой отступ между словами */
  position: relative;
  will-change: color, text-shadow;
}

/* Увеличенный отступ между строками для логического разделения */
#typewriter-text .line-break {
  display: block;
  content: '';
  margin: 0.8em 0; /* Увеличенный отступ между фразами */
  height: 0;
}

@keyframes smoothFadeToWhite {
  0% {
    background: linear-gradient(25deg, #fff 0%, #666 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  20% {
    background: linear-gradient(25deg, #fff 0%, #888 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  40% {
    background: linear-gradient(25deg, #fff 0%, #aaa 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  60% {
    background: linear-gradient(25deg, #fff 0%, #ccc 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  80% {
    background: linear-gradient(25deg, #fff 0%, #eee 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  100% {
    background: transparent;
    -webkit-text-fill-color: #ffffff;
    color: #ffffff;
  }
}

/* Цветовые пятна - видимые */


