/* ===================================================
   BASE.CSS — Reset, Layout, Grid, Spacing, Utilities
   =================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden; /* Nuclear option for horizontal scrolling */
  width: 100vw;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden; /* Nuclear option for horizontal scrolling */
  width: 100%;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  background-image: linear-gradient(rgba(3, 16, 33, 0.85), rgba(3, 16, 33, 0.95)), url('../images/molecular-hero.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.container--narrow {
  max-width: 960px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ---- Grid ---- */
.grid {
  display: grid;
  gap: var(--gap, 2rem);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---- Flex ---- */
.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-col { display: flex; flex-direction: column; }
.gap-sm { gap: 0.75rem; }
.gap-md { gap: 1.5rem; }
.gap-lg { gap: 2.5rem; }
.flex-wrap { flex-wrap: wrap; }

/* ---- Sections ---- */
.section { padding-block: 6rem; }
.section--sm { padding-block: 4rem; }
.section--lg { padding-block: 8rem; }

/* ---- Text Alignment ---- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* ---- Display ---- */
.block  { display: block; }
.inline { display: inline; }
.hidden { display: none; }
.w-full { width: 100%; }

/* ---- Spacing helpers ---- */
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 2rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 2rem; }

/* ---- Overflow ---- */
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulsate {
  0%   { box-shadow: 0 0 0 0 rgba(0, 212, 180, 0.7); }
  70%  { box-shadow: 0 0 0 14px rgba(0, 212, 180, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 212, 180, 0); }
}

@keyframes pulseGreen {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70%  { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.anim-fade-up    { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.anim-slide-left { opacity: 0; transform: translateX(-40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.anim-slide-right{ opacity: 0; transform: translateX(40px);  transition: opacity 0.7s ease, transform 0.7s ease; }
.anim-fade-in    { opacity: 0; transition: opacity 0.7s ease; }

.anim-delay-1 { transition-delay: 0.1s; }
.anim-delay-2 { transition-delay: 0.2s; }
.anim-delay-3 { transition-delay: 0.3s; }
.anim-delay-4 { transition-delay: 0.4s; }
.anim-delay-5 { transition-delay: 0.5s; }

.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* ---- Responsive Breakpoints ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .section { padding-block: 4rem; }
  .section--lg { padding-block: 5rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
  .container { padding-inline: 1rem; }
}
