/* ==========================================================================
   Gabriel Dias — Portfólio
   Design system: ver design-system.md
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens (custom properties)
   -------------------------------------------------------------------------- */
:root {
  /* Neutros */
  --cream: #faf6f0;
  --cream-2: #f2ebe0;
  --sand: #e8dcc8;
  --sand-2: #d9c9ad;
  --brown-light: #b49a78;
  --brown: #8a7057;
  --brown-dark: #5c4a3a;
  --charcoal: #2b2420;
  --ink: #1c1714;

  /* Acentos */
  --terracotta-soft: #e8b49a;
  --terracotta: #d98c6b;
  --clay-deep: #a85d3e;
  --ocre-soft: #dfc186;
  --ocre: #c9a15a;

  /* Semânticos */
  --bg: var(--cream);
  --surface: #ffffff;
  --text: var(--ink);
  --text-muted: var(--brown);
  --border: var(--sand);
  --accent: var(--terracotta);
  --accent-deep: var(--clay-deep);

  /* Estado (uso pontual em fluxogramas/diagramas: caminhos "sim"/"não") */
  --state-yes: #6f8f5b;
  --state-no: var(--clay-deep);

  /* Tipografia */
  --font-display: "Noto Serif", serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* Espaçamento (escala de 4px) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* Raio */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Sombra */
  --shadow-sm: 0 2px 8px rgba(28, 23, 20, 0.06);
  --shadow-md: 0 8px 24px rgba(28, 23, 20, 0.1);
}

/* --------------------------------------------------------------------------
   2. Reset básico
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

/* Foco visível em todos os elementos interativos — não removido em nenhum lugar */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Utilitário para leitores de tela: esconde visualmente mas mantém acessível */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--sp-4);
  background: var(--ink);
  color: var(--cream);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: var(--sp-4);
}

/* --------------------------------------------------------------------------
   3. Tipografia
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text);
  margin: 0 0 var(--sp-4) 0;
  line-height: 1.2;
}

h1 {
  font-size: clamp(36px, 6vw, 56px);
}

h2 {
  font-size: clamp(28px, 4vw, 32px);
}

h3 {
  font-size: 20px;
}

p {
  margin: 0 0 var(--sp-4) 0;
}

.lead {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 60ch;
}

.italic-highlight {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 24px;
  color: var(--accent-deep);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 14px;
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--clay-deep);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

/* --------------------------------------------------------------------------
   4. Navbar (topnav fixa)
   -------------------------------------------------------------------------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 240, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  max-width: 1120px;
  margin: 0 auto;
}

.topnav__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}

.topnav__brand:hover {
  color: var(--accent-deep);
}

.topnav__links {
  display: flex;
  gap: var(--sp-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.topnav__links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: var(--sp-1) 0;
  border-bottom: 2px solid transparent;
}

.topnav__links a:hover,
.topnav__links a[aria-current="page"] {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}

.topnav__cta {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: #ffffff;
  background: var(--accent);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.topnav__cta:hover {
  background: var(--accent-deep);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Painel de navegação: linha única no desktop, colapsável no mobile.
   Sem JS, .nav-panel fica sempre visível e empilhado (ver regra
   mobile abaixo) — nenhum link depende de JavaScript para existir. */
.nav-panel {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle[hidden] {
  display: none;
}

/* Acima do breakpoint mobile o hambúrguer nunca deve aparecer, mesmo
   depois do JS remover o atributo [hidden] — o menu horizontal já
   está visível por padrão nessas larguras. */
@media (min-width: 768px) {
  .nav-toggle {
    display: none !important;
  }
}

.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    background-color 0.15s ease;
}

.nav-toggle__icon {
  position: relative;
}

.nav-toggle__icon::before {
  position: absolute;
  top: -6px;
  left: 0;
}

