/* ==========================================================================
   Dra. Manoela Achcar — link na bio
   Valores vindos de specs/design.md. Não alterar tokens sem atualizar a spec.
   ========================================================================== */

/* Tokens ------------------------------------------------------------------ */
/* Página: tema escuro (véu grafite sobre o vídeo, texto creme).
   Janelas (.modal): continuam claras — tokens redefinidos mais abaixo. */
:root {
  color-scheme: dark;
  --color-text: #FAF6F2;
  --color-text-muted: rgb(250 246 242 / 0.85);     /* não baixar de 85%: contraste AA sobre o vídeo */
  --color-cta-bg: #E5C1A7;
  --color-cta-text: #262422;
  --color-accent: #E5C1A7;
  --color-focus: #FAF6F2;
  --color-bg: #262422;                              /* aparece enquanto o vídeo carrega */
  --color-surface: #2E2B29;
  --color-surface-translucent: rgb(38 36 34 / 0.55);
  --color-border: rgb(229 193 167 / 0.5);
  --color-overlay: rgb(38 36 34 / 0.72);            /* véu grafite sobre o vídeo de fundo */
  --color-backdrop: rgb(20 19 18 / 0.6);            /* fundo escurecido atrás das janelas */
  --shadow-avatar: 0 12px 24px -12px rgb(0 0 0 / 0.6);

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --fs-display: 44px;
  --fs-title: 30px;
  --fs-eyebrow: 12px;
  --fs-card-title: 16px;
  --fs-body: 15px;
  --fs-card-sub: 13px;
  --fs-legal: 11px;

  --radius-card: 18px;
  --radius-modal: 28px;
  --radius-media: 14px;
  --radius-pill: 999px;

  --avatar-size: 112px;
  --gutter: 20px;
  --column: 440px;
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
}

@media (min-width: 1024px) {
  :root {
    --fs-display: 64px;
    --fs-title: 36px;
    --fs-eyebrow: 13px;
    --fs-card-title: 17px;
    --fs-body: 16px;
    --avatar-size: 128px;
  }
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

html.modal-aberto { overflow: hidden; }

img { display: block; max-width: 100%; }
h1, h2, p, figure { margin: 0; }
button { font: inherit; color: inherit; }

.sprite { position: absolute; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Background: vídeo em tela cheia sob véu grafite (camada própria) --------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--color-bg);
  animation: fade-in 800ms ease-out both;
}

.bg__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Véu que garante o contraste do texto claro sobre qualquer quadro do vídeo */
.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
}

/* Página ------------------------------------------------------------------ */
.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    max(48px, 10svh)
    max(var(--gutter), env(safe-area-inset-right))
    calc(24px + env(safe-area-inset-bottom))
    max(var(--gutter), env(safe-area-inset-left));
}

.content,
.footer {
  width: 100%;
  max-width: var(--column);
}

/* Identificação ------------------------------------------------------------ */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  padding: 4px;
  border: 1.5px solid var(--color-accent);
  border-radius: 50%;
  box-shadow: var(--shadow-avatar);
  animation: avatar-in 700ms var(--ease-out-soft) both;
}

.avatar img {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  object-fit: cover;
}

