:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --text: #1f1b16;
  --muted: #6b6258;
  --line: #e6dfd4;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fdeee4;
  --good: #15803d;
  --good-soft: #e8f5ec;
  --bad: #b91c1c;
  --bad-soft: #fbeaea;
  --shadow: 0 1px 2px rgba(31, 27, 22, .05), 0 8px 24px rgba(31, 27, 22, .06);
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f; --surface: #1e1a16; --surface-2: #27221d; --text: #f2ece4; --muted: #a89d90;
    --line: #362f28; --accent: #fb923c; --accent-ink: #1a0f06; --accent-soft: #3a2416;
    --good: #4ade80; --good-soft: #15291c; --bad: #f87171; --bad-soft: #351919;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15120f; --surface: #1e1a16; --surface-2: #27221d; --text: #f2ece4; --muted: #a89d90;
  --line: #362f28; --accent: #fb923c; --accent-ink: #1a0f06; --accent-soft: #3a2416;
  --good: #4ade80; --good-soft: #15291c; --bad: #f87171; --bad-soft: #351919;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: .2em 0 .6em; }
h3 { font-size: 1.2rem; margin: 0 0 .4em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; font-size: .9em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

/* Barra de progresso + topo */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-mark { color: var(--accent); }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: .95rem; }
.topnav a:not(.btn):hover { color: var(--text); }
.theme-toggle {
  background: none; border: 1px solid var(--line); color: var(--text); width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; font-size: 1.05rem;
}

/* Botões */
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; cursor: pointer;
  padding: 13px 22px; border-radius: 999px; font: 600 1rem var(--sans); text-decoration: none;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-sm { padding: 8px 16px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }

/* Hero */
.hero { padding: clamp(48px, 9vw, 110px) 0 56px; border-bottom: 1px solid var(--line); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--accent); margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); margin: 0 0 20px; max-width: 16ch; }
.hero h1 em { color: var(--accent); font-style: italic; }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 60ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 36px; }
.hero-stats { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px 32px; color: var(--muted); font-size: .95rem; }
.hero-stats strong { font-family: var(--serif); font-size: 1.6rem; color: var(--text); margin-right: 4px; }

/* Layout */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-top: 48px; }
.toc { position: sticky; top: 90px; align-self: start; font-size: .9rem; }
.toc-title { font-weight: 600; margin: 0 0 10px; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.content { max-width: 760px; min-width: 0; }
.chapter { padding: 8px 0 56px; }
.chapter-num { font-weight: 600; color: var(--accent); font-size: .85rem; letter-spacing: .08em; margin: 0; }
.chapter[data-tool] .chapter-num::before { content: "◆ "; }
.note { color: var(--muted); font-size: .9rem; }
.sub { margin-top: 32px; }

/* Camadas */
.layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.layer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.layer:nth-child(2) { background: var(--accent-soft); }
.layer:nth-child(3) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.layer p { margin: 0; font-size: .95rem; }
.layer-tag { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }

/* Ferramentas */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin: 24px 0; }
.quiz-q { font-weight: 600; font-size: 1.1rem; margin: 0 0 14px; }
.quiz-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quiz-opts button {
  text-align: left; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 12px; padding: 14px;
  color: var(--text); font: 500 .95rem/1.4 var(--sans); cursor: pointer;
}
.quiz-opts button:hover { border-color: var(--accent); }
.quiz-opts small { color: var(--muted); }
.quiz-label { margin: 0; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.quiz-model { font-family: var(--serif); font-size: 2rem; color: var(--accent); margin: 4px 0 8px; }
.models { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.models div { border-top: 3px solid var(--accent); padding-top: 10px; }
.models strong { display: block; font-family: var(--serif); font-size: 1.1rem; }
.models span { font-size: .88rem; color: var(--muted); }

.builder { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.builder-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
.builder-form textarea, .builder-form input:not([type="checkbox"]), .search, #lead-form input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: 400 .95rem/1.5 var(--sans); resize: vertical;
}
.builder-form textarea:focus, .builder-form input:focus, .search:focus, #lead-form input:focus { outline: none; border-color: var(--accent); }
.builder-form .check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.builder-out { display: flex; flex-direction: column; gap: 10px; }
.builder-out .prompt-box { flex: 1; min-height: 200px; }
.out-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.score { font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--bad-soft); color: var(--bad); }
.score[data-level="mid"] { background: var(--accent-soft); color: var(--accent); }
.score[data-level="high"] { background: var(--good-soft); color: var(--good); }
.prompt-box {
  margin: 0; white-space: pre-wrap; word-wrap: break-word; background: var(--surface-2); border-radius: 10px; padding: 14px;
  font: 400 .9rem/1.6 ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--text);
}
.prompt-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.prompt-card .copy { align-self: flex-start; }
.chapter > .prompt-card { margin: 20px 0; }

