/**
 * HERO SECTION STYLES
 *
 * Contains:
 * - Hero Section (main welcome section)
 * - Hero Visual Card with electric effects
 * - Animations and transitions
 * - Responsive design for hero
 *
 * Dependencies: base.css, components.css
 */

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--space-2xl) var(--space-md);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, oklch(from var(--brand) 0.1 calc(c/2) h / 0.3), transparent 50%),
    radial-gradient(circle at 80% 80%, oklch(from var(--brand) 0.08 calc(c/2) h / 0.2), transparent 50%);
  z-index: -1;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.hero-title,
.section-title {
  margin-bottom: var(--space-md);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.hero-title strong,
.section-title strong {
  color: var(--brand);
  position: relative;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: var(--space-lg);
  color: var(--hero-muted);
}

.hero-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--hero-muted);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--brand);
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.feature-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 2;
}

.feature-item:hover .feature-icon {
  opacity: 1;
  transform: scale(1.1);
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Hero Visual Card */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;

  /* Initial state - hidden from bottom with transform */
  transform: translateY(100px);
  opacity: 0;

  /* Smooth transition for animation */
  transition:
    transform 2s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.6s ease-out;
}

/* Animated state when element is in viewport */
.hero-visual.is-visible {
  transform: translateY(0);
  opacity: 1;
}

/* SVG positioning */
.svg-container {
  position: absolute;
}

/* Card container */
.card-container {
  padding: 2px;
  border-radius: 24px;
  position: relative;
  background: linear-gradient(-30deg,
      var(--gradient-color),
      transparent,
      var(--gradient-color)),
    linear-gradient(to bottom,
      var(--color-neutral-900),
      var(--color-neutral-900));
  width: 350px;
  height: 500px;
}

/* Inner container */
.inner-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Border layers */
.border-outer {
  border: 2px solid rgba(111, 179, 0, 0.5);
  border-radius: 24px;
  padding-right: 4px;
  padding-bottom: 4px;
  width: 100%;
  height: 100%;
}

.main-card {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  border: 2px solid var(--electric-border-color);
  margin-top: -4px;
  margin-left: -4px;
  filter: url(#turbulent-displace);
}

/* Glow effects */
.glow-layer-1 {
  border: 2px solid rgba(111, 179, 0, 0.6);
  border-radius: 24px;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  filter: blur(1px);
  animation: card-glow-pulse 3s ease-in-out infinite;
}

@keyframes card-glow-pulse {

  0%,
  100% {
    opacity: 0.6;
    border-color: rgba(111, 179, 0, 0.6);
  }

  50% {
    opacity: 1;
    border-color: rgba(111, 179, 0, 0.9);
  }
}

/* Overlay effects */
.overlay-1 {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 24px;
  opacity: 1;
  mix-blend-mode: overlay;
  transform: scale(1.1);
  filter: blur(16px);
  background: linear-gradient(-30deg,
      var(--brand),
      transparent 30%,
      transparent 70%,
      var(--brand));
  animation: overlay-pulse-in 4s ease-in-out infinite;
}

.overlay-2 {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 24px;
  opacity: 0.5;
  mix-blend-mode: overlay;
  transform: scale(1.1);
  filter: blur(16px);
  background: linear-gradient(-30deg,
      var(--brand),
      transparent 30%,
      transparent 70%,
      var(--brand));
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  animation: overlay-pulse-out 4s ease-in-out infinite;
}

.card-container:hover .overlay-2 {
  transform: scale(1.1) translate(-2px, -2px);
  opacity: 0.7;
}

@keyframes overlay-pulse-in {

  0%,
  100% {
    transform: scale(1.05);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.15);
    opacity: 0.7;
  }
}

@keyframes overlay-pulse-out {

  0%,
  100% {
    transform: scale(1.15);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.3;
  }
}

/* Background glow */
.background-glow {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 24px;
  filter: blur(32px);
  transform: scale(1.1);
  opacity: 0.3;
  z-index: -1;
  background: linear-gradient(-30deg,
      var(--electric-light-color),
      transparent,
      var(--electric-border-color));
}

/* Content container */
.content-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Content sections */
.content-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px;
  padding-bottom: 16px;
  height: 100%;
}

.content-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px;
  padding-top: 16px;
}

/* Scrollbar glass component */
.scrollbar-glass {
  background: radial-gradient(47.2% 50% at 50.39% 88.37%,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0) 100%),
    rgba(255, 255, 255, 0.04);
  position: relative;
  transition: background 0.3s ease;
  border-radius: 14px;
  width: fit-content;
  height: fit-content;
  padding: 8px 16px;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.scrollbar-glass:hover {
  background: radial-gradient(47.2% 50% at 50.39% 88.37%,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0) 100%),
    rgba(255, 255, 255, 0.08);
}

