/* Live cursors overlay (see assets/js/cursors.js). Uses the site's tokens from main.css. */

.cx-layer { position: fixed; inset: 0; z-index: 420; pointer-events: none; overflow: hidden; }
.cx-swarm { position: absolute; inset: 0; transition: opacity 400ms; }
.cx-bots-off .cx-swarm { opacity: 0; }

.cx-cur { position: absolute; left: 0; top: 0; will-change: transform; transition: opacity 300ms var(--ease); }
.cx-cur svg { display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); transition: scale 120ms var(--ease); }
.cx-cur.is-down svg { scale: 0.82; }
.cx-tag {
  position: absolute; left: 14px; top: 16px; display: flex; align-items: center; white-space: nowrap;
  font: 500 11px/1 var(--font-sans); color: #0a0a0b; opacity: .85;
  padding: 4px 6px; border-radius: 3px 999px 999px 999px;
  transition: opacity 200ms, padding 300ms var(--ease);
}
.cx-tag b { font-weight: 600; }
.cx-full { display: inline-block; max-width: 0; overflow: hidden; vertical-align: bottom; transition: max-width 350ms var(--ease); }
.cx-cur.is-named .cx-tag { opacity: 1; padding: 4px 8px; }
.cx-cur.is-named .cx-full { max-width: 130px; }
.cx-bots-off .cx-cur, .cx-bots-off .cx-sel:not(.cx-user) { opacity: 0; }

.cx-you { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity 200ms; will-change: transform; }
.cx-you.is-on { opacity: 1; }

