/* =========================
   CSS RESET
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =========================
   ROOT VARIABLES
========================= */
:root {
  --bg: #ffffff;
  --text: #171a20;
  --muted: #5c5e62;
  --accent: #000000;

  /* Tesla red */
  --tesla-red: #E82127;
  --tesla-red-dark: #C21C22;
  --tesla-red-soft: rgba(232, 33, 39, 0.1);

  /* Shadows */
  --tesla-red-shadow-soft: rgba(232, 33, 39, 0.15);
  --tesla-red-shadow: rgba(232, 33, 39, 0.25);
  --tesla-red-shadow-strong: rgba(232, 33, 39, 0.35);
}

/* =========================
   GLOBAL
========================= */
html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* =========================
   HEADER
========================= */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: var(--text);
}

.nav a {
  margin: 0 0.75rem;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.85;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--tesla-red);
  opacity: 1;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  transition: background 0.2s ease;
}

.cta:hover {
  background: #222;
}

/* =========================
   HERO
========================= */
.hero {
  min-height: auto;
  padding: 5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hero p {
  max-width: 600px;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2.5rem;
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: #222;
  transform: translateY(-1px);
}

.button.secondary {
  border: 1px solid var(--tesla-red);
  color: var(--tesla-red);
}

.button.secondary:hover {
  background: var(--tesla-red);
  color: #fff;
  transform: translateY(-1px);
}

/* =========================
   SECTIONS (GLOBAL RHYTHM)
========================= */
section {
  padding: 2.25rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  scroll-margin-top: 90px;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1.1rem;
  position: relative;
}

section h2::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background: var(--tesla-red);
  margin-top: 0.5rem;
  border-radius: 2px;
}

section p {
  color: var(--muted);
}

section p:last-child {
  margin-bottom: 0;
}

/* =========================
   CAROUSEL
========================= */
#carousel {
  text-align: center;
  padding-top: 1rem;
  padding-bottom: 0; /* avoid double vertical spacing */
}

.carousel-container {
  position: relative;
  overflow: hidden; /* desktop */
}

.carousel-track {
  display: flex;
  gap: 1rem;
  transition: transform 0.3s ease;
}

.carousel-item {
  width: 400px;
  flex-shrink: 0;
}

.carousel-item img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carousel-item img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px var(--tesla-red-shadow);
}

.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--tesla-red);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
  transition: background 0.2s ease;
}

.carousel-button:hover {
  background: var(--tesla-red-dark);
}

.carousel-button.prev {
  left: 0.5rem;
}

.carousel-button.next {
  right: 0.5rem;
}

/* Dots UI (hidden everywhere by default; enabled only on mobile) */
.carousel-ui {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.carousel-dots {
  display: flex;
  gap: 6px;
}

.carousel-dots button {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(23, 26, 32, 0.25);
}

.carousel-dots button[aria-current="true"] {
  background: var(--tesla-red);
}

/* =========================
   SERVICES
========================= */
.services-list {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.services-list ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.services-list ul li {
  margin-bottom: 0.4rem;
  color: var(--text);
}

.services-list > li {
  list-style: none;
  flex: 1;
  background: var(--tesla-red-soft);
  border-radius: 16px;
  padding: 1.75rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.services-list > li > strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--tesla-red);
  margin-bottom: 1rem;
}

/* =========================
   ABOUT
========================= */
#about p {
  line-height: 1.7;
  margin-bottom: 1.25rem;
  text-align: left;
}

/* =========================
   CREDENTIALS
========================= */
.credentials-list {
  list-style: none;
  padding: 0;
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.credentials-list li {
  background: var(--tesla-red-soft);
  border-radius: 14px;
  padding: 1rem 1.5rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  position: relative;

  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.credentials-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.1rem;
  bottom: 1.1rem;
  width: 4px;
  border-radius: 4px;
  background: var(--tesla-red);
}

.credentials-list .icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 33, 39, 0.12);
  border-radius: 50%;
  margin-left: 0.25rem;
}

.credentials-list .icon svg {
  width: 18px;
  height: 18px;
  fill: var(--tesla-red);
}

.credentials-list .text {
  flex: 1;
}

