/* ===================================================================
   GIBI — vitrine publica das revisoes em quadrinhos (/gibi + /gibi/{id})
   DAGOBERTO STYLE — direcao "editorial premium" com o sabor do gibi:
   tinta + papel + reticula (halftone) + elenco Bit & Bug.
   Tudo escopado em .gb-* (nao depende de Tailwind: nao precisa rebuild).
   A camada .gcena-* e a MESMA do player do aluno (aula-player.php): o
   balao/lousa/selo sao desenhados por codigo por cima do painel limpo.
   Padrao: docs/design.md · manual: docs/gibi.md §16
   =================================================================== */

/* ================================================================= */
/* VARIAVEIS — cada acento tem um PAPEL                              */
/* ================================================================= */
:root {
    --gb-ink: #0a1614;           /* tinta: fundo escuro do hero/CTA */
    --gb-ink-2: #10271f;
    --gb-teal: #14b8a6;          /* a marca */
    --gb-teal-deep: #0d9488;
    --gb-mint: #5eead4;          /* a marca sobre escuro */
    --gb-amber: #ffc107;         /* o BIT (luvas, antena) = o acerto */
    --gb-amber-deep: #b45309;    /* par legivel do ambar no tema claro */
    --gb-cream: #fff4d6;         /* o corpo do Bit / o papel do gibi */
    --gb-bug: #9b59b6;           /* o BUG = o erro, e a IA que desenha */
    --gb-bug-soft: #d7b8e8;
    --gb-red: #e53935;           /* a palavra-chave em destaque / o POW */
    --gb-sky: #38bdf8;           /* escolas, governo, alcance */
    --gb-sky-deep: #0369a1;
    --gb-paper: #fff8e7;
    --gb-line: #10151a;          /* contorno do painel (mesma tinta do sprite do Bit) */
    --gb-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
    --gb-font-gibi: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', cursive;
    --gb-font-pow: Impact, 'Arial Black', 'Helvetica Neue', sans-serif;
}
/* No escuro, o par "deep" (feito pra ler sobre branco) morre — vira o par claro.
   Os cards passam a cor por --c inline, entao a troca tem que ser no token. */
[data-theme="dark"] {
    --gb-teal-deep: #2dd4bf;
    --gb-amber-deep: #ffc107;
    --gb-sky-deep: #38bdf8;
    --gb-bug: #b07cc6;
}

/* ================================================================= */
/* BASE                                                              */
/* ================================================================= */
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }

.gb-wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.gb-sec { padding: 5rem 0; }
.gb-sec--bg { background: var(--bg); }
.gb-sec--surface { background: var(--surface); }

.gb-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .8125rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--gb-teal-deep); margin-bottom: 1rem;
}
[data-theme="dark"] .gb-eyebrow { color: var(--gb-mint); }
.gb-eyebrow::before { content: ""; width: 1.75rem; height: 2px; border-radius: 2px; background: currentColor; opacity: .5; }
.gb-eyebrow--bug { color: var(--gb-bug); }
[data-theme="dark"] .gb-eyebrow--bug { color: var(--gb-bug-soft); }
.gb-eyebrow--amber { color: var(--gb-amber-deep); }
[data-theme="dark"] .gb-eyebrow--amber { color: var(--gb-amber); }
.gb-eyebrow--sky { color: var(--gb-sky-deep); }
[data-theme="dark"] .gb-eyebrow--sky { color: var(--gb-sky); }

.gb-h2 {
    font-size: clamp(1.75rem, 1.1rem + 2.6vw, 2.75rem); line-height: 1.12; letter-spacing: -.025em;
    font-weight: 700; color: var(--text); margin: 0 0 1rem; text-wrap: balance;
}
.gb-lead {
    font-size: clamp(1rem, .95rem + .35vw, 1.1875rem); line-height: 1.65; color: var(--muted);
    max-width: 42rem; margin: 0 0 3rem; text-wrap: pretty;
}
.gb-center { text-align: center; }
.gb-center .gb-lead { margin-left: auto; margin-right: auto; }
.gb-pow {
    font-family: var(--gb-font-pow); text-transform: uppercase; letter-spacing: .02em;
    color: var(--gb-amber); text-shadow: -2px -2px 0 var(--gb-line), 2px -2px 0 var(--gb-line), -2px 2px 0 var(--gb-line), 2px 2px 0 var(--gb-line), 0 4px 0 var(--gb-line);
}

