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

/* This stylesheet only loads on index.html, so it owns the dark
   "systems engineering" theme for the page without affecting the
   legacy light theme still used by pages not yet migrated. */
body {
  background: var(--bg-0);
  color: var(--text-1);
}

h1, h2, h3, h4 {
  color: var(--text-0);
}

p {
  color: var(--text-1);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  background: var(--bg-0);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(255, 176, 32, 0.05) 0%, transparent 45%),
              radial-gradient(circle at 85% 60%, rgba(52, 211, 153, 0.04) 0%, transparent 45%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  padding-top: 160px;
  padding-bottom: 80px;
}

.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.hero-content {
  max-width: 740px;
  color: var(--text-0);
}

/* ---- Hero network console: dot-matrix Africa drawn by js/hero.js ---- */
.hero-network {
  position: relative;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(22, 29, 38, 0.55), rgba(10, 13, 17, 0.2));
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease 0.3s, transform 0.9s ease 0.3s;
}

body.loaded .hero-network {
  opacity: 1;
  transform: none;
}

.hero-network-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}

.hero-network-head .status-pill {
  padding: 4px 12px 4px 10px;
  font-size: 0.68rem;
}

.hero-network-map {
  aspect-ratio: 600 / 640;
  margin: 6px auto 4px;
  max-width: 520px;
}

.hero-network-map svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-network-log {
  min-height: 1.6em;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hn-log-prompt { color: var(--amber); }
.hn-log-ok { color: var(--status-green); }

/* Corner brackets — a viewfinder frame around the console */
.hn-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--amber);
  border-style: solid;
  border-width: 0;
  opacity: 0.7;
}
.hn-corner-tl { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.hn-corner-tr { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.hn-corner-bl { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.hn-corner-br { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

.hn-dots {
  fill: none;
  stroke-linecap: round;
  stroke-width: 3.4;
}
.hn-dots-0 { stroke: rgba(255, 255, 255, 0.14); }
.hn-dots-1 { stroke: rgba(255, 255, 255, 0.24); }
.hn-dots-2 { stroke: rgba(52, 211, 153, 0.45); }
.hn-dots-mask {
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-width: 3.4;
}

.hn-link {
  fill: none;
  stroke: rgba(255, 176, 32, 0.4);
  stroke-width: 1.1;
  stroke-dasharray: 3 4;
}

.hn-packet {
  fill: var(--amber);
  filter: drop-shadow(0 0 4px rgba(255, 176, 32, 0.9));
}
.hn-packet-in {
  fill: var(--status-green);
  filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.9));
}

.hn-node {
  fill: var(--bg-0);
  stroke: var(--status-green);
  stroke-width: 1.5;
}

.hn-hub {
  fill: var(--amber);
  filter: drop-shadow(0 0 6px rgba(255, 176, 32, 0.8));
}

.hn-ring {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: hnRing 2.8s ease-out infinite;
}
.hn-ring-2 { animation-delay: 1.4s; }

@keyframes hnRing {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(5); opacity: 0; }
}

.hn-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  fill: var(--text-2);
}
.hn-label-hub {
  fill: var(--amber);
  font-weight: 600;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  margin-bottom: 22px;
}

.hero-title {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--text-0);
}

.hero-emphasis {
  color: var(--amber);
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-1);
  max-width: 560px;
  margin-bottom: 36px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-credentials {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-2);
  margin: 0;
}

/* ---- Hero ledger: real, named production systems — not a fake UI mockup ---- */
.hero-ledger {
  position: relative;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.hero-ledger-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: 8px;
}

.hero-ledger-table {
  display: flex;
  flex-direction: column;
}

.hero-ledger-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 1.6fr 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  opacity: 0;
}

/* Boot sequence: rows come online one by one, each swept by a scan line */
body.loaded .hero-ledger-row {
  animation: ledgerBoot 0.5s ease forwards;
}
body.loaded .hero-ledger-row:nth-child(1) { animation-delay: 0.5s; }
body.loaded .hero-ledger-row:nth-child(2) { animation-delay: 0.68s; }
body.loaded .hero-ledger-row:nth-child(3) { animation-delay: 0.86s; }
body.loaded .hero-ledger-row:nth-child(4) { animation-delay: 1.04s; }

