/* ============================================================
   Scroll motion and animated icons (driven by js/motion.js).
   Everything animated sits under html.motion-ok, which only exists with JS
   and without prefers-reduced-motion; otherwise the static layout shows.
   ============================================================ */

/* ---------- Reveal variants (base fade-up lives in site.css) ---------- */
.js-motion [data-reveal="fade"] { transform: none; }
.js-motion [data-reveal="scale"] { transform: scale(0.94); }
.js-motion [data-reveal="left"] { transform: translateX(-32px); }
.js-motion [data-reveal="right"] { transform: translateX(32px); }
.js-motion [data-reveal].is-in { transform: none; }

/* ---------- Word by word: --p (0..1) from motion.js, --i per word, --words count (--n is taken by the counters) ---------- */
/* After 21st 24525: word i lights between p = i/(n-1)*0.8 and that + 0.2, resting at 0.5 (keeps unlit words at 3:1 contrast on --bg) */
.motion-ok [data-reveal-words] .rw {
  opacity: calc(0.5 + 0.5 *clamp(0, (var(--p, 0) - var(--i) / max(1, var(--words) - 1) * 0.8) * 5, 1));
}

/* ---------- Animated icons (geometry: Lucide, ISC; motion after cojeev animated icons, MIT) ---------- */
[data-icon-anim] { display: inline-flex; }
[data-icon-anim] svg { overflow: visible; }
.motion-ok [data-icon-anim="direction"].is-play svg { animation: ia-dir 620ms var(--ease-out) both; }
.motion-ok [data-icon-anim="pulse"].is-play svg { animation: ia-pulse 560ms var(--ease-out) both; }
.motion-ok [data-icon-anim="trace"].is-play svg > * {
  stroke-dasharray: 1; animation: ia-trace 820ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 110ms);
}
@keyframes ia-dir {
  0% { transform: none; }
  40% { transform: translate(var(--dx, 4px), var(--dy, 0)); opacity: 0; }
  41% { transform: translate(calc(var(--dx, 4px) * -1), calc(var(--dy, 0px) * -1)); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@keyframes ia-pulse { 0%, 100% { transform: none; } 45% { transform: scale(1.18) rotate(-4deg); } }
@keyframes ia-trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* Check lists: the tick draws itself on scroll-in */
.checks--icons li::before { content: none; }
.checks--icons .checks__tick { position: absolute; left: 0; top: 0.2em; width: 1.1em; height: 1.1em; color: var(--accent-ink); }
.checks--icons .checks__tick svg { width: 100%; height: 100%; }
.card--dark .checks--icons .checks__tick, .section--dark .checks--icons .checks__tick { color: var(--accent-soft); }
.section--dark .plan .checks--icons .checks__tick { color: var(--g); }

/* ---------- Mega menu icons ---------- */
.mega__icon { flex: none; width: 30px; height: 30px; border-radius: 9px; align-items: center; justify-content: center; background: var(--accent-wash); color: var(--accent-ink); }
.mega__icon svg { width: 16px; height: 16px; }

/* ---------- Spotlight cards (21st 2220) ---------- */
.spot { position: relative; isolation: isolate; overflow: hidden; }
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(240, 85, 26, 0.16), transparent 62%);
  transition: opacity 400ms var(--ease-out);
}
.spot:hover::before, .spot:focus-within::before { opacity: 1; }

/* ---------- Home: word-by-word statement (21st 24525) ---------- */
.statement { padding-block: clamp(3rem, 2rem + 5vw, 7rem); }
.statement__text { font-size: clamp(1.75rem, 1rem + 3.2vw, 3.75rem); font-weight: 600; line-height: 1.12; letter-spacing: -0.025em; max-width: 24ch; color: var(--ink); text-wrap: balance; }

/* ---------- Home: offer journey (21st "Timeline", Hyperiux) ----------
   Static/mobile: vertical timeline. Pinned (large screens + motion-ok): track slides by --p,
   rule draws, each item shows (--s 0..1) once the rule's tip reaches it. Geometry in vw:
   gutter 5 · photo 28 · gap 5 · area 144 (title column 16, item step 17, item width 26). */