/* revelacao no scroll — so esconde quando o JS esta vivo */
.gb-js .gb-rv {
    opacity: 0; transform: translateY(22px);
    transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1);
    transition-delay: var(--rv-delay, 0s);
}
.gb-js .gb-rv.is-in { opacity: 1; transform: none; }

/* ================================================================= */
/* BOTOES                                                            */
/* ================================================================= */
.gb-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .625rem;
    min-height: 3rem; padding: .9rem 1.6rem; border-radius: 999px;
    font-size: 1.0625rem; font-weight: 700; text-decoration: none; border: 1px solid transparent;
    transition: transform .2s cubic-bezier(.16, 1, .3, 1), box-shadow .2s ease, background .2s ease, color .2s ease;
}
.gb-btn svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.gb-btn--primary {
    background: linear-gradient(135deg, var(--gb-mint), var(--gb-teal) 55%, var(--gb-teal-deep));
    color: #04211e; box-shadow: 0 10px 30px -8px rgba(20, 184, 166, .65), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.gb-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -10px rgba(20, 184, 166, .75), inset 0 1px 0 rgba(255, 255, 255, .45); }
.gb-btn--amber {
    background: linear-gradient(135deg, #ffe082, var(--gb-amber) 60%, #ff9800);
    color: #1a1200; box-shadow: 0 10px 30px -8px rgba(255, 193, 7, .6), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.gb-btn--amber:hover { transform: translateY(-2px); }
.gb-btn--ghost { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .22); color: #fff; backdrop-filter: blur(8px); }
.gb-btn--ghost:hover { background: rgba(255, 255, 255, .13); transform: translateY(-2px); }
.gb-btn--outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.gb-btn--outline:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--gb-teal); }

/* ================================================================= */
/* HERO                                                              */
/* ================================================================= */
.gb-hero {
    position: relative; isolation: isolate; overflow: hidden; color: #fff; padding: 4.5rem 0 5rem;
    background:
        radial-gradient(60rem 40rem at 84% 6%, rgba(155, 89, 182, .32), transparent 60%),
        radial-gradient(48rem 34rem at 6% 94%, rgba(20, 184, 166, .32), transparent 62%),
        radial-gradient(36rem 24rem at 50% -12%, rgba(255, 193, 7, .16), transparent 60%),
        linear-gradient(160deg, var(--gb-ink-2), var(--gb-ink) 55%, #040d0b);
}
/* granulado + reticula de gibi (halftone): profundidade sem imagem */
.gb-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: var(--gb-grain); opacity: .22; mix-blend-mode: overlay;
}
.gb-hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.6px);
    background-size: 14px 14px;
    -webkit-mask-image: radial-gradient(70rem 40rem at 90% 50%, #000 10%, transparent 70%);
            mask-image: radial-gradient(70rem 40rem at 90% 50%, #000 10%, transparent 70%);
    opacity: .5;
}
.gb-hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.gb-badge {
    display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .9rem .45rem .6rem;
    border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
    font-size: .8125rem; font-weight: 700; letter-spacing: .04em; margin-bottom: 1.5rem;
}
.gb-badge i { width: 1.5rem; height: 1.5rem; border-radius: 6px; background: var(--gb-cream); border: 2px solid var(--gb-line); display: inline-block; position: relative; }
.gb-badge i::before, .gb-badge i::after { content: ""; position: absolute; top: 7px; width: 2px; height: 5px; background: var(--gb-line); border-radius: 1px; }
.gb-badge i::before { left: 6px; } .gb-badge i::after { right: 6px; }
.gb-hero h1 {
    font-size: clamp(2.5rem, 1.4rem + 4.6vw, 4.25rem); line-height: 1.02; letter-spacing: -.035em;
    font-weight: 700; margin: 0 0 1.25rem; text-wrap: balance;
}
.gb-hero h1 .gb-pow { font-size: 1.12em; display: inline-block; transform: rotate(-2deg); }
.gb-grad { background: linear-gradient(95deg, var(--gb-mint), var(--gb-teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gb-hero__sub { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); line-height: 1.6; color: rgba(255, 255, 255, .78); max-width: 36rem; margin: 0 0 2rem; text-wrap: pretty; }
.gb-hero__sub strong { color: #fff; }
.gb-hero__acoes { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.75rem; }
.gb-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.gb-pill {
    display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem; border-radius: 999px;
    font-size: .8125rem; font-weight: 600; color: rgba(255, 255, 255, .86);
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
}
.gb-pill i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--gb-mint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gb-mint) 25%, transparent); }
.gb-pill--amber i { background: var(--gb-amber); box-shadow: 0 0 0 3px rgba(255, 193, 7, .25); }
.gb-pill--bug i { background: var(--gb-bug-soft); box-shadow: 0 0 0 3px rgba(155, 89, 182, .3); }
.gb-pill--sky i { background: var(--gb-sky); box-shadow: 0 0 0 3px rgba(56, 189, 248, .25); }
.gb-hero__nota { margin: 1.25rem 0 0; font-size: .875rem; color: rgba(255, 255, 255, .6); }

/* o palco: um PAINEL de gibi de verdade, com balao por codigo por cima */
.gb-stage { position: relative; width: 100%; max-width: 34rem; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; justify-self: center; }
/* (width:100% e obrigatorio: item de grid com margin:auto encolhe pro conteudo, e o painel
   com container-type nao tem largura intrinseca — sem isto o palco some, 8px) */
.gb-panel {
    position: relative; border: 4px solid var(--gb-line); border-radius: 14px; background: #fbbf24;
    box-shadow: 10px 12px 0 rgba(0, 0, 0, .35), 0 30px 60px -20px rgba(0, 0, 0, .6);
    transform: rotate(-2.5deg); overflow: hidden; container-type: inline-size;
    animation: gb-float 7s ease-in-out infinite;
}
.gb-panel img { display: block; width: 100%; height: auto; }
.gb-stage__balao {
    position: absolute; left: 3%; top: 3.5%; width: 40%; z-index: 2;
    background: #fff; color: #111; border: 3px solid #111; border-radius: 2.4cqw; padding: 1.3cqw 1.9cqw;
    font-family: var(--gb-font-gibi); font-weight: 700; font-size: 2.7cqw; line-height: 1.25; text-align: center; text-transform: uppercase;
    animation: gb-pop .6s cubic-bezier(.16, 1, .3, 1) .5s both;
}
.gb-stage__balao::after { content: ""; position: absolute; width: 2.4cqw; height: 2.4cqw; background: #fff; left: 60%; bottom: -1.45cqw; border-right: 3px solid #111; border-bottom: 3px solid #111; transform: rotate(45deg); }
.gb-stage__balao .gcena-key { color: #c62828; font-size: 1.18em; font-weight: 900; -webkit-text-stroke: .06em #7f0000; paint-order: stroke fill; }
.gb-stage__sfx {
    position: absolute; right: -2%; top: 50%; z-index: 3; font-size: clamp(2rem, 6cqw, 3.5rem);
    transform: rotate(-10deg); animation: gb-pop .6s cubic-bezier(.16, 1, .3, 1) .9s both;
}
.gb-stage__selo {
    position: absolute; left: -.5rem; bottom: .25rem; z-index: 3; transform: rotate(-7deg);
    background: rgba(255, 255, 255, .94); border: 4px solid #2e7d32; color: #2e7d32; border-radius: 10px;
    font-family: var(--gb-font-pow); font-size: 1.1rem; letter-spacing: 1px; padding: .35rem 1rem;
    animation: gb-pop .6s cubic-bezier(.16, 1, .3, 1) 1.2s both;
}
/* paineizinhos de fundo — dao a sensacao de revista aberta */
.gb-stage__ghost {
    position: absolute; border: 3px solid rgba(255, 255, 255, .18); border-radius: 10px; z-index: 0;
    background: rgba(255, 255, 255, .03);
}
.gb-stage__ghost--a { width: 38%; height: 42%; right: -4%; top: -2%; transform: rotate(6deg); }
.gb-stage__ghost--b { width: 30%; height: 34%; left: -6%; bottom: 4%; transform: rotate(-9deg); }
@keyframes gb-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes gb-pop { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }

/* ================================================================= */
/* FAIXA DE NUMEROS                                                  */
/* ================================================================= */
.gb-faixa { background: var(--gb-ink); color: #fff; border-top: 1px solid rgba(255, 255, 255, .08); border-bottom: 1px solid var(--border); }
.gb-faixa__grid { max-width: 1120px; margin: 0 auto; padding: 1.75rem 1.25rem; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; }
.gb-num { display: flex; flex-direction: column; gap: .2rem; padding-left: .9rem; border-left: 3px solid var(--c, var(--gb-teal)); }
.gb-num b { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1; letter-spacing: -.03em; color: var(--c, var(--gb-mint)); }
.gb-num span { font-size: .8125rem; color: rgba(255, 255, 255, .7); line-height: 1.3; }

/* ================================================================= */
/* A ESTANTE — os gibis publicados                                   */
/* ================================================================= */
.gb-estante { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 290px)); justify-content: center; gap: 1.5rem; }
.gb-gibi {
    position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px); overflow: hidden; text-decoration: none; color: inherit;
    box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .25s ease, border-color .25s ease;
}
.gb-gibi:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gb-teal); }
.gb-gibi__capa { position: relative; aspect-ratio: 2 / 3; background: var(--gb-ink-2); overflow: hidden; border-bottom: 3px solid var(--gb-line); max-width: none; }
.gb-gibi__capa img { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; border-radius: 0; transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.gb-gibi:hover .gb-gibi__capa img { transform: scale(1.04); }
.gb-gibi__novo {
    position: absolute; bottom: .9rem; left: -.4rem; transform: rotate(-6deg); z-index: 2;
    background: var(--gb-red); color: #fff; font-family: var(--gb-font-pow); letter-spacing: 1px; font-size: .85rem;
    padding: .25rem .75rem; border: 2px solid var(--gb-line); border-radius: 6px; box-shadow: 2px 3px 0 var(--gb-line);
}
.gb-gibi__corpo { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.gb-gibi__curso { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gb-teal-deep); }
[data-theme="dark"] .gb-gibi__curso { color: var(--gb-mint); }
.gb-gibi__titulo { font-size: 1.125rem; font-weight: 700; line-height: 1.25; color: var(--text); margin: 0; text-wrap: balance; }
.gb-gibi__aula { font-size: .9rem; color: var(--muted); margin: 0; }
.gb-gibi__meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: auto; padding-top: .75rem; font-size: .8125rem; color: var(--muted); }
.gb-gibi__meta b { color: var(--text); font-weight: 600; }
.gb-gibi__ler { display: inline-flex; align-items: center; gap: .4rem; margin-top: .75rem; font-weight: 700; color: var(--gb-teal-deep); }
[data-theme="dark"] .gb-gibi__ler { color: var(--gb-mint); }
.gb-gibi__ler svg { width: 1rem; height: 1rem; transition: transform .2s; }
.gb-gibi:hover .gb-gibi__ler svg { transform: translateX(3px); }
.gb-vazio { text-align: center; padding: 3rem 1.5rem; border: 2px dashed var(--border); border-radius: var(--radius-lg, 16px); color: var(--muted); }
.gb-estante__nota { margin: 2rem 0 0; font-size: .9rem; color: var(--muted); text-align: center; }

