/* ═══════════════════════════════════════════════════════════════
   CAROL PORTILHO — Link Hub v2 · O Veredito à luz do dia
   Versão clara: creme/gelo dominantes, tinta no texto, carmim/vinho
   como selo. Tokens do brand book (tokens.css) + paleta do prompt.
   ═══════════════════════════════════════════════════════════════ */

/* ——— Fontes oficiais (locais) ——— */
@font-face {
  font-family: "Morganite";
  src: url("../assets/fonts/Morganite-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Morganite";
  src: url("../assets/fonts/Morganite-Black.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/Archivo.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --noite: #0A141B;
  --vinho: #4A1D22;
  --vinho-profundo: #300914;
  --carmim: #A31C38;
  --sinal: #F31955;
  --gelo: #EDE6E8;
  --creme: #F5F0EA;
  --bronze: #B79A87;
  --bronze-escuro: #8B6A55;
  --tinta: #160D12;

  --texto-2: rgba(22, 13, 18, 0.66);   /* --cp-texto-2-claro do brand book */
  --linha: rgba(183, 154, 135, 0.42);

  --font-display: "Morganite", sans-serif;
  --font-texto: "Archivo", "Helvetica Neue", sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  min-height: 100svh;
  background: var(--creme);
  color: var(--tinta);
  font-family: var(--font-texto);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════ BACKDROP — palco à luz do dia ═══════════════ */

.stageBackdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--creme);
  isolation: isolate;
}

.stageSlide {
  position: absolute;
  inset: -2%;
  opacity: 0;
  transform: scale(1.045);
  transition:
    opacity 1.6s var(--ease-out),
    transform 7.5s linear;
  will-change: opacity, transform;
}
.stageSlide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, center);
  /* revelação clara: a foto vira lavagem de jornal, não noite */
  filter:
    grayscale(1)
    saturate(0.08)
    contrast(0.9)
    brightness(1.18)
    blur(0.8px);
}
@media (min-width: 1024px) {
  .stageSlide img {
    transform: translateX(var(--shift, 0%)) scale(var(--zoom, 1));
    transform-origin: var(--origin, center);
  }
}
.stageSlideActive {
  opacity: 1;
  transform: scale(1.105);
}

/* véu creme: denso sobre o painel, aberto na metade das fotos */
.stageColorGrade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(
      90deg,
      rgba(245, 240, 234, 0.94) 0%,
      rgba(245, 240, 234, 0.86) 34%,
      rgba(237, 230, 232, 0.55) 70%,
      rgba(245, 240, 234, 0.72) 100%
    ),
    linear-gradient(
      180deg,
      rgba(245, 240, 234, 0.35) 0%,
      rgba(245, 240, 234, 0.1) 50%,
      rgba(245, 240, 234, 0.75) 100%
    );
}

.stageSmoke {
  position: absolute;
  inset: -20%;
  z-index: 3;
  background:
    radial-gradient(circle at 72% 30%, rgba(163, 28, 56, 0.1), transparent 32%),
    radial-gradient(circle at 40% 70%, rgba(183, 154, 135, 0.22), transparent 38%);
  filter: blur(44px);
  animation: smokeDrift 16s ease-in-out infinite alternate;
}

.stageVignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  box-shadow: inset 0 0 160px rgba(139, 106, 85, 0.22);
  pointer-events: none;
}

.stageGrain {
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0.05;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  mix-blend-mode: multiply;
}

@keyframes smokeDrift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 1.5%, 0) scale(1.04); }
}

/* ═══════════════ LAYOUT DE UMA DOBRA ═══════════════ */

.hub {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3svh, 40px) clamp(20px, 4vw, 24px);
}

/* ═══════════════ PAINEL CLARO ═══════════════ */

