/* Growth Design — Site novo (wireframe Figma, página "Site - NOVO") */

:root {
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --bg: #000000;
  --ink: #ffffff;
  --ink-dim: rgba(255, 255, 255, 0.78);
  --ink-faint: rgba(255, 255, 255, 0.23);
  --blue: #0062ff;
  --panel: #050505;
  --line: rgba(255, 255, 255, 0.85);
  --display: 'Workbench', monospace;
  --mono: 'Azeret Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 400;
  line-height: 1.44;
  -webkit-font-smoothing: antialiased;
}

/* Textura com filtro preto 80% por cima, igual aos fills do Figma */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
    url('assets/texture.jpg');
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
}

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

a { color: inherit; }

:focus-visible {
  outline: 2px dashed var(--blue);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--display);
  font-size: 14px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* ---------- Header ---------- */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 26px 48px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--display);
  font-size: 14px;
}

.site-nav span { opacity: 0.6; }

.site-nav a {
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover {
  border-bottom-color: var(--line);
}

.site-logo img { height: 48px; width: auto; }

.btn-quote {
  justify-self: end;
  font-family: var(--display);
  font-size: 18px;
  text-decoration: none;
  padding: 16px 24px;
  border: 1px dashed var(--line);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-quote:hover {
  background-color: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  border-style: solid;
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(48px, 6vh, 70px);
  padding: 150px 24px 60px;
}

.hero-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 6.35vw, 7.625rem);
  line-height: 1.16;
  text-align: center;
}

.hero-accent { color: var(--blue); }

/* ---------- Cases (carrossel) ---------- */

.cases-carousel {
  width: 100%;
  overflow: clip;
}

.carousel-stage {
  position: relative;
  width: 100%;
  height: calc(min(44vw, 846px) * 0.528 + 160px);
}

.carousel-stage {
  --dur: 0.7s;
  --ease: cubic-bezier(0.33, 0.1, 0.25, 1);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* Durante o arraste os cards acompanham o ponteiro sem transição */
.carousel-stage.dragging .case { transition: none; }

/* Rotação automática: percurso mais lento e suave que o clique */
.carousel-stage.slow {
  --dur: 1.5s;
  --ease: cubic-bezier(0.42, 0, 0.22, 1);
}

.case {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(44vw, 846px);
  display: flex;
  flex-direction: column;
  gap: 26px;
  text-align: center;
  transform: translateX(-50%);
  transition: transform var(--dur) var(--ease);
}

.case.is-center {
  transform: translateX(calc(-50% + var(--drag, 0px))) scale(1);
  z-index: 2;
}

.case.is-left {
  transform: translateX(calc(-50% - min(38vw, 730px) + var(--drag, 0px))) scale(0.552);
  z-index: 1;
  cursor: pointer;
}

.case.is-right {
  transform: translateX(calc(-50% + min(38vw, 730px) + var(--drag, 0px))) scale(0.552);
  z-index: 1;
  cursor: pointer;
}

/* Posições fora do quadro: por onde o card que dá a volta sai e reentra,
   deslizando pelas bordas como uma esteira circular — sem fade, sem cruzar o palco */
.case.is-off-left {
  transform: translateX(calc(-50% - 95vw + var(--drag, 0px))) scale(0.552);
  z-index: 1;
}

.case.is-off-right {
  transform: translateX(calc(-50% + 95vw + var(--drag, 0px))) scale(0.552);
  z-index: 1;
}

/* Setas e contador, na linguagem do design */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 10px;
}

