/* ── Premium Variables ── */
:root {
  --bg-dark: #0c0c0c;
  --bg-card: #ffffff;
  --border-light: #e2e2e2;
  --border-subtle: rgba(0, 0, 0, 0.06);
  --text-primary: #0c0c0c;
  --text-secondary: #666;
  --text-tertiary: #777;
  --text-muted: #aaa;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.1);
  --gold: #D4AF37;
  --gold-soft: rgba(212, 175, 55, 0.1);
}

/* ── Page wrapper — centers everything ── */
.page-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 20px 20px;
  max-width: 1400px;
  margin: 0 auto;
  background: #fafafa;
}

/* ── Section title block ── */
.section-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* Animated pill tag */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-dark);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  animation: fadeSlideDown 0.6s ease both;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.section-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.7);
  }
}

/* Main heading with refined reveal */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 4rem);
  /* Slightly larger on mobile */
  line-height: 1.05;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  overflow: hidden;
  margin: 0;
}

.section-title .line {
  display: block;
  animation: revealLine 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.section-title .line:nth-child(1) {
  animation-delay: 0.15s;
}

.section-title .line:nth-child(2) {
  animation-delay: 0.3s;
}

.section-title .line em {
  color: var(--text-tertiary);
  font-weight: 400;
}

@keyframes revealLine {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subtitle - refined typography */
.section-sub {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 620px;
  margin: 0;
  animation: fadeSlideDown 0.7s ease 0.45s both;
  font-weight: 400;
}

/* Divider row - more elegant */
.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: fadeSlideDown 0.6s ease 0.55s both;
  margin-top: 8px;
}

.divider-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, transparent, #ccc, transparent);
}

.divider-line.r {
  background: linear-gradient(to left, transparent, #ccc, transparent);
}

.divider-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.divider-icon:hover {
  transform: rotate(90deg) scale(1.1);
}

.divider-icon svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bento grid — refined spacing */
.bento {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: auto auto auto auto;
  gap: 1px;
  width: 100%;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  animation: fadeSlideDown 0.8s ease 0.6s both;
}

.card {
  background: #fff;
  border: none;
  overflow: hidden;
  position: relative;
  transition: all 0.25s ease;
}

.card:hover {
  z-index: 10;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

/* ═══════════════════════════════════════════
     CARD A — Hero (top-left, 2fr) - Refined
  ═══════════════════════════════════════════ */
.card-hero {
  grid-column: 1 / 4;
  grid-row: 1 / 2;
  background: var(--bg-dark);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 340px;
}

.hero-left {
  padding: 32px 28px 32px 32px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa;
  width: fit-content;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.02);
}

.tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--accent);
}

.hero-heading {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1.1;
  color: #fff;
  flex: 1;
  padding-bottom: 24px;
}

.hero-heading em {
  font-style: italic;
  color: #3a3a3a;
  display: block;
  margin-top: 4px;
}

.hero-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: default;
}

.hero-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

.chip-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chip-ico svg {
  width: 16px;
  height: 16px;
  stroke: #888;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
}

.hero-chip:hover .chip-ico svg {
  stroke: #fff;
}

.chip-label {
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  flex: 1;
  letter-spacing: 0.01em;
}

.chip-arrow {
  font-size: 14px;
  color: #444;
  transition: transform 0.2s;
}

.hero-chip:hover .chip-arrow {
  transform: translateX(4px);
  color: #fff;
}

.hero-right {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
}

.stack-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.stack-wrap video {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.polaroid {
  position: absolute;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease;
}

.p1 {
  width: 140px;
  height: 170px;
  top: 0;
  left: 10px;
  transform: rotate(-5deg);
  z-index: 1;
}

.p1:hover {
  transform: rotate(-3deg) translateY(-5px);
}

.p2 {
  width: 140px;
  height: 174px;
  top: 60px;
  left: 55px;
  transform: rotate(4deg);
  z-index: 2;
}

.p2:hover {
  transform: rotate(2deg) translateY(-5px);
}

/* ═══════════════════════════════════════════
     CARD B — Chatbot (top-right, 1fr) - Refined
  ═══════════════════════════════════════════ */
.card-chat {
  grid-column: 4 / 5;
  grid-row: 1 / 2;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  background: #fff;
}

.card-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0 0 8px 0;
}

