/* ===========================================================================
   Polish and motion layer. Loaded last on every page.

   Floating pill nav, paper grain, page fades, softer cards, button physics,
   scroll reveals (driven by motion.js), the proof ticker, the giant footer
   wordmark, and the hero scenes for every inner page.

   Every animation sits behind prefers-reduced-motion: no-preference, and the
   resting state is always the finished one, so nothing is hidden without JS.
   ========================================================================= */

:root {
  --ease-out: cubic-bezier(.32, .72, 0, 1);
  --ease-spring: cubic-bezier(.16, 1, .3, 1);
  --navh: 84px;
}

/* --- Paper grain over everything (fixed, never scrolls) ------------------ */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Page-to-page fade ---------------------------------------------------- */

@view-transition { navigation: auto; }
.nav { view-transition-name: site-nav; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* --- Floating pill nav ---------------------------------------------------- */

.nav {
  background: transparent;
  border-bottom: 0;
  padding: 12px var(--gutter) 0;
  pointer-events: none;
}
.nav .nav__inner {
  position: relative;
  z-index: 0;
  isolation: isolate;
  max-width: 1180px;
  min-height: 58px;
  margin: 0 auto;
  padding: 0 8px 0 18px;
  border-radius: 999px;
  pointer-events: auto;
  flex-wrap: nowrap;
}
.nav .nav__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(251, 248, 243, .8);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 0 0 1px rgba(28, 22, 18, .07), 0 14px 34px -22px rgba(28, 22, 18, .45);
}
.nav__links a:not(.nav__action) {
  padding: 8px 12px;
  border-radius: 999px;
  transition: background .4s var(--ease-out), color .4s var(--ease-out);
}
.nav__links a:not(.nav__action):hover { background: rgba(28, 22, 18, .06); text-decoration: none; }
.nav__links a[aria-current="page"]:not(.nav__action) { background: rgba(28, 22, 18, .07); }
.nav__links { gap: 2px; }
.nav__action { margin-left: 8px; }

.nav__burger { display: none; }

@media (max-width: 860px) {
  .nav { position: sticky; top: 0; padding: 10px 12px 0; }
  .nav .nav__inner { min-height: 54px; padding: 0 6px 0 14px; }
  .nav__burger {
    position: relative;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-left: auto;
    border-radius: 999px;
    background: var(--ink);
    cursor: pointer;
  }
  .nav__burger span {
    position: absolute;
    width: 16px;
    height: 1.6px;
    border-radius: 2px;
    background: var(--canvas);
    transition: transform .55s var(--ease-out);
  }
  .nav__burger span:first-child { transform: translateY(-3.5px); }
  .nav__burger span:last-child  { transform: translateY(3.5px); }
  .nav__check:checked ~ .nav__burger span:first-child { transform: rotate(45deg); }
  .nav__check:checked ~ .nav__burger span:last-child  { transform: rotate(-45deg); }
  .nav__check:focus-visible ~ .nav__burger { outline: 2px solid var(--coral); outline-offset: 3px; }

  .nav__links {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    padding: 96px 28px 40px;
    background: var(--canvas);
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s var(--ease-out), visibility 0s linear .5s;
  }
  .nav__links a:not(.nav__action) {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 500;
    letter-spacing: -.035em;
    padding: 4px 0;
    background: none !important;
  }
  .nav__links a {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .6s var(--ease-out), transform .7s var(--ease-out);
  }
  .nav__links .nav__action { margin: 18px 0 0; height: 46px; padding: 0 20px; font-size: 16px; }
  .nav__check:checked ~ .nav__links { opacity: 1; visibility: visible; transition: opacity .5s var(--ease-out); }
  html:has(#nav-toggle:checked) { overflow: hidden; }
  .ch--hero .eyebrow { height: auto; min-height: 30px; padding-block: 7px; border-radius: 16px; line-height: 1.35; }
  .nav__check:checked ~ .nav__links a { opacity: 1; transform: none; }
  .nav__check:checked ~ .nav__links a:nth-child(2) { transition-delay: .05s; }
  .nav__check:checked ~ .nav__links a:nth-child(3) { transition-delay: .1s; }
  .nav__check:checked ~ .nav__links a:nth-child(4) { transition-delay: .15s; }
  .nav__check:checked ~ .nav__links a:nth-child(5) { transition-delay: .2s; }
  .nav__check:checked ~ .nav__links a:nth-child(6) { transition-delay: .25s; }
}

/* --- Eyebrows and chapter tabs become pills with the coral dot ----------- */

.chapter__tab {
  height: 30px;
  padding: 0 13px 0 11px;
  border-radius: 999px;
  margin-bottom: 0;
  gap: 9px;
  font-size: 11px;
  letter-spacing: .08em;
}
.chapter__tab::before { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.chapter { align-items: center; gap: 12px; }
.chapter__line { margin-bottom: 0; }
.ch--dark .chapter__tab::before, .ch--chooser .chapter__tab::before { background: var(--coral); }

.hero .eyebrow, .ch--hero .eyebrow, .split-eyebrow, .run-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  height: 30px;
  padding: 0 13px 0 11px;
  border-radius: 999px;
  background: rgba(28, 22, 18, .05);
  color: var(--ink);
  letter-spacing: .1em;
}
.hero .eyebrow::before, .ch--hero .eyebrow::before, .split-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }

