/* =========================================================
   Samsara Materials - Main Stylesheet
   ========================================================= */

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

html { 
  scroll-behavior: smooth; 
}

body { 
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; 
  line-height: 1.5; 
  color: #121212; 
  background-color: #ffffff; 
  transition: background 0.3s, color 0.3s; 
}

a { 
  color: inherit; 
  text-decoration: none; 
}

img { 
  max-width: 100%; 
  display: block; 
}

ul { 
  list-style: none; 
}

.container { 
  width: 100%; 
  max-width: 1120px; 
  margin: 0 auto; 
  padding: 0 1.5rem; 
}

/* =========================================================
   Header & Navigation
   ========================================================= */

.site-header { 
  position: sticky; 
  top: 0; 
  z-index: 100; 
  background: rgba(245, 245, 245, 0.98); 
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08); 
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
}

/* Enhanced glassmorphism when scrolled */
.site-header.scrolled {
  background: rgba(245, 245, 245, 1);
  backdrop-filter: blur(16px) saturate(200%);
  -webkit-backdrop-filter: blur(16px) saturate(200%);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.header-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 0.75rem 0; 
}

.logo { 
  font-weight: 700; 
  font-size: 1.1rem; 
  letter-spacing: 0.06em; 
  text-transform: uppercase; 
  color: #2c3e50; 
}

.site-header .header-inner > a.logo { 
  display: flex; 
  align-items: center; 
  font-size: 0; 
  text-decoration: none; 
}

.site-header .header-inner > a.logo::before { 
  content: ""; 
  display: inline-block; 
  width: 190px; 
  height: 60px; 
  background-image: url('https://a7jd73.webwave.dev/lib/a7jd73/logo-mk94ikbc.png'); 
  background-repeat: no-repeat; 
  background-size: contain; 
  background-position: center;
}

.nav-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.5rem;
  color: #2c3e50;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle:focus-visible {
  outline: 2px solid #00a68d;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.nav-links { 
  list-style: none; 
  display: flex; 
  align-items: center; 
  gap: 1.25rem; 
  font-size: 0.92rem; 
}

.nav-links > li > a { 
  padding: 0.35rem 0; 
  border-bottom: 2px solid transparent; 
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
  font-weight: 500; 
  color: #2c3e50;
  position: relative;
}

.nav-links > li > a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #7dd3c0, #00a68d);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links > li > a:hover::after,
.nav-links > li > a:focus::after { 
  width: 100%;
}

.nav-links > li > a:hover,
.nav-links > li > a:focus { 
  color: #00a68d;
  transform: translateY(-1px);
}

.nav-cta { 
  padding: 0.4rem 0.9rem !important; 
  border-radius: 999px !important; 
  border: 2px solid #c44d58 !important; 
  font-weight: 500; 
  background: #c44d58 !important; 
  color: #ffffff !important; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(196, 77, 88, 0.2);
}

.nav-cta:hover,
.nav-cta:focus { 
  background: #d66570 !important;
  border-color: #d66570 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(196, 77, 88, 0.35);
}

/* =========================================================
   Hero Section
   ========================================================= */

.hero { 
  padding: 4rem 0; 
}

.hero-grid { 
  display: grid; 
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); 
  gap: 2.5rem; 
  align-items: start; 
}

.hero-kicker { 
  text-transform: uppercase; 
  letter-spacing: 0.12em; 
  font-size: 0.75rem; 
  color: #777; 
  margin-bottom: 0.75rem; 
  font-weight: 600;
}

.hero-title { 
  font-size: clamp(2.1rem, 3vw, 2.7rem); 
  font-weight: 700; 
  margin-bottom: 1rem; 
  line-height: 1.2;
}

.hero-text { 
  font-size: 1rem; 
  color: #444; 
  max-width: 36rem; 
  line-height: 1.6;
}

.hero-actions { 
  margin-top: 1.75rem; 
  display: flex; 
  flex-wrap: wrap; 
  gap: 0.9rem; 
}

.hero-right { 
  display: flex; 
  flex-direction: column; 
  gap: 1.25rem; 
}

.hero-img-wrap { 
  border-radius: 1.25rem; 
  overflow: hidden; 
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.18); 
  background-color: #f1f5f9;
}

.hero-image { 
  width: 100%; 
  max-height: 288px; 
  display: block; 
  object-fit: cover; 
}


/* =========================================================
   Buttons
   ========================================================= */

