/* ==========================================================================
   Socioverse - Base CSS, Modern Resets & GPU-Accelerated Atmosphere
   Butter-Smooth 60/120 FPS Composited Performance
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: var(--line-height-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}

/* GPU-Accelerated Fixed Background (Eliminates Scroll Repaints) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.22) 0%, rgba(217, 70, 239, 0.1) 35%, transparent 70%),
    radial-gradient(circle at 10% 40%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 90% 70%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
  will-change: transform;
}

/* Ambient Floating Cosmic Orbs (Hardware-Accelerated) */
.cosmic-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.42;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
  contain: paint;
}

@media (max-width: 767px) {
  .cosmic-orb {
    display: none !important;
  }
}

.cosmic-orb-1 {
  width: 520px;
  height: 520px;
  top: -100px;
  left: 20%;
  background: radial-gradient(circle, #8b5cf6 0%, #6366f1 55%, transparent 75%);
  animation: floatOrb1 22s ease-in-out infinite alternate;
}

.cosmic-orb-2 {
  width: 480px;
  height: 480px;
  top: 45%;
  right: -80px;
  background: radial-gradient(circle, #ec4899 0%, #f43f5e 55%, transparent 75%);
  animation: floatOrb2 26s ease-in-out infinite alternate;
}

.cosmic-orb-3 {
  width: 420px;
  height: 420px;
  bottom: 8%;
  left: -60px;
  background: radial-gradient(circle, #06b6d4 0%, #3b82f6 55%, transparent 75%);
  animation: floatOrb3 24s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(60px, 80px, 0) scale(1.1); }
  100% { transform: translate3d(-30px, 100px, 0) scale(0.95); }
}

@keyframes floatOrb2 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-80px, -60px, 0) scale(1.12); }
  100% { transform: translate3d(-20px, 70px, 0) scale(0.92); }
}

@keyframes floatOrb3 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(70px, -50px, 0) scale(1.15); }
  100% { transform: translate3d(20px, 30px, 0) scale(0.95); }
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: #2b2447;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-deep);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary);
}

/* Skip link for WCAG Accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--brand-primary);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  z-index: 99999;
  text-decoration: none;
  font-weight: 700;
  transition: top var(--transition-fast);
  box-shadow: var(--shadow-glow);
}

.skip-link:focus {
  top: 1rem;
}

/* Headings with Outfit & Sleek Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  letter-spacing: -0.025em;
  font-weight: var(--font-weight-bold);
}

h1 {
  font-size: clamp(1.85rem, 5.5vw, 3.8rem);
  font-weight: var(--font-weight-black);
  letter-spacing: -0.035em;
  line-height: 1.15;
  word-break: break-word;
}

h2 {
  font-size: clamp(1.45rem, 4vw, 2.5rem);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: -0.025em;
  line-height: 1.22;
  word-break: break-word;
}

h3 {
  font-size: clamp(1.18rem, 2.6vw, 1.75rem);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

h4 {
  font-size: 1.15rem;
  font-weight: var(--font-weight-bold);
}

p {
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-4);
}

p.lead {
  font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.65;
  font-weight: var(--font-weight-normal);
}

a {
  color: var(--brand-primary-light);
  text-decoration: none;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}

a:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(196, 181, 253, 0.6);
}

img, picture, svg, video {
  max-width: 100%;
  display: block;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

ul, ol {
  padding-left: 1.35rem;
  margin-bottom: var(--space-4);
}

li {
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* Layout Boundaries & Container */
.container {
  width: 100%;
  max-width: var(--container-max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(14px, 3.5vw, 24px);
  padding-right: clamp(14px, 3.5vw, 24px);
  position: relative;
  z-index: 1;
}

.container-narrow {
  max-width: var(--container-reading-w);
}

.section {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
  position: relative;
  z-index: 1;
}

.section-hero {
  padding-top: calc(var(--header-height) + clamp(1.25rem, 3.5vw, 3rem));
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
  position: relative;
  overflow: hidden;
}

/* Global Responsive Tables (Touch-friendly & Zero Page Overflow) */
table {
  width: 100%;
  border-collapse: collapse;
}

.table-responsive,
.comparison-terminal,
.article-content table,
section table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Responsive Grid Fallback Engine (Adapts inline repeat(auto-fit, minmax(320px))) */
@media (max-width: 767px) {
  .grid[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: var(--space-4) !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grid[style*="repeat(auto-fit"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

.text-center {
  text-align: center;
}

/* Multi-Stop Animated Gradient Text */
.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #c4b5fd 25%, #f472b6 50%, #38bdf8 75%, #ffffff 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 10s ease infinite;
  display: inline-block;
}

.text-cyan-gradient {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease infinite;
  display: inline-block;
}

.text-gold-gradient {
  background: linear-gradient(135deg, #fbbf24 0%, #f43f5e 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
