/*
 * Grafismos de fundo da homepage (frontend publico).
 * Tema "azulejo": padrao geometrico portugues + crescimento, rede e
 * trajetoria. Tudo decorativo (aria-hidden, sem eventos) e animado so com
 * transform/opacity; desliga-se com "prefers-reduced-motion".
 */

:root {
    --hg-line: rgba(76, 215, 246, 0.30);
    --hg-line-soft: rgba(76, 215, 246, 0.16);
    --hg-fill: rgba(76, 215, 246, 0.22);
    --hg-orb-a: rgba(0, 118, 178, 0.30);
    --hg-orb-b: rgba(76, 215, 246, 0.20);
    --hg-gold: rgba(212, 149, 43, 0.35);
}

html.light-theme {
    --hg-line: rgba(0, 118, 178, 0.30);
    --hg-line-soft: rgba(0, 118, 178, 0.16);
    --hg-fill: rgba(0, 118, 178, 0.14);
    --hg-orb-a: rgba(0, 118, 178, 0.16);
    --hg-orb-b: rgba(76, 215, 246, 0.22);
}

/* Base ---------------------------------------------------------------- */

.hg-host { position: relative; }
.hg-host > :not(.hg) { position: relative; z-index: 1; }

.hg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

/* Fundo que sai da coluna central e ocupa a largura do ecra. */
.hg.hg-bleed {
    left: 50%;
    right: auto;
    width: 100vw;
    transform: translateX(-50%);
}

.hg svg { display: block; }
.hg-line { fill: none; stroke: var(--hg-line); stroke-width: 1.2; }
.hg-line.soft { stroke: var(--hg-line-soft); }
.hg-line.thick { stroke-width: 2.4; }
.hg-line.dash { stroke-dasharray: 6 9; }
.hg-fill { fill: var(--hg-fill); stroke: none; }

.hg-orb { position: absolute; border-radius: 50%; filter: blur(70px); }

/* Hero ---------------------------------------------------------------- */

.hero > .hg-hero { z-index: 0; }
.hero > .hero-badge { align-self: flex-start; }

.hg-hero .hg-line { stroke: rgba(76, 215, 246, 0.26); }
.hg-hero .hg-line.soft { stroke: rgba(76, 215, 246, 0.14); }


.hg-hero-art {
    position: absolute;
    top: 50%;
    right: max(24px, calc((100vw - 1180px) / 2 - 10px));
    width: min(540px, 42vw);
    aspect-ratio: 560 / 520;
    transform: translateY(-46%);
}

.hg-hero-art > svg { width: 100%; height: 100%; overflow: visible; }

