/* ===== WeBuildReach — global styles (vanilla port) ===== */

:root {
  --primary: #5A45FD;
  --primary-hover: #4632DC;
  --bg: #FAFAFD;
  --text-dark: #0B0F19;
  --text-muted: #64748B;
  --border: #E8E7F5;
}

* { font-family: 'Plus Jakarta Sans', sans-serif; }

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 69, 253, 0.3) transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-dark);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(90, 69, 253, 0.3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(90, 69, 253, 0.55); }

/* Reduce heavy blur paint cost on mobile */
@media (max-width: 767px) {
  .wbr-ambient-blur { display: none !important; }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animate-bounce, .animate-pulse, .animate-spin-slow, .animate-overflow-slide,
  .blog-table-scroll__hint-inner { animation: none !important; }
}

p, h1, h2, h3, h4, h5, h6, span, li, a {
  word-break: normal;
  overflow-wrap: break-word;
}

/* ===== Reveal-on-scroll (replaces framer-motion entrances) ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.in-view { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Page fade-in on load */
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.page-enter { animation: page-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Spin (hero ring) */
@keyframes spin-slow { to { transform: rotate(360deg); } }
.animate-spin-slow { animation: spin-slow 60s linear infinite; }

/* Top-bar marquee */
@keyframes slide-overflow {
  0%, 12% { transform: translate3d(0,0,0); opacity: 1; }
  72% { transform: translate3d(var(--scroll-dist), 0, 0); opacity: 1; }
  76% { transform: translate3d(var(--scroll-dist), 0, 0); opacity: 0; }
  80% { transform: translate3d(0,0,0); opacity: 0; }
  84%, 100% { transform: translate3d(0,0,0); opacity: 1; }
}
.animate-overflow-slide { animation: slide-overflow 10s ease-in-out infinite; display: inline-block; }

/* ===== Technology stack marquee ===== */
.wbr-marquee {
  width: 100%;
  overflow: hidden;
  padding: 0.5rem 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.wbr-marquee-track {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: max-content;
  animation: wbr-marquee 55s linear infinite;
}
.wbr-marquee-track.is-reverse { animation-direction: reverse; }
.wbr-marquee:hover .wbr-marquee-track { animation-play-state: paused; }
@keyframes wbr-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.wbr-tech-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  padding: 0.8rem 1.4rem;
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  white-space: nowrap;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.wbr-tech-card:hover {
  border-color: rgba(90, 69, 253, 0.45);
  box-shadow: 0 10px 26px rgba(90, 69, 253, 0.1);
  transform: translateY(-3px);
}
.wbr-tech-card img { width: 1.7rem; height: 1.7rem; object-fit: contain; flex-shrink: 0; }
.wbr-tech-card span { font-weight: 700; color: #334155; font-size: 0.95rem; letter-spacing: -0.01em; }
@media (prefers-reduced-motion: reduce) {
  .wbr-marquee { -webkit-mask-image: none; mask-image: none; }
  .wbr-marquee-track { animation: none !important; flex-wrap: wrap; justify-content: center; width: 100%; }
}

/* Reading progress bar (blog detail) */
#reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  z-index: 70; transition: width 0.1s linear;
}

/* ===== Article / blog prose ===== */
.prose-content { color: #334155; line-height: 1.8; font-size: 1.075rem; }
.prose-content h1, .prose-content h2, .prose-content h3 {
  color: #0f172a; font-weight: 800; line-height: 1.25; margin: 2rem 0 1rem;
}
.prose-content h1 { font-size: 2rem; }
.prose-content h2 { font-size: 1.6rem; }
.prose-content h3 { font-size: 1.3rem; }
.prose-content p { margin: 1.15rem 0; }
.prose-content a { color: var(--primary); text-decoration: underline; }
.prose-content ul, .prose-content ol { margin: 1.15rem 0; padding-left: 1.5rem; }
.prose-content li { margin: 0.4rem 0; }
.prose-content ul { list-style: disc; }
.prose-content ol { list-style: decimal; }
.prose-content img { border-radius: 1rem; margin: 1.5rem 0; max-width: 100%; height: auto; }
.prose-content blockquote {
  border-left: 4px solid var(--primary); padding: 0.25rem 1.25rem; margin: 1.5rem 0;
  color: #475569; font-style: italic; background: #f8f7ff; border-radius: 0 0.75rem 0.75rem 0;
}
.prose-content pre {
  background: #0f172a; color: #e2e8f0; padding: 1.25rem; border-radius: 0.75rem;
  overflow-x: auto; margin: 1.5rem 0; font-size: 0.9rem;
}
.prose-content code { background: #f1f5f9; padding: 0.15rem 0.4rem; border-radius: 0.35rem; font-size: 0.9em; }
.prose-content pre code { background: transparent; padding: 0; }

/* Line clamp helpers */
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Hide elements until JS hydration to avoid flashes */
[hidden] { display: none !important; }

/* ===== Blog content tables (mobile horizontal scroll) ===== */
.blog-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.blog-content th {
  background: #5A45FD;
  color: #fff;
  text-align: left;
  padding: 0.9rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.blog-content td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #E2E8F0;
  color: #475569;
}

.blog-content tr:nth-child(even) td { background: #F8FAFC; }

.blog-table-scroll {
  position: relative;
  margin: 2.5rem 0;
  max-width: 100%;
  border-radius: 16px;
  border: 1px solid #E2E8F0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.blog-table-scroll__track {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-radius: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 69, 253, 0.45) transparent;
}

.blog-table-scroll__track::-webkit-scrollbar { height: 5px; }
.blog-table-scroll__track::-webkit-scrollbar-thumb {
  background: rgba(90, 69, 253, 0.45);
  border-radius: 999px;
}

.blog-table-scroll table {
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  min-width: max(100%, 540px);
}

.blog-table-scroll th,
.blog-table-scroll td {
  min-width: 140px;
  vertical-align: top;
  white-space: normal;
}

.blog-table-scroll th:first-child,
.blog-table-scroll td:first-child {
  min-width: 108px;
  position: sticky;
  left: 0;
  z-index: 1;
}

.blog-table-scroll th:first-child {
  background: #5A45FD;
  z-index: 2;
  box-shadow: 2px 0 8px rgba(90, 69, 253, 0.15);
}

.blog-table-scroll td:first-child {
  background: #fff;
  box-shadow: 2px 0 6px rgba(15, 23, 42, 0.06);
}

.blog-table-scroll tr:nth-child(even) td:first-child { background: #F8FAFC; }

.blog-table-scroll.is-scrollable:not(.at-end)::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 52px;
  height: calc(100% - 2.25rem);
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.96));
  pointer-events: none;
  border-radius: 0 16px 0 0;
  z-index: 3;
}

.blog-table-scroll.is-scrollable:not(.at-start)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: calc(100% - 2.25rem);
  background: linear-gradient(to left, transparent, rgba(255, 255, 255, 0.85));
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.blog-table-scroll.is-scrollable.has-scrolled:not(.at-start)::before { opacity: 1; }

.blog-table-scroll__hint {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 0.55rem 1rem 0.7rem;
  border-top: 1px solid #F1F5F9;
}

.blog-table-scroll.is-scrollable .blog-table-scroll__hint { display: flex; }

.blog-table-scroll.at-end .blog-table-scroll__hint {
  opacity: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
  border: none;
}

.blog-table-scroll__hint-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5A45FD;
  animation: blog-table-hint-nudge 2.2s ease-in-out infinite;
}

@keyframes blog-table-hint-nudge {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(5px); opacity: 0.75; }
}

@media (min-width: 769px) {
  .blog-table-scroll.is-scrollable .blog-table-scroll__hint { display: none; }
  .blog-table-scroll.is-scrollable::after,
  .blog-table-scroll.is-scrollable::before { display: none; }
  .blog-table-scroll th:first-child,
  .blog-table-scroll td:first-child {
    position: static;
    box-shadow: none;
  }
}

/* ===== Swiper Equal Heights utility ===== */
.swiper-wrapper {
  display: flex !important;
  align-items: stretch !important;
}
.swiper-slide {
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
}
.swiper-slide > a,
.swiper-slide > div {
  flex-grow: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

/* ===== Missing Tailwind utilities for SEO pages ===== */

/* lg:col-span-4 / lg:col-span-8 — not in pre-built tailwind.css */
@media (min-width: 1024px) {
  .lg\:col-span-4 { grid-column: span 4 / span 4; }
  .lg\:col-span-8 { grid-column: span 8 / span 8; }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:top-24    { top: 6rem; }
  .lg\:sticky    { position: sticky; }
  .lg\:gap-12    { gap: 3rem; }
  .lg\:gap-8     { gap: 2rem; }
}

/* sm:grid-cols-4 — not in pre-built */
@media (min-width: 640px) {
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:py-16       { padding-top: 4rem; padding-bottom: 4rem; }
}

/* bg-slate-100/60, border-slate-200/40 — opacity variants not pre-built */
.bg-slate-100\/60   { background-color: rgba(241, 245, 249, 0.6); }
.border-slate-200\/40 { border-color: rgba(226, 232, 240, 0.4); }
.bg-white\/5        { background-color: rgba(255, 255, 255, 0.05); }
.scale-150          { --tw-scale-x: 1.5; --tw-scale-y: 1.5; transform: scaleX(1.5) scaleY(1.5); }

/* space-y-5 override (may be missing in pre-built) */
.space-y-5 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(1.25rem * (1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(1.25rem * var(--tw-space-y-reverse));
}

/* pt-3, pb-5 */
.pt-3  { padding-top: 0.75rem; }
.pb-5  { padding-bottom: 1.25rem; }
.pr-4  { padding-right: 1rem; }

/* grid-cols-2 inside md:grid-cols-12 for footer */
@media (min-width: 768px) {
  .md\:col-span-2 { grid-column: span 2 / span 2; }
}

/* ===== Footer column layout fix ===== */
/* Ensure footer grid columns never overflow or wrap words badly */
#site-footer footer ul li a,
#site-footer footer a {
  word-break: break-word;
  hyphens: auto;
  display: block;
  line-height: 1.4;
}

#site-footer footer .grid {
  align-items: start;
}

/* Clamp footer link text to prevent overflow in narrow columns */
#site-footer footer ul li {
  min-width: 0;
}

