/* Link na bio: a mesa de impressão ao fundo e os botões como camadas impressas. */
:root {
  --plate: #E9ECEF;
  --grade: rgba(21, 23, 28, .055);
  --sheet: #FFFFFF;
  --ink: #15171C;
  --muted: #5D636D;
  --rule: #D5D9DF;
  --acc: #2E9C74;
  --acc-tinta: #FFFFFF;
  --camada: rgba(21, 23, 28, .028);
  --display: "Archivo", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --mola: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --plate: #111317; --grade: rgba(236, 238, 241, .045); --sheet: #1A1D23; --ink: #ECEEF1; --muted: #9AA1AC;
    --rule: #2B3038; --camada: rgba(236, 238, 241, .03); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); font: 400 15px/1.5 var(--display);
  /* mesa de impressão: grade de 1 cm e uma mais fina dentro */
  background:
    linear-gradient(var(--grade) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--grade) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--plate);
  background-attachment: fixed;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 3px; }

.bio { width: min(480px, 100%); margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); display: grid; gap: 22px; }

/* ---------- Topo ---------- */
.topo { position: relative; display: grid; justify-items: center; text-align: center; padding-top: 12px; }
.foto {
  width: 96px; height: 96px; border-radius: 26px; display: grid; place-items: center; overflow: hidden;
  background: var(--sheet); color: var(--acc); font: 850 40px/1 var(--display); font-stretch: 125%;
  box-shadow: 0 0 0 3px var(--plate), 0 0 0 5px var(--acc), 0 14px 30px rgba(0, 0, 0, .14);
}
.foto img { width: 100%; height: 100%; object-fit: cover; }
.topo h1 {
  margin: 20px 0 0; font: 850 clamp(26px, 8vw, 34px)/1.02 var(--display); font-stretch: 125%;
  letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere;
}
.linha-sub { margin: 10px 0 0; font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.texto { margin: 12px 0 0; max-width: 36ch; color: var(--muted); font-size: 15px; text-wrap: pretty; white-space: pre-line; }

.redes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.redes a {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--rule); transition: transform .2s var(--mola), box-shadow .2s, color .2s;
}
.redes a:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--acc); color: var(--acc); }
.redes svg { width: 20px; height: 20px; }

.compartilhar {
  position: absolute; top: 0; right: 0; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--sheet); color: var(--ink); cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--rule);
}
.compartilhar svg { width: 18px; height: 18px; }
.compartilhar:hover { color: var(--acc); }

/* ---------- Botões: camadas ---------- */
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.links a {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 14px 52px;
  border-radius: 14px; text-decoration: none; text-align: center; font-weight: 700; font-size: 16px; line-height: 1.25; overflow: hidden;
  /* linhas de camada de 0,2 mm, bem de leve */
  background: repeating-linear-gradient(180deg, transparent 0 3px, var(--camada) 3px 4px), var(--sheet);
  color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule), 0 1px 0 rgba(0, 0, 0, .04);
  transition: transform .25s var(--mola), box-shadow .25s;
}
.links a:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--ink), 0 10px 22px rgba(0, 0, 0, .1); }
.links a:active { transform: translateY(0) scale(.99); }
.links .seta { position: absolute; right: 18px; width: 18px; height: 18px; opacity: .45; transition: transform .25s var(--mola), opacity .2s; }
.links a:hover .seta { opacity: 1; transform: translate(2px, -2px); }
.links a.destaque {
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(0, 0, 0, .06) 3px 4px), var(--acc);
  color: var(--acc-tinta); box-shadow: 0 10px 24px color-mix(in srgb, var(--acc) 35%, transparent);
}
.links a.destaque .seta { opacity: .8; }
.links a.destaque:hover { box-shadow: 0 14px 30px color-mix(in srgb, var(--acc) 45%, transparent); }

