/* =====================================================================
   RatechPlus Technologies — Component Styles
   ===================================================================== */

/* ---------- HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--color-header-bg);
  padding: 8px 0;
  border-bottom: 1px solid var(--color-primary-light);
  box-shadow: 0 2px 8px rgba(46, 143, 224, .18);
  transition: padding .25s ease, box-shadow .25s ease;
}
.site-header.scrolled { padding: 5px 0; box-shadow: 0 4px 12px rgba(46, 143, 224, .22); }

.site-header .inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.brand img { height: 58px; width: auto; }
@media (max-width: 767px) { .brand img { height: 46px; } }

.main-nav { display: flex; align-items: center; gap: 22px; flex-wrap: nowrap; }
.main-nav a {
  color: rgba(255,255,255,.82); font-weight: 400; font-size: .95rem;
  position: relative; padding: 6px 0; white-space: nowrap;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--color-secondary); transition: width .25s ease;
}
.main-nav a:hover, .main-nav a.active { color: #fff; }
.main-nav a.active { font-weight: 700; }
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: transparent; color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s ease;
}
.theme-toggle:hover { background: rgba(255,255,255,.12); }

.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }

@media (max-width: 767px) {
  #headerCta { display: none; }
}

@media (max-width: 1200px) {
  .main-nav {
    position: fixed; inset: 0 0 0 auto; width: min(320px, 82vw); height: 100vh;
    background: var(--color-primary); flex-direction: column; align-items: flex-start;
    padding: 90px 28px 28px; gap: 22px; transform: translateX(100%); transition: transform .3s ease; z-index: 55;
  }
  .main-nav.open { transform: translateX(0); }
  .nav-toggle { display: block; }

  .nav-close {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 20px; right: 20px;
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
    color: #fff; font-size: 1.1rem; cursor: pointer;
  }
  .nav-close:hover { background: rgba(255,255,255,.16); }

  .nav-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 54;
  }
  .nav-backdrop.show { display: block; }
}
@media (min-width: 1201px) {
  .nav-close, .nav-backdrop { display: none !important; }
}

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(160deg, var(--color-primary) 0%, #0A1B30 100%);
  color: #fff; padding: 100px 0 90px; position: relative; overflow: hidden;
}
.hero .inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); color: #fff; }
.hero h1 .accent { color: var(--color-secondary); }
.hero p.lead { color: rgba(255,255,255,.78); font-size: 1.12rem; max-width: 520px; margin-bottom: 30px; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* Rotating brand icon above the pipeline panel — pure CSS transform,
   GPU-accelerated, negligible performance cost. */
.brand-spinner { display: flex; justify-content: center; margin-bottom: 18px; }
.spin-icon {
  width: 64px; height: auto;
  filter: drop-shadow(0 0 10px rgba(46, 143, 224, .4));
  animation: spinSlow 9s linear infinite;
}
@keyframes spinSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Signature element: an animated request→review→approve→record pipeline —
   the workflow pattern underneath every system we build (procurement,
   journal review, loan approval, campaign supporter records). Pure inline
   SVG + CSS, no JS, no layout edge cases — scales natively via viewBox. */
.pipeline-panel {
  background: #0B1524; border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lift);
  padding: 26px 22px 20px;
}
.pipeline-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .78rem; color: rgba(255,255,255,.55);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
}
.pipeline-dot { width: 8px; height: 8px; border-radius: 50%; background: #28C840; flex-shrink: 0; animation: dotpulse 1.6s ease-in-out infinite; }
@keyframes dotpulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.pipeline-svg { width: 100%; height: auto; display: block; }
.flow-path { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 2; stroke-dasharray: 6 6; }
.node-ring {
  fill: none; stroke: var(--color-primary-light); stroke-width: 2; opacity: .4;
  transform-box: fill-box; transform-origin: center;
  animation: ringPulse 2.4s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.node-core { fill: var(--color-secondary); }
.node-label { fill: rgba(255,255,255,.7); font-family: var(--font-body); font-size: 22px; font-weight: 500; text-anchor: middle; }
.packet { fill: #9FE7A8; }
@keyframes ringPulse {
  0%   { transform: scale(.85); opacity: .15; }
  50%  { transform: scale(1.18); opacity: .55; }
  100% { transform: scale(.85); opacity: .15; }
}
.pipeline-caption { margin-top: 14px; font-size: .82rem; color: rgba(255,255,255,.45); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .pipeline-dot, .node-ring, .packet animateMotion, .spin-icon { animation: none !important; }
}


/* ---------- STATS ---------- */
.stats-strip { background: var(--color-primary); padding: 40px 0; }
.stats-strip .grid-4 { gap: 20px; }
.stat-item { text-align: center; color: #fff; }
.stat-item .num { font-family: var(--font-mono); font-size: 2.1rem; font-weight: 700; color: var(--color-secondary); }
.stat-item .label { font-size: .88rem; color: rgba(255,255,255,.7); margin-top: 4px; }

/* ---------- SERVICE / PORTFOLIO / INDUSTRY CARDS ---------- */
.service-card, .value-card, .industry-card { padding: 30px; }
.service-card .icon, .value-card .icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; margin-bottom: 18px;
}
.service-card h3 { font-size: 1.12rem; }
.service-card p { color: var(--color-text-muted); font-size: .95rem; }
.service-card ul { padding-left: 18px; margin: 14px 0 0; color: var(--color-text-muted); font-size: .9rem; }
.service-card ul li { margin-bottom: 6px; }

.portfolio-card { overflow: hidden; }
.portfolio-thumb { height: 170px; background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)); display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-mono); font-size: .8rem; }
.portfolio-card .body { padding: 24px; }
.portfolio-card .tag { display: inline-block; font-size: .75rem; font-family: var(--font-mono); color: var(--color-primary-light); margin-bottom: 8px; }
.portfolio-card h3 { font-size: 1.05rem; }
.portfolio-card p { color: var(--color-text-muted); font-size: .92rem; }
.portfolio-card .client { font-size: .82rem; color: var(--color-text-muted); margin-top: 10px; }

