/* ==========================================================================
   Chromatic Minimal Theme - Lake Area Electrical Services
   ========================================================================== */

/* --- Variables --- */
:root {
  --bg-base: #ffffff;
  --bg-alt: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #6b7280;
  --text-light: #f8fafc;

  --chromatic-gradient: linear-gradient(
    90deg,
    #00e5ff,
    #8b5cf6,
    #f472b6,
    #f59e0b
  );
  --chromatic-gradient-hover: linear-gradient(
    90deg,
    #f59e0b,
    #f472b6,
    #8b5cf6,
    #00e5ff
  );

  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-chromatic: 0 10px 30px -10px rgba(139, 92, 246, 0.3);

  --font-sans:
    "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

  --container-width: 1200px;
  --section-padding: 100px 0;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}
ul {
  list-style: none;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 {
  font-size: clamp(3rem, 5vw, 5rem);
}
h2 {
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  margin-bottom: 1rem;
}
h3 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  margin-bottom: 0.5rem;
}
p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}
.text-lead {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  color: var(--text-muted);
  font-weight: 300;
}

/* --- Layout Utility --- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}
.section {
  padding: var(--section-padding);
  position: relative;
}
.bg-alt {
  background-color: var(--bg-alt);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

/* --- UI Elements --- */
.chromatic-line {
  height: 3px;
  width: 100%;
  background: var(--chromatic-gradient);
}
.chromatic-text {
  background: var(--chromatic-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-weight: 600;
  border-radius: 4px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background-color: var(--text-main);
  color: var(--bg-base);
}
.btn-primary:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.btn-chromatic-outline {
  background: var(--bg-base);
  color: var(--text-main);
  position: relative;
  z-index: 1;
  border-radius: 4px;
}
.btn-chromatic-outline::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--chromatic-gradient);
  z-index: -1;
  border-radius: 6px;
}
.btn-chromatic-outline::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-base);
  z-index: -1;
  border-radius: 4px;
  transition: opacity var(--transition-fast);
}
.btn-chromatic-outline:hover::after {
  opacity: 0.9;
}

/* --- HEADER (Strict Consistency) --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  transition: transform 0.3s ease;
}
.header.scroll-down {
  transform: translateY(-100%);
}
.header.scroll-up {
  transform: translateY(0);
}
.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}
.header .logo img {
  height: 40px;
}
.header-nav ul {
  display: flex;
  gap: 2.5rem;
}
.header-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}
.header-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--chromatic-gradient);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-fast);
}
.header-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--text-main);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-base);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}
.mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu ul {
  text-align: center;
}
.mobile-menu li {
  margin-bottom: 2rem;
}
.mobile-menu a {
  font-size: 2rem;
  font-weight: 700;
}
.mobile-menu-close {
  position: absolute;
  top: 30px;
  right: 2rem;
  font-size: 2rem;
}

/* --- HERO SECTION --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}
.gradient-underline {
  position: relative;
  display: inline-block;
}
.gradient-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 8px;
  width: 100%;
  height: 6px;
  background: var(--chromatic-gradient);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
}
.reveal-active .gradient-underline::after {
  animation: growLine 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s;
}
.hero-3d-wrapper {
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  height: 400px;
  perspective: 1000px;
  z-index: 1;
  display: none;
}
.hero-3d-element {
  width: 100%;
  height: 100%;
  background: var(--bg-alt);
  border-radius: 50%;
  position: relative;
  transform-style: preserve-3d;
  box-shadow: var(--shadow-chromatic);
  border: 1px solid var(--border-light);
}
.hero-3d-element::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: var(--chromatic-gradient);
  opacity: 0.2;
  filter: blur(20px);
  z-index: -1;
}

@media (min-width: 1024px) {
  .hero-3d-wrapper {
    display: block;
  }
}

/* --- SERVICES (Cards) --- */
.service-card {
  background: var(--bg-base);
  padding: 3rem 2rem;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}
