/* =========================================================================
   MEMORIAL POLISH — refinamentos editoriais compartilhados
   ========================================================================= */

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* Textura de papel — profundidade sutil */
.page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* Foco acessível */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----- NAV ----- */
.nav.is-scrolled {
  box-shadow:
    0 1px 0 var(--line),
    0 12px 40px color-mix(in oklch, var(--ink) 5%, transparent);
}
.brand { transition: opacity 200ms ease; }
.brand:hover { opacity: 0.82; }
.nav-links a { cursor: pointer; }
.nav-links a.is-active {
  color: var(--ink);
}
.nav-links a.is-active::after { right: 0; }
.music-btn { cursor: pointer; }
.music-btn:focus-visible { border-color: var(--accent); }
.music-btn:hover { background: color-mix(in oklch, var(--accent-soft) 40%, transparent); }

/* ----- HERO ----- */
.hero-content {
  animation: heroEnter 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes heroEnter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
.hero-frame {
  background: color-mix(in oklch, var(--bg) 55%, transparent);
  backdrop-filter: blur(2px);
}
.hero-meta > div {
  padding: 8px 0;
  border-left: 1px solid transparent;
  padding-left: 0;
  transition: border-color 220ms ease, padding-left 220ms ease;
}
.hero-meta > div:hover {
  border-left-color: var(--accent);
  padding-left: 16px;
}
.hero-scroll .line {
  animation: scrollPulse 2.4s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.85); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ----- BOTÕES ----- */
.btn { cursor: pointer; }
.btn-primary {
  box-shadow: 0 2px 0 color-mix(in oklch, var(--ink) 18%, transparent);
}
.btn-primary:hover {
  box-shadow: 0 4px 20px color-mix(in oklch, var(--accent) 35%, transparent);
}
.btn-ghost:hover {
  background: color-mix(in oklch, var(--accent-soft) 35%, transparent);
}

/* ----- SEÇÕES ----- */
.section-title {
  text-wrap: balance;
}
.eyebrow .dot {
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 20%, transparent);
}

/* ----- STATS ----- */
.stat {
  transition: background 240ms ease;
}
.stat:hover {
  background: color-mix(in oklch, var(--accent-soft) 25%, transparent);
}

/* ----- MEDALHAS ----- */
.medal {
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}
.medal:hover {
  border-color: color-mix(in oklch, var(--accent) 50%, var(--line));
  box-shadow: 0 16px 36px color-mix(in oklch, var(--ink) 6%, transparent);
  transform: translateY(-3px);
}

/* ----- TIMELINE ----- */
.tl-row {
  transition: opacity 220ms ease;
}
.tl-content {
  transition: transform 220ms ease;
}
.tl-row:hover .tl-content {
  transform: translateX(6px);
}
.tl-row:hover .tl-year {
  color: var(--ink);
}

/* ----- GALERIA ----- */
.gal-card { cursor: pointer; }
.gal-img { overflow: hidden; }
.gal-img .ph,
.gal-img .ph-img {
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.gal-card:hover .gal-img .ph,
.gal-card:hover .gal-img .ph-img {
  transform: scale(1.05);
}
.gal-card:hover .gal-title {
  color: var(--accent);
}
.gal-title { transition: color 200ms ease; }

/* ----- HOMENAGENS ----- */
.trib {
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}
.trib:hover {
  border-color: color-mix(in oklch, var(--accent) 45%, var(--line));
  box-shadow: 0 20px 44px color-mix(in oklch, var(--ink) 6%, transparent);
  transform: translateY(-4px);
}
.trib-form {
  box-shadow: 0 24px 60px color-mix(in oklch, var(--ink) 4%, transparent);
}

/* ----- SHARE / QR ----- */
.share-chip { cursor: pointer; }
.share-chip:hover {
  background: color-mix(in oklch, var(--accent-soft) 30%, transparent);
  transform: translateY(-1px);
}
.qr {
  position: relative;
  box-shadow:
    0 24px 56px color-mix(in oklch, var(--ink) 10%, transparent),
    inset 0 0 0 1px color-mix(in oklch, var(--line) 80%, transparent);
}
.qr::before,
.qr::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
}
.qr::before {
  top: 8px; left: 8px;
  border-width: 1px 0 0 1px;
}
.qr::after {
  bottom: 8px; right: 8px;
  border-width: 0 1px 1px 0;
}

/* ----- FOOTER ----- */
.foot-cols a { cursor: pointer; }
.foot-bigname {
  -webkit-mask-image: linear-gradient(to bottom, black 28%, transparent 94%);
  mask-image: linear-gradient(to bottom, black 28%, transparent 94%);
}

/* ----- PLACEHOLDER ----- */
.ph-img {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
}
.portrait-wrap:hover .ph-img,
.familia-img:hover .ph-img {
  transform: scale(1.03);
  filter: saturate(0.9) contrast(1.05);
}
.portrait-wrap,
.familia-img {
  overflow: hidden;
}

/* ----- VSWITCH ----- */
.vswitch a { cursor: pointer; }
