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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.05);
    --shadow-md: rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --max-width: 800px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-bg: rgba(255, 255, 255, 0.9);
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e5e5e5;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-md: rgba(0, 0, 0, 0.5);
    --nav-bg: rgba(26, 26, 26, 0.9);
    --code-bg: #0d0d0d;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

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

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

/* Navigation */
.nav {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease;
}

.nav-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.nav-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.theme-toggle-item {
    display: flex;
    align-items: center;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
}

.theme-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.theme-toggle:hover .theme-toggle-icon {
    transform: scale(1.1);
}

.theme-toggle-icon {
    transition: transform 0.3s ease;
    line-height: 1;
}

/* Hero Section */
.hero {
    padding: 8rem 0 6rem;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.hero-content {
    max-width: 700px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

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

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

/* Sections */
.featured-posts,
.skills-section,
.blog-list {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}

/* Post Cards */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.post-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px var(--shadow-md);
    border-color: var(--accent);
}

.post-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-bottom: 0.75rem;
}

.post-card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.post-card-title a {
    color: var(--text-primary);
}

.post-card-title a:hover {
    color: var(--accent);
}

.post-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.813rem;
    font-weight: 500;
}

.post-card-link {
    color: var(--accent);
    font-weight: 600;
    align-self: flex-start;
}

.post-card-link:hover {
    gap: 0.5rem;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--shadow-md);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.skill-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.skill-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* Blog Page */
.blog-header,
.about-section,
.contact-section {
    padding: 6rem 0 3rem;
    text-align: center;
}

.page-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.posts-list {
    margin-top: 4rem;
}

.post-list-item {
    display: flex;
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

.post-list-item:first-child {
    padding-top: 0;
}

.post-list-date {
    flex-shrink: 0;
    width: 120px;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding-top: 0.25rem;
}

.post-list-content {
    flex: 1;
}

.post-list-title {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.post-list-title a {
    color: var(--text-primary);
    transition: var(--transition);
}

.post-list-title a:hover {
    color: var(--accent);
}

.post-list-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.post-list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.read-more {
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
}

/* Post Article */
.post-article {
    padding: 4rem 0;
}

.post-container {
    max-width: 720px;
}

.post-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.post-title {
    font-size: 2.75rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 2rem;
    color: var(--text-muted);
    font-size: 0.938rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-content h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.post-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.post-content code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
    color: var(--accent);
}

.post-content pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content pre code {
    background: transparent;
    padding: 0;
    color: var(--code-text);
}

.post-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
}

.post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.back-link {
    color: var(--text-secondary);
    font-weight: 500;
}

.back-link:hover {
    color: var(--accent);
}

/* About Page */
.about-container {
    max-width: 800px;
    text-align: left;
}

.about-intro {
    margin: 3rem 0;
}

.lead {
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 400;
}

.about-text h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.cv-section {
    margin: 4rem 0;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    text-align: center;
}

.cv-download {
    margin-top: 2rem;
}

.cv-note {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.skill-tag {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.938rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.skill-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* Contact Page */
.contact-container {
    max-width: 900px;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 4rem;
    text-align: left;
}

.contact-methods {
    margin-top: 2rem;
}

.contact-method {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.contact-method:first-child {
    padding-top: 0;
}

.contact-method:last-child {
    border-bottom: none;
}

.contact-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.contact-method h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.contact-method a {
    color: var(--text-secondary);
}

.contact-method a:hover {
    color: var(--accent);
}

.response-time {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.contact-form-container h2 {
    margin-bottom: 1rem;
}

.form-note {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.service-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.contact-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-disabled-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 1rem 0;
    text-align: center;
    margin-top: 6rem;
    border-top: 1px solid var(--border);
}

.footer p {
    margin-bottom: 0.15rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Utilities */
.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .nav-container {
        padding: 1rem 1.5rem 0.75rem;
        gap: 0.75rem;
    }

    .nav-bottom {
        justify-content: center;
    }

    .logo {
        font-size: 1.25rem;
    }

    .theme-toggle {
        min-width: 36px;
        min-height: 36px;
        padding: 0.35rem 0.45rem;
        font-size: 1rem;
    }

    .nav-links {
        gap: 1.25rem;
        font-size: 0.9rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        padding: 3rem 0 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .post-list-item {
        flex-direction: column;
        gap: 1rem;
    }

    .post-list-date {
        width: auto;
    }

    .page-title {
        font-size: 2.25rem;
    }

    .post-title {
        font-size: 2rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .footer {
        padding: 0.75rem 0;
        margin-top: 3rem;
    }

    .footer p {
        font-size: 0.8rem;
        margin-bottom: 0.1rem;
    }

    .footer-tagline {
        font-size: 0.75rem;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .nav-container {
        padding: 0.75rem 1rem 0.5rem;
        gap: 0.5rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.85rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .logo {
        font-size: 1.1rem;
    }

    .theme-toggle {
        min-width: 34px;
        min-height: 34px;
        padding: 0.3rem 0.4rem;
        font-size: 0.95rem;
    }

    .footer {
        padding: 0.5rem 0;
    }

    .footer p {
        font-size: 0.75rem;
    }

    .footer-tagline {
        font-size: 0.7rem;
    }
}
