/* ============================================================
   Demonstrations page (/work): the animated system diagrams and the
   website-template previews, carried over from the live site's Work page.
   The animation rules below are the original ones (scoped under
   .showcase-svg); only the SVG "label" class is renamed .svl so it can't
   collide with the design system's .label. Loaded on /work only.
   ============================================================ */
.demos {
  /* the original showcase palette, kept so the diagrams look as designed */
  --glow: #A9B8FF; --good: #5FE3A3; --signal: #BD4B3C;
  --text: #F5F5F6; --text-dim: #8C8E94; --dim: #8C8E94; --muted-2: #74747C;
  --line: rgba(255, 255, 255, 0.08); --bg-card: #0E0F11;
}
.showcase-media { display: flex; align-items: center; justify-content: center; padding: 1.6rem; background: #0a0a0c; }
.showcase-card { position: relative; border-radius: 18px; padding: 1.5px; width: 100%; }
.showcase-inner { position: relative; background: var(--bg-card); border-radius: 17px; padding: 20px; box-shadow: 0 30px 60px -30px rgba(0,0,0,0.7); }
.showcase-svg { width: 100%; height: auto; display: block; overflow: visible; }
.showcase-svg .stat-num { font-family: 'Space Grotesk', sans-serif; fill: var(--text); font-weight: 600; }
.showcase-svg .svl { font-size: 9px; fill: var(--text-dim); letter-spacing: 0.06em; }
.showcase-svg .glowdot { filter: drop-shadow(0 0 6px var(--glow)); }
.showcase-svg .seq { animation-duration: 7s; animation-iteration-count: infinite; animation-timing-function: ease; }

/* phone ringing (ambient, independent loop) */
.showcase-svg .ring { transform-origin: 50px 110px; animation: sc-ringpulse 2.6s cubic-bezier(.16,1,.3,1) infinite; }
.showcase-svg .ring2 { animation-delay: .55s; }
@keyframes sc-ringpulse { 0% { stroke-opacity: .65; r: 16; } 100% { stroke-opacity: 0; r: 36; } }

/* main 7s sequence */
.showcase-svg .seg1 { animation-name: sc-seg1; }
@keyframes sc-seg1 { 0%,6% { stroke-dashoffset: 140; } 20%,88% { stroke-dashoffset: 0; } 94%,100% { stroke-dashoffset: 140; } }
.showcase-svg .seg2 { animation-name: sc-seg2; }
@keyframes sc-seg2 { 0%,37% { stroke-dashoffset: 140; } 50%,88% { stroke-dashoffset: 0; } 94%,100% { stroke-dashoffset: 140; } }
.showcase-svg .seg3 { animation-name: sc-seg3; }
@keyframes sc-seg3 { 0%,57% { stroke-dashoffset: 140; } 70%,88% { stroke-dashoffset: 0; } 94%,100% { stroke-dashoffset: 140; } }
.showcase-svg .fi-check { animation-name: sc-fadeCheck; }
@keyframes sc-fadeCheck { 0%,15% { opacity: 0; transform: translateY(4px); } 23%,88% { opacity: 1; transform: translateY(0); } 94%,100% { opacity: 0; transform: translateY(4px); } }
.showcase-svg .fi-card { animation-name: sc-fadeCard; }
@keyframes sc-fadeCard { 0%,47% { opacity: 0; transform: translateY(4px); } 56%,88% { opacity: 1; transform: translateY(0); } 94%,100% { opacity: 0; transform: translateY(4px); } }
.showcase-svg .fi-bell { animation-name: sc-fadeBell; }
@keyframes sc-fadeBell { 0%,66% { opacity: 0; transform: translateY(4px); } 74%,88% { opacity: 1; transform: translateY(0); } 94%,100% { opacity: 0; transform: translateY(4px); } }
.showcase-svg .qualify-stroke { animation-name: sc-qualifyColor; }
@keyframes sc-qualifyColor { 0%,27% { stroke: var(--glow); } 36%,96% { stroke: var(--good); } 100% { stroke: var(--glow); } }
.showcase-svg .bell-shake { animation-name: sc-bellshake; transform-origin: 384px 96px; }
@keyframes sc-bellshake { 0%,69% { transform: rotate(0deg); } 71% { transform: rotate(14deg); } 73% { transform: rotate(-14deg); } 75% { transform: rotate(8deg); } 77%,100% { transform: rotate(0deg); } }
.showcase-svg .bell-ping { animation-name: sc-pingring; }
@keyframes sc-pingring { 0%,70% { opacity: 0; r: 6; } 72% { opacity: .9; r: 6; } 83% { opacity: 0; r: 22; } 100% { opacity: 0; r: 22; } }

/* email automation hub */
.showcase-svg .hub-pulse { transform-origin: 200px 110px; animation: sc-hubpulse 2.8s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes sc-hubpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.showcase-svg .spoke-line { stroke-dasharray: 3 6; opacity: 0.35; }

/* ============================================================
   Services card animations — lifted from service-animations-v4.html.
   Scoped under .showcase-svg; one-shot build sequences gated on .in
   so they play when the card scrolls into view (ambient loops always on).
   ============================================================ */
.showcase-svg .lbl { font-family: 'Inter', 'Inter Fallback', 'Inter Fallback Arial', sans-serif; font-size: 9px; fill: var(--dim); letter-spacing: 0.07em; }
.showcase-svg .val { font-family: 'Space Grotesk', sans-serif; fill: var(--text); font-weight: 600; }
.showcase-svg .note { font-family: 'Inter', 'Inter Fallback', 'Inter Fallback Arial', sans-serif; font-size: 10px; fill: var(--dim); }

/* 01 receptionist — ambient */
.showcase-svg .brain-pulse { transform-origin: 210px 88px; animation: sv-brainbeat 2.2s ease-in-out infinite; }
@keyframes sv-brainbeat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.showcase-svg .call-line { stroke-dasharray: 3 4; opacity: 0.4; }

/* 02 website — build sequence (one-shot, gated) */
.showcase-svg .pg-fade { opacity: 0; animation-duration: .45s; animation-timing-function: cubic-bezier(.16,1,.3,1); animation-fill-mode: forwards; }
.showcase-svg .p0 { animation-delay: .3s; } .showcase-svg .p1 { animation-delay: .9s; } .showcase-svg .p2 { animation-delay: 1.4s; }
.showcase-svg .p3 { animation-delay: 1.8s; } .showcase-svg .p4 { animation-delay: 2.2s; }
.showcase-svg .p-live { opacity: 0; }
.showcase-svg .bld-dot { animation: sv-bpulse 1s ease-in-out infinite; fill: var(--glow); }
@keyframes sv-bpulse { 0%,100% { opacity: .4; } 50% { opacity: 1; } }
.in .showcase-svg .pg-fade { animation-name: sv-pgfade; }
.in .showcase-svg .p-live { animation: sv-pgfade .5s ease 3.8s forwards; }
.in .showcase-svg .p-bld { animation: sv-bldout .3s ease 3.7s forwards; }
@keyframes sv-pgfade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sv-bldout { to { opacity: 0; } }

/* 03 automation — workflow draw (one-shot, gated) */
.showcase-svg .wf-draw { stroke-dasharray: 120; stroke-dashoffset: 120; animation-duration: .6s; animation-timing-function: ease; animation-fill-mode: forwards; }
.showcase-svg .wf-d1 { animation-delay: .3s; } .showcase-svg .wf-d2 { animation-delay: 1.4s; }
.showcase-svg .wf-d3 { animation-delay: 2.5s; } .showcase-svg .wf-d4 { animation-delay: 3.6s; }
.showcase-svg .wf-n { opacity: 0; animation-duration: .4s; animation-timing-function: ease; animation-fill-mode: forwards; }
.showcase-svg .wf-n1 { animation-delay: .2s; } .showcase-svg .wf-n2 { animation-delay: 1.3s; } .showcase-svg .wf-n3 { animation-delay: 2.4s; }
.showcase-svg .wf-n4 { animation-delay: 3.5s; } .showcase-svg .wf-n5 { animation-delay: 4.4s; }
.in .showcase-svg .wf-draw { animation-name: sv-wfdraw; }
.in .showcase-svg .wf-n { animation-name: sv-pgfade; }
@keyframes sv-wfdraw { to { stroke-dashoffset: 0; } }

/* 04 lead gen — rows (one-shot, gated) + blinking status (ambient) */
.showcase-svg .lead-row { opacity: 0; animation-duration: .45s; animation-timing-function: ease; animation-fill-mode: forwards; }
.showcase-svg .lr1 { animation-delay: .4s; } .showcase-svg .lr2 { animation-delay: 1.0s; } .showcase-svg .lr3 { animation-delay: 1.6s; }
.showcase-svg .lr4 { animation-delay: 2.2s; } .showcase-svg .lr5 { animation-delay: 2.8s; }
.in .showcase-svg .lead-row { animation-name: sv-pgfade; }
.showcase-svg .status-blink { animation: sv-sblink 2.8s ease-in-out 3.2s infinite; }
@keyframes sv-sblink { 0%,90% { opacity: 1; } 95% { opacity: .3; } 100% { opacity: 1; } }

/* ---------- layout in the new design ---------- */
.demo { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--nf-space-6) clamp(2.5rem, 6vw, 6rem); align-items: center; padding-block: clamp(3rem, 7vw, 5.5rem); border-top: 1px solid var(--nf-line); }
.demo:first-child { border-top: 0; padding-top: 0; }
.demo--flip .demo-visual { order: 2; }
.demo-visual { min-width: 0; }
.demo-stage { position: relative; aspect-ratio: 16 / 10; border: 1px solid var(--nf-line-2); border-radius: 18px; background: linear-gradient(135deg, #16161a, #08080a); overflow: hidden; box-shadow: 0 50px 90px -60px rgba(0, 0, 0, 0.95); }
.demo-shot { position: absolute; inset: clamp(1rem, 2vw, 1.6rem); display: flex; align-items: center; justify-content: center; opacity: 0; transform: scale(0.97); pointer-events: none; transition: opacity 0.5s var(--nf-ease-out), transform 0.5s var(--nf-ease-out); }
.demo-shot.active { opacity: 1; transform: none; pointer-events: auto; }
.demo-shot svg { width: 100%; height: auto; display: block; }
.demo-visual .showcase-inner { border: 1px solid var(--nf-line-2); border-radius: 18px; padding: clamp(1rem, 2.4vw, 1.6rem); background: var(--bg-card); box-shadow: 0 50px 90px -60px rgba(0, 0, 0, 0.95); }
.demo-copy { display: grid; gap: var(--nf-space-4); align-content: center; }
.demo-copy p.muted { max-width: 46ch; }
.demo-lines { margin: var(--nf-space-2) 0 0; display: grid; gap: var(--nf-space-4); }
.demo-lines > div { display: grid; gap: 0.3rem; padding-left: 1rem; border-left: 1px solid var(--nf-line-2); }
.demo-lines dt { font-size: var(--nf-text-xs); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--nf-smoke); }
.demo-lines dd { margin: 0; font-size: var(--nf-text-sm); color: var(--nf-ash); max-width: 46ch; }
.demo-lines .is-outcome { border-left-color: var(--nf-bone); }
.demo-lines .is-outcome dd { color: var(--nf-bone); }
.demo-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: var(--nf-space-2); }
.demo-tab { padding: 0.5rem 0.95rem; font: inherit; font-size: var(--nf-text-xs); letter-spacing: 0.06em; color: var(--nf-ash); background: transparent; border: 1px solid var(--nf-line-2); border-radius: var(--nf-radius-pill); cursor: pointer; transition: color var(--nf-dur-2), border-color var(--nf-dur-2), background var(--nf-dur-2); }
.demo-tab:hover { color: var(--nf-bone); border-color: var(--nf-smoke); }
.demo-tab.active { color: var(--nf-ink); background: var(--nf-bone); border-color: var(--nf-bone); }
.demo-tab:focus-visible { outline: 2px solid var(--nf-bone); outline-offset: 3px; }
.demo-tags { font-size: var(--nf-text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--nf-smoke); }
.demo-ill { font-size: var(--nf-text-sm); color: var(--nf-smoke); max-width: 46ch; padding-left: 1rem; border-left: 1px solid var(--nf-line-2); }
.demo-ill a { color: var(--nf-bone); }
.demos-disclaimer { padding-top: var(--nf-space-6); border-top: 1px solid var(--nf-line); text-align: center; }
@media (max-width: 900px) {
  .demo { grid-template-columns: minmax(0, 1fr); }
  .demo--flip .demo-visual { order: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .showcase-svg *, .demo-shot { animation: none !important; transition: none !important; }
}
