/* ============================================
   TREEZ AFRICA SYSTEMS — Services Page
   ============================================ */

/* ---- Service Detail Section ---- */
.service-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 70px 0;
  border-bottom: 1px solid var(--line);
}

.service-detail:last-child {
  border-bottom: none;
}

.service-detail:nth-child(even) {
  direction: rtl;
}

.service-detail:nth-child(even) > * {
  direction: ltr;
}

.service-detail-content .label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--amber);
  margin-bottom: 12px;
}

.service-detail-content .label::before {
  content: '//';
  color: var(--text-2);
}

.service-detail-content h2 {
  margin-bottom: 16px;
}

.service-detail-content p {
  margin-bottom: 24px;
  color: var(--text-1);
}

.service-features-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}

.service-features-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-small);
  color: var(--text-1);
}

.service-features-list li svg {
  width: 15px;
  height: 15px;
  color: var(--status-green);
  flex-shrink: 0;
}

/* ---- Service panels: bespoke coded visual per service, no stock art ---- */
.service-panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.service-panel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: var(--text-2);
  margin-bottom: 24px;
}

/* Generic row used across ledger / uptime / platform panels */
.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-1);
}

.panel-row:last-child {
  border-bottom: none;
}

.panel-row b {
  color: var(--text-0);
  font-family: var(--font-mono);
  font-weight: 600;
}

.panel-row-label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.panel-row-label svg {
  width: 15px;
  height: 15px;
  color: var(--text-2);
  flex-shrink: 0;
}

.mono-amount {
  font-family: var(--font-mono);
  color: var(--status-green);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.mono-amount.debit {
  color: var(--status-red);
}

.panel-bar {
  height: 5px;
  background: var(--bg-1);
  border-radius: 3px;
  overflow: hidden;
}

.panel-bar span {
  display: block;
  height: 100%;
  background: var(--amber);
  border-radius: 3px;
}

/* Score grid (web apps panel) */
.score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.score-item {
  text-align: center;
  padding: 18px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.score-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--status-green);
}

/* Lighthouse-style dial: the ring fills to the score when the panel reveals */
.score-dial {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.score-dial .score-value {
  font-size: 1.45rem;
}

.score-ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.score-ring circle {
  fill: none;
  stroke-width: 4;
}

.score-ring-track {
  stroke: var(--line);
}

.score-ring-fill {
  stroke: var(--status-green);
  stroke-linecap: round;
  stroke-dasharray: 175.93;
  stroke-dashoffset: 175.93;
  filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.45));
  transition: stroke-dashoffset 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s;
}

.revealed .score-ring-fill {
  stroke-dashoffset: calc(175.93 * (1 - var(--score) / 100));
}

/* ---- Streaming transaction ledger ---- */
.txn-stream .panel-row:last-child {
  border-bottom: 1px solid var(--line);
}

.txn-enter {
  animation: txnEnter 0.6s ease;
}

@keyframes txnEnter {
  0% { opacity: 0; transform: translateY(-8px); background: rgba(255, 176, 32, 0.12); }
  40% { opacity: 1; transform: none; }
  100% { background: transparent; }
}

/* ---- 90-day uptime history ---- */
.uptime-history {
  margin: 4px 0 14px;
}

.uptime-bars {
  display: flex;
  gap: 2px;
  height: 28px;
  align-items: flex-end;
}

.uptime-bars span {
  flex: 1;
  height: 100%;
  border-radius: 1px;
  background: var(--status-green);
  opacity: 0.75;
  transform: scaleY(0.15);
  transform-origin: bottom;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0ms), opacity 0.2s ease;
}

.uptime-bars span:hover {
  opacity: 1;
}

.uptime-bars .is-degraded {
  background: var(--amber);
}

.revealed .uptime-bars span {
  transform: none;
}

.uptime-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

/* ---- Roadmap bars fill on reveal; the active phase carries a moving sheen ---- */
.roadmap-row .panel-bar span {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s;
}

.revealed .roadmap-row .panel-bar span {
  transform: none;
}

.roadmap-row:nth-child(3) .panel-bar span { transition-delay: 0.5s; }
.roadmap-row:nth-child(4) .panel-bar span { transition-delay: 0.7s; }

