/**
 * StarHela – global styles
 * Apple-inspired: typography rhythm, glass surfaces, motion
 */

:root {
  --color-bg: #fafafa;
  --color-surface: rgba(255, 255, 255, 0.72);
  --color-border: rgba(0, 0, 0, 0.06);
  --color-text: #1d1d1f;
  --color-muted: #6e6e73;
  --color-accent: #0071e3;
  --color-accent-hover: #0077ed;
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.08);
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Sticky nav — Apple-like blur + scroll state (pairs with js/main.js) */
#site-nav {
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

#site-nav.nav--scrolled {
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Premium rhythm: section headings */
h1,
h2,
h3 {
  letter-spacing: -0.02em;
}

/* Hero animated gradient */
.hero-gradient {
  background: linear-gradient(
    135deg,
    #f5f5f7 0%,
    #e8eef5 25%,
    #f0f4f8 50%,
    #e5eaf2 75%,
    #fafafa 100%
  );
  background-size: 200% 200%;
  animation: gradient-shift 18s ease infinite;
}

@keyframes gradient-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Subtle mesh overlay */
.hero-mesh::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
      at 20% 30%,
      rgba(0, 113, 227, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(at 80% 70%, rgba(88, 86, 214, 0.06) 0%, transparent 45%);
  pointer-events: none;
}

/* Glass panel */
.glass {
  background: var(--color-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.stagger-children.is-visible > *:nth-child(1) {
  transition-delay: 0.05s;
}
.stagger-children.is-visible > *:nth-child(2) {
  transition-delay: 0.1s;
}
.stagger-children.is-visible > *:nth-child(3) {
  transition-delay: 0.15s;
}
.stagger-children.is-visible > *:nth-child(4) {
  transition-delay: 0.2s;
}
.stagger-children.is-visible > *:nth-child(5) {
  transition-delay: 0.25s;
}
.stagger-children.is-visible > *:nth-child(6) {
  transition-delay: 0.3s;
}
.stagger-children.is-visible > *:nth-child(7) {
  transition-delay: 0.35s;
}
.stagger-children.is-visible > *:nth-child(8) {
  transition-delay: 0.4s;
}
.stagger-children.is-visible > *:nth-child(9) {
  transition-delay: 0.45s;
}
.stagger-children.is-visible > *:nth-child(10) {
  transition-delay: 0.5s;
}

/* Feature card hover */
.feature-card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

/* FAQ accordion */
.faq-item button[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
}

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}

.faq-panel[aria-hidden="false"] {
  grid-template-rows: 1fr;
}

.faq-panel-inner {
  min-height: 0;
  overflow: hidden;
}

/* Focus visible for a11y */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Floating WhatsApp (safe area for notched phones) */
.whatsapp-fab {
  position: fixed;
  z-index: 60;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  right: max(1.25rem, env(safe-area-inset-right, 0px));
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-gradient {
    animation: none;
  }
  .reveal,
  .stagger-children > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .feature-card:hover {
    transform: none;
  }
}