/* Ensure the footer 5-column grid doesn't collapse on mobile */
@media (max-width: 767px) {
  #site-footer footer .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== SEO page layout utilities ===== */
/* Ensure the 2-col layout (content + sidebar) works at all breakpoints */
.seo-page-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .seo-page-grid {
    grid-template-columns: 1fr 340px;
    gap: 3rem;
  }
}

/* Feature cards hover lift */
.feature-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(90, 69, 253, 0.1);
}

/* ===== Tracking helper missing classes ===== */
.tracking-\[0\.2em\]  { letter-spacing: 0.2em; }
.tracking-\[0\.25em\] { letter-spacing: 0.25em; }

/* text-[9px] / text-[11px] — ensure inline-size */
.text-\[9px\]  { font-size: 9px; }
.text-\[11px\] { font-size: 11px; }
.text-\[10px\] { font-size: 10px; }

/* Dark hero sections (location landings) — do not rely on uncompiled Tailwind arbitrary colors */
.wbr-hero-dark {
  background: linear-gradient(135deg, #0F0A2E 0%, #231663 52%, #5A45FD 100%);
  color: #fff;
}
.wbr-hero-dark .wbr-hero-accent { color: #ddd6fe; }
.wbr-hero-dark .wbr-hero-muted { color: rgba(255, 255, 255, 0.78); }
.wbr-hero-dark .wbr-hero-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}
.wbr-hero-cta-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .wbr-hero-cta-row {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .wbr-hero-cta-row .wbr-hero-btn { width: auto; }
}
.wbr-hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  flex-shrink: 0;
  white-space: nowrap;
}

