/* ==========================================================================
   AppsZone — homepage: a scroll-driven product story.

   How motion works: main.js writes one number per section, --p (0 → 1), as
   the section scrolls. Everything below derives its movement from --p with
   calc()/clamp(), so JavaScript never touches individual elements' styles.
   Scroll-linked and pinned layouts only apply under html.motion (set when the
   visitor hasn't asked for reduced motion); without it every section falls
   back to a static layout.
   ========================================================================== */

.page-home {
  --tint: #EEF2F9; /* flagship chapter, cool to match KeepSure's light theme */
  --dark: #0B0B0C;
  /* Signature gradient (from the brand reference), tuned so large text keeps ≥ 3:1 contrast */
  --grad: linear-gradient(90deg, #4F53DD 0%, #7652D6 24%, #B45BB8 48%, #D9658F 72%, #E2714E 100%);
  --grad-light: linear-gradient(90deg, #8B90F4 0%, #B08CF2 26%, #DE90CC 52%, #F4A0B6 76%, #F8B08A 100%);
  --grad-tint: linear-gradient(90deg, #4F53DD 0%, #7652D6 24%, #B25AB6 48%, #D2608A 72%, #D4623F 100%);
}
.page-home main { padding-top: 0; }

/* ---------- Shared type ---------- */
.display {
  font-size: clamp(2.125rem, 1.4rem + 3vw, 4rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.grad,
.display > br + span {
  background-image: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  -webkit-box-decoration-break: slice;
  box-decoration-break: slice;
}
.chapter--dark .grad,
.chapter--dark .display > br + span { background-image: var(--grad-light); }
.chapter--light .display > br + span { background-image: var(--grad-tint); }

/* Section labels get a short gradient rule; the label text itself stays solid and readable */
.page-home main .eyebrow:not(.hero-eyebrow):not(.story-label) { display: inline-flex; align-items: center; gap: 10px; }
.page-home main .eyebrow:not(.hero-eyebrow):not(.story-label)::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}
.chapter--dark .eyebrow::before { background: var(--grad-light) !important; }

/* Primary buttons pick up a faint brand glow on hover */
@media (hover: hover) {
  .page-home .btn-primary:hover { box-shadow: 0 10px 28px -12px rgba(79, 83, 221, .55); }
}
.chapter-head { max-width: 860px; }
.chapter-head .chapter-lead { margin-top: 22px; }
.chapter-lead {
  max-width: 40ch;
  font-size: clamp(1.0625rem, 1rem + .4vw, 1.3125rem);
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}

/* Full-bleed chapters with their own tone */
.chapter { position: relative; margin-inline: clamp(8px, 1vw, 16px); border-radius: clamp(24px, 2.4vw, 36px); }
.chapter--light { background: var(--tint); }
.chapter--dark {
  --text: #F2F2EF;
  --text-2: #A3A39E;
  --muted: #8A8A85;
  --border: rgba(255, 255, 255, .1);
  background: var(--dark);
  color: var(--text);
}

/* ==========================================================================
   01 · Hero
   ========================================================================== */
.hero { position: relative; --s0: .84; }
.hero-sticky { position: relative; overflow: hidden; }
/* Background: a lightly lit top, a soft dot texture, and colour placed behind
   the products (see .hero-stage::before) so the headline area stays crisp. */
.hero-sticky { background: radial-gradient(80% 55% at 50% 0%, #FFFFFF 0%, rgba(255, 255, 255, 0) 70%); }
.hero-sticky::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(17, 17, 17, .13) 1px, transparent 1.6px);
  background-size: 24px 24px;
  background-position: 50% 0;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 62%, #000 5%, transparent 68%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 62%, #000 5%, transparent 68%);
}
.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(var(--header-h) + 48px);
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 32px;
  margin-bottom: 22px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 0 0 1px var(--border), 0 1px 2px rgba(17, 17, 17, .04);
  color: var(--text-2);
}
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 3px rgba(118, 82, 214, .12); }
.hero-title {
  font-size: clamp(2.625rem, 1.6rem + 4.6vw, 5.5rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -0.052em;
  text-wrap: balance;
}
.hero-lead {
  max-width: 30ch;
  margin-top: 24px;
  font-size: clamp(1.0625rem, .98rem + .45vw, 1.375rem);
  line-height: 1.45;
  color: var(--text-2);
  text-wrap: balance;
}
.hero-ctas { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 32px; }
.hero-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 8px;
  font-size: 1rem;
  font-weight: 500;
  color: #4F53DD;
}
.hero-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero-stage { position: relative; z-index: 1; height: 72svh; min-height: 420px; margin-top: 40px; }
.hero-stage::before {
  content: "";
  position: absolute;
  bottom: -8%;
  left: 50%;
  z-index: 0;
  width: min(180svh, 160vw);
  height: 100%;
  translate: -50% 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side at 28% 52%, rgba(79, 83, 221, .26), transparent),
    radial-gradient(closest-side at 44% 42%, rgba(118, 82, 214, .20), transparent),
    radial-gradient(closest-side at 58% 48%, rgba(217, 101, 143, .20), transparent),
    radial-gradient(closest-side at 74% 54%, rgba(226, 113, 78, .20), transparent);
}
.hs-item { position: absolute; left: 50%; bottom: var(--b); width: var(--w); transform: translateX(calc(-50% + var(--x))); }
.hs-c     { --w: 32svh; --x: 0svh;   --b: 4svh;  z-index: 5; }
.hs-l     { --w: 26svh; --x: -33svh; --b: 8svh;  --x0: -7svh;  --r0: -4deg; z-index: 4; }
.hs-r     { --w: 26svh; --x: 33svh;  --b: 8svh;  --x0: 7svh;   --r0: 4deg;  z-index: 4; }
.hs-far-l { --w: 64svh; --x: -74svh; --b: 16svh; --x0: -18svh; --r0: -6deg; z-index: 1; }
.hs-far-r { --w: 64svh; --x: 74svh;  --b: 16svh; --x0: 18svh;  --r0: 6deg;  z-index: 1; }

@media (min-width: 480px) {
  .hero-ctas { flex-direction: row; gap: 20px; }
}

/* Scroll story: copy steps back, products rise and spread into focus */
.motion .hero {
  --t: clamp(0, calc(var(--p, 0) / .42), 1);
  --s: clamp(0, calc(var(--p, 0) / .82), 1);
  --ss: calc(var(--s) * var(--s) * (3 - 2 * var(--s)));
  height: 215svh;
}
.motion .hero-sticky { position: sticky; top: 0; height: 100svh; }
.motion .hero-copy {
  padding-top: calc(var(--header-h) + 8svh);
  transform: translate3d(0, calc(var(--t) * -12svh), 0);
  opacity: clamp(0, calc(1 - (var(--p, 0) - .12) / .4), 1);
  will-change: transform, opacity;
}
.motion .hero-lead { opacity: calc(1 - var(--t) * 1.8); }
.motion .hero-ctas { opacity: calc(1 - var(--t) * 2.4); transform: translateY(calc(var(--t) * 16px)); }
.motion .hero.is-past .hero-ctas { pointer-events: none; }
.motion .hero-stage {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80svh;
  min-height: 0;
  margin: 0;
  transform: translate3d(0, calc((1 - var(--ss)) * var(--drop, 30svh) - var(--ss) * 5svh), 0) scale(calc(var(--s0) + (1 - var(--s0)) * var(--ss)));
  transform-origin: 50% 100%;
  will-change: transform;
}
.motion .hs-item {
  transform:
    translateX(calc(-50% + var(--x) - var(--x0, 0svh) * (1 - var(--ss))))
    rotate(calc(var(--r0, 0deg) * (1 - var(--ss))));
}

/* ==========================================================================
   02 · The collection
   ========================================================================== */
.collection { padding-block: clamp(96px, 5rem + 5vw, 184px) clamp(72px, 4rem + 4vw, 144px); }
.col-grid {
  display: flex;
  gap: 14px;
  margin: 40px calc(var(--gutter) * -1) 0;
  padding: 8px var(--gutter) 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.col-grid::-webkit-scrollbar { display: none; }
.col-card {
  --k: 1;
  position: relative;
  flex: 0 0 min(80vw, 360px);
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  scroll-snap-align: start;
  transition: box-shadow .35s var(--ease);
}
.col-visual { position: relative; aspect-ratio: 1 / 1.02; border-radius: 18px; overflow: hidden; }
.col-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .6), transparent 70%), var(--tint);
}
.col-visual .device { position: absolute; top: 11%; left: 50%; width: 50%; translate: -50% 0; transition: scale .5s var(--ease); }
.col-visual.is-browser .device { top: 24%; width: 88%; }
.col-info { display: flex; flex-direction: column; flex: 1; padding: 18px 12px 12px; }
.col-kind { font-family: var(--mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.col-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Website cards: the card opens the product page; "Visit site" sits above the stretched link */
.card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; }
.col-info .card-actions .link-arrow,
.rc-info .card-actions .link-arrow { margin: 0; padding: 0; }
.card-visit {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 99px;
  box-shadow: inset 0 0 0 1px var(--border-strong);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.card-visit svg { width: 14px; height: 14px; }
.card-visit:hover { background: var(--text); color: var(--bg); box-shadow: none; }
.card-visit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.col-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.col-head-meta .eyebrow { margin-bottom: 0; }
.col-info h3 { margin-top: 8px; font-size: var(--fs-card); letter-spacing: -0.025em; }
.col-info p { margin-top: 8px; color: var(--text-2); font-size: .9375rem; text-wrap: pretty; }
.col-info .link-arrow { margin-top: auto; padding-top: 18px; }

@media (min-width: 900px) {
  .col-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 72px 0 0;
    padding: 0;
    overflow: visible;
  }
  .col-card { flex: none; }

  /* A loose, overlapping composition that settles into three clean cards */
  .motion .col-grid {
    --k: clamp(0, calc((var(--p, 1) - .05) / .8), 1);
    --ke: calc(var(--k) * var(--k) * (3 - 2 * var(--k)));
  }
  .motion .col-card {
    transform:
      translate(calc((1 - var(--ke)) * var(--dx)), calc((1 - var(--ke)) * var(--dy)))
      rotate(calc((1 - var(--ke)) * var(--r)))
      scale(calc(1 + (1 - var(--ke)) * var(--ds, 0)));
    background: rgb(255 255 255 / var(--ke));
    box-shadow: inset 0 0 0 1px rgb(231 231 227 / var(--ke));
    will-change: transform;
  }
  .motion .col-visual { clip-path: inset(0 0 calc((1 - var(--ke)) * -45%) 0 round 18px); overflow: visible; }
  .motion .col-visual::before { opacity: var(--ke); }
  /* Slide the text in with balanced margins, not a transform: a transform would make
     .col-info the box for the title's stretched link, leaving the picture unclickable */
  .motion .col-info {
    opacity: clamp(0, calc((var(--ke) - .6) / .4), 1);
    margin-block: calc((1 - var(--ke)) * 16px) calc((1 - var(--ke)) * -16px);
  }
}

/* ==========================================================================
   03 · Flagship product: KeepSure
   ========================================================================== */
.ft { padding-top: clamp(72px, 4rem + 4vw, 140px); }
.ft-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ft-intro { max-width: 760px; }
.ft-intro .chapter-lead { margin: 22px auto 0; }
.ft-phone { position: relative; width: min(74vw, 340px); margin-top: 48px; }
.ft-screen--b { position: absolute; inset: 0; opacity: 0; }
.ft-features { display: none; text-align: left; }
.ft-features-title { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem); line-height: 1.06; letter-spacing: -0.04em; }
.ft-list { display: grid; gap: 22px; margin-top: 36px; }
.ft-list li { display: flex; align-items: flex-start; gap: 16px; }
.ft-list b { display: block; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; color: var(--text); }
.ft-list li > span:last-child { color: var(--text-2); font-size: .9375rem; line-height: 1.5; }
.ft-ico {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  color: #2563EB;
  box-shadow: 0 1px 2px rgba(27, 24, 20, .06), inset 0 0 0 1px rgba(27, 24, 20, .06);
}
.ft-ico svg { width: 20px; height: 20px; }
.ft-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 40px; }
.ft-meta { font-family: var(--mono); font-size: .75rem; color: var(--muted); }

