/* ELETRICIDADE — Circuitos Elétricos — Estudo Dirigido
   Mesmo sistema de design dos EDs de Dinâmica, repaletizado para o ÂMBAR
   que css/style.css define para o tema eletricidade (--tema-cor: #a16207). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f8fafc;
  --bg2:       #f1f5f9;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --border2:   #cbd5e1;
  --accent:    #a16207;   /* âmbar eletricidade */
  --accent-d:  #713f12;   /* âmbar profundo — hover e texto */
  --accent2:   #15803d;   /* verde-sucesso, para acerto e destaque */
  --accent3:   #c2410c;   /* laranja de alerta */
  --accent-on-dark: #fbbf24; /* legível sobre a .score-section escura */
  --frio:      #0e7490;   /* ciano — corrente e grandezas "frias" */
  --frio-d:    #155e75;
  --text:      #0f172a;
  --text-mid:  #334155;
  --text-muted:#64748b;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Poppins', system-ui, sans-serif;
  --font-mono:    'Space Mono', monospace;
  --r:         10px;
  --r-lg:      18px;
  --shadow:    0 2px 12px rgba(15,23,42,.07);
  --shadow-md: 0 4px 24px rgba(15,23,42,.12);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
}

/* === SKIP LINK === */
.skip-link {
  position: absolute; top: -100%; left: 0;
  background: var(--accent); color: #fff;
  padding: 10px 20px; font-size: .85rem; font-weight: 600;
  z-index: 9999; border-radius: 0 0 8px 0; text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 0; }

/* === HERO === */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 45%, #fffbeb 100%);
}

.hero-deco {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}

.hero-orb {
  position: absolute; border-radius: 50%; opacity: .12;
}
.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--accent), transparent);
  top: -250px; right: -150px;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent2), transparent);
  bottom: -150px; left: -120px;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--accent3), transparent);
  top: 35%; left: 35%; opacity: .07;
}

.wave-line {
  position: absolute; top: 50%; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(113,63,18,.40), rgba(234,179,8,.45), transparent);
  animation: wavePulse 4s ease-in-out infinite;
}
.wave-line:nth-child(2) { top: 56%; animation-delay: 1.3s; opacity: .6; }
.wave-line:nth-child(3) { top: 44%; animation-delay: 2.6s; opacity: .4; }

@keyframes wavePulse {
  0%, 100% { opacity: .2; transform: scaleX(.7); }
  50%       { opacity: 1; transform: scaleX(1); }
}

.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 48px; align-items: center;
  max-width: 1100px; margin: 0 auto;
  padding: 80px 6vw; width: 100%;
}

.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(161,98,7,.10);
  border: 1px solid rgba(161,98,7,.25);
  border-radius: 100px; padding: 4px 16px;
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-d); margin-bottom: 24px;
}

.tag-dot {
  width: 6px; height: 6px; background: var(--accent);
  border-radius: 50%; animation: tagBlink 1.8s ease-in-out infinite;
}
@keyframes tagBlink {
  0%, 100% { opacity: 1; } 50% { opacity: .25; }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6.5vw, 5.5rem);
  font-weight: 900; line-height: 1.0;
  color: var(--text); margin-bottom: 22px;
}
.hero-title em  { font-style: italic; color: var(--accent); }
.hero-title .gn { color: var(--accent2); }

.hero-sub {
  color: var(--text-muted); font-size: 1rem;
  max-width: 440px; margin-bottom: 36px; line-height: 1.85;
}

.hero-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: #fff;
  font-family: var(--font-body); font-weight: 600; font-size: .92rem;
  padding: 14px 30px; border-radius: var(--r-lg);
  text-decoration: none;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 18px rgba(161,98,7,.28);
}
.hero-cta:hover {
  background: var(--accent-d); transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(113,63,18,.35);
}

.hero-visual { display: flex; flex-direction: column; gap: 12px; }

.energy-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 18px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
  transition: transform .2s, box-shadow .2s;
}
.energy-card:hover { transform: translateX(6px); box-shadow: var(--shadow-md); }
.energy-card:nth-child(even) { margin-left: 24px; }

