/**
 * LCARS FOUNDATION CSS
 * Base styles, CSS variables, and typography
 * Based on TNG LCARS (1987-1994) and SNW LCARS (2022+)
 *
 * @version 1.0
 * @date 2025-12-29
 */

/* ============================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================ */

:root {
    /* === LCARS COLOR PALETTE === */

    /* Command/Alert Colors */
    --lcars-orange: #FF9900;
    --lcars-alert-red: #CC6666;
    --lcars-orange-cream: #FFCC99;

    /* Informational Colors */
    --lcars-gold: #FFCC66;
    --lcars-yellow-tan: #FFFF99;

    /* Science/Medical Colors */
    --lcars-blue: #9999FF;
    --lcars-blue-bell: #99CCFF;
    --lcars-navy: #000080;
    --lcars-green: #99CC99;

    /* Operations Colors */
    --lcars-purple: #CC99CC;
    --lcars-pink: #FF99CC;

    /* Backgrounds */
    --lcars-black: #000000;
    --lcars-dark-grey: #333333;
    --lcars-medium-grey: #666666;

    /* Text Colors */
    --lcars-text-white: #FFFFFF;
    --lcars-text-grey: #CCCCCC;
    --lcars-text-on-orange: #000000;
    --lcars-text-on-blue: #FFFFFF;
    --lcars-text-on-black: #FFCC66;

    /* === TYPOGRAPHY === */

    /* Font Families */
    --lcars-font: 'Antonio', 'Swiss 911 Ultra Compressed', 'Helvetica Ultra Compressed', 'Arial Narrow', sans-serif;
    --lcars-fallback: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui;
    --lcars-mono: 'Courier New', 'Consolas', monospace;

    /* Font Sizes */
    --font-size-h1: 32px;
    --font-size-h2: 24px;
    --font-size-h3: 20px;
    --font-size-h4: 18px;
    --font-size-base: 16px;
    --font-size-small: 14px;
    --font-size-tiny: 12px;
    --font-size-button: 14px;
    --font-size-label: 12px;
    --font-size-caption: 10px;

    /* Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.4;
    --line-height-relaxed: 1.6;

    /* === SPACING === */

    /* Spacing Scale (8px base) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* === BORDER RADII === */

    --radius-small: 8px;
    --radius-medium: 15px;
    --radius-large: 30px;
    --radius-pill: 9999px;

    /* === TRANSITIONS === */

    --transition-fast: 150ms;
    --transition-base: 300ms;
    --transition-slow: 500ms;
    --easing: cubic-bezier(0.4, 0.0, 0.2, 1);

    /* === GLASSMORPHISM STANDARDS === */
    --lcars-glass-blur: 20px;
    --lcars-glass-saturate: 150%;
    --lcars-glass-opacity: 0.7;
    --lcars-glass-bg: rgba(0, 0, 0, var(--lcars-glass-opacity));
    --lcars-glass-border: rgba(153, 204, 255, 0.25);
}

/* ============================================
   CSS RESET & BASE STYLES
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--lcars-font);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--lcars-text-white);
    background-color: var(--lcars-black);
    background-image:
        /* subtle dual radial tint for depth */
        radial-gradient(ellipse at top, rgba(153, 153, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(255, 153, 0, 0.02) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--lcars-font);
    font-weight: bold;
    line-height: var(--line-height-tight);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--lcars-text-white);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: var(--font-size-h1);
    color: var(--lcars-orange);
}

h2 {
    font-size: var(--font-size-h2);
    color: var(--lcars-gold);
}

h3 {
    font-size: var(--font-size-h3);
    color: var(--lcars-blue);
}

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

p {
    margin-bottom: var(--space-md);
    line-height: var(--line-height-relaxed);
}

a {
    color: var(--lcars-orange);
    text-decoration: none;
    transition: color var(--transition-fast) var(--easing);
}

a:hover {
    color: var(--lcars-gold);
}

a:focus-visible {
    outline: 2px solid var(--lcars-orange);
    outline-offset: 2px;
}

strong, b {
    font-weight: bold;
    color: var(--lcars-text-white);
}

em, i {
    font-style: italic;
    color: var(--lcars-text-grey);
}

code {
    font-family: var(--lcars-mono);
    font-size: 0.9em;
    background: rgba(255, 153, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--lcars-orange);
}

pre {
    font-family: var(--lcars-mono);
    background: var(--lcars-dark-grey);
    padding: var(--space-md);
    border-left: 4px solid var(--lcars-orange);
    border-radius: var(--radius-small);
    overflow-x: auto;
    margin-bottom: var(--space-md);
}

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

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

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Transform */
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }
.text-normal-case { text-transform: none; }

/* Color Utilities */
.text-orange { color: var(--lcars-orange); }
.text-gold { color: var(--lcars-gold); }
.text-blue { color: var(--lcars-blue); }
.text-green { color: var(--lcars-green); }
.text-pink { color: var(--lcars-pink); }
.text-white { color: var(--lcars-text-white); }
.text-grey { color: var(--lcars-text-grey); }

.bg-orange { background-color: var(--lcars-orange); }
.bg-gold { background-color: var(--lcars-gold); }
.bg-blue { background-color: var(--lcars-blue); }
.bg-green { background-color: var(--lcars-green); }
.bg-pink { background-color: var(--lcars-pink); }
.bg-black { background-color: var(--lcars-black); }
.bg-dark-grey { background-color: var(--lcars-dark-grey); }

/* Spacing Utilities */
.m-0 { margin: 0; }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }

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

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

.p-0 { padding: 0; }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

/* Display Utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

/* Flex Utilities */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus Visible (keyboard navigation) */
:focus-visible {
    outline: 2px solid var(--lcars-orange);
    outline-offset: 2px;
}

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

/* 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 BREAKPOINTS
   ============================================ */

/* Mobile First Approach */
/* Default styles = mobile (< 768px) */

/* Tablet: 768px and up */
@media (min-width: 768px) {
    :root {
        --font-size-h1: 40px;
        --font-size-h2: 28px;
        --font-size-h3: 24px;
    }
}

/* Desktop: 1024px and up */
@media (min-width: 1024px) {
    :root {
        --font-size-h1: 48px;
        --font-size-h2: 32px;
        --font-size-h3: 26px;
    }
}

/* Large Desktop: 1440px and up */
@media (min-width: 1440px) {
    :root {
        --font-size-h1: 56px;
        --font-size-h2: 36px;
        --font-size-h3: 28px;
    }
}