.carousel-arrow {
  width: 46px;
  height: 46px;
  background: none;
  border: 1px dashed var(--line);
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.carousel-arrow:hover {
  background-color: var(--ink);
  color: var(--bg);
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 6px;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  background: none;
  border: 1px dashed var(--line);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.carousel-dot:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

.carousel-dot.active {
  background-color: var(--ink);
  border-style: solid;
  border-color: var(--ink);
}

.case-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 846 / 447;
  background-color: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

/* Vídeo real do site navegando (gravado com as animações vivas);
   só o card em destaque roda — o play/pause é controlado no script. */
.case-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Link para o site ao vivo: aparece no hover do card em destaque.
   Nos laterais fica inerte para o clique continuar girando o carrossel. */
.case-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  text-decoration: none;
  -webkit-user-drag: none;
}

.case.is-center .case-link { pointer-events: auto; }

.case.is-center .case-link:hover,
.case.is-center .case-link:focus-visible { opacity: 1; }

.case-link span {
  font-family: var(--display);
  font-size: clamp(1rem, 1.25vw, 1.5rem);
  color: var(--ink);
  border: 1px dashed var(--line);
  padding: 14px 22px;
}

/* Link "visitar site" abaixo da descrição: só existe no touch,
   onde o overlay de hover dentro do vídeo não faz sentido */
.case-visit { display: none; }

@media (hover: none) {
  .case .case-link { display: none; }

  .case-visit {
    display: inline-block;
    align-self: center;
    margin-top: 2px;
    font-family: var(--display);
    font-size: 0.8rem;
    color: var(--ink);
    text-decoration: none;
    border: 1px dashed var(--line);
    padding: 10px 16px;
  }
}

.case-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.25rem, 1.78vw, 2.13rem);
  transition: opacity 0.4s ease;
}

.case-desc {
  font-size: clamp(0.78rem, 0.79vw, 0.95rem);
  line-height: 1.44;
  color: var(--ink-dim);
  max-width: 46ch;
  margin: 0 auto;
  transition: opacity 0.4s ease;
}

/* ---------- Sections ---------- */

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.27vw, 5.125rem);
  line-height: 1.16;
  text-align: center;
}

.services {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 66px;
  padding: 120px 24px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 1280px;
}

.service-card {
  position: relative;
  border: 1px dashed var(--line);
  padding: 24px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-height: 226px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}


.service-card:hover {
  border-color: var(--blue);
  transform: translateY(-4px);
}

.service-card h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.08vw, 2.5rem);
  line-height: 1.16;
}

.service-card p {
  font-size: 16px;
  line-height: 1.44;
  color: var(--ink-dim);
}

/* ---------- Manifesto ---------- */

.manifesto {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 120px 0 90px;
}

/* Percurso longo de scroll: o texto fica pinado enquanto as palavras acendem */
.manifesto-scroll {
  width: 100%;
  height: 340vh;
}

.manifesto-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.manifesto-text {
  max-width: 948px;
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vh, 40px);
  font-family: var(--display);
  font-size: min(2.5rem, 2.8vh);
  line-height: 1.16;
  text-align: center;
}

.manifesto-text .w {
  opacity: 0.23;
  transition: opacity 0.35s ease;
}

.manifesto-text .w.lit { opacity: 1; }

.signature {
  width: clamp(180px, 14vw, 270px);
  height: auto;
  /* recolhe o vazio que a caixa pinada de 100svh deixa abaixo do texto */
  margin-top: -14svh;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s ease 0.1s, transform 0.8s ease 0.1s;
}

.manifesto.done .signature {
  opacity: 1;
  transform: none;
}

/* ---------- Motion: boot (entrada) e reveals (on-scroll) ----------
   Estados escondidos só existem com JS ativo e motion permitido;
   sem JS ou com reduced-motion, tudo fica visível de imediato. */