.nav-toggle__icon::after {
  position: absolute;
  top: 6px;
  left: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 767px) {
  /* Fallback sem JS: empilha em coluna, com espaçamento — sem
     sobreposição — e todos os links continuam visíveis e acessíveis. */
  .topnav__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-5);
  }

  .nav-panel {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-4);
    width: 100%;
  }

  .nav-panel .topnav__links {
    flex-direction: column;
    gap: var(--sp-1);
    width: 100%;
  }

  .nav-panel .topnav__links a {
    display: block;
    padding: var(--sp-3) 0;
  }

  .nav-panel .topnav__cta {
    justify-content: center;
    width: 100%;
  }

  /* Com JS: vira menu hambúrguer — painel colapsa atrás do botão. */
  .js-nav-enhanced .topnav__inner {
    position: relative;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .js-nav-enhanced .nav-panel {
    position: absolute;
    top: calc(100% + var(--sp-2));
    left: var(--sp-5);
    right: var(--sp-5);
    width: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--sp-5);
    z-index: 60;
    display: none;
  }

  .js-nav-enhanced .nav-panel.is-open {
    display: flex;
  }
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */
.hero {
  padding: var(--sp-9) 0 var(--sp-8);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: center;
}

.hero__eyebrow {
  margin-bottom: var(--sp-3);
}

.hero__title {
  margin-bottom: var(--sp-5);
}

.hero__cta {
  display: flex;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
  flex-wrap: wrap;
}

.hero__media {
  justify-self: center;
}

.hero__photo {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

@media (max-width: 767px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }

  /* Foto ocupa espaço desproporcional em telas pequenas — escondida
     apenas no mobile; volta a aparecer normalmente em tablet/desktop. */
  .hero__media {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   6. Botões
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn--primary {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.btn--primary:hover {
  background: var(--charcoal);
  color: var(--cream);
}

.btn--accent {
  background: var(--terracotta);
  color: var(--ink);
  border-color: var(--terracotta);
}

.btn--accent:hover {
  background: var(--clay-deep);
  color: var(--cream);
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--brown-light);
}

.btn--outline:hover {
  border-color: var(--accent-deep);
  color: var(--accent-deep);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--cream-2);
  color: var(--accent-deep);
  transform: none;
  box-shadow: none;
}

.btn-showcase {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   7. Tags / badges
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--cream-2);
  color: var(--text-muted);
  white-space: nowrap;
}

.tag--accent {
  background: rgba(217, 140, 107, 0.14);
  border-color: var(--terracotta);
  color: var(--clay-deep);
}

.tag--ocre {
  background: rgba(201, 161, 90, 0.16);
  border-color: var(--ocre);
  color: var(--brown-dark);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   8. Cards de projeto
   -------------------------------------------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

@media (max-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.project-card__thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--ocre) 100%);
}

.project-card__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__thumb-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: rgba(28, 23, 20, 0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-card__body {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  flex: 1;
}

.project-card__title {
  margin: 0;
  font-size: 20px;
}

.project-card__title a {
  color: var(--text);
  text-decoration: none;
}

.project-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.project-card {
  position: relative;
}

.project-card__title a:hover {
  color: var(--accent-deep);
}

.project-card__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  flex: 1;
}

.project-card__meta {
  margin-top: var(--sp-2);
}

/* --------------------------------------------------------------------------
   9. Bloco "sobre mim"
   -------------------------------------------------------------------------- */
.about {
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--border);
}

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: start;
}

.about__facts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
}

.about__facts dt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--sp-4);
}

.about__facts dt:first-child {
  margin-top: 0;
}

.about__facts dd {
  margin: var(--sp-1) 0 0 0;
  font-weight: 600;
}

@media (max-width: 720px) {
  .about__grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   10. O que dizem sobre trabalhar comigo (depoimentos)
   -------------------------------------------------------------------------- */
.testimonials {
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--border);
}

.testimonials__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-7);
  margin-top: var(--sp-6);
  max-width: 68ch;
}

.testimonials .case-quote {
  margin: 0;
}

.testimonials .case-quote footer {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
}

.testimonials .case-quote footer strong {
  font-family: var(--font-body);
  font-weight: 700;
}

