html { scroll-behavior: smooth; }
body { overflow-x: clip; }

@keyframes bounce-in {
  0%   { opacity: 0; transform: translateX(20px); }
  60%  { opacity: 1; transform: translateX(-4px); }
  100% { opacity: 1; transform: translateX(0); }
}
.animate-bounce-in { animation: bounce-in 0.5s ease both; animation-delay: 1.5s; }
body { -webkit-font-smoothing: antialiased; }

/* Navbar states */
#navbar.scrolled {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(2,6,23,0.06), 0 10px 30px -10px rgba(2,6,23,0.08);
}
#navbar.scrolled .nav-brand { color: #0f172a; }
#navbar:not(.scrolled) .nav-brand,
#navbar:not(.scrolled) .nav-link { color: #fff; }
#navbar:not(.scrolled) .nav-link:hover { color: #8ec2ff; }

/* Grid background */
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Service cards */
.service-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  padding: 2rem;
  transition: all .35s cubic-bezier(.2,.8,.2,1);
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(47,123,255,0.08), rgba(34,211,238,0.06));
  opacity: 0;
  transition: opacity .35s;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: #8ec2ff;
  box-shadow: 0 20px 50px -20px rgba(47,123,255,0.35);
}
.service-card:hover::before { opacity: 1; }
.service-card > * { position: relative; }

.service-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2f7bff, #06b6d4);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px -10px rgba(47,123,255,0.5);
}

/* Feature cards (dark) */
.feature-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 1.5rem;
  padding: 1.5rem;
  transition: all .35s cubic-bezier(.2,.8,.2,1);
  position: relative;
  overflow: hidden;
}
.feature-card::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #2f7bff, #22d3ee);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.feature-card:hover {
  background: rgba(47,123,255,0.07);
  border-color: rgba(89,158,255,0.25);
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -15px rgba(2,6,23,0.5);
}
.feature-card:hover::after { transform: scaleX(1); }

.feature-icon {
  width: 72px; height: 72px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(47,123,255,0.2), rgba(34,211,238,0.15));
  border: 1px solid rgba(47,123,255,0.3);
  color: #599eff;
  display: flex; align-items: center; justify-content: center;
  transition: all .35s;
}
.feature-card:hover .feature-icon {
  background: linear-gradient(135deg, #2f7bff, #06b6d4);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(47,123,255,0.6);
}

/* Partner logos */
.partner-logo {
  height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: -0.01em;
  transition: all .2s;
}
.partner-logo:hover {
  background: #fff;
  color: #155ef0;
  border-color: #8ec2ff;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px -10px rgba(47,123,255,0.3);
}
.partner-intelbras:hover {
  color: #16a34a;
  border-color: #86efac;
  box-shadow: 0 10px 30px -10px rgba(22,163,74,0.45);
}
.partner-controlid:hover,
.partner-hikvision:hover {
  color: #dc2626;
  border-color: #fca5a5;
  box-shadow: 0 10px 30px -10px rgba(220,38,38,0.45);
}
.partner-ppa:hover {
  color: #ea580c;
  border-color: #fdba74;
  box-shadow: 0 10px 30px -10px rgba(234,88,12,0.45);
}

/* ── Device scene (laptop + phone) ── */
.device-scene {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
}

/* Laptop */
.laptop-mockup {
  position: relative;
  z-index: 1;
}
.laptop-screen {
  width: 580px;
  height: 296px;
  background: #0f172a;
  border-radius: 14px 14px 0 0;
  padding: 10px 10px 0;
  box-shadow:
    0 0 0 2px #334155,
    0 -4px 0 2px #1e293b,
    0 30px 60px -15px rgba(2,6,23,0.5);
  overflow: hidden;
}
.laptop-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 6px 6px 0 0;
}
.laptop-base {
  position: relative;
  width: 632px;
  height: 26px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-radius: 0 0 10px 10px;
  margin-left: -22px;
  box-shadow: 0 4px 20px rgba(2,6,23,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.laptop-camera {
  width: 36px; height: 4px;
  background: #334155;
  border-radius: 99px;
}

/* Phone (small, in front) */
.phone-mockup-small {
  position: absolute;
  bottom: 26px;
  right: -45px;
  z-index: 2;
  filter: drop-shadow(0 20px 40px rgba(2,6,23,0.45));
}
.phone-frame-small {
  position: relative;
  width: 140px;
  height: 280px;
  background: #0f172a;
  border-radius: 26px;
  padding: 8px;
  box-shadow:
    0 0 0 2px #334155,
    inset 0 0 0 1px rgba(255,255,255,0.06);
}
.phone-notch-small {
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 12px;
  background: #0f172a;
  border-radius: 0 0 8px 8px;
  z-index: 10;
}
.phone-screen-small {
  width: 100%;
  height: calc(100% - 12px);
  border-radius: 16px;
  overflow: hidden;
  background: #1e293b;
  margin-top: 6px;
}
.phone-home-bar-small {
  position: absolute;
  bottom: 5px; left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 99px;
}

/* Instagram button */
.instagram-btn {
  color: #6b7280;
}
.instagram-btn:hover {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%) !important;
  color: #fff;
  border-color: transparent !important;
}

/* Reveal animation */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1);
}
[data-reveal].visible { opacity: 1; transform: translateY(0); }