.btn { 
  display: inline-flex; 
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.3rem; 
  border-radius: 0.5rem; 
  font-weight: 600; 
  cursor: pointer; 
  transition: all 0.2s ease; 
  border: none;
  text-align: center;
}

.btn-primary { 
  background: #00a68d; 
  color: #fff; 
  border: 1px solid #00a68d; 
}

.btn-primary:hover,
.btn-primary:focus { 
  background: #008f77; 
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 166, 141, 0.3);
}

.btn-secondary { 
  background: transparent; 
  color: #00a68d; 
  border: 1px solid #00a68d; 
}

.btn-secondary:hover,
.btn-secondary:focus { 
  background: rgba(0, 166, 141, 0.1); 
  transform: translateY(-2px);
}

/* =========================================================
   Layout Components - CONSISTENT SPACING
   ========================================================= */

.section { 
  padding: 4rem 0; 
  background-color: #ffffff;
}

.section-alt { 
  background-color: #a8ddd4; 
  color: #121212;
}

.section-heading { 
  font-size: 1.6rem; 
  margin-bottom: 0.75rem; 
  font-weight: 700;
  line-height: 1.3;
}

.section-subtitle { 
  color: #555; 
  max-width: 48rem; 
  margin-bottom: 2rem; 
  font-size: 0.98rem; 
  line-height: 1.6;
}

/* Subsection headings within sections */
.section h3.section-heading {
  margin-top: 3rem;
}

.grid-3 { 
  display: grid; 
  grid-template-columns: repeat(3, minmax(0, 1fr)); 
  gap: 1.75rem; 
  background-color: #daf0ec;
  padding: 2rem;
  border-radius: 1rem;
}

.grid-2 { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 2.5rem; 
  align-items: start; 
  background-color: #daf0ec;
  padding: 2rem;
  border-radius: 1rem;
}

/* Exception: Hero grids should not have grey background */
.hero-grid {
  background-color: transparent;
  padding: 0;
}

/* Exception: Grids with inline grid-template-columns override */
.grid-2[style*="grid-template-columns"],
.grid-2[style*="align-items"] {
  background-color: transparent;
  padding: 0;
}

/* Exception: Single column grids for full-width cards */
[style*="grid-template-columns: 1fr"] {
  background-color: transparent;
  padding: 0;
}

/* Contact Split Grid */
.split-layout-grid { 
  display: grid; 
  grid-template-columns: 0.65fr 1.35fr; 
  gap: 2.5rem; 
}

/* =========================================================
   Cards
   ========================================================= */

.card { 
  background: #ffffff; 
  color: #121212;
  border-radius: 1rem; 
  padding: 1.5rem; 
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.10); 
  transition: transform 0.2s ease, box-shadow 0.2s ease; 
  height: 100%; 
  position: relative; 
}

.card:hover { 
  transform: translateY(-4px); 
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.22); 
}

.card h3 { 
  font-size: 1.2rem; 
  margin-bottom: 0.5rem; 
  font-weight: 600;
  line-height: 1.3;
}

.card p { 
  color: #555; 
  line-height: 1.6;
}

/* =========================================================
   Performance Tables & Metrics
   ========================================================= */

.table-wrapper { 
  overflow-x: auto; 
  margin: 2rem 0; 
  border: 1px solid #e3e3e3; 
  border-radius: 0.5rem; 
}

table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 0.9rem; 
}

th, 
td { 
  padding: 0.75rem 1rem; 
  text-align: left; 
  border-bottom: 1px solid #e3e3e3; 
}

th { 
  font-weight: 600; 
  color: #444; 
  background: #fafafa; 
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: #f9f9f9;
}

.counter { 
  font-size: 2.2rem; 
  font-weight: 700; 
  color: #0f766e; 
}

#impact-counters-eco { 
  transition: opacity 0.6s ease-in-out; 
}

#impact-counters-eco.ticker-fade { 
  opacity: 0; 
}

.impact-year-label { 
  font-size: inherit; 
  font-weight: inherit; 
  color: inherit; 
  white-space: nowrap; 
}

/* =========================================================
   Profile Toggle Logic
   ========================================================= */

.profile-container { 
  position: relative; 
  margin-top: 0.5rem; 
}

.profile-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.92rem;
  color: #555;
  line-height: 1.6;
}

.profile-text.expanded {
  display: block;
  -webkit-line-clamp: initial;
}

.read-more-btn {
  display: block;
  margin-top: 1.5rem;
  color: #007bff;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0;
  text-align: left;
  transition: color 0.2s ease;
}