/* --- Button physics ------------------------------------------------------- */

.btn, .coral-cta, .pill-btn { transition: transform .5s var(--ease-spring), box-shadow .5s var(--ease-out), background .3s; }
.btn::after, .coral-cta__arrow { transition: transform .5s var(--ease-spring); }
.btn:hover::after, .coral-cta:hover .coral-cta__arrow { transform: translate(2px, -1px) scale(1.06); }
.btn:active, .coral-cta:active, .pill-btn:active, .nav__action:active { transform: scale(.97); }
.textlink { transition: border-color .3s, color .3s; }
.textlink:hover { color: var(--coral-deep); border-color: var(--coral-deep); }

/* --- Softer, layered cards (outer tray + inner plate) --------------------- */

.card, .stack__card, .chat, .thread {
  border: 0;
  border-radius: 26px;
  background: var(--paper);
  box-shadow: none;
}
.cards { gap: 22px; }
.card { padding: 28px; transition: transform .6s var(--ease-spring), box-shadow .6s var(--ease-out); }
.card:hover { transform: translateY(-4px); }
.chat__q, .chat__a, .msg__body { border-radius: 16px; }
.chat__q { border-bottom-right-radius: 5px; }
.chat__a, .msg:not(.msg--out) .msg__body { border-bottom-left-radius: 5px; }
.msg--out .msg__body { border-bottom-right-radius: 5px; }
.stack__card { padding: 34px; }

.project { transition: background .5s var(--ease-out), padding .5s var(--ease-out); border-radius: 0; }
.project:hover { background: rgba(228, 84, 43, .07); padding-inline: 14px; }
.project:hover .project__name { color: var(--coral-deep); }
.faq__item { transition: background .4s var(--ease-out); }
.faq__item:hover { background: rgba(28, 22, 18, .025); }
.faq__q::after { transition: transform .5s var(--ease-spring); }
.faq__item[open] .faq__q::after { transform: rotate(180deg); }

/* --- Scroll reveals (classes added by motion.js) -------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .js [data-r] {
    opacity: 0;
    transform: translateY(42px);
    filter: blur(10px);
    transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out), filter .9s var(--ease-out);
    transition-delay: var(--d, 0ms);
  }
  .js [data-r].in { opacity: 1; transform: none; filter: none; }
}

/* --- Proof ticker --------------------------------------------------------- */

.marquee {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--canvas);
  height: 58px;
  display: flex;
  align-items: center;
}
.marquee__track { display: flex; width: max-content; }
.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(251, 248, 243, .72);
}
.marquee__item b { font-family: var(--font-display); font-size: 19px; font-weight: 500; letter-spacing: -.02em; text-transform: none; color: var(--canvas); }
.marquee__item::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); margin-left: 16px; }
#problem { padding-top: calc(var(--s-7) + 58px); }
@media (prefers-reduced-motion: no-preference) {
  @keyframes marquee { to { transform: translateX(-50%); } }
  .marquee__track { animation: marquee 46s linear infinite; }
  .marquee:hover .marquee__track { animation-play-state: paused; }
}

/* --- Giant footer wordmark ------------------------------------------------ */

.footer__giant {
  margin: var(--s-5) 0 0;
  padding-bottom: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.2rem, 13.2vw, 13.5rem);
  line-height: .86;
  letter-spacing: -.06em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
}
.footer__giant em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.025em; color: var(--coral-deep); }
.footer__bottom { border-top: 1px solid var(--edge); margin-top: var(--s-3); }