.hero-ledger-row::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 176, 32, 0.12) 50%, transparent);
  transform: translateX(-100%);
  pointer-events: none;
}
body.loaded .hero-ledger-row::after {
  animation: ledgerScan 0.9s ease-out forwards;
  animation-delay: inherit;
}

@keyframes ledgerBoot {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}

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

.ledger-client {
  font-weight: 600;
  color: var(--text-0);
  font-size: 0.95rem;
}

.ledger-type {
  color: var(--text-1);
  font-size: 0.9rem;
}

.ledger-category {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.ledger-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--status-green);
  justify-self: end;
  white-space: nowrap;
}

/* ---- About Snapshot ---- */
.about-snapshot {
  position: relative;
  background: var(--bg-1);
}

.about-snapshot .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-image-wrapper {
  position: relative;
}

/* ---- Architecture panel (replaces stock photo) ---- */
.arch-panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 34px 30px;
}

.arch-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.arch-panel-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}

.arch-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 32px;
}

.arch-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.arch-node-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.arch-node-icon svg {
  width: 20px;
  height: 20px;
  color: var(--text-1);
}

.arch-node.highlight .arch-node-icon {
  border-color: var(--amber);
  background: rgba(255, 176, 32, 0.08);
}

.arch-node.highlight .arch-node-icon svg {
  color: var(--amber);
}

.arch-node span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-2);
  white-space: nowrap;
}

.arch-line {
  position: relative;
  flex: 1;
  height: 1px;
  background: var(--line-strong);
  min-width: 14px;
  margin-bottom: 24px;
}

/* A request packet relays Client → Gateway → Core → Database: each line
   carries it for a third of the cycle, offset so the hand-offs line up. */
.arch-line::after {
  content: '';
  position: absolute;
  inset: -3px 0;
  background: radial-gradient(circle, var(--amber) 0 2.5px, rgba(255, 176, 32, 0.35) 3.5px, transparent 4.5px) no-repeat;
  background-size: 7px 7px;
  background-position: 0% 50%;
  opacity: 0;
  animation: archPacket 2.4s linear infinite;
}
.arch-flow .arch-line:nth-child(4)::after { animation-delay: 0.8s; }
.arch-flow .arch-line:nth-child(6)::after { animation-delay: 1.6s; }

@keyframes archPacket {
  0% { background-position: 0% 50%; opacity: 1; }
  33% { background-position: 100% 50%; opacity: 1; }
  33.1%, 100% { background-position: 100% 50%; opacity: 0; }
}

.arch-panel-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-2);
}

.arch-panel-foot b {
  color: var(--text-0);
  font-weight: 600;
}

.about-experience-badge {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background: var(--bg-0);
  border: 1px solid var(--amber);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.about-experience-badge .number {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
}

.about-experience-badge .text {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  margin: 6px 0 0;
}

.about-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: 14px;
}

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

.about-content h2 {
  margin-bottom: 20px;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
}

.about-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.about-feature:hover {
  border-color: var(--line-strong);
  transform: translateX(4px);
}

.about-feature svg {
  width: 16px;
  height: 16px;
  color: var(--status-green);
  flex-shrink: 0;
}

.about-feature span {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-1);
}

/* ---- Services Overview ---- */
.services-overview {
  background: var(--bg-0);
}

.service-card {
  background: var(--bg-2);
  border-radius: var(--radius-md);
  padding: 38px 28px;
  transition: all var(--transition-base);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
}

.service-index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-2);
  margin-bottom: 18px;
}

.service-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.service-icon svg {
  width: 21px;
  height: 21px;
  color: var(--text-1);
  transition: color var(--transition-base);
}

.service-card:hover .service-icon {
  border-color: var(--amber);
  background: rgba(255, 176, 32, 0.08);
}

.service-card:hover .service-icon svg {
  color: var(--amber);
}

.service-card h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.service-card p {
  font-size: var(--fs-small);
  color: var(--text-2);
  margin-bottom: 22px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-1);
  transition: color var(--transition-base);
}

.card-link svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-base);
}

