/* Hero — apresentação + cena Spline
   Padding, margin e radius vêm de .surface / .surface-corner */

.hero {
  position: relative;
  min-height: min(88vh, 920px);
  background-image: url(../svgs/fundo.svg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero .max-container {
  width: 100%;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.hero .btn-hero {
  width: fit-content;
  pointer-events: auto;
}

/* Cena 3D */

.hero-foto {
  position: absolute;
  right: -8%;
  bottom: -4%;
  width: min(95%, 1100px);
  height: min(105%, 980px);
  margin: 0;
  z-index: 0;
  overflow: visible;
  pointer-events: auto;
}

.hero-foto spline-viewer {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: none;
  background: transparent;
  transform: scale(1.35);
  transform-origin: center right;
}

/* Legenda — mesmas medidas/breakpoints do .hero-foto (mexa aqui) */
.hero-interact-hint {
  position: absolute;
  right: 3%;
  bottom: 4%;
  width: min(95%, 1100px);
  height: min(105%, 980px);
  z-index: 5;
  margin: 0;
  padding: 0 0.5rem 1rem;
  box-sizing: border-box;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--b2) 65%, transparent);
}

/* Conteúdo */

.hero-content {
  container-type: inline-size;
  width: 100%;
}

.hero-pill-magnet {
  display: inline-flex;
  margin-bottom: 0.75rem;
  will-change: transform;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}

.hero-pill-magnet.is-magnetic {
  transition: transform 0.12s ease-out;
}

.hero-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  isolation: isolate;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--b2) 88%, transparent);
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--w2) 62%, transparent) 0%,
    color-mix(in srgb, var(--w2) 18%, transparent) 48%,
    color-mix(in srgb, var(--w1) 28%, transparent) 100%
  );
  border: 1px solid color-mix(in srgb, var(--w2) 55%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--w2) 75%, transparent),
    inset 0 -1px 1px color-mix(in srgb, var(--b2) 6%, transparent),
    0 1px 2px color-mix(in srgb, var(--b1) 4%, transparent),
    0 8px 24px color-mix(in srgb, var(--b1) 8%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  opacity: 0;
}

body.is-ready .hero-pill {
  animation: hero-pill-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-pill > span {
  position: relative;
  z-index: 1;
}

.hero-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 35%,
    color-mix(in srgb, var(--w2) 55%, transparent) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  pointer-events: none;
}

body.is-ready .hero-pill::before {
  animation: none;
}

.hero-pill::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--w2) 35%, transparent) 0%,
    transparent 42%
  );
  pointer-events: none;
}