/* Floating cards */
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.floating-card { animation: floaty 4s ease-in-out infinite; }
.floating-card-delay { animation: floaty 4s ease-in-out infinite; animation-delay: 2s; }

/* Pulse slow */
@keyframes pulse-slow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}
.animate-pulse-slow { animation: pulse-slow 6s ease-in-out infinite; }

/* Draw stroke */
@keyframes draw {
  from { stroke-dasharray: 600; stroke-dashoffset: 600; }
  to   { stroke-dasharray: 600; stroke-dashoffset: 0; }
}
.animate-draw { animation: draw 3s ease-out forwards; }

/* ── Locação de Equipamentos ── */
.locacao-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.locacao-card:hover {
  background: rgba(47,123,255,0.1);
  border-color: rgba(89,158,255,0.3);
  transform: translateY(-3px);
}
.locacao-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(47,123,255,0.25), rgba(34,211,238,0.18));
  border: 1px solid rgba(47,123,255,0.3);
  color: #8ec2ff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s;
}
.locacao-card:hover .locacao-icon {
  background: linear-gradient(135deg, #2f7bff, #06b6d4);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(47,123,255,0.6);
}
.locacao-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.locacao-card-desc {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
}

/* ── Portaria Remota ── */
.portaria-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.portaria-step:hover {
  border-color: #8ec2ff;
  box-shadow: 0 8px 30px -10px rgba(47,123,255,0.2);
  transform: translateX(4px);
}
.portaria-step-num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2f7bff, #06b6d4);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -4px rgba(47,123,255,0.5);
}
.portaria-step-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
}
.portaria-step-desc {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.4;
}
.portaria-connector {
  width: 2px;
  height: 20px;
  background: linear-gradient(to bottom, #2f7bff, #06b6d4);
  border-radius: 99px;
  margin-left: 29px;
  opacity: 0.4;
}

/* ── Dropdown Soluções ── */
.nav-dropdown { position: relative; }

.nav-dropdown-trigger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(.2,.8,.2,1);
  min-width: 290px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(2,6,23,0.06),
    0 4px 6px -2px rgba(2,6,23,0.04),
    0 20px 50px -10px rgba(2,6,23,0.16);
  padding: 8px;
  z-index: 100;
}

/* Transparent bridge to keep panel open when moving mouse from trigger */
.nav-dropdown-panel::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}

.nav-dropdown:hover .nav-dropdown-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown:hover .nav-chevron { transform: rotate(180deg); }

.nav-dropdown-arrow {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-top: 1px solid rgba(2,6,23,0.06);
  border-left: 1px solid rgba(2,6,23,0.06);
  border-radius: 2px;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  transition: background 0.15s;
  text-decoration: none;
  color: #0f172a;
}
.nav-dropdown-item:hover { background: #f1f5f9; }

.nav-dropdown-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(47,123,255,0.1), rgba(34,211,238,0.07));
  border: 1px solid rgba(47,123,255,0.15);
  color: #2f7bff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.nav-dropdown-item:hover .nav-dropdown-icon {
  background: linear-gradient(135deg, #2f7bff, #06b6d4);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 16px -4px rgba(47,123,255,0.5);
}

.nav-dropdown-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 2px;
}
.nav-dropdown-desc {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.3;
}
.nav-dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 14px;
}

/* ── Partners carousel ── */
@keyframes scroll-partners {
  from { transform: translateX(0); }
  to   { transform: translateX(-25%); }
}

.partners-carousel-wrapper {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}