/* ===========================================================================
   Hero scenes
   ========================================================================= */

.home-hero__grid, .hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(32px, 4.5vw, 72px);
  align-items: center;
}
.home-hero__grid .hero-h1 { font-size: clamp(2.8rem, 5.3vw, 5.2rem); line-height: .98; }
.home-hero__grid .hero-lead { font-size: clamp(17px, 1.35vw, 20px); }
.hero--split { padding-block: clamp(2rem, 5vw, 4.5rem) var(--s-6); }
.hero--split .hero__inner { max-width: none; }
.hero--split .display { font-size: clamp(2.6rem, 5vw, 4.6rem); }
.hero--split .lead { max-width: 560px; }

/* Double bezel: tray + plate. */
.stage-panel {
  position: relative;
  min-height: clamp(440px, 42vw, 620px);
  border-radius: 36px;
  background: rgba(28, 22, 18, .045);
  box-shadow: inset 0 0 0 1px rgba(28, 22, 18, .06);
}
.stage-core {
  position: absolute;
  inset: 8px;
  overflow: hidden;
  border-radius: 29px;
  box-shadow: inset 0 1px 1px rgba(251, 248, 243, .6);
}
.stage-core--warm {
  background:
    radial-gradient(circle at 1px 1px, rgba(28, 22, 18, .09) 1px, transparent 0) 0 0 / 22px 22px,
    var(--panel);
}
.stage-core--dusk {
  background:
    radial-gradient(circle at 1px 1px, rgba(251, 248, 243, .07) 1px, transparent 0) 0 0 / 24px 24px,
    var(--ink);
}

/* Small floating cards used inside the scenes. */
.scard {
  position: absolute;
  z-index: 2;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: none;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
}
.scard__k { display: block; margin-bottom: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.scard--coral { background: var(--coral); }
.scard--coral .scard__k { color: rgba(28, 22, 18, .62); }
.scard--dark { background: var(--ink); color: var(--canvas); }
.scard--dark .scard__k { color: rgba(251, 248, 243, .55); }
.scard b { font-weight: 600; }
.s-search { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 999px; background: var(--panel); }
.s-search svg { width: 14px; height: 14px; flex: none; }
.s-tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--panel); margin-right: 8px; vertical-align: middle; }
.s-tick svg { width: 11px; height: 11px; }
.s-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; background: var(--ink); color: var(--canvas); font-size: 13px; font-weight: 500; }
.s-pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); box-shadow: none; }

/* --- Home: the line, from a search to a customer -------------------------- */

.sline { position: absolute; inset: 4% 0 2%; width: 100%; height: 94%; overflow: visible; }
.sline__path { fill: none; stroke: var(--ink); stroke-width: .95; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.sline__start { fill: var(--ink); }
.sline__end { fill: var(--coral); }
.sline__ring { fill: none; stroke: var(--coral); stroke-width: .25; opacity: 0; transform-box: fill-box; transform-origin: center; }
.sline__runner { fill: var(--coral); opacity: 0; }

.h-c1 { top: 6%; left: 5%; width: 46%; }
.h-c2 { top: 27%; right: 4%; width: 40%; }
.h-c3 { top: 50%; left: 4%; width: 38%; }
.h-c4 { top: 75%; right: 4%; width: 38%; }
.h-c5 { position: absolute; bottom: 5%; left: 5%; z-index: 3; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes pop  { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
  @keyframes ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(3.4); } }
  @keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
  .stage--thanks .sline__path { animation: draw 1.8s var(--ease-out) .2s both; }
  .stage--thanks .sline__end { animation: pop .6s var(--ease-spring) 1.9s both; }
  .stage--thanks .sline__ring { animation: ring 2.4s var(--ease-out) 2.1s infinite; }
  .stage--thanks .thanks-pill { animation: pop .8s var(--ease-spring) 2.1s both; }
  .stage--home .sline__path { animation: draw 2.3s var(--ease-out) .3s both; }
  .stage--home .sline__start { animation: pop .5s var(--ease-spring) .2s both; }
  .stage--home .sline__end { animation: pop .6s var(--ease-spring) 2.4s both; }
  .stage--home .sline__ring { animation: ring 2.4s var(--ease-out) 2.6s infinite; }
  .stage--home .scard, .stage--home .s-pill { animation: pop .8s var(--ease-spring) both; }
  .stage--home .h-c1 { animation-delay: .5s; }
  .stage--home .h-c2 { animation-delay: 1.0s; }
  .stage--home .h-c3 { animation-delay: 1.5s; }
  .stage--home .h-c4 { animation-delay: 2.0s; }
  .stage--home .h-c5 { animation-delay: 2.5s; }
}