.c-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 8px;
}

.c-title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 20px;
  max-width: 200px;
}

.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  margin-bottom: 16px;
}

.mrow {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.mrow.r {
  flex-direction: row-reverse;
}

.av {
  width: 28px;
  height: 28px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.av-b {
  background: var(--bg-dark);
}

.av-b svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.av-u {
  background: #f5f5f5;
  border: 1.5px solid #e5e5e5;
}

.av-u svg {
  width: 14px;
  height: 14px;
  stroke: #777;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.bub {
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  max-width: 88%;
}

.bub.l {
  background: #f5f5f5;
  color: var(--text-primary);
  border-radius: 0;
}

.bub.d {
  background: var(--bg-dark);
  color: #fff;
  border-radius: 0;
}

.brand-bar {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8f8f8;
  border: 1px solid #ececec;
  border-radius: 0;
  transition: all 0.2s;
}

.brand-bar:hover {
  background: #f0f0f0;
  border-color: #ddd;
}

.brand-ico {
  width: 32px;
  height: 32px;
  background: var(--bg-dark);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-ico svg {
  width: 22px;
  height: 12px;
  fill: #fff;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.brand-sub {
  font-size: 10.5px;
  color: #aaa;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════
     CARD C — RAG & LLM (bottom-left, 1fr) - Refined
  ═══════════════════════════════════════════ */
.card-rag {
  grid-column: 1 / 3;
  grid-row: 3 / 4;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #fff;
}

.card-rag h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0;
}

.card-rag>p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
  max-width: 380px;
}

.rag-table {
  background: #fff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #f0f0f0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.rag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #f2f2f2;
  background: #fafafa;
}

.rag-header span {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rag-add {
  background: var(--bg-dark);
  color: #fff;
  border: none;
  border-radius: 0;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.rag-add:hover {
  background: #2a2a2a;
  transform: scale(1.02);
}

.rag-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid #f7f7f7;
  transition: background 0.2s;
}

.rag-row:last-child {
  border-bottom: none;
}

.rag-row:hover {
  background: #fafafa;
}

.rag-row-ico {
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rag-row-ico svg {
  width: 16px;
  height: 16px;
  stroke: #555;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rag-row-info {
  flex: 1;
}

.rag-row-name {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  margin-bottom: 2px;
}

.rag-row-sub {
  font-size: 11px;
  color: #9ca3af;
}

.rag-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 0;
}

.rag-badge.live {
  background: #e6f7e6;
  color: #0a7e3a;
}

.rag-badge.ready {
  background: #f5f5f5;
  color: #6b7280;
}

/* ═══════════════════════════════════════════
     CARD E — Automation Softwares (full width, middle)
  ═══════════════════════════════════════════ */
.card-automation {
  grid-column: 1 / 5;
  grid-row: 2 / 3;
  padding: 32px;
  background: #fafafa;
  border-bottom: 1px solid var(--border-light);
}

.automation-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.automation-content .card-title {
  font-size: 32px;
  margin: 0;
}

.automation-content .card-desc {
  max-width: 500px;
  margin: 0 auto 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

.automation-tech {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.automation-tech .tech-pill {
  background: #fff;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.automation-tech .tech-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(212, 175, 55, 0.1);
}

.automation-tech .tech-pill svg {
  width: 18px;
  height: 18px;
  stroke: var(--gold);
}

/* ═══════════════════════════════════════════
     CARD F — Automation Dark (full width, bottom)
  ═══════════════════════════════════════════ */
.card-automation-dark {
  grid-column: 1 / 5;
  grid-row: 4 / 5;
  background: var(--bg-dark);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 48px;
  gap: 40px;
  overflow: hidden;
  position: relative;
}

.automation-left {
  flex: 1;
  max-width: 600px;
  z-index: 2;
}

.automation-left .card-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  color: #fff;
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.automation-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.automation-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 16px;
  color: #aaa;
  line-height: 1.6;
}

.automation-list .list-icon {
  width: 24px;
  height: 24px;
  background: #111;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.automation-list .list-icon svg {
  width: 12px;
  height: 12px;
  fill: #fff;
}

.automation-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  perspective: 1000px;
  z-index: 2;
  padding-right: 40px;
}

.swap-cards {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 10;
}

.swap-card {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 16px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 24px;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.swap-card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.swap-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
  z-index: 2;
}

.swap-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  color: #fff;
  margin: 0;
  position: relative;
  z-index: 3;
  text-align: left;
}

.swap-card.active {
  transform: translateZ(0) translateY(0) scale(1);
  z-index: 4;
  opacity: 1;
}

.swap-card.next {
  transform: translateZ(-50px) translateY(40px) scale(0.9);
  z-index: 3;
  opacity: 0.8;
}

.swap-card.next-2 {
  transform: translateZ(-100px) translateY(80px) scale(0.8);
  z-index: 2;
  opacity: 0.6;
}

.swap-card.next-3 {
  transform: translateZ(-150px) translateY(120px) scale(0.7);
  z-index: 1;
  opacity: 0.4;
}

.swap-card.prev {
  transform: translateY(-100px) scale(1.05);
  z-index: 5;
  opacity: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
     CARD D — Deploy (bottom-right, 1fr) - Refined
  ═══════════════════════════════════════════ */
.card-deploy {
  grid-column: 3 / 5;
  grid-row: 3 / 4;
  padding: 32px 28px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  position: relative;
  min-height: 300px;
  background: #fff;
}

.globe-bg {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 260px;
  height: 260px;
  z-index: 0;
  pointer-events: none;
}

.globe {
  width: 260px;
  height: 260px;
  border-radius: 100%;
  background: radial-gradient(circle at 35% 32%, #1a1a1a 0%, #000 80%);
  position: relative;
  overflow: hidden;
  opacity: 0.6;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

.globe::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 14px 14px;
  animation: spinDots 16s linear infinite;
  border-radius: 0;
}

@keyframes spinDots {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 56px 0;
  }
}

.globe::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 20px,
      rgba(255, 255, 255, 0.06) 20px,
      rgba(255, 255, 255, 0.06) 21px);
}

.globe-arc {
  position: absolute;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.globe-arc:nth-child(1) {
  inset: 12%;
}

.globe-arc:nth-child(2) {
  inset: 26%;
}

.globe-arc:nth-child(3) {
  inset: 42%;
}

.globe-sweep {
  position: absolute;
  inset: 0;
  border-radius: 0;
  background: conic-gradient(transparent 0deg,
      rgba(255, 255, 255, 0.04) 60deg,
      transparent 120deg);
  animation: sweepRotate 12s linear infinite;
}

@keyframes sweepRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.deploy-content {
  position: relative;
  z-index: 1;
}

.deploy-content h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0 0 8px 0;
}

.deploy-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 220px;
  margin: 0;
}

