/* Cartano — editorial motion layer.
   Progressive enhancement: scoped to .ws-home; all content remains usable without JS.
   No remote dependencies, auto-scrolling, WebGL, or pinned scenes. */

body.ws-home { --ws-scroll-progress: 0; }
body.ws-home::after {
  content: ""; position: fixed; z-index: 100; top: 0; left: 0; height: 3px;
  width: 100%; background: var(--ws-accent);
  transform: scaleX(var(--ws-scroll-progress)); transform-origin: left center;
  pointer-events: none; will-change: transform;
}

/* Signature hero: crafted lines + responsive luminous paper, not a floating object. */
body.ws-home .ws-hero {
  isolation: isolate; overflow: clip; padding-bottom: 90px;
}
body.ws-home .ws-hero::after {
  content: ""; position: absolute; z-index: 0; inset: 12px 6% auto;
  height: min(410px, 43vw); pointer-events: none; opacity: .53;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(42,104,80,.13) 50%, transparent calc(50% + .5px)),
    repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), rgba(66,110,86,.085) 25%, transparent calc(25% + 1px));
  mask-image: linear-gradient(to bottom, transparent, #000 27%, transparent 93%);
}
.ws-hero-wash {
  position: absolute !important; z-index: 0 !important; pointer-events: none;
  top: 25%; left: 50%; width: min(1050px, 110vw); height: 660px;
  border-radius: 50%; opacity: .68;
  background: radial-gradient(ellipse at 50% 32%, rgba(166,203,176,.27), rgba(224,211,183,.13) 37%, transparent 70%);
  transform: translate3d(calc(-50% + var(--ws-pointer-x, 0px)), calc(-40% + var(--ws-pointer-y, 0px)), 0);
  transition: transform .25s ease-out;
}
body.ws-home .ws-hero h1 {
  text-wrap: balance; position: relative; max-width: 1070px;
}
body.ws-home .ws-hero h1 .ws-highlight {
  position: relative; display: inline-block; white-space: normal; z-index: 0;
}
body.ws-home .ws-hero h1 .ws-highlight::after {
  content: ""; position: absolute; z-index: -1; left: 1%; right: 1%; bottom: .05em; height: .095em;
  background: #bfdbc8; transform: scaleX(0); transform-origin: left center;
  border-radius: 100% 65% 80% 35%; animation: ws-underline 1s .69s both cubic-bezier(.2,.8,.2,1);
}
body.ws-home .ws-hero > .ws-eyebrow { animation: ws-editorial-enter .64s .02s both cubic-bezier(.2,.75,.2,1); }
body.ws-home .ws-hero h1 { animation: ws-editorial-enter .8s .13s both cubic-bezier(.16,1,.3,1); }
body.ws-home .ws-hero-lede { animation: ws-editorial-enter .75s .24s both cubic-bezier(.16,1,.3,1); }
body.ws-home .ws-hero .ws-actions { animation: ws-editorial-enter .7s .35s both cubic-bezier(.16,1,.3,1); }
body.ws-home .ws-hero .ws-micro, body.ws-home .ws-hero .ws-preview-note {
  animation: ws-soft-fade .78s .43s both ease-out;
}
.ws-scroll-cue {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 58px auto 0; color: #6d8174; text-transform: uppercase;
  font-weight: 700; letter-spacing: .16em; font-size: 10px;
  animation: ws-soft-fade 1s .75s both ease-out;
}
.ws-scroll-cue i {
  width: 76px; height: 1px; background: #c1cfc3; position: relative; overflow: hidden;
}
.ws-scroll-cue i::after {
  content: ""; display: block; width: 32px; height: 1px;
  background: var(--ws-accent); transform: translateX(-34px);
  animation: ws-cue-slide 1.15s .9s both cubic-bezier(.3,.7,.2,1);
}

/* Contrast should feel editorial, not like two unrelated static cards. */
.ws-demo-kicker { transition: border-color .3s; }
.ws-comparison { position: relative; }
.ws-comparison::after {
  content: ""; position: absolute; top: 7%; bottom: 7%; left: 50%;
  width: 1px; background: linear-gradient(transparent, rgba(40,107,92,.32), transparent);
  pointer-events: none; opacity: .85;
}
.ws-after .ws-app { transform-origin: center bottom; transition: box-shadow .5s, transform .5s; }
@media (hover:hover) and (pointer:fine) {
  .ws-comparison:hover .ws-after .ws-app {
    box-shadow: 0 25px 55px rgba(32,72,53,.13); transform: translateY(-5px);
  }
  .ws-feature:hover .ws-dashboard {
    box-shadow: 0 26px 62px rgba(28,66,45,.14);
  }
}

