/* ============================================================
   ESTÚDIO · motor de estilos dos 12 conceitos (botão, valores, efeitos).
   A barra de personalização mora em conceitos/modelo
   Acompanha conceitos/scrub/estudio.js. Tudo prefixado com .est-
   para não colidir com o CSS de cada conceito.
   ============================================================ */

.est-ui, .est-ui * { box-sizing: border-box; }
.est-ui {
  --est-ink: #0F172A;
  --est-ink-soft: #1E293B;
  --est-muted: #5B6779;
  --est-line: #E4E7EC;
  --est-line-soft: #F1F3F5;
  --est-sage: #5D7860;
  --est-sage-deep: #44593F;
  --est-sage-soft: #EEF2EC;
  --est-serif: "Literata", Georgia, serif;
  --est-sans: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --est-ease: cubic-bezier(.22, 1, .36, 1);
  font-family: var(--est-sans);
  color: var(--est-ink);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
}

/* ---------- botão flutuante ---------- */
.est-fab {
  position: fixed;
  left: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 140;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px 0 16px;
  background: #FFFFFF;
  color: var(--est-ink);
  border: 1px solid var(--est-line);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 10px 30px rgba(15,23,42,.12);
  font: 500 15px/1 var(--est-sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform .3s var(--est-ease), box-shadow .3s var(--est-ease), border-color .3s var(--est-ease), opacity .25s ease-out;
}
.est-fab:hover { transform: translateY(-2px); border-color: #C9D3C6; box-shadow: 0 2px 4px rgba(15,23,42,.06), 0 16px 36px rgba(15,23,42,.14); }
.est-fab svg { width: 20px; height: 20px; color: var(--est-sage); flex: none; }
.est-fab:focus-visible { outline: 2px solid rgba(93,120,96,.6); outline-offset: 3px; }

/* ---------- celular: botão só com ícone ---------- */
@media (max-width: 720px) {
  .est-fab { left: 12px; bottom: calc(88px + env(safe-area-inset-bottom)); padding: 0; width: 52px; height: 52px; justify-content: center; }
  .est-fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .est-fab svg { width: 22px; height: 22px; }
}

@media print { .est-ui { display: none !important; } }

/* ============================================================
   VALORES · arredondamento (só quando o slider é usado)
   ============================================================ */
html[data-est-raio] :is(button, input[type="submit"], [class*="btn"], [class*="cta"], [class*="button"]):not(.est-ui, .est-ui *) {
  border-radius: var(--est-raio) !important;
}
html[data-est-raio] :is([class*="card"], [class*="tile"]):not([class*="card-"], [class*="tile-"], [class*="-txt"], .est-ui, .est-ui *) {
  border-radius: min(var(--est-raio), 28px) !important;
  overflow: clip;
}

/* ============================================================
   EFEITOS · substituem só a animação de entrada do [data-reveal]
   da camada compartilhada (concept-base.css). "Esmaecer" não tem
   regra aqui: é o padrão original, intocado. As mesmas unidades
   continuam sendo reveladas (sem vão novo). Fill "backwards" de
   propósito: terminada a entrada, o elemento volta ao estilo dele,
   sem transform/clip/filter residual prendendo sombra ou foco.
   ============================================================ */
html.js[data-fx="nenhum"] [data-reveal] { opacity: 1 !important; animation: none !important; }

html.js[data-fx="deslizar"] [data-reveal]:not([data-reveal="rule"]).is-in {
  animation: estSlide var(--est-dur, 820ms) cubic-bezier(.22, 1, .36, 1) var(--rv-delay, 0ms) backwards;
}
html.js[data-fx="escala"] [data-reveal]:not([data-reveal="rule"]).is-in {
  animation: estScale var(--est-dur, 900ms) cubic-bezier(.22, 1, .36, 1) var(--rv-delay, 0ms) backwards;
}
html.js[data-fx="recorte"] [data-reveal]:not([data-reveal="rule"]).is-in {
  animation: estClip var(--est-dur, 1000ms) cubic-bezier(.65, 0, .35, 1) var(--rv-delay, 0ms) backwards;
}
html.js[data-fx="desfoque"] [data-reveal]:not([data-reveal="rule"]).is-in {
  animation: estBlur var(--est-dur, 900ms) cubic-bezier(.22, 1, .36, 1) var(--rv-delay, 0ms) backwards;
}
html.js[data-fx="flex"] [data-reveal]:not([data-reveal="rule"]).is-in {
  animation: estFlex var(--est-dur, 1100ms) cubic-bezier(.34, 1.36, .64, 1) var(--rv-delay, 0ms) backwards;
}
/* o passo da escada fica um pouco maior nos efeitos com movimento */
html.js[data-fx="deslizar"], html.js[data-fx="escala"], html.js[data-fx="recorte"],
html.js[data-fx="desfoque"], html.js[data-fx="flex"] { --rv-step: 90ms; }

@keyframes estSlide { from { opacity: 0; transform: translate3d(0, 32px, 0); } to { opacity: 1; transform: none; } }
@keyframes estScale { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes estClip  { from { opacity: 1; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes estBlur  { from { opacity: 0; filter: blur(14px); } to { opacity: 1; filter: blur(0); } }
@keyframes estFlex  { from { opacity: 0; transform: translate3d(0, 56px, 0) scale(.96); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes estFadeOnly { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .est-fab { transition-duration: .01ms !important; }
  /* dentro do editor o efeito foi escolhido de propósito: toca igual.
     No modelo aberto sozinho, quem pediu menos movimento vê só o fade. */
  html.js[data-fx]:not(.est-embed) [data-reveal]:not([data-reveal="rule"]).is-in {
    animation: estFadeOnly 280ms ease-out var(--rv-delay, 0ms) backwards !important;
  }
  html.js[data-fx="nenhum"] [data-reveal] { animation: none !important; }
}

/* dentro do editor, no celular, o aviso do conceito ocupa uma linha só:
   continua dizendo que é demonstração, sem tomar a prévia */
@media (max-width: 720px) {
  html.est-embed .concept-banner { font-size: 8.5px !important; letter-spacing: .06em !important; padding: 4px 8px !important; line-height: 1.3 !important; }
  html.est-embed .concept-banner a { display: none !important; }
}

/* troca de foto ao mudar a paleta: a antiga desfoca e pulsa enquanto a
   nova carrega; a nova entra nítida. Só filtro e opacidade. */
img.est-img { transition: filter .5s cubic-bezier(.22,1,.36,1), opacity .5s cubic-bezier(.22,1,.36,1); }
img.est-img-loading {
  filter: blur(10px) saturate(.7);
  transition-delay: 120ms;
  animation: estImgPulse 1.1s ease-in-out 120ms infinite;
}
@keyframes estImgPulse { 0%, 100% { opacity: .55; } 50% { opacity: .85; } }
