/* ============================================
   JAUMEMORY LANDING PAGE - MAIN STYLESHEET
   Unified CSS importing all component styles
   Cloud-hosted memory with E2E encryption
   ============================================ */

/* 1. Design System Variables - Foundation */
@import './variables.css';

/* 1.5. Layout Shift Prevention - Critical for CLS */
@import './layout-shift-fix.css';

/* 2. Base Reset and Typography */
/* @import './reset.css'; - Inline below */
/* @import './typography.css'; - Inline below */

/* 3. Layout Components */
@import '../components/navigation/navbar.css';
@import '../components/hero/hero.css';
@import '../components/features/features.css';
@import '../components/features/feature-modal.css';
@import '../components/timeline/timeline.css';
@import '../components/forms/glassmorphic-forms.css';
@import '../components/footer/footer.css';

/* 4. Page Styles */
@import './pages.css';
@import './apply.css';

/* 4. Utility Classes */
/* @import './utilities.css'; - Inline below */

/* ============================================
   Global Base Styles
   ============================================ */

/* Theme transition */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease !important;
}

/* Reset - Inline since reset.css might not exist yet */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Background gradient that spans the entire page */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        var(--gradient-start) 0%,
        var(--gradient-mid) 50%,
        var(--gradient-end) 100%
    );
    background-size: 200% 200%;
    animation: gradientShift 20s ease infinite;
    z-index: -2;
}

/* Main content wrapper */
main {
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

/* Section spacing */
section {
    position: relative;
    padding: var(--space-20) 0;
}

section:first-child {
    padding-top: 0;
}

/* Reduce section padding on mobile */
@media (max-width: 768px) {
    section {
        padding: var(--space-12) 0; /* 3rem instead of 5rem */
    }

    /* Even less space for specific sections */
    .features,
    .timeline,
    .waitlist,
    .testimonials {
        padding: var(--space-10) 0; /* 2.5rem */
    }
}

/* Container utility */
.container {
    max-width: var(--max-width-7xl);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
}

/* ============================================
   Typography - Inline since typography.css might not exist
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-text);
}

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

/* Fix for h1 deprecation warning - explicit font-size for h1 in sectioning elements */
article h1,
aside h1,
nav h1,
section h1 {
    font-size: var(--font-size-4xl);
}

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

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

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

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
}

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

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

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

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

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

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

/* Code */
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: 0.125em 0.25em;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}

pre {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    line-height: var(--leading-relaxed);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

pre code {
    padding: 0;
    background: transparent;
    border: none;
}

/* ============================================
   Utility Classes - Inline since utilities.css might not exist
   ============================================ */

/* Display utilities */
.hidden {
    display: none !important;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.grid {
    display: grid;
}

/* Flexbox utilities */
.flex-row {
    flex-direction: row;
}

.flex-col {
    flex-direction: column;
}

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

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

/* Text alignment */
.text-left {
    text-align: left;
}

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

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

/* Font weights */
.font-normal {
    font-weight: var(--font-normal);
}

.font-medium {
    font-weight: var(--font-medium);
}

.font-semibold {
    font-weight: var(--font-semibold);
}

.font-bold {
    font-weight: var(--font-bold);
}

/* Margins */
.mt-4 {
    margin-top: var(--space-4);
}

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

.my-8 {
    margin-top: var(--space-8);
    margin-bottom: var(--space-8);
}

/* Padding */
.p-4 {
    padding: var(--space-4);
}

.px-6 {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.py-4 {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}

/* Border radius */
.rounded {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-full {
    border-radius: var(--radius-full);
}

/* Shadows */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

/* Glass effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(
        135deg,
        hsl(var(--primary-h), var(--primary-s), var(--primary-l)),
        hsl(var(--accent-h), var(--accent-s), var(--accent-l))
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Screen reader only */
.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;
}

/* ============================================
   Responsive Utilities
   ============================================ */

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

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

/* ============================================
   Loading States
   ============================================ */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ============================================
   Accessibility
   ============================================ */

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    /* Use darker primary color for better contrast with white text (WCAG AA) */
    background: hsl(217, 91%, 40%); /* Darker than primary for contrast */
    color: white;
    padding: var(--space-2) var(--space-4);
    text-decoration: none;
    z-index: var(--z-max);
    border-radius: var(--radius-md);
    font-weight: var(--font-semibold);
    box-shadow: var(--shadow-lg);
}

.skip-to-content:focus {
    top: var(--space-2);
}

.skip-to-content:hover {
    background: hsl(217, 91%, 35%); /* Even darker on hover */
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    body {
        background: white;
        color: black;
    }
    
    .navbar,
    .footer,
    .hero__gradient-bg,
    .hero__gradient-orb,
    .no-print {
        display: none !important;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .container {
        max-width: 100%;
    }
}