.hg-ring { stroke: rgba(76, 215, 246, 0.22); stroke-width: 1.4; fill: none; transform-origin: 280px 260px; }
.hg-spin { animation: hg-spin 60s linear infinite; }
.hg-spin-rev { animation: hg-spin 48s linear infinite reverse; }
.hg-baseline { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1.4; }
.hg-bar { transform-box: fill-box; transform-origin: bottom; animation: hg-grow 1.1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 0.09s + 0.3s); }
.hg-trend { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 700; stroke-dashoffset: 700; animation: hg-draw 2.2s ease-out 0.7s forwards; }
.hg-trend-glow { fill: none; stroke: rgba(76, 215, 246, 0.35); stroke-width: 14; stroke-linecap: round; filter: blur(8px); opacity: 0; animation: hg-fade 1s ease-out 2.2s forwards; }
.hg-node-halo { fill: rgba(124, 240, 255, 0.35); transform-box: fill-box; transform-origin: center; animation: hg-pulse 2.4s ease-in-out infinite; }
.hg-arrow { fill: none; stroke: #ffffff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }

.hg-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 16px 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(15, 26, 46, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
    color: #ffffff;
    font-size: 0.8125rem;
    white-space: nowrap;
    animation: hg-float 7s ease-in-out infinite;
}

.hg-chip svg { width: 18px; height: 18px; padding: 6px; box-sizing: content-box; border-radius: 10px; background: rgba(76, 215, 246, 0.18); color: #7cf0ff; }
.hg-chip b { font-weight: 600; }
.hg-chip-1 { top: 4%; left: -4%; animation-delay: 0s; }
.hg-chip-3 { bottom: 14%; right: -2%; animation-delay: -3.2s; }

/* Mais Networking: rede de contactos ---------------------------------- */

.hg-network { top: -70px; bottom: -70px; opacity: 0.9; }
.hg-network svg { width: 100%; height: 100%; }
.hg-edge { stroke: var(--hg-line-soft); stroke-width: 1.4; }
.hg-node { fill: #4cd7f6; }
.hg-node-ring { fill: none; stroke: var(--hg-line); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; animation: hg-pulse 4s ease-in-out infinite; animation-delay: var(--d); }
html.light-theme .hg-node { fill: #0076b2; }

/* Vantagens: escalar ---------------------------------------------------- */

.hg-scale-art { position: absolute; right: max(2vw, calc(50vw - 640px)); bottom: 6%; width: min(300px, 24vw); height: auto; opacity: 0.9; }
.hg-step { transform-box: fill-box; transform-origin: bottom; animation: hg-grow 0.9s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d); }
.hg-climb { stroke: #0076b2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: hg-draw 2.2s ease-out 0.4s forwards; }
.hg-pulse-dot { transform-box: fill-box; transform-origin: center; animation: hg-float 3.5s ease-in-out infinite; }
.hg-scale-rings { position: absolute; left: max(1vw, calc(50vw - 660px)); top: 4%; width: min(240px, 19vw); height: auto; }
.hg-spin-slow { transform-box: fill-box; transform-origin: center; animation: hg-spin 40s linear infinite; }
.hg-scale-plus { position: absolute; left: 12%; bottom: 10%; width: 34px; height: 34px; animation: hg-float 6s ease-in-out infinite; }
.hg-spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--hg-gold); animation: hg-twinkle 3.6s ease-in-out infinite; }
.hg-spark-1 { top: 18%; right: 34%; }
.hg-spark-2 { top: 62%; left: 30%; animation-delay: -1.2s; }
.hg-spark-3 { top: 30%; right: 6%; animation-delay: -2.2s; background: var(--hg-line); }

/* Cursos em destaque ----------------------------------------------------- */

.hg-featured { top: -40px; bottom: -40px; }
.hg-orb-c { top: 8%; left: -4%; width: 360px; height: 360px; background: var(--hg-orb-a); }
.hg-orb-d { bottom: 6%; right: -3%; width: 320px; height: 320px; background: var(--hg-orb-b); }

.hg-dots {
    position: absolute;
    width: 220px;
    height: 160px;
    background-image: radial-gradient(var(--hg-line) 1.6px, transparent 1.8px);
    background-size: 20px 20px;
}

.hg-dots-l { top: 2%; left: 3%; }
.hg-dots-r { bottom: 4%; right: 4%; }

.hg-shape { position: absolute; animation: hg-float 9s ease-in-out infinite; }
.hg-shape-ring { top: 6%; right: 6%; width: 110px; }
.hg-shape-plus { top: 38%; left: 2%; width: 40px; animation-delay: -3s; }
.hg-shape-tri { bottom: 18%; left: 7%; width: 64px; animation-delay: -5s; }
.hg-shape-star { top: 30%; right: 3%; width: 48px; animation-delay: -2s; }

/* Depoimentos -------------------------------------------------------------- */

.hg-bigquote { position: absolute; width: 220px; fill: var(--hg-fill); }
.hg-bigquote-l { top: 6%; left: 3%; }
.hg-bigquote-r { bottom: 4%; right: 3%; transform: rotate(180deg); }
.hg-arc { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70%; opacity: 0.8; }
.hg-quotes .hg-line.dash { animation: hg-dash 40s linear infinite; }

/* CTA (fundo sempre escuro) ------------------------------------------------ */

.cta-band { isolation: isolate; }
.cta-band > :not(.hg) { position: relative; z-index: 1; }
.hg-cta .hg-wave { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; animation: hg-wave 5s ease-out infinite; animation-delay: var(--d, 0s); }
.hg-waves { position: absolute; right: -90px; top: 50%; width: 420px; height: 420px; transform: translateY(-50%); }
.hg-trajectory { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; opacity: 0.9; }
.hg-traj-path { stroke: rgba(255, 255, 255, 0.34); stroke-width: 2; stroke-dasharray: 3 11; stroke-linecap: round; animation: hg-dash 18s linear infinite; }
.hg-rocket { animation: hg-float 4s ease-in-out infinite; }
.hg-flame { transform-box: fill-box; transform-origin: top; animation: hg-flame 0.5s ease-in-out infinite alternate; }
.hg-spark { position: absolute; width: 18px; fill: rgba(255, 255, 255, 0.7); animation: hg-twinkle 3.2s ease-in-out infinite; animation-delay: var(--d); }

/* Newsletter --------------------------------------------------------------- */

.hg-newsletter { z-index: 0; }
.hg-newsletter svg { position: absolute; right: 0; bottom: 0; width: min(520px, 100%); height: 100%; opacity: 0.85; }
.hg-newsletter .hg-line.dash { animation: hg-dash 24s linear infinite; }
.hg-plane { animation: hg-float 5s ease-in-out infinite; }
.hg-dotc { fill: var(--hg-fill); animation: hg-pulse 3s ease-in-out infinite; animation-delay: var(--d, 0s); transform-box: fill-box; transform-origin: center; }

/* Movimento --------------------------------------------------------------- */

@keyframes hg-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes hg-grow { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes hg-draw { to { stroke-dashoffset: 0; } }
@keyframes hg-fade { to { opacity: 1; } }
@keyframes hg-spin { to { transform: rotate(360deg); } }
@keyframes hg-pulse { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.5); opacity: 0.35; } }
@keyframes hg-dash { to { stroke-dashoffset: -600; } }
@keyframes hg-wave { 0% { transform: scale(0.85); opacity: 0.8; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes hg-twinkle { 0%, 100% { opacity: 0.15; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes hg-flame { from { transform: scaleY(0.8); } to { transform: scaleY(1.25); } }

@media (prefers-reduced-motion: reduce) {
    .hg-climb { stroke-dashoffset: 0; }
    .hg *, .hg-orb, .hg-chip, .hg-shape { animation: none !important; }
    .hg-trend { stroke-dashoffset: 0; }
    .hg-trend-glow { opacity: 1; }
}

/* Ecras pequenos: so o fundo; as composicoes grandes escondem-se. */
@media (max-width: 980px) {
    .hg-hero-art, .hg-chip, .hg-shape-ring, .hg-shape-tri, .hg-bigquote, .hg-waves, .hg-scale-art, .hg-scale-rings { display: none; }
    .hg-network { opacity: 0.45; }
}
