/* Swaramayi — custom CSS (Tailwind handles the rest via utility classes) */

/* ============================================================
   BASE
   ============================================================ */
html {
  scroll-behavior: smooth;
}

/* Prevent horizontal scroll site-wide and contain layout */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
  margin: 0;
  padding: 0;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img, video, iframe, svg, canvas {
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6, p, span, a {
  overflow-wrap: break-word;
  word-break: normal;
}

/* Ensure grid items never force horizontal expansion */
.grid > *, [class*="grid"] > * {
  min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body { font-family: 'Inter', sans-serif; }
h1, h2, h3, h4, h5, .font-heading { font-family: 'Poppins', sans-serif; }

/* ============================================================
   HEADER — ALIGNMENT & OVERFLOW FIX
   ============================================================ */

/* Header inner row — 3-column grid: logo | nav(centered) | cta */
#site-header .header-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "logo nav cta";
  align-items: center;
  height: 4.5rem;           /* 72px */
  gap: 1rem;
}

/* Logo always in left column */
#site-header .header-row > a:first-child {
  grid-area: logo;
}

/* Desktop nav — perfectly centred in the middle column */
#site-header .desktop-nav {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;             /* 20px — was 32px (gap-8) */
  flex-wrap: nowrap;
  min-width: 0;
  grid-area: nav;
}

@media (min-width: 1152px) {
  #site-header .desktop-nav { display: flex; }
}

/* CTA + hamburger share the right column */
#site-header .header-cta {
  display: none;
  align-items: center;
  flex-shrink: 0;
  grid-area: cta;
}
@media (min-width: 1152px) {
  #site-header .header-cta { display: flex; }
}

/* Hamburger: visible below 1152px, occupies the cta grid area */
#site-header #menu-toggle {
  grid-area: cta;
  flex-shrink: 0;
  display: flex !important;  /* override Tailwind's lg:hidden which kicks in at 1024px */
  align-items: center;
  justify-content: center;
}

/* Hide hamburger AND force-show desktop nav/cta above 1152px */
@media (min-width: 1152px) {
  #site-header #menu-toggle { display: none !important; }
  #mobile-menu { display: none !important; }
}

/* Scrolled state */
#site-header.scrolled {
  box-shadow: 0 8px 24px -10px rgba(15, 61, 46, 0.30);
  border-bottom-color: rgba(15, 61, 46, 0.10) !important;
}

/* Mobile menu: clamp height so it scrolls on short viewports */
#mobile-menu {
  max-height: calc(100dvh - 4.5rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   ACTIVE NAV UNDERLINE
   ============================================================ */
.nav-link { position: relative; padding-bottom: 4px; }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 0;
  background: #16A34A;
  transition: width .25s ease;
}
.nav-link:hover::after,
.nav-link.is-active::after { width: 100%; }

/* ============================================================
   HERO
   ============================================================ */
.hero-overlay {
  background:
    linear-gradient(180deg, rgba(15, 38, 28, 0.70) 0%, rgba(15, 61, 46, 0.45) 50%, rgba(10, 30, 22, 0.85) 100%);
}

.hero-grain {
  background-image: radial-gradient(rgba(248, 250, 248, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ============================================================
   HERO BADGE — India's No. 1 pill animations
   ============================================================ */

/* Soft pulsing glow on the No.1 badge — saffron + green halo */
@keyframes badge-no1-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 153, 51, 0.25), 0 0 8px rgba(19, 136, 8, 0.25); }
  50%       { box-shadow: 0 0 18px rgba(255, 153, 51, 0.5), 0 0 18px rgba(19, 136, 8, 0.45); }
}

.hero-badge-no1 {
  animation: badge-no1-glow 3s ease-in-out infinite;
}

/* Subtle green glow pulse on the descriptor badge */
@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0px rgba(74, 222, 128, 0); }
  50%       { box-shadow: 0 0 14px rgba(74, 222, 128, 0.3); }
}

.hero-badge-main {
  animation: badge-glow 2.8s ease-in-out infinite;
}


