/* Modern sleek portfolio styles */
:root {
    --primary: #22223b;
    --secondary: #4a4e69;
    --accent: #f2e9e4;
    --highlight: #9a8c98;
    --white: #fff;
    --shadow: 0 4px 24px rgba(34, 34, 59, 0.08);
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Quicksand', 'Segoe UI', Arial, sans-serif;
    background: var(--accent);
    color: var(--primary);
    font-size: 18px;
    line-height: 1.7;
}

.main {
    max-width: 700px;
    margin: 3rem auto;
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
}

.centered {
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.3em;
}

h2 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 1.5em;
}

ul {
    list-style: none;
    margin-bottom: 2em;
    padding: 0;
}

ul li {
    margin-bottom: 0.7em;
    font-size: 1.1em;
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--highlight);
    text-decoration: underline;
}

em {
    font-style: normal;
    color: var(--highlight);
    font-weight: 600;
}

dl {
    display: grid;
    grid-template-columns: 1fr 2.5fr;
    gap: 1.2rem 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
}

dl dt {
    font-weight: 600;
    color: var(--secondary);
}

dl dd {
    margin: 0;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.badges img {
    height: 90px;
    max-width: 140px;
    border-radius: 10px;
    background: var(--accent);
    box-shadow: var(--shadow);
    padding: 0.5rem;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem 2rem 1rem;
    background: linear-gradient(120deg, var(--secondary) 0%, var(--primary) 100%);
    color: var(--white);
    border-radius: 0 0 24px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 2.5rem;
}

.hero-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 12px rgba(34, 34, 59, 0.10);
}

.hero h1,
.hero h2,
.hero p {
    color: var(--white);
}

.hero-intro {
    font-size: 1.1rem;
    margin-top: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.cards-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.5rem 1.2rem;
    min-width: 220px;
    flex: 1 1 250px;
    max-width: 320px;
    transition: transform 0.25s cubic-bezier(.4, 2, .6, 1), box-shadow 0.25s;
    will-change: transform, box-shadow;
}

.card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 8px 32px rgba(34, 34, 59, 0.16);
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.1rem;
    justify-content: flex-start;
    align-items: center;
    margin-top: 1rem;
}

.skills-list span {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(34, 34, 59, 0.06);
}

.skills-list span:hover {
    background: var(--highlight);
}

.skills-list img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1rem;
}

.project-card {
    display: block;
    background: var(--accent);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    box-shadow: 0 2px 12px rgba(34, 34, 59, 0.08);
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    color: var(--primary);
}

.project-card:hover {
    background: var(--highlight);
    color: var(--white);
    box-shadow: 0 6px 24px rgba(34, 34, 59, 0.16);
    transform: translateY(-4px) scale(1.02);
}

.project-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.project-desc {
    font-size: 0.98rem;
    opacity: 0.85;
}

.info-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.info-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.5rem 1.2rem;
    min-width: 220px;
    flex: 1 1 250px;
    max-width: 320px;
    margin-bottom: 1rem;
}

.social-list {
    display: flex;
    gap: 1.2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: var(--secondary);
    box-shadow: 0 2px 8px rgba(34, 34, 59, 0.06);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
}

.social-btn img {
    width: 28px;
    height: 28px;
}

.social-btn:hover {
    background: var(--highlight);
    color: var(--white);
    box-shadow: 0 6px 24px rgba(34, 34, 59, 0.16);
    transform: translateY(-2px) scale(1.04);
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.article-card {
    display: block;
    background: var(--accent);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    box-shadow: 0 2px 12px rgba(34, 34, 59, 0.08);
    transition: background 0.2s, box-shadow 0.2s, color 0.2s, transform 0.2s;
    color: var(--primary);
    text-decoration: none;
}

.article-card:hover {
    background: var(--highlight);
    color: var(--white);
    box-shadow: 0 6px 24px rgba(34, 34, 59, 0.16);
    transform: translateY(-2px) scale(1.02);
}

.article-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.article-meta {
    font-size: 0.92rem;
    opacity: 0.8;
}

/* Fade-in and scroll-reveal animations */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(.4, 2, .6, 1), transform 0.7s cubic-bezier(.4, 2, .6, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: none;
}

body.dark {
    --primary: #f2e9e4;
    --secondary: #c9ada7;
    --accent: #22223b;
    --highlight: #4a4e69;
    --white: #232136;
    background: var(--accent);
    color: var(--primary);
}

/* Ensure .main is dark in dark mode */
body.dark .main {
    background: #232136;
    color: var(--primary);
}

body.dark .card,
body.dark .info-card {
    box-shadow: 0 4px 24px rgba(34, 34, 59, 0.25);
}

body.dark .project-card,
body.dark .article-card,
body.dark .social-btn,
body.dark .skills-list span {
    background: #2a273f;
    color: var(--primary);
}

body.dark .project-card:hover,
body.dark .article-card:hover,
body.dark .social-btn:hover,
body.dark .skills-list span:hover {
    background: var(--highlight);
    color: #fff;
}

body.dark .hero {
    background: linear-gradient(120deg, #232136 0%, #2a273f 100%);
    color: var(--primary);
}

body.dark .hero h1,
body.dark .hero h2,
body.dark .hero p {
    color: var(--primary);
}

body.dark input[type="text"] {
    background: #232136;
    color: var(--primary);
    border-color: var(--highlight);
}

body.dark input[type="text"].error {
    background: #3a2a3a;
    border-color: #e57373;
}

body.dark button {
    background: var(--highlight);
    color: #fff;
}

body.dark button:hover {
    background: var(--secondary);
}

.dark-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;
    background: var(--card-bg, #fff);
    color: var(--text-color, #222);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.dark-toggle:hover {
    background: var(--highlight);
    color: #fff;
}

/* Responsive card layout improvements */
.cards-section,
.info-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.card,
.info-card {
    flex: 1 1 320px;
    min-width: 260px;
    max-width: 370px;
    margin: 0 auto;
}

@media (max-width: 900px) {

    .cards-section,
    .info-section {
        flex-direction: column;
        gap: 1.2rem;
        align-items: stretch;
    }

    .card,
    .info-card {
        max-width: 100%;
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .main {
        padding: 1.2rem 0.5rem;
    }

    .hero {
        padding: 2rem 0.5rem 1.2rem 0.5rem;
    }

    .hero-img {
        width: 80px;
        height: 80px;
    }

    .dark-toggle {
        top: 0.7rem;
        right: 0.7rem;
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }
}