/* ============================================================
   SERVICES PAGE - BrainX Solutions
   Uses the same color palette as the home page.
   ============================================================ */
:root {
  --color-ink: #0A0A0F;
  --color-white: #FFFFFF;
  --color-red: #E14B3A;
  --color-red-dark: #C73A2A;
  --color-red-light: #F05A4A;
  --color-red-tint: #F3E1DE;
  --color-red-tint-2: #EECEC8;
  --color-paper: #F7F6F4;
  --color-charcoal: #3E3F44;
  --color-line: #E6E5E2;
  --color-gray: #8A8B92;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --radius: 16px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 20px 40px -16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 40px 60px -24px rgba(0, 0, 0, 0.12);
  --container-pad: clamp(20px, 4vw, 24px);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-white);
  color: var(--color-ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
}

.container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-light) 50%, #F7A072 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-red);
  padding: 4px 0;
  position: relative;
}

.section-tag::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 28px;
  height: 2.5px;
  background: linear-gradient(90deg, var(--color-red), var(--color-red-light));
  border-radius: 2px;
}

.section-tag-light {
  color: var(--color-red-tint-2);
}

.section-tag-light::after {
  background: linear-gradient(90deg, var(--color-red-light), #F7A072);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s var(--ease);
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-dark) 100%);
  color: var(--color-white);
  border-color: var(--color-red);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-red-light) 0%, var(--color-red) 100%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 32px -8px rgba(225, 75, 58, 0.35);
}

.btn-primary span {
  position: relative;
  z-index: 1;
}

.btn-outline-light {
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.btn-outline-light:hover {
  border-color: var(--color-white);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

/* ============================================================
   HERO
   ============================================================ */
.services-page {
  background: var(--color-white);
}

.services-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(118px, 14vw, 170px) 0 clamp(80px, 10vw, 120px);
  background: var(--color-ink);
  isolation: isolate;
}

.services-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 55% at 50% 35%, #000 0%, transparent 80%);
  opacity: 0.55;
}

.services-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58rem 36rem at 15% 22%, rgba(225, 75, 58, 0.34), transparent 58%),
    radial-gradient(46rem 34rem at 90% 80%, rgba(247, 160, 114, 0.20), transparent 62%),
    linear-gradient(180deg, rgba(10,10,15,0.20), rgba(10,10,15,0.86));
  z-index: -1;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(92px);
  opacity: 0.28;
}

.hero-orb-one {
  width: 520px;
  height: 520px;
  background: var(--color-red);
  top: -190px;
  right: -130px;
}

.hero-orb-two {
  width: 380px;
  height: 380px;
  background: var(--color-red-light);
  bottom: -140px;
  left: -110px;
}

.services-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.6fr);
  gap: clamp(34px, 6vw, 72px);
  align-items: center;
}

.services-hero-copy h1 {
  color: var(--color-white);
  font-size: clamp(2.45rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin: 22px 0 22px;
  max-width: 820px;
}

.services-hero-copy p {
  color: #C7C9D1;
  max-width: 650px;
  font-size: clamp(15.5px, 1.5vw, 18px);
  line-height: 1.75;
  margin: 0 0 34px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.services-hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: clamp(28px, 4vw, 38px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 40px 90px -44px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(18px);
}

.panel-topline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-red), var(--color-red-light), #F7A072);
}

.panel-label {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  color: var(--color-red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.service-list-preview {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.service-list-preview li {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #202126;
  font-weight: 700;
  line-height: 1.35;
}

.service-list-preview li span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--color-red-tint);
  box-shadow: 0 0 0 5px rgba(225, 75, 58, 0.07);
  flex: none;
}

/* ============================================================
   OVERVIEW
   ============================================================ */
.services-overview {
  padding: clamp(72px, 10vw, 112px) 0;
  background: var(--color-paper);
}

.overview-header {
  max-width: 720px;
  text-align: center;
  margin: 0 auto clamp(38px, 5vw, 58px);
}

.overview-header h2,
.details-heading h2,
.process-card h2,
.services-cta h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 14px 0 14px;
}

.overview-header p {
  color: var(--color-charcoal);
  max-width: 620px;
  margin: 0 auto;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.overview-card {
  position: relative;
  min-height: 280px;
  padding: 28px 26px;
  border-radius: 22px;
  background: var(--color-white);
  border: 1px solid rgba(230, 229, 226, 0.9);
  box-shadow: 0 18px 38px -28px rgba(0,0,0,0.32);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  overflow: hidden;
}

.overview-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(18rem 12rem at 10% 0%, rgba(225,75,58,0.11), transparent 68%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.overview-card:hover {
  transform: translateY(-8px);
  border-color: rgba(225, 75, 58, 0.25);
  box-shadow: var(--shadow-card);
}

.overview-card:hover::before {
  opacity: 1;
}

.overview-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--color-red-tint);
  color: var(--color-red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: all 0.35s var(--ease);
  position: relative;
  z-index: 1;
}

.overview-icon svg {
  width: 28px;
  height: 28px;
}

.overview-card:hover .overview-icon {
  background: linear-gradient(135deg, var(--color-red), var(--color-red-dark));
  color: var(--color-white);
  transform: scale(1.06) rotate(-3deg);
}

.overview-card h3 {
  font-size: 19px;
  line-height: 1.25;
  margin: 0 0 10px;
  position: relative;
  z-index: 1;
}

.overview-card p {
  color: var(--color-charcoal);
  font-size: 14.5px;
  margin: 0;
  position: relative;
  z-index: 1;
}

.card-arrow {
  position: absolute;
  left: 26px;
  bottom: 24px;
  font-weight: 700;
  color: var(--color-red);
  font-size: 14px;
  z-index: 1;
}

/* ============================================================
   DETAILS
   ============================================================ */
.service-details {
  padding: clamp(72px, 10vw, 112px) 0;
  background: var(--color-white);
}

.details-heading {
  max-width: 680px;
  margin-bottom: clamp(32px, 5vw, 52px);
}

.detail-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: clamp(20px, 4vw, 42px);
  align-items: start;
  padding: clamp(28px, 4vw, 42px) 0;
  border-top: 1px solid var(--color-line);
}