/* ================================================================= */
/* O ELENCO                                                          */
/* ================================================================= */
.gb-elenco { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.gb-pers {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 11rem; gap: 1.25rem; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 16px); padding: 1.75rem; overflow: hidden;
}
.gb-pers::before { content: ""; position: absolute; inset: auto -20% -40% auto; width: 18rem; height: 18rem; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, transparent); z-index: 0; }
.gb-pers > * { position: relative; z-index: 1; }
.gb-pers__nome { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--gb-font-pow); font-size: 1.75rem; letter-spacing: .02em; color: var(--c); margin: 0 0 .35rem; }
.gb-pers__papel { font-size: .8125rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .75rem; }
.gb-pers p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.6; text-wrap: pretty; }
.gb-pers p + p { margin-top: .5rem; }
.gb-pers img { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .22)); animation: gb-float 8s ease-in-out infinite; }
.gb-pers--bug img { animation-delay: -3s; }
.gb-folhas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.gb-folha { background: var(--gb-paper); border: 3px solid var(--gb-line); border-radius: 12px; padding: .75rem; box-shadow: 6px 7px 0 var(--gb-line); }
[data-theme="dark"] .gb-folha { box-shadow: 6px 7px 0 rgba(0, 0, 0, .6); }
.gb-folha img { width: 100%; height: auto; display: block; border-radius: 6px; }
.gb-folha figcaption { font-size: .8125rem; color: #3b3b3b; margin: .6rem .25rem 0; line-height: 1.4; }
.gb-folha figcaption b { color: #111; }

/* ================================================================= */
/* COMO FUNCIONA — a esteira                                         */
/* ================================================================= */
.gb-passos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; counter-reset: gb-passo; }
.gb-passo {
    position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 16px);
    padding: 1.5rem 1.25rem 1.4rem; counter-increment: gb-passo;
}
.gb-passo::before {
    content: counter(gb-passo); position: absolute; top: -.9rem; left: 1.1rem; width: 2rem; height: 2rem; border-radius: 50%;
    display: grid; place-items: center; font-family: var(--gb-font-pow); font-size: 1.05rem;
    background: var(--c); color: #fff; border: 3px solid var(--surface); box-shadow: 0 4px 12px -3px color-mix(in srgb, var(--c) 60%, transparent);
}
.gb-passo__ic { width: 2.75rem; height: 2.75rem; border-radius: 12px; display: grid; place-items: center; margin: .25rem 0 .9rem;
    color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); }