/* --- Work: a fanned deck of results --------------------------------------- */

.deck { position: absolute; inset: 0; }
.dcard {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(35%, 210px);
  aspect-ratio: .74;
  margin: calc(min(35%, 210px) / -2 / .74) 0 0 calc(min(35%, 210px) / -2);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 22px;
  box-shadow: 0 30px 60px -30px rgba(28, 22, 18, .6), inset 0 1px 0 rgba(251, 248, 243, .25);
  rotate: var(--r, 0deg);
  translate: var(--x, 0) var(--y, 0);
  transition: rotate .8s var(--ease-spring), translate .8s var(--ease-spring);
}
.dcard__k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }
.dcard__n { font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 3.1vw, 44px); line-height: .9; letter-spacing: -.04em; }
.dcard__n em { font-family: var(--font-serif); font-weight: 400; }
.dcard__t { font-size: 13px; line-height: 1.35; }
.dcard--1 { background: var(--panel); color: var(--ink); --r: -12deg; --x: -80%; --y: 5%; }
.dcard--2 { background: var(--panel); color: var(--ink); --r: -4deg; --x: -27%; --y: -3%; }
.dcard--3 { background: var(--coral); color: var(--ink); --r: 4deg; --x: 27%; --y: -1%; }
.dcard--4 { background: var(--paper); color: var(--ink); --r: 12deg; --x: 80%; --y: 6%; }
.stage--work:hover .dcard--1 { --r: -15deg; --x: -92%; --y: 2%; }
.stage--work:hover .dcard--2 { --r: -6deg; --x: -37%; --y: -7%; }
.stage--work:hover .dcard--3 { --r: 6deg; --x: 37%; --y: -5%; }
.stage--work:hover .dcard--4 { --r: 15deg; --x: 92%; --y: 3%; }
.deck__label { position: absolute; left: 50%; bottom: 6%; translate: -50% 0; z-index: 2; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes deal { from { opacity: 0; rotate: 0deg; translate: 0 40%; } }
  .stage--work .dcard { animation: deal 1.1s var(--ease-spring) both; }
  .stage--work .dcard--2 { animation-delay: .12s; }
  .stage--work .dcard--3 { animation-delay: .24s; }
  .stage--work .dcard--4 { animation-delay: .36s; }
  .stage--work .deck__label { animation: pop .8s var(--ease-spring) .7s both; }
}

/* --- Free audit: the report that writes itself ---------------------------- */

.report {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 7%;
  bottom: 7%;
  padding: 22px 24px;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: none;
  rotate: -1.5deg;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.report__head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--edge); }
.report__title { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -.02em; }
.report__title em { font-family: var(--font-serif); font-weight: 400; }
.report__sec b { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rline { display: block; height: 7px; margin-bottom: 7px; border-radius: 99px; background: var(--panel); transform-origin: left center; }
.rline:nth-child(3) { width: 82%; }
.rline:nth-child(4) { width: 64%; }
.fix { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--panel); font-size: 13.5px; }
.fix .s-tick { margin: 0; }
.fix em { margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: rgba(228, 84, 43, .18); color: var(--coral); }
.report__foot { margin-top: auto; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sticker {
  position: absolute;
  top: 3%;
  right: 5%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--coral);
  rotate: 12deg;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 30px;
  box-shadow: none;
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes write { from { transform: scaleX(0); } }
  @keyframes tick  { from { opacity: 0; transform: scale(.4); } }
  .stage--audit .report { animation: pop 1s var(--ease-spring) both; }
  .stage--audit .rline { animation: write .9s var(--ease-out) both; }
  .stage--audit .rs1 .rline:nth-child(2) { animation-delay: .5s; }
  .stage--audit .rs1 .rline:nth-child(3) { animation-delay: .65s; }
  .stage--audit .rs1 .rline:nth-child(4) { animation-delay: .8s; }
  .stage--audit .rs2 .rline:nth-child(2) { animation-delay: 1.0s; }
  .stage--audit .rs2 .rline:nth-child(3) { animation-delay: 1.15s; }
  .stage--audit .rs2 .rline:nth-child(4) { animation-delay: 1.3s; }
  .stage--audit .fix { animation: pop .7s var(--ease-spring) both; }
  .stage--audit .fix:nth-child(2) { animation-delay: 1.6s; }
  .stage--audit .fix:nth-child(3) { animation-delay: 1.85s; }
  .stage--audit .fix:nth-child(4) { animation-delay: 2.1s; }
  .stage--audit .fix .s-tick { animation: tick .5s var(--ease-spring) both; }
  .stage--audit .fix:nth-child(2) .s-tick { animation-delay: 1.9s; }
  .stage--audit .fix:nth-child(3) .s-tick { animation-delay: 2.15s; }
  .stage--audit .fix:nth-child(4) .s-tick { animation-delay: 2.4s; }
  .stage--audit .sticker { animation: pop .8s var(--ease-spring) 2.5s both, floaty 5s ease-in-out 3.4s infinite; }
}