.testimonial-context {
  display: block;
  margin-top: var(--sp-1);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .thinking__grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   11. Formulário de contato
   -------------------------------------------------------------------------- */
.contact {
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--border);
}

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-7);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.form-field label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.form-field .form-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.form-field input,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--sand-2);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color 0.15s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--terracotta);
  outline: none;
}

.form-field input:focus-visible,
.form-field textarea:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 1px;
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-field--required label::after {
  content: " *";
  color: var(--clay-deep);
}

.contact-direct {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.contact-direct__item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.contact-direct__label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

.contact-direct__value {
  font-size: 17px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .contact__grid {
    grid-template-columns: 1fr;
  }
}

.contact__cta {
  text-align: center;
  max-width: 48ch;
  margin: 0 auto;
}

.contact__cta h2 {
  margin-bottom: var(--sp-6);
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: var(--sp-7) 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer__signature {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
  margin-bottom: var(--sp-4);
}

.site-footer__links {
  display: flex;
  justify-content: center;
  gap: var(--sp-5);
  list-style: none;
  margin: 0 0 var(--sp-4) 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-footer__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--accent-deep);
}

.site-footer__meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* --------------------------------------------------------------------------
   13. Seções gerais / utilidades de layout
   -------------------------------------------------------------------------- */
section {
  scroll-margin-top: 80px;
}

.section-heading {
  max-width: 60ch;
  margin-bottom: var(--sp-6);
}

.projects {
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   14. Case study (páginas de projeto)
   -------------------------------------------------------------------------- */
.case-header {
  padding: var(--sp-8) 0 var(--sp-7);
}

.case-back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: var(--sp-6);
}

.case-back:hover {
  color: var(--accent-deep);
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-7);
  margin: var(--sp-6) 0 0 0;
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}

.case-meta__item dt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

.case-meta__item dd {
  margin: var(--sp-1) 0 0 0;
  font-weight: 600;
}

.case-section {
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--border);
}

.case-prose h2 {
  margin-top: 0;
}

.case-prose h3 {
  margin-top: var(--sp-6);
}

.case-process h3 {
  margin-top: var(--sp-6);
}

.case-process h3:first-of-type {
  margin-top: var(--sp-7);
}

.case-prose ul {
  padding-left: var(--sp-5);
}

.case-prose li {
  margin-bottom: var(--sp-3);
}

.case-quote {
  margin: var(--sp-6) 0;
  padding-left: var(--sp-5);
  border-left: 3px solid var(--accent);
}

.case-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  color: var(--text);
  margin: 0 0 var(--sp-2) 0;
}

.case-quote footer {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

.case-image {
  margin: var(--sp-6) 0 0 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--ocre) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.case-image__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-image__label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: rgba(28, 23, 20, 0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Variante sem borda/moldura: imagem inteira visível (object-fit:
   contain), sem recorte e sem o retângulo de card ao redor. */
.case-image--plain {
  aspect-ratio: auto;
  border: none;
  background: none;
  display: block;
}

.case-image--plain .case-image__photo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Mockups da landing page (case Psicologia Viva/CAASC): cada print
   mantém a proporção original, sem esticar/cortar, dentro de uma
   caixa com fundo neutro e largura máxima própria por versão. */
.lp-mockups {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: var(--sp-6);
  margin-top: var(--sp-6);
}

.lp-mockup {
  margin: 0;
  min-width: 0;
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-sizing: border-box;
}

.lp-mockup__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.lp-mockup--desktop {
  max-width: 640px;
}

.lp-mockup--mobile {
  max-width: 280px;
}

.case-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-5);
  margin-top: var(--sp-6);
}

.case-image-grid .case-image {
  margin-top: 0;
}

/* Variante empilhada: um card abaixo do outro, em vez de lado a lado. */
.case-image-grid--stack {
  grid-template-columns: 1fr;
  width: 100%;
}

.case-image-grid--stack .ds-logo-card img {
  display: block;
  width: 100%;
  aspect-ratio: auto;
  height: auto;
  object-fit: cover;
  padding: 0;
}

