/*
 * ══════════════════════════════════════════════
 *  SERVICES.CSS — Seção "Nossos Serviços"
 * ══════════════════════════════════════════════
 *
 *  Propósito : Scroll-pinned immersive section com painéis 3D,
 *              progress bar, typing terminal e ambient orbs.
 *  Dependências : tokens.css (--color-primary, --font-heading, etc.)
 *  NÃO COLOCAR AQUI : .typing-cursor (está em global.css).
 */

/* ══════════════════════════════════════════════
   SEÇÃO PRINCIPAL
   ══════════════════════════════════════════════ */
#services {
    position: relative;
    height: 550vh;
    padding: 0;
    overflow: visible;
    background: var(--color-black);
    margin-top: -140px; /* Puxa a seção para dentro da elipse de transição */
}

/* Ambient glow connecting with the transition dome (disabled for styling arch) */
#services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 600px;
    background: radial-gradient(
        circle at top center,
        rgba(14, 165, 233, 0.12) 0%,
        rgba(56, 189, 248, 0.04) 40%,
        transparent 75%
    );
    pointer-events: none;
    z-index: 1;
    display: none; /* Desativado temporariamente */
}

.services-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    perspective: 1200px;
}

/* ══════════════════════════════════════════════
   BACKGROUND LAYERS (Ambient Orbs + Dot Grid)
   ══════════════════════════════════════════════ */
.services-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    transition: transform 1.4s var(--ease-smooth), opacity 1.4s;
    will-change: transform, opacity;
}

.services-bg-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.08), transparent 70%);
    top: 10%;
    left: -5%;
}

.services-bg-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.06), transparent 70%);
    bottom: 5%;
    right: -5%;
}

.services-bg-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(14, 165, 233, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    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%);
    opacity: 0.6;
}

/* ══════════════════════════════════════════════
   LAYOUT PRINCIPAL (Grid 2 colunas)
   ══════════════════════════════════════════════ */
.services-inner {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: flex-start;
}

/* ══════════════════════════════════════════════
   COLUNA ESQUERDA (Número + Progresso)
   ══════════════════════════════════════════════ */
.services-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
}

.services-step-counter {
    position: relative;
    width: 100%;
}

/* ── Número Grande de Fundo ───────────────────── */
.services-big-num {
    font-family: var(--font-heading);
    font-size: clamp(8rem, 18vw, 14rem);
    font-weight: 200;
    line-height: 0.85;
    letter-spacing: -0.06em;
    color: transparent;
    -webkit-text-stroke: 1px rgba(14, 165, 233, 0.12);
    position: relative;
    transition: all 0.8s var(--ease-smooth);
    user-select: none;
}

/* ── Overlay preenchido (fade-in) ─────────────── */
.services-big-num-fill {
    position: absolute;
    inset: 0;
    font-family: var(--font-heading);
    font-size: clamp(8rem, 18vw, 14rem);
    font-weight: 200;
    line-height: 0.85;
    letter-spacing: -0.06em;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 50%, var(--color-primary-deep) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition:
        opacity 0.6s var(--ease-smooth),
        transform 1s var(--ease-smooth);
}

.services-big-num-fill.visible {
    opacity: 1;
    transform: scaleX(1);
}

/* ── Label do Passo ───────────────────────────── */
.services-left-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 4px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.6s var(--ease-smooth);
}

.services-left-label.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Título do Passo ──────────────────────────── */
.services-left-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 200;
    color: var(--color-white);
    letter-spacing: -0.03em;
    line-height: 1.15;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.7s var(--ease-smooth) 0.08s;
}

.services-left-title.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Descrição do Passo ───────────────────────── */
.services-left-desc {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    margin-top: 8px;
    max-width: 420px;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.7s var(--ease-smooth) 0.12s;
}

.services-left-desc.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ══════════════════════════════════════════════
   BARRA DE PROGRESSO HORIZONTAL
   ══════════════════════════════════════════════ */
.services-progress {
    width: 100%;
    height: 2px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.services-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.4);
    border-radius: 2px;
    width: 0%;
    transition: width 0.15s linear;
}

/* ══════════════════════════════════════════════
   DOTS DE NAVEGAÇÃO
   ══════════════════════════════════════════════ */
.services-dots {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.services-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.2);
    transition: all 0.5s var(--ease-smooth);
    cursor: default;
}

.services-dot.active {
    background: var(--color-primary);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
    border-color: var(--color-primary-light);
    transform: scale(1.3);
}

/* ══════════════════════════════════════════════
   COLUNA DIREITA (Stack de Painéis 3D)
   ══════════════════════════════════════════════ */
.services-right {
    position: relative;
    height: 520px;
    perspective: 900px;
}

/* ══════════════════════════════════════════════
   PAINÉIS 3D — Card base
   ══════════════════════════════════════════════ */
.services-panel {
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 11, 0.85);
    border: none;
    border-radius: var(--radius-lg);
    padding: 0;
    backdrop-filter: blur(20px);
    box-shadow:
        0 20px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(14, 165, 233, 0.08);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateZ(-120px) rotateY(8deg) scale(0.92);
    transition: all 0.8s var(--ease-smooth);
    pointer-events: none;
    will-change: transform, opacity;
    overflow: hidden;
}