/* Micro-interactions: lines, restrained depth, responsive hover. */
.ws-problem { position: relative; transition: padding-left .32s cubic-bezier(.2,.7,.2,1), background .32s; }
.ws-problem::before {
  content: ""; position: absolute; top: 0; left: 0; right: 100%; height: 1px;
  background: var(--ws-accent); transition: right .45s cubic-bezier(.2,.7,.2,1);
}
.ws-feature { position: relative; overflow: hidden; }
.ws-feature::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity .4s;
  background: radial-gradient(closest-side at var(--ws-feature-x, 75%) var(--ws-feature-y, 45%), rgba(255,255,255,.53), transparent);
}
.ws-feature > * { position: relative; z-index: 1; }
.ws-feature .ws-dashboard {
  transition: transform .45s cubic-bezier(.2,.75,.2,1), box-shadow .4s;
  transform: translate3d(var(--ws-dashboard-x, 0px), var(--ws-dashboard-y, 0px), 0);
}
.ws-method-step { position: relative; border-top-color: #b7cabc; }
.ws-method-step::before {
  content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px;
  background: var(--ws-accent); transform: scaleX(0); transform-origin: left;
  transition: transform .9s cubic-bezier(.2,.7,.2,1) .16s;
}
body.ws-home.ws-motion-active .ws-method-step.is-visible::before { transform: scaleX(1); }
.ws-closing { position: relative; overflow: hidden; }
.ws-closing::before {
  content: ""; position: absolute; pointer-events: none; width: 450px; height: 450px; border: 1px solid rgba(40,107,92,.15);
  border-radius: 50%; right: -160px; top: -260px; box-shadow: 0 0 0 90px rgba(40,107,92,.025), 0 0 0 180px rgba(40,107,92,.02);
}
.ws-closing > * { position: relative; }

/* Scroll choreography: IntersectionObserver adds these classes only when available. */
body.ws-home.ws-motion-active .ws-reveal {
  opacity: 1; transform: translate3d(0,0,0);
  transition: opacity .85s cubic-bezier(.2,.7,.2,1), transform .85s cubic-bezier(.16,1,.3,1);
}
body.ws-home.ws-motion-active .ws-reveal:not(.is-visible) {
  opacity: 0; transform: translate3d(0,30px,0);
}
body.ws-home.ws-motion-active .ws-reveal-delay-1 { transition-delay: 90ms; }
body.ws-home.ws-motion-active .ws-reveal-delay-2 { transition-delay: 170ms; }
@media (hover:hover) and (pointer:fine) {
  body.ws-home .ws-problem:hover { padding-left: 13px; background: rgba(226,235,225,.35); }
  body.ws-home .ws-problem:hover::before { right: 0; }
  body.ws-home .ws-feature:hover::after { opacity: 1; }
  body.ws-home .ws-method-step:hover::before { transform: scaleX(1); }
  body.ws-home .ws-secondary { transition: color .23s, border-color .23s, gap .23s; }
  body.ws-home .ws-secondary:hover { gap: 20px; }
  body.ws-home .ws-primary { transition: background .23s, transform .23s, box-shadow .23s; }
  body.ws-home .ws-primary:hover { box-shadow: 0 13px 30px rgba(26,85,61,.18); }
}
@keyframes ws-editorial-enter {
  from { opacity: 0; transform: translate3d(0,34px,0); }
  to { opacity: 1; transform: translate3d(0,0,0); }
}
@keyframes ws-soft-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ws-underline { to { transform: scaleX(1); } }
@keyframes ws-cue-slide { to { transform: translateX(75px); } }

@media (max-width: 790px) {
  body.ws-home .ws-hero { padding-bottom: 66px; }
  .ws-hero-wash { width: 120vw; height: 460px; opacity: .46; }
  body.ws-home .ws-hero::after { inset: 12px 0 auto; opacity: .3; }
  .ws-scroll-cue { margin-top: 38px; }
  .ws-comparison::after { display: none; }
  .ws-feature .ws-dashboard { transform: none !important; }
  .ws-closing::before { width: 300px; height: 300px; right: -180px; top: -160px; }
}
@media (max-width: 420px) {
  body.ws-home .ws-hero { padding-bottom: 54px; }
  .ws-scroll-cue { margin-top: 30px; letter-spacing: .1em; }
  .ws-scroll-cue i { width: 40px; }
  body.ws-home .ws-hero h1 .ws-highlight::after { bottom: -.01em; }
}

/* Motion can never be a prerequisite to reading or using the page. */
@media (prefers-reduced-motion: reduce) {
  body.ws-home::after, .ws-hero-wash, .ws-scroll-cue i::after { display: none !important; }
  body.ws-home .ws-hero > .ws-eyebrow,
  body.ws-home .ws-hero h1, body.ws-home .ws-hero-lede,
  body.ws-home .ws-hero .ws-actions, body.ws-home .ws-hero .ws-micro,
  body.ws-home .ws-hero .ws-preview-note, .ws-scroll-cue { animation: none !important; }
  body.ws-home .ws-hero h1 .ws-highlight::after { animation: none !important; transform: scaleX(1) !important; }
  body.ws-home.ws-motion-active .ws-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .ws-feature .ws-dashboard, .ws-after .ws-app,
  .ws-problem, .ws-method-step::before { transform: none !important; transition: none !important; }
}
