/* Blog do CLAP — folha única, gerada à mão (não passa pelo Vite).
   Tokens = os mesmos da landing (clap-landing/src/styles/tokens.css).
   Fontes self-hosted de /fonts/ — a CSP não deixa falar com o CDN. */

@font-face { font-family: 'Syne'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/fonts/syne-400-800-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Syne'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/fonts/syne-400-800-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/fonts/space-grotesk-300-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/dm-mono-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/dm-mono-500-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }

:root {
  --bg: #0a0a0b;
  --surface: #111113;
  --surface2: #18181c;
  --border: #222228;
  --border2: #2e2e38;
  --text: #f0f0f2;
  --body: #c9c9d1;
  --muted: #8a8a96;
  --accent: #e8ff47;
  --accent-dim: #e8ff4714;
  --accent-line: #e8ff4740;
  --accent-ink: #e8ff47;          /* acento usado como TEXTO/traço — no claro escurece */
  --on-accent: #0a0a0b;
  --glass: #0a0a0bd1;
  --cta-glow: #e8ff4722;
  --font-display: 'Syne', system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;
  --font-currency: 'Space Grotesk', system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --measure: 700px;
  color-scheme: dark;
}

/* Tema claro: segue o sistema, a não ser que o leitor tenha escolhido no botão.
   theme.js grava data-theme no <html> antes da pintura. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f7f4; --surface: #ffffff; --surface2: #efefea; --border: #e3e3dc; --border2: #d2d2ca;
    --text: #0d0d10; --body: #3b3b44; --muted: #6b6b76;
    --accent-dim: #e8ff4733; --accent-line: #b7cc1c; --accent-ink: #5f7000;
    --glass: #f7f7f4d9; --cta-glow: #e8ff4766;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f7f7f4; --surface: #ffffff; --surface2: #efefea; --border: #e3e3dc; --border2: #d2d2ca;
  --text: #0d0d10; --body: #3b3b44; --muted: #6b6b76;
  --accent-dim: #e8ff4733; --accent-line: #b7cc1c; --accent-ink: #5f7000;
  --glass: #f7f7f4d9; --cta-glow: #e8ff4766;
  color-scheme: light;
}

/* Logo: branca no escuro, versão escura no claro */
.logo-light { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .logo-dark { display: none; }
  :root:not([data-theme="dark"]) .logo-light { display: block; }
}
:root[data-theme="light"] .logo-dark { display: none; }
:root[data-theme="light"] .logo-light { display: block; }
:root[data-theme="dark"] .logo-dark { display: block; }
:root[data-theme="dark"] .logo-light { display: none; }

/* Botão de tema */
.theme-btn {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--border2);
  background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; flex-shrink: 0; transition: border-color .2s ease;
}
.theme-btn svg { width: 17px; height: 17px; }
.theme-btn .i-sun { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-btn .i-moon { display: none; }
}
:root[data-theme="light"] .theme-btn .i-sun { display: block; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: block; }
@media (hover: hover) { .theme-btn:hover { border-color: var(--muted); } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--accent); color: #000; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ── Topo ───────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 26px; width: auto; }
.brand-tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
  padding-left: 12px; border-left: 1px solid var(--border2);
}
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top-link {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 999px;
  transition: color .2s ease;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  text-decoration: none; white-space: nowrap;
  padding: 11px 20px; border-radius: 999px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 24px #e8ff472e; }
.btn-ghost { border: 1px solid var(--border2); color: var(--text); }
@media (hover: hover) {
  .top-link:hover { color: var(--text); }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 32px #e8ff4747; }
  .btn-ghost:hover { border-color: var(--muted); }
  .card:hover { border-color: var(--border2); transform: translateY(-2px); }
  .card:hover .card-img img { transform: scale(1.03); }
  .prose a:not(.btn):hover { text-decoration-color: var(--accent-ink); }
}
@media (max-width: 560px) {
  .brand-tag, .top-link { display: none; }
  .top .btn { padding: 9px 16px; font-size: 13px; }
}

/* ── Rótulos ────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent-ink);
}
.meta {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
  color: var(--muted); text-transform: uppercase;
}
.meta span + span::before { content: '·'; margin: 0 10px; color: var(--border2); }

/* ── Índice do blog ─────────────────────────────── */
.blog-hero { padding: 88px 0 48px; }
.blog-hero h1 {
  font-size: clamp(38px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -.03em;
  font-weight: 600; margin: 16px 0 20px; max-width: 16ch;
}
.blog-hero h1 em { font-style: normal; color: var(--accent-ink); }
.blog-hero p { font-family: var(--font-mono); color: var(--muted); font-size: 15px; max-width: 54ch; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; padding-bottom: 96px; }
.card {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  transition: border-color .25s ease, transform .35s var(--ease);
}
.card-img { aspect-ratio: 1200 / 630; overflow: hidden; background: var(--surface2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h2 { font-size: 20px; line-height: 1.25; letter-spacing: -.01em; margin: 0; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.card .meta { margin-top: auto; padding-top: 8px; }
@media (max-width: 400px) { .grid { grid-template-columns: 1fr; } }

/* ── Post ───────────────────────────────────────── */
.post-head { max-width: 900px; margin: 0 auto; padding: 72px 24px 36px; }
.crumbs { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.post-head h1 {
  font-size: clamp(32px, 4.8vw, 54px); line-height: 1.08; letter-spacing: -.025em;
  font-weight: 600; margin: 20px 0 20px;
}
.post-head .lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--body); line-height: 1.55; margin: 0 0 28px; max-width: 60ch; }

.byline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.byline img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border2); }
.byline strong { font-weight: 700; font-size: 15px; display: block; }

.post-cover { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.post-cover figure { margin: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); }
.post-cover img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.post-cover figcaption, .prose figcaption {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--muted);
  padding: 10px 2px 0; background: var(--bg);
}

.post-layout { max-width: 1120px; margin: 0 auto; padding: 56px 24px 32px; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 64px; }
@media (max-width: 960px) { .post-layout { grid-template-columns: minmax(0, 1fr); gap: 0; } .toc { display: none; } }

/* Sumário lateral */
.toc { position: sticky; top: 96px; align-self: start; }
.toc .eyebrow { color: var(--muted); display: block; margin-bottom: 14px; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.toc a {
  display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 1px solid transparent;
  font-size: 14px; line-height: 1.35; color: var(--muted); text-decoration: none;
}
.toc a:hover { color: var(--text); border-left-color: var(--accent-ink); }

/* Corpo do texto */
.prose { max-width: var(--measure); font-size: 18px; line-height: 1.75; color: var(--body); }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose h2 {
  color: var(--text); font-size: clamp(24px, 2.6vw, 30px); line-height: 1.18; letter-spacing: -.015em;
  font-weight: 600; margin: 2.2em 0 .2em; scroll-margin-top: 96px;
}
.prose h3 { color: var(--text); font-size: 20px; line-height: 1.3; font-weight: 600; margin: 1.8em 0 0; }
.prose strong { color: var(--text); font-weight: 700; }
.prose a:not(.btn) { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 4px; text-decoration-thickness: 1.5px; transition: text-decoration-color .2s ease; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--accent-ink); }
.prose .money, .money { font-family: var(--font-currency); font-weight: 600; color: var(--text); white-space: nowrap; letter-spacing: -.01em; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: 14px; border: 1px solid var(--border); width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* Resposta curta (é o trecho que o Google recorta) */
.answer {
  background: var(--accent-dim); border: 1px solid var(--accent-line); border-radius: 18px;
  padding: 24px 26px; color: var(--text);
}
.answer .eyebrow { display: block; margin-bottom: 10px; }
.answer p { font-size: 18px; line-height: 1.6; }
.answer p + p { margin-top: .7em; }

/* Caixa "na prática" */
.note {
  border-left: 2px solid var(--accent-ink); padding: 4px 0 4px 22px; color: var(--text);
  font-size: 19px; line-height: 1.6;
}
.note .eyebrow { display: block; font-size: 11px; margin-bottom: 6px; }

/* Tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; min-width: 520px; }
.prose th {
  text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); background: var(--surface); padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.prose td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--text); }

/* Print real do CLAP: não corta, e o de celular fica estreito */
.prose figure.shot img { aspect-ratio: auto; object-fit: contain; background: #0a0a0b; }
.prose figure.shot.phone img { max-width: 340px; margin: 0 auto; border-radius: 22px; border: 1px solid var(--border2); box-shadow: 0 24px 60px #00000055; }
.prose figure.shot.phone figcaption { text-align: center; max-width: 420px; margin: 0 auto; }

/* Tabela comparativa */
.prose table.cmp { min-width: 640px; }
.cmp th:not(:first-child), .cmp td:not(:first-child) { text-align: center; }
.cmp th:last-child, .cmp td:last-child { background: var(--accent-dim); color: var(--text); }
.cmp th:last-child { color: var(--accent-ink); font-weight: 500; }
.cmp td.y { color: var(--accent-ink); font-weight: 700; font-size: 17px; }
.cmp td.p { color: var(--body); }
.cmp td.n { color: var(--border2); }
.cmp td:first-child { position: sticky; left: 0; background: var(--bg); z-index: 1; min-width: 170px; }
.cmp th:first-child { position: sticky; left: 0; z-index: 2; }

/* A conta passo a passo */
.calc { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.calc-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--border); font-size: 16px; }
.calc-row:last-child { border-bottom: 0; }
.calc-row .money { flex-shrink: 0; }
.calc-row.total { background: var(--accent-dim); color: var(--text); font-weight: 700; }
.calc-row.total .money { color: var(--accent-ink); font-size: 20px; }
.calc-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 14px 22px 0; }

/* Passos numerados */
.steps { list-style: none; padding: 0 !important; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px 18px 64px; margin: 0 !important; }
.steps li::before {
  content: counter(s, decimal-leading-zero); position: absolute; left: 20px; top: 18px;
  font-family: var(--font-mono); font-size: 13px; color: var(--accent-ink); letter-spacing: .06em;
}
.steps strong { display: block; margin-bottom: 2px; }

/* Perguntas frequentes */
.faq details { border-bottom: 1px solid var(--border); padding: 4px 0; }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 40px 18px 0; position: relative;
  color: var(--text); font-weight: 700; font-size: 18px; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 14px; font-family: var(--font-mono); font-size: 22px; color: var(--accent-ink); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 18px; }

/* Chamada pro CLAP */
.cta {
  margin: 56px 0 0; padding: 36px 32px; border-radius: 22px;
  background: radial-gradient(120% 140% at 100% 0%, var(--cta-glow) 0%, transparent 55%), var(--surface);
  border: 1px solid var(--border2);
}
.cta h2 { margin: 0 0 10px !important; font-size: clamp(22px, 2.6vw, 28px) !important; }
.cta .btn { text-decoration: none; }
.cta p { color: var(--body); margin: 0 0 22px; }
.cta .row { display: flex; gap: 10px; flex-wrap: wrap; }
.cta .fine { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin: 14px 0 0; }

/* Autor */
.author {
  display: grid; grid-template-columns: 72px 1fr; gap: 18px; align-items: start;
  margin: 56px 0 0; padding: 26px 0 0; border-top: 1px solid var(--border);
}
.author img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border2); }
.author .eyebrow { color: var(--muted); font-size: 11px; }
.author strong { display: block; color: var(--text); font-size: 18px; margin: 2px 0 6px; }
.author p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--body); }

