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

:root {
  --white: #111;
  --near-white: #000;
  --light-gray: #a1a1a6;
  --dark: #f5f5f7;
  --near-black: #f5f5f7;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--near-white);
  color: var(--dark);
  overflow-x: hidden;
  position: relative;
}

.starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1.5px 1.5px at 12% 23%, #fff, rgba(255,255,255,0)),
    radial-gradient(2px 2px at 67% 34%, #fff, rgba(255,255,255,0)),
    radial-gradient(1.5px 1.5px at 45% 12%, #fff, rgba(255,255,255,0)),
    radial-gradient(1px 1px at 89% 71%, #fff, rgba(255,255,255,0)),
    radial-gradient(2.5px 2.5px at 23% 67%, #fff, rgba(255,255,255,0)),
    radial-gradient(1px 1px at 56% 89%, #fff, rgba(255,255,255,0)),
    radial-gradient(1.5px 1.5px at 34% 45%, #fff, rgba(255,255,255,0)),
    radial-gradient(2px 2px at 78% 15%, #fff, rgba(255,255,255,0)),
    radial-gradient(1px 1px at 11% 89%, #fff, rgba(255,255,255,0)),
    radial-gradient(1.5px 1.5px at 73% 56%, #fff, rgba(255,255,255,0)),
    radial-gradient(2px 2px at 88% 42%, #fff, rgba(255,255,255,0)),
    radial-gradient(1.5px 1.5px at 21% 11%, #fff, rgba(255,255,255,0)),
    radial-gradient(1px 1px at 65% 72%, #fff, rgba(255,255,255,0)),
    radial-gradient(2px 2px at 9% 45%, #fff, rgba(255,255,255,0)),
    radial-gradient(1.5px 1.5px at 52% 34%, #fff, rgba(255,255,255,0)),
    radial-gradient(1px 1px at 81% 68%, #fff, rgba(255,255,255,0));
  background-repeat: repeat;
  background-size: 300px 300px;
  background-position: 0 0;
  animation: starfield-drift 60s linear infinite;
  pointer-events: none;
  z-index: 1;
  filter: brightness(1.3);
}

@keyframes starfield-drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 300px 300px;
  }
}

.content {
  width: 100%;
  position: relative;
  z-index: 2;
}

.shooting-star {
  position: fixed;
  width: 4px;
  height: 4px;
  background: #ffffff;
  box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 9999;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.4));
}

.shooting-star-tail {
  position: fixed;
  width: 2px;
  height: 2px;
  background: #ffffff;
  box-shadow: 0 0 1px 0.25px rgba(255, 255, 255, 0.5);
  pointer-events: none;
  z-index: 9998;
}

@keyframes shooting-star-streak {
  0% {
    opacity: 1;
    box-shadow: 0 0 8px 2px rgba(255, 255, 100, 1),
                0 0 20px 4px rgba(255, 255, 150, 0.8),
                0 0 40px 6px rgba(255, 200, 0, 0.4),
                -150px -150px 0 0 rgba(255, 255, 100, 0.8),
                -300px -300px 0 0 rgba(255, 200, 0, 0.5),
                -450px -450px 0 0 rgba(255, 150, 0, 0.2);
  }
  100% {
    opacity: 0;
    box-shadow: 0 0 8px 2px rgba(255, 255, 100, 0),
                0 0 20px 4px rgba(255, 255, 150, 0),
                0 0 40px 6px rgba(255, 200, 0, 0),
                -150px -150px 0 0 rgba(255, 255, 100, 0),
                -300px -300px 0 0 rgba(255, 200, 0, 0),
                -450px -450px 0 0 rgba(255, 150, 0, 0);
  }
}

section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5vw;
  position: relative;
}

.hero {
  flex-direction: column;
  text-align: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(17, 17, 17, 0.8) 100%);

  h1 {
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--near-black);
    margin-bottom: 0.5em;
    line-height: 1.05;
    
    animation: scroll-fade linear both;
    animation-timeline: scroll();
    animation-range: 0vh 50vh;
  }
}

@keyframes scroll-fade {
  to {
    opacity: 0;
    scale: 0.9;
    filter: blur(10px);
  }
}

.tagline {
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 400;
  color: var(--light-gray);
  letter-spacing: -0.01em;
  
  animation: scroll-fade-tagline linear both;
  animation-timeline: scroll();
  animation-range: 0vh 40vh;
}

@keyframes scroll-fade-tagline {
  to {
    opacity: 0;
    translate: 0 -30px;
  }
}

.scroll-section {
  background: rgba(17, 17, 17, 0.75);

  &:nth-child(even) {
    background: rgba(0, 0, 0, 0.7);
  }
}

.reveal-text {
  text-align: center;
  
  animation: scroll-reveal linear both;
  animation-timeline: view();
  animation-range: entry 0% cover 40%;

  h2 {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--near-black);
    margin-bottom: 0.4em;
    line-height: 1.1;
  }

  p {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: var(--light-gray);
    letter-spacing: -0.01em;
    max-width: 40ch;
    margin: 0 auto;
  }
}

@keyframes scroll-reveal {
  from {
    opacity: 0;
    scale: 0.8;
    filter: blur(20px);
  }
  to {
    opacity: 1;
    scale: 1;
    filter: blur(0);
  }
}

@supports (animation-timeline: scroll()) {
  .hero h1,
  .tagline,
  .reveal-text {
    opacity: 1;
  }
}

@supports not (animation-timeline: scroll()) {
  .hero h1 {
    animation: fade-in 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }
  
  .tagline {
    animation: fade-in 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s both;
  }
  
  .reveal-text {
    opacity: 0;
    animation: fade-in 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    animation-timeline: auto;

    &:nth-child(1) {
      animation-delay: 0.5s;
    }
  }
  
  @keyframes fade-in {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

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

    &::before,
    &::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}