@media (min-width: 900px) {
  html:not(.motion) .ft-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px 64px;
  }
  html:not(.motion) .ft-intro { grid-column: 1 / -1; justify-self: center; }
  html:not(.motion) .ft-features { display: block; grid-row: 2; }
  html:not(.motion) .ft-phone { grid-row: 2; justify-self: center; margin-top: 0; }

  /* Launch sequence: phone rises, slides aside, features and a second screen follow */
  .motion .ft {
    --a: clamp(0, calc(var(--p, 0) / .12), 1);
    --b: clamp(0, calc((var(--p, 0) - .14) / .22), 1);
    --c: clamp(0, calc((var(--p, 0) - .36) / .12), 1);
    --d: clamp(0, calc((var(--p, 0) - .58) / .16), 1);
    --e: clamp(0, calc((var(--p, 0) - .78) / .1), 1);
    --bs: calc(var(--b) * var(--b) * (3 - 2 * var(--b)));
    --ds: calc(var(--d) * var(--d) * (3 - 2 * var(--d)));
    height: 420svh;
    padding: 0;
  }
  .motion .ft-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; }
  .motion .ft-inner { position: relative; display: block; height: 100%; }
  .motion .ft-intro {
    position: absolute;
    top: calc(var(--header-h) + 6svh);
    left: 50%;
    width: min(760px, 90%);
    transform: translate(-50%, calc(var(--bs) * -10svh));
    opacity: clamp(0, calc(1 - var(--b) * 2.6), 1);
  }
  .motion .ft-phone {
    position: absolute;
    top: 13svh;
    left: 50%;
    width: calc(76svh * 260 / 540);
    margin: 0;
    transform:
      translate3d(calc(-50% + var(--bs) * 22vw), calc((1 - var(--a)) * 30svh + (1 - var(--bs)) * 33svh), 0)
      scale(calc(1 + var(--ds) * .05));
    opacity: calc(.15 + var(--a) * .85);
    will-change: transform;
  }
  .motion .ft-screen--b { opacity: 1; clip-path: inset(0 0 0 calc((1 - var(--ds)) * 100%) round calc(76svh * 38 / 540)); }
  .motion .ft-features {
    display: block;
    position: absolute;
    top: 50%;
    left: var(--gutter);
    width: min(42%, 480px);
    transform: translateY(-50%);
    pointer-events: none;
  }
  .motion .ft-features-title { opacity: var(--c); transform: translateY(calc((1 - var(--c)) * 28px)); }
  .motion .ft-list li {
    --li: clamp(0, calc((var(--p, 0) - var(--o)) / .08), 1);
    opacity: var(--li);
    transform: translateY(calc((1 - var(--li)) * 20px));
  }
  .motion .ft-cta { opacity: var(--e); transform: translateY(calc((1 - var(--e)) * 16px)); }
  .motion .ft.is-cta .ft-features { pointer-events: auto; }
}

