/* Base */
body {
    background-color: #f9f9f9;
    box-sizing: border-box;
    color: #333;
    font-family: 'Georgia', serif;
    font-size: 1em;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a:visited {
    color: inherit;
}

/* Reveal animations (on-load instead of on-scroll) */
.reveal {
    opacity: 1;
    transform: translateY(0);
    animation: fadeSlideUp 0.5s ease-out;
}


/* Apply a gentle load-in to main content blocks */
.blog-container > * {
    animation: fadeSlideUp 0.5s ease-out;
}

footer { 
    animation: fadeSlideUp 0.5s ease-out; 
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Header / Navbar */
.navbar {
    align-items: center;
    animation: fadeSlideIn 0.5s ease-out;
    background-color: #444444;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-left {
    align-items: center;
    display: flex;
}

#navbar-left-link {
    color: inherit;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
    transition: transform 180ms ease;
}

#navbar-left-link:hover {
    transform: translateY(-1px);
}

.profile-img {
    border-radius: 30%;
    height: 60px;
    margin-right: 10px;
    object-fit: cover;
    width: 60px;
}

.name {
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-right {
    display: flex;
    gap: 20px;
}

.navbar-right a {
    color: inherit;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: color 0.3s, transform 180ms ease;
}

.navbar-right a:hover {
    color: #007bff;
}

.navbar-right a:visited {
    color: inherit;
}

.navbar-right a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 220ms ease;
}

.navbar-right a:hover::after,
.navbar-right a:focus-visible::after {
    transform: scaleX(1);
}

.navbar-right a:hover,
.navbar-right a:focus-visible {
    transform: translateY(-1px);
}

/* Active nav link */
.navbar-right a.active {
    color: #007bff;
}
.navbar-right a.active::after {
    transform: scaleX(1);
}

.menu-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: none;
    font-size: 28px;
}

.navbar-right.show {
    background-color: #333;
    padding: 1rem;
    position: absolute;
    right: 0;
    top: 100%;
    width: 100%;
    z-index: 1000;
}

@media (max-width: 768px) {
    .navbar-right {
        background-color: #444444;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        display: none;
        flex-direction: column;
        left: 0;
        padding: 1rem;
        position: absolute;
        right: 0;
        top: 100%;
        width: 100%;
    }

    .navbar-right.show {
        display: flex;
    }

    .navbar-right a {
        padding: 0.5rem 0;
        text-align: center;
    }

    .menu-toggle {
        display: block;
    }
}

/* Blog */
.blog-container {
    margin: 2rem auto;
    max-width: 800px;
    padding: 0 1rem;
}