.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--chromatic-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-fast);
}
.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}
.service-card:hover::before {
  transform: scaleX(1);
}
.service-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}
.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* --- STATS --- */
.stats-section {
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.stat-item {
  text-align: center;
}
.stat-number {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}
.stat-label {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* --- INDUSTRIES (Editorial) --- */
.industry-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 6rem;
  padding-bottom: 6rem;
  border-bottom: 1px solid var(--border-light);
}
.industry-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.industry-row:nth-child(even) .industry-content {
  order: 2;
}
.industry-row:nth-child(even) .industry-image {
  order: 1;
}
.industry-image {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 4/3;
  background: #e2e8f0;
}

.industry-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.industry-img-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-base);
  transform-origin: right;
  z-index: 2;
}
.reveal-active .industry-img-mask {
  animation: slideOut 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- REPORTS (Interactive Tabs) --- */
.reports-wrapper {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 4rem;
}
.report-tabs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.report-tab {
  text-align: left;
  padding: 1rem;
  border-left: 2px solid var(--border-light);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.report-tab.active,
.report-tab:hover {
  color: var(--text-main);
  border-left-color: #8b5cf6;
  background: var(--bg-alt);
}
.report-content {
  background: var(--bg-base);
  padding: 3rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.report-pane {
  display: none;
  animation: fadeIn 0.5s ease;
}
.report-pane.active {
  display: block;
}
.bar-chart {
  margin-top: 2rem;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  height: 200px;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.bar-fill {
  width: 100%;
  background: var(--text-main);
  border-radius: 4px 4px 0 0;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.report-pane.active .bar-fill {
  transform: scaleY(1);
}
.bar-fill.chromatic {
  background: var(--chromatic-gradient);
}

/* --- CALCULATOR --- */
.calculator-box {
  background: var(--text-main);
  color: var(--bg-base);
  padding: 4rem;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}
.calculator-box::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--chromatic-gradient);
}
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.calc-input-group {
  margin-bottom: 2rem;
}
.calc-input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #94a3b8;
  font-weight: 500;
}
.calc-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 4px;
  background: #334155;
  border-radius: 2px;
  outline: none;
  margin-top: 1rem;
}
.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00e5ff;
  cursor: pointer;
}
.calc-result-box {
  text-align: center;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.calc-result-number {
  font-size: 4rem;
  font-weight: 800;
  color: #00e5ff;
  line-height: 1;
  margin: 1rem 0;
}

/* --- TESTIMONIALS --- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.testimonial-card {
  padding: 3rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-base);
  position: relative;
}
.quote-mark {
  font-size: 4rem;
  color: var(--bg-alt);
  position: absolute;
  top: 1rem;
  right: 2rem;
  font-family: serif;
  line-height: 1;
}
.client-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}
.client-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--text-muted);
}
.client-name {
  font-weight: 600;
  color: var(--text-main);
}
.client-role {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- FAQ --- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--border-light);
}
.faq-btn {
  width: 100%;
  text-align: left;
  padding: 1.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-icon {
  width: 24px;
  height: 24px;
  position: relative;
}
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  background: var(--text-main);
  transition: transform 0.3s ease;
}
.faq-icon::before {
  top: 11px;
  left: 0;
  width: 100%;
  height: 2px;
}
.faq-icon::after {
  top: 0;
  left: 11px;
  width: 2px;
  height: 100%;
}
.faq-item.active .faq-icon::after {
  transform: rotate(90deg) scaleY(0);
}
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0;
}
.faq-item.active .faq-content {
  max-height: 500px;
  padding-bottom: 1.5rem;
}

/* --- CONTACT CTA --- */
.contact-cta {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: var(--bg-alt);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition-fast);
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--text-main);
}
.form-textarea {
  resize: vertical;
  min-height: 150px;
}

/* --- FOOTER (Strict Consistency) --- */
.footer {
  background: var(--bg-base);
  color: var(--text-main);
  position: relative;
  border-top: 1px solid var(--border-light);
}
.footer-top-line {
  height: 4px;
  width: 100%;
  background: var(--chromatic-gradient);
  position: absolute;
  top: 0;
  left: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  padding: 5rem 0;
}
.footer-col h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}
.footer-logo img {
  height: 40px;
  margin-bottom: 1rem;
}
.footer-links li {
  margin-bottom: 0.75rem;
}
.footer-links a {
  color: var(--text-muted);
}
.footer-links a:hover {
  color: var(--text-main);
  padding-left: 5px;
}
.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding: 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.footer-legal-links {
  display: flex;
  gap: 1.5rem;
}

/* --- LIVE CHAT WIDGET --- */
.chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 99;
}
.chat-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--text-main);
  color: var(--bg-base);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-fast);
  cursor: pointer;
}
.chat-btn:hover {
  transform: scale(1.1);
}
.chat-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 320px;
  background: var(--bg-base);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-window.active {
  display: flex;
  animation: slideUpChat 0.3s ease;
}
.chat-header {
  background: var(--chromatic-gradient);
  padding: 1rem;
  color: var(--bg-base);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}
.chat-body {
  padding: 1rem;
  height: 250px;
  overflow-y: auto;
  background: var(--bg-alt);
}
.chat-message {
  background: var(--border-light);
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  max-width: 80%;
}
.chat-input-area {
  padding: 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 0.5rem;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 0.5rem;
}
.chat-send {
  background: var(--text-main);
  color: var(--bg-base);
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

/* --- LEGAL PAGES SPECIFIC --- */
.legal-page-header {
  background: var(--bg-alt);
  padding: 150px 0 80px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.1rem;
  color: var(--text-main);
}
.legal-content h2 {
  font-size: 1.75rem;
  margin: 2.5rem 0 1rem;
  color: var(--text-main);
}
.legal-content p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.legal-content ul {
  list-style: disc;
  padding-left: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

/* --- ANIMATIONS & UTILITIES --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes growLine {
  to {
    transform: scaleX(1);
  }
}
@keyframes slideOut {
  to {
    transform: scaleX(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUpChat {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .reports-wrapper,
  .calc-grid,
  .industry-row {
    grid-template-columns: 1fr;
  }
  .industry-row:nth-child(even) .industry-content {
    order: 1;
  }
  .industry-row:nth-child(even) .industry-image {
    order: 2;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 768px) {
  .header-actions,
  .header-nav {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
  .grid-4,
  .grid-3,
  .grid-2,
  .testimonial-grid {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 2.5rem;
  }
  .section {
    padding: 60px 0;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
