/* Bloco 1 da landing: fundo neutro, narrativa de organização e interação local. */
.landing {
  --pointer-x: 50vw;
  --pointer-y: 32vh;
  --hero-local-x: 72%;
  --hero-local-y: 45%;
  background:
    radial-gradient(circle at 72% 16%, rgba(255,255,255,.028), transparent 28rem),
    linear-gradient(180deg, #050706 0%, #070907 72%, #050706 100%) !important;
}
.landing::before {
  opacity: .54 !important;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px) !important;
  background-size: 64px 64px !important;
}
.landing::after {
  background-image:
    linear-gradient(rgba(var(--theme-accent-rgb),.42) 1px, transparent 1px),
    linear-gradient(90deg,rgba(var(--theme-accent-rgb),.42) 1px,transparent 1px) !important;
  -webkit-mask-image: radial-gradient(circle 165px at var(--pointer-x) var(--pointer-y), #000, rgba(0,0,0,.66) 45%, transparent 100%) !important;
  mask-image: radial-gradient(circle 165px at var(--pointer-x) var(--pointer-y), #000, rgba(0,0,0,.66) 45%, transparent 100%) !important;
  filter: none !important;
  opacity: 0 !important;
}
.landing.pointer-active::after { opacity: .64 !important; }

.landing-nav { isolation: isolate; }
/* A navbar precisa formar uma camada acima das seções da landing. O seletor
   explícito vence a regra genérica `.landing > *` sem recorrer a z-index
   arbitrário e mantém o popover dentro da mesma hierarquia. */
body.public-mode .landing > .landing-nav { z-index: 90; }
.landing-nav > div:first-of-type > a { overflow: hidden; }
.landing-nav > div:first-of-type > a::after {
  left: 7px !important;
  right: auto !important;
  width: calc(100% - 14px);
  transform: translateX(-115%) scaleX(.25) !important;
  transform-origin: left;
  transition: transform .3s cubic-bezier(.2,.8,.2,1) !important;
}
.landing-nav > div:first-of-type > a:hover::after,
.landing-nav > div:first-of-type > a:focus-visible::after { transform: translateX(0) scaleX(1) !important; }

.landing-hero {
  min-height: min(790px, calc(100dvh - 72px)) !important;
  isolation: isolate;
  perspective: 1200px;
}
/* A grade desktop pode conservar por alguns instantes a largura-base de 1000px
   enquanto folhas antigas são substituídas. O painel não pode ser recortado
   nesse limite; a própria landing continua contendo qualquer excesso. */
@media (min-width: 981px) {
  .landing-hero { overflow: visible; }
}

/* Em telas estreitas ou baixas, somente o conteúdo do card rola. Assim o
   controle de fechar permanece dentro da viewport e das safe areas. */
@media (max-width: 900px), (max-height: 700px) {
  body.public-mode .auth-layer.open {
    align-items: flex-start;
    justify-items: center;
    overflow: hidden;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }
  body.public-mode .auth-card {
    width: min(520px, 100%);
    min-height: 0;
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)));
    overflow: hidden;
  }
  body.public-mode .auth-content {
    min-height: 0;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 58px;
    padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
    scroll-padding-bottom: max(84px, calc(env(safe-area-inset-bottom) + 74px));
  }
  body.public-mode .auth-close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }
}

