/* ============================================
   NIVAM — Modern UI Layer v2
   Modernization: layout, interactions, effects.
   Brand colors, logo, fonts are UNTOUCHED.
   ============================================ */

/* ─── LOADING SCREEN ─── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--clr-bg-darkest);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.75rem;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
#loading-screen.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-screen__logo {
  width: 90px;
  animation: ls-pulse 1.6s ease-in-out infinite;
}
.loading-screen__logo img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 18px rgba(242,193,46,0.35));
}
.loading-screen__tagline {
  font-family: var(--ff-display);
  font-size: var(--fs-md);
  color: rgba(242,193,46,0.75);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.loading-screen__bar-track {
  width: 180px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.loading-screen__bar-fill {
  height: 100%;
  width: 0%;
  background: var(--grad-gold);
  border-radius: 2px;
  animation: ls-bar 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes ls-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.96); }
}
@keyframes ls-bar {
  0%   { width: 0%; }
  50%  { width: 65%; }
  85%  { width: 92%; }
  100% { width: 100%; }
}

/* ─── GRADIENT TEXT ─── */
.text-gradient {
  background: linear-gradient(135deg, #F2C12E 0%, #ffe082 55%, #C99B1A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline;
}

/* ─── NAVBAR GOLD TOP BORDER ON SCROLL ─── */
.navbar.enh-scrolled {
  border-top: 2px solid rgba(242, 193, 46, 0.28) !important;
}

/* ─── BENTO GRID — Programs ─── */
.programs-bento {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: var(--sp-6);
  margin-top: var(--sp-10);
}

/* Card 1 — Featured (top left, 2/3 width) */
.programs-bento .program-card:nth-child(1) {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}
.programs-bento .program-card:nth-child(1) .program-card__img-wrap {
  aspect-ratio: 16 / 7;
}
.programs-bento .program-card:nth-child(1) .program-card__title {
  font-size: var(--fs-2xl);
}

/* Card 2 — Tall (right column, spans 2 rows) */
.programs-bento .program-card:nth-child(2) {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
}
.programs-bento .program-card:nth-child(2) .program-card__img-wrap {
  aspect-ratio: 4 / 5;
}
.programs-bento .program-card:nth-child(2) .program-card__body {
  flex: 1;
}

/* Card 3 — Horizontal (bottom left, landscape) */
.programs-bento .program-card:nth-child(3) {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  flex-direction: row;
  align-items: stretch;
}
.programs-bento .program-card:nth-child(3) .program-card__img-wrap {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  min-width: 220px;
  width: 220px;
  flex-shrink: 0;
  aspect-ratio: unset;
  height: auto;
}
.programs-bento .program-card:nth-child(3) .program-card__img {
  height: 100%;
}
.programs-bento .program-card:nth-child(3) .program-card__body {
  justify-content: center;
}

/* ─── SVG STAT RINGS ─── */
.stats-rings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-8);
  position: relative;
  z-index: 1;
}

.stat-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  text-align: center;
}

.stat-ring__svg-wrap {
  position: relative;
  width: 136px;
  height: 136px;
}

.stat-ring__svg {
  width: 136px;
  height: 136px;
  transform: rotate(-90deg);
  display: block;
}

.stat-ring__track {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 6;
}

