/* Ponteiro da abertura: propriedades registradas sem heranca (nao recalcula a subarvore). */
@property --px { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --py { syntax: "<length>"; inherits: false; initial-value: 0px; }

/* Zelyon Web v2: demonstracoes (palco da abertura e "Do pedido ao painel").
   Contrato (docs/02-direcao-arte-v2.md, sec. 3): o palco e so visual (data-demo,
   aria-hidden, nada focavel); controles, status e legenda ficam fora dele.
   Geometria: cada palco tem proporcao fixa e as pecas sao posicionadas em % de um
   "canvas" de referencia (comentado em cada bloco). Dentro das interfaces as medidas
   usam cqw da propria peca, com piso de 11 px para todo texto.
   Movimento: so transform, opacity, stroke-dashoffset e clip-path (entrada da secao). */

/* =====================================================================
   Pecas comuns: moldura de cantos, cotas, rotulos, aparelhos
   ===================================================================== */
.frame {
  position: absolute;
  z-index: 6;
  aspect-ratio: 1;
  border: 0 solid var(--zy-on-dark);
  pointer-events: none;
}
.frame--tl { left: 0; top: 0; border-top-width: var(--frame-w); border-left-width: var(--frame-w); border-top-left-radius: var(--corner); }
.frame--br { right: 0; bottom: 0; border-bottom-width: var(--frame-w); border-right-width: var(--frame-w); border-bottom-right-radius: var(--corner); }

/* cota: linha fina com terminais de 6 px e rotulo de 12 px no meio */
.cota {
  position: absolute;
  z-index: 6;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 420ms var(--ease-in-out);
}
.cota::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 6px;
  margin-top: -3px;
  border-left: 1px solid var(--zy-faint-on-dark);
  border-right: 1px solid var(--zy-faint-on-dark);
  background: linear-gradient(var(--zy-faint-on-dark), var(--zy-faint-on-dark)) center / 100% 1px no-repeat;
}
.cota__label {
  position: relative;
  padding-inline: 6px;
  background: var(--zy-navy);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--zy-faint-on-dark);
}
.plabel,
.flabel {
  position: absolute;
  z-index: 6;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--zy-faint-on-dark);
  white-space: nowrap;
  pointer-events: none;
}

.piece { position: absolute; }
.piece__in {
  position: absolute;
  inset: 0;
  /* deslocamento do ponteiro (demos.js): compoe com as animacoes, que usam transform */
  translate: var(--px, 0px) var(--py, 0px);
}
.device { position: absolute; inset: 0; }