.profileShell {
  position: relative;
  width: min(100%, 510px);
  padding: clamp(14px, 2svh, 18px);
  border: 1px solid var(--linha);
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(155deg, rgba(245, 240, 234, 0.82), rgba(237, 230, 232, 0.7));
  box-shadow:
    0 30px 80px rgba(74, 29, 34, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(18px) saturate(0.9);
  -webkit-backdrop-filter: blur(18px) saturate(0.9);
}
/* Pulso de Rosa Sinal — a única dose da cor (regra ≤1%) */
.profileShell::after {
  content: "";
  position: absolute;
  top: 0;
  left: 34px;
  width: 54px;
  height: 2px;
  background: linear-gradient(90deg, var(--sinal) 0%, var(--carmim) 58%, var(--bronze) 100%);
}

.shellContent {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: clamp(10px, 1.5svh, 15px);
}

/* ═══════════════ SINAL NÃO VERBAL ═══════════════ */

.nonverbalSignal {
  position: absolute;
  right: -72px;
  bottom: -52px;
  width: 320px;
  opacity: 0.16;
  pointer-events: none;
  color: var(--bronze-escuro);
  animation: signalBreath 7s ease-in-out infinite;
}
.nonverbalSignal path {
  stroke: currentColor;
  stroke-width: 1;
  fill: none;
  vector-effect: non-scaling-stroke;
}
@keyframes signalBreath {
  0%, 100% { opacity: 0.11; transform: scale(0.985); }
  50%      { opacity: 0.2;  transform: scale(1); }
}

/* ═══════════════ RETRATO HERO — destaque editorial ═══════════════ */

.profilePortrait {
  position: relative;
  width: 100%;
}
.portraitFrame {
  position: relative;
  width: 100%;
  height: clamp(180px, 26svh, 240px);
  overflow: hidden;
  border-radius: 18px 18px 4px 4px;
  border: 1px solid rgba(183, 154, 135, 0.55);
}
.portraitFrame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* olhos no terço superior; o nome assina sobre a camisa branca */
  object-position: center 29%;
  display: block;
}
/* véu para o nome assinar sobre a foto */
.portraitFrame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 44%,
    rgba(245, 240, 234, 0.18) 62%,
    rgba(245, 240, 234, 0.9) 100%
  );
}
/* moldura editorial deslocada, traço fino bronze */
.profilePortrait::before {
  content: "";
  position: absolute;
  inset: 8px -6px -6px 8px;
  border: 1px solid rgba(139, 106, 85, 0.35);
  border-radius: 18px 18px 4px 4px;
  pointer-events: none;
}

.brandName {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 7.4svh, 4.6rem);
  line-height: 0.96; /* brand book: Morganite nunca abaixo de 0,95 */
  letter-spacing: 0.035em;
  text-transform: uppercase;
  color: var(--tinta);
  text-align: center;
}
/* microacento carmim sob o nome */
.profilePortrait::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 26px;
  height: 2px;
  transform: translateX(-50%);
  background: var(--carmim);
}

/* ═══════════════ IDENTIFICAÇÃO ═══════════════ */

.brandEyebrow {
  color: var(--carmim);
  font-size: 0.75rem;
  font-weight: 640;
  letter-spacing: 0.18em;
  margin-top: clamp(4px, 1svh, 10px);
}

.brandHeadline {
  font-size: clamp(0.86rem, 1.9svh, 0.98rem);
  font-weight: 460;
  color: var(--texto-2);
  line-height: 1.45;
}
.brandHeadline strong {
  color: var(--tinta);
  font-weight: 640;
}

/* ═══════════════ BOTÕES — sheen de luz, leve e elegante ═══════════════ */

.linkStack {
  display: grid;
  gap: clamp(8px, 1.2svh, 12px);
  width: 100%;
  margin-top: clamp(2px, 0.6svh, 6px);
}

