/* papelito · cores da pasta "color co" (rainbow color palette) */
:root {
  --c1: #F5EBDC; --c2: #FCCBBC; --c3: #E98D76;
  --c4: #B5704F; --c5: #D58143; --c6: #E1A863;
  --c7: #C0DEE6; --c8: #819A9F; --c9: #AFB76E;
  --c10: #56694D; --c11: #163E1F; --c12: #163230;
  --fundo: #F5EBDC;
  --papel: #FFFBF3;
  --tinta: #163230;
  --suave: #819A9F;
  --linha: rgba(22, 50, 48, .12);
  --destaque: #E98D76;
  --raio: 22px;
  --ui: 'Jost', system-ui, sans-serif;
  --fofa: 'Fredoka', 'Jost', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fundo);
  color: var(--tinta);
  font-family: var(--ui);
  font-size: 15px;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a, button, input, select, textarea, [tabindex] { outline: none; -webkit-tap-highlight-color: transparent; }
:focus, :focus-visible { outline: none; box-shadow: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- marca ---------- */
.marca { font-family: var(--fofa); font-weight: 600; margin: 0; letter-spacing: -.01em; line-height: 1; }
.marca span:nth-child(1) { color: #E98D76; }
.marca span:nth-child(2) { color: #E1A863; }
.marca span:nth-child(3) { color: #AFB76E; }
.marca span:nth-child(4) { color: #819A9F; }
.marca span:nth-child(5) { color: #D58143; }
.marca span:nth-child(6) { color: #56694D; }
.marca span:nth-child(7) { color: #B5704F; }
.marca span:nth-child(8) { color: #E98D76; }
.marca-p { font-size: 26px; }

/* ---------- pílulas ---------- */
.pilula {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 28px;
  border-radius: 999px; background: var(--papel); color: var(--tinta);
  font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  white-space: nowrap; transition: transform .15s, background .15s;
}
.pilula:hover { transform: translateY(-1px); }
.pilula.escura { background: var(--tinta); color: var(--c1); }
.so-icone {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1; flex: none;
}
.so-icone:hover { background: rgba(22, 50, 48, .06); }
.so-icone:disabled { opacity: .3; cursor: default; }

/* =================== início =================== */
#inicio { max-width: 1240px; margin: 0 auto; padding: 72px 40px 64px; }
.topo-inicio { text-align: center; padding: 40px 0 72px; }
.topo-inicio .marca { font-size: clamp(64px, 12vw, 150px); }
.sub { margin: 28px 0 0; font-size: 12px; letter-spacing: .5em; color: var(--suave); }
.bloco { margin-top: 64px; }
.titulo-bloco {
  margin: 0 0 28px; font-weight: 500; font-size: 13px; letter-spacing: .4em; text-transform: uppercase; color: var(--suave);
}
.linha-rola { display: flex; gap: 22px; overflow-x: auto; padding: 6px 2px 18px; scrollbar-width: none; }
.linha-rola::-webkit-scrollbar { display: none; }
.tamanho {
  flex: none; width: 168px; display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 26px 24px 22px; border-radius: var(--raio); background: var(--papel); transition: transform .2s;
}
.tamanho:hover { transform: translateY(-3px); }
.tamanho .mini { border-radius: 8px; box-shadow: 0 6px 14px rgba(22, 50, 48, .08); }
.tamanho b { font-weight: 500; font-size: 14px; letter-spacing: .08em; }
.tamanho small { font-size: 11px; color: var(--suave); letter-spacing: .1em; }

.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px; }
.grade-papeis { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.cartao { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.cartao .capa {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; background: var(--papel) center / cover no-repeat;
  box-shadow: 0 10px 26px rgba(22, 50, 48, .08); transition: transform .25s, box-shadow .25s;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.cartao .capa img { max-width: 100%; max-height: 100%; display: block; }
.cartao:hover .capa { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 18px 36px rgba(22, 50, 48, .14); }
.cartao .rotulo { padding: 0 6px; font-size: 14px; font-weight: 500; letter-spacing: .06em; }
.cartao .rotulo small { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; color: var(--suave); letter-spacing: .14em; }
.grade-papeis .cartao .capa { aspect-ratio: 1.36; border-radius: 12px; }
.rodape { text-align: center; padding: 120px 0 40px; }

/* folhas (camadas por cima) */
.folha { position: fixed; inset: 0; z-index: 50; background: rgba(22, 50, 48, .28); display: flex; align-items: flex-end; justify-content: center; }
.folha-caixa {
  width: min(1100px, 100%); max-height: 88vh; overflow: auto; background: var(--fundo);
  border-radius: 28px 28px 0 0; padding: 28px 40px 56px; animation: sobe .25s cubic-bezier(.22, 1, .36, 1);
}
.folha-caixa.pequena { width: min(460px, 100%); }
@media (min-width: 821px) { .folha { align-items: center; } .folha-caixa { border-radius: 28px; } }
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } }
.folha-topo { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.folha-topo h3 { flex: 1; margin: 0; font-weight: 500; font-size: 13px; letter-spacing: .4em; text-transform: uppercase; }
.lista-opcoes { display: flex; flex-direction: column; gap: 12px; }
.lista-opcoes button { text-align: left; padding: 18px 28px; border-radius: 18px; background: var(--papel); letter-spacing: .06em; }
.lista-opcoes button:hover { background: var(--c2); }

/* =================== editor =================== */
#editor {
  position: fixed; inset: 0; display: grid;
  grid-template-columns: 96px auto 1fr 300px;
  grid-template-rows: 72px 1fr 128px;
  grid-template-areas: "topo topo topo topo" "trilho gaveta palco painel" "trilho gaveta paginas painel";
}
.barra-topo {
  grid-area: topo; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; background: var(--papel); border-bottom: 1px solid var(--linha); z-index: 3;
}
.bt-esq, .bt-meio, .bt-dir { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bt-esq { flex: 1; }
.bt-dir { flex: 1; justify-content: flex-end; }
.nome-doc {
  min-width: 0; width: 240px; border: 0; background: transparent; padding: 10px 24px; border-radius: 999px;
  font-size: 14px; letter-spacing: .06em;
}
.nome-doc:hover, .nome-doc:focus { background: var(--fundo); }
.salvo { font-size: 11px; color: var(--suave); letter-spacing: .14em; white-space: nowrap; }
.zoom { display: flex; align-items: center; gap: 2px; }
.zoom-valor { min-width: 72px; padding: 8px 12px; border-radius: 999px; font-size: 13px; letter-spacing: .06em; }
.zoom-valor:hover { background: var(--fundo); }

.trilho {
  grid-area: trilho; display: flex; flex-direction: column; gap: 6px; padding: 18px 10px;
  background: var(--papel); border-right: 1px solid var(--linha); overflow-y: auto; scrollbar-width: none; z-index: 2;
}
.trilho button {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px; border-radius: 18px;
  font-size: 11px; letter-spacing: .08em; color: var(--suave);
}
.trilho button i { font-style: normal; font-size: 20px; line-height: 1; color: var(--tinta); font-family: var(--fofa); }
.trilho button:hover, .trilho button.ativo { background: var(--fundo); color: var(--tinta); }
.trilho button.ativo i { color: var(--destaque); }
.so-celular { display: none !important; }

.gaveta {
  grid-area: gaveta; width: 340px; background: var(--papel); border-right: 1px solid var(--linha);
  display: flex; flex-direction: column; min-height: 0; z-index: 2;
}
.gaveta-topo { display: flex; align-items: center; justify-content: space-between; padding: 22px 18px 6px 32px; }
.gaveta-topo h3, .painel h4 {
  margin: 0; font-weight: 500; font-size: 12px; letter-spacing: .4em; text-transform: uppercase; color: var(--suave);
}
.gaveta-corpo { flex: 1; overflow-y: auto; padding: 18px 32px 40px; }
.sub-titulo { margin: 28px 0 14px; font-size: 11px; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; color: var(--suave); }
.sub-titulo:first-child { margin-top: 4px; }

.ladrilhos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ladrilhos.dois { grid-template-columns: repeat(2, 1fr); }
.ladrilho {
  aspect-ratio: 1; border-radius: 16px; background: var(--fundo); display: flex; align-items: center; justify-content: center;
  padding: 18%; transition: transform .15s, background .15s;
}
.ladrilho:hover { transform: scale(1.04); background: var(--c2); }
.ladrilho svg, .ladrilho img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ladrilho.foto { padding: 0; overflow: hidden; }
.ladrilho.foto img { object-fit: cover; }
.ladrilho.papel { padding: 0; overflow: hidden; aspect-ratio: 1.36; }
.ladrilho.papel img { object-fit: cover; }
.mini-modelo { border-radius: 12px; overflow: hidden; background: var(--fundo); transition: transform .15s; }
.mini-modelo:hover { transform: scale(1.03); }
.mini-modelo img { width: 100%; display: block; }

.botao-texto {
  display: block; width: 100%; text-align: left; padding: 18px 26px; border-radius: 18px; background: var(--fundo);
  margin-bottom: 12px; line-height: 1.1; transition: background .15s;
}
.botao-texto:hover { background: var(--c2); }
.botao-largo {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 12px 28px;
  border-radius: 999px; background: var(--tinta); color: var(--c1); font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
}
.botao-largo.claro { background: var(--fundo); color: var(--tinta); }
.vazio { color: var(--suave); font-size: 13px; letter-spacing: .06em; line-height: 1.7; padding: 8px 4px; }

/* palco */
.palco { grid-area: palco; position: relative; min-width: 0; min-height: 0; background: var(--fundo); }
.palco-rola { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; padding: 48px; }
.folha-papel { box-shadow: 0 18px 50px rgba(22, 50, 48, .14), 0 2px 6px rgba(22, 50, 48, .06); border-radius: 2px; line-height: 0; }

/* páginas (estilo keynote) */
.paginas {
  grid-area: paginas; display: flex; align-items: center; gap: 18px; padding: 0 32px; overflow-x: auto;
  background: var(--fundo); border-top: 1px solid var(--linha); scrollbar-width: thin;
}
.pag { flex: none; position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pag .mini {
  height: 72px; border-radius: 8px; background: var(--papel) center / cover no-repeat; box-shadow: 0 4px 10px rgba(22, 50, 48, .08);
  border: 2px solid transparent; transition: border-color .15s;
}
.pag.ativa .mini { border-color: var(--destaque); }
.pag small { font-size: 11px; color: var(--suave); letter-spacing: .1em; }
.pag-mais { flex: none; width: 72px; height: 72px; border-radius: 12px; background: var(--papel); font-size: 26px; color: var(--suave); }
.pag-mais:hover { color: var(--destaque); }

/* painel (propriedades) */
.painel { grid-area: painel; background: var(--papel); border-left: 1px solid var(--linha); overflow-y: auto; padding: 28px 32px 48px; z-index: 2; }
.painel h4 { margin-bottom: 18px; }
.secao { padding: 20px 0; border-bottom: 1px solid var(--linha); }
.secao:last-child { border-bottom: 0; }
.rot { display: block; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--suave); margin-bottom: 14px; }
.cores { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.cor { aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent; transition: transform .15s; }
.cor:hover { transform: scale(1.12); }
.cor.ativa { border-color: var(--tinta); }
.cor.nada { background: linear-gradient(135deg, transparent 46%, var(--c3) 46%, var(--c3) 54%, transparent 54%), var(--papel); border-color: var(--linha); }
.hex { display: flex; gap: 10px; margin-top: 14px; }
.hex input { flex: 1; min-width: 0; padding: 10px 24px; border-radius: 999px; border: 1px solid var(--linha); background: var(--fundo); font-size: 13px; letter-spacing: .1em; }
.faixa { display: flex; align-items: center; gap: 14px; }
.faixa input[type=range] { flex: 1; }
.faixa output { width: 44px; text-align: right; font-size: 12px; color: var(--suave); }
input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: var(--c1); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--destaque); border: 3px solid var(--papel); box-shadow: 0 1px 4px rgba(22, 50, 48, .2); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--destaque); border: 3px solid var(--papel); }
.botoes { display: flex; flex-wrap: wrap; gap: 8px; }
.bt {
  min-height: 40px; padding: 8px 20px; border-radius: 999px; background: var(--fundo); font-size: 12px; letter-spacing: .08em;
  transition: background .15s;
}
.bt:hover { background: var(--c2); }
.bt.ativo { background: var(--tinta); color: var(--c1); }
.bt.icone { min-width: 44px; padding: 8px 14px; font-size: 16px; }
.campo { width: 100%; padding: 12px 24px; border-radius: 18px; border: 1px solid var(--linha); background: var(--fundo); font-size: 14px; resize: vertical; }
select.campo { appearance: none; border-radius: 999px; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--suave) 50%), linear-gradient(135deg, var(--suave) 50%, transparent 50%); background-position: calc(100% - 26px) 50%, calc(100% - 20px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.fontes { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.fontes button { text-align: left; padding: 10px 24px; border-radius: 14px; font-size: 20px; }
.fontes button:hover { background: var(--fundo); }
.fontes button.ativo { background: var(--c2); }

/* camadas */
.camada { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 24px; border-radius: 16px; background: var(--fundo); margin-bottom: 8px; }
.camada.ativa { background: var(--c2); }
.camada span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; letter-spacing: .04em; }
.camada .so-icone { width: 34px; height: 34px; font-size: 14px; }

/* apresentar */
.show { position: fixed; inset: 0; z-index: 80; background: #163230; cursor: none; }
.show-palco { position: absolute; inset: 0; }
.show-palco img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; transition: opacity .6s ease, transform .6s cubic-bezier(.22, 1, .36, 1); }
.show-conta { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: rgba(245, 235, 220, .5); font-size: 12px; letter-spacing: .3em; }

/* aviso */
.aviso {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 90; background: var(--tinta); color: var(--c1);
  padding: 14px 32px; border-radius: 999px; font-size: 13px; letter-spacing: .1em; animation: sobe .25s;
}

/* =================== celular =================== */
@media (max-width: 820px) {
  #inicio { padding: 40px 20px 48px; }
  .topo-inicio { padding: 32px 0 40px; }
  .sub { letter-spacing: .36em; }
  .bloco { margin-top: 48px; }
  .grade { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .grade-papeis { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .tamanho { width: 140px; padding: 22px 20px 18px; }
  .folha-caixa { padding: 22px 20px 40px; }

  #editor {
    grid-template-columns: 1fr;
    grid-template-rows: 64px 1fr 96px 84px;
    grid-template-areas: "topo" "palco" "paginas" "trilho";
  }
  .barra-topo { padding: 0 8px; gap: 4px; }
  .barra-topo .marca, .salvo, .zoom, #apresentar { display: none; }
  .nome-doc { width: 100%; padding: 8px 16px; }
  .bt-dir { flex: none; }
  #baixar { padding: 8px 22px; }
  .trilho {
    flex-direction: row; overflow-x: auto; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); gap: 4px;
    border-right: 0; border-top: 1px solid var(--linha);
  }
  .trilho button { flex: none; min-width: 76px; padding: 10px 6px; }
  .so-celular { display: flex !important; }
  .gaveta, .painel {
    position: fixed; left: 0; right: 0; bottom: 0; width: auto; height: 58vh; z-index: 40;
    border: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -12px 40px rgba(22, 50, 48, .16);
    animation: sobe .25s cubic-bezier(.22, 1, .36, 1);
  }
  .gaveta-topo { padding: 18px 12px 0 28px; }
  .gaveta-corpo { padding: 14px 24px 40px; }
  .painel { display: none; padding: 0; }
  .painel.aberto { display: block; }
  .painel .painel-dentro { padding: 6px 24px 40px; }
  .ladrilhos { grid-template-columns: repeat(4, 1fr); }
  .ladrilhos.dois { grid-template-columns: repeat(3, 1fr); }
  .palco-rola { padding: 24px; }
  .paginas { padding: 0 16px; gap: 12px; }
  .pag .mini { height: 52px; }
  .pag-mais { width: 52px; height: 52px; }
}
@media (min-width: 821px) { .painel-topo-celular { display: none; } }
