/* GRADUS landing effects (16/10/2026): page transitions, scroll reveals, 3D tilt, interactive 3D Step Mark, mobile
   menu + sticky CTA, count-ups and chart fills. Works with fx.js; everything here only animates transform/opacity/
   clip-path, and nothing hides content unless fx.js is running (html.fx). prefers-reduced-motion turns motion off. */

/* ── Page-to-page transitions (Chrome/Edge/Android, Safari 18.2+) ── */
@view-transition { navigation: auto; }
.lp > header, body > header { view-transition-name: gradus-header; }
::view-transition-old(root) { animation: fx-vt-out 220ms cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: fx-vt-in 420ms cubic-bezier(.16, 1, .3, 1) both; }
::view-transition-group(gradus-header) { animation-duration: 300ms; }
@keyframes fx-vt-out { to { opacity: 0; transform: translateY(-10px) scale(.992); } }
@keyframes fx-vt-in { from { opacity: 0; transform: translateY(18px); } }

/* ── Reading progress ── */
.fx-progress { position: fixed; z-index: 60; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, #b8ff3d, #d6ff8a); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
@supports (animation-timeline: scroll()) {
  .fx-progress { animation: fx-progress linear both; animation-timeline: scroll(root); }
  @keyframes fx-progress { to { transform: scaleX(1); } }
}

/* ── Reveal on scroll ── */
html.fx [data-rv] { opacity: 0; transition: opacity .8s cubic-bezier(.16, 1, .3, 1) var(--rv-d, 0ms), transform .9s cubic-bezier(.16, 1, .3, 1) var(--rv-d, 0ms), filter .8s ease var(--rv-d, 0ms); will-change: opacity, transform; }
html.fx [data-rv="up"] { transform: translateY(28px); }
html.fx [data-rv="card"] { transform: translateY(36px) scale(.975); }
html.fx [data-rv="device"] { transform: translateY(60px) rotateX(14deg); transform-origin: 50% 100%; }
html.fx [data-rv="fade"] { filter: blur(6px); }
html.fx [data-rv].in { opacity: 1; transform: none; filter: none; }
html.fx [data-rv].in.fx-done { will-change: auto; }

/* Headline: words rise from a mask. */
.fx-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.fx-wi { display: inline-block; }
html.fx .fx-split .fx-wi { transform: translateY(108%); transition: transform 1s cubic-bezier(.16, 1, .3, 1) var(--wd, 0ms); }
html.fx .fx-split.in .fx-wi { transform: none; }

/* Chart fills: horizontal bars grow from the left, vertical bars rise. */
html.fx [data-bar] { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.1s cubic-bezier(.16, 1, .3, 1) var(--rv-d, 0ms); }
html.fx [data-bar].in { transform: none; }
html.fx [data-vbar] { clip-path: inset(100% 0 0 0); transition: clip-path .9s cubic-bezier(.16, 1, .3, 1) var(--rv-d, 0ms); }
html.fx [data-vbar].in { clip-path: inset(0 0 0 0); }
[data-vbar] { cursor: default; }
.fx-tip { position: absolute; z-index: 5; padding: 6px 10px; border-radius: 10px; background: #f7f9fc; color: #0b0d10; font: 800 12px/1.2 Inter, system-ui, sans-serif; white-space: nowrap; pointer-events: none; transform: translate(-50%, calc(-100% - 8px)); box-shadow: 0 10px 24px rgba(0,0,0,.45); opacity: 0; transition: opacity .15s; }
.fx-tip.on { opacity: 1; }

/* ── 3D devices and panels ── */
.fx-stage { perspective: 1400px; }
.device.fx-3d { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--fy, 0px)); transform-style: preserve-3d; will-change: transform; }
/* Once revealed (or when not revealed at all, in the hero) the tilt owns the transform, updated every frame. */
html.fx .device.fx-3d.in, html.fx .device.fx-3d:not([data-rv]) { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--fy, 0px)); }
html.fx .device.fx-3d.fx-done, html.fx .device.fx-3d:not([data-rv]) { transition: none; }
.device.fx-3d .dv-glare { background-size: 220% 100%; background-position: var(--gx, 0%) 0; }
.device.fx-3d::after { content: ''; position: absolute; inset: auto 8% -38px 8%; height: 40px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.55), rgba(0,0,0,0)); transform: translateZ(-60px) scale(var(--shadow, 1)); pointer-events: none; }
[data-fx="hero-visual"] { perspective: 1600px; }
[data-fx="hero-visual"] > * { transform: rotateX(var(--px, 0deg)) rotateY(var(--py, 0deg)) translateY(var(--pt, 0px)); transform-origin: 50% 0; will-change: transform; transition: box-shadow .4s; }
.float.fx-float { will-change: transform; transform: translate3d(var(--fx-x, 0px), var(--fx-y, 0px), 0); }

