/* Animated illustrations. art.js sets four values on every .art element:
   --p   0 to 1 as the illustration crosses the viewport (scroll position)
   --b   0 to 1 as it first comes into view (build-up)
   --mx, --my   pointer position inside it, -1 to 1
   It also toggles .in-view, .is-on (clicked) and .poke (one-shot after a click).
   Without JavaScript the defaults below show every illustration fully built. */
.art {
  --p: 0.5;
  --b: 1;
  --mx: 0;
  --my: 0;
  --c1: var(--coral);
  --c2: var(--blue);
  --c3: var(--yellow);
  --c4: var(--lavender);
  cursor: var(--cursor-press);
  -webkit-tap-highlight-color: transparent;
}
.art text {
  font-family: var(--body);
  font-weight: 800;
  letter-spacing: -3px;
  fill: currentColor;
  stroke: none;
}
.art .floaters {
  transform: translate(calc(var(--mx) * 12px), calc(var(--my) * 12px));
  transition: transform 0.35s ease-out;
}
.art.in-view .floaters > * {
  transform-box: fill-box;
  transform-origin: center;
  animation: art-float 4.5s ease-in-out infinite;
}
.art.in-view .floaters > :is(.f2, .f4) {
  animation: art-twinkle 3.2s ease-in-out -1s infinite;
}
.art.in-view .floaters > :is(.f3, .f5) {
  animation-delay: -2.2s;
}
.art .flow {
  stroke-dasharray: 10 13;
}
.art.in-view .flow {
  animation: art-dash 1.1s linear infinite;
}
.art:hover .flow {
  animation-duration: 0.45s;
}

/* Lines that draw themselves: the clean stroke uses a dash offset, the inked one a wipe. */
.art :is(.tick, .squiggle, .chart, .write, .trail) {
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--drawn, 1));
}
.art .ink:is(.tick, .squiggle, .chart, .write, .trail) {
  clip-path: inset(-30% calc((1 - var(--drawn, 1)) * 100%) -30% -30%);
}

/* Hand-inked lines from ink.js. Until an illustration is inked its clean strokes stay hidden,
   so the pencil lines are the first lines anyone sees. */
.ink-on svg:is(.art, .character, .hero-mascot):not(.is-inked) :is(path, circle, rect, ellipse, line) {
  stroke-opacity: 0;
}
.ink-on svg:is(.art, .character, .hero-mascot) .no-brush :is(path, circle, rect, ellipse, line) {
  stroke-opacity: 1;
}
.inked {
  stroke-opacity: 0;
}
.ink-in .ink > image {
  animation: ink-in 0.3s both;
  animation-delay: calc(var(--k) * 0.9s);
}
.story-scene .ink > image {
  opacity: clamp(0, (var(--draw, 1) * 1.25 - var(--k)) * 12, 1);
}
@keyframes ink-in {
  from {
    opacity: 0;
  }
}

/* Lightbulb: lights when it scrolls into view; click switches it off and on. */
.art-idea .glass {
  transition: fill 0.45s;
}
.art-idea.in-view:not(.is-on) .glass {
  fill: var(--yellow);
}
.art-idea .rays {
  transform-origin: 320px 236px;
  transform: scale(calc(0.5 + 0.5 * var(--b)));
  opacity: var(--b);
  transition:
    transform 0.35s,
    opacity 0.35s;
}
.art-idea.in-view:not(.is-on) .rays > * {
  animation: art-pulse 2.2s ease-in-out infinite;
}
.art-idea:hover .rays {
  transform: scale(1.1);
}
.art-idea.is-on .rays {
  transform: scale(0.5);
  opacity: 0;
}
.art-idea .bulb {
  transform-origin: 320px 372px;
}
.art-idea.poke .bulb {
  animation: art-pop 0.45s;
}