/* --- Contact: a chat that answers ----------------------------------------- */

.cwin {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 8%;
  bottom: 8%;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: none;
}
.cwin__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--edge); }
.cwin__head svg { width: 34px; height: 34px; flex: none; padding: 5px; border-radius: 50%; background: var(--peach); }
.cwin__name { margin: 0; font-weight: 600; font-size: 15px; }
.cwin__status { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.cwin__status i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); vertical-align: 1px; }
.cwin__body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 16px; background: radial-gradient(circle at 1px 1px, rgba(28, 22, 18,.06) 1px, transparent 0) 0 0 / 20px 20px; }
.cmsg { max-width: 80%; padding: 11px 14px; border-radius: 18px; font-size: 14px; line-height: 1.45; }
.cmsg--in { align-self: flex-start; background: var(--panel); border-bottom-left-radius: 5px; }
.cmsg--out { align-self: flex-end; background: var(--ink); color: var(--canvas); border-bottom-right-radius: 5px; }
.cmsg small { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .55; }
.ctyping { align-self: flex-end; display: none; gap: 5px; padding: 12px 14px; border-radius: 18px; background: var(--panel); }
.ctyping i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.cwin__input { display: flex; align-items: center; justify-content: space-between; margin: 0 12px 12px; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--panel); font-size: 13px; color: var(--muted); }
.cwin__input span:last-child { width: 32px; height: 32px; border-radius: 50%; background: var(--coral); }
@media (prefers-reduced-motion: no-preference) {
  @keyframes typing { 0%, 70% { opacity: 1; } 100% { opacity: 0; height: 0; padding: 0; margin: 0; } }
  @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
  .stage--contact .cwin { animation: pop 1s var(--ease-spring) both; }
  .stage--contact .cmsg--in { animation: pop .7s var(--ease-spring) .6s both; }
  .stage--contact .ctyping i { animation: bounce .9s ease-in-out infinite; }
  .stage--contact .ctyping i:nth-child(2) { animation-delay: .15s; }
  .stage--contact .ctyping i:nth-child(3) { animation-delay: .3s; }
  .stage--contact .cmsg--out { animation: pop .7s var(--ease-spring) 2.9s both; }
  .js .stage--contact .ctyping { display: flex; animation: pop .4s var(--ease-spring) 1.3s both, typing .3s ease 2.8s forwards; }
}
.no-js-hide-typing .ctyping { display: none; }

/* --- Thank you: the line completes ---------------------------------------- */

.stage--thanks .sline { inset: 8% 0 6%; height: 86%; }
.thanks-pill { position: absolute; z-index: 3; left: 50%; bottom: 7%; translate: -50% 0; }

/* --- Narrow ---------------------------------------------------------------- */

@media (max-width: 960px) {
  .home-hero__grid, .hero__grid { grid-template-columns: 1fr; }
  .stage-panel { min-height: 460px; }
}
@media (max-width: 560px) {
  .stage-panel { min-height: 420px; border-radius: 28px; }
  .stage-core { border-radius: 22px; }
  .scard { font-size: 12px; padding: 10px 12px; }
  .h-c1 { width: 58%; } .h-c2 { width: 52%; } .h-c3 { width: 50%; } .h-c4 { width: 50%; }
  .dcard { width: 48%; }
  .sticker { width: 70px; height: 70px; font-size: 24px; }
  .report { left: 5%; right: 5%; padding: 18px; }
  .cwin { left: 4%; right: 4%; }
  .footer__giant { font-size: 15vw; }
}

