/* =========================================================
   Mastec Digital — Base stylesheet (shared across all pages)
   ========================================================= */

:root {
  --red: #fb0044;
  --red-dark: #b00030;
  --red-glow: rgba(251, 0, 68, 0.35);

  --ink: #232933;
  --ink-2: #2b3240;
  --ink-3: #333b4a;

  --paper: #ffffff;
  --paper-2: #f7f7fa;
  --paper-3: #eef0f4;

  --text: #1a1a24;
  --text-muted: #676776;
  --text-invert: #f5f5f8;
  --text-invert-muted: #a2a2b5;

  --border: rgba(15, 15, 25, 0.09);
  --border-invert: rgba(255, 255, 255, 0.08);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --shadow: 0 15px 40px rgba(15, 15, 25, 0.08);
  --shadow-lg: 0 25px 60px rgba(15, 15, 25, 0.16);
  --shadow-red: 0 15px 34px var(--red-glow);

  --container: 1600px;
  --header-h: 82px;

  --font-heading: "Outfit", sans-serif;
  --font-body: "Inter", sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--text);
}

p {
  margin: 0 0 1em;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.section--tight {
  padding: 64px 0;
}

.light-bg {
  background:
    radial-gradient(1px 1px at 20px 20px, rgba(15, 15, 25, 0.06) 1px, transparent 0),
    radial-gradient(1px 1px at 60px 60px, rgba(15, 15, 25, 0.06) 1px, transparent 0),
    var(--paper-2);
  background-size: 80px 80px, 80px 80px, auto;
}

.dark-bg {
  background: var(--ink);
  color: var(--text-invert);
}

.dark-bg h1, .dark-bg h2, .dark-bg h3, .dark-bg h4 {
  color: var(--text-invert);
}

.dark-bg p {
  color: var(--text-invert-muted);
}

.section-title {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}

.section-title .label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(251, 0, 68, 0.08);
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.dark-bg .section-title .label {
  background: rgba(251, 0, 68, 0.14);
}

.section-title .label .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 2.4s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.section-title h2 {
  font-size: clamp(2.1rem, 3.8vw, 3rem);
  margin-bottom: 14px;
}

@keyframes titleShimmer {
  to { background-position: 200% 50%; }
}

.section-title h2 em,
.ecom-grid h2 em,
.app-grid h2 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--red) 0%, #ffb347 25%, var(--red) 50%, #ffb347 75%, var(--red) 100%);
  background-size: 250% auto;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleShimmer 5s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .section-title h2 em,
  .ecom-grid h2 em,
  .app-grid h2 em {
    animation: none;
  }
}

.section-title p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

.dark-bg .section-title p {
  color: var(--text-invert-muted);
}

.eyebrow-sm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(251, 0, 68, 0.08);
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 16px 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: none;
  isolation: isolate;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.btn-primary {
  background: linear-gradient(135deg, #ff2a58, var(--red-dark));
  color: #fff;
  box-shadow: 0 12px 28px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  background: linear-gradient(135deg, #ff2a58, var(--red-dark));
  filter: blur(16px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover::after {
  opacity: 0.55;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(6px);
}

.dark-bg .btn-outline {
  border-color: var(--border-invert);
  color: var(--text-invert);
}

.btn-outline:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-3px);
}

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 700;
}

.btn-play .icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn-play:hover .icon {
  background: var(--red);
  transform: scale(1.08);
}

/* ---------- Preloader ---------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#preloader::before {
  content: "";
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(251, 0, 68, 0.15);
  border-top-color: var(--red);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

body.loaded #preloader {
  opacity: 0;
  visibility: hidden;
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  height: var(--header-h);
  background: #ffffff;
  box-shadow: 0 2px 16px rgba(15, 15, 25, 0.06);
  transition: height 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.header.scrolled {
  height: 66px;
  box-shadow: 0 4px 20px rgba(15, 15, 25, 0.1);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  height: 40px;
  width: auto;
}

.navmenu ul {
  display: flex;
  align-items: center;
  gap: 34px;
}

.navmenu a {
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.navmenu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.25s var(--ease);
}

.navmenu a:hover,
.navmenu a.active {
  color: var(--red);
}

.navmenu a:hover::after,
.navmenu a.active::after {
  width: 100%;
}

.mobile-nav-toggle {
  display: none;
  font-size: 1.6rem;
  color: var(--text);
  background: none;
  border: none;
}

@media (max-width: 991px) {
  .mobile-nav-toggle {
    display: block;
  }

  .navmenu {
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(15, 15, 25, 0.08);
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    padding: 40px 32px;
  }

  .navmenu.open {
    transform: translateX(0);
  }

  .navmenu ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 26px;
  }

  .navmenu a {
    font-size: 1.2rem;
  }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--text-invert-muted);
  padding: 80px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.6fr;
  gap: 40px;
  padding-bottom: 50px;
  border-bottom: 1px solid var(--border-invert);
}

.footer-about img {
  height: 42px;
  width: auto;
  margin-bottom: 18px;
}

.footer-about p {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.footer-about .social-links {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.footer-about .social-links a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-invert);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-invert);
  transition: all 0.25s var(--ease);
}

.footer-about .social-links a:hover {
  background: var(--red);
  border-color: var(--red);
  transform: translateY(-3px);
}

.footer h4 {
  color: var(--text-invert);
  font-size: 1.02rem;
  margin-bottom: 20px;
}

.footer-links ul li {
  margin-bottom: 12px;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-invert);
  transform: translateX(3px);
}

.footer-newsletter p {
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.footer-newsletter .btn {
  padding: 12px 24px;
  font-size: 0.85rem;
}

.copyright {
  text-align: center;
  padding: 26px 0;
  font-size: 0.85rem;
}

/* ---------- Scroll to top ---------- */
.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s var(--ease);
  z-index: 8000;
  box-shadow: var(--shadow-red);
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(38px) scale(0.98);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ---------- Video modal (replaces GLightbox) ---------- */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(4, 4, 8, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.video-modal.open {
  display: flex;
}

.video-modal .video-frame {
  width: min(920px, 100%);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.video-modal .video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-modal .close-btn {
  position: absolute;
  top: 28px;
  right: 30px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Generic carousel (replaces Swiper) ---------- */
.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 26px 4px 26px;
  cursor: grab;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.carousel-track.dragging * {
  pointer-events: none;
}

.carousel-slide {
  scroll-snap-align: center;
  flex-shrink: 0;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 8px;
}

.carousel-prev,
.carousel-next {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-invert);
  background: transparent;
  color: var(--text-invert);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease);
}

.light-bg .carousel-prev,
.light-bg .carousel-next,
.section:not(.dark-bg) .carousel-prev,
.section:not(.dark-bg) .carousel-next {
  border-color: var(--border);
  color: var(--text);
}

.carousel-prev:hover,
.carousel-next:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.carousel-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  row-gap: 10px;
  max-width: 480px;
  margin: 0 auto;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  padding: 0;
  transition: all 0.25s var(--ease);
}

.dark-bg .carousel-dot {
  background: var(--border-invert);
}

.carousel-dot.active {
  width: 22px;
  border-radius: 5px;
  background: var(--red);
}

/* ---------- Decorative section glows ---------- */
.section-glow {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.section-glow::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -180px;
  left: 50%;
  width: 900px;
  height: 500px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(251, 0, 68, 0.1), transparent);
  pointer-events: none;
}

