/* =========================================================
   Eco Pulse — guia de compressores (complementa style.css)
   ========================================================= */

/* ---------- Abertura: seletor de tipos ---------- */
.type-picker {
  list-style: none; margin: clamp(2.6rem, 5vw, 3.6rem) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 0 1rem; border-top: 1px solid rgba(255, 255, 255, .18);
}
.type-picker li { animation: hero-in .7s var(--ease) backwards; }
.type-picker li:nth-child(1) { animation-delay: .45s; }
.type-picker li:nth-child(2) { animation-delay: .53s; }
.type-picker li:nth-child(3) { animation-delay: .61s; }
.type-picker li:nth-child(4) { animation-delay: .69s; }
.type-picker li:nth-child(5) { animation-delay: .77s; }
.type-picker li:nth-child(6) { animation-delay: .85s; }
.type-picker a { position: relative; display: grid; gap: .15rem; padding: 1.15rem .5rem .2rem 0; color: #fff; text-decoration: none; }
.type-picker a::before {
  content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 3px; background: var(--green-bright);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.type-picker a:hover::before, .type-picker a:focus-visible::before { transform: scaleX(1); }
.type-picker b { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; }
.type-picker small { font-size: .85rem; color: var(--text-inv-2); line-height: 1.4; }
.type-picker a:hover b { color: var(--green-bright); }

/* ---------- Layout do guia: índice + conteúdo ---------- */
.guide { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(2rem, 4vw, 3.5rem); padding-block: clamp(2.5rem, 5vw, 4rem) clamp(4rem, 8vw, 6rem); }
.toc { position: sticky; top: 104px; align-self: start; }
.toc-h { font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); margin: 0 0 .8rem .75rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.toc a {
  position: relative; display: flex; align-items: baseline; gap: .7rem; padding: .6rem .75rem .7rem; border-radius: 9px;
  color: var(--text-2); font-weight: 500; font-size: .95rem; text-decoration: none; overflow: hidden;
  transition: background-color .3s, color .3s, box-shadow .3s;
}
.toc-n { font-family: var(--font-display); font-weight: 700; font-size: .75rem; color: #9AA8B8; transition: color .3s; }
.toc-bar {
  position: absolute; left: .75rem; right: .75rem; bottom: .3rem; height: 2px; border-radius: 2px;
  background: var(--green-bright); transform: scaleX(0); transform-origin: left;
}
.toc a:hover { color: var(--navy); }
.toc a.is-current { background: var(--surface); color: var(--navy); box-shadow: var(--shadow); }
.toc a.is-current .toc-n { color: var(--green); }

/* ---------- Cada tipo ---------- */
.ctype { padding: clamp(2.5rem, 5vw, 3.6rem) 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.ctype:first-child { border-top: 0; padding-top: .5rem; }
.ctype-head { display: flex; align-items: flex-end; gap: 1.2rem; margin-bottom: 1.8rem; }
.ctype-n {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(3rem, 6vw, 4.4rem); line-height: .8;
  color: transparent; -webkit-text-stroke: 1.5px #B8C6D4; letter-spacing: -0.04em;
}
.ctype-kind { font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--green); margin-bottom: .35rem; }
.ctype h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); color: var(--navy); }
.ctype h3 { font-size: 1.05rem; color: var(--navy); }

.ctype-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 3.5vw, 2.6rem); align-items: start; }
.ctype-text > p { color: var(--text-2); }
.ctype-text > p b, .how b { color: var(--text); font-weight: 600; }
.ctype-text .sub { margin: 1.4rem 0 .5rem; }
.how { list-style: none; counter-reset: h; padding: 0; margin: 1.3rem 0 0; display: grid; gap: .7rem; }
.how li { counter-increment: h; position: relative; padding-left: 2.4rem; color: var(--text-2); font-size: .97rem; }
.how li::before {
  content: counter(h); position: absolute; left: 0; top: .05rem; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: grid; place-items: center; font: 700 .78rem var(--font-display); color: var(--green); background: var(--green-soft);
}
.note { margin-top: 1.3rem; padding: 1rem 1.15rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: .94rem; }

/* ---------- Figura da máquina (SVG animado) ---------- */
.machine { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1rem .9rem; box-shadow: var(--shadow); }
.machine svg { width: 100%; height: auto; overflow: visible; }
.machine figcaption { font-size: .84rem; color: var(--text-2); margin-top: .6rem; padding-top: .7rem; border-top: 1px solid var(--line); line-height: 1.5; }

