/* ============================================================
   Smart Grid R&D Center — IITH
   main.css — Global Styles, Variables, Typography, Nav, Footer
   ============================================================ */

/* ── Approved Global Design System ──────────────────────────── */
:root {
  /* Master Energy Palette */
  --energy-dark:        #2A1208;
  --energy-brown:       #3D1B0C;
  --energy-burnt:       #C94B00;
  --energy-orange:      #FF7A00;
  --energy-amber:       #FF9F1C;
  --energy-light-amber: #FFC857;
  --energy-pale-amber:  #FFF1D6;

  --warm-white:         #FFF9F2;
  --white:              #FFFFFF;

  --text-dark:          #2A1208;
  --text-muted:         #6B5144;
  --text-light:         #A68C7B;

  --border-energy:      rgba(201, 75, 0, 0.22);
  --border-accent:      #FF7A00;
  --shadow-energy:      rgba(80, 25, 0, 0.14);

  /* Canonical Aliases */
  --color-navy:         #2A1208;
  --color-navy-mid:     #3D1B0C;
  --color-navy-light:   #5A2108;
  --color-green:        #FF7A00;
  --color-green-dark:   #C94B00;
  --color-green-light:  #FFC857;
  --color-white:        #FFFFFF;
  --color-off-white:    #FFF9F2;
  --color-gray-100:     #FBF3EA;
  --color-gray-200:     #E7D3C2;
  --color-gray-400:     #A68C7B;
  --color-gray-600:     #6B5144;
  --color-gray-800:     #3D1B0C;
  --color-text:         #2A1208;
  --color-text-muted:   #6B5144;
  --color-amber:        #FF9F1C;
  --color-amber-light:  #FFF1D6;
  --color-red:          #EF4444;

  /* Typography */
  --font-heading: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Font sizes (fluid clamp) */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  clamp(2.25rem, 5vw, 3.5rem);
  --text-6xl:  clamp(2.75rem, 6vw, 4.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --container-max: 1240px;
  --container-wide: 1440px;
  --nav-height: 72px;

  /* Borders */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  /* Shadows — Warm Energy */
  --shadow-sm:  0 1px 3px rgba(42, 18, 8, 0.06), 0 1px 2px rgba(42, 18, 8, 0.04);
  --shadow-md:  0 4px 16px rgba(42, 18, 8, 0.08), 0 2px 6px rgba(42, 18, 8, 0.04);
  --shadow-lg:  0 12px 35px rgba(80, 25, 0, 0.12), 0 4px 12px rgba(80, 25, 0, 0.06);
  --shadow-xl:  0 20px 55px rgba(80, 25, 0, 0.18);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-dark);
  background-color: var(--warm-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--energy-burnt);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--energy-orange); }

ul, ol { list-style: none; }

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--energy-dark);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

/* ── Layout Utilities ───────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--wide {
  max-width: var(--container-wide);
}

.section {
  padding: var(--space-20) 0;
  background-color: var(--warm-white);
}

.section--sm {
  padding: var(--space-12) 0;
}

.section--alt {
  background-color: var(--white);
}

.section--dark {
  background: linear-gradient(135deg, var(--energy-dark) 0%, var(--energy-brown) 100%);
  color: var(--white);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--white);
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-12);
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--energy-burnt);
  margin-bottom: var(--space-3);
}

.section-label--dark {
  color: var(--energy-light-amber);
}

.section-title {
  color: var(--energy-dark);
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.6;
}

/* Grid helpers */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background-color: var(--white);
  border-bottom: 1px solid var(--color-gray-200);
  box-shadow: 0 2px 10px rgba(42, 18, 8, 0.05);
  transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.navbar.scrolled {
  box-shadow: 0 4px 20px rgba(42, 18, 8, 0.08);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Brand */
.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar__logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.navbar__logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.navbar__brand-text {
  display: flex;
  flex-direction: column;
}

.navbar__brand-name {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--energy-dark);
  line-height: 1.2;
  white-space: nowrap;
}

.navbar__brand-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* Nav links */
.navbar__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.navbar__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
}

