/* Calopic editorial motion — story wipe + ecosystem marquee.
   Same design language as home-v2.css: warm paper, deep charcoal, one
   restrained terracotta accent, hairline rules, no glass / no gradients. */

/* ==========================================================================
   Product story — three pinned screens, a left-to-right editorial wipe.
   story.js writes --e (0 -> 1); CSS owns every visual decision.
   ========================================================================== */
.sw { --e: 0; position: relative; }
.sw-pin { height: 250vh; position: relative; }

.sw-stick {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  border-top: 1px solid var(--hv-line);
}

/* Layer 1 — the problem. Quiet, centred, unlit. */
.sw-base {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 32px;
  background: var(--hv-paper);
}
.sw-base-kicker,
.sw-kicker {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--hv-muted);
}
.sw-base-title {
  font-family: var(--hv-serif);
  font-weight: 400;
  font-size: clamp(40px, 5.4vw, 74px);
  line-height: 1.1;
  letter-spacing: -.035em;
  color: var(--hv-muted);
  margin: 22px 0 0;
  max-width: 900px;
}
.sw-base-foot {
  position: absolute;
  bottom: 40px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--hv-muted);
}
.sw-pager { font-size: 13px; font-variant-numeric: tabular-nums; }
.sw-pager b { color: var(--hv-ink); font-weight: 600; }
.sw-pager i { font-style: normal; opacity: .5; margin: 0 3px; }
.sw-bars { display: inline-flex; gap: 5px; }
.sw-bars i { width: 22px; height: 2px; background: var(--hv-line); display: block; }
.sw-bars i.on { background: linear-gradient(90deg, var(--hv-accent) calc(var(--e) * 100%), var(--hv-line) 0); }

/* Layer 2 — the answer, wiped open from the left edge. */
.sw-with {
  position: absolute;
  inset: 0;
  background: var(--hv-paper-alt);
  clip-path: inset(0 calc((1 - var(--e)) * 100%) 0 0);
  display: grid;
  place-items: center;
}
.sw[data-step="2"] .sw-with { clip-path: inset(0 0 0 calc((1 - var(--e)) * 100%)); }
.sw-with-copy {
  width: min(1080px, calc(100% - 64px));
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: center;
}
.sw-with .sw-kicker { color: var(--hv-accent); }
.sw-title {
  font-family: var(--hv-serif);
  font-weight: 400;
  font-size: clamp(34px, 3.8vw, 52px);
  line-height: 1.14;
  letter-spacing: -.028em;
  color: var(--hv-ink);
  margin: 16px 0 0;
}
.sw-title span { display: block; }
.sw-dim { color: var(--hv-muted); font-style: italic; }
.sw-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--hv-ink-soft);
  margin: 22px 0 0;
  max-width: 480px;
}
.sw-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
  color: var(--hv-ink-soft);
}
.sw-foot .sw-pager b { color: var(--hv-accent); }
.sw-with .sw-bars i { background: var(--hv-line); }
.sw-with .sw-bars i.on { background: linear-gradient(90deg, var(--hv-ink) calc(var(--e) * 100%), var(--hv-line) 0); }
.sw[data-step="2"] .sw-base-foot .sw-bars i.on { background: linear-gradient(270deg, var(--hv-accent) calc(var(--e) * 100%), var(--hv-line) 0); }
.sw[data-step="2"] .sw-with .sw-bars i.on { background: linear-gradient(270deg, var(--hv-ink) calc(var(--e) * 100%), var(--hv-line) 0); }

/* The seam: a single restrained hairline riding the wipe edge, with the
   Calopic mark centred on the line like a wipe handle. */
.hv-seam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--hv-accent);
  left: calc(var(--e) * 100%);
  transform: translateX(-50%);
  z-index: 5;
  opacity: min(calc(var(--e) * 12), calc((1 - var(--e)) * 10), 1);
}
/* Bare logo mark sitting exactly midway on the wipe line — no badge, no ring. */
.hv-seam::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 68px;
  transform: translate(-50%, -50%);
  background: url("/assets/favicon.svg") center / contain no-repeat;
}
.sw[data-step="2"] .hv-seam { left: calc((1 - var(--e)) * 100%); }

