/* ==========================================================================
   Cartão digital · Dra. Priscilla Marcondelli
   Mesma identidade da LP (oliva + papel + caramelo, Fraunces + Montserrat)
   e a mesma dupla hélice animada do hero, aqui no topo do cartão.
   Feito pra abrir no celular e caber numa tela só, sem rolar.
   ========================================================================== */

:root {
  --paper: #f5f2ea;
  --paper-2: #ede8dc;
  --card: #fbf9f4;
  --ink: #2c3117;
  --muted: #676b55;

  --olive-900: #2f3616;
  --olive-800: #3a431c;
  --olive-700: #4f5a26;
  --olive-500: #6f7c3a;
  --sage-100: #e5e8d6;

  --caramel: #9a6541;
  --caramel-600: #875534;
  --caramel-light: #e2b48f;

  --line: rgba(47, 54, 22, 0.12);
  --line-strong: rgba(47, 54, 22, 0.22);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

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

body {
  display: flex;
  justify-content: center;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(ellipse 80% 45% at 50% 0%, rgba(211, 216, 189, 0.65), rgba(211, 216, 189, 0) 70%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
p {
  margin: 0;
}

.icon {
  flex: none;
  width: 1.2em;
  height: 1.2em;
}

:focus-visible {
  outline: 3px solid var(--caramel);
  outline-offset: 3px;
}

/* ---------- Cartão ---------- */

.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  min-height: 100dvh;
  background: var(--card);
}

@media (min-width: 480px) {
  body {
    align-items: flex-start;
    padding: 40px 20px;
  }

  .card {
    min-height: auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 40px 80px -40px rgba(47, 54, 22, 0.45);
  }
}

/* ---------- Topo com a hélice ---------- */

.card__top {
  position: relative;
  flex: none;
  height: calc(112px + env(safe-area-inset-top));
  overflow: hidden;
  background: var(--olive-800);
}

/* hélice deitada atravessando o topo; andar no próprio eixo dá a ilusão de girar */
.card__dna {
  --dna-w: 100px;
  --dna-h: 200px;       /* uma volta; mantém a proporção 1:2 do SVG */
  position: absolute;
  top: calc(50% + env(safe-area-inset-top) / 2);
  left: 50%;
  width: var(--dna-w);
  height: 900px;
  transform: translate(-50%, -50%) rotate(-82deg);
}

.card__dna-strand {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: calc(100% + var(--dna-h));
  background: url("../images/dna-helice-claro.svg") 0 0 / var(--dna-w) var(--dna-h) repeat-y;
  animation: dna-giro 30s linear infinite;
  will-change: transform;
}

@keyframes dna-giro {
  to {
    transform: translate3d(0, calc(var(--dna-h) * -1), 0);
  }
}

.card__label {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 18px;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 242, 234, 0.78);
}

.card__share {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  right: 10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(245, 242, 234, 0.28);
  border-radius: 50%;
  background: rgba(47, 54, 22, 0.45);
  color: var(--paper);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.card__share:hover {
  background: rgba(245, 242, 234, 0.16);
}

.card__share .icon {
  width: 18px;
  height: 18px;
}

/* ---------- Perfil ---------- */

.profile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -54px;
  padding: 0 20px 18px;
  text-align: center;
}

.profile__avatar {
  width: 108px;
  height: 108px;
  padding: 4px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 0 0 1.5px rgba(154, 101, 65, 0.55), 0 16px 30px -14px rgba(47, 54, 22, 0.55);
}

.profile__avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile__name {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 1.62rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--olive-900);
}

.profile__role {
  margin-top: 7px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--caramel);
}

.profile__tagline {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-style: italic;
  color: var(--olive-500);
}

.profile__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.42em 0.85em;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--olive-800);
  text-decoration: none;
}

.chip > .icon {
  width: 13px;
  height: 13px;
  color: var(--olive-500);
}

.chip--rating {
  border-color: rgba(154, 101, 65, 0.35);
  background: rgba(226, 180, 143, 0.16);
  transition: background-color 0.2s ease;
}

.chip--rating:hover {
  background: rgba(226, 180, 143, 0.3);
}

.stars {
  display: inline-flex;
  gap: 1px;
  color: var(--caramel);
}

