/* ════════════════════════════════════════
   TOKENS
════════════════════════════════════════ */
:root {
  --c-processos:       #F59E0B;
  --c-tecnologia:      #00FFFF;
  --c-desenvolvimento: #00FF41;
  --c-automacoes:      #8B5CF6;
  --c-integracoes:     #FF0066;
  --bg:   #050505;
  --bg2:  #0a0a0f;
  --text: #E8EDF5;
  --dim:  rgba(232,237,245,0.42);
  --bdr:  rgba(255,255,255,0.06);
  --f-display: 'Orbitron', sans-serif;
  --f-body:    'Syne', sans-serif;
  --f-mono:    'Share Tech Mono', monospace;
}

/* ════════════════════════════════════════
   RESET + BASE
════════════════════════════════════════ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html, body { width:100%; height:100%; overflow:hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════
   FIXED VISUAL LAYERS
════════════════════════════════════════ */
#three-canvas {
  position: fixed; inset:0;
  z-index: 0;
  pointer-events: none;
}
.grain {
  position: fixed; inset:0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.18;
  animation: grainShift 1.1s steps(1) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='4'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
}
@keyframes grainShift {
  0%   { transform:translate(0,0); }
  25%  { transform:translate(-2%,-1%); }
  50%  { transform:translate(1%,2%); }
  75%  { transform:translate(-1%,1%); }
  100% { transform:translate(2%,-1%); }
}
.scanlines {
  position: fixed; inset:0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.07) 2px,
    rgba(0,0,0,.07) 4px
  );
}

/* ════════════════════════════════════════
   CURSOR
════════════════════════════════════════ */
#cur {
  position: fixed;
  width: 9px; height: 9px;
  background: white;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%,-50%);
  mix-blend-mode: difference;
  transition: width .15s, height .15s;
  will-change: left, top;
}
#cur.big { width: 22px; height: 22px; }
#cur-ring {
  position: fixed;
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%,-50%);
  will-change: left, top;
  transition: border-color .25s;
}
#cur-label {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  font-family: var(--f-mono);
  font-size: .52rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: white;
  opacity: 0;
  transform: translate(22px,-50%);
  transition: opacity .2s;
  mix-blend-mode: difference;
}

/* ════════════════════════════════════════
   LOADER
════════════════════════════════════════ */
#loader {
  position: fixed; inset:0;
  background: var(--bg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 80px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.ldr-logo {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2rem,5vw,3.2rem);
  letter-spacing: .12em;
  color: white;
  text-transform: uppercase;
  margin-bottom: 44px;
}
.ldr-logo em { color:#00FFFF; font-style:normal; }
.ldr-terminal {
  font-family: var(--f-mono);
  font-size: .72rem;
  line-height: 2.1;
  min-height: 130px;
}
.ldr-line { display:block; color: rgba(255,255,255,.35); }
.ldr-line.active { color: rgba(255,255,255,.85); }
.ldr-line.done   { color: rgba(255,255,255,.2); }
.ldr-blink {
  display: inline-block;
  width: 7px; height: 11px;
  background: white;
  vertical-align: middle;
  margin-left: 3px;
  animation: blink .75s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0;} }
.ldr-bar-wrap { margin-top:36px; width:220px; }
.ldr-bar {
  height: 1px;
  background: rgba(255,255,255,.1);
  position: relative; overflow:hidden;
}
.ldr-bar-fill {
  position:absolute; inset:0;
  background: white;
  width: 0%;
  transition: width .12s linear;
  box-shadow: 0 0 8px white;
}
.ldr-pct {
  font-family: var(--f-mono);
  font-size: .58rem;
  letter-spacing: .25em;
  color: rgba(255,255,255,.3);
  margin-top: 8px;
}