.gb-passo__ic svg { width: 1.5rem; height: 1.5rem; }
.gb-passo h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .4rem; color: var(--text); line-height: 1.25; }
.gb-passo p { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.gb-passo__quem { display: inline-block; margin-top: .75rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }

/* a demonstracao ao vivo: balao por codigo */
.gb-demo { margin-top: 3.5rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.gb-demo__painel { position: relative; border: 4px solid var(--gb-line); border-radius: 14px; overflow: hidden; container-type: inline-size;
    background: radial-gradient(circle at 70% 30%, #fde68a, #f59e0b 70%); box-shadow: 8px 10px 0 var(--gb-line); aspect-ratio: 1 / 1; }
[data-theme="dark"] .gb-demo__painel { box-shadow: 8px 10px 0 rgba(0, 0, 0, .6); }
.gb-demo__painel::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(0, 0, 0, .09) 1px, transparent 1.5px); background-size: 10px 10px; pointer-events: none; }
.gb-demo__painel img { position: absolute; left: 22%; bottom: 0; width: 60%; height: auto; z-index: 1; }
.gb-demo__painel .gcena-balao { z-index: 2; }
.gb-demo__form label { display: block; font-weight: 700; margin-bottom: .5rem; color: var(--text); }
.gb-demo__form input {
    width: 100%; font: inherit; font-size: 1.05rem; padding: .9rem 1rem; border-radius: 12px; border: 2px solid var(--border);
    background: var(--surface); color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s;
}
.gb-demo__form input:focus { border-color: var(--gb-teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gb-teal) 22%, transparent); }
.gb-demo__dica { margin: .75rem 0 0; font-size: .875rem; color: var(--muted); }
.gb-demo__dica code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: .1rem .35rem; border-radius: 4px; color: var(--text); }
.gb-demo__quem { display: flex; gap: .5rem; margin-top: 1rem; }
.gb-demo__quem button {
    font: inherit; font-size: .875rem; font-weight: 700; padding: .5rem .9rem; border-radius: 999px; cursor: pointer;
    border: 2px solid var(--border); background: var(--surface); color: var(--text); transition: border-color .2s, background .2s;
}
.gb-demo__quem button[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }

/* ================================================================= */
/* AS PORTAS — quando o gibi entra no aprendizado                    */
/* ================================================================= */
.gb-portas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.gb-porta {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem; gap: 1.25rem; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 16px); padding: 1.75rem; overflow: hidden;
}
.gb-porta--wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.gb-porta__tag { display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); padding: .3rem .7rem; border-radius: 999px; margin-bottom: .9rem; }
.gb-porta h3 { font-size: 1.2rem; font-weight: 700; margin: 0 0 .5rem; color: var(--text); line-height: 1.25; text-wrap: balance; }
.gb-porta p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.6; text-wrap: pretty; }
.gb-porta p + p { margin-top: .5rem; }
.gb-porta img { width: 100%; height: auto; display: block; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .2)); }
.gb-porta--em-obra { border-style: dashed; border-color: color-mix(in srgb, var(--c) 45%, var(--border)); }
.gb-porta--em-obra::after { content: "em construção"; position: absolute; right: -2.4rem; top: 1.4rem; transform: rotate(38deg);
    background: var(--c); color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: .3rem 3rem; }

/* a curva da revisao (SVG inline) */
.gb-curva { display: block; width: 100%; height: auto; }
.gb-curva__lbl { font-size: 11px; font-weight: 700; fill: var(--muted); font-family: inherit; }
.gb-curva__eixo { stroke: var(--border); stroke-width: 1.5; }
.gb-curva__esq { fill: none; stroke: var(--gb-red); stroke-width: 2.5; stroke-dasharray: 5 4; opacity: .75; }
.gb-curva__rev { fill: none; stroke: var(--gb-teal); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 900; stroke-dashoffset: 900; }
.gb-js .is-in .gb-curva__rev { animation: gb-tracar 2.2s cubic-bezier(.16, 1, .3, 1) .3s forwards; }
.gb-curva__pt { fill: var(--gb-amber); stroke: var(--gb-line); stroke-width: 2; }
.gb-curva__legenda { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .5rem; font-size: .8125rem; color: var(--muted); }
.gb-curva__legenda i { display: inline-block; width: 1.25rem; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: .4rem; }
@keyframes gb-tracar { to { stroke-dashoffset: 0; } }

