/* ===========================================================
   ISKCON Hebri — Sahyadri Sri Krishna Balarama Kshetra
   Custom styles layered on top of Tailwind (CDN)
   =========================================================== */

/* ---------------------------------------------------------------
   Sanskrit / IAST diacritics (a i u m r s n t s n with marks)
   Cormorant Garamond and Inter lack some of these glyphs, so we add
   Noto Serif / Noto Sans as per-glyph fallbacks. The primary fonts
   still render every character they support; only the missing
   diacritics fall through to Noto. Keeps the design, removes the boxes.
   --------------------------------------------------------------- */
h1, h2, h3, h4, h5, .serif, .font-serif, blockquote, em, i, cite, .italic {
  font-family: 'Cormorant Garamond', 'Noto Serif', Georgia, serif;
}
body, p, li, a, span, div, button, input, textarea, select {
  font-family: 'Inter', 'Noto Sans', system-ui, -apple-system, sans-serif;
}

:root {
  /* Palette */
  --saffron: #d97706;
  --saffron-deep: #b45309;
  --marigold: #f59e0b;
  --forest: #1f4731;
  --forest-deep: #0f2e1d;
  --cream: #faf6ed;
  --cream-warm: #f3ead2;
  --ink: #1c1917;
  --ink-soft: #44403c;
  --paper: #fffdf7;

  /* Easing — Emil's curves (built-in CSS easings are too weak) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

html { scroll-behavior: smooth; }

@supports (overscroll-behavior: contain) {
  html { overscroll-behavior-y: contain; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Hide long brand tagline on very small viewports */
@media (max-width: 480px) {
  .brand-tagline { display: none; }
}

/* Make hero headlines respect the viewport on mobile */
@media (max-width: 640px) {
  h1.font-serif { word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; }
}

h1, h2, h3, h4, h5, .serif {
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.devanagari { font-family: 'Tiro Devanagari Sanskrit', serif; }

/* === Focus visible (keyboard navigation) === */
:focus { outline: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
.tier-card:focus-visible,
.gallery-item:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
  border-radius: 6px;
}
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.btn-outline:focus-visible { outline-offset: 4px; }

/* === Hero video === */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 46, 29, 0.55) 0%,
    rgba(15, 46, 29, 0.35) 40%,
    rgba(28, 25, 23, 0.75) 100%
  );
  z-index: 1;
}

/* === Texture & ornaments === */
.paper-texture {
  background-color: var(--cream);
  background-image:
    radial-gradient(at 20% 10%, rgba(217, 119, 6, 0.06) 0px, transparent 50%),
    radial-gradient(at 80% 90%, rgba(31, 71, 49, 0.05) 0px, transparent 50%);
}

.divider-om {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  color: var(--saffron);
  font-size: 1.5rem;
  margin: 2rem 0;
}
.divider-om::before,
.divider-om::after {
  content: '';
  flex: 1;
  max-width: 8rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--saffron) 50%, transparent);
}

/* === Buttons ===
   Specific property transitions (never `all`).
   :active for press feedback. Hover gated behind hover-capable pointer. */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--saffron);
  color: #fff;
  padding: 0.85rem 1.75rem;
  border-radius: 9999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  transition:
    transform 160ms var(--ease-out),
    background-color 200ms ease,
    box-shadow 200ms ease;
  will-change: transform;
}
.btn-primary:active { transform: scale(0.97); transition-duration: 100ms; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  color: #fff;
  padding: 0.85rem 1.75rem;
  border-radius: 9999px;
  font-weight: 500;
  backdrop-filter: blur(4px);
  transition:
    transform 160ms var(--ease-out),
    background-color 200ms ease,
    border-color 200ms ease;
}
.btn-ghost:active { transform: scale(0.97); transition-duration: 100ms; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1.5px solid var(--forest);
  color: var(--forest);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  background: transparent;
  transition:
    transform 160ms var(--ease-out),
    background-color 200ms ease,
    color 200ms ease;
}
.btn-outline:active { transform: scale(0.97); transition-duration: 100ms; }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: var(--saffron-deep);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.45);
  }
  .btn-primary:hover:active { transform: scale(0.97); }

  .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
  }

  .btn-outline:hover {
    background: var(--forest);
    color: #fff;
  }
}

