/* ============================================ */
/* Fyso Landing Page - Custom Styles            */
/* Complement to Tailwind CSS CDN               */
/* ============================================ */

/* ---- Base ---- */

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

/* Prevent layout shift from scrollbar */
html {
  scrollbar-gutter: stable;
}

/* ---- Selection color ---- */

::selection {
  background-color: #b9dffd; /* fyso-200 */
  color: #07284a; /* fyso-950 */
}

/* ---- Scroll animations ---- */

.scroll-animate {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.scroll-animate--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- FAQ details/summary ---- */

details summary {
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::marker {
  display: none;
  content: '';
}

details[open] summary {
  border-bottom: none;
}

/* Smooth open/close for FAQ content */
details .px-6 {
  animation: faqOpen 0.3s ease-out;
}

@keyframes faqOpen {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Float animation for hero cards ---- */

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ---- Focus styles for accessibility ---- */

a:focus-visible,
button:focus-visible,
details summary:focus-visible {
  outline: 2px solid #0c8ce9; /* fyso-500 */
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Smooth anchor offset for fixed navbar ---- */

[id] {
  scroll-margin-top: 5rem;
}

/* ---- Loading state for CTA buttons (future use) ---- */

.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: -0.625rem;
  margin-left: -0.625rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Responsive adjustments ---- */

/* Ensure proper touch targets on mobile */
@media (max-width: 640px) {
  details summary {
    min-height: 48px;
  }

  a,
  button {
    min-height: 44px;
  }
}

/* ---- Print styles ---- */

@media print {
  nav,
  #demo,
  #empieza,
  footer {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
  }

  section {
    page-break-inside: avoid;
  }
}

/* ---- Reduced motion preference ---- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .scroll-animate {
    opacity: 1;
    transform: none;
  }
}

/* ---- Gradient text fallback for older browsers ---- */

@supports not (background-clip: text) {
  .bg-clip-text {
    color: #006fc7; /* fyso-600 as fallback */
  }
}