/* Website: cards rise in, the sun follows the scroll, the cursor presses the button. */
.art-web .card {
  transform: translateY(calc((1 - var(--b)) * (26px + var(--i) * 18px)));
  opacity: var(--b);
}
.art-web .sun {
  transform: translateY(calc((0.5 - var(--p)) * 70px));
}
.art-web .cursor {
  transform: translate(430px, 356px);
  transition: transform 0.6s cubic-bezier(0.3, 0.9, 0.3, 1);
}
.art-web:hover .cursor,
.art-web.is-on .cursor {
  transform: translate(196px, 284px);
}
.art-web .web-btn {
  transition: fill 0.2s 0.45s;
}
.art-web:hover .web-btn,
.art-web.is-on .web-btn {
  fill: var(--coral);
}
.art-web .burst {
  opacity: 0;
}
.art-web.poke .burst {
  animation: art-burst 0.6s 0.45s;
}

/* Systems: work flows between tools, gears turn with the scroll, the checklist completes. */
.art-systems .gear {
  transform-box: fill-box;
  transform-origin: center;
}
.art-systems .g1 {
  transform: rotate(calc(var(--p) * 360deg));
}
.art-systems .g2 {
  transform: rotate(calc(var(--p) * -463deg + 14deg));
}
.art-systems.in-view:hover .g1 {
  animation: art-spin 4s linear infinite;
}
.art-systems.in-view:hover .g2 {
  animation: art-spin 3.1s linear infinite reverse;
}
.art-systems .tick {
  --drawn: clamp(0, var(--b) * 3.4 - var(--i) - 0.3, 1);
}
.art-systems .bar {
  transform-box: fill-box;
  transform-origin: bottom;
  transform: scaleY(clamp(0.05, var(--b) * 2 - var(--i) * 0.25, 1));
}
.art-systems .done {
  transition: fill 0.3s;
}
.art-systems.is-on .done,
.art-systems:hover .done {
  fill: var(--yellow);
}
.art-systems .done-pill {
  transform-origin: 320px 493px;
}
.art-systems.poke .done-pill {
  animation: art-pop 0.45s;
}

/* Brand: the mark turns with the scroll, swatches pop in, click swaps the palette. */
.art-brand.is-on {
  --c1: var(--yellow);
  --c2: var(--coral);
  --c3: var(--blue);
  --c4: var(--pink);
}
.art-brand .petals {
  transform-origin: 260px 196px;
  transform: rotate(calc(var(--p) * 240deg));
}
.art-brand .petals path,
.art-brand .sw {
  transition: fill 0.4s;
}
.art-brand.in-view:hover .petals {
  animation: art-spin 6s linear infinite;
}
.art-brand .sw {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(clamp(0, var(--b) * 4 - var(--i) * 0.7 - 0.4, 1));
}
.art-brand:hover .sw {
  transform: translateY(calc(-6px - var(--i) * 3px));
  transition:
    transform 0.3s,
    fill 0.4s;
}
.art-brand .spec {
  transform: translateX(calc((1 - var(--b)) * 50px));
  opacity: var(--b);
}
.art-brand .squiggle {
  --drawn: var(--b);
}
.art-brand .brand-pencil {
  transform: translate(calc((var(--b) - 1) * 330px), calc(var(--my) * 4px));
}

/* Motion: the playhead follows the scroll, the ball bounces, click pauses it. */
.art-motion .playhead {
  transform: translateX(calc(var(--p) * 440px));
}
.art-motion .arc {
  stroke-dasharray: 3 11;
}
.art-motion .pause-icon,
.art-motion.is-on .play-icon {
  opacity: 0;
}
.art-motion.is-on .pause-icon {
  opacity: 1;
}
.art-motion .keys > * {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.3s;
}
.art-motion:hover .keys > * {
  transform: scale(1.35);
}
.art-motion .play {
  transform-origin: 500px 118px;
}
.art-motion.poke .play {
  animation: art-pop 0.45s;
}

/* CRM: leads drop into the funnel, the deal moves along the pipeline with the scroll,
   the phone types a reply. Click wins the deal. */