/* Ao abrir: cada camada é "impressa" — o bico passa e o botão aparece atrás dele, de baixo para cima. */
.imprimindo .links li { clip-path: inset(0 100% 0 0); animation: camada .42s var(--mola) forwards; animation-delay: calc(var(--n) * 80ms + 120ms); position: relative; }
.imprimindo .links li::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; border-radius: 2px; background: var(--acc);
  box-shadow: 0 0 12px var(--acc); animation: bico .42s var(--mola) forwards; animation-delay: inherit;
}
@keyframes camada { to { clip-path: inset(0 0 0 0); } }
@keyframes bico { 0% { left: 0; opacity: 1; } 90% { opacity: 1; } 100% { left: calc(100% - 3px); opacity: 0; } }
.imprimindo .topo { animation: subir .5s var(--mola) both; }
@keyframes subir { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Estados ---------- */
.carregando { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60dvh; margin: 0; color: var(--muted); font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.bico { width: 14px; height: 14px; border-radius: 3px 3px 7px 7px; background: var(--acc); animation: vai .9s ease-in-out infinite alternate; }
.bico.parado { animation: none; width: 22px; height: 22px; }
@keyframes vai { from { transform: translateX(-10px); } to { transform: translateX(10px); } }
.fora { min-height: 60dvh; display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center; }
.fora h1 { margin: 14px 0 0; font: 850 26px/1.1 var(--display); font-stretch: 125%; }
.fora p { margin: 0; color: var(--muted); }

.rodape { text-align: center; padding-top: 6px; }
.rodape a { font: 500 10.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.rodape a:hover { color: var(--ink); text-decoration: underline; }

.copiado {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); margin: 0; padding: 10px 16px;
  border-radius: 99px; background: var(--ink); color: var(--plate); font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .3s var(--mola);
}
.copiado.ver { opacity: 1; transform: translate(-50%, 0); }

/* ícone do botão (pelo endereço) */
.links .ic { position: absolute; left: 18px; width: 20px; height: 20px; opacity: .75; }
.links a.destaque .ic { opacity: .95; }

/* botão de produto da loja: foto, nome e preço */
.links a.produto { justify-content: flex-start; gap: 14px; padding: 10px 52px 10px 10px; text-align: left; }
.p-foto { flex: none; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 7%, var(--sheet)); color: var(--muted); font: 850 22px/1 var(--display); }
.p-foto img { width: 100%; height: 100%; object-fit: cover; }
.p-txt { display: grid; gap: 2px; min-width: 0; }
.p-txt b { font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-txt small { font: 700 13px var(--mono); color: var(--acc); }
.links a.produto.destaque .p-txt small { color: inherit; opacity: .9; }

/* novidades da loja */
.novidades { display: grid; gap: 12px; }
.novidades h2 { margin: 6px 0 0; font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; }
.nov-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nov { display: grid; gap: 4px; padding: 8px 8px 10px; border-radius: 14px; text-decoration: none; background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--rule); transition: transform .25s var(--mola), box-shadow .25s; }
.nov:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--acc); }
.nov-foto { aspect-ratio: 1; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 7%, var(--sheet)); color: var(--muted); font: 850 28px/1 var(--display); }
.nov-foto img { width: 100%; height: 100%; object-fit: cover; }
.nov b { font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nov small { font: 700 12.5px var(--mono); color: var(--acc); }

/* estilos escolhidos na Gestão: claro, escuro ou fundo na cor da página (auto segue o aparelho) */
:root[data-tema="claro"] { --plate: #E9ECEF; --grade: rgba(21, 23, 28, .055); --sheet: #FFFFFF; --ink: #15171C; --muted: #5D636D; --rule: #D5D9DF; --camada: rgba(21, 23, 28, .028); color-scheme: light; }
:root[data-tema="escuro"] { --plate: #111317; --grade: rgba(236, 238, 241, .045); --sheet: #1A1D23; --ink: #ECEEF1; --muted: #9AA1AC; --rule: #2B3038; --camada: rgba(236, 238, 241, .03); color-scheme: dark; }
:root[data-tema="cor"] { --plate: color-mix(in srgb, var(--acc) 78%, #000); --grade: rgba(255, 255, 255, .07); --sheet: #FFFFFF; --ink: #15171C; --muted: #5D636D; --rule: rgba(255, 255, 255, 0); --camada: rgba(21, 23, 28, .028); color-scheme: dark; }
:root[data-tema="cor"] .topo h1, :root[data-tema="cor"] .linha-sub, :root[data-tema="cor"] .texto, :root[data-tema="cor"] .novidades h2, :root[data-tema="cor"] .rodape a { color: #fff; }
:root[data-tema="cor"] .linha-sub, :root[data-tema="cor"] .texto, :root[data-tema="cor"] .rodape a, :root[data-tema="cor"] .novidades h2 { opacity: .82; }
:root[data-tema="cor"] .foto { box-shadow: 0 0 0 3px var(--plate), 0 0 0 5px #fff, 0 14px 30px rgba(0, 0, 0, .25); }
:root[data-tema="cor"] .links a.destaque { background: #15171C; color: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
:root[data-tema="cor"] .links a:hover { box-shadow: 0 10px 22px rgba(0, 0, 0, .22); }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .imprimindo .links li { clip-path: none; }
  .imprimindo .links li::after { display: none; }
}