/* ===========================================================================
   Homepage chapters: second pass of motion.
   Everything rests in its finished state; motion is layered on only where
   it is supported and wanted.
   ========================================================================= */

/* Word-by-word headline reveal (spans added by motion.js). */
.split-words .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split-words .w > span { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .js .split-words .w > span { transform: translateY(105%); transition: transform 1s var(--ease-out); transition-delay: calc(var(--wi) * 55ms); }
  .js .split-words.in .w > span { transform: none; }
}

/* --- 2. The leaks: customers dripping out of the gaps --------------------- */
.leaks__gap { overflow: visible; }
.drop { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--coral); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes drip { 0% { opacity: 0; transform: translate(0, 0) scale(1); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0px), 70px) scale(.6); } }
  .drop { animation: drip 2.4s cubic-bezier(.55, 0, .9, .4) infinite; }
  .drop:nth-child(2) { --dx: -10px; animation-delay: .8s; }
  .drop:nth-child(3) { --dx: 9px; animation-delay: 1.6s; }
  .leaks__gap + .leaks__seg + .leaks__gap .drop { animation-duration: 2s; }
}

/* --- 3. The evidence: a slow scan across the dark screen ------------------ */
.ch--dark { overflow: hidden; }
.ch--dark::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 1px 1px, rgba(251, 248, 243, .06) 1px, transparent 0) 0 0 / 26px 26px;
  -webkit-mask-image: radial-gradient(70% 60% at 30% 40%, var(--ink) 0%, transparent 75%);
          mask-image: radial-gradient(70% 60% at 30% 40%, var(--ink) 0%, transparent 75%);
}
.ch--dark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 32%;
  pointer-events: none;
  background: none;
  border-bottom: 1px solid rgba(228, 84, 43, .35);
  opacity: 0;
}
.ch--dark > .shell { position: relative; z-index: 1; }
.bigfig i { transition: color .6s; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes scan { 0% { transform: translateY(-110%); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(330%); opacity: 0; } }
  .ch--dark::after { animation: scan 7s cubic-bezier(.45, 0, .55, 1) infinite; }
  @keyframes zero { 0%, 100% { color: var(--muted); } 50% { color: var(--coral); } }
  .bigfig i { animation: zero 3.2s ease-in-out infinite; }
}

/* --- 4. Grow: searches drifting behind the chat --------------------------- */
.ch--grow { overflow: hidden; }
.ch--grow > .shell { position: relative; z-index: 1; }
.queries {
  position: relative;
  display: grid;
  gap: 12px;
  margin: var(--s-6) calc(50% - 50vw) 0;
  padding: 6px 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, var(--ink) 12%, var(--ink) 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, var(--ink) 12%, var(--ink) 88%, transparent);
}
.queries__row { display: flex; gap: 14px; width: max-content; }
.queries__row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  background: rgba(251, 248, 243, .55);
  font-size: 14px;
  white-space: nowrap;
  color: var(--body);
}
.queries__row span::before { content: ""; width: 10px; height: 10px; border: 1.6px solid currentColor; border-radius: 50%; opacity: .7; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes drift-l { to { transform: translateX(-50%); } }
  @keyframes drift-r { from { transform: translateX(-50%); } to { transform: translateX(0); } }
  .queries__row:nth-child(1) { animation: drift-l 70s linear infinite; }
  .queries__row:nth-child(2) { animation: drift-r 80s linear infinite; }
}

/* --- 5. Run: a rail that fills as each message lands ---------------------- */
.thread { position: relative; padding-left: calc(var(--s-3) + 14px); }
.thread::before, .thread::after {
  content: "";
  position: absolute;
  left: var(--s-3);
  top: 30px;
  bottom: 30px;
  width: 2px;
  border-radius: 2px;
}
.thread::before { background: var(--edge); }
.thread::after { background: var(--coral); transform-origin: top; }
.msg { position: relative; }
.msg::before {
  content: "";
  position: absolute;
  left: calc(-14px - 4px);
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--canvas);
  box-shadow: none;
}
.msg--out::before { left: auto; }
.msg--out { margin-left: auto; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes rail { from { transform: scaleY(0); } to { transform: scaleY(1); } }
    .thread::after { animation: rail linear both; animation-timeline: --thread; animation-range: cover 26% cover 54%; }
  }
}
.msg--out::before { display: none; }