.art-crm .leads {
  opacity: var(--b);
}
.art-crm .lead {
  transform-box: fill-box;
  transform-origin: center;
}
.art-crm.in-view .lead {
  animation: art-drop 2.4s ease-in infinite;
  animation-delay: calc(var(--i) * -0.8s);
}
.art-crm .funnel {
  transform: translate(calc(var(--mx) * 10px), calc(var(--my) * 6px));
  transition: transform 0.35s ease-out;
}
.art-crm .col {
  transform: translateY(calc((1 - var(--b)) * (24px + var(--i) * 16px)));
  opacity: var(--b);
}
.art-crm .won {
  transition: fill 0.4s;
}
.art-crm.is-on .won {
  fill: var(--yellow);
}
.art-crm .tick {
  --drawn: var(--b);
}
.art-crm .deal {
  transform: translateX(calc(clamp(0, var(--p) * 1.6 - 0.3, 1) * 206px));
  transition: transform 0.3s ease-out;
}
.art-crm:hover .deal {
  transform: translate(calc(clamp(0, var(--p) * 1.6 - 0.3, 1) * 206px), -6px);
}
.art-crm.is-on .deal {
  transform: translateX(206px);
  transition-duration: 0.6s;
}
.art-crm .phone-wrap {
  transform: translate(calc(var(--mx) * -6px), calc(var(--my) * -4px));
  transition: transform 0.35s ease-out;
}
.art-crm .phone {
  transform-origin: 118px 400px;
}
.art-crm.poke .phone {
  animation: art-pop 0.45s;
}
.art-crm .msg {
  transform: translateY(calc((1 - clamp(0, var(--b) * 2 - var(--i) * 0.6, 1)) * 14px));
  opacity: clamp(0, var(--b) * 2 - var(--i) * 0.6, 1);
}
.art-crm.in-view .dot {
  animation: art-type 1.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.15s);
}
.art-crm:hover .dot {
  animation-duration: 0.6s;
}

/* Small drawings beside the GHL deliverables. Each plays when its row is hovered or focused,
   moves a little with the scroll, and clicking holds the finished state. */
.art-pipeline .deal {
  transform: translateX(calc(clamp(0, (var(--p) - 0.2) * 2.5, 1) * 68px));
  transition: transform 0.45s cubic-bezier(0.3, 0.9, 0.3, 1);
}
.deliverables article:is(:hover, :focus-within) .art-pipeline .deal,
.art-pipeline.is-on .deal {
  transform: translateX(136px);
}
.art-pipeline .won,
.art-leadform :is(.day, .send-btn),
.art-autoflow .bubble-fill {
  transition: fill 0.35s 0.2s;
}
.deliverables article:is(:hover, :focus-within) .art-pipeline .won,
.art-pipeline.is-on .won,
.deliverables article:is(:hover, :focus-within) .art-leadform .day,
.art-leadform.is-on .day {
  fill: var(--yellow);
}
.art-leadform .write {
  --drawn: clamp(0, (var(--p) - 0.25) * 4 - var(--i) * 0.5, 1);
}
.art-leadform .tick {
  --drawn: 0;
}
.deliverables article:is(:hover, :focus-within) .art-leadform :is(.write, .tick),
.art-leadform.is-on :is(.write, .tick) {
  --drawn: 1;
}
.art-leadform .send {
  transition: transform 0.2s;
}
.deliverables article:is(:hover, :focus-within) .art-leadform .send,
.art-leadform.is-on .send {
  transform: translateY(2px);
}
.deliverables article:is(:hover, :focus-within) .art-leadform .send-btn,
.art-leadform.is-on .send-btn {
  fill: var(--coral);
}
.art-autoflow .packets {
  opacity: var(--b);
}
.art-autoflow.in-view .dot {
  animation: art-type 1.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.15s);
}
.deliverables article:is(:hover, :focus-within) .art-autoflow .dot {
  animation-duration: 0.6s;
}
.art-autoflow .bubble {
  transform-origin: 200px 72px;
  transform: translateY(calc((0.5 - var(--p)) * 10px));
}
.deliverables article:is(:hover, :focus-within) .art-autoflow .bubble-fill,
.art-autoflow.is-on .bubble-fill {
  fill: var(--coral);
}
.art-autoflow.poke .bubble {
  animation: art-pop 0.45s;
}
.art-migrate .mover {
  transform-box: fill-box;
  transform-origin: center;
  opacity: var(--b);
}
.art-migrate.in-view .mover {
  animation: art-move 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.85s);
}
.deliverables article:is(:hover, :focus-within) .art-migrate .mover {
  animation-duration: 1.3s;
}
.art-migrate .sheet {
  transform: translateX(calc((0.5 - var(--p)) * 10px));
  transition: opacity 0.4s;
}
.art-migrate.is-on .sheet {
  opacity: 0.35;
}

