/* ═══════════════════════════════════════════════════════════════
   SAASKART — LAYOUT SYSTEM
   Scope: Container, sections, grids, spacing, responsive
═══════════════════════════════════════════════════════════════ */

/* ── Container ── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}
.container-sm  { max-width: 800px;  margin: 0 auto; padding: 0 var(--space-xl); }
.container-lg  { max-width: 1400px; margin: 0 auto; padding: 0 var(--space-xl); }

/* ── Sections ── */
section { padding: 100px var(--space-xl); }
.section-sm { padding: 60px var(--space-xl); }
.section-lg { padding: 130px var(--space-xl); }

/* ── Section header ── */
.section-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: var(--space-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--red);
  border-radius: 1px;
  flex-shrink: 0;
}
.section-title {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.2px;
  margin-bottom: 1.2rem;
}
.section-sub {
  font-size: 1rem;
  color: var(--text2);
  max-width: 600px;
  line-height: 1.75;
}
.text-center   { text-align: center; }
.text-center .section-sub { margin: 0 auto; }
.text-center .section-label {
  justify-content: center;
}
.text-center .section-label::before,
.text-center .section-label::after {
  content: '';
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--red);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ── Grid systems ── */
.grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.grid-5  { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

/* Gapped grid (border lines like homepage platform grid) */
.grid-lined {
  display: grid;
  gap: 1.5px;
  background: var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.grid-lined-2 { grid-template-columns: 1fr 1fr; }
.grid-lined-3 { grid-template-columns: repeat(3, 1fr); }
.grid-lined-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Split layouts ── */
.split      { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.split-left { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; }

/* ── Flex utilities ── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-start  { display: flex; align-items: flex-start; }
.flex-col    { display: flex; flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ── Background variants ── */
.bg-default { background: var(--bg); }
.bg-alt     {
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(27,42,74,.03) 0%, transparent 60%),
    var(--bg2);
  position: relative;
}
.bg-alt::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(27,42,74,.12) 20%, rgba(27,42,74,.12) 80%, transparent 100%);
}
.bg-navy {
  background: var(--navy);
  color: #fff;
}
.bg-deep    { background: var(--bg3); }
.bg-bordered-top    { border-top: 1px solid var(--border); }
.bg-bordered-bottom { border-bottom: 1px solid var(--border); }
.bg-bordered { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ── Mesh background orbs ── */
.mesh-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mesh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .22;
  animation: orbFloat 9s ease-in-out infinite;
}
.mesh-orb.o1 { width: 640px; height: 640px; background: radial-gradient(circle, #E8352A, transparent 70%); top: -180px; left: -120px; opacity: .05; }
.mesh-orb.o2 { width: 520px; height: 520px; background: radial-gradient(circle, #1B2A4A, transparent 70%); top: -80px; right: -80px; animation-delay: -3.5s; opacity: .06; }
.mesh-orb.o3 { width: 380px; height: 380px; background: radial-gradient(circle, #E8352A, transparent 70%); bottom: 60px; left: 35%; animation-delay: -6s; opacity: .04; }

/* ── Grid overlay ── */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(27,42,74,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 1;
  pointer-events: none;
}

/* ── Glow ── */
.cta-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 400px;
  background: var(--grad-radial);
  pointer-events: none;
}

/* ── Dividers ── */
.divider { width: 100%; height: 1px; background: var(--border); }
.divider-glow { width: 120px; height: 1px; background: var(--grad1); margin: 0 auto; }

/* ── Spacing utilities ── */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl{ margin-top: var(--space-2xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl{ margin-bottom: var(--space-2xl); }

/* ── Overflow ── */
.overflow-hidden { overflow: hidden; }

/* ══ RESPONSIVE BREAKPOINTS ══════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
  section { padding: 80px 1.5rem; }
  .split       { grid-template-columns: 1fr; gap: 3rem; }
  .split-left  { grid-template-columns: 1fr; }
  .grid-4      { grid-template-columns: repeat(2, 1fr); }
  .grid-lined-4{ grid-template-columns: repeat(2, 1fr); }
  .grid-3      { grid-template-columns: repeat(2, 1fr); }
  .grid-lined-3{ grid-template-columns: 1fr 1fr; }
}

/* Mobile */
@media (max-width: 768px) {
  section { padding: 70px 1.2rem; }
  .container, .container-sm, .container-lg { padding: 0 1.2rem; }
  .grid-2      { grid-template-columns: 1fr; }
  .grid-3      { grid-template-columns: 1fr; }
  .grid-4      { grid-template-columns: 1fr; }
  .grid-5      { grid-template-columns: repeat(2, 1fr); }
  .grid-lined-3{ grid-template-columns: 1fr; }
  .grid-lined-4{ grid-template-columns: 1fr; }
  .split       { grid-template-columns: 1fr; gap: 2rem; }
  .split-left  { grid-template-columns: 1fr; }
  .section-title { letter-spacing: -.1px; }
}

/* ══ EXTRA SMALL BREAKPOINT (480px) ══════════════════════════ */
@media (max-width: 480px) {
  section { padding: 60px 1rem; }
  .section-sm { padding: 48px 1rem; }
  .container, .container-sm, .container-lg { padding: 0 1rem; }
  .grid-5 { grid-template-columns: 1fr; }
  .cta-section { padding: 80px 1rem; }
  .split { gap: 1.5rem; }
}

/* ══ MESH ORB — scale down on mobile ════════════════════════ */
@media (max-width: 768px) {
  .mesh-orb.o1 { width: 320px; height: 320px; top: -80px; left: -80px; }
  .mesh-orb.o2 { width: 260px; height: 260px; top: -40px; right: -40px; }
  .mesh-orb.o3 { width: 200px; height: 200px; }
}


/* ═══════════════════════════════════════════════════════════════
   SAASKART — VISUAL BACKGROUNDS (sitewide)
   Applied to all pages: heroes, sections, separators
═══════════════════════════════════════════════════════════════ */

/* ── Hero background layers ── */
#hero {
  background: #fff;
  overflow: hidden;
}

.sk-hero-bg-gradient {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 8% 18%, rgba(232,53,42,.07) 0%, transparent 58%),
    radial-gradient(ellipse 65% 50% at 92% 12%, rgba(27,42,74,.06) 0%, transparent 55%),
    radial-gradient(ellipse 55% 75% at 50% 105%, rgba(232,53,42,.04) 0%, transparent 58%),
    linear-gradient(168deg, #fafbff 0%, #f5f7fd 45%, #ffffff 100%);
}

.sk-hero-bg-noise {
  position: absolute; inset: 0; pointer-events: none; opacity: .022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.sk-hero-bg-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(27,42,74,.065) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, black 25%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, black 25%, transparent 100%);
}

.sk-hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sk-hero-shape {
  position: absolute;
  border-radius: 50%;
  animation: skHeroFloat 9s ease-in-out infinite;
}
.sk-hero-shape.sh1 {
  width: 440px; height: 440px;
  top: -160px; left: -100px;
  background: radial-gradient(circle, rgba(232,53,42,.09) 0%, transparent 70%);
  animation-delay: 0s;
}
.sk-hero-shape.sh2 {
  width: 380px; height: 380px;
  top: -80px; right: -80px;
  background: radial-gradient(circle, rgba(27,42,74,.07) 0%, transparent 70%);
  animation-delay: -3.5s;
}
.sk-hero-shape.sh3 {
  width: 260px; height: 260px;
  bottom: 30px; right: 12%;
  background: radial-gradient(circle, rgba(232,53,42,.05) 0%, transparent 70%);
  animation-delay: -6s;
}

@keyframes skHeroFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-20px) scale(1.035); }
}

/* ── Section gradient separator ── */
.sk-section-sep {
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--red) 20%, var(--navy) 50%, var(--red) 80%, transparent 100%);
  opacity: .22;
  border: none;
}

