/**
 * Base Styles - Orvit Cosmos Stargaze
 * 
 * Reset + dark theme foundation
 * Performance-first approach
 * 
 * @package Orvit_Cosmos
 * @since 1.0.0
 */

/* ============================================
   CSS RESET - Modern Normalize
============================================ */

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

/* ============================================
   HTML & BODY - Dark Theme Foundation
============================================ */

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-size: 16px;
    /* Lenis handles scroll, this is fallback only */
    scroll-behavior: smooth;
}

body {
    /* DARK THEME - Stargaze */
    background-color: #000000;
    color: #ffffff;

    /* Typography - Inter font */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;

    /* Layout */
    overflow-x: hidden;
    min-height: 100vh;

    /* Smooth font rendering */
    -webkit-font-smoothing: antialiased;
}

/* Loading state - prevent scroll until Lenis ready */
body.loading {
    overflow: hidden;
}

body.loading::after {
    content: '';
    position: fixed;
    inset: 0;
    background: #000000;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.6s ease;
}

body:not(.loading)::after {
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   TYPOGRAPHY - Headings
============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    margin: 0;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 5vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

/* ============================================
   TYPOGRAPHY - Text
============================================ */

p {
    margin: 0;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
}

a {
    color: var(--stargaze-cyan, #00d4ff);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #ffffff;
}

/* ============================================
   LISTS
============================================ */

ul,
ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ============================================
   MEDIA - Images, Video, Canvas
============================================ */

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

img {
    image-rendering: -webkit-optimize-contrast;
}

video {
    object-fit: cover;
}

canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}

/* ============================================
   FORMS
============================================ */

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
}

button {
    cursor: pointer;
}

input:focus,
textarea:focus,
select:focus,
button:focus {
    outline: 2px solid var(--stargaze-cyan, #00d4ff);
    outline-offset: 2px;
}

/* ============================================
   LAYOUT - Containers
============================================ */

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container-fluid {
    width: 100%;
    padding: 0 2rem;
}

/* ============================================
   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-width: 0;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--stargaze-cyan, #00d4ff);
    color: #000000;
    padding: 0.5rem 1rem;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   UTILITY CLASSES
============================================ */

.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

.no-scroll {
    overflow: hidden !important;
}

/* ============================================
   REDUCED MOTION
============================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width: 768px) {

    .container,
    .container-fluid {
        padding: 0 1rem;
    }
}