/* Roadmap: a lead travels the road with the scroll and wakes each stop as it arrives.
   Stops lean toward the pointer; click flips the launch switch and the team nods. */
.art-roadmap {
  --d: clamp(0, (var(--p) - 0.12) * 2.7, 1);
}
.art-roadmap :is(.stn, .stop) {
  --lit: clamp(0, (var(--d) - var(--at)) * 10 + 0.5, 1);
}
.art-roadmap .trail {
  --drawn: var(--d);
}
.art-roadmap .stn {
  transform: translate(calc(var(--mx) * (3px + var(--i) * 2px)), calc((1 - var(--lit)) * 12px));
  opacity: calc(0.4 + var(--lit) * 0.6);
  transition: transform 0.3s ease-out;
}
.art-roadmap .stop-on {
  opacity: var(--lit);
}
.art-roadmap .token {
  display: none;
  offset-distance: calc(var(--d) * 100%);
  offset-rotate: 0deg;
  transition: offset-distance 0.2s ease-out;
}
@supports (offset-path: path("M0 0")) {
  .art-roadmap .token {
    display: inline;
  }
}
.art-roadmap .pin {
  transition: transform 0.3s;
}
.art-roadmap:hover .pin {
  transform: translateY(-8px);
}
.art-roadmap .slot {
  transform: translateY(calc((1 - clamp(0, var(--lit) * 3 - var(--i) * 0.5, 1)) * -24px));
  opacity: clamp(0, var(--lit) * 3 - var(--i) * 0.5, 1);
}
.art-roadmap .pen {
  transform: translate(calc(var(--mx) * -10px), calc(var(--my) * 6px));
  transition: transform 0.35s ease-out;
}
.art-roadmap .tick {
  --drawn: clamp(0, var(--lit) * 2 - var(--i), 1);
}
.art-roadmap .s4 {
  --on: var(--lit);
}
.art-roadmap.is-on .s4 {
  --on: calc(1 - var(--lit));
}
.art-roadmap .track-on {
  opacity: var(--on);
}
.art-roadmap .knob {
  transform: translateX(calc(var(--on) * 68px));
  transition: transform 0.4s cubic-bezier(0.3, 0.9, 0.3, 1);
}
.art-roadmap.in-view:hover .person {
  animation: art-nod 1.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.25s);
}
.art-roadmap.in-view.poke .person {
  animation: art-nod 0.5s ease-in-out 2;
  animation-delay: calc(var(--i) * 0.08s);
}

