/* Base styles and variables */
:root {
    --primary-color: #2563eb;
    --text-color: #1f2937;
    --bg-color: #ffffff;
    --border-color: #e5e7eb;
    --hover-color: #1d4ed8;
}

[data-theme="dark"] {
    --text-color: #f3f4f6;
    --bg-color: #111827;
    --border-color: #374151;
    --hover-color: #60a5fa;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
}

/* Hero Section */
.hero {
    padding: 8rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.hero-image {
       flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.light-image {
    display: block;
}

.dark-image {
    display: none;
}

[data-theme="dark"] .light-image {
    display: none;
}

[data-theme="dark"] .dark-image {
    display: block;
}

/* Journey Section */
.journey {
    padding: 4rem 2rem;
    background-color: var(--bg-color);
}

.journey-container {
    max-width: 1200px;
    margin: 0 auto;
}

.journey h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: var(--border-color);
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
    width: 50%;
    padding: 0 2rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-content {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
}

.timeline-year {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Portfolio Section */
.portfolio {
    padding: 4rem 2rem;
    background-color: var(--bg-color);
}

.portfolio-container {
    max-width: 1200px;
    margin: 0 auto;
}

.portfolio h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.portfolio-item {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
}

.portfolio-item:hover {
    transform: translateY(-4px);
}

.portfolio-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.portfolio-content {
    padding: 1.5rem;
}

.portfolio-content h3 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

/* Blog Section */
.blog-preview {
    padding: 4rem 2rem;
    background-color: var(--bg-color);
}

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.blog-item {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
}

.blog-item:hover {
    transform: translateY(-4px);
}

.blog-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-content {
    padding: 1.5rem;
}

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

.blog-content h3 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

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

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
}

/* Gallery Section */
.gallery-preview {
    padding: 4rem 2rem;
    background-color: var(--bg-color);
}

.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Gallery Full Page */
.gallery-full {
    padding: 8rem 2rem 4rem;
}

.gallery-carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto 4rem;
    height: 500px;
}

.carousel-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-container img,
.carousel-container iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 2;
}

.carousel-button.prev {
    left: 1rem;
}

.carousel-button.next {
    right: 1rem;
}

.gallery-masonry {
    columns: 3;
    column-gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.masonry-item img,
.masonry-item iframe {
    width: 100%;
    display: block;
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
}

/* Blog Full Page */
.blog-full {
    padding: 8rem 2rem 4rem;
}

.blog-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Blog Post Page */
.blog-post {
    max-width: 800px;
    margin: 8rem auto 4rem;
    padding: 0 2rem;
}

.post-header {
    margin-bottom: 2rem;
}

.post-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.related-posts {
    background-color: var(--bg-color);
    padding: 4rem 2rem;
}

.related-container {
    max-width: 1200px;
    margin: 0 auto;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Portfolio Full Page */
.portfolio-full {
    padding: 8rem 2rem 4rem;
}

.portfolio-full h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
}

.portfolio-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.portfolio-item-full {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
}

.portfolio-item-full:hover {
    transform: translateY(-4px);
}

.portfolio-item-full .portfolio-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.portfolio-item-full .portfolio-content {
    padding: 1.5rem;
}

.portfolio-item-full h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-description {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.project-details {
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    background-color: var(--border-color);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
    transition: color 0.3s;
}

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

/* Footer */
footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    transition: color 0.3s;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        padding: 1rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        margin-top: 1rem;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        width: 100%;
        padding-left: 2rem;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

    .gallery-masonry {
        columns: 2;
    }
}

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

    .gallery-masonry {
        columns: 1;
    }
}