/* Quiet, continuous motion throughout the portfolio. Only visible panels run. */
@keyframes motion-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -.55rem, 0); }
}
@keyframes motion-image {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}
@keyframes motion-glow {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}
@keyframes motion-bar {
  0%, 100% { transform: scaleX(.65); opacity: .65; }
  50% { transform: scaleX(1); opacity: 1; }
}
@keyframes motion-raise {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-.25rem); }
}
@keyframes motion-sheen {
  0%, 100% { transform: translateX(0); opacity: .45; }
  50% { transform: translateX(7rem); opacity: 1; }
}
@keyframes motion-type {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50% { text-shadow: 0 .04em .45em color-mix(in srgb, currentColor 24%, transparent); }
}
@keyframes motion-pattern {
  to { background-position: 2rem 2rem; }
}
@keyframes motion-icon-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(211,38,63,0); }
  50% { box-shadow: 0 0 1.2rem rgba(211,38,63,.22); }
}
@keyframes motion-letter-shine {
  from { background-position: 85% 50%; }
  to { background-position: 15% 50%; }
}

/* Editorial spacing and direct contact in the hero. */
.hero-content {
  padding-top: calc(var(--header-height) + .2rem);
  padding-bottom: 6.5rem;
}
.hero-support { margin: 1.2rem 0 1.45rem; }
.hero-summary {
  bottom: 1.35rem;
  flex-wrap: wrap;
  column-gap: clamp(1rem, 2.3vw, 2.25rem);
  row-gap: .55rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(245,242,247,.2);
}
.hero-contact {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-left: .15rem;
  padding-left: 1.1rem;
  border-left: 1px solid rgba(245,242,247,.24);
}
.hero-contact-link {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid rgba(245,242,247,.35);
  border-radius: 50%;
  background: #211825;
  color: #f5f2f5;
  text-decoration: none;
  transition: border-color .25s ease, background .25s ease, color .25s ease, transform .25s ease;
}
.hero-contact-link svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }
.hero-contact-link:first-child { color: #25d366; border-color: rgba(37,211,102,.5); }
.hero-contact-link:first-child:hover { border-color: #25d366; background: #25d366; color: #082212; transform: translateY(-.2rem); }
.hero-contact-link:last-child:hover { border-color: #f5f2f5; background: #f5f2f5; color: #211825; transform: translateY(-.2rem); }
.hero.is-active .hero-contact-link:first-child { animation: motion-icon-glow 5s ease-in-out infinite; }
.hero.is-active .hero-contact-link:last-child { animation: motion-icon-glow 5s ease-in-out -2.5s infinite; }

/* Lettering gains a quiet light rhythm; section labels gain a visible rule. */
.panel h2 em, .hero-title em, .showcase-period { text-shadow: 0 0 0 transparent; }
.panel.is-active h2 em, .hero.is-active .hero-title em,
.showcase.is-active .showcase-period { animation: motion-type 7s ease-in-out infinite; }
.eyebrow, .showcase-type { display: inline-flex; align-items: center; gap: .7rem; }
.eyebrow::before, .showcase-type::before {
  content: "";
  flex: 0 0 auto;
  width: 1.35rem;
  height: 2px;
  background: var(--accent);
  transform-origin: left;
}
.showcase-type::before { background: var(--showcase-accent); }
.panel.is-active .eyebrow::before,
.showcase.is-active .showcase-type::before { animation: motion-bar 4.5s ease-in-out infinite; }

/* A tiny drifting dot field adds depth to open areas, never over the content. */
.about::after, .about-depth::after, .expertise::after, .contact::after {
  display: block;
  inset: auto 0 0 auto;
  width: min(34vw, 24rem);
  height: min(38vh, 18rem);
  background: radial-gradient(circle, rgba(211,38,63,.52) 1px, transparent 1.5px) 0 0 / 2rem 2rem;
  mask-image: radial-gradient(ellipse at 100% 100%, #000, transparent 75%);
  opacity: .22;
  pointer-events: none;
}
.about.is-active::after, .about-depth.is-active::after,
.expertise.is-active::after, .contact.is-active::after {
  animation: motion-pattern 24s linear infinite;
}

/* Início: the logo and red editorial accent stay alive without moving the copy. */
.hero.is-active .hero-motion { animation: motion-float 8s ease-in-out infinite; }
.hero.is-active .hero-motion::after { animation: motion-bar 4.8s ease-in-out infinite; transform-origin: right; }
.hero .motion-core {
  animation: none;
  box-shadow: 0 .8rem 2rem rgba(0,0,0,.22), 0 0 2.5rem rgba(211,38,63,.2);
  transform-origin: center;
  backdrop-filter: none;
}
.hero.is-active .motion-core { animation: hero-logo-lift 5.2s ease-in-out infinite; }
.hero.is-active .motion-core img { animation: hero-logo-sway 5.2s ease-in-out infinite; }
.hero .motion-core::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: .4rem;
  border: 2px solid rgba(211,38,63,.5);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.hero .motion-core::after {
  display: block;
  z-index: 4;
  inset: -30%;
  border: 0;
  border-radius: 0;
  background: linear-gradient(110deg, transparent 38%, rgba(255,255,255,.15) 44%, rgba(255,255,255,.72) 50%, rgba(255,255,255,.15) 56%, transparent 62%);
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}
.hero.is-active .motion-core::before { animation: hero-logo-ring 5.2s ease-in-out infinite; }
.hero.is-active .motion-core::after { animation: hero-logo-shine 5.2s ease-in-out infinite; }
@keyframes hero-logo-lift {
  0%, 100% { transform: perspective(650px) translateY(.3rem) rotateX(-3deg) rotateY(-7deg) scale(.98); }
  50% { transform: perspective(650px) translateY(-.8rem) rotateX(5deg) rotateY(8deg) scale(1.035); }
}
@keyframes hero-logo-sway {
  0%, 100% { transform: rotate(-4deg) scale(1); }
  50% { transform: rotate(4deg) scale(1.08); }
}
@keyframes hero-logo-ring {
  0%, 100% { transform: scale(.88); opacity: 0; }
  40% { opacity: .55; }
  75% { transform: scale(1.06); opacity: 0; }
}
@keyframes hero-logo-shine {
  0%, 15% { transform: translateX(-100%); opacity: 0; }
  25% { opacity: .85; }
  60% { transform: translateX(100%); opacity: .85; }
  70%, 100% { transform: translateX(100%); opacity: 0; }
}
.hero.is-active .scroll-hint span { animation: motion-bar 3s ease-in-out infinite; transform-origin: left; }

/* Sobre: the white motif and highlighted card breathe independently. */
.about.is-active::before { animation: motion-glow 5s ease-in-out infinite; }
.about.is-active .about-highlights span:first-child {
  animation: motion-raise 7s ease-in-out infinite;
}
.about-depth .depth-content { position: relative; overflow: hidden; }
.about-depth .depth-content::after {
  content: "";
  position: absolute;
  top: 0;
  left: 1.1rem;
  width: 4rem;
  height: 2px;
  background: var(--accent);
  pointer-events: none;
}
.about-depth.is-active .depth-content::after { animation: motion-sheen 8s ease-in-out infinite; }
.about-depth.is-active .process-list li > span { animation: motion-glow 6s ease-in-out infinite; }
.about-depth.is-active .process-list li:nth-child(2) > span { animation-delay: -2s; }
.about-depth.is-active .process-list li:nth-child(3) > span { animation-delay: -4s; }

/* Projects: keep cards fixed and animate their clipped imagery and small accents. */
.showcase .showcase-media img { transform-origin: center; }
.showcase.is-active .showcase-media img { animation: motion-image 10s ease-in-out infinite; }
.showcase.is-active .showcase-media-label b { animation: motion-raise 3.8s ease-in-out infinite; }
.showcase .showcase-heading { position: relative; }
.showcase .showcase-heading::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 5rem;
  height: 2px;
  background: var(--showcase-accent);
  transform-origin: left;
  pointer-events: none;
}
.showcase.is-active .showcase-heading::after { animation: motion-bar 5.5s ease-in-out infinite; }
.showcase.is-active .showcase-features li:nth-child(2) {
  animation: motion-raise 7s ease-in-out infinite;
}
.showcase-abyss.is-active .showcase-media img { animation-duration: 11s; }
.showcase-luccas.is-active .showcase-media img { animation-duration: 9s; }
.showcase-piu.is-active .showcase-media img { animation-duration: 12s; }

/* Atuação and contato: motion stays in icons and trim, not form fields. */
.expertise.is-active .expertise-list li:nth-child(2) span {
  animation: motion-raise 5s ease-in-out infinite;
}
.expertise.is-active .expertise-list li:nth-child(4) span {
  animation: motion-glow 5s ease-in-out -2.5s infinite;
}
.contact.is-active .contact-action-icon { animation: motion-raise 6s ease-in-out infinite; }
.contact.is-active .email-icon { animation-delay: -3s; }
.contact .contact-form { position: relative; overflow: hidden; }
.contact .contact-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.5rem;
  width: 4rem;
  height: 2px;
  background: var(--accent);
  pointer-events: none;
}
.contact.is-active .contact-form::before { animation: motion-sheen 9s ease-in-out infinite; }

/* Keep this after the generic heading animation so the letters actually shine. */
.hero .hero-title em, .about h2 em, .contact h2 em {
  background-image: linear-gradient(105deg,
    #d3263f 0%,
    #d3263f 46%,
    #f95d73 49%,
    #fff0f2 50%,
    #f95d73 51%,
    #d3263f 54%,
    #d3263f 100%);
  background-size: 260% 100%;
  background-position: 85% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero.is-active .hero-title em,
.about.is-active h2 em,
.contact.is-active h2 em {
  animation: motion-letter-shine 5.5s linear infinite;
}

@media (max-width: 560px) {
  .hero-content { padding-top: calc(var(--header-height) + 1.5rem); padding-bottom: 5rem; }
  .hero-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem .4rem; width: min(100%, 22rem); align-items: center; }
  .hero-actions .primary-action { grid-column: 1 / -1; }
  .hero-contact { margin: 0; padding-left: .8rem; border-left: 1px solid rgba(245,242,247,.24); border-top: 0; }
  .hero-contact-link { width: 2.6rem; height: 2.6rem; }
  .about::after, .about-depth::after, .expertise::after, .contact::after { width: 12rem; height: 10rem; }
  .hero-motion { animation: none !important; }
  .showcase.is-active .showcase-media img { animation-duration: 13s; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title em, .about h2 em, .contact h2 em {
    background-image: none;
    color: #d3263f;
  }
  .panel *, .panel *::before, .panel *::after,
  .panel::before, .panel::after { animation: none !important; }
}