.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 16px 20px; border-radius: 0 12px 12px 0; }

/* Cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card p { margin: 0 0 8px; font-size: .95rem; }
.card-tip { color: var(--muted); font-size: .88rem !important; }

.compare { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; margin: 20px 0; }
.compare > div { border-radius: var(--radius); padding: 16px 18px; }
.compare p { margin: 0; }
.compare-bad { background: var(--bad-soft); }
.compare-good { background: var(--good-soft); }
.compare-label { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px !important; }
.compare-bad .compare-label { color: var(--bad); }
.compare-good .compare-label { color: var(--good); }

.steps { padding-left: 1.2em; }
.steps li { margin-bottom: 10px; }

/* Biblioteca */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 14px; cursor: pointer; font: 500 .88rem var(--sans); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.search { margin-bottom: 16px; }
.library { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tag { font-size: .72rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* Plano */
.plan-progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.plan-progress span { display: block; height: 100%; width: 0; background: var(--good); transition: width .3s ease; }
.plan-count { font-size: .9rem; color: var(--muted); margin: 6px 0 14px; }
.plan { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plan label { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; }
.plan input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--good); flex-shrink: 0; }
.plan input:checked + span { color: var(--muted); text-decoration: line-through; }
.plan-done { background: var(--good-soft); color: var(--good); padding: 14px; border-radius: 12px; font-weight: 600; }

/* Lead */
.lead-box {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; margin: 8px 0 64px;
  background: var(--text); color: var(--bg); border-radius: 20px; padding: clamp(24px, 4vw, 40px);
}
.lead-box h2 { color: var(--bg); }
.lead-box p { opacity: .85; }
.lead-box .eyebrow { color: var(--accent); opacity: 1; }
#lead-form { display: grid; gap: 10px; }
#lead-form input { margin: 0; background: var(--bg); }
.form-msg { margin: 0; font-size: .9rem; min-height: 1.2em; }
.form-msg.err { color: #fca5a5; }
.form-fine { margin: 0; font-size: .8rem; opacity: .6 !important; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); margin: 10px 0 0; }

/* Produto + rodapé */
.product { text-align: center; padding: 48px 24px; margin-bottom: 64px; border: 2px dashed var(--line); border-radius: 20px; }
.product p { color: var(--muted); max-width: 52ch; margin: 0 auto 16px; }
.product .price { font-weight: 600; color: var(--text); }
.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer p { margin: 4px 0; }
.footer .fine { font-size: .8rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .9rem;
  transition: all .2s ease; z-index: 70;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Responsivo */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .content { max-width: none; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .topnav a:not(.btn) { display: none; }
  .layers, .quiz-opts, .cards, .builder, .compare, .library, .lead-box { grid-template-columns: 1fr; }
  .models { grid-template-columns: 1fr 1fr; }
  .tool { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ============================================================
   Hub (página inicial), biblioteca e páginas de apoio
   ============================================================ */
.paper {
  background-color: var(--bg);
  background-image: repeating-linear-gradient(to bottom, transparent 0 35px, var(--line) 35px 36px);
}
.strip {
  display: block; text-align: center; background: var(--text); color: var(--bg); text-decoration: none;
  padding: 9px 16px; font-size: .88rem; font-weight: 600;
}
.strip span { color: #fb923c; margin-left: 6px; }
.hub-hero { padding: clamp(40px, 8vw, 96px) 0; border-bottom: 1px solid var(--line); }
.hub-hero h1 { font-size: clamp(2.4rem, 6.5vw, 4.4rem); margin: 0 0 20px; }
.hub-hero h1 em { color: var(--accent); font-style: italic; }
.hub-hero-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 32px; align-items: center; }
.hub-mascote { position: relative; display: flex; justify-content: center; }
.stamp-big {
  position: absolute; top: -10px; left: 0; width: 120px; height: 120px; border-radius: 50%;
  border: 4px solid var(--accent); color: var(--accent); display: flex; flex-direction: column; align-items: center;
  justify-content: center; transform: rotate(-14deg); font-weight: 800; font-size: .7rem; letter-spacing: .14em;
  background: var(--bg);
}
.stamp-big .ck { font-size: 2.2rem; line-height: 1; letter-spacing: 0; }

.numbers { background: var(--accent); color: #fff; }
.numbers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 26px 16px; }
.numbers-grid div { display: flex; align-items: baseline; gap: 10px; }
.numbers-grid strong { font-family: var(--serif); font-size: 2.4rem; line-height: 1; }
.numbers-grid span { font-size: .92rem; opacity: .92; }

.hub-section { padding: clamp(48px, 8vw, 88px) 16px; }
.hub-section h2 { margin-bottom: .3em; }
.hub-sub { color: var(--muted); margin: 0 0 28px; }
.center { text-align: center; margin-top: 28px; }

.paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.path {
  position: relative; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 2px solid var(--text); border-radius: 18px; padding: 24px;
  box-shadow: 6px 6px 0 var(--text); transition: transform .15s ease, box-shadow .15s ease;
}
.path:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--accent); }
.path h3 { margin: 0; font-size: 1.35rem; }
.path p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.path-num { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--accent); }
.path-tag { position: absolute; top: 18px; right: 18px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--accent-soft); color: var(--accent); padding: 3px 10px; border-radius: 999px; }
.path-go { font-weight: 700; color: var(--accent); }
.path-dark { background: var(--text); color: var(--bg); }
.path-dark p { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.path-dark .path-num, .path-dark .path-go { color: #fb923c; }
.path-dark .path-tag { background: #fb923c; color: #1f1b16; }

.posts-section { background: var(--surface-2); }
.posts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.posts-grid img { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: var(--shadow); transition: transform .15s ease; }
.posts-grid a:hover img { transform: translateY(-3px); }

.turma {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: start;
  background: var(--text); color: var(--bg); border-radius: 24px; padding: clamp(24px, 5vw, 48px);
}
.turma h2 { color: var(--bg); }
.turma .eyebrow { color: #fb923c; }
.turma .note { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.turma-list { padding-left: 1.1em; margin: 0 0 16px; }
.turma-list li { margin-bottom: 8px; }
.turma-form { display: grid; gap: 12px; background: var(--bg); color: var(--text); border-radius: 18px; padding: 22px; }
.turma-form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.turma-form input, .turma-form select {
  padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--text); font: 400 .95rem var(--sans);
}
.turma-form input:focus, .turma-form select:focus { outline: none; border-color: var(--accent); }
.turma-form .form-msg.err { color: var(--bad); }
.turma-form .form-fine { color: var(--muted); }

.about { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: center; }
.about-mascote { display: flex; justify-content: center; }

.lib-hero { padding: clamp(36px, 6vw, 64px) 0; }
.lib-main { padding-top: 32px; padding-bottom: 64px; }
.lib-tools { position: sticky; top: 61px; z-index: 5; background: var(--bg); padding: 12px 0 4px; }
.library-3 { grid-template-columns: repeat(3, 1fr); }
.lib-cta { display: flex; gap: 24px; align-items: center; margin-top: 48px; padding: 28px; border: 2px dashed var(--line); border-radius: 20px; }
.lib-cta h2 { margin: 0 0 6px; font-size: 1.5rem; }
.lib-cta p { margin: 0 0 14px; color: var(--muted); }

@media (max-width: 960px) {
  .paths, .library-3 { grid-template-columns: 1fr 1fr; }
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .numbers-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .hub-hero-grid, .turma, .about, .paths, .library-3 { grid-template-columns: 1fr; }
  .hub-mascote { display: none; }
  .about-mascote svg { width: 150px; height: 150px; }
  .lib-cta { flex-direction: column; text-align: center; }
  .lib-tools { top: 0; position: static; }
}
