/* ============================================================
   ChAinge Logic — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:          hsl(222, 47%, 2%);
  --bg-card:     hsl(222, 47%, 4%);
  --bg-secondary:hsl(217, 19%, 12%);
  --primary:     #09C4DC;
  --primary-dark:#009aad;
  --accent:      hsl(174, 100%, 29%);
  --text:        hsl(210, 40%, 98%);
  --muted:       #8892a4;
  --border:      hsl(217, 19%, 14%);
  --radius:      0.75rem;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a  { color: inherit; text-decoration: none; }

/* ── Utility ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-label {
  font-family: 'Courier New', monospace;
  font-size: 1.05rem;
  letter-spacing: 0.15em;
  color: var(--primary);
  text-transform: uppercase;
  display: block;
  margin-bottom: 1rem;
}

.section-heading {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
}

.section-subtext {
  color: var(--muted);
  max-width: 600px;
  margin: 1rem auto 0;
  text-align: center;
}

.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(9, 196, 220, 0.55), 0 0 22px rgba(9, 196, 220, 0.2);
}
.card:hover { border-color: var(--primary); transform: translateY(-3px); }
.card > * { position: relative; z-index: 1; }
.card-particle-canvas { position: absolute !important; top: 0; left: 0; z-index: 0 !important; pointer-events: none; border-radius: inherit; }

.icon-box {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: rgba(9,196,220,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.icon-box svg { width: 1.2rem; height: 1.2rem; stroke: var(--primary); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0;
  overflow: visible;
  transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}
.navbar.scrolled {
  background: rgba(3,4,7,0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 110px;
}
.navbar-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 110px;
  overflow: visible;
  position: relative;
  z-index: 101;
  margin-left: -58px;
}
.navbar-logo img {
  width: 290px;
  height: auto;
  filter: drop-shadow(0 0 14px rgba(9,196,220,0.7));
  transition: filter 0.3s;
}
.navbar-logo img:hover {
  filter: drop-shadow(0 0 24px rgba(9,196,220,1));
}
.navbar-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.navbar-links a {
  font-size: 0.9rem;
  color: var(--primary);
  transition: color 0.2s;
}
.navbar-links a:hover { color: var(--text); }
.navbar-cta { flex-shrink: 0; }

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  background: rgba(3,4,7,0.97);
  border-top: 1px solid var(--border);
  position: fixed;
  top: 72px; left: 0; right: 0;
  z-index: 99;
  padding: 1rem 0 1.5rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--text); }
.mobile-menu .btn-primary { margin: 1rem 1.5rem 0; text-align: center; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  /* Let mouse events pass through to the section so the sphere tracks the cursor
     even when hovering over text elements on top */
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 960px;
  padding: 8rem 1.5rem 4rem;
}