.stat-ring__fill {
  fill: none;
  stroke: url(#ring-grad);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 0 339;
  transition: stroke-dasharray 2.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-ring__num {
  font-family: var(--ff-display);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700;
  color: var(--clr-gold);
  line-height: 1;
  display: block;
}

.stat-ring__label {
  color: rgba(242,247,244,0.50);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-top: var(--sp-2);
  line-height: 1.4;
  max-width: 120px;
}

/* ─── MAGNETIC BUTTON ─── */
.btn--primary,
.btn--dark {
  will-change: transform;
}

/* ─── TEXT SCRAMBLE ─── */
[data-scramble] {
  display: inline-block;
}

/* ─── BOTTOM MOBILE NAV ─── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(6, 14, 9, 0.96);
  border-top: 1px solid rgba(242,193,46,0.18);
  z-index: 990;
  padding: 0.5rem 0 calc(0.55rem + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 28px rgba(0,0,0,0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.bottom-nav__items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 420px;
  margin: 0 auto;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0.4rem 0.5rem;
  text-decoration: none;
  color: rgba(242,247,244,0.42);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  border-radius: var(--radius-md);
  min-width: 48px;
}

.bottom-nav__item .lucide-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.75px;
  transition: stroke 0.2s ease;
}

.bottom-nav__item.active {
  color: var(--clr-gold);
}
.bottom-nav__item:hover {
  color: rgba(242,193,46,0.8);
  transform: translateY(-2px);
}

.bottom-nav__item--cta {
  background: var(--grad-gold);
  color: var(--clr-bg-darkest) !important;
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.1rem;
  font-size: 0.6rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(242,193,46,0.35);
}

.bottom-nav__item--cta .lucide-icon {
  stroke: var(--clr-bg-darkest);
}

.bottom-nav__item--cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(242,193,46,0.50);
  color: var(--clr-bg-darkest) !important;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: block;
  }
  body {
    padding-bottom: 72px;
  }
  /* Push WhatsApp float up so it doesn't overlap bottom nav */
  .whatsapp-float {
    bottom: calc(1.5rem + 72px);
  }
}

/* ─── FOOTER WATERMARK ─── */
.footer {
  position: relative;
  overflow: hidden;
}
.footer::after {
  content: 'NIVAM';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--ff-display);
  font-size: clamp(6rem, 18vw, 16rem);
  font-weight: 900;
  color: rgba(242, 193, 46, 0.035);
  letter-spacing: -0.02em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  line-height: 0.85;
  z-index: 0;
}
.footer .container { position: relative; z-index: 1; }

/* ─── TESTIMONIALS MARQUEE ─── */
.testimonials-marquee-outer {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  margin-top: var(--sp-10);
}

.testimonials-marquee-track {
  display: flex;
  gap: var(--sp-5);
  animation: testi-scroll 40s linear infinite;
  will-change: transform;
  width: max-content;
}

.testimonials-marquee-track:hover {
  animation-play-state: paused;
}

.testimonials-marquee-track .testimonial-card {
  flex: 0 0 340px;
  min-width: 340px;
  margin: 0;
}

@keyframes testi-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── SECTION TITLE FLUID SIZING (all pages) ─── */
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem) !important;
}

/* ─── VISION/MISSION cards - add top accent bar ─── */
#vision-mission .card {
  position: relative;
  overflow: hidden;
}
#vision-mission .card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-gold);
}

/* ─── HOW WE WORK step circles ─── */
#how-we-work .card > div:first-child {
  position: relative;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .programs-bento {
    grid-template-columns: 1fr 1fr;
  }
  .programs-bento .program-card:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1;
  }
  .programs-bento .program-card:nth-child(2) {
    grid-column: 1 / 2;
    grid-row: 2;
  }
  .programs-bento .program-card:nth-child(3) {
    grid-column: 2 / 3;
    grid-row: 2;
    flex-direction: column;
  }
  .programs-bento .program-card:nth-child(3) .program-card__img-wrap {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
  }
  .stats-rings-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-6);
  }
}

@media (max-width: 768px) {
  .programs-bento {
    grid-template-columns: 1fr;
  }
  .programs-bento .program-card:nth-child(1),
  .programs-bento .program-card:nth-child(2),
  .programs-bento .program-card:nth-child(3) {
    grid-column: auto;
    grid-row: auto;
    flex-direction: column;
  }
  .programs-bento .program-card:nth-child(1) .program-card__img-wrap {
    aspect-ratio: 16/9;
  }
  .programs-bento .program-card:nth-child(2) .program-card__img-wrap {
    aspect-ratio: 16/9;
  }
  .programs-bento .program-card:nth-child(3) .program-card__img-wrap {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
  }
  .stats-rings-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-5);
  }
  .stat-ring__svg-wrap,
  .stat-ring__svg {
    width: 110px;
    height: 110px;
  }
  .testimonials-marquee-track .testimonial-card {
    flex: 0 0 280px;
    min-width: 280px;
  }
}
