:root {
  --bg: #09292c;
  --bg-deep: #062122;
  --surface: #0e3337;
  --line: rgba(242, 239, 233, 0.12);
  --fg: #f2efe9;
  --muted: rgba(242, 239, 233, 0.72);
  --accent: #46e824;
  --accent-ink: #062122;
  --danger: #ffb4a8;
  --radius: 14px;
  --wrap: 1180px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.6rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0; text-wrap: pretty; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }

.lead { color: var(--muted); font-size: 1.1rem; margin-top: 18px; max-width: 60ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 999px;
  font: 650 1rem var(--font); text-decoration: none; cursor: pointer;
  user-select: none;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, box-shadow 200ms ease;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(0.97); }
.btn--ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.btn--dark { background: var(--bg-deep); color: var(--fg); }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: 0.95rem; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #6cf04c; }
  .btn--ghost:hover { background: rgba(242, 239, 233, 0.06); box-shadow: inset 0 0 0 1px rgba(242, 239, 233, 0.3); }
  .btn--dark:hover { background: #0b2c2e; }
}

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 33, 34, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__logo { width: auto; height: 38px; }
.brand__name { font-size: 1.05rem; letter-spacing: 0.06em; font-weight: 400; text-transform: uppercase; }
.brand__name b { font-weight: 800; color: var(--accent); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 500; transition: color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .nav a:not(.btn):hover { color: var(--fg); } }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .menu-btn {
    display: grid; place-content: center; gap: 6px;
    width: 44px; height: 44px; margin-right: -8px;
    background: none; border: 0; cursor: pointer;
  }
  .menu-btn span { display: block; width: 22px; height: 2px; background: var(--fg); border-radius: 2px; transition: transform 200ms var(--ease-out); }
  .menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 20px 20px;
    background: var(--bg-deep); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-8px); visibility: hidden;
    transition: opacity 180ms ease, transform 200ms var(--ease-out), visibility 0s linear 200ms;
  }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity 180ms ease, transform 200ms var(--ease-out); }
  .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav .btn { margin-top: 16px; min-height: 50px; }
}

/* Hero */
.hero { padding: 72px 0 88px; background: radial-gradient(1200px 500px at 85% -10%, rgba(70, 232, 36, 0.08), transparent 60%); }
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__note { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }

/* Diagrama da rede (hero) */
.diagram { margin: 0; }
.diagram .node { transform-box: fill-box; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.45)); animation: float 6s ease-in-out var(--d, 0s) infinite; }
@keyframes float { 0%, 100% { transform: translateY(3px); } 50% { transform: translateY(-5px); } }
.diagram svg { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto; stroke: none; overflow: visible; }
.diagram__links path { fill: none; stroke: var(--accent); stroke-opacity: 0.45; stroke-width: 2; }
.diagram__packets circle { fill: var(--accent); }
.diagram__nodes rect { fill: var(--bg-deep); stroke: rgba(242, 239, 233, 0.22); stroke-width: 1.5; }
.diagram__nodes rect.is-accent { stroke: var(--accent); }
.diagram__nodes rect.is-cloud { stroke-dasharray: 4 4; }
.diagram__nodes text { fill: var(--fg); font: 650 16px var(--font); text-anchor: middle; }
.diagram__nodes text.leaf { font-size: 14px; }
.diagram__nodes text.sub { fill: var(--muted); font-size: 13px; font-weight: 400; }
.diagram figcaption { margin-top: 20px; color: var(--muted); font-size: 0.92rem; text-align: center; }

/* Sections */
.section { padding: 96px 0; }
.section--alt { background: var(--bg-deep); }
.section__head { max-width: 720px; margin-bottom: 48px; }

/* Serviços */
.services { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.services__intro { position: sticky; top: 108px; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 20px; color: var(--accent); font-weight: 600; text-decoration: none; }
.link-arrow span { transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .link-arrow:hover span { transform: translateX(4px); } }
.services__groups { display: grid; gap: 56px; }
/* Services swap (main.js): groups stack in one cell and swap with scroll.
   .is-stacked: effect on. .is-pinned: the viewport is too short to swap while the section scrolls past,
   so the list sticks and the track's ::after adds a fixed scroll distance. */
.svc-progress { display: none; }
.services { --pin-top: calc(var(--hh, 68px) + 40px); }
.services.is-pinned .services__intro { top: var(--pin-top); }
.services.is-pinned .services__track::after { content: ""; display: block; height: calc((var(--n, 3) - 1) * var(--swap, 300px)); }
.services.is-pinned .services__pin { position: sticky; top: var(--pin-top); }
.services.is-stacked .services__groups { gap: 0; }
.services.is-stacked .svc-group { grid-area: 1 / 1; align-self: start; transform-origin: 50% 50%; will-change: transform, opacity, filter; }
.services.is-stacked .svc-progress { display: flex; gap: 6px; margin-bottom: 22px; }
.svc-progress span { position: relative; width: 36px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.svc-progress span::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--f, 0)); }
.svc-group__title { color: var(--accent); font-size: 1rem; font-weight: 600; letter-spacing: 0; margin-bottom: 8px; }
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc-list li { display: grid; grid-template-columns: minmax(180px, 2fr) 3fr; gap: 8px 32px; padding: 22px 0; border-top: 1px solid var(--line); }
.svc-list li:last-child { border-bottom: 1px solid var(--line); }
.svc-list h4 { margin: 0; font-size: 1.15rem; font-weight: 650; line-height: 1.3; }
.svc-list p { color: var(--muted); font-size: 0.98rem; }