.profile__name {
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.profile__name em { font-style: italic; }

.profile__specialty {
  margin-top: 12px;
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-wrap: balance;
}

/* Cards de link ------------------------------------------------------------ */
.links {
  display: grid;
  gap: 12px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 18px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-card);
  color: var(--color-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 200ms ease-out,
    background-color 200ms ease-out,
    box-shadow 200ms ease-out;
}

.card--primary {
  --color-text-muted: rgb(38 36 34 / 0.75);        /* texto de apoio escuro sobre o nude */
  background: var(--color-cta-bg);
  color: var(--color-cta-text);
}

.card--secondary {
  background: var(--color-surface-translucent);
  border-color: var(--color-border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.card__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.card__title {
  font-size: var(--fs-card-title);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.card__sub {
  font-size: var(--fs-card-sub);
  line-height: 1.45;
  color: var(--color-text-muted);
}

.card__arrow {
  width: 18px;
  height: 18px;
  transition: transform 200ms ease-out;
}

.card:active { transform: scale(0.98); }

@media (hover: hover) {
  .card:hover { transform: translateY(-2px); }
  .card:active { transform: scale(0.98); }
  .card--primary:hover { box-shadow: 0 10px 24px -14px rgb(0 0 0 / 0.5); }
  .card--secondary:hover { background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface)); }
  .card:hover .card__arrow { transform: translateX(3px); }
}

/* Foco: creme na página escura, grafite dentro das janelas claras */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* Rodapé ------------------------------------------------------------------- */
.footer {
  margin-top: auto;
  padding-top: 48px;
  text-align: center;
  font-size: var(--fs-legal);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.footer span { white-space: nowrap; }
.footer__sep { margin-inline: 0.6em; }

/* No celular a cidade vai para a segunda linha, sem separador sobrando no fim da primeira */
@media (max-width: 479px) {
  .footer__sep--quebra { display: none; }
  .footer__cidade { display: block; }
}

/* Tablet e desktop: coluna centralizada também na vertical */
@media (min-width: 768px) {
  .page {
    justify-content: center;
    padding-block: 64px;
  }

  .footer {
    margin-top: 48px;
    padding-top: 0;
  }
}

/* Janelas (modais): tema claro ---------------------------------------------- */
.modal {
  color-scheme: light;
  --color-text: #262422;
  --color-text-muted: rgb(38 36 34 / 0.75);
  --color-focus: #262422;
  --color-surface: #FFFDFB;                         /* provisório */
  --color-surface-translucent: rgb(255 253 251 / 0.7);
  --color-border: #E5C1A7;

  width: 100%;
  max-width: 100%;
  max-height: 92svh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-modal) var(--radius-modal) 0 0;
  background: var(--color-surface);
  color: var(--color-text);
  overflow: hidden;
}

.modal[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-in 320ms var(--ease-out-soft);
}

.modal::backdrop {
  background: var(--color-backdrop);
  animation: fade-in 320ms ease-out;
}

.modal.is-fechando { animation: sheet-out 220ms ease-in forwards; }
.modal.is-fechando::backdrop { animation: fade-out 220ms ease-in forwards; }

@media (min-width: 768px) {
  .modal {
    width: min(600px, calc(100% - 64px));
    max-height: 88vh;
    margin: auto;
    border-radius: var(--radius-modal);
  }
}

.modal__header {
  flex-shrink: 0;
  padding: 12px var(--gutter) 16px;
  border-bottom: 1px solid rgb(229 193 167 / 0.6);
}

.modal__handle {
  display: block;
  width: 40px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: var(--radius-pill);
  background: rgb(38 36 34 / 0.15);
}

@media (min-width: 768px) {
  .modal__handle { display: none; }
  .modal__header { padding-top: 24px; }
}

.modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal__title {
  font-family: var(--font-display);
  font-size: var(--fs-title);
  font-weight: 400;
  line-height: 1.1;
}

.modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
  transition: background-color 200ms ease-out;
}

@media (hover: hover) {
  .modal__close:hover { background: rgb(229 193 167 / 0.35); }
}

/* Abas de categoria */
.tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1 0 auto;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 200ms ease-out, color 200ms ease-out;
}

.tab[aria-selected="true"] {
  background: var(--color-cta-bg);
  color: var(--color-cta-text);
}

.modal__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom));
}

.cases-panel {
  display: grid;
  gap: 32px;
  border-radius: var(--radius-media);
  animation: fade-in 180ms ease-out;
}

.cases-panel[hidden] { display: none; }

.case__media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius-media);
  background: rgb(229 193 167 / 0.25);
}

.case__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Etiquetas: canto inferior esquerdo de cada metade da foto */
.case__tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgb(250 246 242 / 0.88);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case__media--lado-a-lado .case__tag--depois { left: calc(50% + 12px); }
.case__media--empilhado .case__tag--antes { bottom: calc(50% + 12px); }

.case figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.modal__cta { margin-top: 32px; }

/* Janela "Minha localização" */
.mapa__imagem {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-media);
  background: rgb(229 193 167 / 0.25);
}

.mapa__imagem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mapa__credito {
  margin-top: 6px;
  font-size: 11px;
  text-align: right;
  color: var(--color-text-muted);
}

.mapa__credito a { color: inherit; }

.endereco {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  font-style: normal;
}

.endereco__rua {
  font-size: var(--fs-card-title);
  font-weight: 600;
  line-height: 1.4;
}

.endereco__cidade {
  font-size: var(--fs-card-sub);
  color: var(--color-text-muted);
}

.rotas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.rota {
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 12px;
}

.rota .card__title {
  font-size: 15px;
  white-space: nowrap;
}

/* Logos oficiais dos apps (exceção à regra de ícones de traço fino) */
.logo-app {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Animações ---------------------------------------------------------------- */
.reveal {
  animation: rise-in 600ms var(--ease-out-soft) both;
  animation-delay: calc(200ms + var(--i, 0) * 80ms);
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes avatar-in { from { opacity: 0; transform: scale(0.96); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(24px); } }

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