@media (prefers-reduced-motion: no-preference) {
  /* entrada do header em cascata */
  html.js .boot-item {
    opacity: 0;
    transform: translateY(-14px);
  }

  html.js.booted .boot-item {
    opacity: 1;
    transform: none;
    transition:
      opacity 0.6s var(--ease-out-quint),
      transform 0.6s var(--ease-out-quint);
    transition-delay: calc(var(--boot-i, 0) * 110ms);
  }

  /* carrossel: o card central sobe primeiro (3); os laterais saem
     deslizando de trás dele para as pontas (4); controles por último */
  html.js:not(.booted) .boot-card { opacity: 0; }

  html.js:not(.booted) .boot-card.is-center {
    transform: translateX(-50%) translateY(46px);
  }

  html.js:not(.booted) .boot-card.is-left,
  html.js:not(.booted) .boot-card.is-right {
    transform: translateX(-50%) scale(0.552);
    z-index: 0;
  }

  html.js.booted .boot-card {
    opacity: 1;
    transition:
      opacity 0.7s var(--ease-out-expo),
      transform 0.9s var(--ease-out-expo);
  }

  html.js.booted .boot-card.is-center { transition-delay: 1.05s; }

  html.js.booted .boot-card.is-left,
  html.js.booted .boot-card.is-right { transition-delay: 1.65s; }

  html.js:not(.booted) .boot-late { opacity: 0; }

  html.js.booted .boot-late {
    opacity: 1;
    transition: opacity 0.6s ease 2.3s;
  }

  /* manifesto: parágrafos entram um a um conforme o scroll chega neles */
  html.js .manifesto-text p {
    transition:
      opacity 0.55s var(--ease-out-quint),
      transform 0.55s var(--ease-out-quint);
  }

  html.js .manifesto-text p:not(.p-in) {
    opacity: 0;
    transform: translateY(18px);
  }

  /* reveals on-scroll: subida suave (footer) */
  html.js .reveal:not(.in) {
    opacity: 0;
    transform: translateY(28px);
    transition: none;
  }

  html.js .reveal.in {
    transition:
      opacity 0.75s var(--ease-out-quint),
      transform 0.75s var(--ease-out-quint);
    transition-delay: calc(var(--reveal-i, 0) * 90ms);
  }

  /* serviços: cada card "liga" como néon de arcade, um por um */
  html.js .service-card:not(.on) { opacity: 0; }

  html.js .service-card.on {
    animation: card-ignite 0.42s steps(1, end) both;
  }

  html.js .service-card p.typing::after {
    content: '_';
    margin-left: 2px;
    animation: cursor-blink 0.65s steps(1) infinite;
  }
}

@keyframes card-ignite {
  0%        { opacity: 0; }
  12%       { opacity: 1; }
  28%       { opacity: 0.25; }
  42%       { opacity: 1; }
  58%       { opacity: 0.55; }
  72%, 100% { opacity: 1; }
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 48px 24px 40px;
}

.footer-bolt { width: 55px; height: 48px; }

.footer-note {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* ---------- Modal de orçamento ---------- */

body.modal-open { overflow: hidden; }

.quote-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* o display:flex acima venceria o hidden do atributo e o modal invisível
   cobriria a página inteira, engolindo todos os cliques do site */
.quote-modal[hidden] { display: none !important; }

.quote-modal.open { opacity: 1; }

.quote-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.quote-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 86svh;
  overflow-y: auto;
  background: #000;
  border: 1px dashed var(--line);
  padding: 40px 36px 32px;
  transform: translateY(22px);
  transition: transform 0.35s var(--ease-out-quint);
}

.quote-modal.open .quote-panel { transform: none; }

.quote-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px dashed var(--line);
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.quote-close:hover {
  background-color: var(--ink);
  color: var(--bg);
}

.quote-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin-bottom: 28px;
  padding-right: 48px;
}

.quote-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.quote-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.quote-field input,
.quote-field select,
.quote-field textarea {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.55);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 14px;
}

.quote-field select { appearance: none; }

.quote-field select option {
  background: #000;
  color: #fff;
}

.quote-field textarea {
  resize: vertical;
  min-height: 96px;
}

.quote-field input:focus,
.quote-field select:focus,
.quote-field textarea:focus {
  outline: none;
  border-style: solid;
  border-color: var(--blue);
}

