/* Bharat Eco Solar Works & Elarviko Portal — Rich Motion, Animations & Transitions */
html {
  scroll-behavior: smooth;
}

@keyframes beswPageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes beswFadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes beswSolarPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
  }
}

@keyframes beswFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes beswShimmer {
  0% {
    transform: translateX(-120%) skewX(-20deg);
  }
  100% {
    transform: translateX(220%) skewX(-20deg);
  }
}

body {
  animation: beswPageIn 0.35s ease-out both;
  transition: opacity 180ms ease;
}

body.besw-leaving {
  opacity: 0;
}

/* Top Scroll Progress Indicator */
#besw-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 9999;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 50%, #10b981 100%);
  transition: width 80ms linear;
  pointer-events: none;
}

/* Nav Link Animated Underline */
header nav a {
  position: relative;
}

header nav a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  background: #f59e0b;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

header nav a:hover::after,
header nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Buttons & Interactive CTAs with Shimmer */
a, button {
  transition: color 180ms ease,
              background-color 180ms ease,
              border-color 180ms ease,
              transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 220ms ease,
              opacity 180ms ease;
}

a:active, button:active {
  transform: scale(0.97);
}

.besw-pulse {
  position: relative;
  overflow: hidden;
  animation: beswSolarPulse 2.6s infinite;
}

.besw-pulse::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-120%) skewX(-20deg);
}

.besw-pulse:hover::before {
  animation: beswShimmer 0.75s ease forwards;
}

/* Floating & Logo Micro-Interactions */
.besw-float {
  animation: beswFloat 4s ease-in-out infinite;
}

