/* ==========================================================
   VYNEX — Componentes
   ========================================================== */

/* ---------- Texto que "rola" no hover (links e botões) ---------- */
.roll {
  display: inline-grid;
  overflow: hidden;
  line-height: 1.25;
  vertical-align: top;
}
.roll > span {
  grid-area: 1 / 1;
  transition: transform .5s var(--ease-out);
}
.roll__b { transform: translateY(105%); }
@media (hover: hover) {
  a:hover > .roll .roll__a, button:hover > .roll .roll__a,
  a:hover .btn__inner > .roll .roll__a, button:hover .btn__inner > .roll .roll__a { transform: translateY(-105%); }
  a:hover > .roll .roll__b, button:hover > .roll .roll__b,
  a:hover .btn__inner > .roll .roll__b, button:hover .btn__inner > .roll .roll__b { transform: none; }
}

/* ---------- Ícones ---------- */
.icon { width: 1.15em; height: 1.15em; flex: none; fill: currentColor; }

/* ---------- Botões ---------- */
.btn {
  --h: 50px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--h);
  padding: 0 1.45em;
  border-radius: var(--r-pill);
  font-family: var(--f-text);
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: .005em;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow var(--dur-2) var(--ease-out), background-color var(--dur-2), border-color var(--dur-2), color var(--dur-2);
}
.btn__inner { display: inline-flex; align-items: center; gap: .6em; position: relative; z-index: 1; }
.btn--small { --h: 42px; font-size: .9375rem; padding: 0 1.15em; }
.btn--large { --h: 58px; font-size: 1.0625rem; padding: 0 1.7em; }
.btn--xl { --h: 68px; font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); padding: 0 2.1em; }

.btn--primary {
  color: #fff;
  background: var(--grad-btn);
  box-shadow: 0 12px 34px -14px rgba(42, 96, 252, .85), inset 0 1px 0 rgba(255, 255, 255, .22);
}
/* Varredura diagonal no ângulo do V */
.btn--primary::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 0;
  background: linear-gradient(155deg, #1F63F5, #3A5BFF 55%, #4A46FF);
  transform: translateX(-115%) skewX(-32deg);
  transition: transform .7s var(--ease-out);
}
@media (hover: hover) {
  .btn--primary:hover::before { transform: translateX(0) skewX(-32deg) scaleX(1.4); }
  .btn--primary:hover { box-shadow: 0 18px 44px -14px rgba(42, 96, 252, 1), inset 0 1px 0 rgba(255, 255, 255, .3); }
}

.btn--ghost {
  color: var(--c-text);
  border: 1px solid var(--c-line-2);
  background: rgba(255, 255, 255, .02);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
@media (hover: hover) {
  .btn--ghost:hover { border-color: rgba(156, 200, 255, .55); background: rgba(42, 96, 252, .14); }
}

.btn--plan {
  width: 100%;
  color: var(--c-text);
  border: 1px solid var(--c-line-2);
  background: rgba(255, 255, 255, .03);
}
.btn--plan::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--grad-btn);
  clip-path: polygon(0 0, 0 0, -30% 100%, -30% 100%);
  transition: clip-path .6s var(--ease-out);
}
@media (hover: hover) {
  .btn--plan:hover { color: #fff; border-color: transparent; }
  .btn--plan:hover::before { clip-path: polygon(0 0, 140% 0, 110% 100%, -30% 100%); }
}

.link-button {
  color: var(--c-sky);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
  text-decoration-color: rgba(156, 200, 255, .45);
  transition: text-decoration-color var(--dur-2), color var(--dur-2);
}
.link-button:hover { color: #fff; text-decoration-color: #fff; }

/* ---------- Pontinhos de janela ---------- */
.chrome-dots { display: inline-flex; gap: 6px; flex: none; }
.chrome-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .16); }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  transition: transform .55s var(--ease-out), background-color .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(2, 4, 14, .72);
  border-color: var(--c-line);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.menu-open {
  z-index: calc(var(--z-menu) + 1);
  background: transparent;
  border-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.brand { display: block; flex: none; padding: .35rem 0; border-radius: 4px; }
.brand img { width: auto; height: clamp(18px, 1.2rem + .2vw, 22px); }

.nav { position: relative; margin-inline: auto; }
.nav__list { display: flex; gap: clamp(1.25rem, .5rem + 1.6vw, 2.4rem); }
.nav__link {
  display: block;
  padding: .5rem 0;
  font-size: .9375rem;
  font-weight: 550;
  color: var(--c-text-2);
  transition: color var(--dur-2);
}
.nav__link:hover, .nav__link[aria-current="true"] { color: var(--c-text); }
.nav__marker {
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: var(--grad-v);
  opacity: 0;
  transition: transform .6s var(--ease-out), width .6s var(--ease-out), opacity .3s;
}
.nav__marker.is-visible { opacity: 1; }

.header-cta { flex: none; }

/* Hambúrguer */
.burger {
  display: none;
  position: relative;
  width: 46px;
  height: 46px;
  margin-left: auto;
  border-radius: 50%;
  border: 1px solid var(--c-line-2);
  background: rgba(255, 255, 255, .03);
}
.burger__line {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-text);
  transition: transform .55s var(--ease-out), top .55s var(--ease-out), background-color .3s;
}
.burger__line:nth-child(1) { top: 18px; }
.burger__line:nth-child(2) { top: 26px; }
.burger[aria-expanded="true"] .burger__line:nth-child(1) { top: 22px; transform: rotate(45deg); }
.burger[aria-expanded="true"] .burger__line:nth-child(2) { top: 22px; transform: rotate(-45deg); }

