/* ══════════════════════════════════════════════════
   BENCH — Biblioteca para Negócios
   styles.css — Redesign via emil-design-eng,
   high-end-visual-design, redesign-existing-projects
   ══════════════════════════════════════════════════ */

/* ─── Variáveis ──────────────────────────────────── */
:root {
  /* Paleta de marca */
  --marfim:  #F6F3EF;
  --grafite: #1D1D1B;
  --pedra:   #D7D3CC;
  --musgo:   #6F7A5A;
  --areia:   #B9B09D;

  /* Tipografia — Söhne (paga) → Plus Jakarta Sans (substituta gratuita mais próxima) */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  /* Custom easing (Emil Kowalski — nunca usar ease-in em UI) */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);

  /* Layout */
  --max-w:      1200px;
  --gutter:     40px;
  --section-py: 140px;

  /* Nav floating pill */
  --nav-h:   52px;
  --nav-top: 24px;
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--marfim);
  color: var(--grafite);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
}

/* Offset de scroll para a nav flutuante */
section[id] {
  scroll-margin-top: calc(var(--nav-h) + var(--nav-top) + 24px);
}

/* ════════════════════════════════════════════════
   FADE-IN — scale + blur + opacity (Emil / High-end)
   Nunca animar de scale(0) — nada no mundo real
   aparece do nada. Começar de scale(0.97).
   ════════════════════════════════════════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity   0.65s var(--ease-out),
    transform 0.65s var(--ease-out);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger por classe — funciona independente de nesting */
.hero-eyebrow.fade-in  { transition-delay: 0.06s; }
.hero-title.fade-in    { transition-delay: 0.18s; }
.hero-subtitle.fade-in { transition-delay: 0.34s; }
.hero-actions.fade-in  { transition-delay: 0.50s; }
.hero-image.fade-in    { transition-delay: 0.22s; }

/* Resposta a prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    transform: none;
    transition: opacity 0.4s ease;
  }
}

/* ════════════════════════════════════════════════
   CABEÇALHO — floating pill nav
   ════════════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: var(--nav-top);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: calc(100% - 48px);
  max-width: 960px;
}

.nav-pill {
  background: var(--musgo);
  border-radius: 999px;
  height: var(--nav-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.header-logo img {
  height: 36px;
  width: auto;
  /* Sem filter — cores originais preservadas */
}

/* ─── Navegação ───────────────────────────────── */
.header-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.header-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--marfim);
  letter-spacing: 0.01em;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: border-color 0.2s var(--ease-out);
}

/* Hover guardado: touch devices não devem ativar hover */
@media (hover: hover) and (pointer: fine) {
  .header-nav a:hover {
    border-color: rgba(246, 243, 239, 0.55);
  }

  .header-logo:hover img {
    opacity: 0.85;
    transition: opacity 0.2s var(--ease-out);
  }
}

/* ─── Hambúrguer ──────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 6px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--marfim);
  border-radius: 1px;
  transform-origin: center;
  /* Animação precisa em cada propriedade — nunca transition: all */
  transition:
    transform 0.3s var(--ease-spring),
    opacity   0.2s var(--ease-out);
}

/* Morph para X */
.hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ════════════════════════════════════════════════
   OVERLAY DO MENU MOBILE
   ════════════════════════════════════════════════ */
.nav-overlay { display: none; }

/* ════════════════════════════════════════════════
   HERO — split layout (texto esquerda, imagem direita)
   Baseado nas diretrizes visuais: "Título forte à
   esquerda, Banco 3D à direita, CTA simples"
   ════════════════════════════════════════════════ */
.hero {
  min-height: 100dvh;
  background: var(--marfim);
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + var(--nav-top) + 60px) var(--gutter) 100px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 80px;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

/* Eyebrow tag */
.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--musgo);
}

/* Headline — Plus Jakarta Sans Semibold (Söhne substitute) */
.hero-title {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  font-size: clamp(3rem, 5.5vw, 5.25rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--grafite);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(0.9375rem, 1.3vw, 1.125rem);
  line-height: 1.78;
  color: var(--grafite);
  opacity: 0.65;
  max-width: 440px;
  text-wrap: pretty;
}