/* Rocket: climbs with the scroll, flame flickers, hover boosts it. */
.art-rocket .fly {
  transform: translate(calc((var(--p) - 0.5) * 90px + var(--mx) * 6px), calc((0.5 - var(--p)) * 120px + var(--my) * 6px));
  transition: transform 0.25s ease-out;
}
.art-rocket .flame {
  transform-box: fill-box;
  transform-origin: top;
}
.art-rocket.in-view .flame {
  animation: art-flame 0.32s ease-in-out infinite alternate;
}
.art-rocket:hover .flame {
  animation-name: art-flame-boost;
}
.art-rocket .speed {
  opacity: calc(var(--p) * 1.4);
  stroke-dasharray: 14 12;
}
.art-rocket.in-view .speed {
  animation: art-dash 0.5s linear infinite;
}
.art-rocket .stars > * {
  transform-box: fill-box;
  transform-origin: center;
}
.art-rocket.in-view .stars > * {
  animation: art-twinkle 2.6s ease-in-out infinite;
}
.art-rocket.in-view .stars > :is(.s2, .s4) {
  animation-delay: -1.3s;
}
.art-rocket .planet {
  transform: translate(calc(var(--mx) * -8px), calc((var(--p) - 0.5) * 40px));
}
.art-rocket .puffs > * {
  transform-box: fill-box;
  transform-origin: center;
}
.art-rocket.in-view .puffs > * {
  animation: art-puff 2.2s ease-in-out infinite;
}
.art-rocket.in-view .puffs > .p2 {
  animation-delay: -0.7s;
}
.art-rocket.in-view .puffs > .p3 {
  animation-delay: -1.4s;
}
.art-rocket.poke .fly > g {
  animation: art-launch 0.9s cubic-bezier(0.5, 0, 0.2, 1);
}

/* Product: components slide into the phone, the slider follows the scroll, click flips the switch. */
.art-product .comp {
  opacity: var(--b);
}
.art-product .from-left {
  transform: translateX(calc((var(--b) - 1) * (60px + var(--i) * 30px)));
}
.art-product .from-right {
  transform: translateX(calc((1 - var(--b)) * (60px + var(--i) * 30px)));
}
.art-product .chart {
  --drawn: var(--b);
}
.art-product .slider-knob {
  transform: translateX(calc(var(--p) * 162px));
}
.art-product .toggle-knob,
.art-product .toggle-track {
  transition:
    transform 0.25s,
    fill 0.25s;
}
.art-product.is-on .toggle-knob {
  transform: translateX(24px);
}
.art-product.is-on .toggle-track {
  fill: var(--yellow);
}
.art-product .cta {
  transition: fill 0.2s;
}
.art-product:hover .cta {
  fill: var(--coral);
}

/* Notebook: notes write themselves in as it scrolls into view. */
.art-notebook .write {
  --drawn: clamp(0, var(--b) * 6.5 - var(--i), 1);
}
.art-notebook .note-pencil {
  transform: translate(calc((var(--b) - 1) * 120px + var(--mx) * 8px), calc((var(--b) - 1) * 60px));
  transition: transform 0.3s ease-out;
}
.art-notebook .ribbon {
  transform-origin: 499px 124px;
}
.art-notebook.in-view .ribbon {
  animation: art-sway 3.4s ease-in-out infinite;
}
.art-notebook .sticky path:first-child {
  transition: fill 0.3s;
}
.art-notebook.is-on .sticky path:first-child {
  fill: var(--coral);
}
.art-notebook .sticky {
  transform-origin: 476px 380px;
}
.art-notebook.poke .sticky {
  animation: art-pop 0.45s;
}

/* Speech bubbles: they pop in, the reply types, click answers. */
.art-bubbles .bubble {
  transform-box: fill-box;
}
.art-bubbles .b1 {
  transform-origin: 20% 100%;
  transform: scale(clamp(0.2, var(--b) * 2, 1));
}
.art-bubbles .b2 {
  transform-origin: 75% 100%;
  transform: scale(clamp(0, var(--b) * 2 - 0.6, 1));
}
.art-bubbles .b3 {
  transform-origin: 30% 100%;
  transform: scale(clamp(0, var(--b) * 2 - 1, 1));
}
.art-bubbles .dots circle {
  transform-box: fill-box;
  transform-origin: center;
}
.art-bubbles.in-view .dots circle {
  animation: art-type 1.1s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.16s);
}
.art-bubbles .answer,
.art-bubbles.is-on .dots {
  opacity: 0;
}
.art-bubbles.is-on .answer {
  opacity: 1;
}
.art-bubbles .mark {
  transform-origin: 242px 190px;
}
.art-bubbles:hover .mark {
  animation: art-nod 0.7s ease-in-out;
}

