/* K-Invest Brand Kit 3.0 — versão web (brand/index.html). Assenta em tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink-body); font: 400 var(--fs-body)/1.625 var(--font-brand); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 700; letter-spacing: -.015em; text-wrap: balance; }
p, ul, ol, dl, figure, table { margin: 0; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dark :focus-visible, .dark:focus-visible { outline-color: var(--amarelo-k); }
.tab { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 50; padding: 12px 16px; background: var(--preto-k); color: var(--branco); font-weight: 600; }
.skip:focus { top: 16px; }

.wrap { width: 100%; max-width: calc(var(--content) + 2 * var(--page-pad)); margin-inline: auto; padding-inline: var(--page-pad); }
.eyebrow { margin: 0; font-size: var(--fs-eyebrow); font-weight: 600; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.k { display: block; width: var(--barra-k-largura); height: var(--barra-k-altura); background: var(--amarelo-k); }
.lead { max-width: 60ch; font-size: var(--fs-body-lg); line-height: 1.55; color: var(--ink-body); }
.muted { color: var(--ink-muted); }

/* ---------- Botões (componente Botao) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-h); padding: 0 20px; border: 1.5px solid transparent; border-radius: var(--radius-md); font: 600 var(--fs-cta)/20px var(--font-brand); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.btn-pri { background: var(--accent); color: var(--on-accent); }
.btn-pri:hover { background: var(--preto-k); color: var(--branco); }
.btn-sec { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-sec:hover { background: var(--ink); color: var(--bg); }
.dark .btn-sec { color: var(--branco); border-color: var(--branco); }
.dark .btn-sec:hover { background: var(--branco); color: var(--preto-k); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: var(--fs-small); }
.btns { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Cabeçalho */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 68px; }
.top-brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--ink); }
.top-brand img { width: 120px; height: auto; }
.top-brand span { padding-left: var(--space-3); border-left: 1px solid var(--line); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; }
.top-site { font-size: var(--fs-small); font-weight: 600; white-space: nowrap; }
@media (max-width: 479.98px) { .top-brand span { display: none; } }

/* ---------- Capa */
.hero { background: var(--preto-k); color: var(--branco); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-6) clamp(40px, 6vw, 128px); align-items: end; padding-block: var(--sec-y); }
.hero .eyebrow { color: #bdbdbd; }
.hero .k { margin: var(--space-3) 0 var(--space-4); }
.hero h1 { color: var(--branco); font-size: clamp(2.75rem, 1.6rem + 4.6vw, 6rem); font-weight: 800; line-height: .98; letter-spacing: -.03em; }
.hero h1 em { display: block; color: var(--amarelo-k); font-style: italic; }
.hero .lead { margin-top: var(--space-4); color: #d6d6d6; }
.hero .btns { margin-top: var(--space-5); }
.hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid var(--branco); }
.hero-facts div { padding: var(--space-3) var(--space-3) var(--space-3) 0; border-bottom: 1px solid #333; }
.hero-facts div:nth-child(even) { padding-left: var(--space-3); border-left: 1px solid #333; }
.hero-facts dt { font-size: var(--fs-small); color: #bdbdbd; }
.hero-facts dd { margin: 2px 0 0; color: var(--branco); font-size: var(--fs-h3); font-weight: 700; line-height: 1.3; }
.hero-facts dd b { color: var(--amarelo-k); }
@media (max-width: 899.98px) { .hero-in { grid-template-columns: minmax(0, 1fr); align-items: start; } }

/* ---------- Corpo: índice lateral + conteúdo */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 clamp(40px, 5vw, 96px); }
.toc { position: sticky; top: 68px; z-index: 10; margin-inline: calc(-1 * var(--page-pad)); padding: 0 var(--page-pad); background: var(--bg); border-bottom: 1px solid var(--line); }
.toc ol { display: flex; gap: var(--space-4); margin: 0; padding: 0; overflow-x: auto; list-style: none; scrollbar-width: none; counter-reset: toc; }
.toc ol::-webkit-scrollbar { display: none; }
.toc a { display: flex; align-items: center; min-height: 52px; border-bottom: 2px solid transparent; color: var(--ink-muted); font-size: var(--fs-small); font-weight: 600; text-decoration: none; white-space: nowrap; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--amarelo-k); }
@media (min-width: 1100px) {
    .layout { grid-template-columns: 220px minmax(0, 1fr); }
    .toc { top: 68px; align-self: start; margin: 0; padding: var(--space-6) 0; border: 0; background: none; }
    .toc ol { flex-direction: column; gap: 0; overflow: visible; border-left: 1px solid var(--line); }
    .toc li { counter-increment: toc; }
    .toc a { min-height: 40px; margin-left: -1px; padding-left: var(--space-3); border-bottom: 0; border-left: 2px solid transparent; }
    .toc a::before { content: counter(toc, decimal-leading-zero); width: 28px; flex: none; color: var(--ink-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
    .toc a[aria-current="true"] { border-left-color: var(--amarelo-k); }
}

/* ---------- Secções */
.sec { padding-block: var(--sec-y) 0; scroll-margin-top: 88px; }
.sec:last-child { padding-bottom: var(--sec-y); }
.sec-head { max-width: 760px; margin-bottom: var(--head-gap); }
.sec-head .eyebrow { margin-bottom: var(--space-2); }
.sec-head h2 { font-size: var(--fs-h1); line-height: 1.15; }
.sec-head p { margin-top: var(--space-3); }
.sub { margin: var(--space-6) 0 var(--space-4); font-size: var(--fs-h2); line-height: 1.2; }
.sub:first-child { margin-top: 0; }
.h3 { margin: 0 0 var(--space-2); font-size: var(--fs-h3); font-weight: 600; line-height: 1.3; }
.prose { max-width: 68ch; }
.prose > * + * { margin-top: var(--space-3); }
.list { padding-left: 1.2em; }
.list li + li { margin-top: var(--space-1); }

/* Grelhas genéricas */
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 260px)), 1fr)); }
.box { padding: var(--pad); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg); }
.box--grey { border-color: var(--surface); background: var(--surface); }