/* navegador: raio 14, linha fina, barra de 36 px (na escala desenhada) com pilula de endereco */
.browser {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #0f2c47;
  box-shadow: var(--shadow-dark);
  container-type: inline-size;
}
.browser__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: max(16px, 5.6cqw);
  background: #0f2c47;
  border-bottom: 1px solid var(--zy-hair-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.browser__url {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40%;
  height: 62%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  line-height: 1;
  color: var(--zy-faint-on-dark);
  white-space: nowrap;
  overflow: hidden;
}
@container (max-width: 420px) { .browser__url { font-size: 0; } }
.browser__screen { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.browser--light { border-color: rgba(0, 35, 44, 0.14); box-shadow: var(--shadow-light); }

/* celular: sempre proporcional a 390 x 844; raio 44, bisel 10, tela com raio 34, ilha 64 x 18 */
.phone {
  padding: 2.6%;
  border-radius: 11.3% / 5.2%;
  background: #0d1f31;
  box-shadow: var(--shadow-dark), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.phone__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 9.2% / 4.1%;
  background: #faf6ef;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  container-type: inline-size;
}
.phone__island {
  position: absolute;
  z-index: 2;
  top: 2.6cqw;
  left: 50%;
  width: 17.3cqw;
  aspect-ratio: 64 / 18;
  margin-left: -8.65cqw;
  border-radius: 999px;
  background: #0d1f31;
}

/* contorno de desenho tecnico (so na camada "estrutura") */
.outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  display: none;
  pointer-events: none;
}
.outline rect {
  x: 0.5px;
  y: 0.5px;
  width: calc(100% - 1px);
  height: calc(100% - 1px);
  rx: 14px;
  fill: none;
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.phone .outline rect { rx: 11.3%; ry: 5.2%; }

/* =====================================================================
   Maré Marcenaria (marca inventada): site, portal e sistema
   Paleta propria e diferente da Zelyon (areia, madeira, salvia, ardosia),
   com titulo em serifa do sistema: e isso que prova "sob medida".
   ===================================================================== */
.f-sand { fill: #efe6d8; }
.f-sand-deep { fill: #e3d6c1; }
.f-paper { fill: #faf6ef; }
.f-sage { fill: #5f7a5a; }
.f-wood { fill: #6b4a2f; }
.f-wood-light { fill: #a77b50; }
.s-wood { stroke: #6b4a2f; stroke-width: 2; fill: none; }
.s-wood-thick { stroke: #6b4a2f; stroke-width: 5; stroke-linecap: round; fill: none; }
.d-line { fill: none; stroke: #6b4a2f; stroke-width: 1.4; }
.d-thin { fill: none; stroke: #8a6d52; stroke-width: 0.8; }
svg { shape-rendering: geometricPrecision; }

/* --- site (navegador escuro por fora, Maré por dentro) --- */
.ms {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 4.6cqw 4cqw;
  background: #faf6ef;
  color: #2a1f17;
}
.ms span { display: block; }
.ms__nav {
  flex: none;
  display: flex !important;
  align-items: center;
  gap: 3cqw;
  height: max(26px, 10.5cqw);
  border-bottom: 1px solid rgba(107, 74, 47, 0.16);
}
.ms__logo { font-family: Georgia, "Times New Roman", serif; font-size: max(13px, 3.8cqw); font-weight: 700; letter-spacing: -0.02em; color: #6b4a2f; }
.ms__links { display: flex !important; gap: 3cqw; margin-left: auto; font-size: max(11px, 2.15cqw); color: #5c4a3b; }
.ms__cta { padding: 0.9cqw 2.2cqw; border-radius: 2px; background: #6b4a2f; color: #faf6ef; font-size: max(11px, 2.15cqw); }
.ms__hero {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 4.4cqw;
  align-items: center;
  padding-block: 3.6cqw;
}
.ms__title { font-family: Georgia, "Times New Roman", serif; font-size: max(15px, 5.7cqw); font-weight: 400; line-height: 1.02; letter-spacing: -0.025em; color: #2a1f17; }
.ms__text { margin-top: 2.4cqw; font-size: max(11px, 2.3cqw); line-height: 1.45; color: #6b5a4b; }
.ms__btn { display: inline-block !important; margin-top: 3.4cqw; padding: 1.3cqw 2.8cqw; border-radius: 2px; background: #6b4a2f; color: #faf6ef; font-size: max(11px, 2.15cqw); }
.ms__img { position: relative; height: 100%; min-height: 0; overflow: hidden; border-radius: 2px; }
.ms__img svg { width: 100%; height: 100%; }
.ms__cats { flex: none; display: flex !important; gap: 1.8cqw; }
.ms__cats span { flex: 1; padding: 1.5cqw 2cqw; border-radius: 2px; background: #efe6d8; color: #6b4a2f; font-size: max(11px, 2.05cqw); }
.ms__cats span:nth-child(2) { background: #e4e8de; color: #4e6649; }
@container (max-width: 600px) {
  .ms__cats { display: none !important; }
  .ms { padding-bottom: 2cqw; }
}
@container (max-width: 380px) {
  .ms__links, .ms__cats, .ms__text, .ms__btn { display: none !important; }
  .ms__hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); padding-block: 3cqw 0; }
  .ms__cta { font-size: 11px; }
}

/* --- sistema da equipe (claro: branco e ardosia, salvia para concluido) --- */
.sp {
  display: flex;
  flex-direction: column;
  gap: 2.4cqw;
  height: 100%;
  padding: 3cqw 3.4cqw;
  background: #f7f8f9;
  color: #1f2a37;
}
.sp span { display: block; }
.sp__head { display: flex !important; align-items: center; gap: 5cqw; }
.sp__title { font-size: max(12px, 3.1cqw); font-weight: 640; letter-spacing: -0.01em; }
.sp__kpi { display: flex !important; align-items: baseline; gap: 1.6cqw; }
.sp__kpi-label { font-size: max(11px, 1.9cqw); color: #556170; }
.sp__kpi-value { font-size: max(14px, 4.4cqw); font-weight: 620; line-height: 1; font-variant-numeric: tabular-nums; }
.sp__board { flex: 1; min-height: 0; display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 1.8cqw; }
.sp__col { display: flex; flex-direction: column; gap: 1.4cqw; min-width: 0; padding: 1.8cqw; border-radius: 4px; background: #eceff2; }
.sp__col-title { font-size: max(11px, 1.9cqw); font-weight: 600; color: #4a5565; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp__col-title .s { display: none; }
.sp__card {
  display: flex !important;
  flex-direction: column;
  gap: 0.4cqw;
  padding: 1.4cqw 1.6cqw;
  border: 1px solid rgba(31, 42, 55, 0.1);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 42, 55, 0.06);
  font-size: max(11px, 2.05cqw);
  line-height: 1.3;
}
.sp__who { color: #556170; }
.sp__tag { align-self: flex-start; margin-top: 0.6cqw; padding: 0.3cqw 1.3cqw; border-radius: 999px; background: rgba(95, 122, 90, 0.16); color: #3f5a3b; font-size: max(11px, 1.8cqw); }
@container (max-width: 420px) {
  .sp { gap: 2cqw; padding: 3cqw; }
  .sp__card--extra, .sp__tag, .sp__kpi, .sp__who { display: none !important; }
  .sp__col-title .l { display: none; }
  .sp__col-title .s { display: inline; }
  .sp__col { padding: 2cqw; }
}

/* --- portal do cliente (abertura) --- */
.pt {
  display: flex;
  flex-direction: column;
  gap: 3cqw;
  height: 100%;
  padding: 14cqw 7cqw 7cqw;
  color: #2a1f17;
}
.pt span { display: block; }
.pt__top { display: flex !important; align-items: center; justify-content: space-between; }
.pt__brand { font-family: Georgia, "Times New Roman", serif; font-size: max(12px, 7.4cqw); font-weight: 700; color: #6b4a2f; }
.pt__avatar { display: grid !important; place-items: center; width: max(18px, 11cqw); aspect-ratio: 1; border-radius: 50%; background: #e4e8de; color: #4e6649; font-size: 11px; font-weight: 600; }
.pt__over { font-size: max(11px, 5.6cqw); color: #6b5a4b; }
.pt__title { font-family: Georgia, "Times New Roman", serif; font-size: max(13px, 8.6cqw); line-height: 1.08; letter-spacing: -0.01em; }
.pt__drawing { padding: 2cqw 4cqw; border-radius: 10px; background: #efe6d8; }
.pt__drawing svg { width: 100%; height: auto; }
.pt__steps { position: relative; display: flex; flex-direction: column; gap: 3.4cqw; margin-top: 1cqw; padding-left: 11cqw; font-size: max(11px, 6cqw); line-height: 1.2; }
.pt__steps::before { content: ""; position: absolute; left: 2.6cqw; top: 1.6cqw; bottom: 1.6cqw; width: 1.5px; background: rgba(107, 74, 47, 0.22); }
.pt__steps li { position: relative; color: #76675a; }
.pt__steps li::before {
  content: "";
  position: absolute;
  left: -11cqw;
  top: 0.15em;
  width: max(8px, 5.4cqw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid #c9b8a2;
  background: #faf6ef;
}
.pt__steps li.is-done { color: #2a1f17; }
.pt__steps li.is-done::before { background: #5f7a5a; border-color: #5f7a5a; }
.pt__steps li.is-now { color: #2a1f17; font-weight: 600; }
.pt__steps li.is-now::before { background: #6b4a2f; border-color: #6b4a2f; box-shadow: 0 0 0 max(3px, 2cqw) rgba(107, 74, 47, 0.16); }
.pt__msg { margin-top: auto; padding: 3.6cqw 4.4cqw; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px rgba(107, 74, 47, 0.14); font-size: max(11px, 5.4cqw); line-height: 1.3; color: #4a3a2d; }
.pt__msg b { display: block; font-weight: 600; color: #2a1f17; }
@container (max-width: 110px) {
  .pt__msg { display: none !important; }
  .pt { gap: 4cqw; padding: 16cqw 7cqw 7cqw; }
  .pt__over, .pt__drawing, .pt__avatar { display: none !important; }
  .pt__steps { padding-left: 13cqw; gap: 4cqw; }
  .pt__steps li::before { left: -13cqw; }
  .pt__steps::before { left: 3.6cqw; }
}

/* =====================================================================
   Camada "estrutura": desenho tecnico das mesmas telas (clonada pelo JS)
   ===================================================================== */
.device--finish,
.device--wire { transition: opacity 420ms var(--ease-in-out); }
.device--wire { opacity: 0; pointer-events: none; }
.hstage.is-structure .device--finish { opacity: 0; }
.hstage.is-structure .device--wire { opacity: 1; }
.hstage.is-structure .cota { opacity: 1; }
/* No desenho tecnico a peca da frente esconde as linhas da de tras (preenchimento opaco). */
.hstage .device.device--wire { background: #0a2238 !important; }

.device--wire,
.device--wire * {
  background: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
  color: transparent !important;
}
.device--wire .browser__bar { border-bottom: 1px solid rgba(143, 163, 173, 0.45) !important; }
.device--wire .browser__url { border: 1px solid rgba(143, 163, 173, 0.45) !important; }
.device--wire .phone__island { border: 1px solid rgba(143, 163, 173, 0.45) !important; }
.device--wire .outline { display: block; }
.device--wire .outline rect { stroke: var(--zy-faint-on-dark); }
.device--wire .tx { outline: 1px solid rgba(143, 163, 173, 0.32); outline-offset: -1px; }
.device--wire [data-block] { position: relative; outline: 1px dashed rgba(143, 163, 173, 0.75); outline-offset: 1px; }
.device--wire [data-block]::after {
  content: attr(data-block);
  position: absolute;
  z-index: 3;
  left: 2px;
  top: 2px;
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--zy-navy) !important;
  color: var(--zy-on-dark-muted) !important;
  font: 500 11px/1.2 var(--font);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.device--wire svg *:not(.outline *) { fill: none !important; stroke: rgba(143, 163, 173, 0.6) !important; stroke-width: 1px !important; vector-effect: non-scaling-stroke; }
.device--wire .pt__steps li::before { background: none !important; box-shadow: none !important; }
.device--wire .pt__steps li::before,
.device--wire .pt__steps::before { border: 1px solid rgba(143, 163, 173, 0.6) !important; }

/* =====================================================================
   Palco da abertura
   Canvas largo 840 x 700:
     site    (44, 44)   540 x 338     sistema (268, 340) 540 x 316
     portal  (578, 60)  164 x 355     traco: (814,121.5) -> (506,353.5), 37 graus
   Canvas estreito 370 x 370 (celular):
     site    (14, 30)  248 x 155      sistema (110, 172) 236 x 142
     portal  (234, 29) 112 x 242      traco: (365,93) -> (215,207)
   ===================================================================== */
.hstage {
  position: relative;
  aspect-ratio: 840 / 700;
  margin-right: calc(-1 * var(--bleed));
  container-type: inline-size;
}
.hstage .frame { width: 14.29%; }
.hstage .frame--br { right: 1.6%; }

.piece--site { left: 5.238%; top: 6.286%; width: 64.286%; aspect-ratio: 540 / 338; z-index: 1; }
.piece--system { left: 31.905%; top: 48.571%; width: 64.286%; aspect-ratio: 540 / 316; z-index: 2; }
.piece--portal { left: 68.81%; top: 8.571%; width: 19.524%; aspect-ratio: 164 / 355; z-index: 4; }
/* A pilula do sistema ficava sob o traco; a legenda da figura ja identifica a demonstracao. */
.piece--system .browser__url { visibility: hidden; }

.stroke { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.stroke line { stroke: var(--zy-lime); stroke-width: 6; stroke-linecap: round; }
.stroke--narrow { display: none; }
/* na estrutura o traco vira linha de construcao; no acabamento volta a ser o lima */
.stroke line { transition: opacity 420ms var(--ease-in-out); }
.stroke .stroke__guide { stroke: var(--zy-faint-on-dark); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0; }
.hstage.is-structure .stroke line:not(.stroke__guide) { opacity: 0; }
.hstage.is-structure .stroke .stroke__guide { opacity: 1; }

.cota--site { left: 5.238%; top: 2.2%; width: 64.286%; }
.cota--portal { left: 68.81%; top: 5.6%; width: 19.524%; }
.plabel--site { left: 5.238%; top: 57.6%; }
.plabel--portal { left: 71.5%; top: 1.4%; }
.plabel--system { left: 31.905%; top: 95.4%; }

/* Celular: canvas 390 x 460, palco sangrando nas duas bordas.
   site (-10, 40) 290 x 181 · sistema (120, 262) 290 x 174 · portal (236, 46) 116 x 251
   traco (372,136) -> (210,258): passa atras do portal e pousa na borda do sistema. */
@media (max-width: 599px) {
  .hstage { aspect-ratio: 390 / 460; margin-left: calc(-1 * var(--margin)); margin-right: calc(-1 * var(--margin)); }
  .hstage .frame { width: 16%; }
  .hstage .frame--tl { left: 4%; top: 2%; }
  .hstage .frame--br { right: 4%; }
  /* a peca do site comeca na margem de 20 px, sem sangrar a esquerda (a marca nao e cortada) */
  .piece--site { left: 5.13%; top: 8.696%; width: 70%; aspect-ratio: 248 / 155; }
  .piece--system { left: 30.77%; top: 56.96%; width: 74.36%; aspect-ratio: 236 / 142; }
  .piece--portal { left: 60.51%; top: 10%; width: 29.74%; aspect-ratio: 112 / 242; }
  .stroke line { stroke-width: 4; }
  .stroke--wide { display: none; }
  .stroke--narrow { display: block; }
  .cota { display: none; }
  .plabel--site { left: 6%; top: 49.6%; }
  .plabel--portal { left: 61%; top: 3.4%; }
  .plabel--system { left: 32%; top: 95%; }
  .browser { border-radius: 10px; }
  /* mini-site: so a marca; o botao ficaria sob o portal */
  .piece--site .ms__cta { display: none !important; }
  /* a peca sangra a esquerda; o conteudo do mini-site nao encosta na borda da tela */
}

/* =====================================================================
   Sequencia de abertura (so com html.intro: uma vez por sessao, sem movimento reduzido)
   t 0     h1 sobe por linha dentro da mascara (nunca opacidade 0: e o LCP)
   t 120   contornos se desenham; cotas a 55%
   t 300   texto de apoio e botoes
   t 560   pecas se encaixam (+90 ms entre elas); acabamento cruza com a estrutura
   t 1000  traco lima se desenha de cima para baixo; cantos avancam 8 px e fecham
   t 1300  indicador, etapa do portal e rotulos
   ===================================================================== */
@keyframes zy-line-up { from { transform: translateY(0.3em); } }
@keyframes zy-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes zy-fade { from { opacity: 0; } }
@keyframes zy-cota { from { opacity: 0; } to { opacity: 0.55; } }
@keyframes zy-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes zy-wire { 0%, 62% { opacity: 1; } 100% { opacity: 0; } }
@keyframes zy-lock-site { from { transform: translate(-24px, -16px); } }
@keyframes zy-lock-system { from { transform: translate(24px, 16px); } }
@keyframes zy-lock-portal { from { transform: translate(0, 32px) scale(0.96); } }
@keyframes zy-close-tl { from { transform: translate(-8px, -8px); } }
@keyframes zy-close-br { from { transform: translate(8px, 8px); } }
@keyframes zy-light { from { opacity: 0.2; transform: scale(0.5); } }

.intro .display .line__in { animation: zy-line-up 600ms var(--ease-out) both; }
.intro .display .line:nth-child(2) .line__in { animation-delay: 70ms; }
.intro .display .line:nth-child(3) .line__in { animation-delay: 140ms; }
.intro .display .line:nth-child(4) .line__in { animation-delay: 210ms; }
.intro .hero__lead { animation: zy-rise 400ms var(--ease-out) 300ms both; }
.intro .hero__actions { animation: zy-rise 400ms var(--ease-out) 360ms both; }
.intro .demo--hero .demo__bar,
.intro .demo--hero .demo__caption { animation: zy-fade 400ms var(--ease-out) 1300ms both; }

.intro .hstage .device--wire { opacity: 1; animation: zy-wire 900ms linear both; animation-delay: calc(0ms - var(--late, 0ms)); }
.intro .hstage .device--wire .outline rect { animation: zy-draw 480ms var(--ease-in-out) both; animation-delay: calc(120ms - var(--late, 0ms)); }
.intro .hstage .cota { animation: zy-cota 400ms var(--ease-out) 120ms both; }

.intro .piece--site .piece__in { animation: zy-lock-site 560ms var(--ease-lock) 560ms both; }
.intro .piece--system .piece__in { animation: zy-lock-system 560ms var(--ease-lock) 650ms both; }
.intro .piece--portal .piece__in { animation: zy-lock-portal 560ms var(--ease-lock) 740ms both; }
.intro .piece--site .device--finish { animation: zy-fade 420ms var(--ease-out) 560ms both; }
.intro .piece--system .device--finish { animation: zy-fade 420ms var(--ease-out) 650ms both; }
.intro .piece--portal .device--finish { animation: zy-fade 420ms var(--ease-out) 740ms both; }
/* sem o clone (JS atrasado), o acabamento ainda chega limpo */
.intro .piece .device:not(.device--wire):not(.device--finish) { animation: zy-fade 420ms var(--ease-out) 560ms both; }

.intro .stroke line:not(.stroke__guide) { stroke-dasharray: 1; animation: zy-draw 320ms var(--ease-in-out) 1000ms both; }
.intro .hstage .frame--tl { animation: zy-close-tl 320ms var(--ease-in-out) 1000ms both; }
.intro .hstage .frame--br { animation: zy-close-br 320ms var(--ease-in-out) 1000ms both; }

.intro .plabel { animation: zy-fade 400ms var(--ease-out) 1300ms both; }
.intro .pt__steps li.is-now::before { animation: zy-light 400ms var(--ease-out) 1300ms both; }

/* Os rotulos tecnicos saem ANTES do acabamento entrar (nada de rotulo fantasma no cruzamento). */
@keyframes zy-label-out { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.intro .hstage .device--wire [data-block]::after { animation: zy-label-out 520ms linear both; animation-delay: calc(0ms - var(--late, 0ms)); }

/* Marca o fim da sequencia: site.js tira html.intro no animationend desta animacao. */
@keyframes zy-intro-end { from { opacity: 0; } to { opacity: 0; } }
.intro .demo--hero::after { content: ""; position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; animation: zy-intro-end 20ms linear 1800ms both; }

/* =====================================================================
   "Do pedido ao painel"
   Canvas largo 1312 x 640: portal (136, 51) 248 x 537; painel (500, 85) 760 x 470
   Canvas medio 900 x 600:  portal (40, 56) 220 x 476;  painel (290, 96) 580 x 420
   Canvas estreito 350 x 400: portal e painel lado a lado (ver @media max-width 599px)
   ===================================================================== */
.fstage {
  position: relative;
  aspect-ratio: 1312 / 640;
  overflow: hidden;
  border-radius: var(--corner);
  background:
    radial-gradient(70% 90% at 85% 0%, rgba(0, 60, 70, 0.35), rgba(0, 60, 70, 0) 70%),
    linear-gradient(180deg, var(--zy-navy), var(--zy-abyss));
  box-shadow: var(--shadow-light);
  container-type: inline-size;
}
.fstage .frame { width: 7.3%; }
.fstage .frame--tl { left: 20px; top: 20px; }
.fstage .frame--br { right: 20px; bottom: 20px; }
.fpiece { position: absolute; }
.fpiece--portal { left: 10.37%; top: 7.97%; width: 18.9%; aspect-ratio: 248 / 537; z-index: 3; }
.fpiece--panel { left: 38.11%; top: 13.28%; width: 57.93%; aspect-ratio: 760 / 470; z-index: 2; }
.flabel--portal { left: 10.37%; top: 2.6%; }
.flabel--panel { left: 38.11%; top: 8.4%; }

@media (max-width: 1099px) {
  .fstage { aspect-ratio: 900 / 650; }
  .fstage .frame { width: 9%; }
  .fpiece--portal { left: 4.44%; top: 9.33%; width: 24.44%; aspect-ratio: 220 / 476; }
  .fpiece--panel { left: 32.22%; top: 14.6%; width: 64.44%; aspect-ratio: 580 / 470; }
  .flabel--portal { left: 13%; top: 4.2%; }
  .flabel--panel { left: 32.22%; top: 11.4%; }
}
/* Celular: portal e painel lado a lado (canvas 350 x 400), para a causa e o efeito
   ficarem na mesma tela; as etapas vem ACIMA do palco. */
@media (max-width: 599px) {
  .fstage { aspect-ratio: 350 / 400; margin-inline: calc(-1 * var(--margin) + 8px); }
  .fstage .frame { width: 16%; }
  .fstage .frame--tl { left: 10px; top: 10px; }
  .fstage .frame--br { right: 10px; bottom: 10px; }
  .fpiece--portal { left: 3%; top: 9%; width: 43%; aspect-ratio: 180 / 390; }
  .fpiece--panel { left: 53%; top: 13%; width: 44%; aspect-ratio: 160 / 300; }
  .flabel--portal { left: 11%; top: 3%; }
  .flabel--panel { left: 53%; top: 7.4%; }
  .browser--light { border-radius: 10px; }
  .demo--flow { display: grid; grid-template-columns: minmax(0, 1fr); }
  .demo--flow .steps { order: -1; margin-top: 0; margin-bottom: 16px; }
}

/* --- portal grande --- */
.fp {
  display: flex;
  flex-direction: column;
  gap: 3.2cqw;
  height: 100%;
  padding: 15cqw 6.4cqw 6.4cqw;
  color: #2a1f17;
  font-size: max(11px, 5cqw);
  line-height: 1.3;
}
.fp span { display: block; }
.fp__top { display: flex !important; align-items: baseline; justify-content: space-between; }
.fp__brand { font-family: Georgia, "Times New Roman", serif; font-size: max(13px, 6.8cqw); font-weight: 700; color: #6b4a2f; }
.fp__hello { font-size: max(11px, 4.8cqw); color: #6b5a4b; }
.fp__over { margin-top: 1cqw; font-size: max(11px, 4.6cqw); color: #6b5a4b; }
.fp__title { font-family: Georgia, "Times New Roman", serif; font-size: max(13px, 7.4cqw); line-height: 1.1; letter-spacing: -0.01em; }
.fp__drawing { position: relative; padding: 10cqw 3.6cqw 2cqw; border-radius: 10px; background: #efe6d8; transition: transform 120ms var(--ease-out); }
.fp__drawing svg { width: 100%; height: auto; }
/* rotulo da cota em HTML (texto em SVG encolheria abaixo de 11 px) */
.fp__dim { position: absolute; right: 3.6cqw; bottom: 1.6cqw; padding: 0 1.4cqw; background: #efe6d8; font-size: max(11px, 3.8cqw); font-weight: 500; line-height: 1.2; color: #6b4a2f; font-variant-numeric: tabular-nums; }
.fp__seal {
  position: absolute;
  top: 2.6cqw;
  left: 3cqw;
  padding: 0.6cqw 2.4cqw;
  border-radius: 999px;
  font-size: max(11px, 4cqw);
  font-weight: 600;
  line-height: 1.35;
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.fp__seal--wait { background: #faf6ef; color: #6b4a2f; box-shadow: inset 0 0 0 1px rgba(107, 74, 47, 0.3); }
.fp__seal--ok { background: #5f7a5a; color: #fff; opacity: 0; transform: scale(0.9); }

.fp__steps { position: relative; display: flex; flex-direction: column; gap: 2.4cqw; padding-left: 8.4cqw; }
.fp__steps::before,
.fp__steps::after {
  content: "";
  position: absolute;
  left: 2.3cqw;
  top: 2.2cqw;
  bottom: 2.2cqw;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
}
.fp__steps::before { background: rgba(107, 74, 47, 0.18); }
.fp__steps::after { background: #5f7a5a; transform: scaleY(var(--tl, 0)); transform-origin: top center; transition: transform 320ms var(--ease-out); }
.fp__step { position: relative; z-index: 1; color: #76675a; transition: color 240ms var(--ease-out); }
.fp__step-name { font-weight: 560; }
.fp__dot {
  position: absolute;
  left: -8.4cqw;
  top: 0.1em;
  width: max(10px, 4.6cqw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid #c9b8a2;
  background: #faf6ef;
}
.fp__dot::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  background: #5f7a5a;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.fp__subs { display: flex !important; flex-wrap: wrap; gap: 0.4cqw 2.6cqw; margin-top: 0.8cqw; font-size: max(11px, 4cqw); color: #76675a; }
.fp__sub { position: relative; padding-left: 3.4cqw; }
.fp__sub::before { content: ""; position: absolute; left: 0; top: 50%; width: 1.8cqw; aspect-ratio: 1; margin-top: -0.9cqw; border-radius: 50%; background: #c9b8a2; }
.fp__sub::after { content: ""; position: absolute; left: 0; top: 50%; width: 1.8cqw; aspect-ratio: 1; margin-top: -0.9cqw; border-radius: 50%; background: #5f7a5a; opacity: 0; transition: opacity 240ms var(--ease-out); }

.fp__when { margin-top: 0.6cqw; font-size: max(11px, 4.2cqw); color: #76675a; }
.fp__when--set { display: none !important; font-weight: 600; color: #2a1f17; }

.fp__foot { margin-top: auto; display: grid; gap: 2.4cqw; }
.fp__action {
  padding: 3cqw;
  border-radius: 10px;
  background: #6b4a2f;
  color: #faf6ef;
  text-align: center;
  font-weight: 600;
  transition: transform 120ms var(--ease-out);
}
.fp .fp__msgs { display: grid; }
.fp__msg { grid-area: 1 / 1; padding: 2.6cqw 3cqw; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px rgba(107, 74, 47, 0.14); font-size: max(11px, 4.2cqw); line-height: 1.35; color: #4a3a2d; }
.fp__msg b { display: block; font-weight: 600; color: #2a1f17; }

/* --- painel da equipe --- */
.pn {
  display: flex;
  flex-direction: column;
  gap: 2cqw;
  height: 100%;
  padding: 2.6cqw 2.8cqw;
  background: #fff;
  color: #1f2a37;
  font-size: max(11px, 1.6cqw);
  line-height: 1.3;
}
.pn span { display: block; }
.pn__head { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 1.6cqw; border-bottom: 1px solid rgba(31, 42, 55, 0.08); }
.pn__title { font-size: max(13px, 2.7cqw); font-weight: 640; letter-spacing: -0.01em; }
.pn__kpis { display: flex !important; gap: 3.4cqw; }
.pn__kpi { display: flex !important; flex-direction: column; align-items: flex-end; }
.pn__kpi-label { font-size: max(11px, 1.45cqw); color: #556170; }
.pn__kpi-value { display: inline-block !important; font-size: max(15px, 3.2cqw); font-weight: 620; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pn__board { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.3cqw; }
.pn__col { display: flex; flex-direction: column; gap: 1cqw; min-width: 0; padding: 1.2cqw; border-radius: 4px; background: #f0f2f4; }
.pn__col-head { display: flex !important; justify-content: space-between; align-items: baseline; gap: 4px; font-size: max(11px, 1.45cqw); font-weight: 600; color: #4a5565; }
.pn__col-head > span:first-child { min-width: 0; white-space: nowrap; }
.pn__col-head .s { display: none; }
.pn__card--row { flex-direction: row !important; justify-content: space-between; align-items: baseline; gap: 6px; }
.pn__card--row .pn__what,
.pn__card--row .pn__who { white-space: nowrap; }
.pn__card--row .pn__who { font-size: max(11px, 1.3cqw); }
.pn__n { display: inline-block !important; flex: none; font-variant-numeric: tabular-nums; color: #6b7684; }
.pn__cards { display: flex; flex-direction: column; gap: 1cqw; }
.pn__card {
  display: flex !important;
  flex-direction: column;
  gap: 0.3cqw;
  padding: 1.1cqw 1.2cqw;
  border: 1px solid rgba(31, 42, 55, 0.12);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 42, 55, 0.05);
  transition: transform 120ms var(--ease-out);
}
.pn__what { font-weight: 600; }
.pn__who { color: #556170; }
.pn__card--hl { border-color: rgba(31, 42, 55, 0.24); }
.pn__tags { display: grid !important; margin-top: 0.6cqw; }
.pn__tag {
  grid-area: 1 / 1;
  justify-self: start;
  padding: 0.2cqw 1cqw;
  border-radius: 999px;
  font-size: max(11px, 1.35cqw);
  font-weight: 500;
  max-width: 100%;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 240ms var(--ease-out);
}
.pn__tag--1 { background: #e8edf5; color: #2f4a6d; }
.pn__tag--2,
.pn__tag--3,
.pn__tag--4 { background: rgba(95, 122, 90, 0.16); color: #3f5a3b; }
.pn__agenda { flex: none; display: flex; align-items: center; gap: 2cqw; padding-top: 1.6cqw; border-top: 1px solid rgba(31, 42, 55, 0.08); }
.pn__agenda-title { flex: none; font-weight: 600; color: #4a5565; }
.pn__days { display: flex !important; gap: 1.2cqw; min-width: 0; }
.pn__day { display: flex !important; gap: 0.8cqw; padding: 0.7cqw 1.2cqw; border-radius: 4px; background: #f0f2f4; white-space: nowrap; transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
.pn__day b { font-weight: 600; }
.pn__day--new { background: rgba(95, 122, 90, 0.16); color: #2f4530; opacity: 0; transform: translateY(4px); }

/* painel no tamanho medio: quadro ainda com quatro colunas, agenda mais curta */
@container (max-width: 520px) {
  .pn { gap: 2.4cqw; }
  .pn__agenda-title { display: none !important; }
  .pn__days { flex-wrap: wrap; row-gap: 1.2cqw; }
  .pn__col-head .l { display: none; }
  .pn__col-head .s { display: block; }
  .pn__card--row .pn__who { display: none; }
  .pn__cards { gap: 0.8cqw; }
  .pn__card--row { padding: 0.5cqw 1.2cqw; }
}
/* painel estreito (celular): so a coluna do pedido da Helena */
@container (max-width: 300px) {
  .pn { padding: 3.6cqw; gap: 3.2cqw; }
  .pn__head { flex-direction: column; align-items: flex-start; gap: 2cqw; }
  .pn__kpis { gap: 6cqw; }
  .pn__kpi { align-items: flex-start; }
  .pn__board { grid-template-columns: minmax(0, 1fr); }
  .pn__col { display: none; padding: 3cqw; gap: 2.6cqw; }
  .pn__cards { gap: 2.6cqw; }
  .pn__card { padding: 2.6cqw 3cqw; gap: 0.6cqw; }
  .pn__tags { margin-top: 1.4cqw; }
  .pn__tag { padding: 0.4cqw 2.4cqw; }
  .pn__agenda { padding-top: 3cqw; }
  .pn__day { padding: 1.4cqw 2.6cqw; gap: 2cqw; }
  .pn__day:not(.pn__day--new) { display: none !important; }
  .pn__day--new { display: flex !important; }
  .demo--flow[data-step="1"] .pn__col[data-col="1"],
  .demo--flow[data-step="2"] .pn__col[data-col="3"],
  .demo--flow[data-step="3"] .pn__col[data-col="3"],
  .demo--flow[data-step="4"] .pn__col[data-col="4"] { display: flex; }
  .demo--flow:not([data-step="4"]) .pn__agenda { opacity: 0.6; }
}
/* portal no tamanho do celular */
@container (max-width: 200px) {
  .fp { gap: 3.6cqw; padding: 16cqw 6cqw 6cqw; }
  .fp__hello, .fp__over, .fp__subs, .fp__msgs { display: none !important; }
  .fp__drawing { padding: 12cqw 3cqw 1cqw; }
  .fp__seal { top: 2cqw; left: 2.4cqw; padding: 0 2.6cqw; }
  .fp__steps { gap: 3cqw; padding-left: 10cqw; }
  .fp__dot { left: -10cqw; width: 6cqw; }
  .fp__steps::before, .fp__steps::after { left: 3cqw; }
  .fp__action { padding: 3.6cqw; }
}
@container (min-width: 201px) and (max-width: 230px) {
  .fp__subs, .fp__hello { display: none !important; }
}

/* --- estados por etapa (o JS so troca data-step; o CSS desenha) --- */
.demo--flow[data-step="1"] .fp__steps { --tl: 0; }
.demo--flow[data-step="2"] .fp__steps { --tl: 0.3334; }
.demo--flow[data-step="3"] .fp__steps { --tl: 0.6667; }
.demo--flow[data-step="4"] .fp__steps { --tl: 1; }

.demo--flow[data-step="1"] .fp__step[data-at="1"],
.demo--flow[data-step="2"] .fp__step:is([data-at="1"], [data-at="2"]),
.demo--flow[data-step="3"] .fp__step:is([data-at="1"], [data-at="2"], [data-at="3"]),
.demo--flow[data-step="4"] .fp__step { color: #2a1f17; }
.demo--flow[data-step="1"] .fp__step[data-at="1"] .fp__dot::after,
.demo--flow[data-step="2"] .fp__step:is([data-at="1"], [data-at="2"]) .fp__dot::after,
.demo--flow[data-step="3"] .fp__step:is([data-at="1"], [data-at="2"], [data-at="3"]) .fp__dot::after,
.demo--flow[data-step="4"] .fp__step .fp__dot::after { opacity: 1; transform: none; }
.demo--flow[data-step="3"] .fp__step[data-at="3"] .fp__dot { box-shadow: 0 0 0 max(3px, 1.6cqw) rgba(95, 122, 90, 0.2); }
.demo--flow[data-step="3"] .fp__sub:is(.fp__sub--a, .fp__sub--b),
.demo--flow[data-step="4"] .fp__sub { color: #2a1f17; }
.demo--flow[data-step="3"] .fp__sub:is(.fp__sub--a, .fp__sub--b)::after,
.demo--flow[data-step="4"] .fp__sub::after { opacity: 1; }
.demo--flow[data-step="4"] .fp__when--tbd { display: none !important; }
.demo--flow[data-step="4"] .fp__when--set { display: block !important; }
.demo--flow:not([data-step="1"]) .fp__seal--wait { opacity: 0; transform: scale(0.9); }
.demo--flow:not([data-step="1"]) .fp__seal--ok { opacity: 1; transform: none; }
.fp .fp__act { display: none; }
.demo--flow[data-step="1"] .fp .fp__act--1,
.demo--flow[data-step="2"] .fp .fp__act--2,
.demo--flow[data-step="3"] .fp .fp__act--3,
.demo--flow[data-step="4"] .fp .fp__act--4 { display: block; }
.demo--flow:not([data-step="1"]) .fp__action { background: transparent; color: #6b4a2f; box-shadow: inset 0 0 0 1.5px rgba(107, 74, 47, 0.45); }
/* etapa 2: desenho aprovado e a mesa ENTRANDO em producao (o portal acompanha o painel) */
.demo--flow[data-step="2"] .fp__step[data-at="3"] { color: #2a1f17; }
.demo--flow[data-step="2"] .fp__step[data-at="3"] .fp__dot { border-color: #5f7a5a; box-shadow: 0 0 0 max(3px, 1.6cqw) rgba(95, 122, 90, 0.2); }
.fp__msg { opacity: 0; transition: opacity 240ms var(--ease-out); }
.demo--flow[data-step="1"] .fp__msg--1,
.demo--flow[data-step="2"] .fp__msg--2,
.demo--flow[data-step="3"] .fp__msg--3,
.demo--flow[data-step="4"] .fp__msg--4 { opacity: 1; }

.demo--flow[data-step="1"] .pn__tag--1,
.demo--flow[data-step="2"] .pn__tag--2,
.demo--flow[data-step="3"] .pn__tag--3,
.demo--flow[data-step="4"] .pn__tag--4 { opacity: 1; }
.demo--flow[data-step="4"] .pn__day--new { opacity: 1; transform: none; }

/* origem e destino de cada etapa: realce lima (o mesmo traco que liga as telas) */
.fstage .is-origin,
.fstage .is-dest {
  border-radius: 4px;
  outline: 1.5px solid var(--zy-lime);
  outline-offset: 2px;
  background-color: rgba(164, 208, 6, 0.14);
}
.fstage .pn__card.is-origin,
.fstage .pn__card.is-dest,
.fstage .pn__day.is-dest { background-color: #f6faea; }
.fstage .is-press { transform: scale(0.97); }

/* traco que liga o portal ao painel (o JS mede e posiciona) */
.link { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.link__line,
.link__pulse { fill: none; stroke-linecap: round; stroke-width: 6; }
.link__line { stroke: var(--zy-lime); opacity: 0; transition: opacity 160ms var(--ease-out); }
.link__line.is-on { opacity: 1; }
.link__pulse { stroke: #f4f7f8; opacity: 0; }
.link__end { fill: var(--zy-navy); stroke: var(--zy-lime); stroke-width: 3; opacity: 0; transition: opacity 160ms var(--ease-out); }
.link.has-end .link__end { opacity: 1; }
/* destino do traco em repouso: o card ativo guarda um filete lima (o anel na borda aponta para ele) */
.fstage [data-card] { outline: 1.5px solid var(--zy-lime); outline-offset: 2px; }
.flow.is-pending .link { opacity: 0; }
.flow.is-in .link { transition: opacity 240ms var(--ease-out) 900ms; }
@media (max-width: 599px) {
  .link__line,
  .link__pulse { stroke-width: 4; }
}

/* entrada da secao (uma vez; so com JS e sem movimento reduzido) */
.flow.is-pending .h2 .line__in { transform: translateY(105%); }
.flow.is-pending .fstage { clip-path: inset(0 0 100% 0 round var(--corner)); }
.flow.is-pending .fpiece { opacity: 0; transform: translateY(16px); }
.flow.is-in .h2 .line__in { transition: transform 640ms var(--ease-out); }
.flow.is-in .fstage { clip-path: inset(0 0 0 0 round var(--corner)); transition: clip-path 640ms var(--ease-out); }
.flow.is-in .fpiece { transition: opacity 560ms var(--ease-out) 200ms, transform 560ms var(--ease-out) 200ms; }
.flow.is-in .fpiece--panel { transition-delay: 290ms; }

/* =====================================================================
   Movimento reduzido: estado final, trocas so por opacidade em 120 ms
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .device--finish,
  .device--wire,
  .cota,
  .stroke line { transition-duration: 120ms; transition-timing-function: linear; }
  .fp__seal,
  .pn__day--new { transform: none !important; }
  .fp__steps::after { transition: none; }
  .fp__dot::after { transform: none; }
  .fp__seal, .fp__msg, .pn__tag, .pn__day, .fp__dot::after, .fp__sub::after, .link__line { transition-duration: 120ms; }
  .steps::after { transition: none; }
  .fstage .is-press { transform: none; }
}

/* mini-site: o botao fica sempre a direita, nunca colado a marca */
.ms__nav .ms__cta { margin-left: auto; }
