/* =====================================================
 * DecryptCode INC — Layout System
 * CSS Grid + Flexbox containers, grids, and utilities
 * Last Updated: February 21, 2026
 * ===================================================== */

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container--sm {
  max-width: var(--container-sm);
}

.container--md {
  max-width: var(--container-md);
}

.container--lg {
  max-width: var(--container-lg);
}

.container--2xl {
  max-width: var(--container-2xl);
}

/* ── Section Spacing ── */
.section {
  padding-block: var(--space-16);
}

.section--sm {
  padding-block: var(--space-10);
}

.section--lg {
  padding-block: var(--space-24);
}

/* ══════════════════════════════════════════════
 * SECTION BACKGROUNDS — alternating tints
 * Each section gets a unique subtle background
 * to create visual rhythm and separation
 * ══════════════════════════════════════════════ */

/* Services — warm indigo undertone */
.section--bg-services {
  background: var(--bg-section-indigo);
  position: relative;
  overflow: hidden;
}
.section--bg-services::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.04) 0%, transparent 70%);
  pointer-events: none;
}
.section--bg-services > * { position: relative; z-index: 1; }

/* Process — slate blue with top divider */
.section--bg-process {
  background: var(--bg-section-slate);
  border-top: 1px solid rgba(129, 140, 248, 0.06);
  position: relative;
  overflow: hidden;
}
.section--bg-process::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.03) 0%, transparent 70%);
  pointer-events: none;
}
.section--bg-process > * { position: relative; z-index: 1; }

/* Industries — cool cyan undertone */
.section--bg-industries {
  background: var(--bg-section-cyan);
  border-top: 1px solid rgba(34, 211, 238, 0.05);
  position: relative;
  overflow: hidden;
}
.section--bg-industries::after {
  content: '';
  position: absolute;
  top: 20%;
  right: -8%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.035) 0%, transparent 70%);
  pointer-events: none;
}
.section--bg-industries > * { position: relative; z-index: 1; }

/* Portfolio — amber warmth */
.section--bg-portfolio {
  background: var(--bg-section-amber);
  border-top: 1px solid rgba(250, 175, 82, 0.06);
  position: relative;
  overflow: hidden;
}
.section--bg-portfolio::after {
  content: '';
  position: absolute;
  top: -15%;
  left: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(250, 175, 82, 0.03) 0%, transparent 70%);
  pointer-events: none;
}
.section--bg-portfolio > * { position: relative; z-index: 1; }

/* Case Studies — deep dark */
.section--bg-cases {
  background: var(--bg-section-deep);
  border-top: 1px solid rgba(148, 163, 184, 0.06);
  position: relative;
  overflow: hidden;
}
.section--bg-cases::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.03) 0%, transparent 70%);
  pointer-events: none;
}
.section--bg-cases > * { position: relative; z-index: 1; }

/* Blog — warm purple tint */
.section--bg-blog {
  background: var(--bg-section-warm);
  border-top: 1px solid rgba(129, 140, 248, 0.05);
  position: relative;
  overflow: hidden;
}
.section--bg-blog::after {
  content: '';
  position: absolute;
  top: -20%;
  left: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.025) 0%, transparent 70%);
  pointer-events: none;
}
.section--bg-blog > * { position: relative; z-index: 1; }

/* Contact — gradient bottom glow */
.section--bg-contact {
  background: linear-gradient(180deg, var(--bg-section-indigo) 0%, #0d0f1a 100%);
  border-top: 1px solid rgba(250, 175, 82, 0.06);
  position: relative;
  overflow: hidden;
}
.section--bg-contact::before {
  content: '';
  position: absolute;
  bottom: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 500px;
  background: radial-gradient(circle, rgba(250, 175, 82, 0.04) 0%, transparent 70%);
  pointer-events: none;
}
.section--bg-contact > * { position: relative; z-index: 1; }

/* ── Section Label (mono uppercase) ── */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--accent-2);
  margin-bottom: var(--space-3);
}

/* ── Section Title ── */
.section-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 640px;
  line-height: var(--leading-normal);
}

/* Center subtitle when inside text-center context */
.text-center .section-subtitle,
.section-header--center .section-subtitle {
  margin-inline: auto;
}

.section-header {
  margin-bottom: var(--space-12);
}

.section-header--center {
  text-align: center;
}

/* ── Grid System ── */
.grid {
  display: grid;
  gap: var(--space-6);
}

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

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

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

.grid--2-1 {
  grid-template-columns: 1fr;
}

/* ── Flex Utilities ── */
.flex {
  display: flex;
}

.flex--col {
  flex-direction: column;
}

.flex--wrap {
  flex-wrap: wrap;
}

.flex--center {
  align-items: center;
  justify-content: center;
}

.flex--between {
  justify-content: space-between;
}

.flex--start {
  align-items: flex-start;
}

.flex--gap-2 {
  gap: var(--space-2);
}

.flex--gap-3 {
  gap: var(--space-3);
}

.flex--gap-4 {
  gap: var(--space-4);
}

.flex--gap-6 {
  gap: var(--space-6);
}

.flex--gap-8 {
  gap: var(--space-8);
}

/* ── Two-Column Layout (sidebar + content) ── */
.layout-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

/* ── Full-Width Section (bleed out of container) ── */
.full-width {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* ── Neural Grid Background ── */
.neural-grid-bg {
  position: relative;
  background-image:
    var(--gradient-section),
    repeating-linear-gradient(
      90deg,
      var(--grid-line) 0px,
      var(--grid-line) 1px,
      transparent 1px,
      transparent 80px
    ),
    repeating-linear-gradient(
      0deg,
      var(--grid-line) 0px,
      var(--grid-line) 1px,
      transparent 1px,
      transparent 80px
    );
  background-size: 100% 100%, 80px 80px, 80px 80px;
}

.neural-grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle 2px at center, var(--grid-node) 0%, transparent 100%);
  background-size: 80px 80px;
  background-position: 0 0;
  pointer-events: none;
  z-index: 0;
}

.neural-grid-bg > * {
  position: relative;
  z-index: 1;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border-subtle);
  border: none;
  margin-block: var(--space-8);
}

.divider--accent {
  background: var(--accent-border);
}

/* ── Responsive Grid Breakpoints ── */

/* Small tablets: 640px */
@media (min-width: 640px) {
  .container {
    padding-inline: var(--space-6);
  }

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

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

/* Tablets: 768px */
@media (min-width: 768px) {
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .layout-sidebar {
    grid-template-columns: 280px 1fr;
  }
}

/* Small desktops: 1024px */
@media (min-width: 1024px) {
  .container {
    padding-inline: var(--space-8);
  }

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

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

  .grid--2-1 {
    grid-template-columns: 2fr 1fr;
  }

  .section {
    padding-block: var(--space-20);
  }

  .section--lg {
    padding-block: var(--space-32);
  }
}

/* Desktops: 1200px */
@media (min-width: 1200px) {
  .layout-sidebar {
    grid-template-columns: 300px 1fr;
    gap: var(--space-12);
  }
}