.dark-bg.section-glow::before {
  background: radial-gradient(closest-side, rgba(251, 0, 68, 0.18), transparent);
}

/* ---------- Inner page hero (about, contact — shared standard) ---------- */
.inner-hero {
  position: relative;
  padding: calc(var(--header-h) + 76px) 0 68px;
  overflow: hidden;
  text-align: center;
  background: #0a0a12;
  isolation: isolate;
}

.inner-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 16% 8%, rgba(251, 0, 68, 0.22), transparent 42%),
    radial-gradient(circle at 86% 92%, rgba(251, 0, 68, 0.12), transparent 45%);
  pointer-events: none;
}

.inner-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 20%, #000, transparent 75%);
  opacity: 0.6;
  pointer-events: none;
}

.inner-hero .container {
  position: relative;
  z-index: 2;
}

.inner-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(251, 0, 68, 0.25);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.inner-hero .eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(251, 0, 68, 0.25);
  animation: blink 2.4s infinite;
}

.inner-hero h1 {
  color: #fff;
  font-size: clamp(2.3rem, 4.8vw, 3.5rem);
  letter-spacing: -0.02em;
  max-width: 760px;
  margin: 0 auto 18px;
  text-wrap: balance;
}

.inner-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--red), #ff6b8a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.inner-hero .lead {
  color: var(--text-invert-muted);
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 1.08rem;
}

.inner-hero .breadcrumbs ol {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-invert-muted);
}

.inner-hero .breadcrumbs a {
  color: var(--text-invert-muted);
  transition: color 0.2s ease;
}

.inner-hero .breadcrumbs a:hover {
  color: #fff;
}

.inner-hero .breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
}

.inner-hero .breadcrumbs li.current {
  color: var(--red);
}

/* Glass stat strip for inner heroes */
.inner-hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 760px;
  margin: 44px auto 0;
}

.inner-hero-stats .stat-item {
  flex: 1 1 140px;
  text-align: center;
  padding: 22px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
}

.inner-hero-stats .stat-item:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(251, 0, 68, 0.4);
}

.inner-hero-stats .num {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.inner-hero-stats .num em {
  font-style: normal;
  color: var(--red);
}

.inner-hero-stats .lbl {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-invert-muted);
  margin-top: 8px;
}

@media (max-width: 600px) {
  .inner-hero-stats .stat-item {
    flex: 1 1 calc(50% - 8px);
  }
}

/* ---------- CTA banner (shared) ---------- */
.cta-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 64px 48px;
  text-align: center;
  background: linear-gradient(135deg, #1b1220 0%, #2a1420 55%, #1b1220 100%);
  isolation: isolate;
}

.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 20%, rgba(251, 0, 68, 0.35), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(251, 0, 68, 0.22), transparent 45%);
}

.cta-banner h2 {
  color: #fff;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  max-width: 620px;
  margin: 0 auto 14px;
}

.cta-banner p {
  color: var(--text-invert-muted);
  max-width: 520px;
  margin: 0 auto 34px;
  font-size: 1.02rem;
}

.cta-banner .cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.cta-banner .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.cta-banner .btn-outline:hover {
  border-color: var(--red);
  color: #fff;
  background: rgba(251, 0, 68, 0.14);
}

@media (max-width: 600px) {
  .cta-banner {
    padding: 48px 24px;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    row-gap: 40px;
  }
}

@media (max-width: 600px) {
  .section { padding: 64px 0; }
  .footer-grid { grid-template-columns: 1fr; }
}
