/* ═══════════════════════════════════════════════════════════
   CodeIn Landing Page — Custom Styles
   Beyond Tailwind: gradients, grid pattern, shimmer effects
   ═══════════════════════════════════════════════════════════ */

/* ─── Base ─────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0a0a0f;
}
::-webkit-scrollbar-thumb {
  background: #1a1d23;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #343a40;
}

/* ─── Hero Gradient ────────────────────────────────────── */
.hero-gradient {
  background:
    radial-gradient(
      ellipse 80% 60% at 50% 20%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 60% 50% at 30% 70%,
      rgba(249, 115, 22, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 50% 40% at 70% 80%,
      rgba(16, 185, 129, 0.06) 0%,
      transparent 50%
    );
  animation: hero-breathe 10s ease-in-out infinite;
}

@keyframes hero-breathe {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.45;
  }
}

/* ─── Grid Pattern ─────────────────────────────────────── */
.grid-pattern {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ─── Feature Cards Hover Glow ─────────────────────────── */
.feature-card {
  position: relative;
}
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(99, 102, 241, 0.1) 50%,
    transparent 60%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
}
.feature-card:hover::before {
  opacity: 1;
}

/* ─── Download Card Glow ───────────────────────────────── */
.download-card {
  position: relative;
  overflow: hidden;
}
.download-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(99, 102, 241, 0.03) 50%,
    transparent 100%
  );
  transition: left 0.6s ease;
}
.download-card:hover::after {
  left: 100%;
}

/* ─── SHA Display ──────────────────────────────────────── */
.sha-display {
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
}

/* ─── FAQ Transitions ──────────────────────────────────── */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
  opacity: 0;
}
.faq-answer:not(.hidden) {
  max-height: 500px;
  opacity: 1;
}

/* ─── Toast Animation ──────────────────────────────────── */
#toast {
  animation:
    toast-in 0.3s ease-out,
    toast-out 0.3s ease-in 2.7s forwards;
}
@keyframes toast-in {
  from {
    transform: translate(-50%, 20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}
@keyframes toast-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* ─── OS Tab Active State ──────────────────────────────── */
.os-tab {
  position: relative;
}
.os-tab.bg-white\/10::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(99, 102, 241, 0.6),
    transparent
  );
  border-radius: 1px;
}

/* ─── Smooth Section Transitions ───────────────────────── */
section {
  position: relative;
}

/* ─── Indian Tricolor Accent Line ──────────────────────── */
.tricolor-line {
  height: 3px;
  background: linear-gradient(
    90deg,
    #ff9933 0%,
    #ff9933 33%,
    #ffffff 33%,
    #ffffff 66%,
    #138808 66%,
    #138808 100%
  );
  border-radius: 2px;
}

/* ─── Skill Cards Hover Glow ───────────────────────────── */
.skill-card {
  position: relative;
}
.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(249, 115, 22, 0.12) 50%,
    transparent 60%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
}
.skill-card:hover::before {
  opacity: 1;
}
.skill-card:hover {
  transform: translateY(-2px);
  transition:
    transform 0.3s ease,
    border-color 0.3s ease;
}

/* ─── Language Switcher ────────────────────────────────── */
#lang-menu {
  animation: fadeDown 0.15s ease-out;
}
#lang-menu.hidden {
  display: none;
}
@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lang-btn.bg-brand-500\/10,
.lang-btn-mobile.bg-brand-500\/10 {
  background: rgba(99, 102, 241, 0.1);
}

/* ─── Skip Link ───────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--codin-accent-primary, #6366f1);
  color: white;
  padding: 8px 16px;
  z-index: 100001;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ─── Responsive polish ───────────────────────────────── */
@media (max-width: 640px) {
  .hero-gradient {
    opacity: 0.2;
  }
}

/* ─── Reduced Motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Print-friendly ──────────────────────────────────── */
@media print {
  nav,
  .hero-gradient,
  .grid-pattern {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