/* ==========================================================================
   04 · Feature story (sticky phone, changing story)
   ========================================================================== */
.story { padding-bottom: clamp(72px, 4rem + 4vw, 140px); }
.story-step { display: flex; flex-direction: column; align-items: center; padding-top: 72px; text-align: center; }
.story-label { display: inline-flex; gap: 10px; margin-bottom: 14px; }
.story-label span { color: #2563EB; }
.story-title { font-size: clamp(2.125rem, 1.4rem + 2.8vw, 3.75rem); line-height: 1.02; letter-spacing: -0.045em; }
.story-text { max-width: 30ch; margin-top: 16px; font-size: var(--fs-lead); line-height: 1.5; color: var(--text-2); text-wrap: pretty; }
.story-inline { width: min(70vw, 300px); margin-top: 40px; }
.story-visual { display: none; }
.story-end { display: flex; justify-content: center; padding-top: 72px; }

@media (min-width: 900px) {
  .story-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; }
  .story-step {
    min-height: 88svh;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    text-align: left;
    opacity: .22;
    transition: opacity .6s var(--ease);
  }
  .story-step.is-active { opacity: 1; }
  .story-inline { display: none; }
  .story-end { justify-content: flex-start; padding: 0 0 18svh; }
  .story-visual {
    position: sticky;
    top: 14svh;
    display: block;
    height: 72svh;
    align-self: start;
  }
  .story-screen {
    position: absolute;
    top: 0;
    left: 50%;
    width: calc(72svh * 260 / 540);
    translate: -50% 0;
    opacity: 0;
    transform: scale(.965) translateY(12px);
    transition: opacity .6s var(--ease), transform .7s var(--ease);
  }
  .story-screen.is-active { opacity: 1; transform: none; }
  .story-dots { position: absolute; top: 50%; right: 0; display: flex; flex-direction: column; gap: 8px; translate: 0 -50%; }
  .story-dots li { width: 6px; height: 6px; border-radius: 99px; background: rgba(27, 24, 20, .18); transition: height .4s var(--ease), background-color .4s var(--ease); }
  .story-dots li.is-active { height: 22px; background: #1B1814; }
}

/* ==========================================================================
   05 · More from AppsZone — product rail
   ========================================================================== */
.more { padding-block: clamp(96px, 5rem + 5vw, 176px) clamp(72px, 4rem + 3vw, 128px); }
.more-head { display: flex; flex-direction: column; gap: 28px; margin-bottom: 36px; }
.more-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: #EDEDE8; }
.seg button {
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-2);
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.seg button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(17, 17, 17, .1); }
.rail-arrows { display: none; gap: 8px; }
.rail-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: box-shadow .2s var(--ease), opacity .2s var(--ease), transform .2s var(--ease);
}
.rail-btn svg { width: 18px; height: 18px; }
.rail-btn:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--border-strong); }
.rail-btn:active:not(:disabled) { transform: scale(.94); }
.rail-btn:disabled { opacity: .35; cursor: default; }

