/* ============================================================
   SYSAPIEN — HOME PAGE STYLES
   ============================================================ */

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 9rem 0 4rem;
  overflow: hidden;
}

.hero__bg-diamond {
  position: absolute;
  top: -220px;
  right: -180px;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(79, 110, 247, 0.07);
  transform: rotate(45deg);
  z-index: 0;
}
.hero__bg-diamond::before {
  content: '';
  position: absolute;
  inset: 60px;
  border: 1px solid rgba(79, 110, 247, 0.05);
}

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero__eyebrow {
  margin-bottom: 1.6rem;
  opacity: 0;
}

.hero__headline {
  font-size: clamp(2.6rem, 1.6rem + 4.2vw, 5.4rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 1.8rem;
  max-width: 15ch;
}

.hero__sub {
  font-size: var(--fs-lg);
  font-weight: 300;
  color: var(--text-muted);
  max-width: 42ch;
  margin-bottom: 2.6rem;
  opacity: 0;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 2.4rem;
  opacity: 0;
}

.hero__proof {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  opacity: 0;
}

.hero__proof .proof-dot {
  width: 8px;
  height: 8px;
  background: var(--teal);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  flex-shrink: 0;
}

.hero__proof a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.hero__proof a:hover {
  color: var(--teal);
  border-color: var(--teal);
}

/* Visual / 3D canvas */
.hero__visual {
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto 0;
  right: clamp(0px, 4vw, 5rem);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(340px, 40vw, 640px);
  height: clamp(340px, 40vw, 640px);
  pointer-events: none;
}

.hero__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 145%;
  height: 145%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(79, 110, 247, 0.18) 0%, rgba(79, 110, 247, 0) 65%);
  pointer-events: none;
  z-index: 0;
}

.hero__visual::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 85%;
  height: 85%;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1px solid rgba(79, 110, 247, 0.1);
  pointer-events: none;
  z-index: 0;
}

#hero-3d {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.hero__scroll-cue {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-xs);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-dim);
  z-index: 2;
}
.hero__scroll-cue .line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--text-dim), transparent);
  animation: scrollCue 2s ease-in-out infinite;
}
@keyframes scrollCue {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50% { transform: scaleY(0.6); opacity: 1; }
}

@media (max-width: 1080px) {
  .hero { flex-direction: column; padding-top: 7.5rem; text-align: left; }
  .hero__visual {
    position: relative;
    top: auto; right: auto; bottom: auto; margin: 0 0 1rem;
    width: 100%; height: 380px;
    order: -1;
  }
  #hero-3d { width: 320px; height: 380px; max-width: 100%; }
  .hero__glow { width: 480px; height: 480px; }
  .hero__visual::before { width: 320px; height: 320px; }
  .hero__headline { max-width: 100%; }
}

@media (max-width: 600px) {
  .hero__visual { height: 300px; }
  #hero-3d { width: 260px; height: 300px; }
  .hero__glow { width: 380px; height: 380px; }
  .hero__visual::before { width: 240px; height: 240px; }
  .hero__scroll-cue { display: none; }
}

/* ============================================================
   SECTION: THE PROBLEM
   ============================================================ */
.problem__head {
  max-width: 50ch;
  margin-bottom: 4rem;
}

.problem__head h2 { margin-top: 1rem; }

.problem__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}
@media (min-width: 560px) {
  .problem__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .problem__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1400px) {
  .problem__grid { grid-template-columns: repeat(5, 1fr); }
}

.problem-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem 1.8rem;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.problem-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 50px -24px rgba(79, 110, 247, 0.5);
}

.problem-card__icon {
  width: 36px;
  height: 36px;
  margin-bottom: 1.6rem;
  color: var(--blue);
}
.problem-card__icon svg { width: 100%; height: 100%; }

.problem-card h3 {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 0.7rem;
}

.problem-card p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   SECTION: NARRATIVE — Sticky scroll "Multi-Agent System"
   ============================================================ */
