/* ============================================
   INNATEENGINE - BASE STYLES
   Reset, Typography, Global Elements
   ============================================ */

/* ==========================================
   MODERN CSS RESET
   ========================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Prevent horizontal scroll during animations */
html, body {
  overflow-x: hidden;
}

/* Remove default margins */
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
dl, dd, ol, ul,
figure, hr, fieldset, legend {
  margin: 0;
}

/* Remove list styles */
ol, ul {
  list-style: none;
}

/* Remove default button styles */
button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

/* Reset form elements */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

/* Remove textarea resize */
textarea {
  resize: vertical;
}

/* Remove link styles */
a {
  color: inherit;
  text-decoration: none;
}

/* Better image defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Remove built-in form typography */
input, button, textarea, select {
  font: inherit;
}

/* Inherit fonts for table */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ==========================================
   SELECTION STYLES
   ========================================== */
::selection {
  background-color: rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
}

::-moz-selection {
  background-color: rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
}

/* ==========================================
   FOCUS STYLES
   ========================================== */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-hero);
  letter-spacing: var(--tracking-tighter);
}

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

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

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

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

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

/* Paragraphs */
p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

/* Lead text */
.lead {
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

/* Small text */
small, .text-sm {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

/* Strong & Bold */
strong, b {
  font-weight: var(--font-semibold);
}

/* Emphasis */
em, i {
  font-style: italic;
}

/* Links */
a {
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-primary);
}

/* ==========================================
   CODE & PRE
   ========================================== */
code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--bg-tertiary);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
  color: var(--brand-primary-light);
}

pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.125em 0.5em;
  font-size: 0.85em;
  box-shadow: 0 2px 0 var(--bg-elevated);
}

/* ==========================================
   HORIZONTAL RULE
   ========================================== */
hr {
  border: none;
  height: 1px;
  background: var(--border-default);
  margin: var(--space-8) 0;
}

/* ==========================================
   BLOCKQUOTE
   ========================================== */
blockquote {
  border-left: 4px solid var(--brand-primary);
  padding-left: var(--space-6);
  margin: var(--space-6) 0;
  font-style: italic;
  color: var(--text-secondary);
}

blockquote cite {
  display: block;
  margin-top: var(--space-4);
  font-style: normal;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* ==========================================
   TABLES
   ========================================== */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}

th {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-secondary);
}

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

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

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

/* ==========================================
   UTILITY: SKIP LINK
   ========================================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-max);
  padding: var(--space-4) var(--space-6);
  background: var(--brand-primary);
  color: white;
  border-radius: var(--radius-md);
  font-weight: var(--font-semibold);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ==========================================
   LAYOUT CONTAINER
   ========================================== */
.container {
  width: 100%;
  max-width: var(--container-2xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

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

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

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

/* ==========================================
   SECTION
   ========================================== */
.section {
  padding: var(--space-24) 0;
}

.section-sm {
  padding: var(--space-16) 0;
}

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

/* ==========================================
   GRADIENT TEXT
   ========================================== */
.gradient-text,
.text-gradient {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-reverse {
  background: var(--brand-gradient-reverse);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================
   BODY STATES
   ========================================== */
body.menu-open,
body.modal-open {
  overflow: hidden;
}

/* ==========================================
   LOADING STATE
   ========================================== */
.is-loading {
  pointer-events: none;
  opacity: 0.6;
}

/* ==========================================
   REDUCED MOTION
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
