/*
 * Tema comum do site (página inicial e HüberClaude): tokens, tipografia, topo,
 * botões, seções, cards e rodapé. Cada página carrega esta folha e depois a sua
 * (home.css, huberclaude.css), só com o que é dela. Fica num arquivo porque a CSP
 * do CloudFront aceita folhas da mesma origem (style-src 'self'), mas não <style>.
 * Um tema só, claro.
 */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/assets/fonts/inter-latin-wght.woff2') format('woff2');
}

:root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #f6f8fb;
    --card: #ffffff;
    --line: #e4e8ef;
    --line-strong: #cfd6e1;
    --text: #0f1b2d;
    --muted: #4a5568;
    --dim: #6b7486;
    --primary: #1f4fd1;
    --primary-hover: #183fa8;
    --primary-soft: #eef3ff;
    --on-primary: #ffffff;
    --accent: #0f766e;
    --accent-soft: #e7f6f4;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.06);
    --shadow: 0 1px 2px rgba(15, 27, 45, 0.05), 0 8px 24px -12px rgba(15, 27, 45, 0.18);
    --code-bg: #0f1b2d;
    --code-text: #d7e3f4;
    --radius: 12px;
    --radius-sm: 8px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
code { font-family: var(--mono); }
h1, h2, h3 { color: var(--text); letter-spacing: -0.02em; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--dim); font-weight: 400; }

/* ---------- Topo ---------- */
.topnav { position: sticky; top: 0; z-index: 30; background: var(--nav-bg); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topnav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.logo img { display: block; width: 30px; height: 30px; border-radius: 7px; }
.logo-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: var(--on-primary); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.02em; }
.logo-dim { color: var(--dim); font-weight: 500; }
.topnav-links { display: flex; align-items: center; gap: 2px; }
.topnav-links > a:not(.btn) { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--muted); font-size: 0.92rem; font-weight: 500; text-decoration: none; }
.topnav-links > a:not(.btn):hover { color: var(--text); background: var(--surface); }
.topnav-tools { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--line); }

/* Barra de atalhos dos projetos, logo abaixo do topo */
.subnav { border-bottom: 1px solid var(--line); background: var(--surface); }
.subnav-inner { display: flex; align-items: center; gap: 6px 18px; min-height: 44px; overflow-x: auto; scrollbar-width: none; font-size: 0.86rem; white-space: nowrap; }
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav-label { color: var(--dim); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.subnav a { color: var(--muted); font-weight: 500; text-decoration: none; }
.subnav a:hover { color: var(--primary); }
.subnav a.is-featured { color: var(--primary); font-weight: 600; }

/* Idioma */
.lang { display: inline-flex; gap: 4px; }
.lang button {
    display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--muted); cursor: pointer;
}
.lang button { opacity: 0.6; }
.lang button img { display: block; width: 20px; height: 14px; border-radius: 2px; }
.lang button:hover { opacity: 1; border-color: var(--line-strong); color: var(--text); }
.lang button[aria-pressed="true"] { opacity: 1; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px;
    border: 1px solid transparent; border-radius: var(--radius-sm); font: inherit; font-size: 0.95rem; font-weight: 600;
    line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--card); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 8px 14px; font-size: 0.88rem; }

/* ---------- Seções ---------- */
.section { padding: 88px 0 0; }
.section-alt { margin-top: 88px; padding: 80px 0; background: var(--surface); border-block: 1px solid var(--line); }
.section-alt + .section { padding-top: 80px; }
.eyebrow { display: inline-block; margin: 0 0 10px; color: var(--primary); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.section-title, .section h2 { margin: 0 0 12px; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; line-height: 1.2; }
.section-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.section-title .muted { font-size: 1rem; }
.section-lead { max-width: 68ch; margin: 0 0 36px; color: var(--muted); font-size: 1.05rem; }
.section-head { margin-bottom: 36px; }
.section-head .section-lead { margin-bottom: 0; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .2s; }
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; font-size: 1.06rem; font-weight: 650; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; overflow-wrap: anywhere; }
.icon-tile { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; margin-bottom: 16px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.icon-tile svg { width: 22px; height: 22px; }
.icon-tile img { display: block; width: 44px; height: 44px; border-radius: 10px; }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-soon { background: var(--surface); color: var(--dim); }

.link { color: var(--primary); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- Faixa de contato e rodapé ---------- */
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; margin-top: 96px; padding: 40px 44px; border-radius: 16px; background: var(--code-bg); color: #fff; }
.cta h2 { margin: 0 0 6px; color: #fff; font-size: 1.6rem; }
.cta p { margin: 0; color: #b9c6da; }
.cta .btn-primary { background: #fff; color: #0f1b2d; }
.cta .btn-primary:hover { background: #e8eefa; }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 72px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--dim); font-size: 0.86rem; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--primary); }

@media (max-width: 960px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topnav-links > a:not(.btn) { display: none; }
}
@media (max-width: 640px) {
    .wrap { width: calc(100% - 32px); }
    .grid { grid-template-columns: minmax(0, 1fr); }
    .topnav-inner { height: 60px; gap: 10px; }
    .topnav-tools { margin-left: 4px; padding-left: 6px; border-left: 0; }
    .lang button { width: 30px; height: 30px; }
    .section { padding-top: 64px; }
    .section-alt { margin-top: 64px; padding: 56px 0; }
    .cta { padding: 28px 24px; }
    .cta .btn { width: 100%; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