/* --- 6. My own money: 3 in 100, and the bundle builder's share ------------ */
.dots100 {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 5px;
  margin-top: 14px;
  max-width: 260px;
  view-timeline: --dots block;
}
.dots100 i { aspect-ratio: 1; border-radius: 50%; background: rgba(28, 22, 18, .12); }
.dots100 i.on { background: var(--coral); box-shadow: none; }
.share { margin-top: var(--s-3); }
.share__bar { position: relative; height: 12px; border-radius: 999px; background: rgba(28, 22, 18, .08); overflow: hidden; view-timeline: --share inline; }
.share__fill { position: absolute; inset: 0 auto 0 0; width: 58.6%; border-radius: 999px; background: var(--coral); transform-origin: left; }
.share__legend { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--secondary); }
.share__legend b { color: var(--ink); font-weight: 600; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes dot-in { from { opacity: 0; transform: scale(.2); } }
    @keyframes dot-on { 0% { background: rgba(28, 22, 18, .12); transform: scale(1); box-shadow: none; } 60% { transform: scale(1.5); } 100% { } }
    .dots100 i { animation: dot-in linear both; animation-timeline: --dots; animation-range: entry 10% cover 30%; }
    .dots100 i.on1 { animation: dot-on linear both; animation-timeline: --dots; animation-range: cover 30% cover 36%; }
    .dots100 i.on2 { animation: dot-on linear both; animation-timeline: --dots; animation-range: cover 34% cover 40%; }
    .dots100 i.on3 { animation: dot-on linear both; animation-timeline: --dots; animation-range: cover 38% cover 44%; }
    @keyframes fill { from { transform: scaleX(0); } }
    .share__fill { animation: fill linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
  }
}

/* --- 7. Who you'd hire: numerals and an accent that grows ----------------- */
.stack__card .ch__num {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 54px;
  line-height: .9;
  letter-spacing: -.02em;
  color: var(--coral);
}
.stack__card { overflow: hidden; }
.stack__card::after {
  content: "";
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--coral);
  transform-origin: left;
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .stack__card::after { animation: fill linear both; animation-timeline: view(); animation-range: entry 30% cover 40%; }
  }
}

/* --- 8. Chooser: soft glows drifting behind ------------------------------- */
.ch--chooser { overflow: hidden; }
.ch--chooser > .shell { position: relative; z-index: 1; }
.ch--chooser::before, .ch--chooser::after {
  content: "";
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}
.ch--chooser::before { left: -12vw; top: -10vw; background: rgba(228, 84, 43, .22); }
.ch--chooser::after { right: -14vw; bottom: -16vw; background: rgba(243, 238, 230, .16); }
@media (prefers-reduced-motion: no-preference) {
  @keyframes orb-a { 50% { transform: translate(8vw, 6vw) scale(1.1); } }
  @keyframes orb-b { 50% { transform: translate(-7vw, -5vw) scale(.92); } }
  .ch--chooser::before { animation: orb-a 18s ease-in-out infinite; }
  .ch--chooser::after { animation: orb-b 22s ease-in-out infinite; }
}

/* --- 9. The close: the line draws itself one last time -------------------- */
.ch--close { overflow: hidden; view-timeline: --closeline block; }
.ch--close > .shell { position: relative; z-index: 1; }
.close-line {
  position: absolute;
  right: 5vw;
  top: 50%;
  width: min(34vw, 480px);
  height: auto;
  translate: 0 -50%;
  overflow: visible;
  pointer-events: none;
}
.close-line path { fill: none; stroke: var(--ink); stroke-width: .7; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: .9; }
.close-line .s0 { fill: var(--ink); }
.close-line .s1 { fill: var(--coral); transform-box: fill-box; transform-origin: center; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes draw-line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
    @keyframes dot-land { from { transform: scale(0); } to { transform: scale(1); } }
    .close-line path { animation: draw-line linear both; animation-timeline: --closeline; animation-range: entry 0% cover 42%; }
    .close-line .s1 { animation: dot-land linear both; animation-timeline: --closeline; animation-range: cover 40% cover 47%; }
  }
}
@media (max-width: 860px) {
  .close-line { opacity: .18; width: 90vw; right: -20vw; }
  .queries { margin-top: var(--s-5); }
}
