/* ============================================
   ALIEN-OPERATIONS.AI — Base Styles
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--space-black);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

::selection {
  background-color: var(--alien-green);
  color: var(--space-black);
}

::-webkit-scrollbar {
  width: 8px;
  background: var(--space-black);
  border-left: 1px solid var(--surface);
}

::-webkit-scrollbar-thumb {
  background: var(--surface);
  border: 1px solid var(--alien-green);
}

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

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

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

/* Utility classes */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--section-pad-x);
}

.section {
  padding: var(--section-pad-y) 0;
  position: relative;
}

.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }

.text-glow {
  text-shadow: 0 0 10px var(--glow-green-mid), 0 0 30px var(--glow-green);
}

.text-glow-amber {
  text-shadow: 0 0 8px rgba(255, 107, 0, 0.6);
}

/* Ambient background organisms (from concept 2) */
.ambient-organism {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: var(--z-bg);
  opacity: 0.35;
  pointer-events: none;
  mix-blend-mode: screen;
}

.organism-1 {
  width: 80vw;
  height: 80vh;
  background: radial-gradient(circle, var(--glow-green-mid) 0%, transparent 70%);
  top: -20%;
  left: -10%;
  animation: drift 25s ease-in-out infinite alternate;
}

.organism-2 {
  width: 60vw;
  height: 60vh;
  background: radial-gradient(circle, var(--glow-teal) 0%, transparent 60%);
  bottom: -10%;
  right: -10%;
  animation: drift 30s ease-in-out infinite alternate-reverse;
}

/* Tendril particle field */
.tendril-field {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: var(--z-bg);
  background-image:
    radial-gradient(1px 1px at 10% 10%, rgba(57,255,20,0.5) 1px, transparent 0),
    radial-gradient(2px 2px at 30% 50%, rgba(0,255,208,0.3) 1px, transparent 0),
    radial-gradient(1.5px 1.5px at 80% 80%, rgba(57,255,20,0.4) 1px, transparent 0);
  background-size: 200px 200px;
  opacity: 0.3;
  animation: tendril-drift 60s linear infinite;
  pointer-events: none;
}

/* CRT scanlines overlay */
.scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 2px;
  pointer-events: none;
  z-index: var(--z-scanlines);
  opacity: 0.3;
}

/* Main content area — offset for sidebar on desktop */
.main-content {
  width: 100%;
  min-height: 100vh;
  position: relative;
  z-index: var(--z-content);
}

@media (min-width: 1024px) {
  .main-content {
    width: calc(100% - var(--sidebar-width));
    margin-right: 0;
  }
}

/* Keyframes */
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes tendril-drift {
  0% { background-position: 0 0; }
  100% { background-position: 200px 200px; }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }
  .ambient-organism, .tendril-field, .scanlines { display: none; }
}
