/* Batla landing — custom styles (animations + details Tailwind can't express inline) */

/* ---------- Self-hosted display font ----------
   Bricolage Grotesque variable woff2 (wght 600–800), subset files copied from
   Google Fonts v9 (gstatic). Self-hosted so nothing render-blocks and no
   third-party font origins are needed (CSP font-src is 'self').
   Body text is the system stack (Roboto on Android — the target audience). */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url(../assets/fonts/bricolage-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url(../assets/fonts/bricolage-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url(../assets/fonts/bricolage-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 8px 24px rgba(30, 122, 58, 0.14);
  --shadow-phone: 0 24px 60px rgba(21, 92, 43, 0.22);
}

html {
  scroll-behavior: smooth;
  /* offset anchors so the sticky navbar doesn't cover section tops */
  scroll-padding-top: 76px;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
/* staggered children */
.reveal.visible .stagger > * {
  animation: rise 0.5s ease-out both;
}
.reveal.visible .stagger > *:nth-child(2) { animation-delay: 0.07s; }
.reveal.visible .stagger > *:nth-child(3) { animation-delay: 0.14s; }
.reveal.visible .stagger > *:nth-child(4) { animation-delay: 0.21s; }
.reveal.visible .stagger > *:nth-child(5) { animation-delay: 0.28s; }
.reveal.visible .stagger > *:nth-child(6) { animation-delay: 0.35s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Reusable card shadow ---------- */
.card-shadow { box-shadow: var(--shadow-card); }

/* ---------- Category tiles ---------- */
.cat-tile {
  transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.cat-tile:hover {
  background-color: #E8F5ED;
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

/* ---------- Hero background texture (subtle green mesh + grid) ---------- */
.hero-bg {
  position: relative;
  background:
    radial-gradient(680px 420px at 88% -8%, rgba(30, 122, 58, 0.10), transparent 60%),
    radial-gradient(520px 360px at 0% 108%, rgba(245, 166, 35, 0.08), transparent 60%);
}
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 122, 58, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 122, 58, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 72%);
          mask-image: radial-gradient(circle at 70% 30%, #000, transparent 72%);
  pointer-events: none;
}
.hero-bg > * { position: relative; z-index: 1; }

/* ---------- Phone mockup ---------- */
.phone {
  box-shadow: var(--shadow-phone);
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
/* animated ping on map pins */
.pin-ping {
  animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.pin-ping:nth-child(2) { animation-delay: 0.8s; }
.pin-ping:nth-child(3) { animation-delay: 1.6s; }
@keyframes ping {
  0%   { transform: scale(1);   opacity: 0.9; }
  70%  { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ---------- Buttons ---------- */
.btn-primary {
  background-color: #1E7A3A;
  color: #fff;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(30, 122, 58, 0.28);
}
.btn-primary:hover { background-color: #155C2B; transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  border: 2px solid #1E7A3A;
  color: #1E7A3A;
  background: transparent;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.btn-outline:hover { background-color: #E8F5ED; transform: translateY(-2px); }

/* ---------- Keyboard focus visibility (a11y) ---------- */
.btn-primary:focus-visible,
.btn-outline:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid #F5A623;
  outline-offset: 2px;
}

/* ---------- Mobile menu slide-down ---------- */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
#mobile-menu.open { max-height: 240px; }

/* ---------- Button spinner (listing form loading state) ---------- */
.spin { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal.visible .stagger > * { animation: none; }
  .phone, .pin-ping { animation: none; }
}
