/* ═══════════════════════════════════════════════════════════════
   MAIN CSS — Imports all component styles
   ═══════════════════════════════════════════════════════════════ */

@import 'variables.css';
@import 'components.css';
@import 'layout.css';
@import 'header.css';
@import 'footer.css';
@import 'animations.css';
@import 'enhancements.css';
@import 'performance.css';
@import 'optimizations.css';

/* ═══════════════════════════════════════════════════════════════
   PAGE TRANSITIONS (Smooth fade-in on load)
   ═══════════════════════════════════════════════════════════════ */
@keyframes pageFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.main-content {
  animation: pageFadeIn 0.3s ease-out forwards;
}

/* ─────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: #0a0a0a;
}

/* Disable smooth scroll on low-end devices for better performance */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────
   TYPOGRAPHY BASE
   ───────────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text);
}

h1 {
  font-size: var(--text-hero);
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-text);
}

strong,
b {
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

ul,
ol {
  list-style: none;
}

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

/* ─────────────────────────────────────────────────────────────
   SELECTION
   ───────────────────────────────────────────────────────────── */
::selection {
  background-color: var(--color-primary);
  color: var(--color-text);
}

/* ─────────────────────────────────────────────────────────────
   FOCUS STYLES
   ───────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────
   SCROLLBAR
   ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) var(--color-bg);
}

/* ─────────────────────────────────────────────────────────────
   UTILITY CLASSES
   ───────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--color-primary-light);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-muted {
  color: var(--color-text-muted);
}

.mt-0 {
  margin-top: 0;
}

.mt-1 {
  margin-top: var(--space-sm);
}

.mt-2 {
  margin-top: var(--space-md);
}

.mt-3 {
  margin-top: var(--space-lg);
}

.mt-4 {
  margin-top: var(--space-xl);
}

.mt-5 {
  margin-top: var(--space-2xl);
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: var(--space-sm);
}

.mb-2 {
  margin-bottom: var(--space-md);
}

.mb-3 {
  margin-bottom: var(--space-lg);
}

.mb-4 {
  margin-bottom: var(--space-xl);
}

.mb-5 {
  margin-bottom: var(--space-2xl);
}

.hidden {
  display: none !important;
}

.block {
  display: block;
}

.inline {
  display: inline;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   VISUAL UPGRADES (3D & NEW SECTIONS)
   ───────────────────────────────────────────────────────────── */

/* Hero Canvas */
.hero {
  position: relative;
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  /* Behind content but above gradient base */
  pointer-events: none;
  /* Let clicks pass through */
}

.hero__content {
  position: relative;
  z-index: 2;
  /* Ensure text is above canvas */
}

/* Reveal Text Animation Helpers */
.reveal-text {
  display: inline-block;
  will-change: transform, opacity;
  /* Default state visible to prevent FOUC/JS failure hiding */
  opacity: 0;
  transform: translateY(20px);
}

.reveal-fade {
  will-change: transform, opacity;
  opacity: 0;
  transform: translateY(20px);
}

/* Fallback: If JS is disabled or fails, show content */
@media (scripting: none) {

  .reveal-text,
  .reveal-fade,
  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Methodology Section */
.methodology {
  background-color: var(--color-bg-elevated);
  padding: var(--space-5xl) 0;
  position: relative;
  /* Ensure it has a z-index context */
  z-index: 5;
}

.methodology__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
}

.methodology__step {
  background: var(--color-bg-card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-base), border-color var(--transition-base);
  position: relative;
  overflow: hidden;
}

.methodology__step:hover {
  transform: translateY(-5px);
  border-color: var(--color-primary-light);
}

.methodology__step::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.methodology__step:hover::before {
  opacity: 1;
}

.methodology__number {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  opacity: 0.2;
  margin-bottom: var(--space-md);
  line-height: 1;
}

.methodology__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.methodology__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: 0;
}

/* Glassmorphism Utilities */
.glass-panel {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}