/* ── bg-alt richer tint ── */
.bg-alt {
  background:
    radial-gradient(ellipse 90% 50% at 100% 0%, rgba(27,42,74,.04) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(232,53,42,.03) 0%, transparent 55%),
    var(--bg2) !important;
  position: relative;
}

/* ── Section dot pattern (utility class) ── */
.sk-dots {
  background-image: radial-gradient(circle, rgba(27,42,74,.055) 1px, transparent 1px) !important;
  background-size: 28px 28px !important;
}

/* ── Fine line sections ── */
.sk-lines {
  background-image: repeating-linear-gradient(
    0deg, transparent, transparent 39px,
    rgba(27,42,74,.038) 39px, rgba(27,42,74,.038) 40px
  ) !important;
}

/* ── Diagonal micro-check ── */
.sk-geo {
  background-image:
    linear-gradient(45deg, rgba(27,42,74,.022) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(27,42,74,.022) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(27,42,74,.022) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(27,42,74,.022) 75%) !important;
  background-size: 36px 36px !important;
  background-position: 0 0, 0 18px, 18px -18px, -18px 0px !important;
}

/* ── Warm tint (for SIA/AI sections) ── */
.sk-warm {
  background:
    radial-gradient(ellipse 65% 55% at 12% 50%, rgba(232,53,42,.06) 0%, transparent 58%),
    radial-gradient(ellipse 55% 65% at 88% 30%, rgba(27,42,74,.05) 0%, transparent 58%),
    var(--bg2) !important;
}

/* ── Top gradient accent line on sections ── */
.sk-top-accent { position: relative; }
.sk-top-accent::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--red) 25%, var(--navy) 75%, transparent 100%);
  opacity: .35;
}

/* ── Card hover lift (global upgrade) ── */
.p-card, .sol-card, .why-card, .intel-card, .uc-card {
  border-radius: var(--radius-lg) !important;
}

/* ── Section borders ── */
section + section,
section + div + section {
  border-top: 1px solid var(--border);
}

/* ── Page hero sub text ── */
.page-hero-sub {
  font-size: clamp(.9rem, 1.4vw, 1.05rem);
  color: var(--text2);
  max-width: 640px;
  margin: 0 auto 2.4rem;
  line-height: 1.72;
}

@media (max-width: 768px) {
  .sk-hero-shape.sh1 { width: 260px; height: 260px; top: -80px; left: -60px; }
  .sk-hero-shape.sh2 { width: 220px; height: 220px; top: -40px; right: -40px; }
  .sk-hero-shape.sh3 { display: none; }
}

/* ── Page hero search ── */
.page-hero-search {
  width: 100%;
  max-width: 560px;
  margin: 0 auto 2rem;
  position: relative;
  z-index: 10;
}
.page-hero-search .search-wrap {
  max-width: 100%;
  margin: 0 0 10px;
  position: relative;
  z-index: 10;
  transition: transform .2s;
}
.page-hero-search .search-wrap:focus-within {
  transform: scale(1.01);
}
.page-hero-search .search-pills {
  justify-content: center;
  margin-top: 0;
}

@media (max-width: 640px) {
  .page-hero-search {
    max-width: 100%;
    padding: 0 .2rem;
  }
  .page-hero-search .search-wrap {
    transform: none !important;
  }
  .page-hero-search .search-pills {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .page-hero-search .search-pills::-webkit-scrollbar { display: none; }
  .page-hero-search .search-pill {
    flex-shrink: 0;
    white-space: nowrap;
  }
}