.ec-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.ec-icon.deep   { background: rgba(113,63,18,.12); }
.ec-icon.green  { background: rgba(21,128,61,.12); }
.ec-icon.lime   { background: rgba(132,204,22,.16); }
.ec-icon.orange { background: rgba(194,65,12,.12); }
.ec-icon.purple { background: rgba(139,92,246,.12); }
.ec-icon.yellow { background: rgba(234,179,8,.12); }

.ec-name { font-weight: 600; font-size: .88rem; color: var(--text); }
.ec-desc { font-size: .75rem; color: var(--text-muted); }

/* === SUMÁRIO === */
.sumario {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248,250,252,.93);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 5vw;
}
.sumario-inner {
  display: flex; align-items: center; gap: 20px;
  height: 52px; overflow-x: auto; scrollbar-width: none;
}
.sumario-inner::-webkit-scrollbar { display: none; }

.sum-logo-link { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; transition: opacity .2s; }
.sum-logo-link:hover { opacity: .7; }
.sum-logo { height: 30px; width: auto; }

.sum-divider { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.sum-label {
  font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); white-space: nowrap; flex-shrink: 0;
}

.sum-list { display: flex; list-style: none; gap: 2px; }
.sum-list a {
  display: block; padding: 5px 12px;
  font-family: var(--font-body); font-size: .78rem;
  color: var(--text-muted); text-decoration: none;
  border-radius: 6px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.sum-list a:hover { color: var(--accent); background: rgba(161,98,7,.08); }

/* === MAIN === */
.main { max-width: 880px; margin: 0 auto; padding: 60px 24px 100px; }

/* === TOPIC === */
.topic {
  padding: 60px 0 40px; border-top: 1px solid var(--border);
  opacity: 0; transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}
.topic:first-child { border-top: none; }
.topic.visible { opacity: 1; transform: translateY(0); }

.topic-header { display: flex; align-items: baseline; gap: 20px; margin-bottom: 28px; }

.topic-num {
  font-family: var(--font-mono); font-size: 3rem; font-weight: 700;
  color: var(--accent); opacity: .15; line-height: 1; flex-shrink: 0;
}

.topic-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  color: var(--text); line-height: 1.15;
}

.topic-body { display: flex; flex-direction: column; gap: 20px; }
.topic-body > p { color: var(--text-mid); }
.topic-body > p strong { color: var(--text); }
.topic-body > p em { color: var(--accent-d); font-style: italic; }

/* === FORMULA BOX === */
.formula-box {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r); padding: 18px 22px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow);
}
.formula-label { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.formula-tex { font-family: var(--font-mono); font-size: 1.1rem; color: var(--text); font-weight: 700; }
.formula-unit { font-size: .82rem; color: var(--text-muted); }
.calc-line {
  font-family: var(--font-mono);
  font-size: .93rem;
  text-align: center;
  background: rgba(255,255,255,.75);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 9px 20px;
  margin: 4px 0;
  color: var(--text);
}

/* === HIGHLIGHT BOX === */
.highlight-box {
  background: rgba(161,98,7,.05);
  border: 1px solid rgba(161,98,7,.18);
  border-radius: var(--r); padding: 18px 22px;
  display: flex; gap: 16px; align-items: flex-start;
}
.highlight-box.green-hl {
  background: rgba(21,128,61,.05);
  border-color: rgba(21,128,61,.2);
}
.highlight-box.orange-hl {
  background: rgba(194,65,12,.05);
  border-color: rgba(194,65,12,.20);
}
.hb-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.highlight-box p { color: var(--text-mid); margin: 0; }

/* Coluna de conteúdo do quadro, para quando ele leva uma figura junto do texto.
   O min-width:0 é o que deixa o SVG encolher dentro do flex. */
.hb-corpo { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hb-figura { margin: 0; }
.hb-figura svg {
  display: block; width: 100%; height: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r);
}
.hb-figura figcaption {
  margin: 10px 2px 0; font-size: .8rem; line-height: 1.6; color: var(--text-muted);
}
.hb-figura figcaption strong { color: var(--text-mid); }

/* === CONCEPT CARD === */
.concept-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px 24px; box-shadow: var(--shadow);
}
.concept-card h4 {
  font-family: var(--font-body); font-weight: 600;
  font-size: .92rem; color: var(--text); margin-bottom: 14px;
}
.concept-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.concept-card li { color: var(--text-mid); padding-left: 22px; position: relative; font-size: .92rem; }
.concept-card li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-size: .85rem; }

