/* ==========================================================
   Shared building blocks for the service pages
   Animated parts start when their block gets .is-on (see [data-animate] in main.js)
   ========================================================== */

/* ---------- Page hero ---------- */

.svc-hero {
  padding: calc(var(--nav-h) + 64px) 0 72px;
}
.svc-hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.svc-hero__inner > * { min-width: 0; }
.svc-hero h1 {
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 700;
  margin-bottom: 22px;
}
.svc-lead {
  max-width: 540px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 19px);
}

.back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color .2s ease;
}
.back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.back:hover { color: var(--text); }
.back:hover svg { transform: translateX(-3px); }

/* ---------- Section intro ---------- */

.svc-intro { max-width: 680px; margin-bottom: 48px; }
.svc-intro p:not(.section__label) { color: var(--muted); font-size: 18px; }

/* Text on one side, a visual on the other */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.split > * { min-width: 0; }
.split--flip > :first-child { order: 2; }
.split h2 { margin-bottom: 18px; }
/* only the text column's own paragraphs, not labels or text inside the mock-ups */
.split > * > p:not(.section__label) { color: var(--muted); font-size: 17px; margin-bottom: 16px; }

/* Simple checklist */
.ticks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 32px; font-size: 16px; }
.ticks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--label-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2383FD80' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 13px no-repeat;
}
[data-theme="light"] .ticks li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304122B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E");
}

/* Small pills, for "good for" lists */
.pills-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pills-row span {
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 14px;
}

/* ---------- Comparison bars ---------- */

.meters { display: grid; gap: 18px; }
.meter { display: grid; gap: 8px; }
.meter__head { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.meter__head b { color: var(--text); font-weight: 600; }
.meter__bar { height: 10px; border-radius: 999px; background: var(--sk); overflow: hidden; }
.meter__bar i {
  display: block;
  height: 100%;
  width: calc(var(--v) * 100%);
  border-radius: inherit;
  background: var(--jade);
  box-shadow: 0 0 12px rgba(131, 253, 128, .5);
  transform: scaleX(0);
  transform-origin: left;
}
.meter--alt .meter__bar i { background: var(--ocean); box-shadow: 0 0 12px rgba(0, 211, 251, .45); }
.is-on .meter__bar i { animation: bar-grow 1.2s cubic-bezier(.3, .7, .3, 1) var(--t, 0s) forwards; }
@keyframes bar-grow { to { transform: none; } }

/* ---------- Flow diagram: steps joined by a travelling pulse ---------- */

.flow-line {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  gap: 14px;
}
.flow-line::before {
  content: '';
  position: absolute;
  left: calc(50% / var(--n));
  right: calc(50% / var(--n));
  top: 34px;
  height: 2px;
  background: var(--border-strong);
}
.flow-line::after {
  content: '';
  position: absolute;
  top: 30px;
  left: calc(50% / var(--n));
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 14px var(--jade);
  opacity: 0;
}
.is-on .flow-line::after { animation: flow-run calc(var(--n) * .9s) linear .3s infinite; }
@keyframes flow-run {
  0%   { left: calc(50% / var(--n)); opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { left: calc(100% - 50% / var(--n) - 10px); opacity: 0; }
}
.flow-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  opacity: 0;
}
.is-on .flow-step { animation: rise .55s cubic-bezier(.2, .7, .3, 1) calc(var(--i) * .15s) both; }
.flow-step__icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
}
.is-on .flow-step__icon { animation: step-lit calc(var(--n) * .9s) linear calc(.3s + var(--i) * .9s) infinite; }
@keyframes step-lit {
  0%, 18% { border-color: var(--jade); box-shadow: 0 0 0 4px rgba(131, 253, 128, .14), var(--glass-shadow); }
  30%, 100% { border-color: var(--glass-border); box-shadow: var(--glass-shadow); }
}
.flow-step__icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--jade);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
[data-theme="light"] .flow-step__icon svg { stroke: var(--sapphire); }
.flow-step b { font-family: var(--font-head); font-size: 15px; }
.flow-step small { color: var(--muted); font-size: 13px; line-height: 1.4; }

/* ---------- Numbered steps with a line that fills as you scroll ---------- */

.steps-v { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 26px; }
.steps-v::before,
.steps-v::after {
  content: '';
  position: absolute;
  left: 21px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
}
.steps-v::before { background: var(--border-strong); }
.steps-v::after { background: var(--jade); box-shadow: 0 0 10px var(--jade); transform: scaleY(0); transform-origin: top; }
.steps-v.is-on::after { animation: line-fill 2.4s ease-out forwards; }
@keyframes line-fill { to { transform: none; } }
.steps-v li { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 20px; }
.steps-v li > span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--bg);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  transition: background .4s ease, color .4s ease, border-color .4s ease;
}
.steps-v.is-on li > span { animation: dot-on .4s ease calc(var(--i) * .4s) forwards; }
@keyframes dot-on { to { background: var(--jade); border-color: var(--jade); color: var(--ink); } }
.steps-v h3 { font-size: 19px; margin: 9px 0 6px; }
.steps-v p { color: var(--muted); font-size: 15.5px; }

/* ---------- Feature cards ---------- */

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat {
  padding: 26px;
  border-radius: var(--radius);
  transition: transform .25s ease, border-color .25s ease;
}
.feat:hover { transform: translateY(-4px); border-color: rgba(131, 253, 128, .5); }
.feat h3 { font-size: 18px; margin-bottom: 8px; }
.feat p { color: var(--muted); font-size: 15px; }
.feat .icon { width: 1.25em; height: 1.25em; }

/* ---------- Closing call to action ---------- */

.cta-band {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.3fr auto;
  gap: 32px;
  align-items: center;
  padding: 48px;
  border-radius: 28px;
}
.cta-band::before {
  content: '';
  position: absolute;
  right: -80px;
  top: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(131, 253, 128, .28), transparent 65%);
  pointer-events: none;
}
.cta-band h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 10px; }
.cta-band p { color: var(--muted); font-size: 17px; }
.cta-band__btns { position: relative; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Links to the other services ---------- */

.others__label { margin-top: 72px; }
.others { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.others a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 16px;
  font-family: var(--font-head);
  font-weight: 600;
  transition: border-color .2s ease, transform .2s ease;
}
.others a span { color: var(--muted); font-weight: 500; }
.others a svg { flex: none; margin-left: auto; width: 18px; height: 18px; fill: none; stroke: var(--jade); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
[data-theme="light"] .others a svg { stroke: var(--text); }
.others a:hover { border-color: rgba(131, 253, 128, .5); transform: translateY(-3px); }
.others a:hover svg { transform: translateX(3px); }

/* ---------- Responsive ---------- */

@media (max-width: 920px) {
  .svc-hero__inner,
  .split { grid-template-columns: 1fr; gap: 44px; }
  .split--flip > :first-child { order: 0; }
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .others { grid-template-columns: repeat(2, 1fr); }
  .cta-band { grid-template-columns: 1fr; padding: 36px 28px; }
  .flow-line { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  .flow-step:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .flow-line::before,
  .flow-line::after { display: none; }
}

@media (max-width: 640px) {
  .feat-grid,
  .others { grid-template-columns: 1fr; }
  .svc-hero { padding-top: calc(var(--nav-h) + 36px); }
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] *,
  [data-animate]::before,
  [data-animate]::after,
  [data-animate] *::before,
  [data-animate] *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
}