.quote-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.quote-submit {
  margin-top: 6px;
  padding: 16px 24px;
  background: none;
  border: 1px dashed var(--line);
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.quote-submit:hover:not(:disabled) {
  background-color: var(--ink);
  color: var(--bg);
}

.quote-submit:disabled {
  opacity: 0.5;
  cursor: wait;
}

.quote-status {
  min-height: 1.2em;
  font-size: 12.5px;
  color: var(--ink-dim);
}

.quote-status a { color: var(--blue); }

/* No celular o formulário vira uma aba de tela cheia, sem ficar solto */
@media (max-width: 640px) {
  .quote-modal {
    padding: 0;
    align-items: stretch;
  }

  .quote-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    padding: 34px 22px calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .quote-field input,
  .quote-field select,
  .quote-field textarea {
    font-size: 16px; /* evita o zoom automático do iOS ao focar */
  }
}

/* ---------- CTA fixo no mobile ---------- */

.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  justify-content: center;
  padding: 34px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 60%, rgba(0, 0, 0, 0));
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition:
    opacity 0.45s var(--ease-out-quint),
    transform 0.45s var(--ease-out-quint);
}

.sticky-cta[hidden] { display: none !important; }

.sticky-cta.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.sticky-cta .btn-quote {
  background-color: rgba(0, 0, 0, 0.9);
  font-size: 15px;
  padding: 14px 26px;
}

@media (max-width: 900px) {
  .sticky-cta { display: flex; }
}

/* ---------- Responsivo ---------- */

@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .carousel-stage { height: calc(min(84vw, 680px) * 0.528 + 212px); }

  .case { width: min(84vw, 680px); }

  /* laterais dão uma espiada nas bordas como convite ao arraste */
  .case.is-left { transform: translateX(calc(-50% - 66vw + var(--drag, 0px))) scale(0.5); }

  .case.is-right { transform: translateX(calc(-50% + 66vw + var(--drag, 0px))) scale(0.5); }

  .case.is-off-left { transform: translateX(calc(-50% - 160vw + var(--drag, 0px))) scale(0.5); }

  .case.is-off-right { transform: translateX(calc(-50% + 160vw + var(--drag, 0px))) scale(0.5); }

  /* nas bordas só aparece o painel; as legendas ficam no card em destaque */
  .case:not(.is-center) .case-name,
  .case:not(.is-center) .case-desc { opacity: 0; }

  .case-name { font-size: 1.4rem; }

  .case-desc { font-size: 0.8rem; }
}

@media (max-width: 900px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 18px;
    padding: 28px 20px 8px;
  }

  .site-nav { order: 2; }

  .site-logo { order: 1; }

  .btn-quote {
    order: 3;
    justify-self: center;
    font-size: 15px;
    padding: 13px 20px;
  }

  .hero {
    min-height: auto;
    padding: 56px 20px 72px;
  }
}

/* Telas estreitas ou baixas: o texto pinado não cabe, volta ao fluxo normal */
@media (max-width: 1023px), (max-height: 640px) {
  .manifesto-scroll { height: auto; }

  .manifesto-sticky {
    position: static;
    height: auto;
    padding: 24px;
  }

  .manifesto-text {
    font-size: clamp(1.35rem, 2.08vw, 2.5rem);
    gap: 40px;
  }

  .manifesto { gap: 60px; }

  /* sem pin não há vazio para recolher */
  .signature { margin-top: 0; }
}

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

  .service-card { min-height: auto; }

  .site-nav { gap: 14px; font-size: 12px; }

  .services { padding: 80px 20px; }

  .manifesto { padding: 80px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  * { transition: none !important; }

  .manifesto-text .w { opacity: 1; }

  .manifesto-scroll { height: auto; }

  .manifesto-sticky { position: static; height: auto; }

  .signature { margin-top: 0; }
}