.plan-table-scroll-hint { display: none; }
@media (max-width: 850px) {
  body.public-mode .plan-feature-table {
    position: relative;
    scroll-padding-inline: 12px;
    scroll-snap-type: x proximity;
  }
  body.public-mode .plan-feature-table:focus-visible {
    outline: 2px solid var(--theme-accent);
    outline-offset: 3px;
  }
  body.public-mode .plan-table-scroll-hint {
    width: min(100%, calc(100vw - 48px));
    min-height: 36px;
    display: flex;
    align-items: center;
    margin: 26px 0 -30px;
    padding: 8px 12px;
    border: 1px solid rgba(50,255,126,.16);
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(50,255,126,.1), rgba(16,19,17,.9) 72%);
    color: #aaffc4;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .03em;
  }
  body.public-mode .plan-feature-table > div > :is(b,span,strong) {
    scroll-snap-align: start;
  }
}
.landing-hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -20px;
  pointer-events: none;
  background: radial-gradient(circle 300px at var(--hero-local-x) var(--hero-local-y), rgba(var(--theme-accent-rgb),.065), transparent 70%);
  opacity: 0;
  transition: opacity .24s ease;
}
.landing.pointer-active .landing-hero::after { opacity: 1; }
.landing-hero-aura { opacity: .54 !important; filter: saturate(.58); }
.landing-hero-product {
  --card-rotate-x: 0deg;
  --card-rotate-y: 0deg;
  --card-x: 50%;
  --card-y: 50%;
  transform: rotateX(var(--card-rotate-x)) rotateY(var(--card-rotate-y));
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform .42s cubic-bezier(.2,.8,.2,1), border-color .25s ease, box-shadow .25s ease;
}
.landing-hero-product::after {
  background: radial-gradient(circle 230px at var(--card-x) var(--card-y), rgba(var(--theme-accent-rgb),.11), transparent 72%) !important;
  opacity: 0;
  transition: opacity .24s ease;
}
.landing-hero-product.is-interacting::after { opacity: 1; }
.landing-hero-product.is-interacting {
  border-color: rgba(var(--theme-accent-rgb),.34);
  box-shadow: 0 28px 72px rgba(0,0,0,.44), 0 0 0 1px rgba(var(--theme-accent-rgb),.045);
}
.landing-hero-product .hero-live-demo { transform: translateZ(10px) !important; }
.landing-hero-product .hero-live-demo :is(.demo-notification,.mock-chart,.mock-stats article,.mock-bottom article) { transform: translateZ(1px); }

.hero-universe { z-index: 0 !important; }
.hero-universe span { backdrop-filter: blur(10px); }
.landing.block1-managed .hero-universe span {
  left: 48%;
  top: 48%;
}
.hero-universe [data-cosmos="health"] { --from-x:87vw;--from-y:29vh;--to-x:calc(48vw + 146px);--to-y:calc(48vh + 24px); }
.hero-universe [data-cosmos="study"] { --from-x:19vw;--from-y:78vh;--to-x:calc(48vw - 76px);--to-y:calc(48vh + 82px); }
.landing.block1-managed .hero-universe :is(span,.hero-universe-orbit,.hero-universe-core),
.landing.block1-managed .landing-hero-copy h1 > *,
.landing.block1-managed .landing-hero-copy .landing-hero-actions { animation: none !important; }

.landing-hero-copy h1 > * { display: block; }
.landing-hero-copy h1 > span:nth-child(2) { color: var(--theme-accent); }
.landing-hero-copy h1 > em { color: #eff6f1; }
.landing-hero-copy .landing-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 52px;
  touch-action: manipulation;
}
.landing-hero-copy .landing-cta::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -50%;
  background: radial-gradient(circle 62px at var(--cta-x,50%) var(--cta-y,50%), rgba(255,255,255,.35), transparent 72%);
  opacity: 0;
  transition: opacity .2s ease;
}
.landing-hero-copy .landing-cta:hover::before { opacity: 1; }
.landing-hero-copy .landing-cta:active { transform: translateY(1px) scale(.98) !important; }

.landing-scroll-cue {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  color: #7e8982;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  transform: translateX(-50%);
  transition: color .2s ease, opacity .2s ease, transform .2s ease;
}
.landing-scroll-cue i { width: 1px; height: 20px; background: linear-gradient(var(--theme-accent),transparent); }
.landing-scroll-cue:hover,.landing-scroll-cue:focus-visible { color: #d8e3db; }
.landing-scroll-cue:focus-visible { outline: 2px solid var(--theme-accent); outline-offset: 5px; border-radius: 8px; }

@media (max-width: 980px) {
  .landing-hero { min-height: auto !important; padding-bottom: 64px !important; }
  .landing-hero-product { transform: none !important; }
  .landing-scroll-cue { display: none; }
}
@media (max-width: 620px) {
  .landing-hero { width: min(100% - 24px, 520px) !important; padding-top: 108px !important; }
  .landing-hero-copy h1 { font-size: clamp(42px, 12vw, 58px) !important; line-height: .97 !important; }
  .landing-hero-copy > p { font-size: 16px !important; line-height: 1.55 !important; }
  .landing-hero-copy .landing-hero-actions { align-items: stretch; }
  .landing-hero-copy .landing-hero-actions .landing-cta { width: 100%; }
  .landing-hero-product { margin-top: 28px; }
}
@media (hover:none),(pointer:coarse) {
  .landing::after,.landing-hero::after { display: none !important; }
}
@media (prefers-reduced-motion:reduce) {
  .landing-hero-product { transform: none !important; transition: none; }
  .landing-scroll-cue,.landing-nav * { transition-duration: .01ms !important; }
}