/* CTA button */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--grafite);
  color: var(--marfim);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 999px;
  transition:
    background 0.25s var(--ease-out),
    transform  0.2s  var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .hero-cta:hover {
    background: var(--musgo);
    transform: translateY(-2px);
  }
}

.hero-cta:active { transform: scale(0.97); }

/* Imagem do produto — lado direito */
.hero-image {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.hero-image img {
  width: 100%;
  max-width: 580px;
}

/* ════════════════════════════════════════════════
   TICKER — marquee de palavras-chave
   ════════════════════════════════════════════════ */
.ticker {
  overflow: hidden;
  border-top: 1px solid rgba(29, 29, 27, 0.08);
  border-bottom: 1px solid rgba(29, 29, 27, 0.08);
  padding: 15px 0;
  background: var(--marfim);
  user-select: none;
}

.ticker__track {
  display: flex;
  align-items: center;
  gap: 24px;
  width: max-content;
  animation: ticker-scroll 28s linear infinite;
}

.ticker__item {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grafite);
  opacity: 0.35;
  white-space: nowrap;
}

.ticker__sep {
  color: var(--musgo);
  opacity: 0.5;
  font-weight: 600;
  flex-shrink: 0;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
}

/* ════════════════════════════════════════════════
   SPLIT LAYOUT — label esquerda + corpo direita
   Padrão editorial: coluna de rótulo estreita +
   coluna de conteúdo larga. Usado em O que é,
   Para quem é, Por que Bench.
   ════════════════════════════════════════════════ */
.section--split {
  background: var(--marfim);
  padding: var(--section-py) var(--gutter);
}

.section-inner--wide {
  max-width: var(--max-w);
  margin: 0 auto;
}

.split-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 80px;
  align-items: start;
}

/* Variante para cabeçalho da seção biblioteca */
.split-grid--top {
  align-items: end;
  margin-bottom: 64px;
}

.split-label {
  padding-top: 5px;
  border-top: 1px solid rgba(29, 29, 27, 0.12);
}

/* Sem margin-bottom no section-label dentro do split */
.split-label .section-label {
  margin-bottom: 0;
}

.split-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Texto de abertura grande — destaque editorial */
.split-lead {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.4vw, 2.125rem);
  line-height: 1.22;
  letter-spacing: -0.022em;
  color: var(--grafite);
  text-wrap: pretty;
}

/* ════════════════════════════════════════════════
   SEÇÕES — estrutura base
   ════════════════════════════════════════════════ */
.section {
  background: var(--marfim);
  padding: var(--section-py) var(--gutter);
}

.section-inner {
  max-width: 720px;
  margin: 0 auto;
}

.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--musgo);
  margin-bottom: 36px;
}

.section-body {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.82;
  color: var(--grafite);
  text-wrap: pretty;
}

.section-intro {
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.75;
  color: var(--grafite);
  opacity: 0.68;
  margin-bottom: 64px;
  text-wrap: pretty;
}

/* ════════════════════════════════════════════════
   DENTRO DA BIBLIOTECA — bento grid assimétrico
   Rompe o padrão 3-colunas-iguais (anti-pattern
   identificado pelo redesign-existing-projects skill)
   ════════════════════════════════════════════════ */
.section--biblioteca .section-inner {
  max-width: var(--max-w);
}

.section--biblioteca .section-intro {
  max-width: 520px;
  margin-bottom: 0;
}

/* 12 colunas: linha 1 = 7/5, linha 2 = 4/4/4 */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.card:nth-child(1) { grid-column: 1 / 8; }
.card:nth-child(2) { grid-column: 8 / 13; }
.card:nth-child(3) { grid-column: 1 / 5; }
.card:nth-child(4) { grid-column: 5 / 9; }
.card:nth-child(5) { grid-column: 9 / 13; }