.narrative {
  position: relative;
}

.narrative__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

@media (min-width: 1300px) {
  .narrative__grid {
    grid-template-columns: 1fr 0.95fr 0.9fr;
  }
}

.narrative__sticky {
  position: sticky;
  top: 110px;
}

.narrative__sticky h2 {
  margin: 1rem 0 1.4rem;
}

.narrative__contrast {
  margin-top: 2.4rem;
  padding: 1.6rem 1.8rem;
  border-left: 2px solid var(--purple);
  background: rgba(123, 92, 240, 0.06);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 500;
  font-style: italic;
  color: var(--text);
}

.narrative__steps {
  display: flex;
  flex-direction: column;
  gap: 16vh;
  padding: 6vh 0 8vh;
}

.narrative__step {
  opacity: 0.3;
  transition: opacity var(--dur-med) var(--ease);
  max-width: 40ch;
}
.narrative__step.is-active { opacity: 1; }

.narrative__step .step-num {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--blue-light);
  display: block;
  margin-bottom: 0.6rem;
}

.narrative__step h3 {
  font-size: var(--fs-xl);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.narrative__step p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* The Fold workflow diagram (SVG, angular, brand-colored) */
.fold-diagram {
  display: none;
  pointer-events: none;
}

@media (min-width: 1300px) {
  .fold-diagram {
    display: block;
    position: sticky;
    top: 110px;
    align-self: start;
    width: 100%;
    height: 80vh;
  }
}

.fold-node {
  opacity: 0.18;
  transform: scale(0.85);
  transform-origin: center;
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.fold-node.is-visible {
  opacity: 1;
  transform: scale(1);
}

.fold-node rect {
  fill: var(--bg-elev-2);
  stroke: var(--border-strong);
  stroke-width: 1;
}
.fold-node.is-visible rect {
  stroke: var(--blue);
}
.fold-node text {
  fill: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fold-node.is-visible text { fill: var(--text); }

.fold-node .fold-node-icon {
  fill: none;
  stroke: var(--blue-light);
  stroke-width: 1.5;
  opacity: 0;
  transition: opacity 0.6s ease 0.2s;
}
.fold-node.is-visible .fold-node-icon { opacity: 1; }

.fold-connector {
  stroke: var(--border-strong);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 0.8s var(--ease-out), stroke 0.6s ease;
}
.fold-connector.is-drawn {
  stroke-dashoffset: 0;
  stroke: var(--blue);
}

.fold-loop {
  opacity: 0;
  transform: scale(0.9);
  transform-origin: center;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.fold-loop.is-visible { opacity: 1; transform: scale(1); }
.fold-loop path {
  stroke: var(--teal);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 6 6;
}

@media (max-width: 860px) {
  .narrative__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .narrative__sticky { position: relative; top: 0; }
  .narrative__steps { gap: 3rem; padding: 0; }
  .narrative__step { opacity: 1; max-width: 100%; }
}

/* ============================================================
   SECTION: SERVICES (3 cards)
   ============================================================ */
.services-section__head {
  margin-bottom: 3.5rem;
  max-width: 50ch;
}
.services-section__head h2 { margin-top: 1rem; }

.service-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.6rem 2rem;
  min-height: 420px;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--teal);
  box-shadow: 0 24px 60px -28px rgba(0, 201, 167, 0.35);
}

.service-card__num {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  color: var(--blue-light);
  opacity: 0.6;
  margin-bottom: 1.4rem;
}

.service-card h3 {
  font-size: var(--fs-xl);
  margin-bottom: 0.8rem;
}

.service-card p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-bottom: 1.6rem;
  flex-grow: 1;
}

.service-card__detail {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
  margin-bottom: 1.4rem;
}

.service-card__link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.service-card__link .arrow { transition: transform var(--dur-fast) var(--ease); }
.service-card:hover .service-card__link .arrow { transform: translateX(4px); }

@media (max-width: 980px) {
  .service-cards { grid-template-columns: 1fr; }
  .service-card { min-height: auto; }
}

/* ============================================================
   SECTION: HOW WE WORK (process timeline)
   ============================================================ */
.process__head { margin-bottom: 4rem; max-width: 50ch; }
.process__head h2 { margin-top: 1rem; }

.process__timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}