/* === Nav === */
.nav-shell {
  transition:
    top 250ms ease,
    background-color 250ms ease,
    box-shadow 250ms ease,
    backdrop-filter 250ms ease;
}
.nav-shell.scrolled {
  top: 0;
  background: rgba(255, 253, 247, 0.95);
  backdrop-filter: saturate(180%) blur(12px);
  box-shadow: 0 1px 0 rgba(28, 25, 23, 0.06);
}
.nav-link {
  position: relative;
  font-weight: 500;
  font-size: 1.125rem;
  transition: color 200ms ease;
}
.nav-shell nav { gap: 2.5rem; }
.nav-shell .btn-primary { padding: 1rem 2.25rem; font-size: 1.0625rem; }
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--saffron);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--ease-out);
}
/* Active link: stripe is permanent — disable transition so it doesn't animate in on page load */
.nav-link.active::after { transform: scaleX(1); transition: none; }
@media (hover: hover) and (pointer: fine) {
  .nav-link:hover::after { transform: scaleX(1); }
}

/* Site logo: green wordmark by default, white wordmark on dark hero */
.site-logo, .site-logo-white {
  display: block;
  height: 5rem;
  width: auto;
}
.site-logo-white { display: none; }
@media (min-width: 768px) {
  .site-logo, .site-logo-white { height: 7rem; }
}
body[data-hero="dark"] .nav-shell:not(.scrolled) .site-logo { display: none; }
body[data-hero="dark"] .nav-shell:not(.scrolled) .site-logo-white { display: block; }