@media (max-width: 959px) {
  .nav, .header-cta { display: none; }
  .burger { display: block; }
}

/* ---------- Menu do celular ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  pointer-events: none;
}
.menu[hidden] { display: none; }
.menu__panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + 2.5rem) var(--gutter) max(2rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(42, 96, 252, .28), transparent 60%),
    radial-gradient(90% 50% at 0% 100%, rgba(56, 54, 241, .22), transparent 60%),
    #02040F;
  overflow-y: auto;
  /* Revelação em diagonal, no ângulo do V */
  clip-path: polygon(100% 0, 100% 0, 100% 0, 100% 0);
  transition: clip-path .75s var(--ease-in-out);
}
.menu.is-open { pointer-events: auto; }
.menu.is-open .menu__panel { clip-path: polygon(-70% 0, 100% 0, 100% 170%, -70% 170%); }
.menu__list { display: grid; gap: .35rem; }
.menu__list li, .menu__foot {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .5s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: 0s;
}
.menu.is-open .menu__list li, .menu.is-open .menu__foot {
  opacity: 1;
  transform: none;
  transition-delay: calc(.22s + var(--i) * .06s);
}
.menu__list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .45rem 0;
  font-family: var(--f-display);
  font-stretch: var(--stretch-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 1.2rem + 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.02em;
}
.menu__foot { display: grid; gap: 1.5rem; padding-top: 2.5rem; }
.menu__foot .btn { justify-self: start; }
.menu__social { display: flex; gap: 1.5rem; color: var(--c-text-2); font-weight: 550; }
.menu__social a:hover { color: var(--c-text); }

/* ---------- Cursor personalizado ---------- */
.cursor { display: none; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor [role="button"] { cursor: none; }
.has-cursor .viewer, .has-cursor .viewer * { cursor: auto; }
.has-cursor .viewer a, .has-cursor .viewer button { cursor: pointer; }
.cursor__dot, .cursor__ring {
  position: fixed;
  left: 0;
  top: 0;
  z-index: var(--z-cursor);
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .3s;
}
.cursor.is-visible .cursor__dot, .cursor.is-visible .cursor__ring { opacity: 1; }
.cursor__dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: #fff;
}
.cursor__ring {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  display: grid;
  place-items: center;
}
.cursor__ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(156, 200, 255, .55);
  transition: transform .45s var(--ease-out), background-color .35s, border-color .35s;
}
.cursor__label {
  position: relative;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .3s, transform .45s var(--ease-out);
}
.cursor.is-link .cursor__ring::before { transform: scale(1.55); background: rgba(42, 96, 252, .14); border-color: rgba(156, 200, 255, .8); }
.cursor.is-link .cursor__dot { transform: scale(.5); }
.cursor.is-view .cursor__ring::before { transform: scale(2.7); background: var(--c-cobalt); border-color: transparent; }
.cursor.is-view .cursor__label { opacity: 1; transform: none; }
.cursor.is-view .cursor__dot { opacity: 0; }
.cursor.is-hidden .cursor__dot, .cursor.is-hidden .cursor__ring { opacity: 0; }
.cursor.is-down .cursor__ring::before { transform: scale(.8); }
.cursor.is-view.is-down .cursor__ring::before { transform: scale(2.4); }

