/* ==================================
   CSS Custom Properties (Variables)
   ================================== */
:root {
    /* Railway-themed Color Palette */
    --color-primary: #1e3a8a;        /* Deep Railway Blue */
    --color-primary-light: #3b82f6;  /* Light Blue */
    --color-primary-dark: #1e293b;   /* Dark Slate */
    --color-secondary: #64748b;      /* Steel Gray */
    --color-accent: #f59e0b;         /* Signal Orange */
    --color-background: #f8fafc;     /* Light Gray Background */
    --color-surface: #ffffff;        /* White Surface */
    --color-text: #0f172a;           /* Dark Text */
    --color-text-light: #64748b;     /* Light Text */
    --color-border: #e2e8f0;         /* Border Gray */

    /* Typography */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: 'Arial', sans-serif;

    --font-size-base: 16px;
    --font-size-small: 0.875rem;
    --font-size-large: 1.125rem;
    --font-size-h1: 3rem;
    --font-size-h2: 2rem;
    --font-size-h3: 1.5rem;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;

    /* Layout */
    --max-width: 1200px;
    --nav-height: 70px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

html {
    scroll-behavior: smooth;
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font-primary);
    color: var(--color-text);
    background-color: var(--color-background);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==================================
   Base Element Styles
   ================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

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

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    font-weight: 700;
    color: var(--color-text);
}

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

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

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

p {
    margin-bottom: var(--spacing-sm);
}

/* ==================================
   Utility Classes
   ================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Fade-in animation utility */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================================
   Accessibility
   ================================== */
/* Focus styles for keyboard navigation */
a:focus,
button:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Skip to main content link (for screen readers) */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: var(--spacing-sm);
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

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

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