/* The shot inside the answer — a clean document card, no glass. */
.hv-sw-shot {
  border: 1px solid var(--hv-line);
  border-radius: 8px;
  background: var(--hv-paper);
  padding: 18px;
  min-height: 250px;
  box-shadow: 0 20px 50px rgba(24, 22, 18, .07);
}
.hv-sw-shot-bar {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--hv-muted);
  border-bottom: 1px solid var(--hv-line);
  padding-bottom: 12px; margin-bottom: 16px;
}
.hv-sw-shot-bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--hv-line); }
.hv-sw-shot-bar span { margin-inline-start: 8px; }
.hv-sw-shot-line { height: 9px; border-radius: 4px; background: var(--hv-line); opacity: .55; margin: 10px 0; }
.hv-sw-shot-line.w90 { width: 90%; }
.hv-sw-shot-line.w70 { width: 70%; }
.hv-sw-shot-line.w50 { width: 50%; }
.hv-sw-shot-card {
  border: 1px solid var(--hv-line); border-radius: 6px;
  background: var(--hv-paper-alt); padding: 12px 14px; margin-top: 14px;
}
.hv-sw-shot-tag {
  font-size: 11px; color: var(--hv-accent);
  background: var(--hv-accent-soft); padding: 3px 8px; border-radius: 4px;
  display: inline-block; margin-bottom: 10px;
}
.hv-sw-shot-actions { display: grid; gap: 8px; margin-top: 6px; }
.hv-sw-shot-action {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--hv-ink-soft);
  border: 1px solid var(--hv-line); border-radius: 6px; padding: 9px 11px;
  background: var(--hv-paper);
}
.hv-sw-shot-action b { color: var(--hv-accent); font-variant-numeric: tabular-nums; font-weight: 600; }
.hv-sw-shot-action em { margin-inline-start: auto; font-style: normal; color: var(--hv-muted); font-size: 11px; }

/* ==========================================================================
   Ecosystem — three offset rows of brand marks, looping forever.
   ecosystem.js builds rows b/c from #eco-track; marks come from logos.js.
   ========================================================================== */
.hv-eco { border-top: 1px solid var(--hv-line); padding: 104px 0; overflow: hidden; }
.hv-eco-head { max-width: 720px; margin-bottom: clamp(48px, 6vw, 72px); }
.hv-eco-title {
  font-family: var(--hv-serif); font-weight: 400;
  font-size: clamp(38px, 5vw, 64px); line-height: 1.08;
  letter-spacing: -.035em; color: var(--hv-ink);
  margin: 18px 0 0;
}
.hv-eco-statement {
  font-size: 17px; line-height: 1.7; color: var(--hv-ink-soft);
  margin: 20px 0 0; max-width: 560px;
}
.eco-rows { display: grid; gap: clamp(8px, 1.2vw, 16px); }
.eco-row {
  position: relative; overflow-x: auto; overflow-y: hidden;
  padding-block: 4px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.eco-row::-webkit-scrollbar { display: none; }
.eco-row--b { margin-inline-start: clamp(-104px, -9vw, -44px); }
.eco-row--c { margin-inline-start: clamp(40px, 6vw, 96px); }
.eco-row.is-ready { overflow: hidden; }
.eco-marquee { display: flex; width: max-content; direction: ltr; }
.eco-track { display: flex; flex: 0 0 auto; align-items: center; margin: 0; padding: 0; list-style: none; }
.eco-item { flex: 0 0 auto; width: clamp(112px, 10vw, 140px); display: grid; place-items: center; }
.eco-mark {
  width: clamp(58px, 5.4vw, 70px); height: clamp(58px, 5.4vw, 70px);
  display: grid; place-items: center;
  border: 1px solid var(--hv-line); border-radius: 8px;
  background: var(--hv-paper); color: var(--hv-ink);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.eco-item:hover .eco-mark { transform: translateY(-3px); border-color: var(--hv-accent); background: var(--hv-paper-alt); }
.eco-mark svg { width: 28px; height: 28px; fill: currentColor; opacity: .55; transition: opacity 180ms ease; }
.eco-item:hover .eco-mark svg { opacity: .9; }
.eco-row.is-ready .eco-marquee { animation: eco-scroll var(--eco-dur, 72s) linear infinite; }
.eco-row--b.is-ready .eco-marquee { --eco-dur: 92s; animation-direction: reverse; }
.eco-row--c.is-ready .eco-marquee { --eco-dur: 108s; }
@keyframes eco-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
[dir="rtl"] .eco-row.is-ready .eco-marquee { animation-name: eco-scroll-rtl; }
@keyframes eco-scroll-rtl { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ==========================================================================
   Responsive / reduced motion
   ========================================================================== */
@media (max-width: 900px) {
  .sw-pin { height: auto; }
  .sw-stick { position: relative; height: auto; min-height: 620px; }
  .sw-with { position: relative; clip-path: none; min-height: 620px; }
  .sw[data-step="2"] .sw-with { clip-path: none; }
  .hv-seam { display: none; }
  .sw-with-copy { grid-template-columns: 1fr; gap: 34px; width: calc(100% - 44px); }
  .sw-base { position: relative; min-height: 420px; }
  .sw-base-foot { bottom: 18px; }
  .hv-eco { padding: 72px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .eco-row.is-ready { overflow-x: auto; }
  .eco-row.is-ready .eco-marquee { animation: none; }
  .eco-row, .eco-row.is-ready { -webkit-mask-image: none; mask-image: none; }
  .eco-item:hover .eco-mark { transform: none; }
  .sw-pin { height: auto; }
  .sw-stick { position: relative; height: auto; min-height: 620px; }
  .sw-with { position: relative; clip-path: none; min-height: 620px; }
  .sw[data-step="2"] .sw-with { clip-path: none; }
  .hv-seam { display: none; }
}
