:root,
html[data-theme="light"],
html[data-theme="dark"] {
  color-scheme: dark !important;
  --color-primary: #f09410;
  --color-background: #071f2e;
  --color-foreground: #f7fafb;
  --color-night: #071f2e;
  --color-night-raised: #0b2b3e;
  --color-night-ink: #f7fafb;
  --color-night-muted: #aab9c2;
  --color-on-primary: #071f2e;
  --color-steel: #aab9c2;
  --color-ember: #f09410;
  --background: #071f2e;
  --foreground: #f7fafb;
  --primary: #f09410;
  --primary-foreground: #071f2e;
  --card: #0b2b3e;
  --card-foreground: #f7fafb;
  --popover: #0b2b3e;
  --popover-foreground: #f7fafb;
  --secondary: #103c55;
  --secondary-foreground: #f7fafb;
  --muted: #103c55;
  --muted-foreground: #aab9c2;
  --accent: #103c55;
  --accent-foreground: #f7fafb;
  --border: rgb(247 250 251 / 14%);
  --input: rgb(247 250 251 / 18%);
  --ring: #f09410;
  --color-neutral-1: #0b2b3e;
  --color-neutral-2: #103448;
  --color-neutral-3: #244252;
  --color-neutral-4: #385568;
  --color-neutral-5: #597182;
  --color-neutral-6: #8095a2;
  --color-neutral-7: #aab9c2;
  --color-neutral-8: #bdc9cf;
  --color-neutral-9: #d7dfe2;
  --color-neutral-10: #f7fafb;
  --color-error: #e15d56;
  --destructive: #e15d56;
  --font-sans: "Inter", "Montserrat", sans-serif;
  --font-display: "Montserrat", "Inter", sans-serif;
}

html,
body {
  min-height: 100%;
  background-color: #071f2e !important;
  color: #f7fafb;
}

body {
  background-image: radial-gradient(rgb(255 255 255 / 10%) .65px, transparent .65px) !important;
  background-size: 7px 7px !important;
  font-family: "Inter", "Montserrat", sans-serif;
}

#root {
  min-height: 100vh;
  color: #f7fafb;
  background: transparent;
}

#root main {
  background-color: #071f2e;
  background-image: radial-gradient(rgb(255 255 255 / 4%) .65px, transparent .65px);
  background-size: 7px 7px;
}

#root header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(4 23 34 / 90%);
  border-bottom: 1px solid rgb(247 250 251 / 12%);
  backdrop-filter: blur(18px);
}

#root header > div {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

#root header img {
  display: block;
  width: 124px;
  height: auto;
  max-height: 46px;
  object-fit: contain;
}

#root header nav {
  align-items: center;
  gap: clamp(14px, 2.2vw, 30px);
  color: #d3dce1;
  font-size: .84rem;
}

#root header a[class*="bg-primary"],
#root header button[class*="bg-primary"] {
  min-height: 44px;
  padding-inline: 22px;
  border-radius: 999px;
  background: #f09410;
  color: #071f2e;
  font-weight: 750;
}

#root main h1,
#root main h2,
#root main h3 {
  font-family: "Montserrat", "Inter", sans-serif;
  letter-spacing: -.035em;
}

#root main h1 {
  font-size: clamp(3rem, 5.4vw, 5.2rem);
  font-weight: 800;
  line-height: .96;
}

#root main h2 {
  font-size: clamp(2.15rem, 4vw, 3.75rem);
  font-weight: 800;
  line-height: 1.02;
}

#root main h3 {
  font-weight: 750;
  line-height: 1.18;
}

#root main > section {
  position: relative;
  border-top: 1px solid rgb(247 250 251 / 8%);
}

#root main > section > div[class*="mx-auto"] {
  width: min(1180px, calc(100% - 48px));
  max-width: 1180px;
}

#root main p[class*="text-primary"] {
  font-family: "JetBrains Mono", "SFMono-Regular", monospace;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

#root main [class*="rounded"]:not([class*="rounded-full"]) {
  border-radius: 12px;
}

#root main [class~="bg-primary"] {
  background-color: #f09410;
  color: #071f2e;
}

#root main [class~="bg-night"] {
  background-color: #071f2e;
}

#root main [class~="bg-background"] {
  background-color: transparent;
}

#root header a,
#root header button {
  transition: color .2s, background .2s, border-color .2s, transform .2s;
}

#root header a:hover,
#root header button:hover {
  color: #f9aa40;
}

#root a[class*="bg-primary"],
#root button[class*="bg-primary"] {
  color: #071f2e;
  font-weight: 700;
}

#root [class*="border"] {
  border-color: rgb(247 250 251 / 14%);
}

#root input,
#root select {
  color: #f7fafb;
}

#root input:focus,
#root select:focus,
#root button:focus-visible,
#root a:focus-visible {
  outline: 2px solid #f9aa40;
  outline-offset: 3px;
}

.service-return {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: #f9aa40 !important;
  font-size: .78rem;
  font-weight: 700;
}

.client-photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 14px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 72px;
}

.client-photo-strip figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid rgb(247 250 251 / 14%);
  border-radius: 5px;
  background: #0b2b3e;
}