.premiumLink {
  --spot-x: 50%;
  --spot-y: 50%;
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr 22px;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 8px 16px;
  overflow: hidden;
  color: var(--tinta);
  text-align: left;
  text-decoration: none;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.72), rgba(237, 230, 232, 0.55));
  border: 1px solid var(--linha);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(74, 29, 34, 0.06);
  transition:
    transform 220ms var(--ease-out),
    border-color 220ms ease,
    box-shadow 220ms ease;
}
/* spotlight de atenção (segue o cursor) */
.premiumLink::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(
    200px circle at var(--spot-x) var(--spot-y),
    rgba(183, 154, 135, 0.22),
    transparent 60%
  );
  transition: opacity 220ms ease;
}
/* sheen: a luz atravessa o botão */
.premiumLink::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -70%;
  width: 45%;
  transform: skewX(-18deg);
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.7) 50%,
    transparent
  );
  transition: left 620ms var(--ease-out);
  pointer-events: none;
}
.premiumLink:hover,
.premiumLink:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(74, 29, 34, 0.45);
  box-shadow: 0 10px 26px rgba(74, 29, 34, 0.14);
}
.premiumLink:hover::before,
.premiumLink:focus-visible::before { opacity: 1; }
.premiumLink:hover::after,
.premiumLink:focus-visible::after { left: 125%; }
.premiumLink:active { transform: translateY(0) scale(0.992); }

.premiumLinkIcon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  color: var(--vinho);
  transition: color 220ms ease;
}
.premiumLinkIcon svg { width: 20px; height: 20px; }
.premiumLink:hover .premiumLinkIcon { color: var(--carmim); }

.premiumLinkCopy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 2px;
}
.premiumLinkCopy strong {
  font-size: 0.94rem;
  font-weight: 660;
}
.premiumLinkCopy small {
  color: var(--texto-2);
  font-size: 0.75rem;
  line-height: 1.3;
}

.premiumLinkArrow {
  position: relative;
  z-index: 2;
  width: 18px;
  height: 18px;
  color: var(--bronze-escuro);
  transition: transform 220ms var(--ease-out), color 220ms ease;
}
.premiumLinkArrow svg { width: 100%; height: 100%; display: block; }
.premiumLink:hover .premiumLinkArrow {
  transform: translate(2px, -2px);
  color: var(--carmim);
}

/* botão com URL pendente ({{placeholder}}) */
.premiumLink[aria-disabled="true"],
.communityFeature[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

/* ═══════════════ CTA DA COMUNIDADE — o bloco de noite na peça clara ═══════════════ */

.communityFeature {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: clamp(72px, 10svh, 88px);
  padding: 14px 18px 12px;
  overflow: hidden;
  color: var(--creme);
  text-align: left;
  text-decoration: none;
  background:
    radial-gradient(circle at 86% 16%, rgba(183, 154, 135, 0.22), transparent 36%),
    linear-gradient(135deg, var(--vinho), var(--vinho-profundo));
  border: 1px solid rgba(183, 154, 135, 0.55);
  border-radius: 18px;
  box-shadow:
    0 18px 40px rgba(48, 9, 20, 0.28),
    inset 0 1px 0 rgba(245, 240, 234, 0.1);
  transition:
    transform 220ms var(--ease-out),
    box-shadow 220ms ease;
}
.communityFeature::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 18px;
  width: 30px;
  height: 2px;
  background: var(--carmim);
}
/* sheen discreto também aqui */
.communityFeature::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -70%;
  width: 45%;
  transform: skewX(-18deg);
  background: linear-gradient(
    105deg,
    transparent,
    rgba(237, 230, 232, 0.22) 50%,
    transparent
  );
  transition: left 700ms var(--ease-out);
  pointer-events: none;
}
.communityFeature:hover,
.communityFeature:focus-visible {
  transform: translateY(-3px);
  box-shadow:
    0 24px 52px rgba(48, 9, 20, 0.4),
    inset 0 1px 0 rgba(245, 240, 234, 0.14);
}
.communityFeature:hover::after,
.communityFeature:focus-visible::after { left: 125%; }

.communityCopy { display: grid; gap: 1px; padding-top: 8px; }