.tech-rows {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  max-height: 160px;
  overflow: hidden;
}

.tech-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tech-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 500;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #eaeaea;
  white-space: nowrap;
  flex-shrink: 0;
  backdrop-filter: blur(6px);
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.tech-pill:hover {
  border-color: #aaa;
  background: #fcfcfc;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

.tech-pill svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pill-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, #fff 80%);
  z-index: 2;
  pointer-events: none;
}

/* ── Chat mockup styles ── */
.chat-mockup {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.chat-topbar-dots {
  display: flex;
  gap: 5px;
}

.chat-topbar-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.chat-topbar-title {
  font-size: .72rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: .02em;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .62rem;
  color: #10b981;
  font-weight: 500;
}

.chat-status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.7);
  }
}

.chat-messages {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 85%;
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  color: #fff;
}

.msg-bubble {
  padding: 7px 12px;
  border-radius: 12px;
  font-size: .74rem;
  line-height: 1.45;
  font-weight: 400;
}

.msg-bubble.bot {
  background: #111;
  color: #fff;
  border-radius: 3px 12px 12px 12px;
}

.msg-bubble.user-b {
  background: #f3f4f6;
  color: #111;
  border-radius: 12px 3px 12px 12px;
}

.typing-bubble {
  display: flex;
  gap: 3px;
  align-items: center;
  padding: 8px 12px;
  background: #111;
  border-radius: 3px 12px 12px 12px;
  width: fit-content;
}

.typing-bubble span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  animation: typing-bounce .9s ease-in-out infinite;
}

.typing-bubble span:nth-child(2) {
  animation-delay: .15s;
}

.typing-bubble span:nth-child(3) {
  animation-delay: .3s;
}

