/* ============================================================
   Baba Spiritual — shared custom styles
   Tailwind handles utilities; this file holds custom keyframes,
   glass effects, cosmic rings, marquee, and motion-safe overrides.
   ============================================================ */

/* Material Symbols default weight */
.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 200, "GRAD" 0, "opsz" 24;
}
.material-symbols-outlined.fill {
  font-variation-settings: "FILL" 1, "wght" 200, "GRAD" 0, "opsz" 24;
}

/* ---------- Grain overlay (subtle film texture over everything) ---------- */
.grain-overlay {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
}

/* ---------- Glass card ---------- */
.glass-card {
  background: rgba(30, 32, 31, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(234, 188, 181, 0.1);
  transition: border-color 0.5s ease, transform 0.4s ease;
}
.glass-card:hover {
  border-color: rgba(234, 188, 181, 0.4);
}

/* ---------- Hero with video background ----------
   Video is 1280×720 (16:9). Strategy by breakpoint:
   - Desktop/tablet: video is full-bleed background, text overlays it.
     Container is min(920px, 100vh) tall, video fills via object-cover.
     Small crop on sides happens only at extreme aspect ratios.
   - Mobile (<768px): we DO NOT crop. The hero becomes stacked — video
     plays at the top in its native 16:9 ratio (no crop, no letterbox,
     no distortion), text content sits below in the dark green band.
*/
.hero-video {
  min-height: 100svh;
  min-height: 100vh;
  max-height: 1100px;
}
@media (min-width: 768px) {
  .hero-video {
    min-height: min(920px, 100vh);
    max-height: 1100px;
  }
}
.hero-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(14,42,34,0.35) 0%, rgba(14,42,34,0.6) 70%, rgba(14,42,34,0.85) 100%),
    linear-gradient(to bottom, rgba(18,20,19,0.55) 0%, rgba(18,20,19,0) 25%, rgba(18,20,19,0) 75%, rgba(18,20,19,0.6) 100%);
}