.communityEyebrow {
  color: var(--bronze);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.communityTitle {
  font-family: var(--font-display);
  font-weight: 800;
  white-space: nowrap;
  font-size: clamp(1.9rem, 4.6svh, 2.6rem);
  line-height: 0.96;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--gelo);
}
.communityDesc {
  color: rgba(237, 230, 232, 0.72);
  font-size: 0.75rem;
  line-height: 1.35;
  margin-top: 3px;
}
.communityAction {
  display: grid;
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: 8px;
  color: var(--bronze);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.communityAction svg {
  width: 17px;
  height: 17px;
  transition: transform 220ms var(--ease-out);
}
.communityFeature:hover .communityAction svg { transform: translate(2px, -2px); }

/* ═══════════════ ASSINATURA ═══════════════ */

.brandSignature {
  color: rgba(22, 13, 18, 0.52);
  font-size: 0.75rem;
  font-weight: 480;
  letter-spacing: 0.06em;
  margin-top: clamp(2px, 0.8svh, 8px);
}
.brandSignature::before,
.brandSignature::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: rgba(139, 106, 85, 0.4);
  vertical-align: middle;
  margin: 0 10px;
}

/* ═══════════════ ACESSIBILIDADE ═══════════════ */

a:focus-visible {
  outline: 2px solid var(--vinho);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .stageSlide,
  .stageSmoke,
  .nonverbalSignal {
    animation: none;
    transition: none;
  }
  .stageSlideActive { transform: none; }
  .stageSlide:not(.stageSlideActive) { display: none; }
  .premiumLink,
  .premiumLink::after,
  .premiumLink .premiumLinkArrow,
  .communityFeature,
  .communityFeature::after,
  .communityAction svg {
    transition: none;
  }
}

/* ═══════════════ MOBILE — BG visível e rodando ═══════════════ */

@media (max-width: 1023px) {
  /* véu mais aberto: o crossfade aparece nas bordas e através do painel */
  .stageColorGrade {
    background:
      linear-gradient(
        180deg,
        rgba(245, 240, 234, 0.62) 0%,
        rgba(245, 240, 234, 0.4) 45%,
        rgba(245, 240, 234, 0.78) 100%
      );
  }
  .profileShell {
    background: linear-gradient(155deg, rgba(245, 240, 234, 0.72), rgba(237, 230, 232, 0.58));
  }
}

@media (max-width: 480px) {
  .shellContent { gap: clamp(8px, 1.1svh, 11px); }
  .profileShell { padding: 12px; }
  .portraitFrame { height: clamp(150px, 22svh, 200px); }

  .brandEyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
    margin-top: 6px;
  }
  .brandName { font-size: clamp(2.9rem, 6.6svh, 3.8rem); }

  .premiumLink {
    grid-template-columns: 24px 1fr 18px;
    gap: 10px;
    padding: 6px 12px;
    min-height: 56px;
  }
  .premiumLinkCopy small { white-space: nowrap; }

  .communityTitle { font-size: clamp(1.75rem, 4.2svh, 2.1rem); }
  .communityAction svg { width: 16px; height: 16px; }

  .brandSignature { margin-top: 0; }
}

/* ═══════════════ DESKTOP — painel à esquerda, palco claro à direita ═══════════════ */

@media (min-width: 1024px) {
  .hub {
    justify-content: flex-start;
    padding-left: clamp(48px, 7vw, 140px);
  }
  .profileShell { width: min(100%, 500px); }
  .shellContent { gap: clamp(12px, 1.9svh, 17px); }
}

@media (min-width: 1024px) and (max-height: 800px) {
  .portraitFrame { height: clamp(150px, 22svh, 190px); }
  .brandName { font-size: clamp(2.8rem, 6.4svh, 3.6rem); }
  .shellContent { gap: clamp(8px, 1.4svh, 12px); }
  .premiumLink { min-height: 52px; }
  .communityFeature { min-height: 68px; }
  .communityTitle { font-size: clamp(1.7rem, 4svh, 2.1rem); }
}