/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-delay-1.in-view { transition-delay: .08s; }
.reveal-delay-2.in-view { transition-delay: .16s; }
.reveal-delay-3.in-view { transition-delay: .24s; }
.reveal-delay-4.in-view { transition-delay: .32s; }
.reveal-delay-5.in-view { transition-delay: .40s; }
.reveal-delay-6.in-view { transition-delay: .48s; }

/* Counter */
.counter { font-variant-numeric: tabular-nums; }

/* ============================================================
   TIMELINE (vertical connector, mobile "How We Work")
   ============================================================ */
.timeline-item:not(:last-child) { position: relative; }
.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 27px; top: 56px; bottom: -32px;
  width: 2px;
  background: repeating-linear-gradient(180deg, #16A34A 0 6px, transparent 6px 12px);
}

/* Hide vertical connector when items are in a horizontal grid (≥640px) */
@media (min-width: 640px) {
  .timeline-grid .timeline-item:not(:last-child)::before {
    display: none;
  }
}

/* ============================================================
   FLOW DIAGRAM (supply-chain card connectors)
   ============================================================ */
.flow-line { position: relative; }
.flow-line::after {
  content: "";
  position: absolute;
  top: 50%; right: -1.75rem;
  width: 1.75rem; height: 2px;
  background: repeating-linear-gradient(90deg, #16A34A 0 6px, transparent 6px 12px);
}
.flow-line:last-child::after { display: none; }

/* Hide connectors when items wrap on small screens */
@media (max-width: 639px) {
  .flow-line::after { display: none; }
}

/* Animated dash */
.flow-dash {
  stroke-dasharray: 6 10;
  animation: dashmove 1.6s linear infinite;
}
@keyframes dashmove { to { stroke-dashoffset: -32; } }

/* ============================================================
   IMAGES & CARDS
   ============================================================ */
.zoom-wrap { overflow: hidden; }
.zoom-img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.zoom-wrap:hover .zoom-img { transform: scale(1.08); }

.lift { transition: transform .3s ease, box-shadow .3s ease; }
.lift:hover { transform: translateY(-6px); box-shadow: 0 20px 40px -18px rgba(15,61,46,0.35); }

.partner-logo { filter: none; opacity: 1; transition: filter .3s ease, opacity .3s ease, transform .3s ease; }
.partner-logo:hover { transform: scale(1.05); box-shadow: 0 8px 20px -8px rgba(15,61,46,0.25); }

/* ============================================================
   FOCUS
   ============================================================ */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #16A34A;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ============================================================
   MAP PULSE MARKER
   ============================================================ */
.pulse-marker { position: relative; }
.pulse-marker::before {
  content: "";
  position: absolute; inset: -8px;
  border-radius: 9999px;
  background: rgba(22,163,74,0.4);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.5); opacity: .8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ============================================================
   FORMS
   ============================================================ */
.field-input {
  width: 100%;
  border: 1px solid #E5E7EB;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field-input:focus {
  border-color: #16A34A;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
  outline: none;
}
.field-error { border-color: #DC2626 !important; }
.field-error-msg { color: #DC2626; font-size: 0.78rem; margin-top: 0.25rem; display: none; }
.field-error-msg.show { display: block; }

/* ============================================================
   IMAGE PLACEHOLDER SHIMMER
   ============================================================ */
.img-placeholder {
  background: linear-gradient(110deg, #E8EFEA 8%, #F4F8F5 18%, #E8EFEA 33%);
  background-size: 200% 100%;
  animation: shimmer 1.8s linear infinite;
}
@keyframes shimmer { to { background-position-x: -200%; } }

/* ============================================================
   VISION FLOW (index.html section 14)
   ============================================================ */
.vision-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
@media (max-width: 639px) {
  .vision-flow > svg,
  .vision-flow > i,
  .vision-flow .vision-arrow {
    transform: rotate(90deg);
  }
}

/* ============================================================
   RESPONSIVE HELPERS
   ============================================================ */

/* Internal padding safety on tiny screens */
@media (max-width: 479px) {
  section { padding-left: 1rem; padding-right: 1rem; }
  .max-w-7xl,
  .max-w-5xl,
  .max-w-4xl,
  .max-w-3xl,
  .max-w-2xl,
  .max-w-xl {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}
