/* Homepage v2 (/home-v2/). Builds on css/catalog.css (hero copy, proof band, desk list, steps, FAQ).
   Concept: one pass through the gold core. Paper drifts in, finished records leave, and every section
   below tells that same pass a little slower. Gold = the agent, red = a person decides, the rest neutral. */

.home-page section[id] { scroll-margin-top: 90px; }
/* Book a call jumps here: the heading sits just under the menu with the calendar filling the rest of the screen */
.home-page #book { scroll-margin-top: 30px; }

/* ---------- 1. Hero ---------- */
/* Two columns on wide screens: headline, line and Book a call on the left, the drift on the right, so the picture of the
   work sits beside the button instead of being one more full-width row under it. Stacks below 900px. */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; column-gap: clamp(1.5rem, 4vw, 3.5rem); padding-bottom: clamp(1rem, 2.5vw, 1.75rem); }
.home-hero h1 { font-size: clamp(2.35rem, 3.9vw, 3.35rem); }
.home-hero .cat-lede { margin-top: 1.4rem; }
.home-hero .cat-actions { gap: 1rem 1.75rem; margin-top: 1.75rem; }

/* Book a call. A gold outline; on hover the gold pours in from wherever the pointer enters (js/home.js sets --px/--py),
   the words turn dark, and the arrow drops away as a fresh one comes down. It scrolls to the calendar at the bottom (#book). */