.card-link:hover {
  color: var(--amber);
}

.card-link:hover svg {
  transform: translateX(3px);
}

/* ---- Why Choose Us ---- */
.why-choose {
  background: var(--bg-1);
}

.why-choose .features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.feature-item {
  position: relative;
  background: var(--bg-2);
  padding: 38px 30px;
  text-align: left;
}

.feature-index {
  position: absolute;
  top: 18px;
  right: 22px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-2);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
}

/* Alternate primary/secondary across the grid so the two
   brand colors both get real presence, not just amber everywhere */
.feature-item:nth-child(even) .feature-icon {
  border-color: rgba(52, 211, 153, 0.35);
}

.feature-item:nth-child(even) .feature-icon svg {
  color: var(--color-secondary);
}

.feature-item h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.feature-item p {
  font-size: var(--fs-small);
  color: var(--text-2);
  margin: 0;
}

/* ---- Trust Bar ---- */
.trust-bar {
  padding: 36px 0;
  overflow: hidden;
  background: var(--bg-0);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.trust-bar-label {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 30px;
}

.trust-bar-track {
  display: flex;
  width: fit-content;
}

.trust-bar-slide {
  display: flex;
  gap: 60px;
  padding: 0 30px;
  align-items: center;
}

.trust-logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-2);
  opacity: 0.55;
  white-space: nowrap;
  transition: opacity var(--transition-base), color var(--transition-base);
}

.trust-logo:hover {
  opacity: 1;
  color: var(--text-0);
}

/* ---- Testimonials ---- */
.testimonials {
  background: var(--bg-1);
}

.testimonials-slider {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}

.testimonial-track {
  display: flex;
  transition: transform 0.5s ease;
}

.testimonial-item {
  min-width: 100%;
  padding: 0 20px;
}

.testimonial-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 48px 44px;
  text-align: left;
  position: relative;
}

.testimonial-card::before {
  content: '>';
  font-family: var(--font-mono);
  font-size: 2.4rem;
  color: var(--amber);
  opacity: 0.35;
  position: absolute;
  top: 30px;
  left: 30px;
  line-height: 1;
}

.testimonial-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
  margin: 0 0 18px;
  padding-left: 18px; /* clears the '>' prompt so the tag reads as its command line */
}

.testimonial-text {
  font-size: 1.05rem;
  color: var(--text-0);
  line-height: 1.75;
  margin-bottom: 26px;
}

.testimonial-author {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

.testimonial-info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.testimonial-info p {
  font-size: var(--fs-small);
  color: var(--text-2);
  margin: 0;
  font-family: var(--font-mono);
}

.testimonial-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.testimonial-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  transition: all var(--transition-base);
  cursor: pointer;
}

.testimonial-btn svg {
  width: 18px;
  height: 18px;
}

.testimonial-btn:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.testimonial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  cursor: pointer;
  transition: all var(--transition-base);
}

.testimonial-dot.active {
  background: var(--amber);
  transform: scale(1.3);
}

/* ---- CTA Banner ---- */
.cta-banner {
  position: relative;
  padding: 100px 0;
  background: var(--bg-0);
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(255, 176, 32, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.cta-banner .container {
  position: relative;
  z-index: 2;
  text-align: center;
}

.cta-banner h2 {
  color: var(--text-0);
  margin-bottom: 16px;
}

.cta-banner p {
  color: var(--text-1);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 32px;
}

.cta-banner .hero-buttons {
  justify-content: center;
  margin-bottom: 0;
}

/* ---- Technology stack band: two marquee rows running opposite ways ---- */
.stack-band {
  padding: 34px 0;
  background: var(--bg-0);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.stack-band-label {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-2);
  margin-bottom: 22px;
}

.stack-band-row + .stack-band-row {
  margin-top: 12px;
}

.stack-band-track {
  display: flex;
  width: max-content;
  animation-duration: 45s;
}

.stack-band-track:hover {
  animation-play-state: paused;
}

.marquee-reverse {
  animation-direction: reverse;
}

.stack-band-set {
  display: flex;
  gap: 12px;
  padding-right: 12px;
}

.stack-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  transition: border-color var(--transition-base), color var(--transition-base);
}

.stack-chip em {
  font-style: normal;
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--text-2);
}