.panel-bar.is-active span {
  position: relative;
  overflow: hidden;
}

.panel-bar.is-active span::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%);
  animation: barSheen 2.2s ease-in-out infinite;
}

@keyframes barSheen {
  to { transform: translateX(100%); }
}

.score-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  margin-top: 6px;
}

/* Roadmap rows (consulting panel) */
.roadmap-row {
  display: grid;
  grid-template-columns: 80px 1fr 76px;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
}

.roadmap-phase {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-1);
}

.roadmap-pct {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-2);
  text-align: right;
}

/* ---- Tech Stack: a manifest, not an icon wall ---- */
.tech-stack {
  background: var(--bg-1);
  position: relative;
}

.stack-manifest {
  max-width: 820px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-2);
}

.stack-manifest-head {
  display: grid;
  grid-template-columns: 140px 1fr;
  padding: 14px 24px;
  background: var(--bg-1);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
}

.stack-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.stack-row:last-child {
  border-bottom: none;
}

.stack-cat {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--amber);
}

.stack-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-0);
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
}

/* ---- Process pipeline (How We Work) ---- */
.pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
}

.pipeline-stage {
  flex: 1;
  min-width: 0;
  padding: 26px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  transition: border-color var(--transition-base);
}

.pipeline-stage:hover {
  border-color: var(--amber);
}

.pipeline-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
  margin-bottom: 12px;
}

.pipeline-stage h4 {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.pipeline-stage p {
  font-size: 0.8rem;
  color: var(--text-2);
  margin: 0;
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--text-2);
  flex-shrink: 0;
}

.pipeline-arrow svg {
  width: 18px;
  height: 18px;
}

/* Scroll-driven: stages and arrows light up in order as the pipeline
   scrolls toward mid-screen, like a build progressing. Unsupported
   browsers keep the static pipeline. */
@supports (animation-timeline: view()) {
  .pipeline {
    view-timeline: --pipeline block;
  }

  .pipeline > * {
    animation: pipelineLight linear both;
    animation-timeline: --pipeline;
  }

  .pipeline-stage .pipeline-index {
    animation: pipelineIndex linear both;
    animation-timeline: --pipeline;
  }

  .pipeline > :nth-child(1), .pipeline > :nth-child(1) .pipeline-index { animation-range: cover 8% cover 14%; }
  .pipeline > :nth-child(2) { animation-range: cover 14% cover 17%; }
  .pipeline > :nth-child(3), .pipeline > :nth-child(3) .pipeline-index { animation-range: cover 17% cover 23%; }
  .pipeline > :nth-child(4) { animation-range: cover 23% cover 26%; }
  .pipeline > :nth-child(5), .pipeline > :nth-child(5) .pipeline-index { animation-range: cover 26% cover 32%; }
  .pipeline > :nth-child(6) { animation-range: cover 32% cover 35%; }
  .pipeline > :nth-child(7), .pipeline > :nth-child(7) .pipeline-index { animation-range: cover 35% cover 41%; }
  .pipeline > :nth-child(8) { animation-range: cover 41% cover 44%; }
  .pipeline > :nth-child(9), .pipeline > :nth-child(9) .pipeline-index { animation-range: cover 44% cover 48%; }
}

@keyframes pipelineLight {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
    border-color: rgba(255, 176, 32, 0.55);
    color: var(--amber);
  }
}

@keyframes pipelineIndex {
  to { color: var(--amber); }
}

/* Responsive */
@media (max-width: 1024px) {
  .service-detail {
    grid-template-columns: 1fr;
  }

  .service-detail:nth-child(even) {
    direction: ltr;
  }

  .service-features-list {
    grid-template-columns: 1fr;
  }

  .pipeline {
    flex-direction: column;
  }

  .pipeline-arrow {
    padding: 6px 0;
    transform: rotate(90deg);
  }

  .stack-manifest-head,
  .stack-row {
    grid-template-columns: 110px 1fr;
    padding: 14px 18px;
  }
}

@media (max-width: 600px) {
  .stack-manifest-head,
  .stack-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .roadmap-row {
    grid-template-columns: 70px 1fr;
  }

  .roadmap-pct {
    grid-column: 2;
    text-align: left;
  }
}