/* === EXAMPLE BOX === */
.example-box {
  background: var(--bg2);
  border-left: 3px solid var(--accent2);
  border-radius: var(--r); padding: 20px 24px;
}
.example-box h4 {
  font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent2); margin-bottom: 12px;
}
.example-box p { color: var(--text-mid); font-size: .92rem; }
.example-box p + p { margin-top: 6px; }
.example-box strong { color: var(--text); }

/* === ENERGY FORMS GRID === */
.energy-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.eg-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 14px; text-align: center;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.eg-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.eg-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.eg-name { font-weight: 600; font-size: .85rem; color: var(--text); margin-bottom: 4px; }
.eg-desc { font-size: .77rem; color: var(--text-muted); line-height: 1.5; }

/* === ANALOGY GRID === */
.analogy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.analogy-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow);
}
.analogy-card.grav { border-top: 3px solid var(--accent2); }
.analogy-card.elet { border-top: 3px solid var(--accent); }
.analogy-card h4 {
  font-family: var(--font-mono); font-size: .75rem;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px;
}
.analogy-card.grav h4 { color: var(--accent2); }
.analogy-card.elet h4 { color: var(--accent); }
.analogy-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.analogy-card li { font-size: .88rem; color: var(--text-mid); padding-left: 16px; position: relative; }
.analogy-card li::before { content: '—'; position: absolute; left: 0; font-size: .85rem; }
.analogy-card.grav li::before { color: var(--accent2); }
.analogy-card.elet li::before { color: var(--accent); }

/* === UNITS TABLE === */
.units-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow);
}
.units-table th {
  background: var(--text); color: #fff;
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 10px 14px; text-align: left;
}
.units-table td {
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  color: var(--text-mid); background: var(--surface);
}
.units-table tr:last-child td { border-bottom: none; }
.units-table tr:nth-child(even) td { background: var(--bg2); }
.units-table .val { color: var(--accent); font-family: var(--font-mono); font-weight: 600; }

/* === QUIZ === */
.quiz-section { margin-top: 40px; }

.quiz-title {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.quiz-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.question-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 22px 24px;
  margin-bottom: 14px; box-shadow: var(--shadow);
}
.question-num {
  display: block; font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px;
}
.question-text { color: var(--text); font-size: .97rem; line-height: 1.65; margin-bottom: 16px; }

.options-list { display: flex; flex-direction: column; gap: 8px; }
.option-btn {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text-mid); font-family: var(--font-body); font-size: .9rem;
  padding: 10px 16px; text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  display: flex; align-items: center; gap: 12px;
}
.option-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text); background: rgba(161,98,7,.05); }
.option-btn.correct { border-color: var(--accent2); background: rgba(21,128,61,.08); color: var(--accent2); }
.option-btn.wrong   { border-color: #ef4444; background: rgba(239,68,68,.07); color: #ef4444; }
.option-btn:disabled { cursor: default; }

.opt-letter {
  font-family: var(--font-mono); font-weight: 700; font-size: .72rem;
  background: var(--border); border-radius: 4px; padding: 2px 7px;
  flex-shrink: 0; color: var(--text-muted);
}

.numeric-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.numeric-inp {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text); font-family: var(--font-mono); font-size: .95rem;
  padding: 8px 12px; width: 140px; outline: none; transition: border-color .2s;
}
.numeric-inp:focus { border-color: var(--accent); }
.numeric-unit { font-family: var(--font-mono); font-size: .82rem; color: var(--text-muted); }