.scrollbar-glass::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1px;
  background: linear-gradient(150deg,
      rgba(255, 255, 255, 0.48) 16.73%,
      rgba(255, 255, 255, 0.08) 30.2%,
      rgba(255, 255, 255, 0.08) 68.2%,
      rgba(255, 255, 255, 0.6) 81.89%);
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  pointer-events: none;
}

/* Typography */
.title {
  font-size: 36px;
  font-weight: 500;
  margin-top: auto;
  color: var(--fg);
}

.description {
  opacity: 0.85;
  color: var(--fg);
}

/* Divider */
.divider {
  margin-top: auto;
  border: none;
  height: 1px;
  background-color: currentColor;
  opacity: 0.1;
  mask-image: linear-gradient(to right, transparent, black, transparent);
  -webkit-mask-image: linear-gradient(to right,
      transparent,
      black,
      transparent);
}

/* Hover effect for card container */
.card-container {
  transform: perspective(1000px) rotateY(0deg) scale(1);
  transition: transform var(--transition-slow);
}

.card-container:hover {
  transform: perspective(1000px) rotateY(5deg) scale(1.02);
}

/* Animation classes for Intersection Observer */
/* NOTE: General .animate-in class uses keyframe animation for most elements */
.animate-in {
  animation: fadeInUp 0.6s ease forwards;
}

/* Override keyframe animation for elements that use their own transitions */
.about-text.animate-in,
.about-stats.animate-in,
.section-title.animate-in {
  animation: none !important;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero sequential animations */
.hero-title {
  opacity: 0;
  transform: translateY(30px);
}

.hero-title.animate-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-subtitle {
  opacity: 0;
  transform: translateY(20px);
}

.hero-subtitle.animate-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Stagger animation for feature items */
.feature-item {
  opacity: 0;
  transform: translateX(-20px);
}

.feature-item.animate-in {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hero button animation - simplified */
.hero-actions .btn {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero-actions .btn.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }

  .hero-title {
    margin-top: var(--space-xl);
    /* Add margin to push title below header */
  }

  .hero-subtitle {
    margin-top: var(--space-sm);
  }

  .hero-features {
    margin-top: var(--space-md);
    text-align: left;
    align-items: flex-start;
  }

  .card-container {
    width: 300px !important;
    height: 400px !important;
  }

  .content-top,
  .content-bottom {
    padding: 32px;
    padding-bottom: 12px;
  }

  .title {
    font-size: 28px;
  }

  .scrollbar-glass {
    font-size: 12px;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .card-container {
    width: 280px !important;
    height: 380px !important;
  }

  .content-top,
  .content-bottom {
    padding: 24px;
    padding-bottom: 8px;
  }

  .title {
    font-size: 24px;
  }

  .scrollbar-glass {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* ===== PROGRESSIVE DEGRADATION - HERO OVERLAYS ===== */

  /* iPhone 13+ i nowsze - zmniejsz blur */
  @media (max-width: 768px) {

    .overlay-1,
    .overlay-2 {
      filter: blur(12px);
      /* było 16px */
    }

    .background-glow {
      filter: blur(24px);
      /* było 32px */
    }

    /* Spowolnij animacje dla oszczędności CPU */
    .overlay-1 {
      animation-duration: 6s;
      /* było 4s */
    }

    .overlay-2 {
      animation-duration: 6s;
      /* było 4s */
    }
  }

  /* iPhone 11, XR, 12 - średnia wydajność */
  .mid-range-device .overlay-1,
  .mid-range-device .overlay-2 {
    filter: blur(8px);
  }

  .mid-range-device .background-glow {
    filter: blur(16px);
    opacity: 0.2;
    /* zmniejsz intensywność */
  }

  /* iPhone 8, SE, 7 - słaba wydajność */
  .low-end-device .overlay-1,
  .low-end-device .overlay-2 {
    animation: none;
    /* wyłącz animacje */
    filter: blur(4px);
    /* minimalny blur */
    opacity: 0.3;
  }

  .low-end-device .background-glow {
    filter: blur(8px);
    opacity: 0.15;
  }

  /* Stare iPhone - minimalne efekty */
  .old-iphone .overlay-1 {
    display: none;
    /* ukryj całkowicie */
  }

  .old-iphone .overlay-2 {
    animation: none;
    filter: none;
    /* usuń blur */
    opacity: 0.2;
    background: var(--brand);
  }

  .old-iphone .background-glow {
    filter: blur(4px);
    opacity: 0.1;
  }

  /* ===== PROGRESSIVE DEGRADATION - SVG FILTER ===== */

  /* Wyłącz SVG filter na mobile */
  @media (max-width: 768px) {
    .main-card {
      filter: none;
    }
  }

  /* Opcjonalnie: pozostaw dla wydajnych iPhone */
  @media (max-width: 768px) {
    .performance-high .main-card {
      filter: url(#turbulent-displace);
    }
  }

  /* Zdecydowanie wyłącz dla słabych urządzeń */
  .low-end-device .main-card,
  .mid-range-device .main-card,
  .old-iphone .main-card {
    filter: none !important;
  }
}