.stars .icon {
  width: 11px;
  height: 11px;
}

/* ---------- Ações ---------- */

.actions {
  display: grid;
  gap: 10px;
  padding: 2px 18px 16px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn .icon {
  width: 22px;
  height: 22px;
}

.btn--wa {
  background: var(--olive-500);
  box-shadow: 0 12px 24px -12px rgba(79, 90, 38, 0.85);
  color: #fff;
}

.btn--wa:hover {
  background: var(--olive-700);
  transform: translateY(-2px);
}

.btn--save {
  border: 1.5px solid rgba(154, 101, 65, 0.55);
  background: transparent;
  color: var(--caramel-600);
}

.btn--save:hover {
  background: rgba(226, 180, 143, 0.16);
  transform: translateY(-2px);
}

/* ---------- Redes e site ---------- */

.links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 16px;
}

.link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 74px;
  padding: 10px 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--olive-800);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.link .icon {
  width: 24px;
  height: 24px;
  color: var(--olive-500);
}

.link:hover {
  border-color: var(--line-strong);
  background: var(--sage-100);
  transform: translateY(-2px);
}

/* ---------- Frase e rodapé ---------- */

.quote {
  padding: 2px 24px 18px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-style: italic;
  text-align: center;
  color: var(--olive-800);
}

.quote::before,
.quote::after {
  color: var(--caramel);
}

.quote::before {
  content: "\201C";
}

.quote::after {
  content: "\201D";
}

.card__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: auto;
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  line-height: 1.5;
  text-align: center;
  color: var(--muted);
}

.card__logo {
  width: auto;
  height: 36px;
  margin-bottom: 6px;
}

.card__copy {
  opacity: 0.8;
}

/* ---------- Aviso (link copiado, contato salvo) ---------- */

.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 10;
  padding: 0.7em 1.15em;
  border-radius: 999px;
  background: var(--olive-900);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.5);
  color: var(--paper);
  font-size: 0.85rem;
  font-weight: 500;
  transform: translateX(-50%);
}

/* ---------- Telas baixas: aperta os respiros pra continuar cabendo sem rolar ---------- */

@media (max-width: 479px) and (max-height: 740px) {
  .card__top {
    height: calc(96px + env(safe-area-inset-top));
  }

  .profile {
    margin-top: -48px;
    padding-bottom: 14px;
  }

  .profile__avatar {
    width: 96px;
    height: 96px;
  }

  .profile__name {
    margin-top: 10px;
    font-size: 1.5rem;
  }

  .btn {
    height: 48px;
  }

  .actions,
  .links {
    padding-bottom: 12px;
  }

  .link {
    min-height: 66px;
  }

  .quote {
    padding-bottom: 12px;
  }
}

/* ---------- Telas altas: tudo um pouco maior pra ocupar a tela sem sobrar vão ---------- */

@media (max-width: 479px) and (min-height: 820px) {
  .card__top {
    height: calc(128px + env(safe-area-inset-top));
  }

  .profile {
    margin-top: -62px;
    padding-bottom: 24px;
  }

  .profile__avatar {
    width: 124px;
    height: 124px;
  }

  .profile__name {
    margin-top: 14px;
    font-size: 1.78rem;
  }

  .profile__tagline {
    font-size: 1.14rem;
  }

  .actions {
    gap: 12px;
    padding-bottom: 22px;
  }

  .btn {
    height: 56px;
    font-size: 1.02rem;
  }

  .links {
    gap: 10px;
    padding-bottom: 24px;
  }

  .link {
    min-height: 86px;
    font-size: 0.76rem;
  }

  .quote {
    padding-bottom: 26px;
    font-size: 1.22rem;
  }
}

/* ---------- Entrada ---------- */

.js .profile,
.js .actions,
.js .links,
.js .quote,
.js .card__foot {
  animation: subir 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.js .actions {
  animation-delay: 0.08s;
}

.js .links {
  animation-delay: 0.16s;
}

.js .quote {
  animation-delay: 0.24s;
}

.js .card__foot {
  animation-delay: 0.3s;
}

@keyframes subir {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card__dna-strand,
  .js .profile,
  .js .actions,
  .js .links,
  .js .quote,
  .js .card__foot {
    animation: none;
  }

  .btn,
  .link {
    transition: none;
  }
}