/* ════════════════════════════════════════
   HUB OVERLAY
════════════════════════════════════════ */
#hub-overlay {
  position: fixed; inset:0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.hub-logo {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.1rem,2.5vw,1.7rem);
  letter-spacing: .22em;
  color: white;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 0 40px rgba(255,255,255,.15);
}
.hub-logo em { color:#00FFFF; font-style:normal; }
.hub-tagline {
  font-family: var(--f-mono);
  font-size: clamp(.5rem,.8vw,.65rem);
  letter-spacing: .42em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  margin-top: 10px;
  text-align: center;
}
.hub-hint {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--f-mono);
  font-size: .52rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: rgba(255,255,255,.18);
  white-space: nowrap;
  animation: pulseHint 3.5s ease infinite;
}
@keyframes pulseHint { 0%,100%{opacity:.5;} 50%{opacity:.12;} }

/* ════════════════════════════════════════
   NODE LABELS (HTML overlay over Three.js)
════════════════════════════════════════ */
#node-labels {
  position: fixed; inset:0;
  z-index: 50;
  pointer-events: none;
}
.nl {
  position: absolute;
  transform: translate(-50%,-50%);
  text-align: center;
  pointer-events: all;
  cursor: none;
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* — central glowing dot — */
.nl-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--nc);
  box-shadow: 0 0 8px 2px var(--nc);
  margin-bottom: 12px;
  position: relative; z-index: 2;
  flex-shrink: 0;
  transition: box-shadow .35s, transform .35s;
}
.nl:hover .nl-dot {
  box-shadow: 0 0 22px 6px var(--nc);
  transform: scale(1.5);
}
/* — cosmic wave rings — */
.nl-waves {
  position: absolute;
  top: 4px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  pointer-events: none;
}
.nl-wave {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--nc);
  top: 0; left: 0;
  transform: translate(-50%,-50%) scale(0);
  opacity: 0;
  animation: cosmicWave 3.6s ease-out infinite;
}
.nl-wave:nth-child(1) { animation-delay: 0s; }
.nl-wave:nth-child(2) { animation-delay: 1.2s; }
.nl-wave:nth-child(3) { animation-delay: 2.4s; }
@keyframes cosmicWave {
  0%   { width:10px; height:10px; opacity:.65; transform:translate(-50%,-50%); }
  100% { width:86px; height:86px; opacity:0;   transform:translate(-50%,-50%); }
}
.nl:hover .nl-wave { animation-duration: 1.6s; }
.nl.prox  .nl-wave { animation-duration: 2.4s; }
/* — text — */
.nl-name {
  font-family: var(--f-mono);
  font-size: .58rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--nc);
  transition: text-shadow .3s;
  position: relative; z-index: 2;
}
.nl:hover .nl-name { text-shadow: 0 0 12px var(--nc); }
.nl-sub {
  font-family: var(--f-body);
  font-size: .62rem;
  font-weight: 300;
  color: rgba(255,255,255,.32);
  margin-top: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s, transform .3s;
  position: relative; z-index: 2;
}
.nl:hover .nl-sub { opacity:1; transform: translateY(0); }
/* — connection canvas — */
#conn-canvas {
  position: fixed; inset: 0;
  z-index: 48;
  pointer-events: none;
}

/* Per-node accent vars */
#nl-processos     { --nc: var(--c-processos); }
#nl-tecnologia    { --nc: var(--c-tecnologia); }
#nl-desenvolvimento { --nc: var(--c-desenvolvimento); }
#nl-automacoes    { --nc: var(--c-automacoes); }
#nl-integracoes   { --nc: var(--c-integracoes); }

/* ════════════════════════════════════════
   PAGES
════════════════════════════════════════ */
.page {
  position: fixed; inset:0;
  z-index: 5;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100vw);
}
.page-canvas {
  position: fixed; inset:0;
  z-index: 0;
  pointer-events: none;
}