/* Pages with dark hero: invert nav text until user scrolls */
body[data-hero="dark"] .nav-shell:not(.scrolled) .nav-link {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
@media (hover: hover) and (pointer: fine) {
  body[data-hero="dark"] .nav-shell:not(.scrolled) .nav-link:hover { color: var(--marigold); }
}
body[data-hero="dark"] .nav-shell:not(.scrolled) .nav-link.active { color: var(--marigold); }
body[data-hero="dark"] .nav-shell:not(.scrolled) .brand-name {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
body[data-hero="dark"] .nav-shell:not(.scrolled) .brand-tagline {
  color: var(--marigold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
body[data-hero="dark"] .nav-shell:not(.scrolled) [data-drawer-toggle] {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* === Cards ===
   Lift on hover (desktop only), press feedback on tap. */
.card-lift {
  transition:
    transform 250ms var(--ease-out),
    box-shadow 250ms ease;
  will-change: transform;
}
.card-lift:active { transform: translateY(-2px) scale(0.995); transition-duration: 80ms; }
@media (hover: hover) and (pointer: fine) {
  .card-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -20px rgba(31, 71, 49, 0.35);
  }
  .card-lift:hover:active { transform: translateY(-2px) scale(0.995); }
}

.tier-card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(217, 119, 6, 0.15);
  border-radius: 1.25rem;
  padding: 2rem 1.75rem;
  overflow: hidden;
  transition:
    transform 250ms var(--ease-out),
    box-shadow 250ms ease,
    border-color 200ms ease;
}
.tier-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--saffron), var(--marigold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms var(--ease-out);
}
.tier-card:active { transform: translateY(-1px) scale(0.995); transition-duration: 80ms; }
@media (hover: hover) and (pointer: fine) {
  .tier-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px -24px rgba(180, 83, 9, 0.35);
  }
  .tier-card:hover::before { transform: scaleX(1); }
  .tier-card:hover:active { transform: translateY(-2px) scale(0.995); }
}
.tier-card.featured {
  border-color: var(--saffron);
  background: linear-gradient(180deg, #fffaf2 0%, #fff 60%);
}
.tier-card.featured::before {
  transform: scaleX(1);
  transition: none;  /* permanent stripe — no enter animation */
}

/* === Initiatives grid === */
.initiative-card img {
  transition: transform 400ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .initiative-card:hover img { transform: scale(1.04); }
}

/* === Stats === */
.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 600;
  color: var(--forest);
  line-height: 1;
}

/* === Reveal on scroll ===
   Both properties share the same curve so they animate as one motion. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 600ms var(--ease-out),
    transform 600ms var(--ease-out);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* === Gallery === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  cursor: pointer;
  background: var(--cream-warm);
  transition: transform 200ms var(--ease-out);
}
.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease-out);
}
.gallery-item:active { transform: scale(0.985); transition-duration: 80ms; }
@media (hover: hover) and (pointer: fine) {
  .gallery-item:hover img,
  .gallery-item:hover video { transform: scale(1.04); }
}

.gallery-item.tall { grid-row: span 2; aspect-ratio: 3/4.5; }
.gallery-item.wide { grid-column: span 2; aspect-ratio: 16/9; }
.gallery-item.square { aspect-ratio: 1; }

@media (max-width: 640px) {
  .gallery-item.wide,
  .gallery-item.tall { grid-column: auto; grid-row: auto; aspect-ratio: 4/5; }
}

/* === Seva tiles (Gau Seva page "More Ways to Serve") === */
.seva-tile {
  transition:
    transform 250ms var(--ease-out),
    box-shadow 250ms ease;
  will-change: transform;
}
.seva-tile:active { transform: translateY(-2px) scale(0.995); transition-duration: 80ms; }
@media (hover: hover) and (pointer: fine) {
  .seva-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -20px rgba(31, 71, 49, 0.35);
  }
}
.seva-tile-img {
  transition: transform 400ms var(--ease-out);
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .seva-tile:hover .seva-tile-img { transform: scale(1.04); }
}
.tile-arrow {
  transition: transform 180ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .seva-tile:hover .tile-arrow { transform: translateX(4px); }
}

/* Filter buttons (gallery + initiatives quick nav) */
.filter-btn,
.quick-pill {
  transition:
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms var(--ease-out);
}
.filter-btn:active,
.quick-pill:active { transform: scale(0.97); transition-duration: 90ms; }
@media (hover: hover) and (pointer: fine) {
  .quick-pill:hover {
    background: var(--saffron);
    color: #fff;
  }
}

/* === Lightbox ===
   Fade + scale in. Coordinated with JS clearing content on transitionend. */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 46, 29, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 200ms var(--ease-out),
    visibility 0s linear 200ms;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 200ms var(--ease-out),
    visibility 0s linear 0s;
}
.lightbox-content {
  transform: scale(0.96);
  transition: transform 200ms var(--ease-out);
}
.lightbox.open .lightbox-content { transform: scale(1); }
.lightbox img,
.lightbox video {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 0.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: block;
}
.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  color: #fff;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition:
    transform 160ms var(--ease-out),
    background-color 200ms ease;
}
.lightbox-close:active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) {
  .lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }
}

/* === Pre-footer CTA === */
.prefooter-cta {
  background:
    radial-gradient(at 30% 30%, rgba(217, 119, 6, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #2a1f15 0%, #1a1410 100%);
  padding: clamp(4rem, 8vw, 6rem) 0;
  color: #fff;
}
.prefooter-cta .prefooter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 1024px) {
  .prefooter-cta .prefooter-grid {
    grid-template-columns: minmax(0, 1.4fr) auto;
    gap: 4rem;
  }
}
.prefooter-cta .eyebrow-line {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--saffron);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 1.5rem;
}
.prefooter-cta .eyebrow-line::before {
  content: '';
  width: 1.5rem;
  height: 1px;
  background: var(--saffron);
}
.prefooter-cta h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
  color: #fff;
  max-width: 28ch;
}
.prefooter-cta h2 em {
  color: var(--saffron);
  font-style: italic;
}
.prefooter-cta p {
  color: rgba(255, 253, 247, 0.7);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 42ch;
}
.prefooter-cta .btn-ghost-dark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease;
}
.prefooter-cta .btn-ghost-dark:active { transform: scale(0.97); transition-duration: 100ms; }
@media (hover: hover) and (pointer: fine) {
  .prefooter-cta .btn-ghost-dark:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.3);
  }
}