.blog-post {
    animation: fadeSlideUp 0.5s ease-out;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.blog-post header {
    margin-bottom: 1rem;
}

.blog-post h1 {
    color: #333;
    font-size: 2.2em;
    margin: 0 0 0.75rem 0;
}

.blog-post h2 {
    color: #333;
    margin: 0 0 0.5rem 0;
}

.blog-post time {
    color: #666;
    font-size: 0.9rem;
}

.post-content {
    color: #444;
    line-height: 1.6;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-bottom: 0.5em;
    margin-top: 1.5em;
}

.post-content p {
    margin-bottom: 1em;
}

.post-content a {
    color: #007bff;
    text-decoration: none;
    display: inline-block;
    transition: transform 180ms ease;
}

.post-content a:hover,
.post-content a:focus-visible {
    text-decoration: underline;
    transform: translateY(-2px) scale(1.12);
}

.post-content img {
    border-radius: 4px;
    height: auto;
    margin: 1em 0;
    max-width: 100%;
}

.post-content code {
    background: #f5f5f5;
    border-radius: 3px;
    font-family: monospace;
    padding: 0.2em 0.4em;
}

.post-content pre {
    background: #f5f5f5;
    border-radius: 4px;
    overflow-x: auto;
    padding: 1em;
}

.post-content blockquote {
    border-left: 4px solid #ddd;
    color: #666;
    margin: 1em 0;
    padding-left: 1em;
}

.tags {
    margin-top: 0.5rem;
}

.tag {
    background: #f0f0f0;
    border-radius: 15px;
    color: #666;
    display: inline-block;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    padding: 0.2rem 0.6rem;
}

.blog-post-preview {
    animation: fadeSlideUp 0.5s ease-out;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    padding: 1.5rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.blog-post-preview:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.blog-post-preview header {
    margin-bottom: 1rem;
}

.blog-post-preview h2 {
    margin: 0 0 0.5rem 0;
}

.blog-post-preview h2 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.blog-post-preview h2 a:hover {
    color: #007bff;
}

.blog-post-preview time {
    color: #666;
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.blog-post-preview .post-preview {
    color: #444;
    line-height: 1.6;
}

.blog-post-preview .read-more {
    color: #007bff;
    display: inline-block;
    font-weight: 500;
    margin-top: 1rem;
    text-decoration: none;
    transition: transform 0.2s;
}

.blog-post-preview .read-more:hover {
    transform: translateX(4px);
}

.back-button {
    color: #666;
    display: inline-block;
    margin-bottom: 2rem;
    text-decoration: none;
    transition: color 0.2s;
}

.back-button:hover {
    color: #007bff;
}

.share-links {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 1.5rem;
}

.share-links a {
    color: #007bff;
    text-decoration: none;
}

.share-links a:hover {
    text-decoration: underline;
}

.read-more {
    color: #007bff;
    display: inline-block;
    font-weight: 500;
    margin-top: 1rem;
    text-decoration: none;
    transition: color 0.2s;
}

.read-more:hover {
    color: #0056b3;
}

@media (max-width: 600px) {
    .blog-container {
        padding: 0 0.5rem;
    }

    .blog-post,
    .blog-post-preview {
        padding: 1rem;
    }
}

/* Projects */
#projects {
    animation: fadeSlideIn 0.5s ease-out;
}

/* Education cards */
.edu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.edu-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.25rem 1.5rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.edu-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.edu-card header {
    margin-bottom: 0.5rem;
}

.edu-card h2 {
    margin: 0 0 0.35rem 0;
    font-size: 1.25rem;
}

.edu-card time,
.edu-card .edu-meta {
    color: #666;
    font-size: 0.95rem;
}

.edu-card p {
    color: #444;
    margin: 0.5rem 0 0;
}

.project-links a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    line-height: 1;
    transition: transform 180ms ease;
}

.project-links a:hover,
.project-links a:focus-visible {
    transform: translateY(-2px) scale(1.12);
}

.post-content img,
.post-content video {
    max-width: 70%;
}

/* Center media embedded in markdown content */
.post-content img,
.post-content video,
.post-content iframe {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.project-card img,
.project-image {
    width: 50%;
}

/* Center media in project bottom section */
.project-image,
.project-video,
.project-bottom iframe {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.project-video {
    width: 100%;
}

/* Footer */
footer {
    background-color: rgb(230, 230, 230);
    color: rgb(0, 0, 0);
    padding: 10px 0;
    text-align: center;
}

/* Footer social links */
footer a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    margin: 0 10px;
    line-height: 1;
}

footer a:visited,
footer a:hover,
footer a:active,
footer a:focus {
    color: inherit;
}

footer i {
    font-size: 28px; /* larger icons */
    transition: transform 180ms ease;
    vertical-align: middle;
}

footer a:hover i {
    transform: translateY(-2px) scale(1.12);
}

/* Contact Form */
#contact-form {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    max-width: 600px;
    padding: 20px;
}

#contact-form h2 {
    color: #444;
    margin-bottom: 20px;
    text-align: center;
}

#contact-form label {
    color: #555;
    font-size: 1em;
}

#contact-form form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0 auto;
    max-width: 500px;
    width: 100%;
}

#contact-form input,
#contact-form textarea {
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1em;
    max-width: 450px;
    padding: 10px;
    width: 100%;
}

#contact-form button {
    align-self: center;
    max-width: 150px;
    width: auto;
    font-family: 'Georgia', serif;
    font-size: 1.5em;
    background-color: #555;
    color: white;
    border-radius: 5px;
    border: none;
    transition: transform 220ms ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#contact-form button:hover {
    cursor: pointer;
    transform: translateY(-2px) scale(1.12);

}

.captcha {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Animations */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
