/* ============================================================
   tech-effects.css — Nucleotech Service, LDA
   Advanced technology visual effects
   ============================================================ */

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #1B6FCC, #3B82F6, #60A5FA);
  z-index: 99999;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.8), 0 0 20px rgba(59, 130, 246, 0.4);
  transition: width 0.1s linear;
}

/* ============================================================
   CUSTOM CURSOR — Desktop only
   ============================================================ */

@media (pointer: fine) {
  * { cursor: none !important; }

  .cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background: #60A5FA;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 8px #3B82F6, 0 0 16px rgba(59, 130, 246, 0.5);
  }

  .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border: 1.5px solid rgba(59, 130, 246, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99997;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.2s ease;
  }

  .cursor-dot.hover {
    width: 10px;
    height: 10px;
    background: #93C5FD;
    box-shadow: 0 0 14px #60A5FA, 0 0 28px rgba(96, 165, 250, 0.5);
  }

  .cursor-ring.hover {
    width: 48px;
    height: 48px;
    border-color: rgba(59, 130, 246, 0.35);
  }

  .cursor-dot.click {
    transform: translate(-50%, -50%) scale(0.6);
  }

  .cursor-ring.click {
    width: 20px;
    height: 20px;
    border-color: rgba(59, 130, 246, 0.8);
  }
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #05080F;
  z-index: 999999;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo-text {
  font-size: clamp(16px, 5vw, 22px);
  font-weight: 900;
  letter-spacing: clamp(4px, 2vw, 8px);
  text-transform: uppercase;
  color: #F1F5F9;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.loading-logo-text::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
  animation: scan-shine 1.4s ease forwards;
}

@keyframes scan-shine {
  0%   { left: -60%; }
  100% { left: 160%; }
}

.loading-sub-text {
  font-size: clamp(8px, 2vw, 10px);
  font-weight: 600;
  letter-spacing: clamp(2px, 1vw, 3px);
  color: #1B6FCC;
  text-transform: uppercase;
  margin-bottom: 48px;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
}

.loading-bar-track {
  width: 260px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 18px;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1B6FCC, #3B82F6, #60A5FA);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.9);
  animation: load-fill 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes load-fill {
  0%   { width: 0%; }
  30%  { width: 45%; }
  60%  { width: 72%; }
  85%  { width: 91%; }
  100% { width: 100%; }
}

.loading-status {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: #3B82F6;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  height: 16px;
  opacity: 0.8;
}

/* ============================================================
   HERO — Extra layers
   ============================================================ */

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(59, 130, 246, 1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 1) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.028;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 70% at 50% 50%, transparent 30%, rgba(10, 14, 26, 0.6) 100%);
}

.hero-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(to top, #0A0E1A, transparent);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeIn 0.8s ease 2.4s forwards;
}

.scroll-mouse {
  width: 22px;
  height: 36px;
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  border-radius: 11px;
  position: relative;
}

.scroll-wheel {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 6px;
  background: rgba(148, 163, 184, 0.5);
  border-radius: 2px;
  animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.7; }
  60%       { transform: translateX(-50%) translateY(12px); opacity: 0; }
}

.scroll-label {
  font-size: 9px;
  letter-spacing: 2.5px;
  color: rgba(148, 163, 184, 0.4);
  text-transform: uppercase;
  font-weight: 600;
}

/* ============================================================
   GLITCH TEXT
   ============================================================ */

.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: var(--accent-primary);
  opacity: 0;
  pointer-events: none;
}

.glitch::before {
  color: #ff3366;
  clip-path: polygon(0 30%, 100% 30%, 100% 55%, 0 55%);
}

.glitch::after {
  color: #00e5ff;
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
}

.glitch.glitching::before {
  opacity: 1;
  animation: glitch-a 0.25s steps(2) forwards;
}

.glitch.glitching::after {
  opacity: 1;
  animation: glitch-b 0.25s steps(2) forwards;
}

@keyframes glitch-a {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-4px, 1px); }
  50%  { transform: translate(3px, -1px); }
  75%  { transform: translate(-2px, 2px); }
  100% { transform: translate(0, 0); opacity: 0; }
}

@keyframes glitch-b {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(4px, -1px); }
  50%  { transform: translate(-3px, 1px); }
  75%  { transform: translate(2px, -2px); }
  100% { transform: translate(0, 0); opacity: 0; }
}

/* ============================================================
   TYPEWRITER CURSOR
   ============================================================ */

.tw-cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--accent-primary);
  margin-left: 2px;
  vertical-align: middle;
  border-radius: 1px;
  animation: blink-cursor 0.75s step-end infinite;
}

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

/* ============================================================
   NEON CARD EFFECT
   ============================================================ */