/* ── Cards: light that follows the cursor (fine pointers only, set by fx.js) ── */
.fx-card { position: relative; }
.fx-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(184, 255, 61, .075), transparent 46%); }
.fx-card:hover::after { opacity: 1; }
.fx-tilt { transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); transition: transform .5s cubic-bezier(.16, 1, .3, 1); }

/* Buttons: press feedback everywhere, magnetic pull on desktop (fx.js sets --bx/--by). */
.lp a.cta-p, .lp a.cta-g, .lp button { transition: transform .35s cubic-bezier(.16, 1, .3, 1), background-color .2s, border-color .2s, color .2s, box-shadow .3s; }
.lp a.cta-p { transform: translate(var(--bx, 0px), var(--by, 0px)); }
.lp a.cta-p:hover { box-shadow: 0 10px 34px rgba(184, 255, 61, .28); }
.lp a.cta-p:active, .lp a.cta-g:active { transform: translate(var(--bx, 0px), var(--by, 0px)) scale(.965); }

/* Demo switches become real switches. */
.fx-switch { cursor: pointer; transition: background-color .25s; }
.fx-switch > span { transition: transform .3s cubic-bezier(.16, 1, .3, 1), background-color .25s; }
.fx-switch:focus-visible { outline: 2px solid #b8ff3d; outline-offset: 3px; }

/* ── Phones carousel: 3D coverflow + drag + dots ── */
.phones.fx-cover { perspective: 1200px; cursor: grab; }
.phones.fx-cover.drag { cursor: grabbing; scroll-snap-type: none !important; }
.phones.fx-cover > * { transform: rotateY(var(--cy, 0deg)) scale(var(--cs, 1)); opacity: var(--co, 1); transition: transform .25s ease-out, opacity .25s; }
.phones.fx-cover img { -webkit-user-drag: none; user-select: none; }
.fx-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.fx-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: #2c3440; cursor: pointer; transition: width .35s cubic-bezier(.16, 1, .3, 1), background-color .25s; }
.fx-dots button[aria-current="true"] { width: 26px; background: #b8ff3d; }
.fx-dots button::before { content: ''; display: block; margin: -18px; width: calc(100% + 36px); height: 44px; }

/* ── Interactive 3D Step Mark ── */
.fx-mark { position: relative; width: var(--mk, 180px); height: var(--mk, 180px); perspective: 900px; cursor: grab; touch-action: pan-y; margin-inline: auto; -webkit-tap-highlight-color: transparent; }
.fx-mark.drag { cursor: grabbing; }
.fx-mark .m3 { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--mx3, -12deg)) rotateY(var(--my3, -24deg)); }
.fx-mark .m3 i { position: absolute; inset: 0; background-repeat: no-repeat; background-size: 100% 100%; transform: translateZ(var(--z)); backface-visibility: visible; }
.fx-mark::after { content: ''; position: absolute; left: 10%; right: 10%; bottom: -22%; height: 18%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--mkc, #b8ff3d) 35%, transparent), transparent); filter: blur(6px); opacity: .8; pointer-events: none; }
.fx-mark-hint { display: block; margin-top: 26px; font: 700 12px/1 Inter, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #5b6472; text-align: center; }

/* ── Mobile: menu, sticky CTA, spacing, tap targets ── */
.fx-burger { display: none; place-items: center; width: 44px; height: 44px; margin-right: -6px; border: 1px solid #242b34; border-radius: 14px; background: #11151a; color: #f7f9fc; cursor: pointer; }
.fx-burger svg { width: 20px; height: 20px; }
.fx-menu { position: fixed; z-index: 80; inset: 0; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 18px) 24px calc(env(safe-area-inset-bottom, 0px) + 24px); background: rgba(11, 13, 16, .97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-family: Inter, system-ui, sans-serif; opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.fx-menu.open { opacity: 1; visibility: visible; transition: opacity .3s; }
.fx-menu-top { display: flex; align-items: center; justify-content: space-between; height: 44px; margin-bottom: 28px; color: #f7f9fc; font-weight: 900; letter-spacing: .06em; font-size: 19px; }
.fx-menu nav { display: flex; flex-direction: column; }
.fx-menu nav a { display: flex; align-items: center; justify-content: space-between; min-height: 60px; border-bottom: 1px solid #1b2027; color: #f7f9fc; text-decoration: none; font-size: 26px; font-weight: 800; letter-spacing: -.02em; transform: translateY(16px); opacity: 0; transition: transform .5s cubic-bezier(.16, 1, .3, 1) var(--d), opacity .4s var(--d); }
.fx-menu nav a::after { content: '→'; font-size: 20px; color: #5b6472; }
.fx-menu.open nav a { transform: none; opacity: 1; }
.fx-menu .fx-menu-ctas { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.fx-menu .fx-menu-ctas a { display: flex; align-items: center; justify-content: center; min-height: 56px; border-radius: 999px; font-size: 17px; font-weight: 800; text-decoration: none; }
.fx-sticky { position: fixed; z-index: 55; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); display: none; gap: 10px; padding: 8px; border-radius: 999px; background: rgba(17, 21, 26, .92); border: 1px solid #242b34; box-shadow: 0 18px 44px rgba(0, 0, 0, .55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transform: translateY(140%); transition: transform .45s cubic-bezier(.16, 1, .3, 1); font-family: Inter, system-ui, sans-serif; }
.fx-sticky.on { transform: none; }
.fx-sticky a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 999px; font-size: 15px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.fx-sticky a.p { background: var(--fx-accent, #b8ff3d); color: #0b0d10; }
.fx-sticky a.g { flex: 0 0 auto; padding-inline: 18px; color: #f7f9fc; border: 1px solid #2c3440; }

@media (max-width: 960px) {
  .fx-burger { display: grid; }
  .fx-sticky { display: flex; }
  body.fx-menu-open { overflow: hidden; }
  /* The fixed CTA bar must not cover the last lines of the page. */
  .lp > footer, body > footer { padding-bottom: 84px; }
}
@media (max-width: 560px) {
  /* Phones: the header keeps the logo and the menu; the call to action lives in the hero and the bottom bar. */
  .lp > header .cta-p { display: none !important; }
}
@media (max-width: 359px) {
  /* Smallest phones: the two bottom-bar buttons have to fit on one line without leaving the bar. */
  .fx-sticky { gap: 8px; padding: 6px; }
  .fx-sticky a { font-size: 13px; }
  .fx-sticky a.g { padding-inline: 12px; }
}
@media (max-width: 640px) {
  /* Inline section paddings were set for desktop (100–130 px); phones get a shorter rhythm. */
  .lp section[style*="padding-block: 1"] { padding-block: 72px !important; }
  .lp section[style*="padding-block: 80px 72px"] { padding-block: 56px 48px !important; }
  .lp .wrap { padding-inline: 20px; }
  /* Thumb-sized links in the footer. */
  .lp footer nav a { display: inline-flex !important; align-items: center; min-height: 44px; }
  .lp footer nav { row-gap: 0 !important; }
  /* Degraus labels (Fundação · Evolução · Performance · Legado) fit four columns. */
  .fx-degrau-labels { font-size: 9.5px !important; letter-spacing: .04em !important; }
  .fx-mark { --mk: 118px; }
  .lp h1 { letter-spacing: -0.045em !important; }
}

@media (prefers-reduced-motion: reduce) {
  html.fx [data-rv], html.fx .fx-split .fx-wi, html.fx [data-bar], html.fx [data-vbar] { opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important; transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .fx-progress { display: none; }
}
