/* =========================================================
   SERVICES — stacking cards with live, interactive visuals
   ========================================================= */
.svc-head { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.svc-head > div { display: flex; flex-direction: column; gap: 18px; }

.svc { min-height: 540px; overflow: hidden; }
.svc::before { content: ""; position: absolute; left: 44px; right: 44px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, var(--sc), transparent); }
.svc .s-text { position: relative; z-index: 1; }
.s-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.svc .s-num { color: var(--sc2); }
.s-proof { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--sc) 12%, #fff); color: var(--sc2); font-size: 12px; }
.svc .s-list li::before { color: var(--sc2); }
.s-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; font-weight: 700; font-size: 15px; color: var(--sc2); text-decoration: none; border-bottom: 1.5px solid currentColor; transition: gap .3s var(--ease); }
.s-link:hover { color: var(--ink); gap: 12px; }
.s-hint { color: var(--muted); }
.s-ghost {
  position: absolute; right: -6px; bottom: -96px; z-index: -1; pointer-events: none;
  font-family: var(--f-display); font-weight: 900; font-variation-settings: "wdth" 70; font-size: 11rem; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--sc) 22%, transparent);
}
.svc .s-visual { min-height: 440px; }

/* ---------- 01 · code → screen ---------- */
.sv-build { background: radial-gradient(80% 80% at 100% 100%, rgba(26,188,165,.35), transparent 60%), var(--ink); display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 20px; align-items: center; padding: 24px; }
.sb-editor { border-radius: 16px; background: #15151B; border: 1px solid var(--line-d); overflow: hidden; min-width: 0; }
.sb-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line-d); }
.sb-tab { min-height: 36px; padding: 7px 13px; border-radius: 9px; border: 0; background: transparent; color: var(--muted-d); font-family: var(--f-mono); font-size: 12.5px; cursor: pointer; transition: background-color .25s ease, color .25s ease; }
.sb-tab:hover { color: var(--paper); }
.sb-tab.is-on { background: #24242E; color: var(--paper); box-shadow: inset 0 -2px 0 #1ABCA5; }
.sb-tab:focus-visible { outline: 2px solid #7CF2D8; outline-offset: 1px; }
.sb-pre { margin: 0; padding: 16px 16px 18px; min-height: 196px; font-family: var(--f-mono); font-size: 12.5px; line-height: 1.8; color: #E6E6EE; overflow-x: auto; }
.sb-code .ln { display: block; white-space: pre; }
.sb-code .ln i { display: inline-block; width: 26px; font-style: normal; color: #4B4B57; user-select: none; }
.is-typing .sb-code .ln { animation: lnType .35s var(--ease) backwards; animation-delay: calc(var(--n) * 110ms); }
@keyframes lnType { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.sb-code .c { color: #6E6E7D; font-style: italic; } .sb-code .t { color: #7CF2D8; }
.sb-status { display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; overflow: hidden; padding: 9px 14px; border-top: 1px solid var(--line-d); font-size: 11.5px; color: var(--muted-d); }
.sb-state { color: #FFD166; }
.is-built .sb-state { color: #4ADE80; }
.sb-phone { width: 150px; aspect-ratio: 720 / 1561; padding: 5px; border-radius: 26px; background: #1D1D24; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.18), 0 30px 50px -20px rgba(0,0,0,.7), 0 0 60px -10px rgba(26,188,165,.5); }
.sb-screen { position: relative; width: 100%; height: 100%; border-radius: 21px; overflow: hidden; background: #FAF7F2; }
.sb-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transform: scale(1.06); transition: opacity .5s ease, transform .8s var(--ease); }
.sb-screen img.is-on { opacity: 1; transform: none; }
.sb-build { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(11,11,15,.5); backdrop-filter: blur(3px); opacity: 0; transition: opacity .35s ease; }
.sb-build span { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin360 .8s linear infinite; }
.is-typing .sb-build { opacity: 1; }
@keyframes spin360 { to { transform: rotate(360deg); } }

/* ---------- 02 · wireframe ↔ shipped ---------- */
.sv-compare { display: flex; align-items: center; justify-content: center; padding: 22px; background: radial-gradient(70% 70% at 50% 50%, #DCE1FF, #EEF0FF 70%); }
.cmp-frame { --pos: 50%; position: relative; height: 410px; aspect-ratio: 720 / 1561; border-radius: 30px; overflow: hidden; border: 6px solid #15151B; background: #fff; box-shadow: 0 30px 60px -24px rgba(27,47,181,.45); touch-action: pan-y; }
.cmp-real { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cmp-wire {
  position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0);
  background-color: #FAFBFF;
  background-image: linear-gradient(rgba(47,75,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(47,75,255,.07) 1px, transparent 1px);
  background-size: 10px 10px;
}
.cmp-wire i { position: absolute; background: #E4E7F3; border-radius: 4px; }
.cmp-wire i.cmp-img {
  background:
    linear-gradient(to top right, transparent calc(50% - .8px), #C5CBE6 calc(50% - .8px), #C5CBE6 calc(50% + .8px), transparent calc(50% + .8px)),
    linear-gradient(to top left, transparent calc(50% - .8px), #C5CBE6 calc(50% - .8px), #C5CBE6 calc(50% + .8px), transparent calc(50% + .8px)),
    #EEF0F8;
  border: 1px solid #D3D8EE;
}
.cmp-wire b { position: absolute; width: 9%; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid #C5CBE6; background: #fff; }
.cmp-wire b.ring { width: 15%; border-width: 3px; border-color: #C9CEE8; background: transparent; }
.cmp-note { position: absolute; font-size: 8.5px; color: #2F4BFF; background: #fff; padding: 2px 5px; border-radius: 4px; border: 1px solid rgba(47,75,255,.3); white-space: nowrap; }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #2F4BFF; box-shadow: 0 0 12px rgba(47,75,255,.6); pointer-events: none; }
.cmp-knob { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #2F4BFF; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(27,47,181,.45); }
.is-sweep .cmp-line { transition: left .8s var(--ease); }
.is-sweep .cmp-wire { transition: clip-path .8s var(--ease); }
.cmp-tag { position: absolute; top: 12px; z-index: 2; padding: 4px 8px; border-radius: 6px; font-size: 10.5px; background: rgba(11,11,15,.78); color: #fff; pointer-events: none; }
.cmp-tag-l { left: 10px; } .cmp-tag-r { right: 10px; background: #2F4BFF; }
.cmp-range { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cmp-frame:has(.cmp-range:focus-visible) { outline: 3px solid #2F4BFF; outline-offset: 4px; }

/* ---------- 03 · runnable workflow ---------- */
.sv-flow { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 24px; background: radial-gradient(80% 80% at 50% 40%, #FFF1C4, #FFF8E4 70%); }
.fl-stage { position: relative; width: 100%; aspect-ratio: 400 / 260; }
.fl-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fl-wires path { fill: none; stroke: rgba(156,106,0,.35); stroke-width: 2; stroke-dasharray: 5 6; animation: dash 1.4s linear infinite; }
.fl-pk { fill: #FF8A3D; opacity: 0; filter: drop-shadow(0 0 6px #FF8A3D); }
.fl-pk.is-on { opacity: 1; }
.fl-node {
  position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; padding: 11px 15px; border-radius: 14px;
  background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; white-space: nowrap; border: 2px solid transparent;
  box-shadow: 0 12px 26px -14px rgba(11,11,15,.35); transition: border-color .3s ease, box-shadow .3s ease, transform .4s var(--ease);
}
.fl-node.is-lit { border-color: var(--sc); box-shadow: 0 0 0 5px color-mix(in srgb, var(--sc) 22%, transparent), 0 12px 26px -14px rgba(11,11,15,.35); transform: translate(-50%, -50%) scale(1.06); }
.fl-llm { background: var(--ink); color: var(--paper); flex-wrap: wrap; justify-content: center; }
.fl-llm small { width: 100%; text-align: center; font-size: 10.5px; color: var(--muted-d); font-weight: 400; }
.fl-llm.is-think { animation: think .7s ease-in-out infinite alternate; }
@keyframes think { to { box-shadow: 0 0 0 10px color-mix(in srgb, var(--sc) 30%, transparent), 0 0 40px color-mix(in srgb, var(--sc) 60%, transparent); } }
.fl-out { position: absolute; right: 2%; top: 74%; padding: 6px 11px; border-radius: 999px; background: #16A34A; color: #fff; font-size: 11.5px; opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .5s var(--ease); }
.is-done .fl-out { opacity: 1; transform: none; }
.fl-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.fl-log { color: #6B5200; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .svc .s-visual { min-height: 0; }
  /* cards are taller than the screen here, so stacking would hide their visuals — scroll them normally */
  .svc { position: relative; top: auto; }
  .s-ghost { display: none; }
}
@media (max-width: 760px) {
  .svc { min-height: 0; }
  .svc::before { left: 26px; right: 26px; }
  .s-ghost { font-size: 7rem; bottom: -40px; }
  .sv-build { grid-template-columns: 1fr; padding: 16px; }
  .sb-phone { justify-self: center; width: 130px; }
  .cmp-frame { height: 360px; }
  .fl-node { padding: 8px 10px; font-size: 12px; gap: 6px; }
  .fl-node svg { width: 14px; height: 14px; }
  .sv-flow { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .sb-build span { animation: none; }
}
