/* ============================================================
   IntelliGrid Energy Dynamic — Design System
   Dept. of Electrical Engineering, NIT Rourkela
   ============================================================ */

:root {
  /* Brand palette */
  --navy-950: #060b16;
  --navy-900: #0a1428;
  --navy-800: #0f1e38;
  --navy-700: #16294a;
  --navy-600: #1d3560;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-300: #5eead4;
  --electric-500: #2563eb;
  --electric-400: #3b82f6;
  --white: #ffffff;
  --off-white: #f4f7fb;
  --grey-100: #eef1f6;
  --grey-300: #c9d2e0;
  --grey-500: #7c8aa3;
  --grey-700: #445069;
  --ink: #0c1524;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Semantic tokens (flip these for dark mode) */
  --bg: var(--off-white);
  --surface: var(--white);
  --surface-alt: var(--grey-100);
  --text: var(--ink);
  --text-muted: var(--grey-700);
  --border: var(--grey-300);
  --accent: var(--teal-500);
  --accent-strong: var(--electric-500);
  --header-bg: var(--navy-900);
  --header-text: var(--white);

  /* Typography */
  --font-head: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Spacing / radius / shadow */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(10, 20, 40, 0.06);
  --shadow-md: 0 10px 30px rgba(10, 20, 40, 0.10);
  --shadow-lg: 0 24px 60px rgba(10, 20, 40, 0.18);
  --container: 1200px;
  --transition: 220ms cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg: var(--navy-950);
  --surface: var(--navy-900);
  --surface-alt: var(--navy-800);
  --text: var(--grey-100);
  --text-muted: var(--grey-300);
  --border: var(--navy-600);
  --header-bg: #071021;
  --header-text: var(--white);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
p { line-height: 1.7; color: var(--text-muted); margin: 0 0 1em; }
a { color: var(--accent-strong); text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
section { padding: 88px 0; }
.section-tight { padding: 56px 0; }

/* --- Eyebrow / section heading --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--accent);
  display: inline-block;
}
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--navy-950); box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost-light { background: rgba(255,255,255,0.08); color: var(--white); border-color: rgba(255,255,255,0.25); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.16); }
.btn-whatsapp { background: #25D366; color: #05230f; }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn-block { width: 100%; justify-content: center; }

/* --- Header / Nav --- */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: var(--container); margin: 0 auto; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand-mark {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(135deg, var(--teal-400), var(--electric-500));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; color: var(--navy-950);
  flex-shrink: 0;
}
.brand-text { line-height: 1.2; }
.brand-text .name { font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; }
.brand-text .sub { font-size: 0.72rem; color: var(--grey-300); }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links > li { position: relative; }
.nav-links > li > a, .nav-links > li > button {
  display: flex; align-items: center; gap: 4px;
  color: var(--grey-100); background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 0.92rem; font-weight: 500;
  padding: 10px 12px; border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}
.nav-links > li > a:hover, .nav-links > li > button:hover, .nav-links > li.open > button { background: rgba(255,255,255,0.08); color: var(--teal-300); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); color: var(--white); border: none; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.16); }

.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--navy-800); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md); min-width: 240px; padding: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all var(--transition);
}
.nav-links > li.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--grey-100); font-size: 0.9rem; }
.dropdown a:hover { background: rgba(255,255,255,0.06); color: var(--teal-300); }

.mobile-toggle { display: none; background: none; border: none; color: var(--white); cursor: pointer; }

@media (max-width: 980px) {
  .nav-links { position: fixed; top: 72px; left: 0; right: 0; bottom: 0; background: var(--navy-900);
    flex-direction: column; align-items: stretch; padding: 16px; gap: 2px; overflow-y: auto;
    transform: translateX(-100%); transition: transform var(--transition); }
  .nav-links.mobile-open { transform: translateX(0); }
  .nav-links > li > a, .nav-links > li > button { width: 100%; justify-content: space-between; padding: 14px 12px; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; display: none; box-shadow: none; background: var(--navy-800); }
  .nav-links > li.open .dropdown { display: block; }
  .mobile-toggle { display: block; }
  .search-btn-label { display: none; }
}

/* --- Hero --- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 15% 20%, rgba(45,212,191,0.18), transparent 45%),
              radial-gradient(circle at 85% 0%, rgba(37,99,235,0.22), transparent 40%),
              var(--navy-950);
  color: var(--white);
  padding: 120px 0 100px;
}
.hero .grid-svg { position: absolute; inset: 0; opacity: 0.35; pointer-events: none; }
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
.hero .eyebrow { color: var(--teal-300); }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--white); }
.hero .tagline { font-size: 1.15rem; color: var(--teal-300); font-weight: 600; margin-bottom: 18px; }
.hero .lede { color: var(--grey-300); font-size: 1.05rem; max-width: 640px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 64px; position: relative; z-index: 2; }
.hero-stat { padding: 18px; border-radius: var(--radius-md); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
.hero-stat .num { font-family: var(--font-head); font-size: 1.8rem; font-weight: 800; color: var(--teal-300); }
.hero-stat .label { font-size: 0.8rem; color: var(--grey-300); }
@media (max-width: 720px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }

/* --- Cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  height: 100%;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.card-icon {
  width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(20,184,166,0.15), rgba(37,99,235,0.15));
  color: var(--accent); margin-bottom: 18px;
}
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* --- Person / team card --- */
.person-card { text-align: center; }
.person-photo {
  width: 100%; aspect-ratio: 1/1; border-radius: var(--radius-md);
  background: var(--surface-alt); display: flex; align-items: center; justify-content: center;
  color: var(--grey-500); margin-bottom: 18px; overflow: hidden; font-size: 0.85rem; text-align: center; padding: 10px;
  border: 1px dashed var(--border);
}
.person-name { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; margin-bottom: 2px; }
.person-role { color: var(--accent); font-size: 0.85rem; font-weight: 600; margin-bottom: 10px; }
.person-links { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }

/* --- Badges / tags --- */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.badge-ongoing { background: rgba(37,99,235,0.12); color: var(--electric-500); }
.badge-completed { background: rgba(34,197,94,0.12); color: #16a34a; }
.badge-proposed { background: rgba(245,158,11,0.12); color: #b45309; }
.badge-instock { background: rgba(34,197,94,0.12); color: #16a34a; }
.badge-quote { background: rgba(124,138,163,0.15); color: var(--grey-700); }
.tag { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--surface-alt); color: var(--text-muted); font-size: 0.78rem; margin: 0 6px 6px 0; }

/* --- Placeholder blocks (used until real content supplied) --- */
.placeholder-note {
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 0.82rem; color: var(--grey-500); background: var(--surface-alt);
  margin-top: 10px;
}
.placeholder-photo { color: var(--grey-500); font-size: 0.8rem; }

/* --- CTA band --- */
.cta-band {
  background: linear-gradient(120deg, var(--navy-900), var(--navy-700));
  color: var(--white); border-radius: var(--radius-lg); padding: 56px; text-align: center;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: var(--grey-300); max-width: 620px; margin: 0 auto 28px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* --- Footer --- */
.site-footer { background: var(--navy-950); color: var(--grey-300); padding: 64px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr; gap: 32px; margin-bottom: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
.footer-col h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 16px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--grey-300); font-size: 0.9rem; }
.footer-col a:hover { color: var(--teal-300); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.82rem; }
.social-row { display: flex; gap: 10px; }

/* --- Breadcrumb --- */
.breadcrumb { background: var(--surface-alt); padding: 16px 0; font-size: 0.85rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { margin: 0 8px; color: var(--grey-500); }
.breadcrumb .current { color: var(--accent); font-weight: 600; }

/* --- Page header (internal pages) --- */
.page-header { background: var(--navy-900); color: var(--white); padding: 64px 0 56px; }
.page-header h1 { color: var(--white); font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.page-header p { color: var(--grey-300); max-width: 640px; }

/* --- Filters bar --- */
.filters-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 36px; }
.filters-bar select, .filters-bar input[type="text"] {
  padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: var(--font-body);
}
.filter-chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 0.85rem; cursor: pointer; transition: all var(--transition);
}
.filter-chip.active, .filter-chip:hover { background: var(--accent); color: var(--navy-950); border-color: var(--accent); }
.search-input-wrap { position: relative; flex: 1; min-width: 220px; }
.search-input-wrap input { width: 100%; padding-left: 40px; }
.search-input-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--grey-500); }

/* --- Forms --- */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: var(--font-body); font-size: 0.95rem;
}
.form-field textarea { resize: vertical; min-height: 110px; }
.form-field .req { color: var(--danger); }
.form-error { color: var(--danger); font-size: 0.8rem; margin-top: 4px; display: none; }
.form-note { font-size: 0.78rem; color: var(--grey-500); }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6,11,22,0.6); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 500; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg); max-width: 520px; width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 32px; position: relative; box-shadow: var(--shadow-lg);
}
.modal-close { position: absolute; top: 18px; right: 18px; background: var(--surface-alt); border: none; width: 34px; height: 34px; border-radius: 999px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text); }
.modal-product-preview { display: flex; gap: 14px; align-items: center; background: var(--surface-alt); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 20px; }
.modal-product-preview img, .modal-product-preview .ph { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }

/* --- Utility --- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.gap-10 { gap: 10px; }
.wrap { flex-wrap: wrap; }
.small { font-size: 0.85rem; }
.divider { height: 1px; background: var(--border); margin: 40px 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--navy-950); padding: 10px 16px; z-index: 999; }
.skip-link:focus { left: 10px; top: 10px; }

/* --- Back to top --- */
.back-to-top {
  position: fixed; bottom: 90px; right: 24px; width: 46px; height: 46px; border-radius: 999px;
  background: var(--navy-900); color: var(--white); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); border: none; cursor: pointer; opacity: 0; visibility: hidden; transition: all var(--transition); z-index: 150;
}
.back-to-top.show { opacity: 1; visibility: visible; }

/* --- Floating WhatsApp button --- */
.floating-whatsapp {
  position: fixed; bottom: 24px; right: 24px; width: 58px; height: 58px; border-radius: 999px;
  background: #25D366; color: #05230f; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); z-index: 150; border: none; cursor: pointer;
}

/* --- Animations --- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.reveal { animation: fadeUp 0.6s ease both; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