.submit-btn {
  background: var(--accent); color: #fff; border: none; border-radius: var(--r);
  font-family: var(--font-mono); font-size: .78rem; font-weight: 700;
  padding: 8px 18px; cursor: pointer; transition: background .2s;
}
.submit-btn:hover:not(:disabled) { background: var(--accent-d); }
.submit-btn:disabled { opacity: .5; cursor: default; }

.feedback {
  margin-top: 12px; padding: 12px 16px; border-radius: var(--r);
  font-size: .88rem; line-height: 1.6; display: none;
}
.feedback.show { display: block; }
.feedback.correct { color: var(--accent2); background: rgba(21,128,61,.08); border: 1px solid rgba(21,128,61,.25); }
.feedback.wrong   { color: #ef4444; background: rgba(239,68,68,.07); border: 1px solid rgba(239,68,68,.2); }

/* === SCORE === */
.score-section {
  background: linear-gradient(135deg, #1c1408 0%, #713f12 100%);
  padding: 80px 24px;
}
.score-inner { max-width: 500px; margin: 0 auto; text-align: center; }
.score-inner h2 { font-family: var(--font-display); font-size: 2.2rem; color: #fff; margin-bottom: 30px; }

.score-display {
  font-family: var(--font-mono); font-size: 4.5rem; font-weight: 700;
  color: var(--accent-on-dark); line-height: 1; margin-bottom: 16px;
}
.score-sep { color: rgba(255,255,255,.2); font-size: 2.8rem; margin: 0 8px; }
#score-total { color: rgba(255,255,255,.25); font-size: 2.8rem; }
#score-msg { color: rgba(255,255,255,.55); margin-bottom: 24px; font-size: .95rem; }

.reset-btn {
  background: transparent; border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.4); font-family: var(--font-mono); font-size: .78rem;
  padding: 10px 24px; border-radius: var(--r); cursor: pointer;
  letter-spacing: .08em; text-transform: uppercase;
  transition: border-color .2s, color .2s;
}
.reset-btn:hover { border-color: #ef4444; color: #f87171; }

.report-name { margin-top: 24px; }
.report-hint {
  display: block; font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.3); margin-bottom: 8px;
}
.name-input {
  display: block; width: 100%; max-width: 300px; margin: 0 auto;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r); color: rgba(255,255,255,.8);
  font-family: var(--font-body); font-size: .9rem;
  padding: 9px 14px; outline: none; transition: border-color .2s;
}
.name-input:focus { border-color: var(--accent-on-dark); }
.name-input::placeholder { color: rgba(255,255,255,.25); }

.report-actions { margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); }
.report-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.report-btn {
  background: transparent; border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.4); font-family: var(--font-mono); font-size: .72rem;
  padding: 8px 16px; border-radius: var(--r); cursor: pointer;
  letter-spacing: .07em; text-transform: uppercase;
  transition: border-color .2s, color .2s;
}
.report-btn:hover { border-color: var(--accent-on-dark); color: var(--accent-on-dark); }

/* === FOOTER === */
.footer {
  padding: 22px; text-align: center;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: .65rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted);
}

/* === CORES DAS FIGURAS ===
   Toda cor de figura mora aqui, nunca num atributo do SVG. É o que permite
   extrair o desenho para img/animacoes/ com um script, sem reescrever a
   geometria, e retematizar o arquivo avulso mexendo só nas custom properties.
   Lido por scripts/extrair-figuras-eds.ps1 — manter em sincronia com o bloco
   <style> que o script embute nos .svg avulsos. */
:root {
  --fig-fundo:      #ffffff;
  --fig-fundo-b:    #e2e8f0;
  --fig-fio:        #334155;
  --fig-corpo:      #f1f5f9;
  --fig-corpo-b:    #334155;
  --fig-pilha:      #eab308;
  --fig-pilha-b:    #a16207;
  --fig-lampada:    #fef3c7;
  --fig-lampada-b:  #a16207;
  --fig-luz:        #fbbf24;
  --fig-resistor:   #fde68a;
  --fig-resistor-b: #92400e;
  --fig-medidor:    #ffffff;
  --fig-medidor-b:  #334155;
  --fig-corrente:   #0e7490;
  --fig-tensao:     #a16207;
  --fig-carga-txt:  #ffffff;
  --fig-texto:      #334155;
  --fig-rotulo:     #64748b;
  --fig-guia:       #cbd5e1;
  --fig-divisor:    #e2e8f0;
  --fig-ok:         #15803d;
  --fig-ok-suave:   #f0fdf4;
  --fig-alerta:     #a16207;
  --fig-alerta-suave:#fef3c7;
  --fig-erro:       #dc2626;
  --fig-ohmico:     #15803d;
  --fig-nohmico:    #c2410c;
  --fig-fonte-m:    'Space Mono', ui-monospace, monospace;
  --fig-fonte-t:    'Poppins', system-ui, sans-serif;
}