/* === Footer === */
.site-footer {
  background:
    radial-gradient(at 80% 0%, rgba(217, 119, 6, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #14100b 0%, #0a0805 100%);
  color: rgba(255, 253, 247, 0.7);
  padding-top: 4rem;
  padding-bottom: 2rem;
}
.site-footer .footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.site-footer .footer-brand img {
  height: 2.75rem;
  width: auto;
}
.site-footer .footer-brand .name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  color: #fff;
}
.site-footer .footer-tagline {
  max-width: 22rem;
  font-size: 0.9rem;
  line-height: 1.65;
}
.site-footer h4.footer-heading {
  color: rgba(255, 255, 255, 0.45);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 1.5rem;
}
.site-footer .footer-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.95rem;
}
.site-footer .footer-list li { line-height: 1.5; }
.footer-link {
  color: rgba(255, 253, 247, 0.78);
  transition: color 150ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .footer-link:hover { color: var(--saffron); }
}

.site-footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: rgba(255, 253, 247, 0.5);
}
.site-footer .footer-mantra {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(255, 253, 247, 0.55);
  letter-spacing: 0.02em;
}

/* === Mobile nav drawer ===
   transform-based (GPU) instead of `right`. Staggered link entrance. */
.mobile-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(85vw, 360px);
  height: 100vh;
  background: var(--paper);
  z-index: 60;
  padding: 6rem 2rem 2rem;
  transform: translateX(100%);
  transition: transform 350ms var(--ease-drawer);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15);
  will-change: transform;
}
.mobile-drawer.open { transform: translateX(0); }

.mobile-drawer nav a {
  opacity: 0;
  transform: translateX(20px);
  transition:
    opacity 280ms var(--ease-out),
    transform 280ms var(--ease-out);
}
.mobile-drawer.open nav a { opacity: 1; transform: translateX(0); }
.mobile-drawer.open nav a:nth-child(1) { transition-delay:  90ms; }
.mobile-drawer.open nav a:nth-child(2) { transition-delay: 130ms; }
.mobile-drawer.open nav a:nth-child(3) { transition-delay: 170ms; }
.mobile-drawer.open nav a:nth-child(4) { transition-delay: 210ms; }
.mobile-drawer.open nav a:nth-child(5) { transition-delay: 250ms; }
.mobile-drawer.open nav a:nth-child(6) { transition-delay: 290ms; }
.mobile-drawer.open nav a:nth-child(7) { transition-delay: 330ms; }
.mobile-drawer.open nav a:nth-child(8) { transition-delay: 370ms; }

.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 46, 29, 0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 55;
  transition: opacity 250ms var(--ease-drawer);
}
.mobile-backdrop.open { opacity: 1; pointer-events: auto; }

/* === Marquee / scrolling Sanskrit ===
   Ambient — slow & dim. Keyframes are correct here (continuous linear motion). */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: inline-block;
  animation: marquee 90s linear infinite;
  opacity: 0.35;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* === Mahamantra audio floating button === */