.rail {
  --rail-pad: max(var(--gutter), calc((100% - var(--maxw)) / 2));
  display: flex;
  gap: 16px;
  padding: 8px var(--rail-pad) 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--rail-pad);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail:focus-visible { outline-offset: -2px; }
.rc-card {
  position: relative;
  flex: 0 0 min(82vw, 380px);
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  scroll-snap-align: start;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.rc-card[hidden] { display: none; }
.rc-visual {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / .92;
  border-radius: 18px;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .6), transparent 70%), var(--tint);
}
.rc-visual .device { position: absolute; top: 12%; left: 50%; width: 46%; translate: -50% 0; transition: scale .5s var(--ease); }
.rc-visual.is-browser .device { left: 12%; top: 18%; width: 118%; translate: none; transform-origin: 0 0; }
.rc-info { display: flex; flex-direction: column; flex: 1; padding: 18px 12px 12px; }
.rc-info h3 { font-size: var(--fs-card); letter-spacing: -0.025em; }
.rc-meta { margin-top: 4px; font-size: .875rem; color: var(--muted); }
.rc-info p { margin-top: 10px; font-size: .9375rem; color: var(--text-2); text-wrap: pretty; }
.rc-info .link-arrow { margin-top: auto; padding-top: 18px; }

@media (min-width: 768px) {
  .more-head { flex-direction: row; align-items: flex-end; justify-content: space-between; margin-bottom: 44px; }
  .more-controls { justify-content: flex-end; gap: 20px; }
  .rail-arrows { display: flex; }
}