.case-diagram {
  margin: var(--sp-6) 0 0 0;
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.case-diagram svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 480px;
}

.case-screenshots {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  margin-top: var(--sp-6);
}

.case-screenshot {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.case-screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.case-screenshot__caption {
  padding: var(--sp-4) var(--sp-5);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Variante sem borda/moldura ao redor da imagem. */
.case-screenshot--plain {
  border: none;
  background: none;
}

.case-screenshot--plain .case-screenshot__caption {
  border-top: none;
  padding-top: 0;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-5);
  margin-top: var(--sp-6);
}

/* Vantagens exclusivas (case Psicologia Viva/CAASC): 3 colunas fixas
   no desktop, ao invés do auto-fit padrão do .scenario-grid. */
@media (min-width: 641px) {
  .scenario-grid--3col {
    grid-template-columns: repeat(3, 1fr);
  }
}

.scenario-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
}

.scenario-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 var(--sp-2) 0;
}

.scenario-card h3,
.scenario-card h4 {
  margin: 0 0 var(--sp-2) 0;
  font-size: 18px;
}

.scenario-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-7) var(--sp-6);
  margin: var(--sp-7) 0 0 0;
}

.stat {
  margin: 0;
}

.stat__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 56px);
  color: var(--accent-deep);
  line-height: 1;
  margin: 0;
}

.stat__label {
  margin: var(--sp-3) 0 0 0;
  font-size: 14px;
  line-height: 1.6;
  min-height: 4.8em; /* reserva espaço de 3 linhas — mesma altura para todos os blocos, mesmo com textos de tamanhos diferentes */
  color: var(--text-muted);
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.checklist li {
  position: relative;
  padding-left: var(--sp-6);
  color: var(--text);
  margin-bottom: 0;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-deep);
  font-weight: 700;
}

.case-cta {
  padding: var(--sp-9) 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.case-cta h2 {
  max-width: 32ch;
  margin: 0 auto var(--sp-6) auto;
}

/* --------------------------------------------------------------------------
   15. Demonstração de Design System (case Hero DS)
   -------------------------------------------------------------------------- */
.ds-demo {
  margin-top: var(--sp-6);
}

.ds-section {
  padding: var(--sp-6) 0;
  border-top: 1px solid var(--border);
}

.ds-section:first-child {
  padding-top: 0;
  border-top: none;
}

.ds-section h3 {
  margin-bottom: var(--sp-5);
}

.ds-section h4 {
  font-size: 15px;
  margin-bottom: var(--sp-3);
}

/* Seção 1 — marcas */
.ds-logos-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-7);
  padding: var(--sp-6);
  background: var(--cream-2);
  border-radius: var(--radius-md);
}

.ds-logo-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

.ds-logo-slot__box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 64px;
  background: var(--surface);
  border: 1px dashed var(--brown-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 0 var(--sp-3);
}

.ds-logo-slot__caption {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

/* Seção 2 — tokens de cor */
.ds-brands {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-6);
}

.ds-swatches {
  display: flex;
  gap: var(--sp-3);
}

.ds-swatch {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

.ds-swatch__color {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.ds-swatch__color--main {
  border: 2px solid var(--ink);
}

.ds-swatch__hex {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: center;
  word-break: break-word;
}

.ds-status-eyebrow {
  margin: var(--sp-7) 0 var(--sp-4) 0;
}

.ds-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
}

.ds-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}

.ds-status__color {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.ds-status__label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* Seção 3 — tipografia */
.ds-type-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--border);
}

.ds-type-row:first-child {
  border-top: none;
  padding-top: 0;
}

.ds-type-sample {
  margin: 0;
  color: var(--text);
}

.ds-type-sample--display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 48px;
  line-height: 1.1;
}

.ds-type-sample--large {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
}

.ds-type-sample--paragraph {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
}

.ds-type-sample--label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
}

.ds-type-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Demonstração de logo (case Hero DS) */
.ds-logo-demo {
  margin-top: var(--sp-6);
}

