/* ZABAL Base Styles - Typography, Reset, Global */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--cream-500);
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Typography System */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-4);
    color: var(--cream-100);
}

h1 {
    font-size: var(--text-5xl);
    font-weight: 900;
}

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

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

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

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

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

p {
    margin-bottom: var(--space-4);
    color: var(--cream-400);
}

.lead-text {
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--cream-300);
    line-height: 1.7;
}

/* Links */
a {
    color: var(--zabal-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--zabal-secondary);
}

a:focus {
    outline: 2px solid var(--zabal-primary);
    outline-offset: 2px;
}

/* Lists */
ul, ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-2);
    color: var(--cream-400);
}

/* Utility Classes */
.gradient-text {
    background: linear-gradient(135deg, var(--zabal-primary), var(--zabal-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.zabal-highlight {
    color: var(--zabal-primary);
    font-weight: 700;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

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

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

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

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

/* Container System */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

/* Accessibility */
.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;
}

/* Focus Management */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--zabal-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--radius-md);
    z-index: var(--z-tooltip);
}

.skip-link:focus {
    top: 6px;
}

/* Selection */
::selection {
    background: var(--zabal-primary);
    color: white;
}

::-moz-selection {
    background: var(--zabal-primary);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--navy-800);
}

::-webkit-scrollbar-thumb {
    background: var(--navy-600);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--navy-500);
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* CLS Prevention - Reserve space for dynamic content */
.hero-container,
.streaming-hub-container,
.zabal-overview-container,
.projects-gallery-container,
.founder-identity-container {
    min-height: 100px; /* Prevent layout shift during load */
}

/* GPU Acceleration for animated elements */
.card,
.btn,
.nav-link,
.project-card,
.benefit-card,
.evolution-step,
.chain-badge {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize paint for fixed elements */
.nav-menu,
.main-content,
.back-button {
    will-change: transform, opacity;
    contain: layout style;
}

/* Prevent font flash (FOIT) */
body {
    font-display: swap;
}

/* Image optimization defaults */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[loading="lazy"] {
    background: var(--navy-700);
}

/* Iframe optimization */
iframe {
    border: 0;
    max-width: 100%;
}

iframe[loading="lazy"] {
    background: var(--navy-700);
}

/* Content visibility for off-screen sections */
.content-section:not(.active) {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Reduce repaints on scroll */
.hero-background,
.hero-particles {
    will-change: transform;
    contain: strict;
}

/* Optimize animations */
@media (prefers-reduced-motion: no-preference) {
    .animate-on-scroll,
    .reveal-element {
        will-change: opacity, transform;
    }
}

/* Remove will-change after animation completes */
.revealed,
.in-view {
    will-change: auto;
}