/* As faixas do código de cores NÃO são retematizáveis: uma faixa marrom
   precisa continuar marrom em qualquer tema, senão o resistor deixa de
   poder ser lido. Por isso ficam fora do bloco escuro mais abaixo. */
:root {
  --fig-b-preto:    #1a1a1a;
  --fig-b-marrom:   #7b4a12;
  --fig-b-vermelho: #c0392b;
  --fig-b-laranja:  #e67e22;
  --fig-b-amarelo:  #f1c40f;
  --fig-b-verde:    #27ae60;
  --fig-b-azul:     #2980b9;
  --fig-b-violeta:  #8e44ad;
  --fig-b-cinza:    #7f8c8d;
  --fig-b-branco:   #ecf0f1;
  --fig-b-ouro:     #c9a227;
}

/* legenda de cores no figcaption — mesmos tokens do desenho */
.leg-corrente { color: var(--fig-corrente); font-weight: 600; }
.leg-tensao   { color: var(--fig-tensao); font-weight: 600; }
.leg-ohmico   { color: var(--fig-ohmico); font-weight: 600; }
.leg-nohmico  { color: var(--fig-nohmico); font-weight: 600; }

/* estruturas do circuito */
.fig-fundo     { fill: var(--fig-fundo); stroke: var(--fig-fundo-b); stroke-width: 1; }
.fig-fio       { fill: none; stroke: var(--fig-fio); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.fig-fio-fino  { fill: none; stroke: var(--fig-fio); stroke-width: 2; stroke-linecap: round; }
.fig-no        { fill: var(--fig-fio); }
.fig-corpo     { fill: var(--fig-corpo); stroke: var(--fig-corpo-b); stroke-width: 2; }
.fig-pilha     { fill: var(--fig-pilha); stroke: var(--fig-pilha-b); stroke-width: 2; }
.fig-pilha-tp  { fill: var(--fig-pilha-b); }
.fig-polo      { fill: none; stroke: var(--fig-fio); stroke-width: 3; stroke-linecap: round; }
.fig-lampada   { fill: var(--fig-lampada); stroke: var(--fig-lampada-b); stroke-width: 2; }
.fig-lampada-x { fill: none; stroke: var(--fig-lampada-b); stroke-width: 2; }
.fig-luz       { fill: none; stroke: var(--fig-luz); stroke-width: 2.5; stroke-linecap: round; }
.fig-filamento { fill: none; stroke: var(--fig-resistor-b); stroke-width: 2; }
.fig-resistor  { fill: var(--fig-resistor); stroke: var(--fig-resistor-b); stroke-width: 2; }
.fig-medidor   { fill: var(--fig-medidor); stroke: var(--fig-medidor-b); stroke-width: 2; }
.fig-guia      { fill: none; stroke: var(--fig-guia); stroke-width: 1.5; stroke-dasharray: 5 4; }
.fig-divisor   { fill: none; stroke: var(--fig-divisor); stroke-width: 2; stroke-dasharray: 5 4; }
.fig-eixo      { fill: none; stroke: var(--fig-texto); stroke-width: 2; }
.fig-eixo-p    { fill: var(--fig-texto); }
.fig-caixa-ok     { fill: var(--fig-ok-suave); stroke: var(--fig-ok); stroke-width: 1.5; }
.fig-caixa-alerta { fill: var(--fig-alerta-suave); stroke: var(--fig-alerta); stroke-width: 1.5; }

/* analogia do desnível — a rampa por onde as cargas descem */
.fig-nivel     { fill: none; stroke: var(--fig-guia); stroke-width: 2; stroke-dasharray: 6 6; }
.fig-rampa     { fill: none; stroke: var(--fig-fio); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.fig-cota-u    { fill: none; stroke: var(--fig-tensao); stroke-width: 3; stroke-dasharray: 7 7; }
.fig-carga     { fill: var(--fig-tensao); }
.fig-carga-txt { fill: var(--fig-carga-txt); font-family: var(--fig-fonte-m); font-size: 15px; font-weight: 700; }

/* Quadro parado para quem pede menos movimento. O CSS não alcança o SMIL, então
   em vez de tentar pausar a animação trocamos o grupo animado por um grupo
   estático já posicionado. Vale igual no inline e no .svg avulso. */
.fig-cargas-paradas { display: none; }
@media (prefers-reduced-motion: reduce) {
  .fig-cargas-animadas { display: none; }
  .fig-cargas-paradas  { display: inline; }
}

/* corrente e tensão */
.fig-v-corrente { fill: none; stroke: var(--fig-corrente); stroke-width: 3; stroke-linecap: round; }
.fig-p-corrente { fill: var(--fig-corrente); }
.fig-v-tensao   { fill: none; stroke: var(--fig-tensao); stroke-width: 3; stroke-linecap: round; }
.fig-p-tensao   { fill: var(--fig-tensao); }

/* curvas do gráfico V × i */
.fig-curva-ohm  { fill: none; stroke: var(--fig-ohmico);  stroke-width: 3.5; stroke-linecap: round; }
.fig-curva-noh  { fill: none; stroke: var(--fig-nohmico); stroke-width: 3.5; stroke-linecap: round; }
.fig-no-ohm     { fill: var(--fig-ohmico); }
.fig-no-noh     { fill: var(--fig-nohmico); }

/* faixas do resistor */
.fig-corpo-res  { fill: var(--fig-resistor); stroke: var(--fig-resistor-b); stroke-width: 1.5; }
.fig-terminal   { fill: none; stroke: var(--fig-fio); stroke-width: 3; stroke-linecap: round; }
.fig-fx-preto    { fill: var(--fig-b-preto); }
.fig-fx-marrom   { fill: var(--fig-b-marrom); }
.fig-fx-vermelho { fill: var(--fig-b-vermelho); }
.fig-fx-laranja  { fill: var(--fig-b-laranja); }
.fig-fx-amarelo  { fill: var(--fig-b-amarelo); }
.fig-fx-verde    { fill: var(--fig-b-verde); }
.fig-fx-azul     { fill: var(--fig-b-azul); }
.fig-fx-violeta  { fill: var(--fig-b-violeta); }
.fig-fx-cinza    { fill: var(--fig-b-cinza); }
.fig-fx-branco   { fill: var(--fig-b-branco); stroke: var(--fig-rotulo); stroke-width: .7; }
.fig-fx-ouro     { fill: var(--fig-b-ouro); }

/* textos */
.fig-t          { font-family: var(--fig-fonte-t); font-size: 11px;   fill: var(--fig-texto); }
.fig-t-rot      { font-family: var(--fig-fonte-t); font-size: 10px;   fill: var(--fig-rotulo); }
.fig-t-nota     { font-family: var(--fig-fonte-t); font-size: 11.5px; font-weight: 600; fill: var(--fig-texto); }
.fig-m          { font-family: var(--fig-fonte-m); font-size: 12px;   fill: var(--fig-texto); }
.fig-m-peq      { font-family: var(--fig-fonte-m); font-size: 11px;   fill: var(--fig-rotulo); }
.fig-tit        { font-family: var(--fig-fonte-m); font-size: 12px;   font-weight: 700; fill: var(--fig-alerta); }
.fig-tit-ok     { font-family: var(--fig-fonte-m); font-size: 12px;   font-weight: 700; fill: var(--fig-ok); }
.fig-tit-erro   { font-family: var(--fig-fonte-m); font-size: 12px;   font-weight: 700; fill: var(--fig-erro); }
.fig-r-corrente { font-family: var(--fig-fonte-m); font-size: 12px;   font-weight: 700; fill: var(--fig-corrente); }
.fig-r-tensao   { font-family: var(--fig-fonte-m); font-size: 12px;   font-weight: 700; fill: var(--fig-tensao); }
.fig-r-ohm      { font-family: var(--fig-fonte-m); font-size: 12px;   font-weight: 700; fill: var(--fig-ohmico); }
.fig-r-noh      { font-family: var(--fig-fonte-m); font-size: 12px;   font-weight: 700; fill: var(--fig-nohmico); }
.fig-visor      { font-family: var(--fig-fonte-m); font-size: 13px;   font-weight: 700; fill: var(--fig-corrente); }
.fig-peq        { font-size: 9.5px; }
.fig-med        { font-size: 11.5px; }
.fig-nota-ok     { fill: var(--fig-ok); }
.fig-nota-alerta { fill: var(--fig-alerta); }
.fig-nota-erro   { fill: var(--fig-erro); }

/* ================================================================
   COMPONENTES ESPECÍFICOS DE CIRCUITOS
   ================================================================ */

/* === FORMULA BOX — variantes de destaque === */
.formula-box.large { padding: 26px 28px; border-left-width: 5px; align-items: center; text-align: center; }
.formula-tex.big   { font-size: 1.9rem; letter-spacing: .02em; }

/* === LAW CARD — enunciado preciso × simplificação === */
.law-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-md);
}
.law-tier { padding: 22px 26px; }
.law-tier + .law-tier { border-top: 1px solid var(--border); }
.law-tier.precise { background: linear-gradient(180deg, rgba(113,63,18,.055), rgba(113,63,18,.02)); }
.law-tier.simple  { background: var(--surface); }

