html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent horizontal scroll on mobile */
  overflow-x: hidden;
}

/* Prevent any element from breaking horizontal layout */
img, svg, video, canvas { max-width: 100%; }

/* Better balance for headings on small screens */
.text-balance { text-wrap: balance; }

/* Custom xs breakpoint via container query fallback (handled in markup) */
@media (min-width: 480px) {
  .xs\:block { display: block; }
  .xs\:hidden { display: none; }
  .xs\:flex { display: flex; }
  .xs\:text-\[40px\] { font-size: 40px; line-height: 1; }
}

/* Tap targets — minimum 44px on mobile */
@media (max-width: 640px) {
  a, button { min-height: 44px; }
  a.inline-flex, button.inline-flex { min-height: 0; }
}

/* Safe area padding for iOS notch */
@supports (padding: max(0px)) {
  .safe-bottom { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  .safe-top    { padding-top:    max(0.5rem, env(safe-area-inset-top)); }
}

/* Hide native disclosure arrow */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Custom scrollbar (subtle) */
@media (min-width: 768px) {
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-track { background: #f8fafc; }
  ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 2px solid #f8fafc; }
  ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
}

/* Pricing card hover lift */
#pricing .rounded-3xl { transition: transform 0.3s ease, box-shadow 0.3s ease; }
#pricing .rounded-3xl:hover { transform: translateY(-4px); }

/* FAQ summary focus */
details > summary:focus-visible {
  outline: 2px solid #1f7ff0;
  outline-offset: 4px;
  border-radius: 8px;
}

/* Buttons / links a11y focus */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid #1f7ff0;
  outline-offset: 2px;
}
input:focus-visible { outline: none; }

/* Smooth marquee pause on hover */
.animate-marquee:hover { animation-play-state: paused; }

/* Subtle reveal for elements */
.reveal { opacity: 0; transform: translateY(16px); 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); }

/* ===========================================
   MOBILE-FIRST POLISH
   =========================================== */

/* Smaller hero badge on tiny phones */
@media (max-width: 374px) {
  h1 { font-size: 30px !important; line-height: 1.15 !important; }
}

/* Prevent images from causing horizontal scroll */
section { max-width: 100vw; }

/* Mobile: tighter card padding for grid items if they're using big rounding */
@media (max-width: 480px) {
  .rounded-\[36px\] { border-radius: 24px; }
  .rounded-\[28px\] { border-radius: 20px; }
}

/* Sticky CTA breathing — slight push on scroll-up */
/* WhatsApp float — gentle bobbing to grab attention */
@keyframes wa-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
#wa-float { animation: wa-bob 3s ease-in-out infinite; }
#wa-float:hover { animation-play-state: paused; }

#qris-modal {
  overscroll-behavior: contain;
}

#qris-modal > div {
  scrollbar-width: thin;
}

@media (max-width: 640px) {
  #qris-modal {
    align-items: center !important;
    padding: 0.75rem !important;
  }
  #qris-modal > div {
    max-height: calc(100dvh - 1.5rem) !important;
    max-width: 23rem !important;
    border-radius: 18px !important;
  }
  #qris-modal > div > div:first-child {
    padding: 0.75rem 1rem !important;
  }
  #qris-modal > div > div:last-child {
    padding: 1rem 1.25rem 1.25rem !important;
  }
  #qris-title {
    font-size: 1.25rem !important;
    line-height: 1.2 !important;
  }
  #qris-title + p {
    margin-top: 0.35rem !important;
    font-size: 0.75rem !important;
  }
  #qris-title + p + div {
    margin-top: 0.95rem !important;
    padding: 0.7rem 0.85rem !important;
    font-size: 0.8rem !important;
    line-height: 1.35 !important;
  }
  #qris-title + p + div + div {
    margin-top: 0.85rem !important;
    padding: 0.9rem !important;
  }
  #qris-amount {
    font-size: 1.45rem !important;
  }
  #qris-modal img[alt="QRIS pembayaran Fluently"] {
    margin-top: 1rem !important;
    width: min(12.5rem, 68vw) !important;
    padding: 0.45rem !important;
  }
  #qris-modal img[alt="QRIS pembayaran Fluently"] + p {
    display: none !important;
  }
  #qris-wa-confirm {
    margin-top: 1.05rem !important;
    min-height: 3.25rem !important;
    padding: 0.85rem 1rem !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    line-height: 1.25 !important;
  }
  #qris-cancel {
    margin-top: 0.65rem !important;
  }
}

/* Tabular numbers for countdown alignment */
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Disable hover lift on touch devices to avoid stuck states */
@media (hover: none) {
  .feature-card:hover, .skill-tile:hover, .level-card:hover {
    transform: none !important;
  }
}

/* Improve tap area for nav anchors */
@media (max-width: 767px) {
  #mobile-menu a { min-height: 44px; display: flex; align-items: center; }
}

/* Optical fix: hero mascot at very small widths */
@media (max-width: 360px) {
  #hero-stage .mascot { width: 315px !important; max-width: 116vw !important; }
}

/* Mascot entrance pop-in (overrides while transitioning, then natural anim resumes) */
@keyframes mascot-pop {
  0%   { opacity: 0; transform: scale(0.55) translateY(60px) rotate(-10deg); }
  60%  { opacity: 1; transform: scale(1.04) translateY(-8px) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) translateY(0) rotate(0deg); }
}
.mascot-in {
  animation-name: mascot-pop, var(--mascot-loop, bearBob);
  animation-duration: 0.95s, 5s;
  animation-timing-function: cubic-bezier(.2,.9,.3,1.2), ease-in-out;
  animation-delay: 0s, 0.95s;
  animation-iteration-count: 1, infinite;
  animation-fill-mode: both;
}

/* Mascot hover tilt — gentle on bigger mascot in hero */
.mascot { transition: transform 400ms cubic-bezier(.2,.9,.3,1.2), filter 300ms ease; }
#hero-stage:hover .mascot { transform: scale(1.02) rotate(-2deg); filter: brightness(1.04); }

/* Drop shadow soft pulse under mascot */
@keyframes mascot-shadow {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.45; }
  50%      { transform: translateX(-50%) scale(0.85); opacity: 0.25; }
}
.mascot-shadow {
  position: absolute;
  bottom: 6%;
  left: 50%;
  width: 60%;
  height: 22px;
  background: radial-gradient(ellipse, rgba(15,23,42,0.45), transparent 70%);
  border-radius: 50%;
  filter: blur(6px);
  animation: mascot-shadow 5s ease-in-out infinite;
  z-index: 5;
}