.jr { background: #fff; padding-block: var(--section); }
.jr__track { display: grid; gap: var(--s-7); width: min(100% - 2 * var(--gutter), 720px); margin-inline: auto; }
.jr__photo { margin: 0; aspect-ratio: 16 / 10; border-radius: var(--r-xl); overflow: hidden; }
.jr__photo img { width: 100%; height: 100%; object-fit: cover; }
.jr__title { margin: 0; font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem); font-weight: 700; line-height: 0.95; letter-spacing: -0.04em; }
.jr__period { margin: var(--s-3) 0 0; color: var(--muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9375rem; }
.jr__rule, .jr__tip { display: none; }
.jr .jr__items { list-style: none; margin: var(--s-7) 0 0; padding: 0 0 0 var(--s-5); border-left: 1px solid var(--accent); display: grid; gap: var(--s-7); }
.jr__item { position: relative; }
.jr__dot { position: absolute; left: calc(-1 * var(--s-5)); top: 0.45em; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); translate: -50% 0; }
.jr__stem { display: none; }
.jr__when { margin: 0 0 var(--s-2); color: var(--accent); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.875rem; }
.jr__h { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 650; line-height: 1.08; letter-spacing: -0.03em; }
.jr__big { margin: 0; font-size: clamp(2.5rem, 2rem + 2.5vw, 4rem); font-weight: 700; line-height: 0.95; letter-spacing: -0.05em; }
.jr__text { margin: var(--s-3) 0 0; max-width: 40ch; color: var(--muted); line-height: 1.45; }
.jr__link { display: inline-flex; gap: 6px; margin-top: var(--s-3); font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; }
.jr__link:hover { color: var(--accent); }

@media (min-width: 900px) and (min-height: 640px) {
  .motion-ok .jr { height: 380vh; padding: 0; }
  .motion-ok .jr__stage { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; overflow: hidden; padding-top: 72px; }
  .motion-ok .jr__track { --tw: 187vw; display: flex; gap: 5vw; width: var(--tw); max-width: none; height: min(70vh, 660px); margin: 0; padding-inline: 5vw; transform: translate3d(calc(var(--p, 0) * (100vw - var(--tw))), 0, 0); will-change: transform; }
  .motion-ok .jr__photo { flex: 0 0 28vw; height: 100%; aspect-ratio: auto; border-radius: 1.25vw; }
  .motion-ok .jr__area { position: relative; flex: 0 0 144vw; }
  .motion-ok .jr__rule { display: block; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }
  .motion-ok .jr__tip { display: block; position: absolute; top: 50%; left: calc(var(--p, 0) * 100%); width: 0.8vw; height: 0.8vw; border-radius: 50%; background: var(--accent); translate: -50% -50%; box-shadow: 0 0 0 0.5vw rgb(196 90 26 / 0.15); }
  .motion-ok .jr__title { position: absolute; left: 0; top: 0; width: 14vw; font-size: 3.2vw; }
  .motion-ok .jr__period { position: absolute; left: 0; top: calc(50% + 1.6vw); margin: 0; font-size: 1.1vw; }
  .motion-ok .jr .jr__items { position: absolute; inset: 0; margin: 0; padding: 0; border: 0; display: block; }
  .motion-ok .jr .jr__item {
    --s: clamp(0, calc((var(--p, 0) - ((16 + var(--i) * 17) / 144 - 0.05)) * 9), 1);
    position: absolute; left: calc(16vw + var(--i) * 17vw); width: 26vw; top: 50%; bottom: 0; padding-left: 1.6vw;
    display: flex; flex-direction: column; justify-content: flex-end;
    opacity: 1; transform: none; transition: none;
  }
  .motion-ok .jr .jr__item--top { top: 0; bottom: 50%; justify-content: flex-start; }
  .motion-ok .jr__stem { display: block; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--accent); transform-origin: top; transform: scaleY(var(--s)); }
  .motion-ok .jr__item--top .jr__stem { transform-origin: bottom; }
  .motion-ok .jr__dot { left: 0; top: auto; bottom: 0; width: 1vw; height: 1vw; translate: -50% 50%; transform: scale(var(--s)); }
  .motion-ok .jr__item--top .jr__dot { top: 0; bottom: auto; translate: -50% -50%; }
  .motion-ok .jr__copy > * { opacity: var(--s); transform: translateY(calc((1 - var(--s)) * 2.5vw)); }
  .motion-ok .jr__item--top .jr__copy { margin-top: -0.6vw; }
  .motion-ok .jr__item:not(.jr__item--top) .jr__copy { margin-bottom: -0.4vw; }
  .motion-ok .jr__when { font-size: max(0.8125rem, 0.9vw); }
  .motion-ok .jr__h { font-size: max(1.375rem, 2vw); }
  .motion-ok .jr__big { font-size: 4vw; }
  .motion-ok .jr__text { font-size: max(0.9375rem, 1.1vw); max-width: 22vw; }
  .motion-ok .jr__link { font-size: max(0.9375rem, 1vw); }
}

