/* WattWhy LK — styles
 * Page rhythm: dark metallic sections (hero, features, advantage, team)
 * alternate with calm white sections. Tailwind (CDN) handles layout;
 * this file holds the shared components and effects.
 */

/* ---------- Base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { font-feature-settings: "cv02", "cv03", "cv04", "cv11"; }
.font-sinhala { font-family: 'Noto Sans Sinhala', 'Inter', sans-serif; letter-spacing: .02em; }
.font-tamil   { font-family: 'Noto Sans Tamil', 'Inter', sans-serif; letter-spacing: .02em; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #080c14; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ---------- Header & progress bar ---------- */
#mainHeader { transition: background .25s, box-shadow .25s; }
#mainHeader.scrolled {
  background: rgba(8, 12, 20, .98) !important;
  box-shadow: 0 12px 32px -5px rgba(0,0,0,.45), 0 0 1px 1px rgba(255,255,255,.1);
}
#scrollProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100;
  background: linear-gradient(90deg, #2563eb, #6366f1 35%, #9333ea 70%, #06b6d4);
  transition: width .1s ease-out;
}

/* ---------- Dark metallic surfaces ---------- */
.metallic-black-hero {
  position: relative; overflow: hidden; color: #f1f5f9;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, #172033 0%, #0c101c 55%, #060911 100%);
  border-bottom: 1px solid rgba(30, 41, 59, .8);
}
.glow { position: absolute; border-radius: 9999px; pointer-events: none; z-index: 0; }
.metallic-chassis {
  background: linear-gradient(145deg, #1f293d, #0d1322);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.8), inset 0 1px 1px rgba(255,255,255,.2);
}
.metallic-surface {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02)), #0c1220;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 40px -15px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.18);
}

/* ---------- Gradient text / buttons ---------- */
.gradient-purple-blue,
.gradient-purple-blue-light {
  display: inline-block; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gradient-purple-blue       { background-image: linear-gradient(135deg, #3b82f6, #6366f1 45%, #a855f7); }
.gradient-purple-blue-light { background-image: linear-gradient(135deg, #60a5fa, #818cf8 50%, #c084fc); }
.gradient-purple-blue-bg    { background: linear-gradient(135deg, #2563eb, #4f46e5 50%, #7e22ce); }
.gradient-purple-blue-glow  { box-shadow: 0 10px 30px -5px rgba(99,102,241,.35); }
.gradient-purple-blue-glow:hover { box-shadow: 0 15px 35px -5px rgba(147,51,234,.45); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  position: relative; overflow: hidden; font-weight: 700; color: #fff; border-radius: .75rem;
  padding: .85rem 1.75rem; transition: transform .2s; }
.btn:hover { transform: translateY(-2px); }
.btn::after { content: ""; position: absolute; inset: 0 auto 0 -100%; width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  transition: transform .7s ease; pointer-events: none; }
.btn:hover::after { transform: translateX(200%); }
.btn-ghost { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.15);
  color: #cbd5e1; box-shadow: none; }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- Section pieces ---------- */
.eyebrow { display: inline-block; padding: .25rem .9rem; border-radius: 9999px; font-size: .75rem;
  font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.dark .eyebrow, .eyebrow-dark { background: rgba(139,92,246,.2); color: #d8b4fe; border-color: rgba(168,85,247,.3); }
.icon-box { display: flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem;
  border-radius: 1rem; font-size: 1.4rem; transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.card:hover .icon-box { transform: scale(1.12) rotate(-3deg); }

/* ---------- Cards with cursor spotlight (light + dark) ---------- */
.card { position: relative; overflow: hidden; border-radius: 1.5rem; background: #fff;
  border: 1px solid rgba(226,232,240,.9);
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s, border-color .3s; }
.card::before { content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  transition: opacity .4s; background: radial-gradient(380px circle at var(--mouse-x,-500px) var(--mouse-y,-500px), rgba(99,102,241,.08), transparent 75%); }
.card:hover { transform: translateY(-5px); border-color: rgba(99,102,241,.35);
  box-shadow: 0 20px 35px -10px rgba(99,102,241,.12); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.card-dark { background: rgba(13,19,34,.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-color: rgba(255,255,255,.1); box-shadow: 0 20px 40px -15px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.12); }
.card-dark::before { background: radial-gradient(380px circle at var(--mouse-x,-500px) var(--mouse-y,-500px), rgba(147,51,234,.22), rgba(59,130,246,.16) 40%, transparent 75%); }
.card-dark:hover { border-color: rgba(168,85,247,.45);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.85), 0 0 25px rgba(99,102,241,.22); }
.inset-dark { background: rgba(8,13,25,.8); border: 1px solid rgba(255,255,255,.1); border-radius: 1rem; padding: 1rem; }

/* ---------- Phone mockup ---------- */
@keyframes float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(.4deg); } }
.device-float { animation: float 7s ease-in-out infinite; }
.device-float:hover { animation-play-state: paused; }
.lang-tab.active { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; box-shadow: 0 2px 6px rgba(79,70,229,.4); }

/* ---------- Calculator sliders ---------- */
input[type=range] { -webkit-appearance: none; appearance: none; background: #e2e8f0; border-radius: 9999px; height: 8px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 22px; width: 22px; border-radius: 50%;
  background: #4f46e5; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(79,70,229,.4); cursor: pointer; transition: transform .15s; }
input[type=range]::-moz-range-thumb { height: 18px; width: 18px; border-radius: 50%; background: #4f46e5; border: 3px solid #fff; cursor: pointer; }
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }
#baseUnits::-webkit-slider-thumb { background: #8b5cf6; }
#baseUnits::-moz-range-thumb { background: #8b5cf6; }

/* ---------- Form fields ---------- */
.field { width: 100%; padding: .75rem 1rem; border-radius: .75rem; font-size: .875rem; color: #0f172a;
  background: rgba(248,250,252,.7); border: 1px solid #cbd5e1; }
.field:focus { outline: 2px solid #6366f1; background: #fff; }
.label { display: block; margin-bottom: .4rem; font-size: .75rem; font-weight: 600; color: #334155;
  text-transform: uppercase; letter-spacing: .05em; }

/* ---------- FAQ ---------- */
.faq-item svg { transition: transform .25s; }
.faq-item button[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ---------- Modals ---------- */
.modal { display: none; position: fixed; inset: 0; z-index: 60; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.modal.open { display: flex; }

/* ---------- Scroll reveal ---------- */
.reveal-on-scroll, .reveal-scale { opacity: 0; transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal-on-scroll { transform: translateY(30px); }
.reveal-scale { transform: scale(.96) translateY(20px); }
.revealed { opacity: 1; transform: none; }
.stagger > :nth-child(2) { transition-delay: .1s; } .stagger > :nth-child(3) { transition-delay: .2s; }
.stagger > :nth-child(4) { transition-delay: .3s; } .stagger > :nth-child(5) { transition-delay: .4s; }

/* ---------- Back to top ---------- */
#backToTop { position: fixed; bottom: 28px; right: 28px; z-index: 40; opacity: 0; pointer-events: none;
  transform: translateY(16px); transition: opacity .3s, transform .3s; }
#backToTop.show { opacity: 1; transform: none; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .device-float { animation: none; }
  .reveal-on-scroll, .reveal-scale { opacity: 1; transform: none; transition: none; }
}
