/* CSS Reset and Variables */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #666;
    --accent-color: #0066cc;
    --background-color: #ffffff;
    --surface-color: #f8f9fa;
    --border-color: #e5e7eb;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --max-width: 720px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    --transition: all 0.2s ease-in-out;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #f0f0f0;
        --secondary-color: #a0a0a0;
        --accent-color: #4da6ff;
        --background-color: #0a0a0a;
        --surface-color: #1a1a1a;
        --border-color: #2a2a2a;
        --text-primary: #f0f0f0;
        --text-secondary: #a0a0a0;
    }
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Ethereum logo background - scattered logos */
.eth-bg-logo {
    position: fixed;
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.eth-bg-logo svg {
    width: 100%;
    height: 100%;
}

.eth-bg-logo svg path {
    fill: #627eea;
}

@media (prefers-color-scheme: dark) {
    .eth-bg-logo svg path {
        fill: #4da6ff;
    }
}

/* Logo 1 - Top left area */
.eth-bg-logo:nth-child(1) {
    width: 200px;
    height: 320px;
    top: 10%;
    left: 5%;
    transform: rotate(-15deg);
    animation: float1 20s ease-in-out infinite;
}

/* Logo 2 - Right side */
.eth-bg-logo:nth-child(2) {
    width: 150px;
    height: 240px;
    top: 50%;
    right: 8%;
    transform: rotate(20deg);
    animation: float2 25s ease-in-out infinite;
}

/* Logo 3 - Bottom left */
.eth-bg-logo:nth-child(3) {
    width: 180px;
    height: 288px;
    bottom: 15%;
    left: 15%;
    transform: rotate(10deg);
    animation: float3 30s ease-in-out infinite;
}

/* Logo 4 - Top right */
.eth-bg-logo:nth-child(4) {
    width: 120px;
    height: 192px;
    top: 20%;
    right: 20%;
    transform: rotate(-25deg);
    animation: float4 22s ease-in-out infinite;
}

/* Logo 5 - Center bottom */
.eth-bg-logo:nth-child(5) {
    width: 160px;
    height: 256px;
    bottom: 10%;
    left: 45%;
    transform: rotate(5deg);
    animation: float5 28s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: rotate(-15deg) translateY(0px); }
    50% { transform: rotate(-15deg) translateY(-20px); }
}

@keyframes float2 {
    0%, 100% { transform: rotate(20deg) translateY(0px); }
    50% { transform: rotate(20deg) translateY(15px); }
}

@keyframes float3 {
    0%, 100% { transform: rotate(10deg) translateY(0px); }
    50% { transform: rotate(10deg) translateY(-25px); }
}

@keyframes float4 {
    0%, 100% { transform: rotate(-25deg) translateY(0px); }
    50% { transform: rotate(-25deg) translateY(20px); }
}

@keyframes float5 {
    0%, 100% { transform: rotate(5deg) translateY(0px); }
    50% { transform: rotate(5deg) translateY(-15px); }
}

/* Darker opacity for dark mode */
@media (prefers-color-scheme: dark) {
    .eth-bg-logo {
        opacity: 0.02;
    }
}

/* Hide some logos on mobile for better performance */
@media (max-width: 768px) {
    .eth-bg-logo:nth-child(4),
    .eth-bg-logo:nth-child(5) {
        display: none;
    }
    
    .eth-bg-logo:nth-child(1) {
        width: 120px;
        height: 192px;
    }
    
    .eth-bg-logo:nth-child(2) {
        width: 100px;
        height: 160px;
    }
    
    .eth-bg-logo:nth-child(3) {
        width: 110px;
        height: 176px;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
    margin-bottom: 1.5rem;
}

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

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background-color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
}

@media (prefers-color-scheme: dark) {
    .site-header {
        background-color: rgba(10, 10, 10, 0.8);
    }
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    position: relative;
}

/* Logo */
.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.logo:hover {
    background-color: var(--surface-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    background-color: var(--surface-color);
    text-decoration: none;
    color: var(--accent-color);
}

.nav-links svg {
    flex-shrink: 0;
}

.nav-links span {
    display: none;
}

@media (min-width: 768px) {
    .nav-links {
        gap: 0.75rem;
    }
    
    .nav-links span {
        display: inline;
    }
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

/* Main Content */
main {
    flex: 1;
    padding: 3rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
    padding-top: 3rem;
}

.profile-image {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.profile-image:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
}

.name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.contact {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.contact:last-of-type {
    margin-bottom: 0;
}

/* Sections */
section {
    margin-bottom: 3rem;
}

section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

/* About Section */
.about p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Lists */
.publication-list,
.project-list {
    list-style: none;
    margin-left: 0;
}

.publication-list li,
.project-list li {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.8;
}

.publication-list li::before,
.project-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.publication-list a,
.project-list a {
    font-weight: 500;
}

/* Footer */
.site-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.site-footer p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--background-color);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        gap: 0.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-links span {
        display: inline;
    }

    .name {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .profile-image {
        width: 180px;
        height: 180px;
    }

    section h2 {
        font-size: 1.5rem;
    }
    
    .blog-card {
        padding: 1.25rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero,
section {
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }

/* Blog Section */
.blog-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
    min-height: 200px;
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-card {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


.blog-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.blog-card h3 a {
    color: var(--text-primary);
    font-weight: 600;
}

.blog-card h3 a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.blog-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.blog-meta.in-progress {
    color: var(--accent-color);
    font-weight: 500;
}

.blog-card p:last-child {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Loading and error states */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.error-message {
    text-align: center;
    padding: 2rem;
    background-color: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.error-message p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.error-message a {
    font-weight: 600;
}

.view-all {
    text-align: center;
    margin-top: 2rem;
}

.view-all a {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
}

.view-all a:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    text-decoration: none;
    transform: translateX(4px);
}

/* Load more button */
.load-more-btn {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.load-more-btn:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Focus Styles */
a:focus,
button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer {
        display: none;
    }
    
    main {
        padding: 0;
    }
    
    a {
        text-decoration: underline;
    }
}