/*
 * Painel limpo (sem card decorativo, fundo transparente).
 * Usado no painel 1 (IDE mockup) que tem sua própria estrutura visual.
 *
 * !important é necessário aqui porque .services-panel define estilos
 * base com alta especificidade (background, box-shadow, backdrop-filter,
 * border) que precisam ser completamente anulados neste contexto.
 */
.services-panel.services-panel-clean {
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    border: none !important;
    overflow: visible !important;
    width: 120% !important;
}

.services-panel.services-panel-clean::before,
.services-panel.services-panel-clean::after {
    display: none !important;
    content: none !important;
}

.services-panel.services-panel-clean.active {
    opacity: 1;
    pointer-events: auto;
    transform: none !important;
    will-change: auto !important;
}

/* ── Borda gradiente via mask-composite ───────── */
.services-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(160deg,
        rgba(14, 165, 233, 0.5),
        rgba(14, 165, 233, 0.08) 40%,
        transparent 60%,
        rgba(56, 189, 248, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 3;
}

/* ── Inner glow no topo ───────────────────────── */
.services-panel::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 80px;
    background: radial-gradient(ellipse 100% 100% at 50% 0%, rgba(14, 165, 233, 0.12), transparent);
    pointer-events: none;
    z-index: 1;
}

/* ── Estados do painel ────────────────────────── */
.services-panel.active {
    opacity: 1;
    transform: translateZ(0) rotateY(0deg) scale(1);
    pointer-events: auto;
}

.services-panel.behind {
    opacity: 0;
    transform: translateZ(-200px) rotateY(-4deg) scale(0.85);
    filter: blur(3px);
    pointer-events: none;
}

/* ══════════════════════════════════════════════
   SHIMMER SWEEP (ativado no painel ativo)
   ══════════════════════════════════════════════ */
@keyframes panel-shimmer {
    0%   { transform: translateX(-100%) skewX(-15deg); }
    100% { transform: translateX(300%) skewX(-15deg); }
}

.services-panel.active .panel-shimmer {
    animation: panel-shimmer 2.5s var(--ease-smooth) 0.3s 1;
}

.panel-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.06), rgba(255, 255, 255, 0.03), transparent);
    pointer-events: none;
    z-index: 2;
    transform: translateX(-100%) skewX(-15deg);
}

/* ══════════════════════════════════════════════
   GRID PATTERN INTERNO
   ══════════════════════════════════════════════ */
.panel-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
    mask-image: linear-gradient(to bottom, black 0%, transparent 60%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 60%);
    border-radius: var(--radius-lg);
}

/* ══════════════════════════════════════════════
   CORNER ACCENT MARKS
   ══════════════════════════════════════════════ */
.panel-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 4;
    pointer-events: none;
}

.panel-corner::before,
.panel-corner::after {
    content: '';
    position: absolute;
    background: rgba(14, 165, 233, 0.35);
}

.panel-corner::before {
    width: 16px;
    height: 1px;
}

.panel-corner::after {
    width: 1px;
    height: 16px;
}

.panel-corner-tl { top: 10px; left: 10px; }
.panel-corner-tl::before { top: 0; left: 0; }
.panel-corner-tl::after  { top: 0; left: 0; }

.panel-corner-tr { top: 10px; right: 10px; }
.panel-corner-tr::before { top: 0; right: 0; left: auto; }
.panel-corner-tr::after  { top: 0; right: 0; left: auto; }

.panel-corner-br { bottom: 10px; right: 10px; }
.panel-corner-br::before { bottom: 0; right: 0; left: auto; top: auto; }
.panel-corner-br::after  { bottom: 0; right: 0; left: auto; top: auto; }

.panel-corner-bl { bottom: 10px; left: 10px; }
.panel-corner-bl::before { bottom: 0; left: 0; right: auto; top: auto; }
.panel-corner-bl::after  { bottom: 0; left: 0; right: auto; top: auto; }

/* ══════════════════════════════════════════════
   PANEL HEADER BAR
   ══════════════════════════════════════════════ */
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px 14px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.08);
    position: relative;
    z-index: 2;
}

.panel-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary);
    animation: pulse-dot-panel 2s ease-in-out infinite;
}

@keyframes pulse-dot-panel {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.7); }
}

.panel-header-title {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 300;
    color: var(--color-white);
    letter-spacing: -0.01em;
}

.panel-header-badge {
    margin-left: auto;
    font-size: 0.52rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.15);
    border-radius: var(--radius-full);
    padding: 2px 7px;
}

/* ══════════════════════════════════════════════
   PANEL BODY
   ══════════════════════════════════════════════ */
.panel-body {
    padding: 20px 24px 24px;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.panel-body p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ══════════════════════════════════════════════
   TERMINAL ANIMATION (linhas reveladas no scroll)
   ══════════════════════════════════════════════ */
@keyframes terminal-reveal {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.term-line {
    opacity: 0;
    animation: terminal-reveal 0.4s ease-out forwards;
}