.card {
  background: var(--pedra);
  border: 1px solid rgba(29, 29, 27, 0.06);
  border-radius: 8px;
  padding: 36px 32px;
  /* Feedback de presença — scale(0.97) a 0.98 no active */
  transition: transform 0.2s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-4px);
  }
}

.card:active {
  transform: scale(0.98);
}

.card-number {
  display: block;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--musgo);
  margin-bottom: 28px;
}

.card-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--grafite);
  margin-bottom: 10px;
  line-height: 1.3;
  text-wrap: balance;
}

.card-body {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--grafite);
  opacity: 0.58;
}

/* ════════════════════════════════════════════════
   POR QUE BENCH — seção manifesto (fundo pedra)
   Tratamento editorial: context + lead serif itálico + body
   ════════════════════════════════════════════════ */
.section--destaque {
  background: var(--pedra);
  padding: var(--section-py) var(--gutter);
}

.section--destaque .section-inner--wide {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* Contexto introdutório discreto */
.manifesto-context {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--grafite);
  opacity: 0.45;
  margin-bottom: 20px;
}

/* Frase principal — Plus Jakarta Sans, peso médio para hierarquia editorial */
.manifesto-lead {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--grafite);
  margin-bottom: 36px;
  text-wrap: balance;
}

/* Body da seção destaque */
.section--destaque .section-body {
  opacity: 0.75;
}

/* Blockquote manifesto */
.manifesto-quote {
  border-left: 2px solid var(--musgo);
  padding: 2px 0 2px 28px;
  margin: 8px 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, 1.7vw, 1.3125rem);
  line-height: 1.65;
  color: var(--grafite);
  text-wrap: pretty;
}

/* ════════════════════════════════════════════════
   BOOK REVEAL — scroll-driven rotation
   Apple-style sticky scroll tunnel:
   • section height = 320vh (túnel de scroll)
   • inner sticky div ocupa 100dvh
   • JS mapeia progress [0,1] → rotateY + rotateX
   ════════════════════════════════════════════════ */
.book-reveal {
  height: 320vh;
  position: relative;
  background: var(--pedra);
}

/* Sticky container: full-bleed, sem padding — vídeo cobre tudo */
.book-reveal__sticky {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: hidden;
  background: var(--pedra);
}

/* Vídeo cobre o viewport inteiro como fundo imersivo */
.book-reveal__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.book-reveal__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  will-change: auto;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Vinheta perimetral — cria a sensação de profundidade infinita */
.book-reveal__sticky::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    ellipse 80% 80% at 50% 50%,
    transparent 40%,
    rgba(246, 243, 239, 0.55) 100%
  );
  pointer-events: none;
}

/* Label — overlay no topo, centralizado */
.book-reveal__label {
  position: absolute;
  top: calc(var(--nav-h) + var(--nav-top) + 28px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 2;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--musgo);
  opacity: 0;
  transition:
    opacity  0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
}

.book-reveal__label.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Tagline — overlay na base, centralizado */
.book-reveal__tagline {
  position: absolute;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(18px);
  z-index: 2;
  width: max-content;
  max-width: min(680px, 88vw);
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  font-size: clamp(1.375rem, 2.8vw, 2.25rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--grafite);
  text-align: center;
  opacity: 0;
  transition:
    opacity  0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
  text-wrap: balance;
}

.book-reveal__tagline em {
  font-style: italic;
  font-weight: 400;
  color: var(--musgo);
}

.book-reveal__tagline.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Barra de progresso — base da tela */
.book-reveal__progress {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 48px;
  height: 2px;
  background: rgba(29, 29, 27, 0.12);
  border-radius: 1px;
  overflow: hidden;
}

.book-reveal__progress-bar {
  height: 100%;
  width: 0%;
  background: var(--musgo);
  border-radius: 1px;
  transition: width 0.05s linear;
}

