/* ==========================================================================
   Circuit Sage — páginas de Serviços (servicos, desenho-tecnico, modelacao-3d)
   Usa as mesmas cores do site.css (fundo #0a0e27/#060920, azul #0066ff→#00ccff,
   roxo #7c3aed dos CTAs). Todas as animações param com prefers-reduced-motion.
   ========================================================================== */

:root { --svc-cyan: #00ccff; --svc-blue: #0066ff; --svc-violet: #7c3aed; --svc-copper: #f59e0b;
            --svc-line: rgba(255,255,255,.08); --svc-card: rgba(19,24,41,.85); }

/* ---------- Hero com grelha animada ---------- */
.svc-hero { position: relative; overflow: hidden; padding: 9rem 0 4rem; text-align: center; }
.svc-hero::before { content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(0,204,255,.07) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0,204,255,.07) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  animation: svcGrid 18s linear infinite; pointer-events: none; }
@keyframes svcGrid { to { background-position: 48px 48px, 48px 48px; } }
.svc-hero .container { position: relative; }
.svc-hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 900; line-height: 1.1; margin: 1rem 0; }
.svc-hero p.lead { max-width: 760px; margin: 0 auto 2rem; color: #a0aec0; font-size: 1.15rem; line-height: 1.7; }
.svc-cta-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.svc-cta-row .btn { padding: 1rem 2rem; font-size: 1.05rem; }

/* ---------- Percurso «do circuito à peça» ---------- */
.svc-journey { max-width: 980px; margin: 3rem auto 0; }
.svc-journey svg { width: 100%; height: auto; display: block; overflow: visible; }
.svc-journey .st-label { fill: #e2e8f0; font: 600 13px Inter, sans-serif; text-anchor: middle; }
.svc-journey .st-sub { fill: #718096; font: 500 11px Inter, sans-serif; text-anchor: middle; }
.svc-journey .st-ring { fill: #0d1230; stroke: rgba(0,204,255,.45); stroke-width: 2; }
.svc-journey .st-ring.pcb { stroke: var(--svc-copper); stroke-width: 3; }
.svc-journey .path { fill: none; stroke: url(#svcJourneyGrad); stroke-width: 3; stroke-dasharray: 8 8;
  animation: svcDash 1.2s linear infinite; }
@keyframes svcDash { to { stroke-dashoffset: -16; } }

/* ---------- Secções ---------- */
.svc-section { padding: 5rem 0; }
.svc-section.alt { background: #060920; }
.svc-section.alt2 { background: #04061a; }
.svc-kicker { display: inline-block; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--svc-cyan); font-weight: 700; margin-bottom: .75rem; }
.svc-h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.svc-intro { color: #a0aec0; max-width: 720px; line-height: 1.7; }
.svc-center { text-align: center; }
.svc-center .svc-intro { margin: 0 auto; }

/* ---------- Carro-chefe: PCB ---------- */
.svc-flagship { position: relative; border-radius: 1.25rem; padding: 2px;
  background: linear-gradient(135deg, var(--svc-copper), var(--svc-cyan) 45%, var(--svc-violet));
  box-shadow: 0 30px 80px rgba(0,102,255,.18); }
.svc-flagship-inner { border-radius: calc(1.25rem - 2px); background: #0b1030; padding: 2.5rem;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: center; }
.svc-flag-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .9rem; border-radius: 999px;
  background: rgba(245,158,11,.14); color: #fbbf24; font-weight: 700; font-size: .8rem; letter-spacing: .05em;
  border: 1px solid rgba(245,158,11,.4); }
.svc-flagship h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 900; margin: 1rem 0 .75rem; }
.svc-flagship p { color: #a0aec0; line-height: 1.7; }
.svc-checks { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .6rem; }
.svc-checks li { position: relative; padding-left: 1.8rem; color: #cbd5e0; line-height: 1.5; }
.svc-checks li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 1.25rem; height: 1.25rem;
  border-radius: 50%; background: rgba(16,185,129,.15); color: #34d399; font-size: .75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; }
.svc-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.5rem; }
.svc-chip { padding: .3rem .75rem; border-radius: 999px; font-size: .8rem; color: #cbd5e0;
  background: rgba(255,255,255,.05); border: 1px solid var(--svc-line); }
.svc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0; }
.svc-stat { text-align: center; padding: 1rem .5rem; border-radius: .75rem; background: rgba(0,102,255,.07);
  border: 1px solid rgba(0,204,255,.15); }
.svc-stat b { display: block; font-size: 1.6rem; font-weight: 900;
  background: linear-gradient(135deg, #00ccff, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.svc-stat span { font-size: .78rem; color: #a0aec0; }

/* PCB animada */
.svc-pcb svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 40px rgba(0,0,0,.5)); }
.svc-pcb .trace { fill: none; stroke: #f59e0b; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 600; stroke-dashoffset: 600; animation: svcTrace 4s ease-in-out infinite; }
.svc-pcb .trace:nth-of-type(2) { animation-delay: .4s; } .svc-pcb .trace:nth-of-type(3) { animation-delay: .8s; }
.svc-pcb .trace:nth-of-type(4) { animation-delay: 1.2s; } .svc-pcb .trace:nth-of-type(5) { animation-delay: 1.6s; }
@keyframes svcTrace { 0% { stroke-dashoffset: 600; } 45%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -600; } }
.svc-pcb .pulse { animation: svcPulse 2s ease-in-out infinite; }
@keyframes svcPulse { 50% { opacity: .35; } }

/* ---------- Grelha de serviços ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.svc-card { position: relative; display: block; padding: 1.75rem; border-radius: 1rem; background: var(--svc-card);
  border: 1px solid var(--svc-line); text-decoration: none; color: inherit; overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.svc-card::after { content: ''; position: absolute; inset: auto -40% -60% auto; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,204,255,.18), transparent 70%); opacity: 0; transition: opacity .3s; }
.svc-card:hover { transform: translateY(-6px); border-color: rgba(0,204,255,.45); box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.svc-card:hover::after { opacity: 1; }
.svc-card .ico { width: 3rem; height: 3rem; border-radius: .8rem; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff; background: linear-gradient(135deg, var(--svc-blue), var(--svc-violet)); margin-bottom: 1rem; }
.svc-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .5rem; color: #fff; }
.svc-card p { color: #a0aec0; line-height: 1.6; font-size: .95rem; }
.svc-card .more { display: inline-block; margin-top: 1rem; color: var(--svc-cyan); font-weight: 600; font-size: .9rem; transition: transform .2s; }
.svc-card:hover .more { transform: translateX(4px); }
.svc-card.static { cursor: default; }

/* ---------- Montar o pacote (interativo) ---------- */
.svc-builder { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.5rem; align-items: start; }
.svc-toggles { display: grid; gap: .75rem; }
.svc-toggle { display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left; padding: 1rem 1.25rem;
  border-radius: .9rem; border: 1px solid var(--svc-line); background: rgba(255,255,255,.03); color: #cbd5e0;
  font: inherit; cursor: pointer; transition: background .2s, border-color .2s, transform .15s; }
.svc-toggle:hover { transform: translateX(3px); }
.svc-toggle .box { flex: 0 0 1.5rem; height: 1.5rem; border-radius: .4rem; border: 2px solid #4a5568;
  display: flex; align-items: center; justify-content: center; font-size: .85rem; color: transparent; transition: all .2s; }
.svc-toggle[aria-pressed="true"] { background: rgba(0,102,255,.12); border-color: rgba(0,204,255,.5); color: #fff; }
.svc-toggle[aria-pressed="true"] .box { background: linear-gradient(135deg, #0066ff, #00ccff); border-color: transparent; color: #fff; }
.svc-toggle .t { font-weight: 600; } .svc-toggle .s { display: block; font-size: .8rem; color: #718096; font-weight: 400; }
.svc-toggle .star { margin-left: auto; color: #fbbf24; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.svc-output { position: sticky; top: 96px; padding: 1.75rem; border-radius: 1rem; background: #0b1030;
  border: 1px solid rgba(0,204,255,.25); }
.svc-output h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.svc-output ul { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .5rem; min-height: 3rem; }
.svc-output li { color: #cbd5e0; font-size: .92rem; padding-left: 1.4rem; position: relative; animation: svcIn .25s ease; }
.svc-output li::before { content: '▸'; position: absolute; left: 0; color: var(--svc-cyan); }
.svc-output .empty { color: #718096; font-style: italic; }
@keyframes svcIn { from { opacity: 0; transform: translateY(4px); } }
.svc-meter { height: 8px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; margin-bottom: .5rem; }
.svc-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f59e0b, #00ccff, #7c3aed); transition: width .35s ease; }
.svc-meter-label { font-size: .85rem; color: #a0aec0; margin-bottom: 1.25rem; min-height: 1.3em; }
.svc-meter-label.full { color: #fbbf24; font-weight: 700; }
.svc-output .btn { width: 100%; text-align: center; }

/* ---------- Processo ---------- */
.svc-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: 2.5rem; counter-reset: step; position: relative; }
.svc-step { position: relative; padding: 1.75rem 1.25rem 1.25rem; border-radius: 1rem; background: var(--svc-card); border: 1px solid var(--svc-line); }
.svc-step::before { counter-increment: step; content: counter(step); position: absolute; top: -1rem; left: 1.25rem;
  width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0066ff, #00ccff); color: #fff; font-weight: 800; box-shadow: 0 0 0 6px #060920; }
.svc-step h3 { font-size: 1.05rem; margin: .25rem 0 .5rem; } .svc-step p { color: #a0aec0; font-size: .92rem; line-height: 1.6; }
.svc-note { margin-top: 1.5rem; color: #a0aec0; font-size: .95rem; }

/* ---------- Formatos (fita a correr) ---------- */
.svc-marquee { overflow: hidden; margin-top: 2rem; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.svc-marquee-track { display: flex; gap: .75rem; width: max-content; animation: svcMarquee 32s linear infinite; }
.svc-marquee:hover .svc-marquee-track { animation-play-state: paused; }
.svc-marquee .svc-chip { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .9rem; padding: .5rem 1rem; }
@keyframes svcMarquee { to { transform: translateX(-50%); } }

/* ---------- Setores ---------- */
.svc-sectors { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-top: 2rem; }
.svc-sector { padding: 1.25rem 1rem; text-align: center; border-radius: .9rem; background: rgba(255,255,255,.03);
  border: 1px solid var(--svc-line); color: #cbd5e0; font-weight: 600; font-size: .92rem; transition: border-color .2s, transform .2s; }
.svc-sector:hover { border-color: rgba(0,204,255,.4); transform: translateY(-3px); }
.svc-sector i { display: block; font-size: 1.6rem; color: var(--svc-cyan); margin-bottom: .5rem; }

/* ---------- Dois lados (texto + ilustração) ---------- */
.svc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.svc-split.rev > :first-child { order: 2; }
.svc-figure { border-radius: 1rem; background: #0b1030; border: 1px solid rgba(0,204,255,.18); padding: 1.5rem; }
.svc-figure svg { width: 100%; height: auto; display: block; }

/* desenho técnico animado */
.svc-drawing .part { fill: none; stroke: #e2e8f0; stroke-width: 2.2; stroke-dasharray: 900; stroke-dashoffset: 900; animation: svcDraw 6s ease-in-out infinite; }
.svc-drawing .hole { fill: none; stroke: #e2e8f0; stroke-width: 2; stroke-dasharray: 200; stroke-dashoffset: 200; animation: svcDraw 6s ease-in-out infinite .6s; }
.svc-drawing .axis { stroke: #f59e0b; stroke-width: 1; stroke-dasharray: 10 4 2 4; opacity: .8; }
.svc-drawing .dim { stroke: #00ccff; stroke-width: 1.2; opacity: 0; animation: svcFade 6s ease-in-out infinite 1.4s; }
.svc-drawing .dimtxt { fill: #00ccff; font: 600 13px 'JetBrains Mono', monospace; opacity: 0; animation: svcFade 6s ease-in-out infinite 1.8s; }
.svc-drawing .title { fill: #718096; font: 600 11px Inter, sans-serif; }
@keyframes svcDraw { 0% { stroke-dashoffset: 900; } 40%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes svcFade { 0%, 20% { opacity: 0; } 35%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* cubo 3D a rodar (invólucro) */
.svc-cube-stage { perspective: 900px; height: 300px; display: flex; align-items: center; justify-content: center; }
.svc-cube { position: relative; width: 170px; height: 170px; transform-style: preserve-3d; animation: svcSpin 14s linear infinite; }
.svc-cube .f { position: absolute; inset: 0; border: 2px solid rgba(0,204,255,.75); background: rgba(0,102,255,.08);
  box-shadow: inset 0 0 30px rgba(0,204,255,.18); }
.svc-cube .f.front  { transform: translateZ(85px); }
.svc-cube .f.back   { transform: rotateY(180deg) translateZ(85px); }
.svc-cube .f.right  { transform: rotateY(90deg) translateZ(85px); }
.svc-cube .f.left   { transform: rotateY(-90deg) translateZ(85px); }
.svc-cube .f.top    { transform: rotateX(90deg) translateZ(85px); background: rgba(124,58,237,.12); border-color: rgba(167,139,250,.8); }
.svc-cube .f.bottom { transform: rotateX(-90deg) translateZ(85px); }
.svc-cube .board { position: absolute; left: 20px; right: 20px; top: 60px; height: 50px; transform: rotateX(90deg) translateZ(-10px);
  background: repeating-linear-gradient(90deg, #065f46 0 18px, #047857 18px 20px); border: 2px solid #f59e0b; border-radius: 4px; }
.svc-cube .f.front::before { content: ''; position: absolute; left: 22px; bottom: 22px; width: 34px; height: 14px; border: 2px solid #f59e0b; border-radius: 3px; }
@keyframes svcSpin { from { transform: rotateX(-22deg) rotateY(0); } to { transform: rotateX(-22deg) rotateY(360deg); } }

/* Especificações */
.svc-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.svc-spec { padding: 1.25rem; border-radius: .9rem; background: rgba(0,102,255,.07); border: 1px solid rgba(0,204,255,.15); }
.svc-spec b { display: block; font-size: 1.25rem; color: #fff; margin-bottom: .25rem; } .svc-spec span { color: #a0aec0; font-size: .88rem; }

/* CTA final */
.svc-final { text-align: center; padding: 4.5rem 1.5rem; border-radius: 1.25rem; margin: 0 auto; max-width: 980px;
  background: radial-gradient(circle at 20% 20%, rgba(0,204,255,.18), transparent 55%), radial-gradient(circle at 80% 80%, rgba(124,58,237,.22), transparent 55%), #0b1030;
  border: 1px solid rgba(0,204,255,.2); }
.svc-final p { color: #a0aec0; max-width: 620px; margin: 0 auto 2rem; line-height: 1.7; }

/* Revelar ao fazer scroll */
.svc-js .svc-reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.svc-js .svc-reveal.in { opacity: 1; transform: none; }

/* ---------- Como funciona ---------- */
.cf-calcs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .75rem; margin-top: 2rem; }
.cf-calc { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; border-radius: .8rem; background: rgba(255,255,255,.03);
  border: 1px solid var(--svc-line); color: #e2e8f0; font-weight: 600; font-size: .92rem; transition: border-color .2s, transform .2s; }
.cf-calc:hover { border-color: rgba(0,204,255,.45); transform: translateY(-2px); }
.cf-calc i { color: var(--svc-cyan); font-size: 1.2rem; }
.cf-example { margin-top: 2.5rem; padding: 1.75rem; border-radius: 1rem; background: #0b1030; border: 1px solid rgba(0,204,255,.25); }
.cf-example h3 { margin-bottom: 1rem; font-size: 1.1rem; }
.cf-table { display: grid; gap: .5rem; }
.cf-row { display: grid; grid-template-columns: 1.1fr 1.6fr 1.6fr .7fr; gap: 1rem; align-items: center; padding: .7rem .9rem;
  border-radius: .6rem; background: rgba(255,255,255,.025); border: 1px solid var(--svc-line); }
.svc-js .cf-example.svc-reveal .cf-row { opacity: 0; transform: translateX(-10px); transition: opacity .4s ease, transform .4s ease; transition-delay: calc(var(--i) * 140ms + 200ms); }
.svc-js .cf-example.svc-reveal.in .cf-row { opacity: 1; transform: none; }
.cf-l { color: #cbd5e0; font-weight: 600; font-size: .9rem; }
.cf-f, .cf-s { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .85rem; color: #a5b4fc; background: none; }
.cf-s { color: #94a3b8; }
.cf-r { font-family: 'JetBrains Mono', ui-monospace, monospace; color: #34d399; text-align: right; font-size: 1rem; }
.cf-doc { position: relative; min-height: 340px; display: flex; align-items: center; justify-content: center; }
.cf-page { position: relative; z-index: 2; width: 240px; height: 310px; border-radius: .5rem; background: #f8fafc; padding: 1.1rem; display: flex;
  flex-direction: column; gap: .55rem; box-shadow: 0 25px 50px rgba(0,0,0,.5); transform: rotate(-3deg); transition: transform .4s; }
.cf-doc:hover .cf-page { transform: rotate(0); }
.cf-page b { font: 800 .62rem Inter, sans-serif; color: #0b1030; letter-spacing: .06em; border-bottom: 2px solid #0066ff; padding-bottom: .35rem; }
.cf-page i { display: block; height: 7px; border-radius: 4px; background: #cbd5e1; }
.cf-page i.s { width: 60%; }
.cf-tab { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.cf-tab span { height: 26px; border-radius: 3px; background: linear-gradient(#e2e8f0, #e2e8f0) top/100% 6px no-repeat, #f1f5f9; border: 1px solid #e2e8f0; }
.cf-ok { margin-top: auto; align-self: flex-end; font: 800 .75rem Inter, sans-serif; color: #059669; border: 2px solid #059669; border-radius: .35rem; padding: .2rem .5rem; transform: rotate(-8deg); }
.cf-page.back { position: absolute; z-index: 1; transform: rotate(5deg) translate(28px, 8px); background: #cbd5e1; opacity: .5; }
.cf-cycle .svc-step.cf-hl { border-color: rgba(52,211,153,.55); background: linear-gradient(180deg, rgba(16,185,129,.12), rgba(19,24,41,.85)); }
.cf-cycle .svc-step.cf-hl::before { background: linear-gradient(135deg, #10b981, #34d399); }
.cf-scope svg { width: 100%; height: auto; display: block; }
.cf-wave { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 700; stroke-dashoffset: 700; animation: svcTrace 5s ease-in-out infinite; }
.cf-wave.sim { stroke: #00ccff; }
.cf-wave.meas { stroke: #34d399; animation-delay: .5s; opacity: .9; }
.cf-roles { margin-bottom: 1.5rem; }
.cf-roles .svc-card { border-color: rgba(0,204,255,.35); background: linear-gradient(180deg, rgba(0,102,255,.10), rgba(19,24,41,.85)); }
@media (max-width: 760px) {
  .cf-row { grid-template-columns: 1fr; gap: .25rem; }
  .cf-r { text-align: left; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .svc-flagship-inner, .svc-builder, .svc-split { grid-template-columns: 1fr; }
  .svc-split.rev > :first-child { order: 0; }
  .svc-steps { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; }
  .svc-output { position: static; }
}
@media (max-width: 560px) {
  .svc-hero { padding-top: 7.5rem; }
  .svc-flagship-inner { padding: 1.5rem; }
  .svc-steps { grid-template-columns: 1fr; }
  .svc-stats { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .svc-stat b { font-size: 1.25rem; }
  .svc-section { padding: 3.5rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  .svc-page *, .svc-page *::before, .svc-page *::after { animation: none !important; transition: none !important; }
  .svc-pcb .trace, .svc-drawing .part, .svc-drawing .hole { stroke-dashoffset: 0; }
  .svc-drawing .dim, .svc-drawing .dimtxt { opacity: 1; }
  .svc-reveal { opacity: 1; transform: none; }
}

/* Ferramenta padrão: Altium Designer */
.svc-chip.svc-chip-main { color: #fbbf24; font-weight: 700; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.45); }