/* ================================================================= */
/* ESCOLAS, GOVERNO, EMPRESAS                                        */
/* ================================================================= */
.gb-inst { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.gb-inst__img { border: 4px solid var(--gb-line); border-radius: 14px; overflow: hidden; box-shadow: 10px 12px 0 var(--gb-line); transform: rotate(1.5deg); }
[data-theme="dark"] .gb-inst__img { box-shadow: 10px 12px 0 rgba(0, 0, 0, .6); }
.gb-inst__img img { display: block; width: 100%; height: auto; }
.gb-argumentos { display: grid; gap: 1rem; margin: 1.5rem 0 2rem; }
.gb-arg { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .9rem; align-items: start; }
.gb-arg__ic { width: 2.5rem; height: 2.5rem; border-radius: 10px; display: grid; place-items: center; color: var(--c);
    background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); }
.gb-arg__ic svg { width: 1.25rem; height: 1.25rem; }
.gb-arg b { display: block; color: var(--text); margin-bottom: .15rem; }
.gb-arg span { color: var(--muted); font-size: .925rem; line-height: 1.55; }
.gb-inst__nums { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-bottom: 2rem; }
.gb-inst__nums div b { display: block; font-size: 1.75rem; letter-spacing: -.03em; color: var(--gb-sky-deep); line-height: 1; }
[data-theme="dark"] .gb-inst__nums div b { color: var(--gb-sky); }
.gb-inst__nums div span { font-size: .8125rem; color: var(--muted); }

/* ================================================================= */
/* CTA FINAL                                                         */
/* ================================================================= */
.gb-cta {
    position: relative; isolation: isolate; overflow: hidden; color: #fff; padding: 5rem 0;
    background:
        radial-gradient(50rem 30rem at 10% 0%, rgba(155, 89, 182, .35), transparent 60%),
        radial-gradient(46rem 30rem at 90% 100%, rgba(20, 184, 166, .35), transparent 62%),
        linear-gradient(160deg, var(--gb-ink-2), var(--gb-ink) 60%, #040d0b);
}
.gb-cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--gb-grain); opacity: .22; mix-blend-mode: overlay; }
.gb-cta__grid { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: 3rem; align-items: center; }
.gb-cta h2 { font-size: clamp(1.9rem, 1.2rem + 2.8vw, 3rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 1rem; text-wrap: balance; }
.gb-cta p { color: rgba(255, 255, 255, .76); font-size: 1.0625rem; line-height: 1.6; max-width: 36rem; margin: 0 0 2rem; }
.gb-cta__acoes { display: flex; flex-wrap: wrap; gap: .75rem; }
.gb-cta__capa { border: 4px solid var(--gb-line); border-radius: 14px; overflow: hidden; transform: rotate(4deg); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7), 8px 10px 0 rgba(0, 0, 0, .35); animation: gb-float 9s ease-in-out infinite; }
.gb-cta__capa img { display: block; width: 100%; height: auto; }

/* ================================================================= */
/* FAQ                                                               */
/* ================================================================= */
.gb-faq { max-width: 46rem; margin: 0 auto; display: grid; gap: .75rem; }
.gb-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 1.25rem; transition: border-color .2s; }
.gb-faq details[open] { border-color: var(--gb-teal); }
.gb-faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; font-weight: 700; color: var(--text); }
.gb-faq summary::-webkit-details-marker { display: none; }
.gb-faq summary::after { content: "+"; flex-shrink: 0; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--gb-teal-deep); background: color-mix(in srgb, var(--gb-teal) 14%, transparent); transition: transform .25s; }
.gb-faq details[open] summary::after { transform: rotate(45deg); }
.gb-faq details p { margin: 0 0 1.2rem; color: var(--muted); line-height: 1.6; text-wrap: pretty; }