.neon-border {
  position: relative;
  overflow: hidden;
}

.neon-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0) 0%,
    rgba(59, 130, 246, 0.4) 50%,
    rgba(27, 111, 204, 0) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.neon-border:hover::before {
  opacity: 1;
}

/* Corner accent */
.neon-border::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: 0 inherit 0 0;
}

.neon-border:hover::after {
  opacity: 1;
}

/* ============================================================
   BUTTON ENHANCEMENTS
   ============================================================ */

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
  pointer-events: none;
}

.btn-primary:hover::after {
  width: 400px;
  height: 400px;
}

/* ============================================================
   STAT CARDS — Glow enhancements
   ============================================================ */

.stat-card {
  border-left: none !important;
  position: relative;
  transition: all 0.35s ease !important;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(to bottom, #1B6FCC, #3B82F6, #60A5FA);
  border-radius: 2px 0 0 2px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.stat-card:hover {
  background: #111e33 !important;
  transform: translateX(6px) !important;
  box-shadow: 0 4px 24px rgba(59, 130, 246, 0.12);
}

.stat-num {
  text-shadow: 0 0 30px rgba(27, 111, 204, 0.4);
}

/* ============================================================
   SECTION DIVIDERS — Glowing lines
   ============================================================ */

#sobre::before,
#ecossistema::before,
#clientes::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.25), transparent);
}

#sobre,
#ecossistema,
#clientes {
  position: relative;
}

/* ============================================================
   ECO CARDS — Hover lift
   ============================================================ */

.eco-card {
  transition: all 0.3s ease !important;
}

.eco-card:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.08) !important;
}

/* ============================================================
   CLIENT BADGES — Glow on hover
   ============================================================ */

.client-badge {
  transition: all 0.3s ease !important;
}

.client-badge:hover {
  border-color: rgba(59, 130, 246, 0.35) !important;
  color: #60A5FA !important;
  background: rgba(59, 130, 246, 0.06) !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.12) !important;
}

/* ============================================================
   CTA SECTION
   ============================================================ */

#cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), rgba(27, 111, 204, 0.4), transparent);
  animation: border-glow 4s ease-in-out infinite alternate;
}

@keyframes border-glow {
  0%   { opacity: 0.5; }
  100% { opacity: 1; }
}

/* ============================================================
   HERO BADGE — Pulse
   ============================================================ */

.hero-badge {
  animation: badge-pulse 3.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(27, 111, 204, 0.2); }
  50%       { box-shadow: 0 0 0 8px rgba(27, 111, 204, 0); }
}

/* ============================================================
   SECTION LABEL — Pulse dot
   ============================================================ */

.section-label::before {
  animation: label-pulse 2.5s ease-in-out infinite;
  width: 24px !important;
}

@keyframes label-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; box-shadow: 0 0 8px var(--accent-primary); }
}

/* ============================================================
   PARCEIRO — Top glow line
   ============================================================ */

#parceiros {
  position: relative;
}

#parceiros::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), var(--accent-primary), rgba(59, 130, 246, 0.3), transparent);
}

/* ============================================================
   FOOTER — Top glow line
   ============================================================ */

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
}

footer {
  position: relative;
}

/* ============================================================
   NAV — Glow when scrolled
   ============================================================ */

nav.scrolled {
  box-shadow: 0 1px 30px rgba(0, 0, 0, 0.4), 0 0 1px rgba(59, 130, 246, 0.15) !important;
}

/* ============================================================
   HERO H1 GLOW
   ============================================================ */

#hero h1 {
  text-shadow: 0 0 60px rgba(27, 111, 204, 0.15);
}

/* ============================================================
   TAB ACTIVE — Glow
   ============================================================ */

.tab-btn.active {
  text-shadow: 0 0 12px rgba(27, 111, 204, 0.3);
}

/* ============================================================
   HERO CONTENT — Fade in after loading
   ============================================================ */

.hero-content {
  animation: heroEntrance 0.9s ease 1.7s both;
}

@keyframes heroEntrance {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hero sub hidden until typewriter starts */
.hero-sub {
  visibility: hidden;
}

/* ============================================================
   HERO — Central glow orb
   ============================================================ */

.hero-glow-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
  width: 680px;
  height: 680px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(27, 111, 204, 0.18) 0%,
    rgba(27, 111, 204, 0.08) 35%,
    transparent 70%
  );
  z-index: 1;
  pointer-events: none;
  animation: orb-breathe 5s ease-in-out infinite;
}

@keyframes orb-breathe {
  0%, 100% { transform: translate(-50%, -52%) scale(1);   opacity: 1; }
  50%       { transform: translate(-50%, -52%) scale(1.1); opacity: 0.65; }
}

/* ============================================================
   PARCEIROS — Circuit decoration
   ============================================================ */