/* ---------- Dotted map (21st 999) ---------- */
.dotmap { position: relative; aspect-ratio: 1400 / 740; }
.dotmap img, .dotmap__arcs { position: absolute; inset: 0; width: 100%; height: 100%; }
.dotmap img { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent); }
.dotmap__arcs path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; }
.motion-ok .dotmap[data-reveal]:not(.is-in) .dotmap__arcs path { stroke-dashoffset: 1; }
.motion-ok .dotmap__arcs path { transition: stroke-dashoffset 1.4s var(--ease-out); transition-delay: calc(300ms + var(--i) * 350ms); }
.dotmap__pin { position: absolute; width: 0; height: 0; }
.dotmap__pin i { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(240, 85, 26, 0.22); }
.dotmap__pin.is-main i { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.motion-ok .dotmap__pin i::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: dm-ping 2.6s var(--ease-out) infinite; animation-delay: calc(var(--i) * 0.45s); }
@keyframes dm-ping { 0% { transform: scale(0.4); opacity: 0.9; } 70%, 100% { transform: scale(2.2); opacity: 0; } }
.dotmap__pin b { position: absolute; left: 12px; top: -30px; white-space: nowrap; font-size: var(--t-xs); font-weight: 600; background: var(--ink); color: var(--on-dark); padding: 4px 9px; border-radius: 999px; }
.dotmap__pin--kl b { left: auto; right: 12px; }

/* Home: reach card */
.reach { display: grid; gap: var(--s-6); background: var(--white); border-radius: var(--r-xl); padding: clamp(1.25rem, 1rem + 2vw, 3rem); box-shadow: var(--sh-card); }
@media (min-width: 900px) { .reach { grid-template-columns: 0.8fr 1.2fr; align-items: center; } }
.reach__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.reach__dot.is-main { box-shadow: 0 0 0 4px rgba(240, 85, 26, 0.2); }
/* Dark variant (home): no card, white dots, light labels */
.section--dark .reach { background: none; box-shadow: none; padding: 0; }
.section--dark .dotmap img { filter: brightness(0) invert(1); opacity: 0.9; }
.section--dark .dotmap__pin b { background: var(--on-dark); color: var(--ink); }
.section--dark .statement__text { color: var(--on-dark); }
.section--dark.spot::before { background: radial-gradient(620px circle at var(--mx, 50%) var(--my, 50%), rgba(240, 85, 26, 0.22), transparent 62%); }