/* No mobile o mask quebra o overflow:hidden no iOS — removido */
@media (max-width: 767px) {
  .partners-carousel-wrapper {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.partners-track {
  display: flex;
  width: max-content;
  animation: scroll-partners 18s linear infinite;
}

.partners-track:hover { animation-play-state: paused; }

.partner-slide {
  flex-shrink: 0;
  width: 180px;
  height: 90px;
  margin-right: 1.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.75rem;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s, transform .2s;
}

.partner-slide:hover {
  border-color: #8ec2ff;
  box-shadow: 0 10px 30px -10px rgba(47,123,255,0.25);
  transform: translateY(-3px);
}

.partner-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.65;
  transition: filter .2s, opacity .2s;
}

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

/* Form */
input:focus, select:focus, textarea:focus { outline: none; }

/* Hero ring animations */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes spin-slow-reverse {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}
.animate-spin-slow         { animation: spin-slow 24s linear infinite; }
.animate-spin-slow-reverse { animation: spin-slow-reverse 18s linear infinite; }

/* Flip cards */
.flip-card {
  perspective: 1000px;
  height: 200px;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}
.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

/* ===================== TABLET (768px – 1023px) ===================== */
@media (min-width: 768px) and (max-width: 1023px) {

  /* Zoom reduz layout + visual do mockup para caber no espaço disponível */
  .device-scene { zoom: 0.72; }

  /* Feature cards */
  .feature-card { padding: 1.25rem 1rem; }
  .feature-icon { width: 56px; height: 56px; }

  /* Flip cards */
  .flip-card { height: 200px; }
}

/* ===================== DESKTOP PEQUENO (1024px – 1279px) ===================== */
@media (min-width: 1024px) and (max-width: 1279px) {

  /* Zoom reduz layout + visual do mockup para caber no flex-1 */
  .device-scene { zoom: 0.82; }
}

/* ===================== MOBILE (≤ 767px) ===================== */
@media (max-width: 767px) {

  /* --- Flip cards --- */
  .flip-card { height: 210px; }
  .flip-card-front { padding: 1rem 0.75rem; }
  .flip-card-back  { padding: 0.9rem 0.75rem; }
  .flip-card-front .w-16 { width: 3rem; height: 3rem; }
  .flip-card-front svg  { width: 1.6rem; height: 1.6rem; }
  .flip-card-front h3   { font-size: 0.72rem; margin-top: 0.5rem; }
  .flip-card-back  h3   { font-size: 0.8rem; margin-bottom: 0.3rem; }
  .flip-card-back  p    { font-size: 0.67rem; line-height: 1.4; }

  /* hint de toque */
  .flip-card-front::after {
    content: "toque ▸";
    position: absolute;
    bottom: 0.5rem;
    right: 0.6rem;
    font-size: 0.55rem;
    color: #599eff;
    font-weight: 600;
    letter-spacing: 0.03em;
    opacity: 0.7;
  }

  /* --- Seções gerais --- */
  #servicos  { padding-top: 3rem; padding-bottom: 3rem; }
  #sobre     { padding-top: 3rem; padding-bottom: 3rem; }
  #diferenciais { padding-top: 3rem; padding-bottom: 3rem; }
  #artech-access { padding-top: 3rem; padding-bottom: 3rem; }
  #parceiros { padding-top: 3rem; padding-bottom: 3rem; }

  .laptop-screen { width: 320px; height: 163px; }
  .laptop-base   { width: 350px; margin-left: -15px; }
  .phone-mockup-small { right: -28px; bottom: 22px; }
  .phone-frame-small  { width: 108px; height: 216px; border-radius: 22px; }
  #contato   { padding-top: 3rem; padding-bottom: 3rem; }

  /* --- Hero --- */
  #home .container { padding-top: 2.5rem; padding-bottom: 2.5rem; }

  /* --- Partner logos --- */
  .partner-logo { height: 60px; font-size: 0.8rem; }

  /* --- Carrossel de parceiros --- */
  .partner-slide {
    width: 130px;
    height: 68px;
    padding: 0.5rem 0.85rem;
    margin-right: 0.75rem;
  }

  /* --- Cards de locação (mais visíveis no mobile) --- */
  .locacao-card {
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.22);
  }

  /* --- Feature cards (diferenciais) --- */
  .feature-card { padding: 1rem 0.75rem; }
  .feature-icon { width: 40px; height: 40px; border-radius: 10px; }
  .feature-icon svg { width: 1.2rem; height: 1.2rem; }
}
.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}
.flip-card-front {
  background: #ffffff;
  box-shadow: 0 10px 40px -10px rgba(2,6,23,0.25);
}
.flip-card-back {
  background: linear-gradient(135deg, #155ef0, #06b6d4);
  color: #ffffff;
  transform: rotateY(180deg);
  box-shadow: 0 10px 40px -10px rgba(47,123,255,0.5);
}