.mahamantra-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 5.5rem;  /* sits to the left of the WhatsApp FAB */
  z-index: 40;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: var(--saffron);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
  transition:
    transform 200ms var(--ease-out),
    background-color 200ms ease,
    box-shadow 200ms ease;
  will-change: transform;
}
.mahamantra-fab:active { transform: scale(0.92); transition-duration: 100ms; }
.mahamantra-fab[data-playing="true"] {
  background: var(--saffron-deep);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.55), 0 0 0 0 rgba(217, 119, 6, 0.4);
  animation: mantra-pulse 2.2s ease-out infinite;
}
@keyframes mantra-pulse {
  0%   { box-shadow: 0 4px 14px rgba(217, 119, 6, 0.55), 0 0 0 0 rgba(217, 119, 6, 0.45); }
  70%  { box-shadow: 0 4px 14px rgba(217, 119, 6, 0.55), 0 0 0 14px rgba(217, 119, 6, 0); }
  100% { box-shadow: 0 4px 14px rgba(217, 119, 6, 0.55), 0 0 0 0 rgba(217, 119, 6, 0); }
}
.mahamantra-icon-play  { display: block; }
.mahamantra-icon-pause { display: none; }
.mahamantra-fab[data-playing="true"] .mahamantra-icon-play  { display: none; }
.mahamantra-fab[data-playing="true"] .mahamantra-icon-pause { display: block; }

@media (hover: hover) and (pointer: fine) {
  .mahamantra-fab:hover {
    transform: scale(1.05);
    background: var(--saffron-deep);
  }
  .mahamantra-fab::before {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: var(--forest-deep);
    color: #fff;
    padding: 0.5rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  }
  .mahamantra-fab:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mahamantra-fab[data-playing="true"] { animation: none; }
}

/* === WhatsApp floating action button === */
.whatsapp-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  transition:
    transform 200ms var(--ease-out),
    box-shadow 200ms ease;
  will-change: transform;
}
.whatsapp-fab:active { transform: scale(0.92); transition-duration: 100ms; }
@media (hover: hover) and (pointer: fine) {
  .whatsapp-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
  }
  /* Tooltip — appears on hover only on hover-capable devices */
  .whatsapp-fab::before {
    content: 'Chat with us on WhatsApp';
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: var(--forest-deep);
    color: #fff;
    padding: 0.5rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition:
      opacity 160ms var(--ease-out),
      transform 160ms var(--ease-out);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  }
  .whatsapp-fab:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* === Krishna flute audio toggle (floating, bottom-left) === */
.audio-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 50;
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  color: var(--saffron-deep);
  border: 1px solid rgba(180, 83, 9, 0.18);
  box-shadow: 0 6px 18px rgba(28, 25, 23, 0.12);
  cursor: pointer;
  transition:
    transform 200ms var(--ease-out),
    box-shadow 200ms ease,
    background 200ms ease;
  will-change: transform;
}
.audio-fab svg { width: 22px; height: 22px; }
.audio-fab:active { transform: scale(0.92); transition-duration: 100ms; }
.audio-fab.is-playing {
  background: var(--saffron);
  color: var(--cream);
  border-color: var(--saffron-deep);
  box-shadow: 0 8px 22px rgba(217, 119, 6, 0.4);
}
.audio-fab.is-playing .audio-fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  border: 1.5px solid var(--saffron);
  opacity: 0;
  animation: audio-pulse 2.4s var(--ease-out) infinite;
  pointer-events: none;
}
@keyframes audio-pulse {
  0%   { transform: scale(0.92); opacity: 0.6; }
  100% { transform: scale(1.35); opacity: 0; }
}
@media (hover: hover) and (pointer: fine) {
  .audio-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 26px rgba(217, 119, 6, 0.32);
  }
  .audio-fab::before {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: var(--forest-deep);
    color: var(--cream);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition:
      opacity 160ms var(--ease-out),
      transform 160ms var(--ease-out);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  }
  .audio-fab:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}
@media (max-width: 480px) {
  .audio-fab { width: 46px; height: 46px; bottom: 18px; left: 18px; }
  .audio-fab svg { width: 19px; height: 19px; }
}