/* ---------- Footer (21st 29773): split columns, contact icons, map and wordmark ---------- */
.footer-split { display: grid; gap: var(--s-7); padding: clamp(2.5rem, 5vw, 4rem) calc(var(--gutter) - var(--inset)) var(--s-6); max-width: var(--max); margin-inline: auto; }
@media (min-width: 900px) { .footer-split { grid-template-columns: 1fr 2.2fr; } }
.footer-split .footer-links { padding: 0; grid-template-columns: repeat(2, 1fr); max-width: none; margin: 0; }
@media (min-width: 700px) { .footer-split .footer-links { grid-template-columns: repeat(4, 1fr); } }
.footer-split .footer-about { grid-column: auto; }
.footer-contact { list-style: none; padding: 0; display: grid; gap: var(--s-3); margin-top: var(--s-5); }
.footer-contact a, .footer-contact > li > span { display: inline-flex; align-items: center; gap: var(--s-3); font-size: var(--t-small); color: var(--on-dark-2); text-decoration: none; transition: color var(--d-fast); }
.footer-contact a:hover { color: var(--on-dark); }
.footer-contact .ia { width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center; background: var(--dark-2); color: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--dark-3); }
.footer-contact .ia svg { width: 16px; height: 16px; }
.footer-mark { position: relative; overflow: hidden; padding-inline: calc(var(--gutter) - var(--inset)); }
.dotmap--footer { position: absolute; inset: 0 0 auto; opacity: 0.32; }
.dotmap--footer img { filter: invert(1); }
.footer-word { position: relative; font-size: clamp(4rem, 19vw, 17rem); font-weight: 700; letter-spacing: -0.06em; line-height: 0.82; text-align: center; color: var(--on-dark); padding: clamp(3rem, 8vw, 7rem) 0 0.12em; white-space: nowrap; }
.footer-word span { color: var(--accent); }
.motion-ok .footer-word { background: linear-gradient(180deg, var(--on-dark) 30%, rgba(245, 242, 238, 0.25)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.motion-ok .footer-word span { -webkit-text-fill-color: var(--accent); }
/* Halftone wordmark (js/motion.js): canvas reprints the word, the text stays for layout only. */
.footer-halftone { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.footer-mark.is-halftone .footer-word, .footer-mark.is-halftone .footer-word span { background: none; color: transparent; -webkit-text-fill-color: transparent; }
/* Home: logo strip sits closer under the photo arc (its lower band is empty). */
.hero--studio + .bench { position: relative; margin-top: calc(clamp(260px, 38vw, 520px) * -0.2); padding-top: calc(var(--section) * 0.3); }
/* Pixel text fill (js/motion.js, after 21st "Pixel Text Fill"): canvas repaints the statement on scroll. */
.statement .container { position: relative; }
.pixel-fill { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.is-pixel-fill { color: transparent !important; }

/* Home: reach — home base row, two region lists, cobe globe with pop-up tags */
.reach__home { display: grid; grid-template-columns: 14px auto; column-gap: var(--s-3); align-items: baseline; margin-top: var(--s-6); }
.reach__home small { grid-column: 2; color: var(--on-dark-2); font-size: var(--t-small); }
.reach__regions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid rgba(245, 242, 238, 0.12); }
.reach__regions h3 { font-size: var(--t-small); font-weight: 600; color: var(--on-dark); margin: 0 0 var(--s-3); }
.reach__regions ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.reach__regions li { color: var(--on-dark-2); font-size: var(--t-small); }
.globe { position: relative; aspect-ratio: 1; width: 100%; max-width: 620px; justify-self: center; user-select: none; }
.globe canvas { width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; cursor: grab; touch-action: pan-y; border-radius: 50%; }
.globe__tag { position: absolute; bottom: anchor(top); left: anchor(center); translate: -50% 0; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; background: var(--ink); color: var(--on-dark); font-size: var(--t-xs); white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); opacity: 0; scale: 0.9; transition: opacity 0.35s, scale 0.35s; }
.globe__tag.is-on { opacity: var(--v); scale: 1; }
.globe__tag.is-main, .globe__tag.is-below { top: anchor(bottom); bottom: auto; margin: 10px 0 0; }
.globe__tag.is-main { background: var(--accent); color: #fff; }
.globe__faces { position: relative; display: flex; margin-left: -4px; }
.globe__faces img { flex: none; max-width: none; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); background: #3a3430; }
.globe__faces img + img { margin-left: -9px; }
.globe__tag.is-main .globe__faces img { border-color: var(--accent); }
.globe__faces::after { content: ""; position: absolute; right: -1px; bottom: 0; width: 7px; height: 7px; border-radius: 50%; background: #3ecf6e; box-shadow: 0 0 0 2px var(--ink); animation: globe-pulse 1.5s ease-in-out infinite; }
.globe__tag.is-main .globe__faces::after { box-shadow: 0 0 0 2px var(--accent); }
.globe__tag b { font-weight: 600; }
.globe__tag > span:last-child { opacity: 0.75; padding-left: 6px; border-left: 1px solid currentColor; }
.globe__tag em { font-style: normal; font-variant-numeric: tabular-nums; font-weight: 600; }
@keyframes globe-pulse { 50% { opacity: 0.4; } }
@supports not (anchor-name: --a) { .globe__tag { display: none; } }
@media (prefers-reduced-motion: reduce) { .globe__faces::after { animation: none; } }
@media (max-width: 600px) { .globe__tag { font-size: 11px; padding: 4px 8px; gap: 5px; } .globe__faces img { width: 20px; height: 20px; } .globe__faces img + img { margin-left: -7px; } }