.besw-logo-hover:hover img {
  transform: scale(1.08) rotate(-3deg);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Smooth Form Input Focus Transition */
input, select, textarea {
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

/* Mobile drawer & desktop dropdown smooth reveal */
#mobile-nav-drawer {
  transition: opacity 240ms ease, transform 240ms ease;
}

.besw-dropdown-menu {
  animation: beswFadeUp 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.besw-dropdown.is-open .besw-chevron {
  transform: rotate(180deg);
}

/* Smooth FAQ <details> accordion animation */
details summary {
  cursor: pointer;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary .material-symbols-outlined {
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

details[open] summary .material-symbols-outlined {
  transform: rotate(180deg);
}

details[open] > *:not(summary) {
  animation: beswFadeUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ===== fx.js layer ===== */
.besw-animating { transition: none !important; }
.besw-word { display: inline-block; }
main [id] { scroll-margin-top: 96px; }

/* Highlighted word underline */
.besw-accent { position: relative; white-space: nowrap; }
.besw-accent svg { position: absolute; left: 0; right: 0; bottom: -0.14em; width: 100%; height: 0.28em; overflow: visible; }
.besw-accent path { fill: none; stroke: #f59e0b; stroke-width: 4px; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* Hero photo + light motes */
@keyframes beswKenBurns { from { scale: 1.04; } to { scale: 1.14; } }
.besw-kenburns { animation: beswKenBurns 18s ease-in-out infinite alternate; }
.besw-motes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.besw-motes i { position: absolute; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 10px 2px rgba(251, 191, 36, 0.7); opacity: 0; }

/* Cards: lift and cursor spotlight */
.besw-card { transition: translate 300ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 300ms ease, border-color 220ms ease; }
.besw-card:hover { translate: 0 -5px; box-shadow: 0 18px 34px -14px rgba(15, 23, 42, 0.22); }
@media (hover: hover) {
  .besw-card:not([class*="bg-gradient"]):hover { background-image: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(245, 158, 11, 0.10), transparent 70%); }
  .besw-card .material-symbols-outlined { transition: scale 300ms cubic-bezier(0.34, 1.56, 0.64, 1); }
  .besw-card:hover > div:first-child > .material-symbols-outlined:first-child { scale: 1.15; }
}

/* Header condense on scroll (public site) */
body > header.sticky > div:first-child { transition: height 260ms cubic-bezier(0.22, 1, 0.36, 1); }
body > header.besw-scrolled { box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.25); }
body > header.sticky.besw-scrolled > div:first-child { height: 4rem; }

/* Dropdown items cascade */
.besw-dropdown.is-open .besw-dropdown-menu a { animation: beswFadeUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
.besw-dropdown.is-open .besw-dropdown-menu a:nth-child(2) { animation-delay: 50ms; }
.besw-dropdown.is-open .besw-dropdown-menu a:nth-child(3) { animation-delay: 100ms; }

/* Range sliders with filled track */
input[type="range"].besw-range { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 99px; border: 0; padding: 0; cursor: pointer;
  background: linear-gradient(90deg, #f59e0b var(--fill, 50%), #d3e4fe var(--fill, 50%)) !important; }
input[type="range"].besw-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 5px solid #f59e0b; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3); transition: transform 160ms ease; }
input[type="range"].besw-range:active::-webkit-slider-thumb { transform: scale(1.25); }
input[type="range"].besw-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 5px solid #f59e0b; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3); }

/* Floating actions */
.besw-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; pointer-events: none; }
.besw-fab > * { pointer-events: auto; }
.besw-top { position: relative; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #855300; display: grid; place-items: center; box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.35); opacity: 0; visibility: hidden; translate: 0 12px; transition: opacity 250ms ease, translate 250ms ease, visibility 250ms; }
.besw-top.is-on { opacity: 1; visibility: visible; translate: 0 0; }
.besw-top svg { position: absolute; inset: 0; transform: rotate(-90deg); fill: none; stroke: #e5eeff; stroke-width: 3; }
.besw-top .besw-ring { stroke: #f59e0b; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.besw-wa { position: relative; display: flex; align-items: center; height: 52px; min-width: 52px; justify-content: center; padding: 0 14px; border-radius: 99px; background: #128c4a; color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 10px 24px -8px rgba(18, 140, 74, 0.7); }
.besw-wa::before { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid #25d366; animation: beswPing 2.4s ease-out infinite; pointer-events: none; }
.besw-wa-label { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width 300ms ease, margin 300ms ease; }
.besw-wa:hover .besw-wa-label, .besw-wa:focus-visible .besw-wa-label { max-width: 120px; margin-left: 8px; }
@keyframes beswPing { 0% { transform: scale(1); opacity: 0.8; } 70%, 100% { transform: scale(1.35); opacity: 0; } }

/* Form states */
.besw-spinner { display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: beswSpin 0.7s linear infinite; }
@keyframes beswSpin { to { transform: rotate(360deg); } }
@keyframes beswShake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.besw-shake { animation: beswShake 0.45s ease; border-color: #ba1a1a !important; box-shadow: 0 0 0 3px rgba(186, 26, 26, 0.2) !important; }
.besw-toast { position: fixed; left: 50%; bottom: 24px; z-index: 10000; width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: #93000a; color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 14px 30px -10px rgba(15, 23, 42, 0.5); translate: -50% 0; animation: beswFadeUp 0.3s ease both; }
.besw-confetti { position: fixed; z-index: 10001; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; opacity: 0; }

/* Unverified-claim labels (includes/claims.php) */
.besw-claim { display: inline-block; width: fit-content; align-self: flex-start; vertical-align: middle; margin: 2px 0; padding: 1px 7px; border-radius: 4px; background: #fef3c7; color: #713f12; border: 1px dashed #b45309; font-size: 10px; line-height: 15px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.besw-claim-note { position: relative; z-index: 20; width: 100%; max-width: 1280px; margin: 0 auto; padding: 8px 1.25rem; }
.besw-claim-note p { margin: 0; padding: 10px 14px; border-radius: 8px; background: #fef3c7; color: #713f12; border: 1px dashed #b45309; font-size: 13px; line-height: 19px; text-align: left; font-weight: 500; }
.besw-claim-footer { padding: 0 0 1.5rem; }
.besw-preview-bar { background: #fef3c7; color: #713f12; text-align: center; font-size: 12px; line-height: 18px; padding: 5px 12px; }
.besw-preview-bar a { text-decoration: underline; font-weight: 700; }

@media print {
  .besw-fab, .besw-motes, #besw-scroll-progress { display: none !important; }
  body > header { position: static !important; }
  main { padding-top: 0 !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

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

/* Illustrated bands and isometric scenes (includes/graphics.php) */
.besw-band { width: 100%; padding: 4rem 1.25rem; background: radial-gradient(900px 420px at 82% 40%, rgba(251, 191, 36, 0.14), transparent 70%), linear-gradient(180deg, #ffffff, #eff4ff); overflow: hidden; }
.besw-band-inner { max-width: 1216px; margin: 0 auto; display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .besw-band-inner { grid-template-columns: 5fr 7fr; } }
.besw-kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #855300; }
.besw-band h2 { margin: 6px 0 10px; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.18; font-weight: 800; letter-spacing: -0.02em; color: #0b1c30; }
.besw-lead { font-size: 16px; line-height: 26px; color: #475569; }
.besw-band ul { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.besw-band li { display: flex; gap: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.86); border: 1px solid #e5eeff; box-shadow: 0 8px 22px -16px rgba(15, 23, 42, 0.35); transition: translate 250ms ease, box-shadow 250ms ease; }
.besw-band li:hover { translate: 6px 0; box-shadow: 0 14px 28px -16px rgba(15, 23, 42, 0.4); }
.besw-band li > .material-symbols-outlined { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #fde68a, #f59e0b); color: #613b00; }
.besw-band li strong { display: block; font-size: 15px; color: #0b1c30; }
.besw-band li p { margin: 2px 0 0; font-size: 13px; line-height: 19px; color: #526075; }
.besw-art { margin: 0; text-align: center; }
.besw-art figcaption { font-size: 11px; color: #64748b; }
.besw-scene { display: block; width: 100%; height: auto; overflow: visible; }
.besw-flow { animation: beswFlow 0.9s linear infinite; }
@keyframes beswFlow { to { stroke-dashoffset: -26; } }
.besw-sunrays { animation: beswTurn 26s linear infinite; }
@keyframes beswTurn { to { transform: rotate(360deg); } }
.besw-cloud { animation: beswDrift 16s ease-in-out infinite alternate; }
@keyframes beswDrift { to { transform: translateX(60px); } }
.besw-tag { animation: beswFloat 4.5s ease-in-out infinite; }
.besw-cell { animation: beswGlint 6s ease-in-out infinite; animation-delay: calc(var(--i) * 0.16s); }
@keyframes beswGlint { 0%, 82%, 100% { filter: none; } 90% { filter: brightness(1.7); } }

.project-art { height: 100%; padding: 4px; transition: scale 450ms cubic-bezier(0.22, 1, 0.36, 1); }
.project-art .besw-scene { height: 100%; overflow: hidden; }
.project-card:hover .project-art { scale: 1.08; }

/* Data charts (includes/charts.php) */
.besw-chart-wrap { display: grid; gap: 1rem; align-items: center; }
@media (min-width: 900px) { .besw-chart-wrap { grid-template-columns: minmax(0, 5fr) minmax(220px, 2fr); } }
.besw-chart { width: 100%; height: auto; font-family: Inter, sans-serif; }
.besw-chart text { font-size: 11px; fill: #64748b; }
.besw-chart text.axis { font-size: 12px; font-weight: 700; fill: #334155; }
.besw-chart text.num { font-size: 10.5px; font-weight: 800; fill: #fff; }
.besw-dot { transform-box: fill-box; transform-origin: center; transition: scale 200ms ease; }
.besw-dot:hover { scale: 1.25; }
.besw-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; color: #1e293b; }
.besw-legend li { display: flex; align-items: center; gap: 8px; }
.besw-legend i { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; }
.besw-timeline { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 1.5rem; }
.besw-timeline > div { flex-basis: 0; min-width: 130px; padding: 12px 14px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, hsl(calc(217 + var(--i) * 4) 62% calc(22% + var(--i) * 7%)), hsl(calc(217 + var(--i) * 4) 68% calc(34% + var(--i) * 7%))); animation: beswFadeUp 0.6s ease both; animation-delay: calc(var(--i) * 120ms); }
.besw-timeline strong { display: block; font-size: 13px; }
.besw-timeline span { font-size: 11px; opacity: 0.85; }
@media print { .besw-band { break-inside: avoid; } }

/* Developer credit (includes/credit.php): "Designed, Developed & Cared by [logo + name]" */
.besw-credit { width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; background: #050b18; padding: 12px 1.25rem 140px; text-align: center; }
@media (min-width: 640px) { .besw-credit { padding: 12px 84px; } }
.besw-credit-text { font-size: 14px; line-height: 20px; color: #e2e8f0; }
.besw-credit-pill { display: inline-flex; align-items: center; gap: 9px; padding: 3px 16px 3px 4px; border-radius: 99px; background: rgba(251, 191, 36, 0.07); border: 1px solid rgba(251, 191, 36, 0.38); white-space: nowrap; transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease; }
.besw-credit-pill strong { font-size: 14px; font-weight: 800; color: #fcd34d; }
.besw-credit-pill:hover { background: rgba(251, 191, 36, 0.16); border-color: #fbbf24; box-shadow: 0 0 18px -4px rgba(251, 191, 36, 0.6); }
.besw-credit-badge { flex: none; display: block; width: 40px; height: 40px; border-radius: 50%; }
@media print { .besw-credit { background: none; padding: 12px; } .besw-credit-text, .besw-credit-pill strong { color: #0b1c30; } }