.hero-headline {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.hero-headline .hl,
.cta-heading .hl {
  color: var(--primary);
  text-shadow: 0 0 40px rgba(9, 196, 220, 0.45);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 580px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.hero-bottom-pills {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.pill-teal {
  font-size: 0.8rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.pill-dark {
  font-size: 0.8rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--primary);
  color: var(--primary);
}

/* ============================================================
   SERVICES
   ============================================================ */
.services {
  padding: 6rem 0;
}
.services-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.services-grid .card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Courier New', monospace;
  margin-bottom: 0.5rem;
}
.services-grid .card-body {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ============================================================
   SOLUTIONS
   ============================================================ */
.solutions {
  padding: 6rem 0;
  background: linear-gradient(180deg, transparent 0%, rgba(9,196,220,0.03) 50%, transparent 100%);
}
.solutions-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
.solutions-grid .card {
  text-align: center;
}
.solutions-grid .card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  margin-top: 0.75rem;
}
.solutions-grid .card-body {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}
.solutions-grid .icon-box {
  margin: 0 auto 0;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  padding: 6rem 0;
}
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about-label { margin-bottom: 1rem; }
.about-heading {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}
.about-text {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}
.about-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.about-values .card-title {
  font-family: 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
}
.about-values .card-body {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ============================================================
   REVIEWS — STACKED CARDS
   ============================================================ */
.reviews {
  padding: 6rem 0;
}
.reviews-header {
  text-align: center;
  margin-bottom: 4rem;
}
.stack-scene {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  min-height: 420px; /* 55px fan-tip space + ~365px card */
}
.stack-card {
  position: absolute;
  left: 0; right: 0;
  top: 55px;                          /* room above for fanned tips */
  transform-origin: center bottom;    /* fan pivots around card base */
  background: rgba(6, 8, 15, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(9, 196, 220, 0.15);
  border-radius: 1.25rem;
  padding: 2.5rem;
  cursor: grab;
  user-select: none;
  will-change: transform;
  transition: transform 0.55s cubic-bezier(0.34, 1.3, 0.64, 1),
              box-shadow 0.4s ease,
              border-color 0.4s ease,
              opacity 0.4s ease;
}
.stack-card:active { cursor: grabbing; }
/* Front card — upright, full glow */
.stack-card[data-pos="0"] {
  z-index: 3;
  transform: rotate(0deg);
  box-shadow: 0 0 0 1px rgba(9,196,220,0.2),
              0 0 40px rgba(9,196,220,0.12),
              0 12px 48px rgba(0,0,0,0.55);
  border-color: rgba(9, 196, 220, 0.28);
}
/* Middle card — fans out to the left */
.stack-card[data-pos="1"] {
  z-index: 2;
  transform: rotate(-11deg);
  box-shadow: 0 0 20px rgba(9,196,220,0.06), 0 6px 28px rgba(0,0,0,0.4);
  border-color: rgba(9, 196, 220, 0.12);
}
/* Back card — fans out to the right */
.stack-card[data-pos="2"] {
  z-index: 1;
  transform: rotate(9deg);
  box-shadow: 0 0 10px rgba(9,196,220,0.04), 0 3px 16px rgba(0,0,0,0.3);
  border-color: rgba(9, 196, 220, 0.08);
}
.stack-card.is-dragging {
  transition: none !important;
  transform-origin: center center;    /* feels natural when dragging */
  z-index: 10;
  cursor: grabbing;
  box-shadow: 0 0 0 1px rgba(9,196,220,0.4),
              0 0 60px rgba(9,196,220,0.22),
              0 24px 64px rgba(0,0,0,0.65);
  border-color: rgba(9,196,220,0.45);
}
.stack-card.is-flying {
  transition: transform 0.42s cubic-bezier(0.55, 0, 1, 0.45),
              opacity 0.42s ease;
  pointer-events: none;
  opacity: 0 !important;
}
.stack-quote-mark {
  font-size: 3.5rem;
  line-height: 0.85;
  color: var(--primary);
  opacity: 0.45;
  margin-bottom: 1rem;
  font-family: Georgia, 'Times New Roman', serif;
}
.stack-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1.75rem;
}
.stack-divider {
  width: 2.5rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(9,196,220,0.7), transparent);
  margin-bottom: 1.25rem;
}
.stack-author {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.stack-role {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--primary);
  margin-top: 0.3rem;
  letter-spacing: 0.02em;
}
.review-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2.5rem;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.05em;
}
@media (max-width: 600px) {
  .stack-scene  { min-height: 460px; }
  .stack-card   { padding: 2rem; top: 48px; }
  .stack-text   { font-size: 0.95rem; }
  .stack-card[data-pos="1"] { transform: rotate(-9deg); }
  .stack-card[data-pos="2"] { transform: rotate(7deg); }
}

/* ============================================================
   PROCESS
   ============================================================ */
.process {
  padding: 6rem 0;
  background: linear-gradient(180deg, transparent 0%, rgba(9,196,220,0.03) 50%, transparent 100%);
}
.process-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.process-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  transition: border-color 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(9, 196, 220, 0.55), 0 0 22px rgba(9, 196, 220, 0.2);
}
.process-step:hover { border-color: var(--primary); }
.process-step > * { position: relative; z-index: 1; }
.process-num {
  font-family: 'Courier New', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.5;
  line-height: 1;
  margin-bottom: 0.75rem;
}
.process-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.process-body {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ============================================================
   CTA — FLOATING SPHERE
   ============================================================ */

@keyframes cta-float {
  0%,  100% { transform: translateY(0px);   }
  40%        { transform: translateY(-18px); }
  70%        { transform: translateY(-9px);  }
}

@keyframes cta-glow-pulse {
  0%, 100% {
    box-shadow:
      inset 0 0 70px  rgba(9,196,220,0.04),
      0 0 0   1px rgba(9,196,220,0.15),
      0 0 40px  rgba(9,196,220,0.14),
      0 0 90px  rgba(9,196,220,0.06),
      0 0 160px rgba(9,196,220,0.02),
      0 60px 140px rgba(0,0,0,0.6);
  }
  50% {
    box-shadow:
      inset 0 0 70px  rgba(9,196,220,0.08),
      0 0 0   1px rgba(9,196,220,0.28),
      0 0 65px  rgba(9,196,220,0.28),
      0 0 140px rgba(9,196,220,0.11),
      0 0 240px rgba(9,196,220,0.04),
      0 60px 140px rgba(0,0,0,0.6);
  }
}

.cta-section {
  padding: 8rem 0;
}

/* ── Sphere shape ── */
.cta-box {
  /* Circular */
  width: 480px;
  max-width: 90vw;
  aspect-ratio: 1;
  border-radius: 50%;

  /* Layered radial glow — more transparent/see-through */
  background:
    radial-gradient(ellipse at 38% 28%, rgba(9,196,220,0.09) 0%, transparent 46%),
    radial-gradient(ellipse at 64% 72%, rgba(9,196,220,0.04) 0%, transparent 40%),
    radial-gradient(circle  at 50% 50%, rgba(9,196,220,0.02) 0%, rgba(6,8,15,0.45) 66%);

  border: 1px solid rgba(9,196,220,0.22);
  padding: 0;
  margin: 0 auto;
  position: relative;
  overflow: hidden;

  /* Flex-centre the content */
  display: flex;
  align-items: center;
  justify-content: center;

  animation: cta-float 7s ease-in-out infinite,
             cta-glow-pulse 4s ease-in-out infinite;
}

/* Subtle specular highlight arc — top-left of sphere */
.cta-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 28% 22%, rgba(9,196,220,0.07) 0%, transparent 38%),
    radial-gradient(ellipse at 50% 50%, rgba(9,196,220,0.02) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Ensure children sit above the canvas & gradients */
.cta-box > *          { position: relative; z-index: 1; }

/* ── Content wrapper — keeps text inside the circle ── */
.cta-content {
  position: relative;
  z-index: 2;
  width: 62%;
  max-width: 360px;
  text-align: center;
}

.cta-heading {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.cta-sub {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Ghost teal button — matches hero navbar CTA ── */
.btn-cta-ghost {
  display: inline-block;
  background: rgba(3, 4, 8, 0.88);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--primary);
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.01em;
  box-shadow: 0 0 12px rgba(9,196,220,0.55),
              0 0 30px rgba(9,196,220,0.18);
  transition: box-shadow 0.25s ease, transform 0.15s ease, background 0.2s ease;
}
.btn-cta-ghost:hover {
  background: rgba(9,196,220,0.07);
  box-shadow: 0 0 22px rgba(9,196,220,0.9),
              0 0 58px rgba(9,196,220,0.32);
  transform: translateY(-2px);
  color: var(--primary);
}

@media (prefers-reduced-motion: reduce) {
  .cta-box { animation: none; }
}

@media (max-width: 480px) {
  .cta-content        { width: 72%; }
  .cta-heading        { font-size: 1.4rem; }
  .cta-sub            { font-size: 0.875rem; }
  .btn-cta-ghost      { font-size: 0.85rem; padding: 0.75rem 1.6rem; }
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  padding: 6rem 0;
}
.contact-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.contact-heading {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 1rem;
}
.contact-sub {
  color: var(--muted);
  margin-bottom: 3rem;
}
.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.contact-item svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: var(--primary);
  flex-shrink: 0;
}
/* TODO: Replace placeholder text below with real contact details */

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}
.footer-copy {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .solutions-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  .navbar-links, .navbar-cta { display: none; }
  .hamburger { display: flex; }

  .about-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-values { grid-template-columns: 1fr; }

  .process-grid { grid-template-columns: repeat(2, 1fr); }

  .solutions-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-top { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
  .solutions-grid { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr; }
}