.parceiro-left,
.parceiro-right {
  position: relative;
  overflow: hidden;
}

.parceiro-circuit {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 1;
}

/* SVG circuit pattern injected via background */
.parceiro-circuit-left {
  background:
    /* horizontal lines */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(27, 111, 204, 0.06) 39px,
      rgba(27, 111, 204, 0.06) 40px
    ),
    /* vertical lines */
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(27, 111, 204, 0.06) 39px,
      rgba(27, 111, 204, 0.06) 40px
    );
  /* Fade out towards left edge — content side */
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 90% 50%, black 30%, transparent 100%);
  mask-image:         radial-gradient(ellipse 100% 80% at 90% 50%, black 30%, transparent 100%);
}

.parceiro-circuit-right {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(59, 130, 246, 0.06) 39px,
      rgba(59, 130, 246, 0.06) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(59, 130, 246, 0.06) 39px,
      rgba(59, 130, 246, 0.06) 40px
    );
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 10% 50%, black 30%, transparent 100%);
  mask-image:         radial-gradient(ellipse 100% 80% at 10% 50%, black 30%, transparent 100%);
}

/* Glowing corner accent — top-right of left panel */
.parceiro-left::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(218, 41, 28, 0.08) 0%, transparent 65%);
  pointer-events: none;
}

/* Glowing corner accent — bottom-left of right panel */
.parceiro-right::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.09) 0%, transparent 65%);
  pointer-events: none;
}

/* ============================================================
   CTA — Decorações laterais (rede + servidores)
   ============================================================ */

.cta-deco {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  height: 320px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}

.cta-deco-left  { left: 4%; }
.cta-deco-right { right: 4%; }

@media (max-width: 1100px) {
  .cta-deco { display: none; }
}

/* Pacote de dados a percorrer a topologia */
.data-packet {
  animation: packet-travel 4s ease-in-out infinite;
}

@keyframes packet-travel {
  0%   { transform: translate(60px,  60px);  opacity: 1; }
  25%  { transform: translate(140px, 130px); opacity: 1; }
  50%  { transform: translate(200px, 210px); opacity: 0.8; }
  75%  { transform: translate(140px, 130px); opacity: 0.6; }
  100% { transform: translate(60px,  60px);  opacity: 1; }
}

/* LEDs a piscar com fases diferentes */
.led-blink { animation: led-pulse 2.2s ease-in-out infinite; }
.led-1 { animation-delay: 0s; }
.led-2 { animation-delay: 0.55s; }
.led-3 { animation-delay: 1.1s; }
.led-4 { animation-delay: 1.65s; }

@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* Barras de actividade do servidor */
.bar-activity { animation: bar-grow 3s ease-in-out infinite; }
.bar-a1 { animation-delay: 0s; }
.bar-a2 { animation-delay: 1s; }

@keyframes bar-grow {
  0%, 100% { transform: scaleX(1);    transform-origin: left; }
  50%       { transform: scaleX(0.4); transform-origin: left; }
}

/* ============================================================
   CTA — Animated orbit rings
   ============================================================ */

.cta-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  pointer-events: none;
  z-index: 0;
}

.cta-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.12);
  transform: translate(-50%, -50%);
  animation: ring-expand 6s ease-in-out infinite;
}

.cta-ring-1 {
  width: 220px;
  height: 220px;
  border-color: rgba(27, 111, 204, 0.2);
  animation-delay: 0s;
}

.cta-ring-2 {
  width: 380px;
  height: 380px;
  border-color: rgba(59, 130, 246, 0.12);
  animation-delay: 1.5s;
}

.cta-ring-3 {
  width: 540px;
  height: 540px;
  border-color: rgba(59, 130, 246, 0.07);
  animation-delay: 3s;
}

@keyframes ring-expand {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.6; }
  50%       { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}

/* dot node on the first ring */
.cta-ring-1::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1B6FCC;
  box-shadow: 0 0 10px #3B82F6, 0 0 20px rgba(59, 130, 246, 0.5);
  animation: orbit-dot 6s linear infinite;
  transform-origin: 50% 110px; /* half of ring-1 height */
}

@keyframes orbit-dot {
  from { transform: translateX(-50%) rotate(0deg)   translateY(-110px); }
  to   { transform: translateX(-50%) rotate(360deg) translateY(-110px); }
}

/* Ensure CTA content is above the rings */
#cta > .reveal {
  position: relative;
  z-index: 1;
}

/* ============================================================
   SOBRE — Subtle glow behind stats
   ============================================================ */

.sobre-stats {
  position: relative;
}

.sobre-stats::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27, 111, 204, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.sobre-stats .stat-card {
  position: relative;
  z-index: 1;
}