.hero-cta { position: relative; isolation: isolate; display: inline-flex; align-items: stretch; height: 58px; border-radius: 5px; overflow: hidden; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-dim); font: 600 1rem/1 var(--font-body); text-decoration: none; transition: color .45s var(--ease-out-expo), box-shadow .45s; }
.hero-cta-label { display: flex; align-items: center; padding: 0 1.4rem 0 1.5rem; }
.hero-cta-arrow { display: grid; place-items: center; width: 58px; overflow: hidden; font-size: 1.05rem; }
.hero-cta-arrow span { grid-area: 1 / 1; transition: transform .55s var(--ease-out-expo); }
.hero-cta-arrow span + span { transform: translateY(-36px); }
.hero-cta::before { content: ''; position: absolute; z-index: -1; inset: 0; background: var(--accent); clip-path: circle(0 at var(--px, 50%) var(--py, 50%)); transition: clip-path .7s var(--ease-out-expo); }
.hero-cta:hover, .hero-cta:focus-visible { color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.hero-cta:hover::before, .hero-cta:focus-visible::before { clip-path: circle(160% at var(--px, 50%) var(--py, 50%)); }
.hero-cta:hover .hero-cta-arrow span:first-child, .hero-cta:focus-visible .hero-cta-arrow span:first-child { transform: translateY(36px); }
.hero-cta:hover .hero-cta-arrow span + span, .hero-cta:focus-visible .hero-cta-arrow span + span { transform: none; }
.hero-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* the second way in: plain words, the arrow drops on hover */
.cta-quiet { display: inline-flex; align-items: center; gap: .1rem; color: var(--text-muted); font-size: .97rem; text-decoration: none; transition: color .3s; }
.cta-quiet:hover, .cta-quiet:focus-visible { color: var(--text); }

/* The drift: a slow, low-contrast picture of the work. Three quiet labels under it say what each part is: work arrives,
   the agent does the job, a person approves. (They replace the separate three-beats section that stood below the proof band.) */
.drift {
  position: relative; height: clamp(340px, 36vw, 440px); --spread: 1.7;
  container-type: size; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.drift-wire { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, var(--border-hover) 20%, rgba(212, 160, 82, .35) 50%, var(--border-hover) 80%, transparent); }
.drift-core { position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px; display: grid; place-items: center; }
.drift-core::before { content: ''; position: absolute; inset: -20px; border-radius: 50%; background: radial-gradient(circle, rgba(212, 160, 82, .16), transparent 62%); }
.drift-core .core { --d: 84px; position: relative; animation: drift-breathe 7s ease-in-out infinite; }
@keyframes drift-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

.drift-doc, .drift-rec { position: absolute; top: 50%; left: 0; opacity: 0; will-change: transform, opacity; animation-timing-function: linear; animation-iteration-count: infinite; animation-delay: var(--d, 0s); }
/* Paper coming in: email, PDF, drawing, timesheet. Faint, warm, no words. */
.drift-doc { width: 46px; height: 60px; margin-top: -30px; border-radius: 3px; background-color: #d9d5cb; animation-name: drift-in; animation-duration: 18s; }
.drift-doc--mail { width: 62px; height: 42px; margin-top: -21px; background: linear-gradient(155deg, transparent 49%, #b9b4a8 49.5%, transparent 51%) 0 0 / 50% 60% no-repeat, linear-gradient(205deg, transparent 49%, #b9b4a8 49.5%, transparent 51%) 100% 0 / 50% 60% no-repeat, #d9d5cb; }
.drift-doc--pdf { background: linear-gradient(#b9b4a8, #b9b4a8) 7px 8px / 22px 4px no-repeat, repeating-linear-gradient(#d9d5cb 0 6px, #c4bfb3 6px 7.5px) 7px 20px / 32px 30px no-repeat, #d9d5cb; }
.drift-doc--drawing { background: linear-gradient(#6f7f99, #6f7f99) 8px 12px / 30px 1.5px no-repeat, linear-gradient(#6f7f99, #6f7f99) 8px 12px / 1.5px 26px no-repeat, linear-gradient(#6f7f99, #6f7f99) 37px 12px / 1.5px 26px no-repeat, linear-gradient(#6f7f99, #6f7f99) 8px 37px / 30px 1.5px no-repeat, #cfd4dc; }
.drift-doc--sheet { width: 58px; height: 46px; margin-top: -23px; background: repeating-linear-gradient(90deg, transparent 0 10px, #bdb7aa 10px 11px), repeating-linear-gradient(transparent 0 8px, #bdb7aa 8px 9px), #d9d5cb; }
@keyframes drift-in {
  0% { transform: translate(-60px, calc(var(--y) * var(--spread, 1))) rotate(var(--r)); opacity: 0; }
  12% { opacity: .42; }
  62% { transform: translate(calc(50cqw - 120px), calc(var(--y) * var(--spread, 1) * .3)) rotate(calc(var(--r) * .3)); opacity: .42; }
  82% { transform: translate(calc(50cqw - 30px), 0) rotate(0) scale(.35); opacity: 0; }
  100% { transform: translate(calc(50cqw - 30px), 0) scale(.35); opacity: 0; }
}
/* Finished records going out: dark rows with a gold mark, as they would sit in the ERP. */
.drift-rec { width: 104px; height: 26px; margin-top: -13px; border-radius: 5px; border: 1px solid #34343a; background: linear-gradient(var(--accent-dim), var(--accent-dim)) 9px 50% / 6px 6px no-repeat, linear-gradient(#2e2e34, #2e2e34) 22px 9px / 44px 3px no-repeat, linear-gradient(#2a2a30, #2a2a30) 22px 15px / 30px 3px no-repeat, #18181b; animation-name: drift-out; animation-duration: 18s; }
@keyframes drift-out {
  0% { transform: translate(calc(50cqw - 52px), 0) scale(.4); opacity: 0; }
  14% { transform: translate(calc(50cqw + 60px), calc(var(--y) * var(--spread, 1) * .4)) scale(1); opacity: .7; }
  70% { transform: translate(calc(100cqw - 150px), calc(var(--y) * var(--spread, 1))); opacity: .7; }
  86%, 100% { transform: translate(calc(100cqw - 60px), calc(var(--y) * var(--spread, 1))); opacity: 0; }
}
.drift.is-paused *, .drift.is-paused { animation-play-state: paused !important; }

.drift-label { position: absolute; transform: translateX(-50%); font: 500 .8rem/1.4 var(--font-body); color: var(--text-muted); white-space: nowrap; }
.drift-label--in { left: 24%; top: 18%; }
.drift-label--agent { left: 50%; top: calc(50% + 50px); color: var(--accent); }
.drift-label--ask { left: 76%; top: calc(50% + 23.8cqh + 22px); }
.drift-label--ask::before { content: ''; display: inline-block; margin: 0 .5rem 1px 0; vertical-align: middle; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(239, 68, 68, .14); }

/* One record in each pass needs a person: it stops over "You approve", its red mark pulses twice, turns green, and goes on. */
.drift-rec--ask { --y: 14cqh; background: linear-gradient(#2e2e34, #2e2e34) 22px 9px / 44px 3px no-repeat, linear-gradient(#2a2a30, #2a2a30) 22px 15px / 30px 3px no-repeat, #18181b; animation-name: drift-ask; }
.drift-rec--ask::after { content: ''; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--danger); animation: drift-ask-mark 18s linear infinite var(--d, 0s); }
@keyframes drift-ask {
  0% { transform: translate(calc(50cqw - 52px), 0) scale(.4); opacity: 0; }
  10% { transform: translate(calc(50cqw + 60px), calc(var(--y) * var(--spread, 1) * .4)) scale(1); opacity: .85; }
  32%, 54% { transform: translate(calc(78cqw - 52px), calc(var(--y) * var(--spread, 1))); opacity: .95; }
  76% { transform: translate(calc(100cqw - 150px), calc(var(--y) * var(--spread, 1))); opacity: .8; }
  88%, 100% { transform: translate(calc(100cqw - 60px), calc(var(--y) * var(--spread, 1))); opacity: 0; }
}
@keyframes drift-ask-mark {
  0%, 32% { background: var(--danger); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  37%, 46% { box-shadow: 0 0 0 6px rgba(239, 68, 68, .3); }
  41.5%, 50% { background: var(--danger); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  52%, 100% { background: var(--success); box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); }
}

/* ---------- 1b. Systems it works with ---------- */
/* A centred band across the full width, so it reads as its own break before the proof band's two columns. Logos are one
   colour and quiet; they slide left to right like the papers above, at about the same speed, so the hero and the strip
   read as one flow. Without js/home.js they sit still and wrap. */
.systems { padding: 0 0 clamp(3rem, 6vw, 4.5rem); text-align: center; }
.catalog-page .systems-label { margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem); font-size: clamp(1.35rem, 2vw, 1.65rem); line-height: 1.2; color: var(--text-muted); }
/* The last word changes slowly (ERP, inbox, software): the old word fades and blurs away, the new one settles in.
   All the words share one grid cell, so the space is as wide as the longest and the line never shifts. Gold italic,
   like the hero's last line; the rest of the line stays quiet grey. */
.flip { color: var(--accent); font-style: italic; }
.flip.is-flipping { display: inline-grid; justify-items: start; vertical-align: top; }
.flip.is-flipping .flip-word { grid-area: 1 / 1; padding-right: .12em; white-space: nowrap; opacity: 0; transform: translateY(.25em); filter: blur(6px); }
.flip.is-flipping .flip-word.is-on, .flip.is-flipping .flip-word.is-off { transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out-expo), filter 1s var(--ease-out); }
.flip.is-flipping .flip-word.is-on { opacity: 1; transform: none; filter: none; transition-delay: .2s; }
.flip.is-flipping .flip-word.is-off { transform: translateY(-.25em); }
.systems-list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .75rem 3.25rem; }
.systems-list li { display: flex; flex: none; align-items: center; gap: .55rem; height: 48px; font: 600 1.02rem/1 var(--font-body); color: var(--text); white-space: nowrap; opacity: .5; transition: opacity .3s; }
.systems-list li:hover { opacity: .95; }
.systems-list img { display: block; width: auto; height: calc(var(--h, 26px) * var(--s, 1)); }
.systems-note { margin-top: .75rem; font-size: .8rem; color: var(--text-muted); }

.systems-strip.is-looping { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%); }
.systems-strip.is-looping .systems-track { display: flex; width: max-content; animation: systems-slide 60s linear infinite; }
.systems-strip.is-looping .systems-list { flex-wrap: nowrap; padding-right: 3.25rem; }
.systems-strip:hover .systems-track, .systems-strip.is-paused .systems-track { animation-play-state: paused; }
@keyframes systems-slide { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* ---------- 2. What changed for our clients ---------- */
/* Each result is a small before and after drawn in the drift's own parts: the old way in grey, a wire, the agent (the gold
   core) or the outcome in gold. A signal runs along each wire now and then, one result after another. */
.wins { padding: clamp(3.5rem, 7vw, 5rem) 0 clamp(1rem, 2vw, 1.5rem); }
.wins-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 2rem; margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem); }
.wins-head h2 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); line-height: 1.1; }
.wins-head p { font-size: .85rem; color: var(--text-muted); }
.wins-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem clamp(1.5rem, 4vw, 3.5rem); }
.wins-list h3 { font-size: clamp(1.3rem, 1.9vw, 1.55rem); line-height: 1.2; color: var(--text); }
.wins-list p { margin-top: .6rem; max-width: 36ch; font-size: .97rem; line-height: 1.6; color: var(--text-muted); }
.win-mark { display: flex; align-items: center; gap: .65rem; height: 44px; margin-bottom: 1.1rem; color: #85858f; }
.win-mark svg { display: block; flex: none; }
.win-mark .core { --d: 32px; }
.win-wire { position: relative; flex: none; width: 46px; height: 1px; overflow: hidden; background: linear-gradient(90deg, var(--border-hover), var(--accent-dim)); }
.win-wire::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 60%; background: linear-gradient(90deg, transparent, var(--accent-bright), transparent); transform: translateX(-100%); animation: win-signal 6s var(--ease-out) infinite; animation-delay: calc(var(--i, 0) * 1.5s + 1s); }
@keyframes win-signal { 0% { transform: translateX(-100%); } 20%, 100% { transform: translateX(200%); } }
.win-hand { transform-box: view-box; transform-origin: 50% 50%; animation: win-spin 2.4s linear infinite; }
@keyframes win-spin { to { transform: rotate(360deg); } }
.win-up { color: var(--accent); }

/* ---------- 4. Desks (compact) ---------- */
.home-desks { padding-top: clamp(4rem, 8vw, 6rem); }
.dl--compact .dl-row { grid-template-columns: minmax(0, 250px) minmax(0, 1.3fr) minmax(0, .9fr); padding: .9rem 1.1rem; }
.dl--compact .dl-name { font-size: 1.5rem; }
.dl--compact .dl-line { font-size: .97rem; }
.dl--compact .dl-side { justify-content: center; gap: .75rem; }
.home-all { margin: 1.4rem 0 2rem; text-align: center; }

/* ---------- 5. How it works ---------- */
.home-how .how-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; margin-top: 2.25rem; }
.home-how .how-foot .watch-line { margin-top: 0; }

/* ---------- 6. About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding: clamp(4.5rem, 9vw, 7rem) 0; }
.about-photo { margin: 0; }
.about-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 18%; border-radius: 16px; background: var(--surface); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8); filter: grayscale(.15); }
.about-photo figcaption { margin-top: .7rem; font: 500 .74rem/1.4 var(--font-mono); color: var(--text-muted); }
.about-text h2 { font-size: clamp(2rem, 3.4vw, 2.7rem); line-height: 1.1; }
.about-lede { margin-top: 1rem; font-size: 1.15rem; line-height: 1.55; color: var(--text); max-width: 46ch; }
.about-text > p:not(.about-lede):not(.about-links) { margin-top: .9rem; font-size: 1rem; line-height: 1.7; color: var(--text-muted); max-width: 58ch; }
.about-points { list-style: none; margin-top: 1.2rem; max-width: 54ch; }
.about-points li { position: relative; padding: .45rem 0 .45rem 1.5rem; font-size: .97rem; line-height: 1.55; color: var(--text); }
.about-points li::before { content: ''; position: absolute; left: 2px; top: calc(.45rem + .78em - 3.5px); width: 7px; height: 7px; border-radius: 50%; background: var(--accent-dim); }
.about-links { display: flex; flex-wrap: wrap; gap: .8rem 1.75rem; margin-top: 1.5rem; }

/* ---------- 7. Questions ---------- */
.home-faq { padding: clamp(4.5rem, 9vw, 7rem) 0; }
.home-faq h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.12; }

/* ---------- 8. Book, with the calendar on the page ---------- */
.book { position: relative; padding: clamp(4.5rem, 9vw, 7rem) 0 clamp(3.5rem, 6vw, 5rem); }
.book::before { content: ''; position: absolute; z-index: -1; inset: 0 -10% 30%; background: radial-gradient(closest-side, rgba(212, 160, 82, .06), transparent); pointer-events: none; }
.book-head { text-align: center; margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem); }
.book-head h2 { font-size: clamp(2rem, 3.6vw, 2.8rem); line-height: 1.1; max-width: 22ch; margin: 0 auto; }
.book-head p { margin: 1rem auto 0; max-width: 54ch; font-size: 1.02rem; line-height: 1.6; color: var(--text-muted); }
/* Calendly sits straight on the page, event details and photo included. js/home.js grows the frame to fit each step, so it never scrolls inside itself. */
.book-cal { max-width: 1000px; margin: 0 auto; }
.book-cal .calendly-inline-widget { min-width: 300px; height: 800px; }
.book-alt { max-width: 70ch; margin: 1.1rem auto 0; text-align: center; font-size: .88rem; color: var(--text-muted); }
.book-alt a { margin: 0 .2rem; font-size: .88rem; }

/* ---------- Where you are: a quiet rail on the left of wide screens ---------- */
/* .rail is a <nav>, so undo the site-wide nav styles first. It fades in once the hero has gone. */
.rail { position: fixed; z-index: 40; top: 50%; left: max(1.25rem, calc((100vw - var(--container-max)) / 2 - 10rem)); transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .15rem; margin: 0; padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility .5s; }
.rail.is-shown { opacity: 1; visibility: visible; }
.rail a { display: flex; align-items: center; gap: .7rem; padding: .4rem 0; color: var(--text-dim); font: 500 .68rem/1 var(--font-mono); text-decoration: none; transition: color .3s; }
.rail a::before { content: ''; flex: none; width: 12px; height: 1px; background: currentColor; transition: width .4s var(--ease-out), background .4s; }
.rail a span { white-space: nowrap; opacity: 0; transform: translateX(-4px); transition: opacity .3s, transform .3s var(--ease-out); }
.rail:hover a span, .rail a:focus-visible span, .rail a[aria-current] span { opacity: 1; transform: none; }
.rail a:hover, .rail a[aria-current] { color: var(--text); }
.rail a[aria-current]::before { width: 28px; background: var(--accent); }
@media (max-width: 1359px) { .rail { display: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .dl--compact .dl-row { grid-template-columns: minmax(0, 210px) minmax(0, 1.2fr) minmax(0, .9fr); }
}
@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; padding-bottom: 2.5rem; }
  .wins-list { grid-template-columns: 1fr; max-width: 520px; }
  .drift { height: clamp(170px, 30vw, 250px); margin-top: 1.5rem; --spread: 1; }
  .drift-rec--ask { --y: 22cqh; }
  .drift-label { top: auto; bottom: 0; }
  .drift-label--in { left: 22%; }
  .drift-label--ask { left: 78%; }
  .dl--compact .dl-row { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); }
  .about { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); align-items: start; }
  .home-faq { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .drift { height: 150px; }
  .home-hero h1 { font-size: clamp(2.1rem, 9.4vw, 2.6rem); }
  .drift-core { width: 110px; height: 110px; margin: -55px 0 0 -55px; }
  .drift-core .core { --d: 60px; }
  .drift-doc--drawing, .drift-rec--3 { display: none; }
  .drift-label { font-size: .72rem; }
  .drift-more { display: none; }
  .systems-list { --s: .8; column-gap: 2.5rem; }
  .systems-list li { height: 40px; font-size: .9rem; }
  .systems-strip.is-looping .systems-list { padding-right: 2.5rem; }
  .dl--compact .dl-row { grid-template-columns: 132px minmax(0, 1fr); }
  .dl--compact .dl-name { font-size: 1.3rem; }
  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 240px; }
  .home-how .how-foot .btn-primary { width: 100%; justify-content: center; }
  .book-cal { margin: 0 -1.25rem; border-radius: 0; }
}

/* Reduced motion: the drift becomes one still frame, papers on the left and records on the right */
@media (prefers-reduced-motion: reduce) {
  .drift-doc, .drift-rec { animation: none !important; opacity: .42; }
  .drift-rec { opacity: .7; }
  .drift-doc--mail { transform: translate(calc(4cqw), calc(var(--y) * var(--spread, 1))) rotate(var(--r)); }
  .drift-doc--pdf { transform: translate(calc(12cqw), calc(var(--y) * var(--spread, 1))) rotate(var(--r)); }
  .drift-doc--drawing { transform: translate(calc(19cqw), calc(var(--y) * var(--spread, 1) * .5)) rotate(var(--r)); }
  .drift-doc--sheet { transform: translate(calc(26cqw), calc(var(--y) * var(--spread, 1) * .3)) rotate(var(--r)); }
  .drift-rec--1 { transform: translate(calc(50cqw + 60px), calc(var(--y) * var(--spread, 1))); }
  .drift-rec--ask { transform: translate(calc(78cqw - 52px), calc(var(--y) * var(--spread, 1))); opacity: .9; }
  .drift-rec--3 { transform: translate(calc(100cqw - 160px), calc(var(--y) * var(--spread, 1))); }
}