/* ---------- Mobile hero: stacked, no crop ---------- */
@media (max-width: 767px) {
  .hero-video {
    min-height: 0;
    max-height: none;
    height: auto;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    display: flex;
  }
  .hero-bg-video {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
    object-fit: cover;            /* still cover, but container matches video ratio so nothing is cropped */
  }
  .hero-overlay { display: none; } /* No video to darken below the text */
  .hero-rings   { display: none; } /* Skip decorative rings on mobile — keeps the hero clean and fast */
  .hero-content {
    position: relative;
    width: 100%;
    padding: 56px 20px 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg-video { display: none; }
}

/* ---------- Ken Burns: slow continuous pan + zoom on key images ----------
   Multiple variants so multiple images on the same page don't move in lockstep. */
@keyframes kenburns-a {
  0%   { transform: scale(1.05) translate(0, 0); }
  50%  { transform: scale(1.14) translate(-1.5%, -1.2%); }
  100% { transform: scale(1.05) translate(0, 0); }
}
@keyframes kenburns-b {
  0%   { transform: scale(1.08) translate(0, 0); }
  50%  { transform: scale(1.15) translate(1.5%, -1%); }
  100% { transform: scale(1.08) translate(0, 0); }
}
@keyframes kenburns-c {
  0%   { transform: scale(1.06) translate(0, 0); }
  50%  { transform: scale(1.16) translate(-1%, 1.5%); }
  100% { transform: scale(1.06) translate(0, 0); }
}
.kenburns {
  animation: kenburns-a 22s ease-in-out infinite;
  transform-origin: center;
  will-change: transform;
}
.kenburns-b { animation-name: kenburns-b; animation-duration: 26s; }
.kenburns-c { animation-name: kenburns-c; animation-duration: 30s; }

/* Wrap an image with .kenburns-frame to crop the zoomed-in motion cleanly */
.kenburns-frame {
  overflow: hidden;
  border-radius: inherit;
}

/* ---------- Icon float: subtle bobbing on service-card icons ---------- */
@keyframes icon-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.icon-float {
  animation: icon-float 4s ease-in-out infinite;
  display: inline-block;
  will-change: transform;
}
/* Stagger so the 6 cards don't bob in unison */
.icon-float-d1 { animation-delay: 0.6s; }
.icon-float-d2 { animation-delay: 1.2s; }
.icon-float-d3 { animation-delay: 1.8s; }
.icon-float-d4 { animation-delay: 2.4s; }
.icon-float-d5 { animation-delay: 3.0s; }

/* Stop motion when the OS asks for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .kenburns, .kenburns-b, .kenburns-c, .icon-float {
    animation: none !important;
    transform: none !important;
  }
}

/* ---------- Cosmic rings (hero) ----------
   Two-layer approach: outer .ring-pos centers + accepts parallax (set via
   CSS vars by app.js), inner .ring-spin handles rotation. Combining both on
   one transform property would conflict, so we split them. */
.ring-pos {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% + var(--px, 0px)), calc(-50% + var(--py, 0px)));
  transition: transform 0.3s ease-out;
  pointer-events: none;
}
.ring-spin {
  border-radius: 9999px;
  border: 1px solid rgba(234, 188, 181, 0.1);
  animation: spin 120s linear infinite;
}
.ring-spin.dim   { border-color: rgba(234, 188, 181, 0.05); }
.ring-spin.rev   { animation-direction: reverse; animation-duration: 90s; }
.ring-spin.slow  { animation-duration: 180s; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---------- Fade in on load (hero) ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(2rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Marquee (testimonials) ---------- */
@keyframes scrollx {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-track {
  animation: scrollx 40s linear infinite;
}
.marquee-track:hover {
  animation-play-state: paused;
}

/* ---------- Scroll-reveal (added by app.js) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 1s ease, transform 1s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Form fields ---------- */
.field {
  background: transparent;
  border: none;
  border-bottom: 1px solid #c1c8c4;
  color: #e3e2e0;
  padding: 12px 0;
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  width: 100%;
  outline: none;
  transition: border-color 0.3s;
}
.field:focus {
  border-bottom-color: #eabcb5;
}
.field::placeholder {
  color: #8b928e;
}
select.field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23eabcb5' stroke-width='1.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 24px;
}
select.field option {
  background: #1e201f;
  color: #e3e2e0;
}
textarea.field {
  resize: vertical;
  min-height: 120px;
}

/* ---------- Reduced motion respect ---------- */
@media (prefers-reduced-motion: reduce) {
  .cosmic-rings,
  .marquee-track,
  [class*="animate-["] {
    animation: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Image grayscale-to-color on hover ---------- */
.img-fade {
  filter: grayscale(100%);
  transition: filter 0.8s ease;
}
.img-fade:hover {
  filter: grayscale(0%);
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  display: none;
  background: rgba(18, 20, 19, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(234, 188, 181, 0.1);
}
.mobile-menu.open {
  display: block;
}

/* ---------- Article prose (single blog post) ---------- */
.prose-article p {
  font-family: "DM Sans", sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: #e3e2e0;
  margin-bottom: 1.5rem;
}
.prose-article h2 {
  font-family: "EB Garamond", serif;
  font-size: 32px;
  line-height: 1.3;
  color: #eabcb5;
  margin-top: 3rem;
  margin-bottom: 1rem;
}
.prose-article h3 {
  font-family: "EB Garamond", serif;
  font-size: 24px;
  color: #e3e2e0;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.prose-article blockquote {
  border-left: 2px solid #eabcb5;
  padding-left: 1.5rem;
  font-style: italic;
  color: #c1c8c4;
  margin: 2rem 0;
}
.prose-article ul, .prose-article ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: #e3e2e0;
}
.prose-article li {
  margin-bottom: 0.5rem;
  font-family: "DM Sans", sans-serif;
  line-height: 1.7;
}
.prose-article a {
  color: #eabcb5;
  text-decoration: underline;
  text-underline-offset: 4px;
}