.ds-logo-group + .ds-logo-group {
  margin-top: var(--sp-7);
}

.ds-logo-group h3 {
  margin-bottom: var(--sp-4);
}

.ds-logo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5);
}

@media (max-width: 640px) {
  .ds-logo-grid {
    grid-template-columns: 1fr;
  }
}

.ds-logo-card {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.ds-logo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  box-sizing: border-box;
  padding: var(--sp-6);
  background: var(--surface);
}

.ds-logo-card figcaption {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Variações de fundo para pré-visualizar logos claros/com texto branco */
.ds-logo-card--dark img {
  background: var(--ink);
}

.ds-logo-card--brand-viva img {
  background: #a04fc9; /* Psicologia Viva — cor primária (300) */
}

.ds-logo-card--brand-conexa img {
  background: #1900af; /* Conexa — cor primária (300) */
}

.border-top-none {
  border-top: none;
}

/* --------------------------------------------------------------------------
   16. Anatomia & Contraste (case Hero DS) — botão real do Hero DS
   -------------------------------------------------------------------------- */
.anatomy-block {
  padding: var(--sp-7) 0;
  border-top: 1px solid var(--border);
}

.anatomy-block:first-child {
  padding-top: 0;
  border-top: none;
}

.anatomy-block h3 {
  margin-bottom: var(--sp-5);
}

/* Botão do Hero DS: Sora 600, 16px, padding 0.5rem/1rem, radius 0.5rem */
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Sora", var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  color: #ffffff;
  cursor: pointer;
  white-space: nowrap;
}

.hero-btn__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.hero-btn--conexa {
  background: #1900af;
  --hero-ring: rgba(25, 0, 175, 0.45);
}

.hero-btn--viva {
  background: #a04fc9;
  --hero-ring: rgba(160, 79, 201, 0.45);
}

.hero-btn--conexa.hero-btn--hover {
  background: #13007d;
}

.hero-btn--viva.hero-btn--hover {
  background: #7c23a8;
}

.hero-btn--focus {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 5px var(--hero-ring);
}

.hero-btn--loading {
  color: rgba(255, 255, 255, 0.85);
}

.hero-btn__spinner {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: hero-btn-spin 0.7s linear infinite;
}

@keyframes hero-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.hero-btn:disabled {
  background: #e6e6f0;
  color: #555567;
  cursor: not-allowed;
}

/* Seção 1 — anatomia */
.anatomy-row {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.anatomy-figure {
  position: relative;
  width: 380px;
  max-width: 100%;
  height: 190px;
}

.anatomy-connectors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.anatomy-connector {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.5;
}

.anatomy-figure .hero-btn {
  position: absolute;
  left: 105px;
  top: 95px;
  width: 170px;
  height: 40px;
  box-sizing: border-box;
  justify-content: center;
  margin: 0;
}

.anatomy-pin {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.anatomy-pin--1 {
  left: 35px;
  top: 115px;
  transform: translate(-50%, -50%);
}

.anatomy-pin--2 {
  left: 190px;
  top: 25px;
  transform: translate(-50%, -50%);
}

.anatomy-pin--3 {
  left: 345px;
  top: 115px;
  transform: translate(-50%, -50%);
}

.anatomy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.anatomy-list li {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  font-size: 15px;
}

.anatomy-list__num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.anatomy-list code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-deep);
  background: rgba(217, 140, 107, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Seções 2 e 3 — estados / contraste */
.states-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-7);
  margin-top: var(--sp-5);
}

@media (max-width: 640px) {
  .states-grid {
    grid-template-columns: 1fr;
  }
}

.states-col h4 {
  margin-bottom: var(--sp-2);
}

.state-block {
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--border);
}

.state-block:first-child {
  padding-top: var(--sp-3);
}

.state-block__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.state-block__buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.contrast-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--sp-3);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--state-yes);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.contrast-badge strong {
  font-weight: 700;
}

.mw-100 {
  max-width: 100%;
}
