/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
    /* Colors - Professional medical palette */
    --color-primary: #0066CC;
    --color-primary-dark: #004C99;
    --color-primary-light: #E6F0FA;
    
    --color-accent: #00A878;
    --color-accent-light: #E6F7F3;
    
    --color-text-primary: #1A202C;
    --color-text-secondary: #4A5568;
    --color-text-tertiary: #718096;
    
    --color-background: #F7FAFC;
    --color-surface: #FFFFFF;
    --color-border: #E2E8F0;
    --color-border-light: #EDF2F7;
    
    /* Project-specific accent colors */
    --color-heparin: #DC2626;
    --color-nicu: #EC4899;
    --color-tpn: #8B5CF6;
    --color-medsort: #0891B2;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* 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), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Container */
    --container-max-width: 900px;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-background);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ========================================
   Background Animation
   ======================================== */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--color-primary-light), rgba(0, 102, 204, 0.2));
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--color-accent-light), rgba(0, 168, 120, 0.15));
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

/* ========================================
   Container
   ======================================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    position: relative;
    z-index: 1;
}

/* ========================================
   Header
   ======================================== */
.header {
    text-align: center;
    padding: var(--spacing-3xl) 0;
    margin-bottom: var(--spacing-xl);
}

.header-content {
    animation: fadeInUp 0.6s ease-out;
}

.name-section {
    margin-bottom: var(--spacing-md);
}

.name {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto var(--spacing-xl);
    border: 4px solid var(--color-surface);
    box-shadow: var(--shadow-lg);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.credentials {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-primary);
    letter-spacing: 0.05em;
    margin-top: var(--spacing-xs);
}

.title-section {
    margin-top: var(--spacing-lg);
}

.title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.subtitle {
    font-size: 1rem;
    color: var(--color-text-tertiary);
    margin-top: var(--spacing-xs);
}

/* ========================================
   About Section
   ======================================== */
.about-section {
    margin-bottom: var(--spacing-3xl);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.about-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border-light);
    display: flex;
    gap: var(--spacing-xl);
    align-items: flex-start;
}

.about-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: var(--color-primary-light);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.about-content h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
}

.about-content p {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* ========================================
   Projects Section
   ======================================== */
.projects-section {
    margin-bottom: var(--spacing-3xl);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.section-description {
    font-size: 1.1rem;
    color: var(--color-text-tertiary);
    max-width: 500px;
    margin: 0 auto;
}

.projects-grid {
    display: grid;
    gap: var(--spacing-lg);
}

/* ========================================
   Project Cards
   ======================================== */
.project-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
    display: flex;
    gap: var(--spacing-lg);
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    transition: 
        transform var(--transition-base),
        box-shadow var(--transition-base),
        border-color var(--transition-base);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-border);
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover .project-arrow {
    opacity: 1;
    transform: translate(0, 0);
}

/* Project card accent colors */
.project-card:has(.project-icon.heparin)::before {
    background: var(--color-heparin);
}

.project-card:has(.project-icon.nicu)::before {
    background: var(--color-nicu);
}

.project-card:has(.project-icon.tpn)::before {
    background: var(--color-tpn);
}

.project-card:has(.project-icon.medsort)::before {
    background: var(--color-medsort);
}

/* Fallback for browsers without :has() support */
@supports not selector(:has(*)) {
    .project-card::before {
        background: var(--color-primary);
    }
}

.project-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base);
}

.project-card:hover .project-icon {
    transform: scale(1.05);
}

.project-icon.heparin {
    background: rgba(220, 38, 38, 0.1);
    color: var(--color-heparin);
}

.project-icon.nicu {
    background: rgba(236, 72, 153, 0.1);
    color: var(--color-nicu);
}

.project-icon.tpn {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-tpn);
}

.project-icon.medsort {
    background: rgba(8, 145, 178, 0.1);
    color: var(--color-medsort);
}