.industry-card { display: flex; align-items: center; gap: 14px; padding: 20px; }
.industry-card .icon { width: 44px; height: 44px; border-radius: 50%; background: var(--color-bg-alt); color: var(--color-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.industry-card h4 { font-size: .98rem; margin-bottom: 2px; }
.industry-card p { font-size: .84rem; color: var(--color-text-muted); margin: 0; }

/* ---------- PROCESS TIMELINE ---------- */
.process-line { position: relative; padding-left: 46px; }
.process-line::before { content:""; position:absolute; left:15px; top:6px; bottom:6px; width:2px; background: rgba(15,42,74,.12); }
.process-step { position: relative; padding-bottom: 34px; }
.process-step:last-child { padding-bottom: 0; }
.process-step .marker {
  position: absolute; left: -46px; top: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-primary); color: #fff; font-family: var(--font-mono); font-size: .8rem;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.process-step h4 { font-size: 1.02rem; margin-bottom: 4px; }
.process-step p { color: var(--color-text-muted); font-size: .93rem; margin: 0; }

/* ---------- TESTIMONIALS ---------- */
.testimonial-card { padding: 28px; }
.testimonial-card .quote { font-size: .98rem; color: var(--color-text); margin-bottom: 18px; }
.testimonial-card .who { display: flex; align-items: center; gap: 12px; }
.testimonial-card .who .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--color-bg-alt); display:flex; align-items:center; justify-content:center; font-family: var(--font-display); font-weight:700; color: var(--color-primary); }
.testimonial-card .who strong { display: block; font-size: .92rem; }
.testimonial-card .who span { font-size: .8rem; color: var(--color-text-muted); }

/* ---------- CTA BAND ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--color-primary), #0A1B30);
  color: #fff; border-radius: var(--radius-lg); padding: 56px; text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.78); max-width: 560px; margin: 0 auto 26px; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid rgba(15,42,74,.1); padding: 18px 0; }
.faq-q { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 600; }
.faq-a { max-height: 0; overflow: hidden; color: var(--color-text-muted); font-size: .93rem; transition: max-height .3s ease; }
.faq-item.open .faq-a { max-height: 300px; padding-top: 10px; }
.faq-item.open .faq-q .fa-chevron-down { transform: rotate(180deg); }
.faq-q .fa-chevron-down { transition: transform .25s ease; color: var(--color-primary-light); }

/* ---------- FOOTER ---------- */
.site-footer { background: var(--color-footer-bg); color: rgba(255,255,255,.72); padding: 64px 0 24px; }
.site-footer h4 { color: #fff; font-size: .98rem; margin-bottom: 16px; }
.site-footer a { color: rgba(255,255,255,.65); font-size: .92rem; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-brand p { font-size: .92rem; color: rgba(255,255,255,.6); max-width: 340px; }
.footer-logo { height: 56px; width: auto; margin-bottom: 18px; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 22px; text-align: center; font-size: .85rem; color: rgba(255,255,255,.5); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero .inner { grid-template-columns: 1fr; }
  .pipeline-panel { padding: 18px 12px 16px; }
  .node-label { font-size: 19px; }
  .spin-icon { width: 52px; }
  .footer-logo { height: 44px; }
}
@media (max-width: 380px) {
  .pipeline-panel { padding: 16px 8px 14px; }
  .node-label { font-size: 17px; }
}

/* =====================================================================
   MOBILE / TABLET ONLY OVERRIDES — hero spacing, headline size, CTA
   buttons, and stats layout. Desktop (above 991px) is untouched.
   ===================================================================== */

/* Tablet: tighten hero vertical spacing, cap headline size a bit more */
@media (max-width: 991px) {
  .hero { padding: 64px 0 56px; }
  .hero h1 { font-size: 2rem; }
}

/* Phone: raise the eyebrow further, shrink headline again, and make the
   two CTA buttons compact enough to stay side-by-side instead of wrapping */
@media (max-width: 767px) {
  .hero { padding: 44px 0 40px; }
  .hero .eyebrow { margin-bottom: 10px; }
  .hero h1 { font-size: 1.7rem; }
  .hero p.lead { font-size: 1rem; margin-bottom: 22px; }

  .hero .cta-row { gap: 8px; flex-wrap: nowrap; }
  .hero .cta-row .btn {
    padding: 10px 14px;
    font-size: .8rem;
    gap: 6px;
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Very small phones: shrink the headline once more */
@media (max-width: 380px) {
  .hero h1 { font-size: 1.5rem; }
  .hero .cta-row .btn { padding: 9px 10px; font-size: .75rem; }
}

/* Stats strip: keep a 2x2 grid on mobile/tablet instead of collapsing to
   a single stacked column (overrides the generic 1-column rule at 640px) */
@media (max-width: 640px) {
  .stats-strip .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 18px 14px; }
  .stat-item .num { font-size: 1.7rem; }
}

