/* ════════════════════════════════════════════════════════════════════════════
   SERVICES — slide visuals. Each .svc-slide is a 2-column grid:
   left = copy, right = an animated placeholder unique to that service.
   Animations only run while the slide is .is-active so they restart on each
   navigation.
   ════════════════════════════════════════════════════════════════════════════ */

.svc-slide {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 24px;
  padding: clamp(24px, 4vh, 40px) clamp(40px, 6vw, 72px);
}
@media (min-width: 760px) {
  .svc-slide {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    gap: 32px;
  }
}
.svc-slide-copy {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: clamp(10px, 2vh, 20px);
  min-width: 0;
}
.svc-slide-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  min-width: 0;
  height: 100%;
}

/* Make the title slightly smaller to make room for the visual */
.svc-slide-title { font-size: clamp(28px, 4.2vw, 56px); }
.svc-slide-list { padding-top: 14px; }

/* ═══════════════════════════════════════════════════════════════
   1. WEB — browser frame with loading bars + Core Web Vitals dial
   ═══════════════════════════════════════════════════════════════ */
.vis-web {
  width: 100%; max-width: 380px;
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  background: rgba(20, 20, 24, 0.5);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
}
.vis-web-chrome {
  height: 28px;
  padding: 0 12px;
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ash);
}
.vis-tl { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.vis-tl:nth-child(1) { background: #ff605c; opacity: 0.7; }
.vis-tl:nth-child(2) { background: #ffbd44; opacity: 0.7; }
.vis-tl:nth-child(3) { background: #00ca4e; opacity: 0.7; }
.vis-web-url { margin-left: 10px; }
.vis-web-body {
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
.vis-web-line {
  height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  width: 0;
}
.vis-w1 { width: 65%; }
.vis-w2 { width: 90%; }
.vis-w3 { width: 50%; }
.vis-w4 { width: 78%; }
.svc-slide.is-active .vis-web-line {
  animation: webFill 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  width: 0;
}
.svc-slide.is-active .vis-w1 { animation-delay: 0.15s; --target: 65%; }
.svc-slide.is-active .vis-w2 { animation-delay: 0.30s; --target: 90%; }
.svc-slide.is-active .vis-w3 { animation-delay: 0.45s; --target: 50%; }
.svc-slide.is-active .vis-w4 { animation-delay: 0.60s; --target: 78%; }
@keyframes webFill { from { width: 0; } }

.vis-web-cwv {
  position: absolute;
  bottom: 14px; right: 14px;
  width: 80px; height: 80px;
  display: grid; place-items: center;
}
.vis-web-ring { position: absolute; inset: 0; }
.vis-web-arc { stroke-dashoffset: 201; transition: stroke-dashoffset 1.4s cubic-bezier(0.2,0.8,0.2,1); }
.svc-slide.is-active .vis-web-arc { stroke-dashoffset: 8; }
.vis-web-num {
  position: relative;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  line-height: 1;
}
.vis-web-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 400;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   2. RANK — bars climbing positions
   ═══════════════════════════════════════════════════════════════ */
.vis-rank {
  width: 100%; max-width: 360px;
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.vis-rank-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: rgba(20,20,24,0.4);
  color: var(--charcoal);
  opacity: 0;
  transform: translateX(-8px);
}
.svc-slide.is-active .vis-rank-row {
  animation: rankRise 0.55s cubic-bezier(0.2,0.8,0.2,1) forwards;
  animation-delay: calc(var(--row) * 0.08s);
}
@keyframes rankRise {
  to { opacity: 1; transform: translateX(0); }
}
.vis-rank-pos { color: var(--ash); letter-spacing: 0.04em; }
.vis-rank-bar {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,255,255,0.16), rgba(255,255,255,0.04));
  width: 0;
}
.svc-slide.is-active .vis-rank-bar {
  animation: rankBar 1s cubic-bezier(0.2,0.8,0.2,1) forwards;
  animation-delay: calc(var(--row) * 0.08s + 0.2s);
}
@keyframes rankBar {
  to { width: var(--w, 50%); }
}
.vis-rank-you {
  background: linear-gradient(90deg, rgba(255,128,31,0.10), rgba(255,128,31,0.02));
  border-color: rgba(255,128,31,0.4);
  color: var(--ink);
}
.vis-rank-you .vis-rank-pos { color: var(--accent); }
.vis-rank-you .vis-rank-bar {
  background: linear-gradient(90deg, #ff801f, #ffbe5c);
}
.vis-rank-tag {
  background: var(--accent);
  color: #0c0c0e;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   3. GUARD — shield + scanning beam + status tags
   ═══════════════════════════════════════════════════════════════ */
.vis-guard {
  position: relative;
  width: 100%; max-width: 320px; height: 280px;
  display: flex; align-items: center; justify-content: center;
}
.vis-shield { width: 160px; height: auto; }
.vis-shield-glow {
  stroke-dasharray: 80 360;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 8px rgba(255, 128, 31, 0.5));
}
.svc-slide.is-active .vis-shield-glow {
  animation: shieldRun 4s linear infinite;
}
@keyframes shieldRun { to { stroke-dashoffset: -440; } }

.vis-shield-check {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
}
.svc-slide.is-active .vis-shield-check {
  animation: shieldCheck 0.8s cubic-bezier(0.2,0.8,0.2,1) 0.4s forwards;
}
@keyframes shieldCheck { to { stroke-dashoffset: 0; } }

.vis-guard-beam {
  position: absolute;
  top: 0; left: 18%;
  width: 64%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,128,31,0.8), transparent);
  box-shadow: 0 0 16px rgba(255,128,31,0.5);
  opacity: 0;
}
.svc-slide.is-active .vis-guard-beam {
  animation: scanBeam 2.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes scanBeam {
  0%   { top: 4%;  opacity: 0; }
  10%  { opacity: 1; }
  50%  { top: 90%; opacity: 1; }
  60%  { opacity: 0; }
  100% { top: 4%;  opacity: 0; }
}

.vis-guard-tag {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(20,20,24,0.85);
  border: 1px solid var(--hairline-strong);
  color: var(--charcoal);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  backdrop-filter: blur(6px);
}
.vis-guard-tag-1 { top: 14%; left: -4%; color: var(--accent); border-color: rgba(255,128,31,0.3); }
.vis-guard-tag-2 { top: 50%; right: -4%; }
.vis-guard-tag-3 { bottom: 12%; left: 8%; color: var(--live); border-color: rgba(17,255,153,0.3); }
.svc-slide.is-active .vis-guard-tag {
  animation: tagPop 0.5s cubic-bezier(0.2,0.8,0.2,1) forwards;
}
.svc-slide.is-active .vis-guard-tag-1 { animation-delay: 0.5s; }
.svc-slide.is-active .vis-guard-tag-2 { animation-delay: 0.9s; }
.svc-slide.is-active .vis-guard-tag-3 { animation-delay: 1.3s; }
@keyframes tagPop { to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════════════════════════
   4. LINK — globe with animated arcs between regional nodes
   ═══════════════════════════════════════════════════════════════ */
.vis-link {
  position: relative;
  width: 100%; max-width: 320px; aspect-ratio: 1;
}
.vis-globe { width: 100%; height: 100%; display: block; }
.vis-globe .vis-node-g circle { fill: var(--accent); filter: drop-shadow(0 0 4px rgba(255,128,31,0.6)); }
.svc-slide.is-active .vis-globe .vis-node-g circle {
  animation: nodePulse 2.2s ease-in-out infinite;
}
.vis-globe .vis-node-g circle:nth-child(1) { animation-delay: 0s; }
.vis-globe .vis-node-g circle:nth-child(2) { animation-delay: 0.3s; }
.vis-globe .vis-node-g circle:nth-child(3) { animation-delay: 0.6s; }
.vis-globe .vis-node-g circle:nth-child(4) { animation-delay: 0.9s; }
.vis-globe .vis-node-g circle:nth-child(5) { animation-delay: 1.2s; }
.vis-globe .vis-node-g circle:nth-child(6) { animation-delay: 1.5s; }
@keyframes nodePulse {
  0%, 100% { r: 3.5; opacity: 1; }
  50%      { r: 5.5; opacity: 0.6; }
}

.vis-arc {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  filter: drop-shadow(0 0 4px rgba(255,128,31,0.5));
}
.svc-slide.is-active .vis-arc {
  animation: arcDraw 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.svc-slide.is-active .vis-arc-1 { animation-delay: 0.2s; }
.svc-slide.is-active .vis-arc-2 { animation-delay: 1.0s; }
.svc-slide.is-active .vis-arc-3 { animation-delay: 1.8s; }
@keyframes arcDraw {
  0%   { stroke-dashoffset: 200; opacity: 0; }
  20%  { opacity: 1; }
  60%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -200; opacity: 0; }
}

.vis-link-labels { position: absolute; inset: 0; pointer-events: none; }
.vis-link-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--charcoal);
  background: rgba(20,20,24,0.7);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--hairline);
}

/* ═══════════════════════════════════════════════════════════════
   5. AUTO — workflow boxes with packets traveling between them
   ═══════════════════════════════════════════════════════════════ */
.vis-auto {
  position: relative;
  width: 100%; max-width: 380px;
}
.vis-flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.vis-flow-node {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 14px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: rgba(20,20,24,0.5);
  font-family: var(--font-mono);
  font-size: 12px;
}
.vis-flow-k {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}
.vis-flow-v { color: var(--ink); }
.vis-flow-in   { border-color: rgba(91,108,255,0.35); }
.vis-flow-in   .vis-flow-k { color: #5b6cff; }
.vis-flow-out  { border-color: rgba(17,255,153,0.35); }
.vis-flow-out  .vis-flow-k { color: var(--live); }

.vis-flow-link {
  height: 22px;
  position: relative;
  margin: 0 0 0 12px;
}
.vis-flow-link::before {
  content: '';
  position: absolute;
  left: 12px; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--hairline-strong), transparent);
}
.vis-flow-packet {
  position: absolute;
  left: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255,128,31,0.8);
  top: -4px;
  opacity: 0;
}
.svc-slide.is-active .vis-flow-packet {
  animation: packet 3.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes packet {
  0%   { top: -4px; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 22px; opacity: 0; }
}

.vis-auto-pulse {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,128,31,0.08), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* ═══════════════════════════════════════════════════════════════
   6. WRITE — document with lines filling left to right (typing)
   ═══════════════════════════════════════════════════════════════ */
.vis-write {
  width: 100%; max-width: 360px;
}
.vis-write-doc {
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: rgba(20,20,24,0.5);
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.vis-write-meta {
  display: flex; justify-content: space-between;
  font-size: 10px;
  color: var(--ash);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 16px;
}
.vis-write-cursor { animation: blink 1.1s steps(2) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.vis-write-h {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.vis-write-blink { animation: blink 1s steps(2) infinite; color: var(--accent); font-style: normal; }
.vis-write-line {
  height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.12);
  margin-bottom: 8px;
  width: 0;
}
.svc-slide.is-active .vis-write-line {
  animation: writeLine 0.8s cubic-bezier(0.4, 0, 0.6, 1) forwards;
  animation-delay: var(--d);
}
@keyframes writeLine { to { width: var(--w); } }

.vis-write-foot {
  display: flex; justify-content: space-between;
  font-size: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}
.vis-write-foot span:first-child { color: var(--ash); }
.vis-write-ok {
  color: var(--live);
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════════════
   7. BRAND — type specimen with cycling glyph + grid
   ═══════════════════════════════════════════════════════════════ */
.vis-brand {
  width: 100%; max-width: 360px;
}
.vis-brand-spec {
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: rgba(20,20,24,0.5);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}
.vis-brand-big {
  position: relative;
  height: 120px;
}
.vis-brand-glyph {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 130px;
  line-height: 1;
  background: linear-gradient(180deg, var(--ink) 30%, #ff801f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  opacity: 0;
}
.svc-slide.is-active .vis-brand-glyph {
  animation: brandCycle 6s steps(1) infinite;
}
.svc-slide.is-active .vis-brand-glyph:nth-child(1) { animation-delay: 0s; }
.svc-slide.is-active .vis-brand-glyph:nth-child(2) { animation-delay: 1.5s; }
.svc-slide.is-active .vis-brand-glyph:nth-child(3) { animation-delay: 3.0s; }
.svc-slide.is-active .vis-brand-glyph:nth-child(4) { animation-delay: 4.5s; }
@keyframes brandCycle {
  0%   { opacity: 0; transform: translateY(8px); }
  3%   { opacity: 1; transform: translateY(0); }
  22%  { opacity: 1; transform: translateY(0); }
  25%  { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 0; }
}

.vis-brand-grid {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--charcoal);
  text-align: center;
}
.vis-brand-grid span {
  padding: 4px 0;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  transition: color .25s, background .25s;
}
.svc-slide.is-active .vis-brand-grid span {
  animation: brandShimmer 4s ease-in-out infinite;
}
.svc-slide.is-active .vis-brand-grid span:nth-child(odd) { animation-delay: 0.5s; }
@keyframes brandShimmer {
  0%, 100% { color: var(--charcoal); background: rgba(255,255,255,0.02); }
  50%      { color: var(--accent); background: rgba(255,128,31,0.06); }
}

.vis-brand-meta {
  display: flex; justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ash);
}