/* Reduzir movimento: colapsa o túnel, exibe vídeo parado */
@media (prefers-reduced-motion: reduce) {
  .book-reveal {
    height: auto;
  }
  .book-reveal__sticky {
    position: relative;
    height: 100dvh;
  }
  .book-reveal__progress { display: none; }
  .book-reveal__label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  .book-reveal__tagline {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Mobile: túnel menor, tagline mais alta */
@media (max-width: 640px) {
  .book-reveal {
    height: 240vh;
  }
  .book-reveal__tagline {
    bottom: 56px;
    font-size: clamp(1.125rem, 5vw, 1.5rem);
  }
}

/* ════════════════════════════════════════════════
   RODAPÉ
   ════════════════════════════════════════════════ */
.site-footer {
  background: var(--grafite);
  padding: 64px var(--gutter);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 48px;
}

.footer-main {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--marfim);
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}

.footer-sub {
  font-size: 0.8125rem;
  color: var(--areia);
  letter-spacing: 0.02em;
}

.footer-nav {
  display: flex;
  gap: 24px;
}

.footer-nav a {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: rgba(185, 176, 157, 0.5);
  transition: color 0.2s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .footer-nav a:hover { color: var(--areia); }
}

.footer-copy {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: rgba(185, 176, 157, 0.35);
  white-space: nowrap;
}

/* ════════════════════════════════════════════════
   RESPONSIVO — Tablet (≤ 960px)
   ════════════════════════════════════════════════ */
@media (max-width: 960px) {
  :root {
    --section-py: 100px;
    --gutter: 32px;
  }

  .header-nav { gap: 24px; }

  /* Hero: empilha verticalmente */
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero-image {
    justify-content: center;
  }
  .hero-image img {
    max-width: 420px;
  }

  /* Split layout: empilha */
  .split-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .split-grid--top { margin-bottom: 48px; }

  /* Bento vira 2 colunas */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .card:nth-child(n) { grid-column: auto; }

  /* Footer empilha */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
  .footer-nav { justify-content: center; }
}

/* ════════════════════════════════════════════════
   RESPONSIVO — Mobile (≤ 640px)
   ════════════════════════════════════════════════ */
@media (max-width: 640px) {
  :root {
    --section-py: 80px;
    --gutter: 24px;
    --nav-top: 16px;
  }

  /* Pill ocupa quase a largura toda no mobile */
  .site-header {
    width: calc(100% - 32px);
    max-width: none;
  }

  /* Hambúrguer visível */
  .hamburger { display: flex; }

  /* Nav vira overlay full-screen */
  .header-nav {
    position: fixed;
    inset: 0;
    z-index: 160;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .header-nav.is-open {
    visibility: visible;
    pointer-events: auto;
  }

  /* Links do menu mobile: grandes, com stagger de entrada */
  .header-nav a {
    display: block;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--marfim);
    border: none;
    padding: 14px 0;
    letter-spacing: -0.01em;
    opacity: 0;
    transform: translateY(18px);
    /* Animação precisa — não usar transition: all */
    transition:
      opacity   0.4s var(--ease-out),
      transform 0.4s var(--ease-out);
  }

  /* Stagger de revelação dos links */
  .header-nav.is-open a:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.10s; }
  .header-nav.is-open a:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.17s; }
  .header-nav.is-open a:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.24s; }
  .header-nav.is-open a:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.31s; }

  /* Fundo musgo do overlay de menu */
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--musgo);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
  }

  .nav-overlay.is-open {
    opacity: 0.97;
    pointer-events: auto;
  }

  /* Hero mobile */
  .hero {
    padding-top: calc(var(--nav-h) + var(--nav-top) + 48px);
    padding-bottom: 72px;
  }
  .hero-inner { gap: 36px; }
  .hero-image img { max-width: 100%; }
  .hero-subtitle { max-width: 100%; }
  .hero-title { font-size: clamp(2.5rem, 10vw, 3.5rem); }

  /* Cards: coluna única */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .card:nth-child(n) { grid-column: auto; }

  /* Biblioteca label/intro no mobile */
  .section--biblioteca .section-label,
  .section--biblioteca .section-intro {
    max-width: 100%;
  }

  /* Manifesto lead menor no mobile */
  .manifesto-lead {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
}