/* ================================================================= */
/* O LEITOR (/gibi/{id}) — webtoon vertical, balao por codigo        */
/* ================================================================= */
.gb-leitor { padding: 2.5rem 0 4rem; }
.gb-leitor__topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.gb-leitor__volta { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--gb-teal-deep); text-decoration: none; }
[data-theme="dark"] .gb-leitor__volta { color: var(--gb-mint); }
.gb-leitor__volta svg { width: 1rem; height: 1rem; }
.gb-leitor h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); line-height: 1.1; letter-spacing: -.03em; margin: .25rem 0 .5rem; color: var(--text); text-wrap: balance; }
.gb-leitor__meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--muted); font-size: .9rem; margin-bottom: 2rem; }
.gb-leitor__meta a { color: var(--gb-teal-deep); font-weight: 600; text-decoration: none; }
[data-theme="dark"] .gb-leitor__meta a { color: var(--gb-mint); }
.gb-tira { display: grid; gap: 1.25rem; max-width: 720px; margin: 0 auto; }
.gb-tira .gcena { max-width: 100%; border-radius: 14px; box-shadow: 6px 8px 0 var(--gb-line); }
[data-theme="dark"] .gb-tira .gcena { box-shadow: 6px 8px 0 rgba(0, 0, 0, .6); }
.gb-tira .gcena img { border-width: 3px; }
.gb-tira__n { text-align: center; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.gb-fim { max-width: 720px; margin: 3rem auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 16px); padding: 2rem; text-align: center; }
.gb-fim h2 { font-size: 1.5rem; margin: 0 0 .5rem; color: var(--text); letter-spacing: -.02em; }
.gb-fim p { color: var(--muted); margin: 0 0 1.5rem; text-wrap: pretty; }
.gb-fim__acoes { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }

/* ---- a camada do painel, igual ao player (aula-player.php) ---- */
.gcena { position: relative; container-type: inline-size; max-width: min(720px, 100%); }
.gcena img { width: 100%; height: auto; display: block; border-radius: 12px; border: 2px solid #10151a; }
.gcena-balao { position: absolute; background: #fff; border: 3px solid #111; border-width: 0.35cqw;
    border-radius: 16px; border-radius: 2.4cqw; padding: 9px 13px; padding: 1.3cqw 1.9cqw;
    font-weight: 700; font-size: 14px; font-size: 2.5cqw; line-height: 1.25; text-align: center;
    text-transform: uppercase; color: #111; font-family: var(--gb-font-gibi); }
.gcena-balao::after { content: ''; position: absolute; width: 15px; height: 15px; width: 2.2cqw; height: 2.2cqw; background: #fff; }
.gcena-t-bl::after { left: 16%; bottom: -9px; bottom: -1.35cqw; border-right: 3px solid #111; border-bottom: 3px solid #111; border-width: 0.35cqw; transform: rotate(45deg); }
.gcena-t-bc::after { left: 47%; bottom: -9px; bottom: -1.35cqw; border-right: 3px solid #111; border-bottom: 3px solid #111; border-width: 0.35cqw; transform: rotate(45deg); }
.gcena-t-br::after { right: 16%; bottom: -9px; bottom: -1.35cqw; border-right: 3px solid #111; border-bottom: 3px solid #111; border-width: 0.35cqw; transform: rotate(45deg); }
.gcena-t-l::after  { left: -9px; left: -1.35cqw; top: 42%; border-left: 3px solid #111; border-bottom: 3px solid #111; border-width: 0.35cqw; transform: rotate(45deg); }
.gcena-t-r::after  { right: -9px; right: -1.35cqw; top: 42%; border-right: 3px solid #111; border-top: 3px solid #111; border-width: 0.35cqw; transform: rotate(45deg); }
.gcena-t-no::after { display: none; }
.gcena-key { color: #c62828; font-size: 1.18em; font-weight: 900; letter-spacing: 0.02em; -webkit-text-stroke: 0.06em #7f0000; paint-order: stroke fill; }
.gcena-ov { position: absolute; font-weight: 700; text-align: center; line-height: 1.5; color: #111; font-family: var(--gb-font-gibi); }
.gcena-ov-lousa { background: #2e5d43; color: #fff; border: 4px solid #143423; border-width: 0.45cqw; border-radius: 10px; border-radius: 1.2cqw; padding: 10px; padding: 1.4cqw; font-size: 16px; font-size: 2.9cqw; text-shadow: 1px 1px 0 rgba(0,0,0,.35); }
.gcena-ov-placa { background: #fdf6dd; border: 3px solid #111; border-width: 0.35cqw; border-radius: 9px; border-radius: 1.2cqw; padding: 9px; padding: 1.2cqw; font-size: 14px; font-size: 2.5cqw; }
.gcena-ov-poster { background: #fffdf4; border: 3px solid #111; border-width: 0.35cqw; border-radius: 8px; border-radius: 1cqw; padding: 12px; padding: 1.6cqw; font-size: 15px; font-size: 2.7cqw; line-height: 1.7; }
.gcena-ov-selo { background: rgba(255,255,255,.92); border: 4px solid #2e7d32; border-width: 0.5cqw; color: #2e7d32; border-radius: 9px; border-radius: 1.2cqw; font-family: var(--gb-font-pow); font-size: 24px; font-size: 4.2cqw; padding: 7px 14px; padding: 1cqw 2cqw; transform: rotate(-7deg); letter-spacing: 1px; }
.gcena-ov-titulo { background: none; font-family: var(--gb-font-pow); text-transform: uppercase; font-size: 48px; font-size: 9cqw; color: #ffc107; line-height: 1.1; letter-spacing: 2px; text-shadow: -3px -3px 0 #111, 3px -3px 0 #111, -3px 3px 0 #111, 3px 3px 0 #111, 0 6px 0 #111; }
.gcena-ov-titulo div + div { font-size: 46%; color: #fff; margin-top: 4px; }
.gcena-sfx { position: absolute; right: 5%; top: 56%; font-family: var(--gb-font-pow); color: #ffc107; font-size: 34px; font-size: 6cqw; letter-spacing: 1px; transform: rotate(-8deg); text-shadow: -2px -2px 0 #111, 2px -2px 0 #111, -2px 2px 0 #111, 2px 2px 0 #111; }

/* ================================================================= */
/* RESPONSIVO                                                        */
/* ================================================================= */
@media (max-width: 1100px) {
    .gb-faixa__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .gb-passos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .gb-hero__grid { grid-template-columns: minmax(0, 1fr); }
    .gb-stage { max-width: 30rem; padding-top: 2.5rem; }
    .gb-elenco, .gb-folhas, .gb-portas, .gb-demo, .gb-inst { grid-template-columns: minmax(0, 1fr); }
    .gb-porta--wide { grid-template-columns: minmax(0, 1fr); }
    .gb-cta__grid { grid-template-columns: minmax(0, 1fr); }
    .gb-cta__capa { max-width: 14rem; margin: 0 auto; transform: rotate(2deg); }
}
@media (max-width: 640px) {
    .gb-sec { padding: 3.5rem 0; }
    .gb-hero { padding: 3rem 0 3.5rem; }
    .gb-hero__acoes .gb-btn, .gb-cta__acoes .gb-btn, .gb-fim__acoes .gb-btn { width: 100%; }
    .gb-faixa__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gb-passos { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .gb-pers { grid-template-columns: minmax(0, 1fr); }
    .gb-pers img { max-width: 11rem; margin: 0 auto; }
    .gb-porta { grid-template-columns: minmax(0, 1fr); }
    .gb-porta img { max-width: 8rem; margin: 0 auto; }
    .gb-stage__selo { font-size: .9rem; }
    .gb-inst__img { transform: none; }
}

/* ================================================================= */
/* MOVIMENTO DESLIGADO — estado final legivel                        */
/* ================================================================= */
@media (prefers-reduced-motion: reduce) {
    .gb-panel, .gb-pers img, .gb-porta img, .gb-cta__capa { animation: none; }
    .gb-stage__balao, .gb-stage__sfx, .gb-stage__selo { animation: none; opacity: 1; scale: 1; }
    .gb-js .gb-rv { opacity: 1; transform: none; transition: none; }
    .gb-js .is-in .gb-curva__rev, .gb-curva__rev { animation: none; stroke-dashoffset: 0; }
    .gb-btn:hover, .gb-gibi:hover { transform: none; }
    .gb-gibi:hover .gb-gibi__capa img { transform: none; }
    html { scroll-behavior: auto; }
}