/* ── Page Navigation ── */
.page-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 60px;
  background: linear-gradient(to bottom, rgba(5,5,5,.88) 60%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.back-btn {
  font-family: var(--f-mono);
  font-size: .58rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  background: none;
  border: 1px solid rgba(255,255,255,.1);
  padding: 8px 18px;
  cursor: none;
  display: flex; align-items:center; gap:7px;
  transition: color .3s, border-color .3s, box-shadow .3s;
}
.back-btn:hover {
  color: white;
  border-color: rgba(255,255,255,.3);
  box-shadow: 0 0 16px rgba(255,255,255,.05);
}
.page-nav-logo {
  font-family: var(--f-display);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .18em;
  color: rgba(255,255,255,.35);
  text-decoration: none;
}
.page-nav-logo em { font-style:normal; color: rgba(0,255,255,.4); }
.page-indicator {
  font-family: var(--f-mono);
  font-size: .52rem;
  letter-spacing: .28em;
  color: rgba(255,255,255,.2);
}

/* ── Page Content ── */
.page-content { position:relative; z-index:5; }

/* ── Hero ── */
.page-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 110px 80px 80px;
  position: relative;
}
.page-eyebrow {
  font-family: var(--f-mono);
  font-size: .58rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  display: flex; align-items:center; gap:12px;
  opacity: 0;
  animation: none;
}
.page-eyebrow::before {
  content:''; display:block;
  width:24px; height:1px;
  background: var(--accent);
}
.page-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(3rem,9vw,7.5rem);
  line-height: .9;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: white;
  max-width: 960px;
  overflow: hidden;
}
.page-title .accent { color: var(--accent); }
.page-title .outline {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255,255,255,.2);
}
/* word-mask reveal */
.wm { display:inline-block; overflow:hidden; vertical-align:bottom; }
.wi { display:inline-block; transform:translateY(110%); }
.page-desc {
  font-family: var(--f-body);
  font-size: clamp(.9rem,1.6vw,1.1rem);
  font-weight: 300;
  color: var(--dim);
  max-width: 500px;
  line-height: 1.85;
  margin-top: 28px;
  opacity: 0;
}
.scroll-hint {
  position: absolute;
  bottom: 36px; left: 80px;
  display: flex; align-items:center; gap:12px;
  font-family: var(--f-mono);
  font-size: .5rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: rgba(255,255,255,.18);
  opacity: 0;
}
.sh-line {
  width: 48px; height: 1px;
  background: rgba(255,255,255,.12);
  position:relative; overflow:hidden;
}
.sh-line::after {
  content:''; position:absolute; inset:0;
  background: white;
  animation: scan 2.2s ease infinite;
}
@keyframes scan { 0%{transform:translateX(-100%);} 100%{transform:translateX(200%);} }

/* ── Services ── */
.services {
  padding: 80px 80px 100px;
  position: relative; z-index:5;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(5,5,5,.92) 8%,
    rgba(5,5,5,.97) 100%
  );
}
.services-label {
  font-family: var(--f-mono);
  font-size: .58rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  margin-bottom: 48px;
  display:flex; align-items:center; gap:12px;
}
.services-label::before {
  content:''; display:block;
  width:24px; height:1px;
  background: currentColor;
}
.srv-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 1px;
}
.srv {
  padding: 40px 36px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--bdr);
  position: relative; overflow:hidden;
  cursor: none;
  transition: background .4s, transform .4s cubic-bezier(.16,1,.3,1), border-color .4s;
  opacity:0; transform:translateY(28px);
  transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1), background .4s, border-color .4s;
}
.srv.visible { opacity:1; transform:translateY(0); }
.srv::before {
  content:''; position:absolute;
  top:0; left:0; right:0; height:2px;
  background: var(--accent);
  transform: scaleX(0); transform-origin:left;
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.srv:hover::before { transform:scaleX(1); }
.srv:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.1);
  transform: translateY(-4px) !important;
}
/* mouse glow per card */
.srv::after {
  content:''; position:absolute; inset:0;
  background: radial-gradient(
    circle at var(--mx,50%) var(--my,50%),
    rgba(255,255,255,.04) 0%, transparent 55%
  );
  opacity:0; transition:opacity .4s;
}
.srv:hover::after { opacity:1; }
.srv-num {
  font-family: var(--f-mono);
  font-size: .52rem;
  letter-spacing: .28em;
  color: rgba(255,255,255,.18);
  margin-bottom: 18px;
}
.srv-title {
  font-family: var(--f-body);
  font-weight: 800;
  font-size: 1.05rem;
  color: white;
  margin-bottom: 10px;
  transition: color .3s;
}
.srv:hover .srv-title { color: var(--accent); }
.srv-desc {
  font-family: var(--f-body);
  font-size: .82rem;
  font-weight: 300;
  color: rgba(255,255,255,.38);
  line-height: 1.75;
}