.sources { margin-top: 40px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); line-height: 1.7; }
.sources strong { color: var(--text); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; font-size: 11px; }
.sources a { color: var(--muted); }

/* Leia também */
.related { margin-top: 48px; }
.related > .eyebrow { display: block; margin-bottom: 14px; color: var(--muted); }
.related-list { display: grid; gap: 10px; }
.related-list a {
  display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; text-decoration: none !important;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; transition: border-color .2s ease;
}
.related-list img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; }
.related-list span { color: var(--text); font-weight: 600; font-size: 16px; line-height: 1.3; }
.related-list em { display: block; font-style: normal; font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 4px; }
@media (hover: hover) { .related-list a:hover { border-color: var(--border2); } }

/* ── Rodapé ─────────────────────────────────────── */
.foot { border-top: 1px solid var(--border); margin-top: 64px; }
.foot .wrap { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 32px; padding-bottom: 40px; }
.foot p { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

@media (max-width: 640px) {
  .wrap, .post-head, .post-cover, .post-layout { padding-left: 16px; padding-right: 16px; }
  .post-head { padding-top: 44px; }
  .post-cover img { aspect-ratio: 4 / 3; }
  .post-layout { padding-top: 36px; }
  .prose { font-size: 17px; }
  .cta { padding: 28px 22px; }
  .blog-hero { padding: 56px 0 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
