/* ==========================================================
   Componentes compartilhados
   ========================================================== */

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-family: var(--font-title); font-weight: 600; font-size: .95rem; line-height: 1;
  padding: .95em 1.6em; border-radius: 999px; white-space: nowrap;
  transition: background-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease), color .2s;
}
.btn .icon { width: 1.1em; height: 1.1em; transition: transform .2s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 8px 20px rgba(21, 112, 239, .32); }
.btn-primary:hover { background: #0F62D6; box-shadow: 0 10px 26px rgba(21, 112, 239, .42); transform: translateY(-1px); }
.btn-sm { font-size: .875rem; padding: .78em 1.35em; }
.btn-outline { border: 1.5px solid var(--blue-600); color: var(--blue-600); background: #fff; }
.btn-outline:hover { background: var(--blue-50); }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  color: #fff; transition: background-color .2s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn .icon { width: 20px; height: 20px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .4em; font-family: var(--font-title);
  font-weight: 600; font-size: .95rem; color: var(--blue-600);
}
.link-arrow .icon { width: 1.1em; height: 1.1em; transition: transform .2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Chips / selos ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .35em;
  font-size: .75rem; font-weight: 600; line-height: 1;
  padding: .5em .8em; border-radius: 999px;
  background: var(--blue-50); color: var(--blue-600);
}
.chip-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-verde  { background: var(--green-50); color: var(--green-600); }
.chip-azul   { background: var(--blue-50);  color: var(--blue-600); }
.chip-ambar  { background: var(--amber-50); color: var(--amber-600); }
.chip-neutro { background: var(--gray-50);  color: var(--gray-600); }
.chip-demo   { background: #FFF1D6; color: #8A5300; }

/* ---------- Aviso de modo demonstração ---------- */
.demo-banner {
  background: #FFF1D6; color: #6B4100; font-size: .8125rem; line-height: 1.4;
  text-align: center; padding: 8px var(--gutter);
  border-bottom: 1px solid #F4D9A6;
}
.demo-banner strong { font-weight: 700; }

/* ---------- Logo ---------- */
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { height: 62px; width: auto; }
.logo-fallback {
  display: inline-flex; flex-direction: column; line-height: .95;
  font-family: var(--font-title); font-weight: 800; letter-spacing: .02em;
  font-size: 1.35rem; color: #fff;
}
.logo-fallback small { font-size: .8em; font-weight: 700; letter-spacing: .14em; }
.logo-fallback.on-light { color: var(--ink); }

/* ---------- Cabeçalho ---------- */
.site-header { position: relative; z-index: 20; color: #fff; }
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 92px;
}
.main-nav ul { display: flex; align-items: center; gap: 36px; }
.main-nav a {
  position: relative; font-size: .9375rem; font-weight: 500; color: rgba(255, 255, 255, .9);
  padding: 8px 0; transition: color .2s;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--blue-400); transform: scaleX(0); transition: transform .25s var(--ease);
}
.main-nav a:hover { color: #fff; }
.main-nav a:hover::after { transform: scaleX(1); }
.main-nav a[aria-current="page"] { color: #fff; font-weight: 600; }
.header-nav-group { display: flex; align-items: center; gap: 28px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.menu-toggle { display: none; }

/* Busca rápida (abre abaixo do cabeçalho) */
.header-search {
  position: absolute; left: 0; right: 0; top: 100%;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.header-search.is-open { opacity: 1; visibility: visible; transform: none; }
.header-search form {
  display: flex; align-items: center; gap: 10px; max-width: 560px; margin-left: auto;
  background: #fff; border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow-lg);
}
.header-search .icon { color: var(--muted); width: 20px; height: 20px; }
.header-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .95rem;
}
.header-search input:focus-visible { outline: none; }
.header-search form:focus-within { box-shadow: var(--shadow-lg), 0 0 0 3px var(--blue-400); }

@media (max-width: 900px) {
  .header-inner { min-height: 76px; }
  .brand img { height: 40px; }
  .menu-toggle { display: inline-grid; }
  .header-nav-group { gap: 8px; }
  .main-nav {
    position: absolute; left: var(--gutter); right: var(--gutter); top: calc(100% - 4px);
    background: var(--navy-900); border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav a { display: block; padding: 12px 14px; border-radius: 10px; }
  .main-nav a::after { display: none; }
  .main-nav a:hover, .main-nav a[aria-current="page"] { background: rgba(255, 255, 255, .08); }
}
@media (max-width: 420px) {
  .header-actions .btn-sm { padding: .7em 1em; font-size: .8125rem; }
  .brand img { height: 34px; }
}
@media (max-width: 360px) { /* celulares bem estreitos (320px) */
  .header-nav-group, .header-actions { gap: 4px; }
  .header-actions .btn-sm { padding: .65em .75em; }
  .header-actions .icon-btn { width: 38px; height: 38px; }
  .brand img { height: 30px; }
}

/* ---------- Títulos de seção ---------- */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px;
}
.section-title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 700; letter-spacing: -.01em; }
.section-sub { margin-top: 6px; color: var(--muted); font-size: 1rem; }

/* ---------- Card de indicador ---------- */
.stat-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 22px 16px 20px; border-radius: var(--radius-lg);
  background: var(--bg-soft); border: 1px solid var(--line);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .icon { width: 30px; height: 30px; color: var(--blue-600); margin-bottom: 6px; }
.stat-value { font-family: var(--font-title); font-weight: 700; font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.4rem); color: var(--ink); line-height: 1; }
.stat-label { font-size: .875rem; color: var(--text); font-weight: 500; }

/* ---------- Card de projeto ---------- */
.project-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 10px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--blue-100); }
.project-cover {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius);
  background: var(--navy-900);
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.project-card:hover .project-cover img { transform: scale(1.04); }
.project-cover .chip-demo { position: absolute; top: 10px; left: 10px; box-shadow: var(--shadow-sm); }
.project-body { display: flex; flex-direction: column; flex: 1; padding: 16px 8px 6px; }
.project-title { font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
.project-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* card inteiro clicável */
.project-title a:focus-visible { outline: none; }
.project-card:has(.project-title a:focus-visible) { outline: 3px solid var(--blue-400); outline-offset: 2px; }
.project-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.project-summary {
  margin-top: 10px; font-size: .9rem; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.project-benefit {
  display: flex; gap: 6px; margin-top: 10px; font-size: .8125rem; color: var(--green-600); font-weight: 500;
}
.project-benefit .icon { width: 16px; height: 16px; margin-top: 2px; }
.project-benefit span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 16px; }
.project-date { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.round-arrow {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  background: var(--blue-600); color: #fff; box-shadow: 0 6px 14px rgba(21, 112, 239, .3);
  transition: transform .2s var(--ease), background-color .2s;
}
.round-arrow .icon { width: 18px; height: 18px; }
.project-card:hover .round-arrow { transform: translateX(3px); background: #0F62D6; }

/* ---------- Selo de tecnologia ---------- */
.tech-item { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 76px; }
.tech-badge {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  font-family: var(--font-title); font-weight: 800; font-size: .95rem; color: #fff;
  background: var(--tech-cor, var(--blue-600));
  transition: transform .2s var(--ease);
}
.tech-badge.is-icon { background: transparent; color: var(--blue-600); }
.tech-badge.is-icon .icon { width: 40px; height: 40px; }
.tech-badge.is-light-text { color: #1B1B1B; }
/* Formatos parecidos com os selos da referência */
.tech-badge.is-oval { width: 68px; height: 42px; margin: 5px 0; border-radius: 50%; font-style: italic; font-size: 1.05rem; letter-spacing: -.02em; }
.tech-badge.is-escudo, .tc-badge.is-escudo {
  border-radius: 0; font-size: 1.5rem; padding-bottom: 6px;
  clip-path: polygon(4% 0, 96% 0, 88% 86%, 50% 100%, 12% 86%);
  background: linear-gradient(90deg, var(--tech-cor) 50%, color-mix(in srgb, var(--tech-cor) 78%, #fff) 50%);
}
.tc-badge.is-escudo { font-size: .9rem; padding-bottom: 2px; }
.tech-item:hover .tech-badge { transform: translateY(-3px); }
.tech-name { font-size: .8125rem; font-weight: 600; color: var(--ink); }

/* ---------- Rodapé ---------- */
.site-footer {
  background: linear-gradient(120deg, var(--navy-950), var(--navy-800));
  color: rgba(255, 255, 255, .85);
}
.footer-inner {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 40px;
  padding-block: 40px;
}
.footer-info { font-size: .875rem; line-height: 1.6; }
.footer-info strong { color: #fff; font-weight: 600; }
.footer-info .footer-team { color: rgba(255, 255, 255, .6); }
.footer-quote {
  font-family: var(--font-hand); font-weight: 500; font-size: 1.75rem; line-height: 1.1;
  color: #fff; text-align: right;
}
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; gap: 18px; text-align: center; justify-items: center; padding-block: 32px; }
  .footer-quote { text-align: center; }
}

/* ---------- Página provisória (rotas das próximas fases) ---------- */
.page-hero { background: linear-gradient(90deg, #04112B, #0B2F63); color: #fff; padding-bottom: 56px; }
.page-hero-inner { padding-top: 24px; }
.page-hero h1 { color: #fff; font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }
.page-placeholder { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-block: 56px 80px; }
.page-placeholder p { max-width: 620px; }

/* ---------- Melhorias de navegação ---------- */
.stat-card.is-link { cursor: pointer; }
.stat-card.is-link:hover { border-color: var(--blue-100); }
.stat-card.is-link:hover .stat-label { color: var(--blue-600); }

.link-arrow--sm { font-size: .875rem; }
.project-card:hover .link-arrow .icon { transform: translateX(3px); }

.back-to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 999px;
  background: var(--blue-600); color: #fff; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s, background-color .2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: #0F62D6; }
.back-to-top .icon { width: 20px; height: 20px; }

/* Painel de avisos (somente debug) */
.dev-avisos {
  position: fixed; left: 16px; bottom: 16px; z-index: 50; max-width: min(460px, calc(100vw - 32px));
  background: #fff; border: 1px solid #F4D9A6; border-left: 4px solid var(--amber-600);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: .8125rem; color: var(--ink);
}
.dev-avisos summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-weight: 600; color: #6B4100; }
.dev-avisos summary .icon { width: 18px; height: 18px; }
.dev-avisos ul { list-style: disc; padding: 0 16px 0 32px; max-height: 40vh; overflow: auto; }
.dev-avisos li { margin-bottom: 4px; }
.dev-avisos p { padding: 8px 14px 12px; color: var(--muted); }

/* Atalho de teclado na busca */
.kbd {
  display: inline-block; font: 600 .75rem/1 var(--font-body); color: var(--muted);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 4px 6px; background: var(--bg-soft);
}
@media (max-width: 900px) { .kbd { display: none; } }

/* ---------- Hero escuro compartilhado (Home e Projetos) ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  background: var(--navy-950);
  padding-bottom: 120px; /* espaço para a sobreposição do painel branco */
}
/* Fundo: escritório escuro desfocado (composição em CSS, sem foto) */
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 70% at 78% 45%, rgba(43, 131, 246, .35), transparent 60%),
    radial-gradient(18% 22% at 62% 18%, rgba(120, 180, 255, .30), transparent 70%),
    radial-gradient(10% 12% at 90% 12%, rgba(160, 205, 255, .25), transparent 70%),
    radial-gradient(14% 16% at 48% 70%, rgba(78, 162, 255, .18), transparent 70%),
    radial-gradient(8% 10% at 70% 82%, rgba(255, 190, 120, .12), transparent 70%),
    linear-gradient(90deg, #04112B 0%, #061A3D 38%, #0A2752 70%, #0B2F63 100%);
}
.hero-bg::after { /* véu escuro à esquerda para leitura do texto (fica sobre a foto) */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(4, 17, 43, .94) 0%, rgba(4, 17, 43, .72) 32%, rgba(4, 17, 43, .15) 60%, rgba(4, 17, 43, 0) 75%),
              linear-gradient(180deg, rgba(4, 17, 43, .55) 0%, rgba(4, 17, 43, 0) 22%, rgba(4, 17, 43, 0) 80%, rgba(4, 17, 43, .45) 100%);
}

/* Chip suave (cards da Home, como na referência) */
.chip-soft { background: #EDF3FB; color: #1E3A66; font-weight: 500; }

/* Ícone preenchido */
.icon-fill { stroke: none; }
.icon-btn--soft { background: rgba(255, 255, 255, .08); }
.icon-btn--soft:hover { background: rgba(255, 255, 255, .16); }

/* ==========================================================
   Ajuste de escala para ficar proporcional às referências aprovadas
   (textos e cards maiores em relação à largura da página)
   ========================================================== */
.section-title { font-size: clamp(1.6rem, 1.2rem + 1.3vw, 2.4rem); }
.section-sub { font-size: clamp(1rem, .95rem + .25vw, 1.2rem); }
.section-head .link-arrow { font-size: 1.05rem; }
.project-card { padding: 12px; }
.project-body { padding: 18px 10px 8px; }
.project-title { font-size: clamp(1.1rem, 1rem + .35vw, 1.35rem); }
.project-summary { font-size: clamp(.92rem, .88rem + .2vw, 1.05rem); }
.project-date { font-size: .9rem; }
.project-chips .chip { font-size: .8rem; }
.project-card--grade .project-chips--top .chip { font-size: .875rem; font-weight: 600; padding: .5em 1em; }
.project-card--grade .link-arrow--sm { font-size: .95rem; }
.round-arrow { width: 42px; height: 42px; }
.stat-value { font-size: clamp(2rem, 1.5rem + 1.6vw, 3rem); }
.stat-label { font-size: clamp(.875rem, .82rem + .2vw, 1rem); }
.tech-badge { width: 60px; height: 60px; font-size: 1.05rem; border-radius: 16px; }
.tech-badge.is-oval { width: 76px; height: 46px; margin: 7px 0; border-radius: 50%; }
.tech-badge.is-icon .icon { width: 46px; height: 46px; }
.tech-name { font-size: .9rem; }
.footer-info { font-size: .95rem; }
.footer-quote { font-size: 2rem; }
@media (max-width: 720px) {
  .tech-badge { width: 52px; height: 52px; font-size: .95rem; }
  .tech-badge.is-oval { width: 66px; height: 40px; margin: 6px 0; }
}

/* Lista de tecnologias (Home e Detalhe) */
.tech-list { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 16px; }
@media (max-width: 720px) {
  .tech-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); justify-items: center; }
}
@media (max-width: 380px) {
  .tech-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Projeto em destaque ---------- */
.chip-destaque {
  position: absolute; top: 10px; right: 10px; gap: 5px; padding: .5em .85em;
  background: linear-gradient(135deg, #FFD54A, #F5B301); color: #4A3200; font-weight: 700; box-shadow: 0 4px 12px rgba(245, 179, 1, .35);
}
.chip-destaque .icon { width: 13px; height: 13px; }
.project-card.is-destaque { border-color: #F6D57A; box-shadow: 0 0 0 1px #F6D57A, var(--shadow-sm); }
.project-card.is-destaque:hover { border-color: #F5B301; box-shadow: 0 0 0 1px #F5B301, var(--shadow-lg); }
.chip-destaque-lg { background: #FFF4D6; color: #8A5A00; }
.chip-destaque-lg .icon { width: 15px; height: 15px; color: #F5B301; }