.cx-sel {
  position: absolute; left: 0; top: 0; border: 1.5px solid var(--sc);
  opacity: 0; transition: opacity 200ms; will-change: transform, width, height;
}
.cx-sel.is-on { opacity: 1; }
.cx-sel.is-drawing { background: color-mix(in srgb, var(--sc) 8%, transparent); }
.cx-sel i { position: absolute; width: 8px; height: 8px; background: #fff; border: 1.5px solid var(--sc); }
.cx-sel i:nth-child(1) { left: -5px; top: -5px; }
.cx-sel i:nth-child(2) { right: -5px; top: -5px; }
.cx-sel i:nth-child(3) { left: -5px; bottom: -5px; }
.cx-sel i:nth-child(4) { right: -5px; bottom: -5px; }
.cx-dim {
  position: absolute; left: 50%; top: 100%; margin-top: 8px; translate: -50% 0; white-space: nowrap;
  background: var(--sc); color: #0a0a0b; font: 500 10.5px/1 var(--font-mono);
  padding: 4px 6px; border-radius: 4px; font-variant-numeric: tabular-nums;
}
.cx-sel.is-drawing .cx-dim { left: 100%; translate: -100% 0; }

.cx-ring {
  position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%;
  border: 2px solid var(--rc); animation: cx-ring 500ms ease-out forwards;
}
@keyframes cx-ring { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* Elements while a cursor (or you) is restyling them */
.cx-anim {
  transition: rotate 500ms var(--ease), scale 500ms var(--ease), translate 500ms var(--ease),
              color 400ms ease, background-color 400ms ease, transform 160ms linear, box-shadow 300ms var(--ease) !important;
}
.cx-anim.cx-dragging { transition: color 400ms ease, background-color 400ms ease, transform 160ms linear !important; }
.hero-role.cx-typing .hero-phrase::after {
  content: ""; display: inline-block; width: 2px; height: 0.9em; margin-left: 3px;
  background: var(--cx-caret, currentColor); vertical-align: -0.08em; animation: cx-blink 800ms steps(1) infinite;
}
@keyframes cx-blink { 50% { opacity: 0; } }

/* Edit mode */
.cx-editing [data-cx-name] { cursor: move; }
.cx-editing [data-cx-name]:hover { outline: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 3px; }
.cx-editing a, .cx-editing button { cursor: default; }
.cx-editing .cx-bar button, .cx-editing .cx-insp button { cursor: pointer; }

.cx-insp {
  position: fixed; left: 0; top: 0; z-index: 430; width: 232px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); font: 13px/1.4 var(--font-sans);
}
.cx-insp[hidden] { display: none; }
.cx-insp-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font: 500 12px var(--font-mono); color: #b63b24; }
.cx-x { background: none; border: 0; color: var(--text-muted); font-size: 18px; line-height: 1; padding: 0 4px; }
.cx-row { display: grid; grid-template-columns: 50px 1fr 36px; align-items: center; gap: 8px; margin: 8px 0; color: var(--text-muted); }
.cx-row[hidden] { display: none; }
.cx-row.cx-row-sw { grid-template-columns: 50px 1fr; }
.cx-sw { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-sw button { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); padding: 0; }
.cx-sw button:hover { box-shadow: 0 0 0 2px var(--text); }
.cx-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.cx-row output { font: 11px var(--font-mono); text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.cx-reset, .cx-bar button {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 12px; font: 500 12.5px var(--font-sans);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.cx-reset { width: 100%; border-radius: var(--r-sm); margin-top: 4px; }
.cx-reset:hover, .cx-bar button:hover { border-color: var(--border-strong); }
.cx-bar button[aria-pressed="true"] { background: var(--maroon); color: var(--cream); border-color: transparent; }

.cx-bar {
  position: fixed; left: 50%; bottom: 16px; translate: -50% 0; z-index: 140; color: var(--ink);
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px;
  background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong); border-radius: 999px; box-shadow: var(--shadow);
  font: 12.5px var(--font-sans); color: var(--text-muted); white-space: nowrap;
}
.cx-bar [hidden] { display: none; }
.cx-dots { display: flex; }
.cx-dots b, .cx-dots button {
  width: 20px; height: 20px; margin-left: -4px; padding: 0; border-radius: 50%; border: 2px solid var(--bg);
  font: 600 9.5px/16px var(--font-sans); color: #0a0a0b; text-align: center;
}
.cx-dots > :first-child { margin-left: 0; }
.cx-dots .cx-dot-you { background: #e2553a; color: #fff; }
.cx-dots .cx-dot-more { background: var(--ink); color: var(--cream); width: 26px; border-radius: 999px; }
.cx-count { font-variant-numeric: tabular-nums; }
.cx-hint { display: none; }
.cx-editing .cx-hint { display: inline; }

@media (max-width: 900px) { .cx-editing .cx-hint { display: none; } }
@media (max-width: 719px) { .cx-bar, .cx-insp, .cx-cur, .cx-sel, .cx-you { display: none !important; } }
@media print { .cx-layer, .cx-bar, .cx-insp { display: none !important; } }

/* ── Speech bubbles (cursors and you) ───────────────────────────────────── */
.cx-say {
  position: absolute; left: 15px; top: 40px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 7px 11px; border-radius: 4px 14px 14px 14px; background: var(--bc, #fff); color: #1e060e;
  font: 500 12.5px/1.2 var(--font-sans); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5);
  opacity: 0; scale: .7; transform-origin: 0 0; transition: opacity 200ms, scale 260ms var(--ease);
}
.cx-say.is-on { opacity: 1; scale: 1; }
.cx-you .cx-say-you { --bc: #e2553a; color: #fff; left: 14px; top: 22px; }

/* ── Scribbles: hand-drawn underline / circle ───────────────────────────── */
.cx-mark { position: absolute; left: 0; top: 0; overflow: visible; transition: opacity 400ms; }
.cx-mark path { fill: none; stroke-width: 3.2; stroke-linecap: round; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: cx-draw 520ms var(--ease) forwards; }
.cx-mark.is-out { opacity: 0; }
@keyframes cx-draw { to { stroke-dashoffset: 0; } }

/* ── Comment pins ───────────────────────────────────────────────────────── */
.cx-pin { position: absolute; left: 0; top: 0; display: flex; align-items: flex-start; gap: 6px; opacity: 0; transition: opacity 250ms; }
.cx-pin.is-on { opacity: 1; }
.cx-pin b {
  flex: none; width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; background: var(--pc); color: #1e060e;
  display: grid; place-items: center; font: 600 12px var(--font-sans); border: 2px solid #fff; box-shadow: 0 8px 18px -8px rgba(0,0,0,.5);
  scale: 0; transition: scale 300ms var(--ease);
}
.cx-pin.is-on b { scale: 1; }
.cx-pin span {
  max-width: 200px; padding: 8px 11px; border-radius: 4px 12px 12px 12px; background: #fff; color: #2a0f18;
  font: 12.5px/1.35 var(--font-sans); box-shadow: 0 12px 28px -12px rgba(0,0,0,.45);
  translate: -6px 0; opacity: 0; transition: opacity 250ms 120ms, translate 300ms var(--ease) 120ms;
}
.cx-pin span strong { font-weight: 600; margin-right: 4px; }
.cx-pin.is-on span { translate: 0 0; opacity: 1; }

/* ── Cursor chat input ──────────────────────────────────────────────────── */
.cx-chat { position: fixed; left: 0; top: 0; z-index: 440; }
.cx-chat[hidden] { display: none; }
.cx-chat input {
  width: 220px; padding: 9px 13px; border: 0; border-radius: 4px 16px 16px 16px; background: #e2553a; color: #fff;
  font: 500 13px var(--font-sans); box-shadow: 0 14px 30px -12px rgba(0,0,0,.5); outline: none;
}
.cx-chat input::placeholder { color: rgba(255,255,255,.75); }
.cx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cx-tip { color: var(--text-muted); }
.cx-tip kbd { font: 500 11px var(--font-mono); padding: 1px 6px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--paper); color: var(--ink); }
.cx-editing .cx-tip { display: none; }

/* ── Toys: draggable stickers and chips ─────────────────────────────────── */
.cx-toy { cursor: grab; touch-action: none; transition: transform 650ms cubic-bezier(.34, 1.56, .64, 1); }
.cx-toy.is-held { cursor: grabbing; transition: none; z-index: 5; scale: 1.08; }

/* Magnetic buttons ease back when released */
.btn, .icon-btn { transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 220ms var(--ease); }

/* Easter egg wobble */
.cx-wobble { animation: cx-wobble 900ms var(--ease); }
@keyframes cx-wobble {
  20% { transform: rotate(-12deg) scale(1.15); } 40% { transform: rotate(8deg) scale(1.1); }
  60% { transform: rotate(-6deg) scale(1.05); } 80% { transform: rotate(3deg); } 100% { transform: rotate(-4deg); }
}
@media (max-width: 900px) { .cx-tip { display: none; } }

/* Bar letters call their cursor over */
.cx-dots button { transition: translate 250ms var(--spring), scale 250ms var(--spring); }
.cx-dots button:hover { translate: 0 -5px; scale: 1.2; position: relative; z-index: 1; }
.cx-bar .cx-count { background: none; border: 0; padding: 4px 6px; color: var(--text-muted); text-decoration: underline dotted; text-underline-offset: 3px; }
.cx-bar .cx-count:hover { color: var(--ink); }

/* Floating reactions */
.cx-react {
  position: absolute; font: 700 22px/1 var(--font-sans); color: var(--rc);
  text-shadow: 0 2px 0 rgba(30, 6, 14, .6), 0 0 12px rgba(255,255,255,.25);
  animation: cx-float 1.4s var(--ease) forwards;
}
@keyframes cx-float {
  0% { opacity: 0; transform: translate(0, 0) scale(.4); }
  15% { opacity: 1; transform: translate(calc(var(--dx) * .2), -14px) scale(1.15); }
  100% { opacity: 0; transform: translate(var(--dx), -110px) scale(.9); }
}

/* Draw mode */
.cx-ink { position: fixed; inset: 0; z-index: 410; pointer-events: none; touch-action: none; }
.cx-ink.is-on { pointer-events: auto; cursor: crosshair; }
.cx-bar .cx-draw[aria-pressed="true"] { background: #e2553a; color: #fff; border-color: transparent; }

/* "hire" easter egg */
.cx-pulse { animation: cx-pulse 1s var(--ease) 3; }
@keyframes cx-pulse { 50% { box-shadow: 0 0 0 10px rgba(255, 180, 155, .35); scale: 1.06; } }

/* Agents: no name tags on the cursors; names live in the build log */
.cx-cur .cx-tag { display: none; }
.cx-log {
  display: inline-flex; align-items: center; gap: 6px; max-width: 300px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font: 12px var(--font-mono); color: var(--text-muted);
  padding-left: 10px; border-left: 1px solid var(--border-strong);
}
.cx-log i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #3ccf7f; }
.cx-log b { font-weight: 500; color: var(--ink); }
.cx-log.is-new { animation: cx-log-in 300ms var(--ease); }
@keyframes cx-log-in { from { opacity: 0; } }
@media (max-width: 1180px) { .cx-tip { display: none; } }
@media (max-width: 1000px) { .cx-log { max-width: 180px; } }

/* Resting agents gather in one flock and fade back */
.cx-cur.is-resting { opacity: .85; }
.cx-cur.is-resting svg { scale: .85; }

/* Bar: plain mini cursors instead of letters */
.cx-dots button { width: 20px; height: 22px; margin-left: 0; border: 0; border-radius: 6px; background: transparent; display: grid; place-items: center; }
.cx-dots button:hover { background: rgba(42, 15, 24, .08); }
.cx-dots { gap: 1px; }
.cx-log svg { flex: none; }
.cx-pin b { background: #fff; }
.cx-pin span { padding-left: 11px; }

/* Agents dock in their bar slot when resting; an empty slot means that agent is out working */
.cx-cur.is-docked { opacity: 0; transition: opacity 160ms; }
.cx-dots button svg { transition: opacity 250ms, scale 300ms var(--spring); }
.cx-dots button.is-out svg { opacity: .22; scale: .8; }

/* Keep the bar perfectly still: fixed-width log, no layout shifts as text changes */
.cx-log { width: 250px; max-width: none; flex: none; }
.cx-log, .cx-log * { white-space: nowrap; }
.cx-log { text-overflow: ellipsis; }
.cx-bar .cx-count { flex: none; }
.cx-dots { flex: none; }
.cx-bar .cx-draw { width: 104px; }
.cx-bar .cx-edit { width: 112px; }
.cx-bar .cx-toggle { width: 116px; }
.cx-bar .cx-draw, .cx-bar .cx-edit, .cx-bar .cx-toggle { flex: none; text-align: center; padding-inline: 0; }
@media (max-width: 1000px) { .cx-log { width: 170px; } }

/* While drawing, the bar sits above the ink layer so Stop drawing stays clickable */
.cx-drawing .cx-bar { z-index: 415; }

/* Edit-mode extras keep their space so the bar never shifts */
.cx-bar .cx-reset-all { width: 64px; flex: none; padding-inline: 0; }
.cx-bar .cx-reset-all.is-off { visibility: hidden; }
.cx-tip, .cx-hint { width: 250px; flex: none; overflow: hidden; text-overflow: ellipsis; }
.cx-editing .cx-hint { display: inline-block; }
@media (max-width: 1180px) { .cx-tip, .cx-hint, .cx-editing .cx-hint { display: none; } }
@media (max-width: 980px) { .cx-log { display: none; } }
.cx-bar .cx-count { display: none; } /* label text removed; the mini cursors still gather/call */

/* An agent holding the page while it slides it */
.cx-cur.is-grab svg { scale: .82; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }

/* ── Agent restructures (temporary layout variants, reverted after a few seconds) ── */
::view-transition-group(*) { animation-duration: 650ms; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 450ms; }
.cx-vt .cx-layer { view-transition-name: cx-overlay; }

/* Hero mirrored: photo panel on the left with the torn edge on the right */
.cx-v-hero-mirror .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.cx-v-hero-mirror .hero-panel { order: -1; clip-path: polygon(0 0, 97.5% 0, 98.2% 8%, 96% 16%, 99% 25%, 96.5% 34%, 98.6% 43%, 95.5% 52%, 98.8% 61%, 96.2% 70%, 99.2% 79%, 96.8% 88%, 98% 100%, 0 100%); padding: 56px 72px 56px 48px; }
.cx-v-hero-mirror .hero-copy { padding-left: clamp(24px, 5vw, 64px); }

/* Work: demo and text swap sides */

/* Toolbox as a tidy grid with the info card first */
.cx-v-tools-grid .tool-board { grid-template-columns: 300px minmax(0, 1fr); }
.cx-v-tools-grid .tool-info { order: -1; }
.cx-v-tools-grid .tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cx-v-tools-grid .tool { width: 100%; border-radius: 10px; text-align: left; }

/* Journey slider wrapped into a grid */
.cx-v-journey-grid .journey-track { flex-wrap: wrap; overflow: visible; justify-content: center; }
.cx-v-journey-grid .jcard { flex: 0 0 min(300px, 30%); rotate: 0deg; min-height: 0; }

/* Contact columns swapped */
.cx-v-contact-flip .contact-copy { order: 2; }

/* Site-wide passes */
.cx-v-theme-navy { --maroon: #14284a; --maroon-2: #1b345e; --maroon-3: #24467a; --coral: #2f7df6; --peach: #9cc6ff; --cream: #eef3f9; --cream-2: #e3ebf5; --paper: #ffffff; --ink: #0f1b2e; }
.cx-v-theme-navy .hero-panel { background: radial-gradient(60% 50% at 70% 30%, rgba(156, 198, 255, .45), transparent 70%), linear-gradient(160deg, #3d8bff, #1f5fd6 55%, #173f99); }
.cx-v-theme-navy body, .cx-v-theme-navy .hero, .cx-v-theme-navy .cream, .cx-v-theme-navy .mobile-menu { background: var(--cream); }
.cx-v-theme-navy .site-header { --nav-bg: rgba(238, 243, 249, .86); }
.cx-v-sharp { --r-sm: 0px; --r: 2px; --r-lg: 4px; }
.cx-v-sharp .btn, .cx-v-sharp .tags li, .cx-v-sharp .tool, .cx-v-sharp .badge, .cx-v-sharp .topics button, .cx-v-sharp .tool-filters button, .cx-v-sharp .work-dots button { border-radius: 3px; }
.cx-v-sharp .deck-photo, .cx-v-sharp .roll-card, .cx-v-sharp .phone, .cx-v-sharp .phone-screen { border-radius: 4px; }
.cx-v-type-sans .hero-title, .cx-v-type-sans .section-title, .cx-v-type-sans .slide-title, .cx-v-type-sans .contact-title, .cx-v-type-sans .jcard-year, .cx-v-type-sans .fact-front b, .cx-v-type-sans .tool-info-name {
  font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.04em;
}
.cx-v-type-sans .hero-title { font-size: clamp(3.4rem, 8vw, 7rem); }
.cx-v-tight { --section-y: 56px; }
.cx-v-tight .section-head { margin-bottom: 24px; }

/* Smooth fallback when View Transitions aren't available */
.hero-panel, .section { transition: padding 500ms var(--ease), background-color 500ms var(--ease); }

/* Back to top: blocks being deleted by agents */
.cx-del { position: absolute; left: 0; top: 0; border: 2px solid #e2553a; background: rgba(226, 85, 58, .10); border-radius: 6px; animation: cx-del 650ms var(--ease) forwards; }
.cx-del span { position: absolute; left: -2px; top: -22px; background: #e2553a; color: #fff; font: 600 10.5px/1 var(--font-mono); padding: 4px 6px; border-radius: 4px 4px 0 0; }
@keyframes cx-del { 0% { opacity: 0; scale: 1.04; } 25% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: .9; } }
.cx-deleting { opacity: 0 !important; transform: scale(.94) !important; filter: blur(2px); transition: opacity 420ms var(--ease), transform 420ms var(--ease), filter 420ms !important; }

/* Opening timelapse: hero parts wait until an agent places them */
.hero-seq .hero-panel { transition: opacity 700ms var(--ease), transform 900ms var(--ease); }
.hero-seq .hero-panel:not(.is-in) { opacity: 0; transform: translateX(5%); }
.hero-seq .ltr { transition: transform 500ms var(--spring), opacity 250ms; }
.hero-seq .ltr:not(.is-in) { opacity: 0; transform: translateY(.35em) scale(.5); }
.hero-seq .hero-actions .btn { transition: opacity 250ms, scale 450ms var(--spring), transform 220ms var(--ease); }
.hero-seq .hero-actions .btn:not(.is-in) { opacity: 0; scale: .6; }
.hero-seq .deck-photo { transition: transform 650ms var(--spring), opacity 300ms, translate 650ms var(--spring), rotate 650ms var(--spring); }
.hero-seq .deck-photo:not(.is-in) { opacity: 0; translate: 180px -50px; rotate: 22deg; }
.hero-seq .sticker { transition: opacity 250ms, scale 500ms var(--spring); }
.hero-seq .sticker:not(.is-in) { opacity: 0; scale: .2; }
.hero-seq .hero-vertical { transition: opacity 400ms; }
.hero-seq .hero-vertical:not(.is-in) { opacity: 0; }

/* Smart guides: magenta lines flash along a frame when it snaps into place */
.cx-guide { position: absolute; display: block; background: #ff2fd6; box-shadow: 0 0 6px rgba(255, 47, 214, .55); pointer-events: none; animation: cx-guide 600ms ease-out forwards; }
@keyframes cx-guide { 0% { opacity: 0; } 15% { opacity: .9; } 100% { opacity: 0; } }
.cx-bar .cx-sound { flex: none; width: 96px; text-align: center; padding-inline: 0; }
.cx-bar .cx-sound[aria-pressed="true"] { background: transparent; color: inherit; border-color: var(--border-strong); }
@media (max-width: 860px) { .cx-bar .cx-sound { display: none; } }
@media (prefers-reduced-motion: reduce) { .cx-guide { animation: none; opacity: 0; } }