.client-photo-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .5s ease;
}

@keyframes spr-lightning-strike {
  0%, 11%, 100% { opacity: 0; }
  12% { opacity: .96; }
  12.4% { opacity: .16; }
  13% { opacity: .88; }
  13.8% { opacity: .08; }
  14.5% { opacity: .72; }
  16% { opacity: 0; }
}

/* The hero image remains static; lightning is reserved for the SPDA diagram. */
.sky-flash {
  overflow: hidden;
  z-index: 2;
  background: transparent !important;
  opacity: 1 !important;
  animation: none !important;
}

.bolt {
  opacity: 0;
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 10px #8bcfff);
  animation: spr-lightning-strike 5.4s steps(1, end) infinite;
}

@keyframes spr-section-enter {
  from { opacity: .72; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

#root main > .spr-reveal.spr-visible {
  animation: spr-section-enter 420ms cubic-bezier(.2,.7,.2,1) both;
}

#root main a,
#root main button {
  transition: color 220ms ease, background-color 220ms ease, border-color 220ms ease, transform 280ms cubic-bezier(.2,.7,.2,1), box-shadow 280ms ease;
}

#root main a:hover,
#root main button:hover {
  transform: translateY(-2px);
}

.client-photo-strip figure:has(img[src*="torre-cameras"]) {
  width: min(100%, 520px);
  justify-self: start;
}

.client-photo-strip img[src*="torre-cameras"] {
  aspect-ratio: 3 / 4;
  object-position: center;
}

/* Keep service photography close to each source image's real composition. */
#root main > section:first-of-type img[src*="client-security/entrada-assistida.jpg"] {
  object-fit: contain;
  background: #071f2e;
}

#root main div:has(> img[src*="spda-medicao.webp"]) {
  display: grid;
  grid-template-columns: minmax(180px, .72fr) minmax(0, 1fr);
  align-items: stretch;
}

#root main img[src*="spda-medicao.webp"] {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: #0b2b3e;
}

#root main img[src*="engenharia-eletrica.jpg"] {
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #0b2b3e;
}

#root main .relative.overflow-hidden:has(> .tower-intelligence-feed) {
  width: 100%;
}

#root main .tower-intelligence-feed {
  width: 100%;
  aspect-ratio: 4 / 5 !important;
}

#root main div.grid:has(.tower-intelligence-feed) {
  width: min(100%, 754px);
  grid-template-columns: minmax(0, 300px) minmax(0, 430px);
  justify-content: center;
  margin-inline: auto;
}

#root main .tower-intelligence-feed > img {
  object-fit: contain;
  background: #0b2b3e;
}

.client-photo-strip figure:hover img {
  transform: scale(1.025);
}

/* Staggered, low-travel reveals keep the service pages lively without hiding content for long. */
@keyframes spr-hero-rise {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes spr-hero-image-arrive {
  from { opacity: .35; transform: scale(1.055); }
  to { opacity: 1; transform: scale(1); }
}

#root main.spr-enhanced-motion .spr-hero-rise {
  animation: spr-hero-rise 650ms cubic-bezier(.2,.7,.2,1) both;
  animation-delay: var(--spr-hero-delay, 0ms);
}

#root main.spr-enhanced-motion img.spr-hero-image {
  animation: spr-hero-image-arrive 1100ms cubic-bezier(.2,.7,.2,1) both;
}

#root main.spr-enhanced-motion .spr-motion-item {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 540ms cubic-bezier(.2,.7,.2,1), transform 540ms cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--spr-motion-delay, 0ms);
}

#root main.spr-enhanced-motion .spr-motion-item.spr-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes spr-enhanced-section-enter {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

#root main.spr-enhanced-motion > section.spr-reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
}

#root main.spr-enhanced-motion > section.spr-reveal.spr-visible {
  animation: spr-enhanced-section-enter 520ms cubic-bezier(.2,.7,.2,1) both;
}

#root main.spr-enhanced-motion .spr-motion-item:has(img) img {
  transition: transform 750ms cubic-bezier(.2,.7,.2,1), filter 750ms ease;
}

#root main.spr-enhanced-motion .spr-motion-item:has(img):hover img {
  transform: scale(1.025);
  filter: saturate(1.08);
}

@media (max-width: 760px) {
  #root header nav {
    gap: 10px !important;
  }

  .service-return {
    font-size: .68rem;
  }

  .client-photo-strip {
    width: calc(100% - 32px);
    margin-bottom: 42px;
  }

  #root main div:has(> img[src*="spda-medicao.webp"]) {
    grid-template-columns: minmax(0, 1fr);
  }

  #root main img[src*="spda-medicao.webp"] {
    height: auto;
    aspect-ratio: 4 / 5;
  }

  #root main div.grid:has(.tower-intelligence-feed) {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  #root main .relative.overflow-hidden:has(> .tower-intelligence-feed) {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #root main > .spr-reveal.spr-visible { animation: none; }
  #root main .spr-hero-rise,
  #root main img.spr-hero-image { animation: none; }
  #root main .spr-motion-item { opacity: 1; transform: none; transition: none; }
  .bolt { animation: none !important; opacity: 1 !important; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