/* === Newsletter / form input ring (consistent across the site) === */
input[type="email"], input[type="text"], input[type="tel"], select, textarea {
  transition:
    border-color 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out);
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
}

/* === Form submit state machine === */
form[data-state="sending"] button[type="submit"] {
  pointer-events: none;
  opacity: 0.7;
}
form[data-state="sent"] {
  position: relative;
}
form[data-state="sent"] > :not(.form-success) { opacity: 0; pointer-events: none; }
.form-success {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: inherit;
  border-radius: inherit;
  padding: 2rem;
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
}
form[data-state="sent"] .form-success {
  display: flex;
  opacity: 1;
}
.form-success-check {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: var(--saffron);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  transform: scale(0.9);
  animation: check-pop 320ms var(--ease-out) forwards;
}
@keyframes check-pop {
  to { transform: scale(1); }
}

/* === Form inputs === */
input, select, textarea {
  transition: border-color 160ms var(--ease-out), box-shadow 160ms ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
}

/* === Misc === */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--saffron);
}

.bg-forest { background: var(--forest); }
.bg-forest-deep { background: var(--forest-deep); }
.bg-cream { background: var(--cream); }
.bg-cream-warm { background: var(--cream-warm); }
.bg-saffron { background: var(--saffron); }
.text-saffron { color: var(--saffron); }
.text-forest { color: var(--forest); }
.text-cream { color: var(--cream); }

.section { padding: clamp(4rem, 8vw, 7rem) 0; }

.container-narrow,
.container-wide {
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}
.container-narrow { max-width: 64rem; }
.container-wide   { max-width: 80rem; }

/* Tighter container padding at the smallest phones */
@media (max-width: 380px) {
  .container-narrow,
  .container-wide { padding: 0 1rem; }
}

/* Tighter card padding at narrow widths so they don't overflow */
@media (max-width: 480px) {
  .bg-cream-warm.rounded-2xl,
  .bg-white.rounded-2xl { padding: 1.25rem !important; }
}

/* Belt-and-braces: prevent any element from blowing out the layout at narrow widths */
@media (max-width: 768px) {
  img, video, iframe, table { max-width: 100%; height: auto; }
  pre, code { overflow-x: auto; max-width: 100%; }
  .gallery-grid { gap: 0.5rem; }
  /* Force every block element to honour its container width */
  section, article, .container-wide, .container-narrow,
  .grid, .flex { min-width: 0; }
  /* Form fields can have intrinsic min-widths that exceed narrow viewports */
  input, select, textarea { min-width: 0; max-width: 100%; }
  /* Hide the contact-bar phone/email cluster a touch later so it doesn't fight 768 */
  .announcement-contacts { display: none !important; }
}
@media (min-width: 900px) {
  .announcement-contacts { display: flex !important; }
}

/* Marquee containment — make absolutely sure it can't push body width */
.marquee { overflow: hidden; max-width: 100vw; }
.marquee-track { will-change: transform; }

/* Footer links: nowrap only inside announcement bar; allow wrap in footer */
.announcement-contacts .footer-link { white-space: nowrap; }
footer .footer-link { word-break: break-word; overflow-wrap: anywhere; }
/* At 768-899px the 4-col footer grid is tight — drop to 2 cols there */
@media (min-width: 768px) and (max-width: 899px) {
  footer .grid.md\:grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* === Reduced motion ===
   Keep opacity/color changes (aid comprehension); kill movement. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .marquee-track { animation: none !important; }

  .mobile-drawer nav a {
    opacity: 1 !important;
    transform: none !important;
    transition-delay: 0ms !important;
  }

  .card-lift:hover,
  .tier-card:hover,
  .seva-tile:hover,
  .btn-primary:hover,
  .whatsapp-fab:hover,
  .audio-fab:hover { transform: none !important; }
  .audio-fab.is-playing .audio-fab-pulse { animation: none; }
}