.detail-row:last-child {
  border-bottom: 1px solid var(--color-line);
}

.detail-number {
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(225, 75, 58, 0.42);
}

.detail-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-red);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.detail-kicker::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-red-tint);
}

.detail-content h3 {
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.detail-content p {
  color: var(--color-charcoal);
  max-width: 770px;
  margin: 0 0 18px;
  font-size: 15.5px;
}

.detail-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.detail-content li {
  position: relative;
  padding-left: 22px;
  color: #2E3035;
  font-size: 14.5px;
}

.detail-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-red);
  box-shadow: 0 0 0 5px rgba(225, 75, 58, 0.10);
}

.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(10,10,15,0.12);
  color: var(--color-ink);
  font-weight: 700;
  font-size: 13.5px;
  transition: all 0.3s var(--ease);
}

.detail-link:hover {
  color: var(--color-white);
  background: var(--color-red);
  border-color: var(--color-red);
  transform: translateY(-2px);
  box-shadow: 0 16px 26px -18px rgba(225,75,58,0.8);
}

/* ============================================================
   PROCESS
   ============================================================ */
.services-process {
  padding: clamp(72px, 10vw, 112px) 0;
  background: var(--color-paper);
}

.process-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(34px, 6vw, 70px);
  align-items: center;
  background: var(--color-ink);
  border-radius: 30px;
  padding: clamp(32px, 6vw, 62px);
  color: var(--color-white);
  position: relative;
  overflow: hidden;
}

.process-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(36rem 26rem at 15% 15%, rgba(225,75,58,0.36), transparent 60%),
    radial-gradient(28rem 20rem at 92% 85%, rgba(247,160,114,0.18), transparent 62%);
  pointer-events: none;
}

.process-card > * {
  position: relative;
  z-index: 1;
}

.process-card p {
  color: #C7C9D1;
  max-width: 520px;
  margin: 0;
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.process-steps div {
  min-height: 132px;
  padding: 22px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(12px);
}

.process-steps strong {
  display: block;
  font-family: var(--font-mono);
  color: var(--color-red-tint-2);
  font-size: 13px;
  margin-bottom: 18px;
}

.process-steps span {
  display: block;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

/* ============================================================
   CTA
   ============================================================ */
.services-cta {
  padding: clamp(72px, 10vw, 112px) 0;
  background:
    radial-gradient(38rem 24rem at 50% 0%, rgba(225,75,58,0.12), transparent 65%),
    var(--color-white);
}

.services-cta-inner {
  max-width: 800px;
  text-align: center;
}

.services-cta .section-tag::after {
  left: 50%;
  transform: translateX(-50%);
}

.services-cta p {
  color: var(--color-charcoal);
  max-width: 650px;
  margin: 0 auto 28px;
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal-item {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.overview-grid .reveal-item:nth-child(2),
.detail-row:nth-of-type(2) { transition-delay: 0.06s; }
.overview-grid .reveal-item:nth-child(3),
.detail-row:nth-of-type(3) { transition-delay: 0.12s; }
.overview-grid .reveal-item:nth-child(4),
.detail-row:nth-of-type(4) { transition-delay: 0.18s; }
.overview-grid .reveal-item:nth-child(5),
.detail-row:nth-of-type(5) { transition-delay: 0.24s; }
.overview-grid .reveal-item:nth-child(6),
.detail-row:nth-of-type(6) { transition-delay: 0.30s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .services-hero-inner {
    grid-template-columns: 1fr;
  }

  .services-hero-panel {
    max-width: 640px;
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-row {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .detail-link {
    grid-column: 2;
    justify-self: start;
  }

  .process-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .services-hero {
    padding-top: 104px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .overview-grid,
  .process-steps {
    grid-template-columns: 1fr;
  }

  .overview-card {
    min-height: 240px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .detail-link {
    grid-column: 1;
  }

  .detail-number {
    font-size: 2.4rem;
  }
}

@media (max-width: 480px) {
  .services-hero-panel,
  .process-card {
    border-radius: 22px;
  }

  .services-hero-copy h1 {
    font-size: 2.3rem;
  }

  .overview-card {
    padding: 24px 22px;
  }

  .btn {
    padding: 13px 24px;
    font-size: 13.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-item {
    opacity: 1;
    transform: none;
  }
}