@keyframes hero-pill-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hero-pill-shine {
  0%,
  55% {
    transform: translateX(-120%);
  }
  75%,
  100% {
    transform: translateX(120%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-pill,
  .hero-pill::before {
    animation: none;
  }

  .hero-pill {
    opacity: 1;
  }
}

/* Celular / touch — menos custo de paint/composição */
@media (max-width: 900px), (pointer: coarse) {
  .hero-pill-magnet {
    will-change: auto;
    transition: none;
  }

  .hero-pill {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    opacity: 1;
    animation: none;
  }

  .hero-pill::before,
  .hero-pill::after {
    content: none;
    animation: none;
    display: none;
  }

  body.is-ready .hero-pill,
  body.is-ready .hero-pill::before {
    animation: none;
  }

  .hero-foto spline-viewer {
    contain: strict;
  }
}

.hero-greeting {
  color: var(--b3);
  font-family: var(--font-condensed);
  font-weight: 400;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22.5cqw;
  white-space: nowrap;
  background: linear-gradient(0deg, var(--b2), var(--b3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.introducao {
  position: relative;
  z-index: 3;
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  max-width: 42ch;
}

.introducao p {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--b3);
  max-width: 38ch;
}

/* ≤1200 */

@media (max-width: 1200px) {
  .hero {
    min-height: min(84vh, 860px);
  }

  .hero-foto {
    width: min(80%, 780px);
    height: min(95%, 820px);
    right: -12%;
    bottom: 4%;
  }

  .hero-foto spline-viewer {
    transform: scale(1.25);
  }

  .hero-interact-hint {
    width: min(80%, 780px);
    height: min(95%, 820px);
    right: -1%;
    bottom: 4%;
    font-size: 0.75rem;
  }
}

/* ≤900 — grid: texto | cena
   display:contents no max-container → padding-inline espelha o container
   Spline: medida FIXA (não encolher) para não cortar a cena */

@media (max-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-rows: auto;
    column-gap: 1.25rem;
    row-gap: 0;
    align-items: stretch;
    min-height: auto;
    padding-inline: 24px;
  }

  .hero .max-container {
    display: contents;
  }

  .hero-copy {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
  }

  .hero-content {
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 7.5vw, 4rem);
    white-space: normal;
  }

  .introducao {
    margin-top: 0;
    max-width: 36ch;
    width: 100%;
    z-index: 1;
  }

  .hero-foto {
    --spline-size-w: 380px;
    --spline-size-h: 500px;
    position: relative;
    grid-column: 2;
    grid-row: 1;
    right: auto;
    bottom: auto;
    width: var(--spline-size-w);
    height: var(--spline-size-h);
    min-width: var(--spline-size-w);
    min-height: var(--spline-size-h);
    max-width: var(--spline-size-w);
    max-height: var(--spline-size-h);
    aspect-ratio: auto;
    align-self: end;
    justify-self: center;
    z-index: 1;
    overflow: visible;
    flex-shrink: 0;
  }

  .hero-foto spline-viewer {
    position: absolute;
    inset: 0;
    width: var(--spline-size-w) !important;
    height: var(--spline-size-h) !important;
    min-height: 0;
    transform: none;
    transform-origin: center center;
  }

  .hero-interact-hint {
    --spline-size-w: 380px;
    --spline-size-h: 380px;
    position: relative;
    grid-column: 2;
    grid-row: 1;
    right: auto;
    bottom: auto;
    width: var(--spline-size-w);
    height: var(--spline-size-h);
    min-width: var(--spline-size-w);
    min-height: var(--spline-size-h);
    max-width: var(--spline-size-w);
    max-height: var(--spline-size-h);
    aspect-ratio: auto;
    align-self: end;
    justify-self: center;
    z-index: 5;
    font-size: 0.65rem;
    padding-bottom: 0.5rem;
  }
}

/* ≤768 — mesma medida do Spline; só o texto/grid muda */

@media (max-width: 768px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 380px;
    column-gap: 1rem;
  }

  .hero-copy {
    gap: 1rem;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 8vw, 3.1rem);
  }

  .introducao {
    max-width: 32ch;
  }

  .introducao p {
    font-size: 1rem;
  }

  .hero-interact-hint {
    font-size: 0.6rem;
  }
}

/* ≤600 — celular: sem Spline nem legenda */

@media (max-width: 600px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    row-gap: 0;
    align-items: stretch;
  }

  .hero-foto,
  .hero-interact-hint {
    display: none !important;
  }

  .hero-copy {
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    gap: 0.75rem;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 10vw, 2.85rem);
  }

  .introducao {
    max-width: none;
  }
}

@media (max-width: 483px) {
  .hero-copy {
    gap: 0.65rem;
  }

  .hero h1 {
    font-size: clamp(2.05rem, 10.5vw, 2.6rem);
  }

  .introducao p {
    max-width: 100%;
  }
}

/* ≤456 — texto não perde padding; Spline não força a largura do grid */
@media (max-width: 456px) {
  .hero {
    padding-inline: 16px;
    box-sizing: border-box;
    min-width: 0;
    overflow-x: clip;
  }

  .hero-copy {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .introducao {
    max-width: 100%;
    min-width: 0;
  }

  .introducao p,
  .hero .btn-hero {
    max-width: 100%;
  }
}
