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

/* Scroll animasyonu için izole edilmiş stiller */
.scroll-animation-wrapper {
  isolation: isolate;
  position: relative;
  z-index: 1;
  width: 100%;
  overflow-x: hidden; /* Yatay taşmaları engelle */
}

/* Scroll animasyonu stilleri */
.scroll-animation-section {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100vh;
  font-family: 'Geist', 'SF Pro Text', 'SF Pro Icons', 'AOS Icons',
    'Helvetica Neue', Helvetica, Arial, sans-serif, system-ui;
  box-sizing: border-box; /* Padding ve border'ların genişliğe dahil edilmesi */
  max-width: 100%; /* Taşmaların önlenmesi */
  padding: 0 15px; /* Kenarlardan boşluk */
}

.scroll-animation-section ul,
.scroll-animation-section li {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 100%; /* Taşmayı engelle */
  word-wrap: break-word; /* Uzun metinlerin alt satıra geçmesi */
}

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

@layer debug {
  .scroll-animation-section [data-debug='true'] li {
    outline: 0.05em dashed currentColor;
  }
  .scroll-animation-section [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;
  }

  .scroll-animation-section [data-sync-scrollbar='true'] {
    scrollbar-color: oklch(var(--lightness) var(--chroma) var(--hue)) #0000;
  }
  @supports (animation-timeline: scroll()) and (animation-range: 0% 100%) {
    .scroll-animation-section [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-range: entry 50% exit 50%, entry 40% entry 50%,
        exit 30% exit 40%;
      animation-timeline: --list;
    }
    .scroll-animation-section [data-sync-scrollbar='true'][data-animate='true'] 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 {
  .scroll-animation-section {
    --start: 0;
    --end: 360;
    --lightness: 65%;
    --base-chroma: 0.3;
  }
  .scroll-animation-section [data-theme='dark'] {
    --lightness: 75%;
  }
  .scroll-animation-section [data-theme='light'] {
    --lightness: 65%;
  }
  .scroll-animation-section {
    --lightness: 75%;
  }
  .scroll-animation-section ul {
    --step: calc((var(--end) - var(--start)) / (var(--count) - 1));
  }
  .scroll-animation-section 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%) {
    .scroll-animation-section [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 {
  .scroll-animation-section {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color, transparent);
    padding-bottom: 0;
  }

  .scroll-animation-section section:first-of-type {
    --font-level: 6;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    line-height: 1.25;
    width: 100%;
    padding-left: 5rem;
    margin-bottom: 0;
    min-height: 100vh;
    gap: 4rem;
    padding-top: 0;
  }

  .scroll-animation-section section:last-of-type {
    min-height: 100vh;
    display: flex;
    place-items: flex-start;
    width: 100%;
    justify-content: center;
  }

  .scroll-animation-section section:last-of-type h2 {
    --font-level: 6;
  }

  .scroll-animation-section main {
    width: 100%;
  }

  .scroll-animation-section section:first-of-type h2 {
    position: sticky;
    top: 25vh;
    font-size: inherit;
    margin: 0;
    display: inline-block;
    height: -webkit-fit-content;
    height: -moz-fit-content;
    height: fit-content;
    font-weight: 600;
    width: auto;
    flex-shrink: 0;
    padding-top: 3rem;
  }

  .scroll-animation-section ul {
    font-weight: 600;
    padding-inline: 0;
    margin: 0;
    list-style-type: none;
    padding-bottom: 0;
    padding-top: calc(25vh + 0.5rem);
    flex-grow: 1;
  }

  .scroll-animation-section li {
    margin-bottom: 1rem;
  }

  .scroll-animation-section .last-item {
    margin-bottom: 0;
    padding-bottom: 0;
  }

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

  .scroll-animation-section [data-snap='true'] li {
    scroll-snap-align: center;
  }

  .scroll-animation-section h2,
  .scroll-animation-section .last-item {
    background: linear-gradient(
      canvasText 50%,
      color-mix(in oklch, canvas, canvasText 25%)
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: #0000;
  }
}

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

  .scroll-animation-section footer {
    padding-block: 2rem;
    opacity: 0.5;
  }

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

@layer base {
  .scroll-animation-section {
    --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;
  }

  .scroll-animation-section :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);
  }

  .scroll-animation-section::before {
    --size: 45px;
    --line: color-mix(in hsl, canvasText, transparent 70%);
    content: '';
    height: 100%;
    width: 100%;
    position: absolute;
    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(to bottom,
        transparent,
        black 20%,
        black 80%,
        transparent
      ),
      radial-gradient(
        ellipse at center,
        black 30%,
        transparent 80%
      );
    mask: 
      linear-gradient(to bottom,
        transparent,
        black 20%,
        black 80%,
        transparent
      ),
      radial-gradient(
        ellipse at center,
        black 30%,
        transparent 80%
      );
    top: 0;
    transform-style: flat;
    pointer-events: none;
    z-index: -1;
  }

  .scroll-animation-section .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 {
  display: none !important;
}

/* Sadece Mobil için Düzenlemeler */
@media (max-width: 991px) {
  /* Taşmaları engelle */
  .scroll-animation-wrapper,
  .scroll-animation-section,
  .scroll-animation-section main,
  .scroll-animation-section section,
  .scroll-animation-section ul,
  .scroll-animation-section li {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  /* Dikey yerleşim */
  .scroll-animation-section section:first-of-type {
    flex-direction: column;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    gap: 1rem;
  }
  
  /* Başlığın dikey olarak kayması için düzenleme */
  .scroll-animation-section section:first-of-type h2 {
    position: relative;
    top: auto;
    padding-top: 2rem;
    text-align: left;
    margin-bottom: 1rem;
    width: 100%;
    font-size: 1.75rem !important;
  }
  
  /* Liste öğelerinin düzgün sıralanması */
  .scroll-animation-section ul {
    padding-top: 0;
    width: 100%;
  }
  
  .scroll-animation-section li {
    padding: 0.5rem 0;
    word-wrap: break-word;
    font-size: 4rem;
  }
}

@media (max-width: 767px) {
  .scroll-animation-section section:first-of-type {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .scroll-animation-section section:first-of-type h2 {
    font-size: 3.5rem !important;
  }
  
  .scroll-animation-section li {
    font-size: 4rem;
  }
}

@media (max-width: 575px) {
  .scroll-animation-section section:first-of-type {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .scroll-animation-section section:first-of-type h2 {
    font-size: 3.5rem !important;
  }
  
  .scroll-animation-section li {
    font-size: 4rem;
  }
} 