.read-more-btn:hover,
.read-more-btn:focus {
  color: #0056b3;
  text-decoration: underline;
}

/* =========================================================
   Technical Resources & Downloads
   ========================================================= */

.btn-download { 
  color: #007bff !important; 
  font-weight: 600; 
  font-size: 0.85rem; 
  text-decoration: underline; 
  margin-top: 1.5rem; 
  display: inline-block; 
  cursor: pointer; 
  transition: color 0.2s ease;
}

.btn-download:hover,
.btn-download:focus {
  color: #0056b3 !important;
}

/* =========================================================
   FAQ Accordion
   ========================================================= */

details { 
  border-bottom: 1px solid #f1f5f9; 
  padding: 1rem 0; 
  cursor: pointer; 
}

summary { 
  font-weight: 700; 
  color: #1e293b; 
  list-style: none; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  cursor: pointer;
  user-select: none;
}

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

summary::after { 
  content: "+"; 
  font-size: 1.5rem; 
  color: #00a68d; 
  transition: transform 0.3s ease; 
  flex-shrink: 0;
  margin-left: 1rem;
}

details[open] summary::after { 
  transform: rotate(45deg); 
}

details p { 
  padding-top: 1rem; 
  color: #475569; 
  animation: slideDown 0.3s ease; 
  line-height: 1.6;
}

/* =========================================================
   Partner Logos
   ========================================================= */

.partner-logo { 
  height: 45px; 
  width: auto; 
  max-width: 100%; 
  object-fit: contain; 
  margin-bottom: 1.25rem; 
  display: block; 
}

/* =========================================================
   Image Wrappers
   ========================================================= */

.application-image-wrapper, 
.install-image-wrapper, 
.video-thumb-wrapper { 
  margin-bottom: 0.85rem; 
  border-radius: 0.9rem; 
  overflow: hidden; 
  background-color: #f1f5f9;
}

.application-image, 
.install-image, 
.video-thumb { 
  width: 100%; 
  height: 180px; 
  display: block; 
  object-fit: cover; 
  transition: transform 0.3s ease;
}

.card:hover .application-image,
.card:hover .install-image,
.card:hover .video-thumb {
  transform: scale(1.05);
}

/* =========================================================
   Tech Step Badges
   ========================================================= */

.tech-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: #00a68d;
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
  margin-right: 0.85rem;
  flex-shrink: 0;
  vertical-align: middle;
}

.card .tech-step-badge + h3 {
  display: inline;
  margin-bottom: 0;
}

.card .tech-step-badge ~ p:first-of-type {
  margin-top: 1rem;
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer { 
  background: #1e293b; 
  color: #f1f5f9; 
  padding: 2rem 0; 
  margin-top: 0;
}

.site-footer p {
  margin: 0;
}

.footer-email {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-email:hover {
  color: #00a68d;
}

.footer-email svg {
  flex-shrink: 0;
}

.footer-email {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-email:hover {
  color: #00a68d;
}

.footer-email svg {
  flex-shrink: 0;
}

/* =========================================================
   Back to Top Button
   ========================================================= */

#backToTop { 
  position: fixed; 
  bottom: 2rem; 
  right: 2rem; 
  background: #00a68d; 
  color: #fff; 
  padding: 0.75rem 1.25rem; 
  border-radius: 0.5rem; 
  cursor: pointer; 
  opacity: 0; 
  pointer-events: none; 
  transition: opacity 0.3s ease, transform 0.2s ease; 
  font-weight: 600; 
  z-index: 90;
  box-shadow: 0 4px 12px rgba(0, 166, 141, 0.3);
}

#backToTop.show { 
  opacity: 1; 
  pointer-events: all; 
}

#backToTop:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 166, 141, 0.4);
}

/* =========================================================
   Utility Classes (replacing inline styles)
   ========================================================= */