/* ---------- Janela de navegador e celular (mockups) ---------- */
.window {
  position: relative;
  border-radius: var(--r-window);
  background: #0B1026;
  border: 1px solid rgba(160, 180, 255, .16);
  overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .5);
}
.window__chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 30px;
  padding: 0 12px;
  background: #0E1433;
  border-bottom: 1px solid rgba(160, 180, 255, .1);
}
.window__tab {
  min-width: 0;
  padding: 3px 10px;
  border-radius: 6px 6px 0 0;
  font-size: .6875rem;
  font-weight: 600;
  color: var(--c-text-2);
  background: rgba(255, 255, 255, .05);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.window__screen, .phone__screen {
  position: relative;
  overflow: hidden;
  background: var(--p-bg, #0B1026);
}
.window__screen { aspect-ratio: 16 / 10; }
.window__screen iframe, .phone__screen iframe {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  transform-origin: 0 0;
  max-width: none;
  pointer-events: none;
  background: var(--p-bg, #fff);
  opacity: 0;
  transition: opacity .6s var(--ease-out);
}
.window__screen iframe.is-loaded, .phone__screen iframe.is-loaded { opacity: 1; }
.window__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  font-family: var(--f-display);
  font-stretch: var(--stretch-label);
  font-weight: 700;
  font-size: clamp(.9rem, .7rem + .6vw, 1.2rem);
  color: var(--p-ink, #fff);
  opacity: .55;
  text-align: center;
}
.window__placeholder[hidden] { display: none; }
.window__placeholder[hidden] { display: none; }
.window__placeholder::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 18%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--p-accent, var(--c-azure)), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: placeholder-scan 1.4s var(--ease-in-out) infinite;
}
@keyframes placeholder-scan {
  from { background-position: -100% 0; }
  to { background-position: 200% 0; }
}

.phone {
  position: relative;
  padding: 7px;
  border-radius: 30px;
  background: linear-gradient(160deg, #1A2150, #070A1C);
  border: 1px solid rgba(160, 180, 255, .2);
  box-shadow: 0 40px 70px -24px rgba(0, 0, 0, .9);
}
.phone::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 2;
  width: 26%;
  height: 12px;
  margin-left: -13%;
  border-radius: 10px;
  background: #02030A;
}
.phone__screen { aspect-ratio: 390 / 844; border-radius: 23px; }

/* ---------- WhatsApp flutuante ---------- */
.wa-float {
  position: fixed;
  right: max(1.1rem, env(safe-area-inset-right));
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  z-index: var(--z-float);
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #fff;
  background: var(--grad-v);
  box-shadow: 0 14px 34px -10px rgba(42, 96, 252, .9);
  font-size: 1.45rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(.85);
  transition: opacity .45s var(--ease-out), transform .6s var(--ease-out), visibility .45s;
}
.wa-float.is-visible { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) { .wa-float:hover { transform: scale(1.06); } }

/* ---------- Visualizador de projetos ---------- */
.viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-text);
  overflow: hidden;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop {
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.viewer.is-open { animation: viewer-in .45s var(--ease-out); }
.viewer.is-open::backdrop { animation: fade-in .4s var(--ease-out); }
.viewer.is-closing { animation: viewer-out .35s var(--ease-in-out) forwards; }
.viewer.is-closing::backdrop { animation: fade-out .35s var(--ease-in-out) forwards; }
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes viewer-out { to { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.viewer__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem var(--gutter);
  border-bottom: 1px solid var(--c-line);
  background: rgba(2, 4, 14, .85);
}
.viewer__heading { min-width: 0; margin-right: auto; }
.viewer__title {
  font-family: var(--f-display);
  font-stretch: var(--stretch-label);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer__note { font-size: var(--fs-xs); color: var(--c-text-3); }

.viewer__devices {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-line-2);
  background: rgba(255, 255, 255, .03);
}
.viewer__devices button {
  position: relative;
  z-index: 1;
  padding: .45rem 1rem;
  border-radius: var(--r-pill);
  font-size: .875rem;
  font-weight: 600;
  color: var(--c-text-2);
  transition: color .3s;
}
.viewer__devices button[aria-checked="true"] { color: #fff; }
.viewer__devices-marker {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: var(--r-pill);
  background: var(--grad-btn);
  transition: transform .55s var(--ease-out);
}
.viewer__devices[data-active="mobile"] .viewer__devices-marker { transform: translateX(100%); }

.viewer__newtab {
  font-size: .875rem;
  font-weight: 600;
  color: var(--c-text-2);
  text-decoration: underline;
  text-underline-offset: .25em;
  text-decoration-color: var(--c-line-2);
}
.viewer__newtab:hover { color: var(--c-text); }
.viewer__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--c-line-2);
  transition: background-color .3s, transform .5s var(--ease-out);
}
.viewer__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (hover: hover) { .viewer__close:hover { background: rgba(255, 255, 255, .08); transform: rotate(90deg); } }

.viewer__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(.75rem, .4rem + 1.5vw, 1.75rem);
}
.viewer__frame {
  position: relative;
  width: min(100%, 1440px);
  height: 100%;
  border-radius: var(--r-window);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 1), 0 0 0 1px rgba(160, 180, 255, .18);
  transition: width .7s var(--ease-in-out), height .7s var(--ease-in-out), border-radius .7s var(--ease-in-out);
}
.viewer__frame[data-device="mobile"] {
  width: min(100%, 390px);
  height: min(100%, 844px);
  border-radius: 28px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 1), 0 0 0 8px #10163A, 0 0 0 9px rgba(160, 180, 255, .25);
}
.viewer__iframe { width: 100%; height: 100%; background: #fff; opacity: 0; transition: opacity .5s var(--ease-out); }
.viewer__iframe.is-loaded { opacity: 1; }
.viewer__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #0B1026;
  transition: opacity .5s var(--ease-out), visibility .5s;
}
.viewer__loading span {
  width: 140px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--c-azure), transparent) no-repeat;
  background-size: 50% 100%;
  animation: placeholder-scan 1.2s var(--ease-in-out) infinite;
}
.viewer__frame:not(.is-loading) .viewer__loading { opacity: 0; visibility: hidden; }

@media (max-width: 719px) {
  .viewer__devices, .viewer__newtab { display: none; }
  .viewer__stage { padding: 0; }
  .viewer__frame, .viewer__frame[data-device="mobile"] { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
}

.cursor-away .cursor__dot, .cursor-away .cursor__ring { opacity: 0 !important; }