/* ── CTA Row ── */
.pg-cta {
  padding: 72px 80px;
  position: relative; z-index:5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--bdr);
  background: rgba(5,5,5,.98);
  opacity:0; transform:translateY(24px);
  transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
}
.pg-cta.visible { opacity:1; transform:translateY(0); }
.cta-text h3 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.8rem,3.5vw,3rem);
  text-transform: uppercase;
  color: white;
  line-height: .95;
  margin-bottom: 10px;
}
.cta-text p {
  font-family: var(--f-body);
  font-size: .9rem;
  color: var(--dim);
  max-width: 380px;
  line-height: 1.7;
}
.cta-btn {
  font-family: var(--f-mono);
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border: none;
  padding: 16px 40px;
  cursor: none;
  text-decoration: none;
  display: inline-block;
  position: relative; overflow:hidden;
  flex-shrink:0;
  transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s;
}
.cta-btn::before {
  content:''; position:absolute; inset:0;
  background: rgba(0,0,0,.2);
  transform: translateX(-100%);
  transition: transform .4s cubic-bezier(.76,0,.24,1);
}
.cta-btn:hover::before { transform:translateX(0); }
.cta-btn:hover { transform:translateY(-3px); box-shadow:0 10px 40px rgba(255,255,255,.12); }

/* ── Accent per page ── */
#page-processos     { --accent: var(--c-processos); }
#page-tecnologia    { --accent: var(--c-tecnologia); }
#page-desenvolvimento { --accent: var(--c-desenvolvimento); }
#page-automacoes    { --accent: var(--c-automacoes); }
#page-integracoes   { --accent: var(--c-integracoes); }

/* ── Glitch title effect ── */
.glitch {
  position:relative; display:inline-block;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position:absolute; inset:0;
  pointer-events:none;
  overflow:hidden;
}
.glitch::before {
  color: #ff0050;
  animation: gl-r 8s infinite linear;
  mix-blend-mode: screen;
  clip-path: inset(0 0 0 0);
  opacity: 0;
}
.glitch::after {
  color: #00f0ff;
  animation: gl-c 7.5s infinite linear;
  mix-blend-mode: screen;
  opacity: 0;
}
@keyframes gl-r {
  0%,91%,100%{transform:none;opacity:0;clip-path:inset(0 0 0 0);}
  92%{transform:translate(2px,-1px);opacity:.9;clip-path:inset(20% 0 55% 0);}
  94%{transform:translate(-3px,1px);opacity:.8;clip-path:inset(50% 0 20% 0);}
  96%{transform:none;opacity:0;}
}
@keyframes gl-c {
  0%,93%,100%{transform:none;opacity:0;clip-path:inset(0 0 0 0);}
  94%{transform:translate(-2px,1px);opacity:.8;clip-path:inset(30% 0 40% 0);}
  96%{transform:translate(3px,-2px);opacity:.7;clip-path:inset(60% 0 10% 0);}
  98%{transform:none;opacity:0;}
}

/* ── Click ripple ── */
.ripple {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 8000;
  border: 1px solid rgba(255,255,255,.35);
  transform: translate(-50%,-50%) scale(0);
  animation: rippleOut .7s cubic-bezier(.2,.8,.4,1) forwards;
}
@keyframes rippleOut { to{transform:translate(-50%,-50%) scale(6);opacity:0;} }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width:768px) {
  #loader           { padding:40px 28px; }
  .page-nav         { padding:18px 24px; }
  .page-hero        { padding:100px 24px 72px; }
  .services         { padding:60px 24px 80px; }
  .pg-cta           { padding:52px 24px; flex-direction:column; gap:28px; align-items:flex-start; }
  .srv-grid         { grid-template-columns:1fr; }
  .scroll-hint      { left:24px; }
  #hub-overlay      { display:none; }
}