/* Single-column stacked grid */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.stack-grid-lg {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

/* Text alignment */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

/* Margin utilities */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-2 { margin-bottom: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Impact page callout boxes */
.impact-callout {
  padding: 1rem;
  background: #cceee7;
  border-radius: 0.5rem;
  border: 1px solid #00a68d;
  margin-top: 1rem;
}

.impact-summary {
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 0.5rem;
  border-left: 4px solid #00a68d;
  margin-bottom: 2rem;
}

.impact-summary p {
  font-size: 1.1rem;
  margin: 0;
}

/* Applications Under Development: product cards */
.dev-products {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dev-product-card {
  display: flex;
  gap: 2rem;
  align-items: start;
}

.dev-product-img {
  flex: 0 0 30%;
  max-width: 30%;
}

.dev-product-content {
  flex: 1;
}

/* Feature list styling */
.feature-list {
  list-style: disc;
  padding-left: 1.5rem;
  color: #555;
  line-height: 1.8;
}

.feature-list li {
  margin-bottom: 0.5rem;
}

/* Spec tables (replacing inline table styles) */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto;
  max-width: 64rem;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.spec-table thead tr {
  background: #00a68d;
  color: white;
}

.spec-table th,
.spec-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid #ddd;
}

.spec-table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

/* CTA section variants */
.section-cta-light {
  background: #cceee7;
}

.section-cta-medium {
  background: #7ecfbe;
}

.section-cta-alt {
  background: #99d9cc;
}

/* Contact form */
.form-grid {
  display: grid;
  gap: 1.25rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-input {
  padding: 1rem;
  border: 1px solid #e3e3e3;
  border-radius: 0.5rem;
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
}

.form-input:focus {
  outline: 2px solid #00a68d;
  outline-offset: 2px;
}

textarea.form-input {
  resize: vertical;
}

.form-wrapper {
  max-width: 48rem;
  margin: 0 auto;
}

/* Hero image max height override */
.hero-image-tall {
  max-height: none;
  height: 100%;
}

/* Subsection headings for advisors etc */
.subsection-heading {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

/* Hero statement text */
.hero-statement {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.4;
  color: #121212;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================
   Form Inputs
   ========================================================= */

input[type="text"],
input[type="email"],
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: 2px solid #00a68d;
  outline-offset: 2px;
}

/* =========================================================
   Animations
   ========================================================= */

@keyframes slideDown { 
  from { 
    opacity: 0; 
    transform: translateY(-10px); 
  } 
  to { 
    opacity: 1; 
    transform: translateY(0); 
  } 
}

/* =========================================================
   Mobile Responsive
   ========================================================= */

/* Tablet/iPad (landscape and portrait) */
@media (max-width: 1024px) and (min-width: 761px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    padding: 1.5rem;
  }
  
  .container {
    padding: 0 1.25rem;
  }
}

@media (max-width: 900px) { 
  .hero-grid { 
    grid-template-columns: minmax(0, 1fr); 
  }
  
  .hero { 
    padding: 3rem 0; 
  }
  
  .section {
    padding: 3rem 0;
  }
}

@media (max-width: 760px) {
  /* Disable backdrop-filter on header and .scrolled variant —
     iOS Safari traps position:fixed children inside backdrop-filter parents */
  .site-header,
  .site-header.scrolled {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(245, 245, 245, 0.98);
  }

  .nav-toggle {
    display: block;
  }

  /* CLOSED state: display:none guarantees nothing peeks through.
     max-height/overflow/padding tricks fail on certain iOS Safari versions. */
  .nav-links {
    display: none !important;
    position: fixed;
    top: 61px;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 200;
    background: rgba(245, 245, 245, 0.98);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  }

  /* OPEN state: show the menu */
  .nav-open .nav-links {
    display: flex !important;
  }
  
  .grid-3, 
  .grid-2, 
  .split-layout-grid { 
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }

  /* Dev product cards: stack on mobile */
  .dev-product-card {
    flex-direction: column;
  }

  .dev-product-img {
    flex: none;
    max-width: 100%;
  }

  /* Contact form: single column on mobile */
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  
  .section { 
    padding: 2.5rem 0; 
  }
  
  .section-heading {
    font-size: 1.4rem;
  }
  
  #backToTop {
    bottom: 1rem;
    right: 1rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Adjust tech badges for mobile */
  .tech-step-badge {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.85rem;
    margin-right: 0.65rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .hero {
    padding: 2.5rem 0;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .card {
    padding: 1.25rem;
  }
  
  .counter {
    font-size: 1.8rem;
  }
  
  .section {
    padding: 2rem 0;
  }
  
  /* Further reduce grid padding on phones */
  .grid-3,
  .grid-2 {
    padding: 1rem;
    gap: 1.25rem;
  }
  
  /* Make tech badges even smaller on phones */
  .tech-step-badge {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
    margin-right: 0.5rem;
  }
  
  /* Adjust card titles with badges */
  .card .tech-step-badge + h3 {
    font-size: 1.05rem;
  }
}