/* Tabelas: só a tabela desliza no telemóvel, nunca a página */
.table-wrap { overflow-x: auto; border-top: 2px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
th, td { padding: 12px var(--space-3) 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--ink); font-weight: 600; white-space: nowrap; }
td:first-child { color: var(--ink); font-weight: 600; }
.table-wrap table { min-width: 560px; }

/* As 10 regras */
.rules { display: grid; gap: 0 var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); margin: 0; padding: 0; list-style: none; counter-reset: rule; border-top: 2px solid var(--ink); }
.rules li { position: relative; padding: var(--space-4) 0 var(--space-4) 56px; border-bottom: 1px solid var(--line); counter-increment: rule; }
.rules li::before { content: counter(rule); position: absolute; left: 0; top: var(--space-4); display: grid; place-items: center; width: 36px; height: 36px; background: var(--preto-k); color: var(--branco); font-weight: 700; font-size: var(--fs-small); }
.rules strong { color: var(--ink); }

/* Pares usar / evitar, pode / não pode */
.pair { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.do, .dont { padding: var(--pad); border-top: 4px solid var(--ink); background: var(--surface); }
.dont { border-top-color: var(--erro); }
.do h3, .dont h3 { margin-bottom: var(--space-3); font-size: var(--fs-h3); }

/* Brand core */
.core { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); border-top: 2px solid var(--ink); border-left: 1px solid var(--line); }
.core div { padding: var(--space-4); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.core dt { font-size: var(--fs-small); font-weight: 600; color: var(--ink-muted); }
.core dd { margin: var(--space-1) 0 0; color: var(--ink); font-size: var(--fs-body-lg); line-height: 1.45; }

/* ---------- Logótipo */
.logos { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.logo-tile { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.logo-stage { display: grid; place-items: center; aspect-ratio: 16 / 10; padding: var(--space-5); background: var(--branco); }
.logo-stage.on-black { background: var(--preto-k); }
.logo-stage.on-yellow { background: var(--amarelo-k); }
.logo-stage img { width: min(240px, 80%); height: auto; }
.logo-stage img.mono { width: auto; height: auto; max-height: 64px; }
.logo-meta { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--line); }
.logo-meta strong { color: var(--ink); }
.logo-meta p { font-size: var(--fs-small); }
.logo-meta .btn { align-self: flex-start; margin-top: auto; }
.clear { position: relative; display: grid; place-items: center; padding: var(--space-6); background: var(--surface); }
.clear-box { position: relative; padding: 28px; outline: 1px dashed var(--line-strong); }
.clear-box img { width: 220px; }
.clear-note { margin-top: var(--space-3); font-size: var(--fs-small); color: var(--ink-muted); }

/* ---------- Cor */
.swatches { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
@media (min-width: 600px) { .swatches { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.sw { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.sw-chip { aspect-ratio: 3 / 2; display: flex; align-items: flex-end; padding: var(--space-3); font-weight: 700; }
.sw-body { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); font-size: var(--fs-small); }
.sw-body strong { color: var(--ink); font-size: var(--fs-body); }
.sw-body code { font: 500 var(--fs-small) var(--font-brand); color: var(--ink-muted); }
.copy { align-self: flex-start; margin-top: var(--space-2); padding: 0; border: 0; background: none; color: var(--ink); font: 600 var(--fs-small) var(--font-brand); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; min-height: var(--touch); }
.copy[data-done] { text-decoration: none; }
.ratio { display: flex; height: 64px; margin-top: var(--space-4); border: 1px solid var(--line); }
.ratio span { display: flex; align-items: flex-end; padding: 8px; font-size: var(--fs-caption); font-weight: 600; }
.combos { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.combo { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 72px; padding: var(--space-3) var(--space-4); border: 1px solid var(--line); font-weight: 700; }
.combo small { font-weight: 500; font-size: var(--fs-caption); }
.combo.no { position: relative; }
.combo.no::after { content: "Proibido"; position: absolute; right: -1px; top: -1px; padding: 2px 8px; background: var(--erro); color: var(--branco); font-size: var(--fs-caption); font-weight: 600; }

/* ---------- Tipografia */
.specimen { border-top: 2px solid var(--ink); }
.spec { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--space-2) var(--space-5); align-items: baseline; padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.spec-meta { font-size: var(--fs-small); color: var(--ink-muted); }
.spec-meta strong { display: block; color: var(--ink); }
.spec-sample { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 599.98px) { .spec { grid-template-columns: minmax(0, 1fr); } }
.t-display { font-size: var(--fs-display); line-height: 1.07; font-weight: 800; letter-spacing: -.02em; }
.t-display em { font-style: italic; }
.t-h1 { font-size: var(--fs-h1); line-height: 1.15; font-weight: 700; letter-spacing: -.015em; }
.t-h2 { font-size: var(--fs-h2); line-height: 1.21; font-weight: 700; letter-spacing: -.01em; }
.t-h3 { font-size: var(--fs-h3); line-height: 1.3; font-weight: 600; }
.t-eyebrow { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.t-body-lg { font-size: 18px; line-height: 28px; }
.t-body { font-size: 16px; line-height: 26px; }
.t-small { font-size: 14px; line-height: 22px; }
.t-caption { font-size: 12px; line-height: 18px; font-weight: 500; }
.t-price-lg { font-size: 32px; line-height: 36px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.t-price { font-size: 22px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.t-cta { font-size: 15px; line-height: 20px; font-weight: 600; }

/* ---------- Espaço e forma */
.scale { display: grid; gap: var(--space-2); }
.scale-row { display: grid; grid-template-columns: 96px 56px minmax(0, 1fr); align-items: center; gap: var(--space-3); font-size: var(--fs-small); }
.scale-row strong { color: var(--ink); }
.scale-bar { height: 16px; background: var(--preto-k); }
.radii { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.radius { display: grid; place-items: center; width: 120px; height: 88px; border: 2px solid var(--ink); font-size: var(--fs-small); font-weight: 600; color: var(--ink); }

/* ---------- Componentes (amostras visuais) */
.demo { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); padding: var(--pad); border: 1px solid var(--line); border-radius: var(--radius-md); }
.demo-cap { margin-top: var(--space-2); font-size: var(--fs-small); color: var(--ink-muted); }
.tag { display: inline-block; padding: 4px 8px; border-radius: var(--radius-sm); background: var(--inverse-bg); color: var(--inverse-ink); font: 600 12px/16px var(--font-brand); }
.tag--ex { color: var(--amarelo-k); }
.tag--sold { background: var(--accent); color: var(--on-accent); }
.tag--line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.card { position: relative; display: flex; flex-direction: column; flex: 1 1 260px; max-width: 360px; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--bg); }
.card:hover { box-shadow: var(--shadow-card); }
.card-ph { position: relative; aspect-ratio: 3 / 2; background: var(--surface); }
.card-ph img { width: 100%; height: 100%; object-fit: cover; }
.card-ph .tag { position: absolute; left: 12px; top: 12px; }
.card-b { display: flex; flex-direction: column; flex: 1; padding: var(--space-3); }
.card-b .eyebrow { margin-bottom: var(--space-1); }
.card-b h3 { margin: 0 0 var(--space-2); font-size: 18px; font-weight: 600; line-height: 1.33; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin: var(--space-1) 0 var(--space-3); font-size: var(--fs-small); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.card-foot span { font-size: var(--fs-caption); color: var(--ink-muted); }
.card-foot a { font-weight: 600; font-size: var(--fs-cta); }
.person { flex: 0 1 200px; }
.person-ph { aspect-ratio: 4 / 5; display: grid; place-items: center; background: var(--cinza-claro); color: var(--cinza-medio); font-size: var(--fs-small); }
.person h3 { margin-top: 12px; font-size: 18px; font-weight: 600; }
.person p { margin: 2px 0 12px; font-size: var(--fs-small); color: var(--ink-muted); }
.legal { padding: var(--space-3) var(--space-4); background: var(--surface); }
.legal p { font-size: 12px; line-height: 18px; color: var(--ink-muted); }
.legal p + p { margin-top: var(--space-1); }
.legal b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.cartela-demo { position: relative; width: 100%; max-width: 560px; aspect-ratio: 3 / 2; background: #4a4a4a; color: var(--branco); }
.cartela-demo img.photo { width: 100%; height: 100%; object-fit: cover; }
.cartela { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3); padding: var(--space-3) 20px; background: var(--preto-k); }
.cartela .eyebrow { margin-bottom: 4px; color: var(--amarelo-k); }
.cartela p.loc { color: var(--branco); font-size: 22px; font-weight: 700; line-height: 26px; }
.cartela img { width: 120px; height: auto; }
.field { display: grid; gap: 6px; width: 100%; max-width: 360px; }
.field label { color: var(--ink); font-size: var(--fs-small); font-weight: 600; }
.field input { min-height: var(--control-h); padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: 400 16px var(--font-brand); color: var(--ink); }
.field input:focus { border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: 0; }
.field .err { color: var(--erro); font-size: var(--fs-small); font-weight: 600; }

/* Checklist */
.check { display: grid; gap: 0; max-width: 820px; margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.check label { display: flex; gap: var(--space-3); align-items: flex-start; min-height: var(--touch); padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--preto-k); }

/* Downloads */
.dl { display: grid; gap: var(--space-2); max-width: 820px; margin: 0; padding: 0; list-style: none; }
.dl a { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); min-height: 56px; padding: 0 var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); font-weight: 600; text-decoration: none; }
.dl a:hover { border-color: var(--ink); }
.dl small { color: var(--ink-muted); font-weight: 500; }

/* ---------- Rodapé */
.foot { margin-top: var(--sec-y); padding-block: var(--space-7) var(--space-5); background: var(--preto-k); color: #dddddd; font-size: var(--fs-small); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-4); }
.foot img { width: 140px; }
.foot p { color: #dddddd; }
.foot a { color: var(--branco); }
.foot-legal { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid #2a2a2a; font-size: 12px; color: #9a9a9a; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
    .top, .toc, .btns, .copy { display: none !important; }
    .layout { grid-template-columns: 1fr; }
    .sec { break-inside: avoid-page; }
}