.process__line {
  position: absolute;
  top: 28px;
  left: 0;
  width: 100%;
  height: 4px;
  pointer-events: none;
}
.process__line svg { width: 100%; height: 4px; display: block; overflow: visible; }
.process__line-path {
  stroke: var(--blue);
  stroke-width: 1;
}

.process__step {
  position: relative;
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.process__step.is-visible { opacity: 1; transform: translateX(0); }

.process__step-num {
  width: 56px;
  height: 56px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--blue-light);
  margin-bottom: 1.4rem;
  position: relative;
  z-index: 2;
}
.process__step.is-visible .process__step-num {
  border-color: var(--blue);
}

.process__step h3 {
  font-size: var(--fs-md);
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.process__step p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.process__footnote {
  margin-top: 4rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 500;
  font-style: italic;
  color: var(--text);
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 980px) {
  .process__timeline { grid-template-columns: 1fr; gap: 2.5rem; }
  .process__line { display: none; }
  .process__step { transform: translateY(24px); }
}

/* ============================================================
   SECTION: PROOF / CREDIBILITY
   ============================================================ */
.proof__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: stretch;
}

.proof__card {
  background: linear-gradient(160deg, var(--bg-elev-2), var(--bg-elev));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.proof__card::after {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  right: -120px;
  bottom: -140px;
  border: 1px solid rgba(79, 110, 247, 0.08);
  transform: rotate(45deg);
}

.proof__card h2 { margin: 1rem 0 1.2rem; font-size: var(--fs-2xl); }
.proof__card p { color: var(--text-muted); margin-bottom: 1rem; max-width: 46ch; }

.proof__link {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  position: relative;
  z-index: 2;
}
.proof__link .arrow { transition: transform var(--dur-fast) var(--ease); }
.proof__link:hover .arrow { transform: translate(3px, -3px); }

.proof__stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 2.4rem;
  position: relative;
  z-index: 2;
}
.proof__stat-num {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--text);
  display: block;
}
.proof__stat-label {
  font-size: var(--fs-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.discipline-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.discipline-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease);
}
.discipline-card:hover {
  transform: translateY(-4px);
  border-left-color: var(--teal);
}
.discipline-card h3 {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.discipline-card p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .proof__grid { grid-template-columns: 1fr; }
  .discipline-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .discipline-grid { grid-template-columns: 1fr; }
  .proof__stats { gap: 1.5rem; flex-wrap: wrap; }
}

/* ============================================================
   SECTION: FINAL CTA
   ============================================================ */
.final-cta {
  position: relative;
  overflow: hidden;
  text-align: center;
}

.final-cta__bloom {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translate(-50%, -50%) scale(0.4);
  background: radial-gradient(circle, rgba(0, 201, 167, 0.14) 0%, rgba(123, 92, 240, 0.08) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: transform 1.4s var(--ease-out), opacity 1.4s var(--ease-out);
  opacity: 0;
}
.final-cta__bloom.is-visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.final-cta__inner {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
}

.final-cta h2 {
  margin: 1rem 0 1rem;
}

.final-cta__sub {
  color: var(--text-muted);
  font-size: var(--fs-lg);
  max-width: 50ch;
  margin: 0 auto 3rem;
}

.cta-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  text-align: left;
}

.cta-form .field-full { grid-column: 1 / -1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field label {
  font-size: var(--fs-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  background: rgba(0, 201, 167, 0.03);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }

.field textarea { resize: vertical; min-height: 120px; }

.cta-form__submit { margin-top: 0.6rem; }

.final-cta__note {
  margin-top: 1.6rem;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

@media (max-width: 700px) {
  .cta-form { grid-template-columns: 1fr; }
}