/* =========================
   TESTIMONIALS
========================= */
.testimonials-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.testimonials-list li {
  background: var(--tesla-red-soft);
  border-radius: 14px;
  padding: 1.25rem 1.75rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.testimonials-list p {
  margin-bottom: 0.75rem;
  font-style: italic;
  color: var(--text);
}

.testimonials-list span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* =========================
   CONTACT
========================= */
#contact a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

#contact a:hover {
  color: var(--tesla-red);
  text-decoration: underline;
}

/* Contact icon list (left column) */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  flex: 0 0 auto;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.contact-links a svg {
  width: 18px;
  height: 18px;
  fill: var(--tesla-red);
  flex-shrink: 0;
}

.contact-links a:hover {
  background: var(--tesla-red-soft);
  color: var(--tesla-red);
}

/* Contact bottom row: links + partner logos */
.contact-bottom-row {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

/* Logo marquee */
.partner-marquee {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  max-width: 760px;
  margin-left: auto;
}

/* Desktop: push the logo strip itself to the right edge */
@media (min-width: 769px) {
  .partner-marquee {
    display: flex;
    justify-content: flex-end;
  }
}

.partner-track {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: max-content;
}

/* Logos */
.partner-track img {
  height: 34px;
  width: auto;
  object-fit: contain;
  opacity: 0.7;
  filter: grayscale(100%);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.partner-track img:hover {
  opacity: 1;
  filter: grayscale(0%);
}

/* =========================
   FOOTER
========================= */
.site-footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* =========================
   HAMBURGER MENU
========================= */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 20px;
  cursor: pointer;
}

.menu-toggle .bar {
  height: 3px;
  width: 100%;
  background-color: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.open .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.open .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* =========================
   GALLERY MODAL (GRID + VIEWER)
========================= */
.gallery-modal[hidden] { display: none; }

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.gm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
}

.gm-panel {
  position: relative;
  height: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.gm-title {
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  letter-spacing: 0.2px;
  margin-right: auto;
  margin-left: 0.25rem;
}

.gm-close,
.gm-back {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,0.14);
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 44px;
}

.gm-back {
  font-size: 18px;
  line-height: 44px;
}

/* GRID */
.gm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  overflow: auto;
  padding-bottom: 0.5rem;
}

.gm-thumb {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.gm-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  transition: transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .gm-thumb:hover img { transform: translateY(-1px); }
}

/* VIEWER */
.gm-viewer {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  gap: 0.75rem;
}

.gm-img {
  max-width: min(95vw, 1100px);
  max-height: 72vh;
  object-fit: contain;
  border-radius: 14px;
}

.gm-prev,
.gm-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,0.14);
  color: #fff;
  cursor: pointer;
  font-size: 30px;
}

.gm-prev { left: 0.25rem; }
.gm-next { right: 0.25rem; }

.gm-caption {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  text-align: center;
  padding: 0 0.5rem;
}

/* Responsive grid */
@media (max-width: 900px) {
  .gm-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .gm-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {
  .site-header {
    padding: 1rem;
  }

  .nav {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg);
    padding: 1rem 2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  }

  .nav.visible {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .cta {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
  }

  /* Services stack */
  .services-list {
    flex-direction: column;
  }

  /* --- Mobile carousel: swipe + peek --- */
  #carousel {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .carousel-container {
    max-width: 100%;
    margin: 0 auto;

    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    padding: 0 1rem 0.75rem;
  }

  .carousel-track {
    gap: 0.75rem;
    transition: none;
  }

  .carousel-item {
    flex: 0 0 86%;
    max-width: 420px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  .carousel-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
  }

  .carousel-button {
    display: none;
  }

  .carousel-ui {
    display: flex;
  }

  /* Credentials mobile */
  .credentials-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .credentials-list li {
    padding: 1rem 1.25rem;
    gap: 0.75rem;
  }

  .credentials-list .icon {
    width: 32px;
    height: 32px;
  }

  .credentials-list .icon svg {
    width: 16px;
    height: 16px;
  }

  /* Contact row stacks */
  .contact-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .partner-marquee {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-top: 2rem; 
  }

  /* Auto-scrolling mini carousel */
  .partner-track {
    animation: partner-scroll 18s linear infinite;
    gap: 1rem;
  }

  .partner-track img {
    height: 30px;
  }
}

/* Smooth endless loop (track is duplicated in HTML) */
@keyframes partner-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .partner-track {
    animation: none !important;
  }
}

/* DESKTOP: show only first set of 8 partner logos */
@media (min-width: 769px) {
  .partner-track img:nth-child(n+9) {
    display: none;
  }
}