/* Paper plane: flies across with the scroll. */
.art-plane .plane-fly {
  transform: translate(calc((var(--p) - 0.5) * 130px + var(--mx) * 8px), calc((0.5 - var(--p)) * 80px + var(--my) * 8px));
  transition: transform 0.25s ease-out;
}
.art-plane .trail {
  stroke-dasharray: 10 13;
}
.art-plane.in-view .trail {
  animation: art-dash 1.1s linear infinite;
}
.art-plane .clouds path {
  transform: translateX(calc((0.5 - var(--p)) * 60px));
}
.art-plane .letter {
  transform-origin: 134px 168px;
}
.art-plane.poke .letter {
  animation: art-pop 0.45s;
}
.art-plane.poke .plane-body {
  animation: art-send 0.9s cubic-bezier(0.5, 0, 0.2, 1);
}

/* The character asleep, for the 404 page. */
.character .eye-closed,
.hero-mascot .eye-closed {
  display: none;
}
.character.asleep .eye,
.character.asleep .smile {
  display: none;
}
.character.asleep .eye-closed {
  display: inline;
}
.character.asleep .screen {
  fill: var(--lavender);
}
.character.asleep .power {
  fill: var(--paper);
}
.character.asleep .zees > * {
  animation: art-zee 3s ease-in-out infinite;
}
.character.asleep .zees > .z2 {
  animation-delay: 0.5s;
}
.character.asleep .zees > .z3 {
  animation-delay: 1s;
}

@keyframes art-float {
  50% {
    transform: translateY(-9px);
  }
}
@keyframes art-twinkle {
  50% {
    transform: scale(0.6);
    opacity: 0.55;
  }
}
@keyframes art-drop {
  0% {
    transform: translateY(-24px);
    opacity: 0;
  }
  15% {
    transform: none;
    opacity: 1;
  }
  70% {
    transform: translate(var(--dx), 120px) scale(0.7);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), 160px) scale(0.5);
    opacity: 0;
  }
}
@keyframes art-move {
  0% {
    transform: none;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    transform: translate(118px, var(--dy));
    opacity: 1;
  }
  100% {
    transform: translate(118px, var(--dy));
    opacity: 0;
  }
}
@keyframes art-pulse {
  50% {
    opacity: 0.35;
  }
}
@keyframes art-pop {
  40% {
    transform: scale(1.12);
  }
}
@keyframes art-dash {
  to {
    stroke-dashoffset: -23;
  }
}
@keyframes art-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes art-burst {
  0% {
    opacity: 1;
    transform: translateX(-6px);
  }
  100% {
    opacity: 0;
    transform: translateX(8px);
  }
}
@keyframes art-flame {
  from {
    transform: scaleY(0.82);
  }
  to {
    transform: scaleY(1.06);
  }
}
@keyframes art-flame-boost {
  from {
    transform: scaleY(1.15);
  }
  to {
    transform: scaleY(1.5);
  }
}
@keyframes art-puff {
  50% {
    transform: scale(1.25);
    opacity: 0.6;
  }
}
@keyframes art-launch {
  45% {
    transform: translate(150px, -190px);
  }
  46% {
    transform: translate(-150px, 190px);
    opacity: 0;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
@keyframes art-send {
  45% {
    transform: translate(260px, -120px);
    opacity: 0;
  }
  46% {
    transform: translate(-200px, 90px);
    opacity: 0;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
@keyframes art-sway {
  50% {
    transform: skewX(-6deg);
  }
}
@keyframes art-type {
  30% {
    transform: translateY(-9px);
  }
  60% {
    transform: none;
  }
}
@keyframes art-nod {
  30% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(3px);
  }
}
@keyframes art-zee {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-18px);
  }
}