@keyframes typing-bounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: .5;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.card-desc {
  font-size: .85rem;
  color: #6b7280;
  line-height: 1.65;
  font-weight: 400;
  margin-bottom: 24px;
}

/* Smooth transitions */
* {
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* ═══════════════════════════════════════════
     LARGE TABLET / LAPTOPS (max-width: 1200px)
  ═══════════════════════════════════════════ */
@media (max-width: 1200px) {
  .page-wrap {
    padding: 100px 20px;
  }

  .hero-heading {
    font-size: 32px;
  }

  /* Reflow grid to 2 columns */
  .bento {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  /* Hero takes full width */
  .card-hero {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  /* RAG & Deploy share the next row */
  .card-rag {
    grid-column: 1 / 2;
    grid-row: auto;
  }

  .card-chat {
    grid-column: 2 / -1;
    grid-row: auto;
  }

  .card-deploy {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .card-automation-dark {
    grid-column: 1 / -1;
    grid-row: auto;
    padding: 40px;
  }

  .stack-wrap {
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
    min-height: 280px;
  }
}

/* ═══════════════════════════════════════════
     TABLET (max-width: 900px)
  ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .hero-heading {
    max-width: 100%;
  }

  /* Hero left / right stack */
  .card-hero {
    grid-template-columns: 1fr;
  }

  .hero-left {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 32px 24px;
  }

  .hero-right {
    min-height: 280px;
  }

  /* Card Chat & RAG stack */
  .card-rag,
  .card-chat {
    grid-column: 1 / -1;
  }

  .card-automation-dark {
    flex-direction: column;
    padding: 40px 32px;
    gap: 48px;
    text-align: left; /* Changed from center to allow left alignment of content */
    align-items: flex-start;
  }

  .automation-left {
    max-width: 100%;
  }

  .automation-right {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-right: 0;
    padding-bottom: 140px; /* Space for the 3D stacked cards */
  }

  .swap-cards {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
  }

  /* RAG table converts to 1 column format */
  .rag-table {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════
     MOBILE (max-width: 600px)
  ═══════════════════════════════════════════ */
@media (max-width: 600px) {
  .page-wrap {
    padding: 60px 16px;
    gap: 28px;
  }

  .section-title {
    font-size: 36px;
  }

  /* Stack all cards in one column */
  .bento {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .hero-left {
    padding: 28px 20px;
  }

  .hero-heading {
    font-size: 28px;
    padding-bottom: 20px;
  }

  .hero-right {
    min-height: 220px;
  }

  .stack-wrap {
    min-height: 220px;
  }

  .card-chat {
    padding: 24px 20px;
    min-height: unset;
  }

  .card-rag {
    padding: 28px 20px;
  }

  .card-rag h2 {
    font-size: 24px;
  }

  .card-deploy {
    padding: 28px 20px;
    min-height: unset;
    overflow: visible;
  }

  .card-automation-dark {
    padding: 32px 20px;
    gap: 40px;
    text-align: left;
    align-items: flex-start;
  }

  .automation-left .card-title {
    font-size: 28px;
  }

  .automation-right {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-right: 0;
    padding-bottom: 80px; /* Space for the mobile 3D stack */
  }

  .swap-cards {
    max-width: 320px; /* Slightly wider for better visibility on mobile */
  }

  .swap-card.next {
    transform: translateZ(-30px) translateY(20px) scale(0.9);
  }

  .swap-card.next-2 {
    transform: translateZ(-60px) translateY(40px) scale(0.8);
  }

  .swap-card.next-3 {
    transform: translateZ(-90px) translateY(60px) scale(0.7);
  }

  .swap-card.prev {
    transform: translateY(-60px) scale(1.05);
  }

  /* Adjust globe for mobile pinned to corner */
  .globe-bg {
    width: 160px;
    height: 160px;
    right: -20px;
    top: 20px;
    transform: none;
    opacity: 0.5;
  }

  .globe {
    width: 160px;
    height: 160px;
  }

  .deploy-content p {
    max-width: 100%;
  }

  /* Tech pills: allow wrapping */
  .tech-rows {
    max-height: none;
    overflow: visible;
  }

  .tech-row {
    flex-wrap: wrap;
  }

  .tech-pill {
    font-size: 11px;
    padding: 7px 12px;
  }
}