/* =====================================================================
   CENA DA SEDE NO CELULAR (24/11/2026)
   A mesma da home antiga, a pedido dele ("a parte do escritório no celular
   eu quero que continue a mesma… vinha a tela inteira, achava bonito").
   Regras trazidas da home antiga (bloco v14 do <style> + home-refinement,
   refino-2026, mescla-2026 e capa-2026), com os tokens já resolvidos:
   o resultado na tela é o mesmo. Só abaixo de 768 px; no computador e no
   tablet a capa nova (sede em camadas) continua como está.
   JS: assets/cena-sede.js (GSAP, carregado só no celular).
   ===================================================================== */

/* as mesmas calibragens de fonte da home antiga (mescla-2026.css): a mesma
   Manrope, com o tamanho ajustado por face. É isso que dá o título da cena em
   4 linhas e o peso que ele tinha. font-synthesis: none, como lá. */
@font-face { font-family: "KO Cena Texto"; src: url("fonts/manrope-latin.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; size-adjust: 104%; }
@font-face { font-family: "KO Cena Titulos"; src: url("fonts/manrope-latin.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; size-adjust: 96%; }
@font-face { font-family: "KO Cena Titulos Grande"; src: url("fonts/manrope-latin.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; size-adjust: 77.5%; }

.office-story-mobile { display: none; }

@media (max-width: 767.98px) {
  /* no celular a capa rola normal e a cena faz o papel de palco */
  .capa { position: relative; top: auto; }
  .capa-sede { display: none; }
  #folha-1 { margin-top: calc(-1 * var(--r-folha)); }

  .office-story-mobile {
    display: block;
    position: relative;
    min-height: 100svh;
    margin-top: -1px;
    padding: 0;
    background: #08090B;
    color: #F2F4F8;
    overflow: clip;
    z-index: 2;
    font-synthesis: none;
  }
  .office-story-mobile.is-enhanced { min-height: 160svh; height: 160svh; }

  .office-story-stage {
    --story-inset-x: 0px;
    --story-inset-top: 0px;
    --story-inset-bottom: 0px;
    --story-radius: 0px;
    --story-progress: 1;
    position: sticky;
    top: 0;
    min-height: 100svh;
    height: 100svh;
    isolation: isolate;
    overflow: hidden;
    display: block;
  }

  .office-story-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: 0;
    background: #1F232B;
    clip-path: inset(var(--story-inset-top) var(--story-inset-x) var(--story-inset-bottom) var(--story-inset-x) round var(--story-radius));
    will-change: clip-path;
  }

  /* moldura da prancha: fio claro + sombra; dissolve quando ela abre */
  .office-story-frame {
    position: absolute;
    top: var(--story-inset-top);
    right: var(--story-inset-x);
    bottom: var(--story-inset-bottom);
    left: var(--story-inset-x);
    z-index: 1;
    pointer-events: none;
    border-radius: var(--story-radius);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 18px 52px rgba(0, 0, 0, .5);
    opacity: var(--story-frame, 0);
  }

  .office-story-media picture,
  .office-story-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    display: block;
  }
  .office-story-media img {
    object-fit: cover;
    object-position: center 38%;
    transform: scale(1.06);
    transform-origin: center center;
    will-change: transform;
  }

  .office-story-media::before,
  .office-story-media::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
  .office-story-media::before {
    z-index: 2;
    background: linear-gradient(180deg, rgba(15, 17, 22, .28) 0%, rgba(15, 17, 22, .08) 34%, rgba(15, 17, 22, .78) 100%);
  }
  .office-story-media::after {
    z-index: 3;
    background:
      linear-gradient(90deg, transparent 0 18%, rgba(255, 255, 255, .11) 18.2%, transparent 18.9%),
      linear-gradient(90deg, transparent 0 64%, rgba(255, 255, 255, .08) 64.2%, transparent 64.9%);
    opacity: .42;
    mix-blend-mode: soft-light;
  }

  .office-story-content {
    position: absolute;
    left: 1.5rem;
    right: 2.5rem;
    bottom: calc(env(safe-area-inset-bottom) + 2rem);
    z-index: 4;
    width: min(calc(100% - 4rem), 22rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .58);
  }
  .office-story-kicker {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    font-family: "KO Cena Texto", var(--fonte);
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .74);
  }
  .office-story-kicker::before {
    content: "";
    width: 30px;
    height: 1px;
    background: currentColor;
    opacity: .76;
  }
  .office-story-content h2 {
    margin: 0;
    max-width: 6.53em;
    font-family: "KO Cena Titulos Grande", var(--fonte);
    font-size: clamp(2.05rem, 11.5vw, 3.35rem);
    font-weight: 600;
    line-height: .98;
    letter-spacing: 0;
    text-wrap: balance;
    color: #F2F4F8;
  }
  .office-story-content p {
    margin: 0;
    font-family: "KO Cena Texto", var(--fonte);
    max-width: 29ch;
    font-size: .9375rem;
    line-height: 1.55;
    color: rgba(245, 242, 236, .78);
  }

  .office-story-caption {
    position: absolute;
    left: 1.5rem;
    right: 3rem;
    top: calc(env(safe-area-inset-top) + 1.5rem);
    z-index: 4;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-family: "KO Cena Texto", var(--fonte);
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(245, 242, 236, .7);
    text-shadow: 0 1px 14px rgba(0, 0, 0, .55);
  }
  .office-story-caption .fig-num {
    font-family: "KO Cena Titulos", var(--fonte);
    font-style: italic;
    font-size: .8125rem;
    letter-spacing: 0;
    text-transform: none;
    color: #FFFFFF;
  }
  .office-story-caption .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #FFFFFF;
    flex: none;
  }

  .office-story-progress {
    position: absolute;
    top: calc(env(safe-area-inset-top) + 1.5rem);
    right: 1.25rem;
    bottom: calc(env(safe-area-inset-bottom) + 2rem);
    z-index: 5;
    width: 1px;
    background: rgba(245, 242, 236, .18);
  }
  .office-story-progress span {
    display: block;
    width: 1px;
    height: 100%;
    transform: scaleY(var(--story-progress));
    transform-origin: top center;
    background: #FFFFFF;
  }
  .office-story-mobile.is-enhanced .office-story-stage { --story-progress: 0; }

  /* caminho sem GSAP (o JS marca .is-vanilla): a narrativa entra quando a moldura abre */
  .office-story-mobile.is-vanilla .office-story-caption,
  .office-story-mobile.is-vanilla .office-story-kicker,
  .office-story-mobile.is-vanilla #office-story-title,
  .office-story-mobile.is-vanilla .office-story-content p {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 640ms cubic-bezier(0, 0, .2, 1), transform 820ms cubic-bezier(.16, 1, .3, 1);
  }
  .office-story-mobile.is-vanilla #office-story-title { transform: translateY(24px); }
  .office-story-mobile.is-vanilla .office-story-stage.is-told .office-story-caption { opacity: 1; transform: none; transition-delay: 40ms; }
  .office-story-mobile.is-vanilla .office-story-stage.is-told .office-story-kicker { opacity: 1; transform: none; transition-delay: 140ms; }
  .office-story-mobile.is-vanilla .office-story-stage.is-told #office-story-title { opacity: 1; transform: none; transition-delay: 240ms; }
  .office-story-mobile.is-vanilla .office-story-stage.is-told .office-story-content p { opacity: 1; transform: none; transition-delay: 380ms; }
  .office-story-mobile.is-vanilla .office-story-kicker::before { transition: width 620ms cubic-bezier(.16, 1, .3, 1) 200ms; width: 0; }
  .office-story-mobile.is-vanilla .office-story-stage.is-told .office-story-kicker::before { width: 30px; }

  /* caminho GSAP: o fio da etiqueta se desenha por variável */
  .office-story-mobile.is-enhanced:not(.is-vanilla) .office-story-kicker::before {
    transform: scaleX(var(--kicker-line, 1));
    transform-origin: left center;
  }

  /* clarão de revelação quando a moldura termina de abrir */
  .office-story-mobile.is-enhanced .office-story-media { --reveal-sweep: 0; }
  .office-story-mobile.is-enhanced .office-story-reveal-glow {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: calc(var(--reveal-sweep) * .9);
    background: radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, .2), transparent 55%);
    mix-blend-mode: screen;
  }

  /* durante a cena o cabeçalho sai de cena, como antes */
  body.office-story-active .topo { transform: translateY(calc(-100% - 8px)); }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .office-story-mobile { min-height: 100svh; }
  .office-story-stage { min-height: 100svh; }
  .office-story-media { clip-path: inset(0 0 0 0 round 0); will-change: auto; }
  .office-story-frame { display: none; }
  .office-story-media img { transform: none; will-change: auto; }
}