.stack-chip:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* ---- Engineering at TREEZ ---- */
.engineering {
  background: var(--bg-1);
}

.ci-run {
  max-width: 1100px;
  margin: 0 auto 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  overflow: hidden;
}

.ci-run-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background: var(--bg-0);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-2);
}

.ci-run-id {
  color: var(--text-0);
}

.ci-run-status {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: var(--status-green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.68rem;
}

.ci-run-status.is-running {
  border-color: rgba(255, 176, 32, 0.4);
  color: var(--amber);
}

.ci-stages {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  list-style: none;
  margin: 0;
  padding: 26px 22px;
  counter-reset: none;
}

.ci-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-family: var(--font-mono);
}

/* Connector to the next stage, filled once this stage has passed */
.ci-stage:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 2px;
  background: linear-gradient(90deg, var(--status-green) 50%, var(--line) 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  transition: background-position 0.45s ease;
}

.ci-stage.is-passed:not(:last-child)::after {
  background-position: 0 0;
}

.ci-stage-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--bg-1);
  display: grid;
  place-items: center;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.ci-stage.is-running .ci-stage-icon {
  border-color: var(--amber);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

.ci-stage.is-passed .ci-stage-icon {
  border-color: var(--status-green);
  background: rgba(52, 211, 153, 0.12);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.25);
}

.ci-stage.is-passed .ci-stage-icon::before {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--status-green);
  border-bottom: 2px solid var(--status-green);
  transform: translateY(-1px) rotate(-45deg);
}

.ci-stage b {
  font-size: 0.82rem;
  color: var(--text-0);
  font-weight: 600;
}

.ci-stage small {
  font-size: 0.66rem;
  color: var(--text-2);
}

.ci-stage.is-pending b {
  color: var(--text-2);
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.practice-card {
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-2);
}

.practice-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber);
  margin-bottom: 14px;
}

.practice-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.practice-card p {
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.practice-tags,
.case-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.practice-tags span,
.case-stack span {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-1);
}

/* ---- Case studies ---- */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.case-card {
  display: flex;
  flex-direction: column;
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-2);
}

.case-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.case-client {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.case-head .status-pill {
  padding: 3px 10px 3px 8px;
  font-size: 0.66rem;
}

.case-card h3 {
  font-size: 1.15rem;
  margin-bottom: 22px;
}

.case-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 18px 0;
  margin-bottom: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.case-card .case-stack {
  margin-top: auto;
}

.case-metric {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--amber);
  line-height: 1.2;
}

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

.case-cta {
  text-align: center;
  margin-top: 36px;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .hero .container {
    padding-top: 120px;
  }

  .hero-main {
    grid-template-columns: 1fr;
  }

  .hero-network {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
  }

  .about-snapshot .container {
    grid-template-columns: 1fr;
  }

  .about-image-wrapper {
    max-width: 480px;
    margin: 0 auto;
  }

  .why-choose .features-grid {
    grid-template-columns: 1fr;
  }

  .practice-grid,
  .case-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Six stages don't fit side by side: run them as a vertical log */
  .ci-stages {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ci-stage {
    flex-direction: row;
    text-align: left;
    gap: 14px;
  }

  .ci-stage small {
    margin-left: auto;
  }

  .ci-stage:not(:last-child)::after {
    top: 34px;
    left: 15px;
    right: auto;
    width: 2px;
    height: 12px;
    background: linear-gradient(180deg, var(--status-green) 50%, var(--line) 50%);
    background-size: 100% 200%;
    background-position: 0 100%;
  }
}

@media (max-width: 768px) {
  .hero .container {
    padding-top: 100px;
  }

  .hero-ledger-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }

  .ledger-category {
    order: 3;
  }

  .ledger-status {
    order: 4;
    justify-self: start;
  }

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

  .testimonial-card {
    padding: 40px 24px;
  }
}

@media (max-width: 480px) {
  .hero-ledger-row {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }

  .ledger-status {
    justify-self: start;
  }

  .arch-flow {
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px 14px;
  }

  .arch-line {
    display: none;
  }
}