.project-content {
    flex: 1;
    min-width: 0;
}

.project-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
    display: inline;
}

.project-content p {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.status-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    margin-left: var(--spacing-sm);
    vertical-align: middle;
}

.status-badge.beta {
    background: rgba(139, 92, 246, 0.15);
    color: var(--color-tpn);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-tertiary);
    background: var(--color-background);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border-light);
}

.project-arrow {
    flex-shrink: 0;
    color: var(--color-text-tertiary);
    opacity: 0;
    transform: translate(-8px, 8px);
    transition: 
        opacity var(--transition-base),
        transform var(--transition-base),
        color var(--transition-base);
    align-self: flex-start;
}

.project-card:hover .project-arrow {
    color: var(--color-primary);
}

/* Animation delays for cards */
.project-card:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.3s both; }
.project-card:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.4s both; }
.project-card:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.5s both; }
.project-card:nth-child(4) { animation: fadeInUp 0.6s ease-out 0.6s both; }

/* ========================================
   Disclaimer Section
   ======================================== */
.disclaimer-section {
    margin-bottom: var(--spacing-2xl);
    animation: fadeInUp 0.6s ease-out 0.7s both;
}

.disclaimer-card {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border: 1px solid #FCD34D;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.disclaimer-icon {
    flex-shrink: 0;
    color: #D97706;
    margin-top: 2px;
}

.disclaimer-card p {
    font-size: 0.875rem;
    color: #92400E;
    line-height: 1.6;
}

.disclaimer-card strong {
    font-weight: 600;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    text-align: center;
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--color-border-light);
    animation: fadeInUp 0.6s ease-out 0.8s both;
}

.footer p {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    :root {
        --spacing-2xl: 2rem;
        --spacing-3xl: 2.5rem;
    }
    
    .container {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .header {
        padding: var(--spacing-2xl) 0;
    }
    
    .about-card {
        flex-direction: column;
        padding: var(--spacing-xl);
    }
    
    .about-icon {
        width: 48px;
        height: 48px;
    }
    
    .project-card {
        flex-direction: column;
        padding: var(--spacing-lg);
    }
    
    .project-card::before {
        width: 100%;
        height: 4px;
        top: 0;
        left: 0;
    }
    
    .project-arrow {
        position: absolute;
        top: var(--spacing-lg);
        right: var(--spacing-lg);
        opacity: 0.5;
        transform: none;
    }
    
    .project-card:hover .project-arrow {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 480px) {
    .name {
        font-size: 2rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .project-content h3 {
        font-size: 1.1rem;
    }
    
    .status-badge {
        display: block;
        margin: var(--spacing-sm) 0 0 0;
        width: fit-content;
    }
}

/* ========================================
   Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .gradient-orb {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
.project-card:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.project-card:focus:not(:focus-visible) {
    outline: none;
}

.project-card:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-border: #000;
        --color-text-secondary: #333;
        --color-text-tertiary: #444;
    }
    
    .project-card {
        border-width: 2px;
    }
}

/* Dark mode support (optional - uncomment if desired) */
/*
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #0F172A;
        --color-surface: #1E293B;
        --color-text-primary: #F1F5F9;
        --color-text-secondary: #CBD5E1;
        --color-text-tertiary: #94A3B8;
        --color-border: #334155;
        --color-border-light: #1E293B;
        --color-primary-light: rgba(0, 102, 204, 0.2);
        --color-accent-light: rgba(0, 168, 120, 0.2);
    }
    
    .gradient-orb {
        opacity: 0.2;
    }
    
    .disclaimer-card {
        background: linear-gradient(135deg, rgba(217, 119, 6, 0.1) 0%, rgba(217, 119, 6, 0.15) 100%);
        border-color: rgba(217, 119, 6, 0.3);
    }
    
    .disclaimer-card p {
        color: #FCD34D;
    }
    
    .disclaimer-icon {
        color: #FCD34D;
    }
}
*/