/* ==========================================================================
   06 · Apps vs websites
   ========================================================================== */
.split { padding-block: clamp(80px, 4rem + 4vw, 150px); transition: background-color .8s var(--ease); }
.split[data-active="apps"] { background: #F7F3EE; }
.split[data-active="websites"] { background: #EFF3F7; }
.split-title { margin: 0 auto 48px; text-align: center; }
.split-panels { display: grid; gap: 16px; }
.split-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 560px;
  padding: 36px 28px 0;
  border-radius: 28px;
  box-shadow: inset 0 0 0 1px var(--border);
}
.split-panel--apps { background: linear-gradient(180deg, #FFFFFF 0%, #F3ECE3 100%); }
.split-panel--web { background: linear-gradient(180deg, #FFFFFF 0%, #E6EDF4 100%); }
.split-copy { position: relative; z-index: 2; }
.split-copy h3 { margin-top: 12px; font-size: clamp(1.875rem, 1.3rem + 1.8vw, 2.75rem); line-height: 1.04; letter-spacing: -0.04em; }
.split-copy p { max-width: 30ch; margin-top: 12px; color: var(--text-2); font-size: 1.0625rem; }
.split-copy .link-arrow { margin-top: 22px; min-height: 44px; }
.split-visual { margin-top: auto; transition: transform .7s var(--ease); }
.split-visual--phone { width: min(56%, 250px); margin: 40px auto -18%; }
.split-visual--browser { width: 124%; margin: 48px 0 -10% 8%; }
.split[data-active="apps"] .split-panel--apps .split-visual,
.split[data-active="websites"] .split-panel--web .split-visual { transform: translateY(-10px); }

@media (min-width: 900px) {
  .split-title { margin-bottom: 64px; }
  .split-panels { grid-template-columns: 1fr 1fr; gap: 20px; }
  .split-panel { min-height: 640px; padding: 48px 44px 0; }
  .split-visual--phone { width: min(52%, 270px); }
}

/* ==========================================================================
   07 · Behind the products — principles
   ========================================================================== */
.think { padding-block: clamp(96px, 5rem + 5vw, 176px) 24px; }
.think .chapter-head { margin-inline: auto; text-align: center; }
.think .chapter-lead { margin-inline: auto; }
.think-grid { margin-top: 48px; }
.think-step { padding-block: 48px; }
.think-num {
  font-family: var(--mono);
  font-size: .8125rem;
  background: var(--grad-light);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.think-step h3 { margin-top: 12px; font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem); line-height: 1; letter-spacing: -0.05em; }
.think-step p { max-width: 30ch; margin-top: 16px; font-size: var(--fs-lead); line-height: 1.5; color: var(--text-2); }
.think-inline { margin-top: 32px; aspect-ratio: 1 / .92; }
.think-stage { display: none; }

@media (min-width: 900px) {
  .think-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 72px; margin-top: 24px; }
  .think-step {
    min-height: 82svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    opacity: .28;
    transition: opacity .6s var(--ease);
  }
  .think-step.is-active { opacity: 1; }
  .think-inline { display: none; }
  .think-stage {
    position: sticky;
    top: calc(50svh - min(31svh, 280px));
    display: block;
    height: min(62svh, 560px);
    align-self: start;
  }
  .think-visual { position: absolute; inset: 0; opacity: 0; transition: opacity .6s var(--ease); }
  .think-visual.is-active { opacity: 1; }
}

/* Visual frame */
.vz {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  border-radius: 24px;
  background: radial-gradient(90% 70% at 50% 0%, rgba(169, 156, 255, .08), transparent 70%), #131315;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}

/* Understand: a problem map that ends in an insight */
.vz-flow { width: 100%; max-width: 440px; height: auto; font-family: var(--font); }
.vz-flow .node rect { fill: rgba(255, 255, 255, .04); stroke: rgba(255, 255, 255, .2); stroke-width: 1.2; }
.vz-flow .node text { fill: #EDEDEA; font-size: 13px; font-weight: 500; text-anchor: middle; dominant-baseline: central; }
.vz-flow .node.warn rect { fill: rgba(233, 139, 90, .1); stroke: #E98B5A; }
.vz-flow .node.warn text { fill: #F6C3A6; }
.vz-flow .node.idea rect { fill: rgba(169, 156, 255, .14); stroke: #A99CFF; }
.vz-flow .node.idea text { fill: #DAD4FF; }
.vz-flow .edge { fill: none; stroke: rgba(255, 255, 255, .28); stroke-width: 1.4; stroke-dasharray: 1; stroke-dashoffset: 1; }
.vz-flow .edge.idea { stroke: #A99CFF; }
.vz-flow .node {
  opacity: 0;
  transform: translateY(8px);
  transform-box: fill-box;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  transition-delay: calc(var(--i) * 150ms);
}
.is-active .vz-flow .node { opacity: 1; transform: none; }
.is-active .vz-flow .edge { stroke-dashoffset: 0; transition: stroke-dashoffset .55s var(--ease) calc(var(--i) * 150ms - 80ms); }

/* Simplify: a cluttered screen dissolves into one clear card */
.vz-simplify .vm {
  width: min(88%, 380px);
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: #1B1B1E;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  transition: opacity .45s var(--ease) .55s, transform .5s var(--ease) .55s;
}
.vm-bar, .vm-tabs, .vm-actions { display: flex; gap: 6px; }
.vm-bar i { width: 22px; height: 22px; border-radius: 6px; background: #2C2C31; }
.vm-bar i:nth-child(3) { margin-right: auto; }
.vm-tabs i { flex: 1; height: 10px; border-radius: 99px; background: #2C2C31; }
.vm-tabs i:first-child { background: #4A4A52; }
.vm-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vm-fields span { display: grid; gap: 5px; }
.vm-fields b { width: 50%; height: 6px; border-radius: 3px; background: #3A3A41; }
.vm-fields i { height: 22px; border-radius: 6px; background: #26262B; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.vm-banner { height: 34px; border-radius: 8px; background: repeating-linear-gradient(135deg, #2A2A30 0 8px, #25252A 8px 16px); }
.vm-actions i { flex: 1; height: 30px; border-radius: 8px; background: #2C2C31; }
.vm-actions i:last-child { background: #3F3F47; }
.vz-simplify .n { transition: opacity .3s var(--ease), transform .3s var(--ease); transition-delay: calc(var(--i) * 22ms); }
.vz-simplify.is-active .n,
.is-active .vz-simplify .n { opacity: 0; transform: scale(.85); }
.is-active .vz-simplify .vm { opacity: 0; transform: scale(.92); }
.vz-simplify .vc {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(70%, 290px);
  display: grid;
  gap: 4px;
  padding: 22px 22px 20px;
  border-radius: 20px;
  background: #F8F9FC;
  color: #111827;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .6);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.9);
  transition: opacity .6s var(--ease), transform .7s var(--ease);
}
.is-active .vz-simplify .vc { opacity: 1; transform: translate(-50%, -50%); transition-delay: .7s; }
.vc-kicker { font-size: .75rem; font-weight: 600; color: #2563EB; }
.vc b { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; }
.vc-amount { font-size: 2rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }
.vc-bar { display: block; height: 5px; margin-top: 10px; border-radius: 99px; background: rgba(17, 24, 39, .1); overflow: hidden; }
.vc-bar i { display: block; width: 36%; height: 100%; border-radius: inherit; background: #3B82F6; }
.vc-note { margin-top: 6px; font-size: .8125rem; color: #6B7280; }

/* Build: design → prototype → product */
.vz-build { display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.vb-phone { position: relative; width: min(42%, 210px); aspect-ratio: 260 / 540; }
.vb-layer { position: absolute; inset: 0; }
.vb-hot {
  position: absolute;
  width: 20%;
  aspect-ratio: 1;
  border-radius: 50%;
  translate: -50% -50%;
  box-shadow: 0 0 0 2px #A99CFF, 0 0 0 8px rgba(169, 156, 255, .2);
  opacity: 0;
}
.vb-product { opacity: 0; }
.is-active .vb-hot { animation: vb-in .5s var(--ease) .9s forwards; }
.is-active .vb-hot + .vb-hot { animation-delay: 1.15s; }
.is-active .vb-product { animation: vb-in .7s var(--ease) 2.1s forwards; }
.vb-steps { display: flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 500; color: #6B6B67; }
.vb-steps li { transition: color .4s; }
.vb-steps li + li::before { content: "→"; margin-right: 10px; color: #3F3F43; }
.is-active .vb-steps li:nth-child(1) { animation: vb-lit .4s forwards; }
.is-active .vb-steps li:nth-child(2) { animation: vb-lit .4s .9s forwards; }
.is-active .vb-steps li:nth-child(3) { animation: vb-lit .4s 2.1s forwards; }
@keyframes vb-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes vb-lit { to { color: #F2F2EF; } }

/* ==========================================================================
   08 · Process timeline
   ========================================================================== */
.proc { padding-block: 64px clamp(96px, 5rem + 5vw, 176px); }
.proc-grid { display: grid; gap: 48px; }
.proc-head .chapter-lead { margin-top: 22px; }
.proc-list { position: relative; padding-left: 40px; }
.proc-line { position: absolute; top: 34px; bottom: 34px; left: 7px; width: 2px; border-radius: 2px; background: rgba(255, 255, 255, .1); }
.proc-line i {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--p, 1) * 100%);
  border-radius: inherit;
  background: linear-gradient(180deg, #8B90F4, #DE90CC 55%, #F8B08A);
}
.proc-stage { position: relative; padding: 22px 0 24px; }
.proc-dot {
  position: absolute;
  top: 30px;
  left: -40px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--dark);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22);
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease);
}
.proc-num { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.proc-stage h3 {
  margin-top: 4px;
  font-size: clamp(1.75rem, 1.25rem + 1.9vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #F2F2EF;
  transition: color .45s var(--ease);
}
.proc-stage p { max-width: 38ch; margin-top: 8px; color: var(--text-2); transition: opacity .45s var(--ease); }
.proc-stage.is-on .proc-dot { background: #F2F2EF; box-shadow: 0 0 0 5px rgba(222, 144, 204, .18); }
.motion .proc-stage:not(.is-on) h3 { color: #3E3E3B; }
.motion .proc-stage:not(.is-on) p { opacity: .3; }

@media (min-width: 900px) {
  .proc-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 72px; align-items: start; }
  .proc-head { position: sticky; top: 30svh; }
  .proc-stage { padding: 30px 0 34px; }
  .proc-dot { top: 42px; }
}

/* ==========================================================================
   09 · Case study preview
   ========================================================================== */
.case { padding-block: clamp(96px, 5rem + 5vw, 176px) clamp(72px, 4rem + 3vw, 128px); }
.case-head { display: flex; flex-direction: column; gap: 24px; margin-bottom: 40px; }
.case-aside { max-width: 420px; }
.case-aside .link-arrow { margin-top: 18px; min-height: 44px; }
.case-track {
  --rail-pad: max(var(--gutter), calc((100% - var(--maxw)) / 2));
  position: relative;
  display: flex;
  gap: 16px;
  padding: 8px var(--rail-pad) 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--rail-pad);
  scrollbar-width: none;
}
.case-track::-webkit-scrollbar { display: none; }
.case-frame { flex: 0 0 min(76vw, 340px); scroll-snap-align: start; }
.case-visual {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1.05;
  border-radius: 22px;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .55), transparent 70%), #ECF0F7;
}
.case-phone { position: absolute; top: 12%; left: 50%; width: 46%; translate: -50% 0; }
.case-num { display: block; margin-top: 18px; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.case-frame h3 { margin-top: 6px; font-size: var(--fs-card); letter-spacing: -0.025em; }
.case-frame p { margin-top: 6px; font-size: .9375rem; color: var(--text-2); }

.case-visual--paper { background: radial-gradient(circle at 70% 30%, rgba(160, 120, 70, .12) 0 18%, transparent 19%), #ECE6DD; }
.cs-receipt {
  position: absolute;
  top: 16%;
  left: 50%;
  width: 46%;
  aspect-ratio: 1 / 1.45;
  display: flex;
  flex-direction: column;
  gap: 9%;
  padding: 10% 9%;
  translate: -50% 0;
  rotate: -8deg;
  background: linear-gradient(180deg, #FBF9F4, #EEE9DF);
  font-family: var(--mono);
  font-size: .75rem;
  color: rgba(42, 39, 35, .35);
  box-shadow: 0 18px 30px -18px rgba(60, 40, 20, .35);
  clip-path: polygon(0 0, 100% 0, 100% 94%, 92% 100%, 84% 94%, 76% 100%, 68% 94%, 60% 100%, 52% 94%, 44% 100%, 36% 94%, 28% 100%, 20% 94%, 12% 100%, 4% 94%, 0 100%);
}
.cs-receipt i { display: block; height: 4px; border-radius: 2px; background: rgba(42, 39, 35, .12); }
.cs-receipt i.s { width: 55%; }
.case-visual--grid {
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(27, 24, 20, .05) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(27, 24, 20, .05) 1px, transparent 1px) 0 0 / 22px 22px,
    #F8F5EF;
}
.cs-sketch { display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--mono); font-size: .875rem; color: #1B1814; }
.cs-sketch span { padding: 8px 18px; border: 1.5px dashed rgba(27, 24, 20, .45); border-radius: 12px; background: rgba(255, 255, 255, .6); }
.cs-sketch svg { width: 44px; height: 26px; rotate: 90deg; fill: none; stroke: #2563EB; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.case-visual--proto .case-phone--sm { width: 36%; top: 16%; }
.case-visual--proto .case-phone--sm:first-child { left: 28%; }
.case-visual--proto .case-phone--sm:last-child { left: 72%; }
.cs-arrow { position: absolute; top: 5%; left: 50%; width: 26%; translate: -50% 0; fill: none; stroke: #6C5CE7; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; z-index: 2; }
.case-visual--ship { background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .5), transparent 70%), #E5EDFB; }
.cs-badge {
  position: absolute;
  bottom: 7%;
  left: 50%;
  translate: -50% 0;
  padding: 7px 14px;
  border-radius: 99px;
  background: #1B1814;
  color: #fff;
  font-family: var(--mono);
  font-size: .75rem;
  white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5);
}

@media (min-width: 900px) {
  .case-head { flex-direction: row; align-items: flex-end; justify-content: space-between; margin-bottom: 48px; }

  /* Pinned: vertical scrolling walks the story sideways */
  .motion .case { padding: 0; }
  .motion .case-sticky {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding-top: var(--header-h);
  }
  .motion .case-head { margin-bottom: clamp(24px, 5svh, 48px); }
  .motion .case-track {
    overflow: visible;
    scroll-snap-type: none;
    transform: translate3d(calc(var(--p, 0) * var(--dist, 0) * -1px), 0, 0);
    will-change: transform;
  }
  .motion .case-frame { flex-basis: clamp(250px, 33svh, 340px); }
}

/* ==========================================================================
   10 · The person behind AppsZone
   ========================================================================== */
.person { padding-block: clamp(96px, 5rem + 5vw, 184px); }
.person-grid { display: grid; gap: 40px; }
.person-title { font-size: clamp(2.25rem, 1.4rem + 3.4vw, 4.25rem); }
.person-title > span { display: block; }
.person-title .w { opacity: clamp(.14, calc(var(--p, 1) * (var(--n, 1) + 4) - var(--i)), 1); }
.person-side .chapter-lead { max-width: 34ch; }
.person-skills { display: grid; gap: 20px; margin: 32px 0 28px; }
.person-skills > div { padding-top: 16px; border-top: 1px solid var(--border); }
.person-skills dt { font-weight: 600; letter-spacing: -0.01em; }
.person-skills dd { margin: 4px 0 0; color: var(--text-2); }
.person-side .link-arrow { min-height: 44px; }

@media (min-width: 1024px) {
  .person-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 88px; align-items: end; }
}

/* ==========================================================================
   11 · Final call to action
   ========================================================================== */
.finale {
  position: relative;
  overflow: hidden;
  padding-block: clamp(112px, 6rem + 6vw, 240px) clamp(96px, 5rem + 4vw, 176px);
  text-align: center;
}
.finale::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1000px, 140vw);
  height: 520px;
  translate: -50% -55%;
  background:
    radial-gradient(closest-side at 30% 50%, rgba(79, 83, 221, .12), transparent),
    radial-gradient(closest-side at 55% 45%, rgba(180, 91, 184, .09), transparent),
    radial-gradient(closest-side at 76% 55%, rgba(226, 113, 78, .1), transparent);
  pointer-events: none;
}
.finale-inner { position: relative; }
.finale-inner { z-index: 1; display: flex; flex-direction: column; align-items: center; }
.finale-title { font-size: clamp(2.75rem, 1.5rem + 5.4vw, 6rem); letter-spacing: -0.055em; }
.finale .chapter-lead { margin-top: 22px; }
.finale-ctas { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 40px; }
@media (min-width: 480px) { .finale-ctas { flex-direction: row; } }

/* ==========================================================================
   Mobile: sticky link during the KeepSure story
   ========================================================================== */
.story-pill { display: none; }
@media (max-width: 899px) {
  .story-pill {
    position: fixed;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(17, 17, 17, .92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: #fff;
    box-shadow: 0 14px 36px -14px rgba(0, 0, 0, .45);
    transform: translate(-50%, 160%);
    transition: transform .45s var(--ease);
  }
  .story-pill.is-visible { transform: translate(-50%, 0); }
  .story-pill .app-icon { --s: 40px; }
  .sp-name { font-size: .9375rem; font-weight: 600; white-space: nowrap; }
  .sp-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    margin-left: 6px;
    padding: 0 16px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: .875rem;
    font-weight: 600;
  }
  .sp-cta svg { width: 16px; height: 16px; }
}

/* ---------- Hover (pointer devices only) ---------- */
@media (hover: hover) {
  .rc-card:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--border), var(--shadow-lift); }
  .rc-card:hover .rc-visual .device,
  .col-card:hover .col-visual .device { scale: 1.02; }
  .rc-card:hover .link-arrow,
  .col-card:hover .link-arrow { color: var(--accent); }
  .rc-card:hover .link-arrow svg,
  .col-card:hover .link-arrow svg { transform: translateX(3px); }
  .col-card:hover { box-shadow: inset 0 0 0 1px var(--border), var(--shadow-lift); }
}

/* ---------- Reduced motion: everything readable, nothing moving ---------- */
@media (prefers-reduced-motion: reduce) {
  .person-title .w { opacity: 1; }
  .story-screen, .think-visual, .story-step, .think-step { transition: none; }
}