.m-case { fill: #EEF2F6; stroke: var(--navy); stroke-width: 6; }
.m-case-solid { fill: var(--navy); }
.m-chamber { fill: #fff; }
.m-rotor { fill: var(--navy); }
.m-axle { fill: #fff; stroke: var(--navy); stroke-width: 3; }
.m-vane { stroke: var(--green); stroke-width: 7; stroke-linecap: round; }
.m-wall { fill: none; stroke: var(--navy); stroke-width: 6; stroke-linecap: square; }
.m-pipe { fill: none; stroke: #D3DCE6; stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; }
.m-pipe-thin { stroke-width: 6; }
.m-flow { fill: none; stroke: var(--green-bright); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 4 12; }
.m-flow.is-hot { stroke: var(--green); stroke-width: 5; }
.m-spin-arrow, .m-spin-head { fill: none; stroke: rgba(255, 255, 255, .75); stroke-width: 3; stroke-linecap: round; }
.m-label { font: 600 13px var(--font-body); fill: var(--navy); }
.m-label-sm { font-size: 11.5px; font-weight: 500; fill: var(--text-2); }
.m-lead { fill: none; stroke: #9AA8B8; stroke-width: 1; }

.p-air { fill: var(--green-bright); opacity: .14; }
.p-valve { fill: var(--green); transition: transform .12s linear; }
.p-piston { fill: var(--navy); }
.p-rings { stroke: rgba(255, 255, 255, .35); stroke-width: 2; }
.p-rod { stroke: #6B7C93; stroke-width: 11; stroke-linecap: round; }
.p-pin { fill: var(--green-bright); stroke: var(--navy); stroke-width: 2; }
.m-crank { fill: #EEF2F6; stroke: var(--navy); stroke-width: 4; }

.s-body { fill: #DCE5EE; }
.s-body-f { fill: #E9EFF5; }
.s-lobes path { fill: none; stroke: var(--navy); stroke-width: 9; }
.s-lobes-f path { stroke: #2D5F8C; }
.s-oil { fill: #C98A12; }

.t-diffuser { fill: none; stroke: var(--navy); stroke-width: 12; stroke-dasharray: 3 8; }
.t-shroud { fill: #EEF2F6; stroke: var(--navy); stroke-width: 2; }
.t-blade { fill: none; stroke: var(--navy); stroke-width: 5; stroke-linecap: round; }
.t-hub { fill: var(--navy); stroke: var(--navy); }
.t-in { fill: var(--green-bright); }

.c-cooler { fill: var(--green-soft); stroke: var(--green); stroke-width: 2; }
.c-coil { fill: none; stroke: var(--green); stroke-width: 2; }
.c-volute { fill: none; stroke: var(--navy); stroke-width: 12; stroke-linecap: round; }

.b-box rect { fill: #fff; stroke: var(--navy); stroke-width: 2; }
.b-box text { font: 600 12px var(--font-body); fill: var(--navy); text-anchor: middle; }
.b-box-hl rect { fill: var(--navy); }
.b-box-hl text { fill: #fff; font-size: 14px; }
.b-high { stroke-width: 7; }
.b-track { fill: #E3E9EF; }
.b-fill-lo { fill: var(--green-bright); }
.b-fill-hi { fill: var(--green); }
.b-tick { stroke: var(--navy); stroke-width: 2; }
.b-hi-label { fill: var(--green); font-weight: 600; }

/* animações: pausadas até a máquina aparecer na tela (script liga .is-running) */
.m-flow { animation: m-flow 1s linear infinite paused; }
.spin { transform-box: fill-box; transform-origin: center; animation: m-spin 1.2s linear infinite paused; }
.spin-fast { animation-duration: .8s; }
.s-lobes { animation: m-lobes .9s linear infinite paused; }
.b-fill-hi { transform-box: fill-box; transform-origin: left center; transform: scaleX(.198); animation: m-boost 3.6s var(--ease) infinite paused; }
.machine.is-running .m-flow, .machine.is-running .spin, .machine.is-running .s-lobes, .machine.is-running .b-fill-hi { animation-play-state: running; }
@keyframes m-flow { to { stroke-dashoffset: -16; } }
@keyframes m-spin { to { transform: rotate(360deg); } }
@keyframes m-lobes { to { transform: translateX(26px); } }
@keyframes m-boost { 0%, 12% { transform: scaleX(.198); } 55%, 88% { transform: scaleX(1); } 100% { transform: scaleX(.198); } }

/* ---------- Ficha, prós e contras, onde se aplica ---------- */
.specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 1.8rem 0 0; }
.specs div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; }
.specs dt { font-size: .76rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.specs dd { margin: .2rem 0 0; font-family: var(--font-display); font-weight: 600; color: var(--navy); line-height: 1.3; }
.specs small { display: block; font: 500 .8rem var(--font-body); color: var(--text-2); }

.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.proscons > div { border-radius: 12px; padding: 1.2rem 1.3rem; border: 1px solid var(--line); background: var(--surface); }
.proscons h3 { margin-bottom: .7rem; }
.proscons ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.proscons li { position: relative; padding-left: 1.6rem; font-size: .94rem; }
.proscons li::before { content: ""; position: absolute; left: 0; top: .3em; width: 1rem; height: 1rem; border-radius: 50%; background: center/80% no-repeat; }
.pros li::before { background-color: var(--green-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23207641' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.cons li::before { background-color: #FBEAE8; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8h7' fill='none' stroke='%23B42318' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }

.vsd { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.vsd > div { border-radius: 12px; padding: 1.2rem 1.3rem; background: var(--surface); border: 1px solid var(--line); }
.vsd h3 { margin-bottom: .45rem; }
.vsd p { font-size: .94rem; color: var(--text-2); }
.vsd b { color: var(--text); }
.vsd .vsd-hl { background: var(--navy); border-color: var(--navy); }
.vsd-hl h3, .vsd-hl b { color: #fff; }
.vsd-hl p { color: var(--text-inv-2); }

.where { margin-top: 1.4rem; padding: .2rem 0 .2rem 1.3rem; border-left: 3px solid var(--green); }
.where h3 { margin-bottom: .4rem; }
.where p { color: var(--text-2); max-width: 46rem; }
.aside { margin-top: 1rem; padding: .9rem 1.1rem; border-radius: 10px; background: #EAF1F8; font-size: .93rem; }
.aside b { color: var(--navy); }
.aside-warn { background: #FFF6E5; }
.aside-warn b { color: #8A5A00; }
.where-cta { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1rem; font-weight: 600; color: var(--green); text-decoration: none; }
.where-cta span { transition: transform .3s var(--ease); }
.where-cta:hover span { transform: translateX(5px); }

/* ---------- Comparativo ---------- */
.compare { padding-top: clamp(2.5rem, 5vw, 3.6rem); border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.compare h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); color: var(--navy); }
.compare .lead { margin: .6rem 0 1.6rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.cmp { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .93rem; }
.cmp th, .cmp td { padding: .9rem 1rem; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.cmp thead th { border-top: 0; background: var(--navy); color: #fff; font-weight: 600; font-size: .82rem; letter-spacing: .04em; }
.cmp tbody th a { font-family: var(--font-display); font-weight: 600; color: var(--navy); text-decoration: none; }
.cmp tbody th a:hover { color: var(--green); }
.cmp tbody tr { transition: background-color .25s; }
.cmp tbody tr:hover { background: #F6F9FB; }
.cmp td { color: var(--text-2); }
.yn { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.yn-yes { background: var(--green-soft); color: var(--green); }
.yn-no { background: #FBEAE8; color: #B42318; }
.yn-opt { background: #EAF1F8; color: var(--navy); }

/* ---------- Perguntas ---------- */
.asks { background: var(--navy-ink); color: #fff; }
.asks-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.asks .section-head { margin: 0; position: sticky; top: 110px; }
.asks .section-head h2 { color: #fff; }
.asks .lead { color: var(--text-inv-2); margin-bottom: 1.8rem; }
.asks mark { --mark-color: rgba(76, 194, 122, .42); }
.ask-list { list-style: none; counter-reset: a; margin: 0; padding: 0; border-top: 1px solid var(--line-dark); }
.ask-list li { counter-increment: a; position: relative; display: grid; gap: .2rem; padding: 1.15rem 0 1.15rem 3.2rem; border-bottom: 1px solid var(--line-dark); }
.ask-list li::before { content: counter(a, decimal-leading-zero); position: absolute; left: 0; top: 1.15rem; font: 700 1rem var(--font-display); color: var(--green-bright); }
.ask-list b { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.ask-list span { color: var(--text-inv-2); font-size: .95rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 1024px) {
  .type-picker { grid-template-columns: repeat(3, 1fr); }
  .guide { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  .toc {
    position: sticky; top: 76px; z-index: 20; margin-inline: -1.5rem; padding: .6rem 1.5rem;
    background: rgba(244, 245, 242, .96); border-bottom: 1px solid var(--line);
  }
  .toc-h { display: none; }
  .toc ol { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
  .toc ol::-webkit-scrollbar { display: none; }
  .toc a { white-space: nowrap; padding: .5rem .8rem .6rem; }
  .ctype, .compare { scroll-margin-top: 140px; }
  .ctype:first-child { padding-top: 2rem; }
}
@media (max-width: 800px) {
  .ctype-grid { grid-template-columns: 1fr; }
  .specs { grid-template-columns: 1fr 1fr; }
  .proscons, .vsd { grid-template-columns: 1fr; }
  .asks-grid { grid-template-columns: 1fr; }
  .asks .section-head { position: static; }
}
@media (max-width: 600px) {
  .type-picker { grid-template-columns: 1fr 1fr; }
  .machine { padding: .6rem .6rem .8rem; }
  .ctype-head { gap: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .type-picker li { animation: none; }
  .type-picker a::before, .toc a, .where-cta span, .p-valve { transition: none; }
  .m-flow, .spin, .s-lobes { animation: none; }
  .b-fill-hi { animation: none; transform: none; }
}
