/* ============================================
   BASE.CSS — Ultimate Design System
   Anthony Shen Portfolio
   ============================================ */

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

/* === DESIGN TOKENS === */
:root {
    /* Colors - Primary */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #181818;
    --bg-card: #1c1c1c;
    --bg-elevated: #242424;
    
    /* Colors - Accent */
    --accent-gold: #d4a853;
    --accent-gold-light: #e8c77b;
    --accent-gold-dark: #b8923f;
    --accent-gold-muted: rgba(212, 168, 83, 0.15);
    --accent-teal: #3eb8a8;
    --accent-teal-light: #5fd4c4;
    --accent-teal-muted: rgba(62, 184, 168, 0.15);
    
    /* Colors - Semantic */
    --accent-pink: #e879a9;
    --accent-purple: #a17fe0;
    --accent-blue: #5b9cf4;
    --accent-green: #4ade80;
    --accent-orange: #fb923c;
    --accent-red: #f87171;
    
    /* Colors - Text */
    --text-primary: #f8f6f1;
    --text-secondary: #a8a49c;
    --text-muted: #6b6860;
    --text-inverse: #0a0a0a;
    
    /* Colors - Borders */
    --border-subtle: rgba(212, 168, 83, 0.12);
    --border-muted: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    
    /* Colors - Effects */
    --glow-gold: rgba(212, 168, 83, 0.4);
    --glow-teal: rgba(62, 184, 168, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 30px 70px rgba(0, 0, 0, 0.6);
    
    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3.5rem;
    --text-6xl: 4.5rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-2xl: 36px;
    --radius-full: 9999px;
    
    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 150ms;
    --duration-base: 300ms;
    --duration-slow: 500ms;
    --duration-slower: 700ms;
    
    /* Layout */
    --max-width: 1400px;
    --nav-height: 80px;
}

/* === BASE STYLES === */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    font-size: var(--text-base);
}

/* Noise Texture Overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.025;
    pointer-events: none;
    z-index: 10000;
}

/* Selection */
::selection {
    background: var(--accent-gold);
    color: var(--text-inverse);
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 3px;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 3px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* === CONGRESSIONAL MEDAL BADGE === */
.medal-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.2), rgba(212, 168, 83, 0.1));
    border: 2px solid var(--accent-gold);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-6);
    animation: medalGlow 3s ease-in-out infinite;
}

.medal-badge .medal-icon {
    font-size: 1.5rem;
    animation: medalBounce 2s ease-in-out infinite;
}

.medal-badge .medal-text {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes medalGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(212, 168, 83, 0.3); }
    50% { box-shadow: 0 0 40px rgba(212, 168, 83, 0.5); }
}

@keyframes medalBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* === PHOTO PLACEHOLDERS === */
.photo-placeholder {
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-8);
    transition: all var(--duration-base) ease;
    position: relative;
    overflow: hidden;
}

.photo-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(212, 168, 83, 0.05) 50%, transparent 60%);
    background-size: 200% 200%;
    animation: placeholderShimmer 3s ease-in-out infinite;
}

@keyframes placeholderShimmer {
    0% { background-position: 200% 200%; }
    100% { background-position: -200% -200%; }
}

.photo-placeholder:hover {
    border-color: var(--accent-gold);
    border-style: solid;
}

.photo-placeholder .placeholder-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.6;
    position: relative;
    z-index: 1;
}

.photo-placeholder .placeholder-text {
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: var(--space-2);
    position: relative;
    z-index: 1;
}

.photo-placeholder .placeholder-size {
    font-size: var(--text-xs);
    color: var(--text-muted);
    opacity: 0.7;
    position: relative;
    z-index: 1;
}

/* Photo placeholder with actual image */
.photo-placeholder.has-image {
    padding: 0;
    border: none;
}

.photo-placeholder.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

/* Specific sizes */
.hero-photo {
    aspect-ratio: 5/6;
    margin-bottom: var(--space-6);
}

.project-photo {
    aspect-ratio: 16/10;
    min-height: 200px;
}

.profile-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
}

/* === AWARDS BANNER === */
.awards-banner {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-muted);
    border-bottom: 1px solid var(--border-muted);
    padding: var(--space-5) 0;
    overflow: hidden;
    position: relative;
}

.awards-scroll {
    display: flex;
    gap: var(--space-12);
    animation: scrollBanner 30s linear infinite;
    width: max-content;
}

.award-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    white-space: nowrap;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--text-sm);
}

.award-item .award-icon {
    font-size: 1.25rem;
}

@keyframes scrollBanner {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* === NAVIGATION === */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: var(--space-5) 0;
    transition: all var(--duration-slow) var(--ease-out);
}

.nav-container.scrolled {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border-muted);
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-12);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 500;
    color: var(--accent-gold);
    letter-spacing: 0.01em;
    transition: all var(--duration-base) var(--ease-out);
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width var(--duration-base) var(--ease-out);
}

.logo:hover {
    text-shadow: 0 0 40px var(--glow-gold);
}

.logo:hover::after {
    width: 100%;
}

.nav-links {
    display: flex;
    gap: var(--space-2);
    list-style: none;
}

.nav-link {
    padding: var(--space-3) var(--space-5);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: var(--radius-full);
    transition: all var(--duration-base) var(--ease-out);
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    transition: all var(--duration-base) ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::before {
    border-color: var(--border-subtle);
    background: var(--accent-gold-muted);
}

.nav-link.active {
    color: var(--text-inverse);
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    font-weight: 600;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    z-index: 1001;
}

.mobile-toggle span {
    width: 26px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--duration-base) var(--ease-out);
    transform-origin: center;
}

.mobile-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-8);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    color: var(--text-inverse);
    box-shadow: 0 4px 20px rgba(212, 168, 83, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 40px rgba(212, 168, 83, 0.45);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary svg {
    transition: transform var(--duration-base) var(--ease-out);
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--accent-gold-muted);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
}

/* === SECTION LABELS === */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-6);
}

.section-label::before {
    content: '';
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-gold));
}

/* === PAGE HEADER === */
.page-header {
    padding: var(--space-24) var(--space-12) var(--space-16);
    max-width: var(--max-width);
    margin: 0 auto;
    border-bottom: 1px solid var(--border-muted);
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(var(--text-4xl), 7vw, var(--text-6xl));
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: var(--space-4);
}

.page-header p {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    max-width: 600px;
}

/* === MAIN CONTENT === */
.main-content {
    padding-top: var(--nav-height);
    position: relative;
    z-index: 1;
}

/* === FOOTER === */
.footer {
    padding: var(--space-12);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
    border-top: 1px solid var(--border-muted);
    background: var(--bg-secondary);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    :root {
        --space-12: 2rem;
    }
}

@media (max-width: 1024px) {
    nav {
        padding: 0 var(--space-8);
    }
    
    .page-header {
        padding: var(--space-20) var(--space-8) var(--space-12);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--space-4);
        padding: var(--space-8);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-link {
        font-size: var(--text-lg);
        padding: var(--space-4) var(--space-8);
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    nav {
        padding: 0 var(--space-6);
    }
    
    .page-header {
        padding: var(--space-16) var(--space-6) var(--space-10);
    }
    
    .footer {
        padding: var(--space-8) var(--space-6);
    }
    
    .medal-badge {
        padding: var(--space-2) var(--space-4);
    }
    
    .medal-badge .medal-text {
        font-size: var(--text-xs);
    }
}

/* === UTILITIES === */
.text-gradient {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.6; 
        transform: scale(0.92); 
    }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