.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split__media { margin: 0; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); }
.split__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.checks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.checks li { position: relative; padding-left: 34px; color: var(--muted); }
.checks li strong { color: var(--fg); font-weight: 650; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23062122' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* Steps: the rail draws with scroll (--p, set in main.js); the packet only runs on finished segments.
   data-stage 0: no packet; 1: 01 to 02 (3s loop); 2 or no JS: 01 to 03 (6s loop, stages at 0 / 40% / 80%) */
.steps { --gap: 16px; --b: 44px; position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); list-style: none; margin: 0; padding: 0; }
.steps::before, .steps::after { content: ""; position: absolute; left: calc((100% - 2 * var(--gap)) / 6); right: calc((100% - 2 * var(--gap)) / 6); pointer-events: none; }
.steps::before { top: calc(var(--b) / 2 - 1px); height: 2px; background: linear-gradient(90deg, var(--accent), rgba(70, 232, 36, 0.25)); transform-origin: left; transform: scaleX(var(--p, 1)); }
.steps::after { top: calc(var(--b) / 2 - 7px); height: 14px; background: radial-gradient(circle, var(--accent) 0 3.5px, rgba(70, 232, 36, 0.35) 4.5px, transparent 7px) 0 50% / 14px 14px no-repeat; animation: packet 6s linear infinite; }
.steps li { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; }
.steps__n { position: relative; z-index: 1; align-self: center; display: grid; place-items: center; width: var(--b); height: var(--b); border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px rgba(70, 232, 36, 0.55); font-size: 0.85rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; animation: stage 6s ease-out infinite; }
.steps li:nth-child(2) .steps__n { animation-delay: 2.4s; }
.steps li:nth-child(3) .steps__n { animation-delay: 4.8s; }
.steps__card { flex: 1; padding: 26px 28px; border-radius: var(--radius); border: 1px solid var(--line); }
@keyframes packet {
  0% { background-position-x: 0%; opacity: 0; }
  4% { opacity: 1; }
  80% { background-position-x: 100%; opacity: 1; }
  88%, 100% { background-position-x: 100%; opacity: 0; }
}
/* mobile: each connector carries the packet for its 40% of the loop */
@keyframes packet-down {
  0% { background-position: 50% 0%, 50% 50%; background-size: 0 0, 2px 100%; }
  1% { background-size: 14px 14px, 2px 100%; }
  40% { background-position: 50% 100%, 50% 50%; background-size: 14px 14px, 2px 100%; }
  41%, 100% { background-position: 50% 100%, 50% 50%; background-size: 0 0, 2px 100%; }
}
@keyframes stage {
  0% { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 8px rgba(70, 232, 36, 0.14); }
  16%, 100% { background: var(--bg); color: var(--accent); box-shadow: inset 0 0 0 1.5px rgba(70, 232, 36, 0.55), 0 0 0 8px rgba(70, 232, 36, 0); }
}
@keyframes stage-b {
  0% { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 8px rgba(70, 232, 36, 0.14); }
  16%, 100% { background: var(--bg); color: var(--accent); box-shadow: inset 0 0 0 1.5px rgba(70, 232, 36, 0.55), 0 0 0 8px rgba(70, 232, 36, 0); }
}
/* Scroll-linked entrance: content is visible by default where unsupported */
@supports (animation-timeline: view()) {
  .steps li { animation: step-in var(--ease-out) both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
  .steps li:nth-child(2) { animation-range: entry 15% cover 36%; }
  .steps li:nth-child(3) { animation-range: entry 30% cover 42%; }
}
@media (min-width: 861px) {
  .steps[data-stage="0"]::after { animation: none; opacity: 0; }
  .steps[data-stage="0"] .steps__n, .steps[data-stage="1"] li:nth-child(3) .steps__n { animation: none; }
  .steps[data-stage="1"]::after { animation: packet-half 3s linear infinite; }
  /* separate name so the badges restart in sync with the packet when the stage changes */
  .steps[data-stage="1"] .steps__n { animation-name: stage-b; animation-duration: 3s; }
}
@keyframes packet-half {
  0% { background-position-x: 0%; opacity: 0; }
  4% { opacity: 1; }
  80% { background-position-x: 50%; opacity: 1; }
  88%, 100% { background-position-x: 50%; opacity: 0; }
}
@keyframes step-in { from { opacity: 0; transform: translateY(28px); } }
.steps p { color: var(--muted); margin-top: 8px; }

.cta { background: var(--accent); color: var(--accent-ink); padding: 56px 0; }
.cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.cta p { margin-top: 8px; font-size: 1.08rem; opacity: 0.8; }

/* Contact */
.split--contact { align-items: start; }
.contact { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 22px; }
.contact li { display: flex; gap: 16px; }
.contact svg { width: 22px; height: 22px; color: var(--accent); margin-top: 3px; }
.contact span { display: block; color: var(--muted); font-size: 0.86rem; margin-bottom: 2px; }
.contact a, .contact p { font-weight: 550; text-decoration: none; }
.contact a { display: inline-flex; align-items: center; min-height: 44px; }
@media (hover: hover) and (pointer: fine) { .contact a:hover { text-decoration: underline; text-underline-offset: 3px; } }

.form { padding: 32px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 16px; }
.form__hint { color: var(--muted); font-size: 0.92rem; margin-top: -8px; }
.form label { display: grid; gap: 6px; font-weight: 550; font-size: 0.95rem; }
.form small { color: var(--muted); font-weight: 400; }
.form input, .form textarea {
  width: 100%; padding: 12px 14px;
  font: 400 1rem/1.4 var(--font); color: var(--fg);
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color 160ms ease;
}
.form textarea { resize: vertical; min-height: 110px; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.field-error { color: var(--danger); font-size: 0.9rem; font-weight: 500; }
.form [aria-invalid="true"] { border-color: var(--danger); }
.form .btn { justify-self: start; }

.map { display: block; width: 100%; height: 340px; margin-top: 64px; border: 1px solid var(--line); border-radius: 20px; filter: grayscale(0.4) contrast(1.05); }

/* bottom padding leaves room for the fixed WhatsApp button */
.footer { border-top: 1px solid var(--line); padding: 64px 0 calc(96px + env(safe-area-inset-bottom)); background: var(--bg-deep); }
.footer p { color: var(--muted); font-size: 0.95rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr; gap: 48px; }
.footer__about p { max-width: 36ch; margin-top: 18px; }
.footer__social { display: flex; gap: 10px; margin-top: 22px; }
.footer__social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); transition: color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out); }
.footer__social svg { width: 20px; height: 20px; }
.footer__col h2 { font-size: 0.95rem; font-weight: 700; color: var(--fg); margin-bottom: 14px; }
.footer__col ul { list-style: none; margin: 0; padding: 0; }
.footer__col a, .footer__plain { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 0.95rem; line-height: 1.4; }
.footer__col svg { width: 18px; height: 18px; color: var(--accent); }
.footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-top: 48px; padding-top: 20px; background: linear-gradient(var(--line), var(--line)) 20px 0 / calc(100% - 40px) 1px no-repeat; }
.footer__bottom a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 0.95rem; }
@media (hover: hover) and (pointer: fine) {
  .footer__col a:hover, .footer__bottom a:hover { color: var(--fg); }
  .footer__social a:hover { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
}
@media (max-width: 860px) {
  .footer { padding-top: 48px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 36px 24px; }
  .footer__about { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer__grid { grid-template-columns: 1fr; }
}

.wa-float {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40;
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; color: #fff; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.5);
  transition: transform 160ms var(--ease-out);
}
.wa-float svg { width: 30px; height: 30px; }
.wa-float:active { transform: scale(0.94); }

/* Responsive */
@media (max-width: 860px) {
  .hero { padding: 40px 0 64px; }
  .hero__grid, .split { grid-template-columns: 1fr; gap: 40px; }
  .section { padding: 72px 0; }
  .steps { grid-template-columns: 1fr; }
  .steps::before, .steps::after { display: none; }
  .steps li { flex-direction: row; gap: 16px; }
  .steps__n { align-self: flex-start; }
  .steps li:not(:last-child)::after {
    content: ""; position: absolute; left: calc(var(--b) / 2 - 7px); top: var(--b); bottom: calc(-1 * var(--gap)); width: 14px;
    background: radial-gradient(circle, var(--accent) 0 3.5px, rgba(70, 232, 36, 0.35) 4.5px, transparent 7px) 50% 0% / 14px 14px no-repeat, linear-gradient(rgba(70, 232, 36, 0.3), rgba(70, 232, 36, 0.3)) 50% 50% / 2px 100% no-repeat;
    animation: packet-down 6s linear infinite;
  }
  .steps li:nth-child(2)::after { animation-delay: 2.4s; }
  .services { grid-template-columns: 1fr; }
  .services__intro { position: static; }
  .services { --pin-top: calc(var(--hh, 68px) + 16px); }
  .diagram svg { max-width: 380px; }
  .cta__inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .hero__cta .btn { flex: 1 1 100%; }
  .svc-list li { grid-template-columns: 1fr; padding: 18px 0; }
  .form { padding: 22px; }
  .map { height: 280px; margin-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .diagram__packets { display: none; }
  .diagram .node { animation: none; }
  .steps::before, .steps::after, .steps li, .steps li::after, .steps__n { animation: none; }
  .steps::before { transform: none; }
  .steps::after { display: none; }
}
