/* Base compartilhada: cores, tipografia, menu, botões, campos e modais */

:root {
  --papel: #f4eee5;
  --papel-2: #ebe3d6;
  --branco: #fffdf9;
  --tinta: #2b211d;
  --tinta-2: #66574e;
  --po: #cfc2b4;
  --linha: rgba(43, 33, 29, 0.14);
  --cafe: #4a3a33;
  --terracota: #a9532c;
  --terracota-escura: #8c4321;
  --bordo: #7a2632;
  --ocre: #c98b3b;
  --salvia: #9aa791;
  --sucesso: #4f6b45;

  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-foto: 22px;
  --r-card: 18px;
  --sombra-papel: 0 1px 2px rgba(43, 33, 29, 0.08), 0 18px 40px -18px rgba(43, 33, 29, 0.35);
  --sombra-leve: 0 1px 2px rgba(43, 33, 29, 0.06), 0 8px 24px -12px rgba(43, 33, 29, 0.22);
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Fio com um losango no meio, como nos livros de contos (cor: terracota) */
  --ornamento: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath d='M0 6h50M70 6h50' stroke='%23a9532c' stroke-width='1'/%3E%3Cpath d='M60 1.5 64.5 6 60 10.5 55.5 6z' fill='%23a9532c'/%3E%3C/svg%3E");

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

/* Mantém a proporção de imagens com width/height no HTML quando elas encolhem */
img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--terracota);
  color: var(--branco);
}

:focus-visible {
  outline: 2px solid var(--terracota);
  outline-offset: 3px;
  border-radius: 6px;
}

.visualmente-oculto {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Lenis (rolagem suave) */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
  overflow: clip;
}

/* ---------- Monograma ---------- */
.monograma {
  display: block;
  height: 26px;
  width: auto;
  color: var(--tinta);
  fill: currentColor;
}

/* ---------- Menu em pílula ---------- */
.nav {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 50;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.4vw, 28px);
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--sombra-leve);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}

.nav__marca {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav__links {
  display: flex;
  gap: clamp(12px, 1.8vw, 24px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  font-size: 13px;
  color: var(--tinta-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav__links a:hover {
  color: var(--tinta);
}

.nav__acoes {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 760px) {
  .nav__links .so-desktop {
    display: none;
  }
}

/* ---------- Botões ---------- */
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--terracota);
  color: #fff8f1;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s var(--ease), opacity 0.2s;
}

.botao:hover {
  background: var(--terracota-escura);
}

.botao:active {
  transform: scale(0.97);
}

.botao[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.botao--grande {
  min-height: 48px;
  padding: 0 26px;
  font-size: 15px;
}

.botao--contorno {
  background: transparent;
  color: var(--tinta);
  box-shadow: inset 0 0 0 1px var(--linha);
}

.botao--contorno:hover {
  background: rgba(43, 33, 29, 0.05);
}

.botao--claro {
  background: var(--branco);
  color: var(--tinta);
}

.botao--claro:hover {
  background: #fff;
}

.botao-icone {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tinta);
  cursor: pointer;
  transition: background 0.2s;
}

.botao-icone:hover {
  background: rgba(43, 33, 29, 0.07);
}

.botao-icone svg {
  width: 18px;
  height: 18px;
}

/* Botão de música com barrinhas animadas */
.musica {
  display: none;
}

.musica.disponivel {
  display: inline-grid;
}

.musica__barras {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.musica__barras i {
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  transition: height 0.3s;
}

.musica.tocando .musica__barras i {
  animation: barra 0.9s ease-in-out infinite alternate;
}

.musica.tocando .musica__barras i:nth-child(2) {
  animation-delay: -0.3s;
}

.musica.tocando .musica__barras i:nth-child(3) {
  animation-delay: -0.6s;
}

.musica.tocando .musica__barras i:nth-child(4) {
  animation-delay: -0.15s;
}

@keyframes barra {
  from {
    height: 3px;
  }
  to {
    height: 14px;
  }
}

/* ---------- Campos de formulário ---------- */
.campo {
  display: grid;
  gap: 6px;
}

.campo > span {
  font-size: 13px;
  color: var(--tinta-2);
}

.entrada-texto,
.campo input,
.campo textarea,
.campo select {
  width: 100%;
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid var(--linha);
  border-radius: 14px;
  background: var(--branco);
  color: var(--tinta);
  font: 15px/1.4 var(--sans);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.campo textarea {
  min-height: 110px;
  resize: vertical;
}

.entrada-texto:focus,
.campo input:focus,
.campo textarea:focus,
.campo select:focus {
  outline: none;
  border-color: var(--terracota);
  box-shadow: 0 0 0 3px rgba(169, 83, 44, 0.16);
}

.mensagem-erro {
  font-size: 13px;
  color: var(--bordo);
}

.mensagem-erro:empty {
  display: none;
}

/* ---------- Modal (dialog nativo) ---------- */
.modal {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--papel);
  color: var(--tinta);
  box-shadow: 0 30px 80px -20px rgba(30, 20, 15, 0.5);
  overflow: hidden;
}

.modal::backdrop {
  background: rgba(43, 33, 29, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal[open] {
  display: flex;
  flex-direction: column;
}

.modal__rolagem {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(24px, 5vw, 40px);
}

.modal__fechar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(255, 253, 249, 0.85);
}

.modal__titulo {
  font-size: clamp(2.2rem, 7vw, 3rem);
  margin-bottom: 12px;
  padding-right: 40px;
}

.modal p + p {
  margin-top: 12px;
}

/* No celular a janela sobe de baixo, ocupando a largura toda (como as gavetas dos apps):
   sobra mais altura útil e o conteúdo cabe sem precisar rolar. */
@media (max-width: 600px) {
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .modal__rolagem {
    padding: 24px 20px calc(22px + env(safe-area-inset-bottom));
    font-size: 15px;
  }

  .modal__titulo {
    font-size: 2.1rem;
    margin-bottom: 8px;
  }

  .modal__fechar {
    top: 10px;
    right: 10px;
  }
}

/* ---------- Salvar na agenda ---------- */
.agenda {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.agenda[hidden] {
  display: none;
}

.agenda__rotulo {
  width: 100%;
  font-size: 13px;
  color: var(--tinta-2);
  text-align: center;
}

.agenda .botao {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
}

/* ---------- Avisos rápidos (toast) ---------- */
.aviso {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  translate: -50% 0;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--tinta);
  color: var(--papel);
  font-size: 14px;
  box-shadow: var(--sombra-papel);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.4s var(--ease);
  pointer-events: none;
}

.aviso.visivel {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