.navbar__link:hover {
  color: var(--energy-dark);
  background-color: var(--energy-pale-amber);
}

.navbar__link.active {
  color: var(--energy-dark);
  background-color: #FFEACC;
  font-weight: 700;
}

.navbar__link--cta {
  background-color: var(--energy-orange) !important;
  color: var(--energy-dark) !important;
  font-weight: 700 !important;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  margin-left: 0.25rem;
  box-shadow: 0 2px 10px rgba(255, 122, 0, 0.25);
  transition: all var(--transition-fast);
}

.navbar__link--cta:hover {
  background-color: var(--energy-amber) !important;
  color: var(--energy-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 122, 0, 0.35);
}

/* Mobile toggle */
.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  cursor: pointer;
}

.navbar__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--energy-dark);
  border-radius: var(--radius-full);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.navbar__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__toggle.open span:nth-child(2) { opacity: 0; }
.navbar__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.navbar__mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background-color: var(--white);
  border-bottom: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-md);
  padding: var(--space-4) var(--space-6);
  z-index: 999;
}

.navbar__mobile.open {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.navbar__mobile .navbar__link {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
}

/* Page top offset */
.page-content {
  margin-top: var(--nav-height);
}

/* ── Breadcrumb & Page Header ───────────────────────────────── */
.breadcrumb {
  background: linear-gradient(135deg, #2A1208 0%, #5A2108 45%, #C94B00 100%);
  padding: calc(var(--nav-height) + var(--space-8)) 0 var(--space-10);
  border-bottom: 3px solid var(--energy-orange);
  position: relative;
  overflow: hidden;
}

.breadcrumb::after {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(255, 159, 28, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.breadcrumb::before {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 15%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(255, 122, 0, 0.16) 0%, transparent 70%);
  pointer-events: none;
}

.breadcrumb__nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  position: relative;
  z-index: 1;
}

.breadcrumb__link {
  color: var(--energy-light-amber);
  opacity: 0.9;
  font-weight: 600;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.breadcrumb__link:hover { opacity: 1; color: var(--white); }

.breadcrumb__sep {
  color: rgba(255, 249, 242, 0.5);
}

.breadcrumb__current {
  color: var(--white);
  font-weight: 700;
}

.breadcrumb__title {
  color: var(--white);
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.breadcrumb__subtitle {
  color: rgba(255, 249, 242, 0.92);
  font-size: var(--text-lg);
  margin-top: var(--space-2);
  max-width: 720px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: linear-gradient(135deg, #1F0D05 0%, #2A1208 55%, #3D1B0C 100%);
  color: rgba(255, 249, 242, 0.85);
  padding: var(--space-16) 0 var(--space-8);
  border-top: 3px solid var(--energy-burnt);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer__logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: #FFFFFF;
  padding: 4px;
}

.footer__logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.footer__name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
}

.footer__tagline {
  font-size: var(--text-sm);
  color: rgba(255, 249, 242, 0.75);
  line-height: 1.6;
}

.footer__credits {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.footer__credit-item {
  font-size: var(--text-xs);
  color: rgba(255, 249, 242, 0.8);
}

.footer__credit-label {
  font-weight: 700;
  color: var(--energy-light-amber);
}

.footer__col-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--energy-light-amber);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__link {
  font-size: var(--text-sm);
  color: rgba(255, 249, 242, 0.82);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer__link:hover {
  color: var(--energy-amber);
  transform: translateX(2px);
}

.footer__bottom {
  border-top: 1px solid rgba(255, 200, 87, 0.18);
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.footer__copy {
  font-size: var(--text-sm);
  color: rgba(255, 249, 242, 0.7);
}

.footer__social {
  display: flex;
  gap: var(--space-3);
}

.footer__social-link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--energy-light-amber);
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  border: 1px solid rgba(255, 200, 87, 0.3);
  text-align: center;
}

.footer__social-link:hover {
  background-color: var(--energy-orange);
  color: var(--energy-dark);
  border-color: var(--energy-orange);
}

/* ── Scroll Animations ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