.tier-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 100px; margin-bottom: 14px;
}
.law-tier.precise .tier-tag { color: #fff; background: var(--accent-d); }
.law-tier.simple  .tier-tag {
  color: var(--accent-d); background: rgba(21,128,61,.12);
  border: 1px solid rgba(21,128,61,.28);
}

.law-statement { font-family: var(--font-display); font-size: 1.06rem; line-height: 1.62; color: var(--text); }
.law-statement strong { color: var(--accent-d); }
.law-statement em     { font-style: italic; color: var(--accent-d); }
.law-note { margin-top: 14px; font-size: .86rem; line-height: 1.7; color: var(--text-muted); }
.law-note strong { color: var(--text-mid); }

/* === FIGURA / DIAGRAMA DE CORPO LIVRE === */
.fbd-figure { margin: 4px 0; }
.fbd-figure svg {
  display: block; width: 100%; max-width: 680px; height: auto; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow);
}
.fbd-figure figcaption {
  margin: 12px auto 0; max-width: 620px; text-align: center;
  font-size: .8rem; line-height: 1.6; color: var(--text-muted);
}
.fbd-figure figcaption strong { color: var(--text-mid); }

/* === ANALOGY CARD — "o engano" × "o que de fato acontece" === */
.analogy-card.certo   { border-top: 3px solid var(--accent2); }
.analogy-card.erro { border-top: 3px solid #ef4444; }
.analogy-card.certo   h4 { color: var(--accent2); }
.analogy-card.erro h4 { color: #dc2626; }
.analogy-card.certo   li::before { color: var(--accent2); }
.analogy-card.erro li::before { color: #dc2626; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; padding: 80px 5vw 50px; }
  .hero-visual { display: none; }
  .energy-grid { grid-template-columns: 1fr 1fr; }
  .analogy-grid { grid-template-columns: 1fr; }
  .units-table th, .units-table td { padding: 7px 10px; font-size: .82rem; }
  .law-tier { padding: 18px 18px; }
}
@media (max-width: 500px) {
  .energy-grid { grid-template-columns: 1fr; }
  .topic-header { flex-direction: column; gap: 4px; }
  .topic-num { font-size: 2rem; }
  .score-display { font-size: 3.5rem; }
  .formula-tex.big { font-size: 1.35rem; }
  .law-statement { font-size: 1rem; }
}
