
/* ---------- RESET & BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    padding: 2rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ---------- THEMES ---------- */
[data-theme="light"] {
    --bg: #ffffff;
    --text: #1a1a2e;
    --card-bg: #f8f9fa;
    --border: #dee2e6;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --input-bg: #ffffff;
    --btn-bg: #1a1a2e;
    --btn-text: #ffffff;
    --accent: #4a6cf7;
    --muted: #6c757d;
    --tag-bg: #e9ecef;
    --profile-border: #4a6cf7;
}

[data-theme="dark"] {
    --bg: #0d1117;
    --text: #e6edf3;
    --card-bg: #161b22;
    --border: #30363d;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --input-bg: #0d1117;
    --btn-bg: #e6edf3;
    --btn-text: #0d1117;
    --accent: #58a6ff;
    --muted: #8b949e;
    --tag-bg: #21262d;
    --profile-border: #58a6ff;
}

body {
    background: var(--bg);
    color: var(--text);
}

/* ---------- THEME TOGGLE ---------- */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: 0.2s;
    z-index: 999;
}

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

/* ---------- HEADER WITH PHOTO ---------- */
header {
    margin-top: 2rem;
    margin-bottom: 3rem;
    text-align: center;
}

.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-photo-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--accent), #a855f7, var(--accent));
    background-size: 300% 300%;
    animation: gradientMove 4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.profile-photo-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 3px solid var(--bg);
    transition: border-color 0.3s;
}

/* Fallback if image doesn't load */
.profile-photo-wrapper .fallback-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--accent);
    border: 3px solid var(--bg);
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-top: 0.3rem;
}

header .subtitle {
    font-size: 1.2rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

/* ---------- SECTIONS ---------- */
section {
    margin-bottom: 3.5rem;
    background: var(--card-bg);
    padding: 2rem 2rem 2.2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: background 0.3s, border 0.3s;
}

section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

section h2 i {
    color: var(--accent);
}

/* ---------- ABOUT ---------- */
.about-text {
    font-size: 1.1rem;
    max-width: 700px;
}

/* ---------- WORK ---------- */
.work-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border);
}

.work-item:last-child {
    border-bottom: none;
}

.work-icon {
    font-size: 2.2rem;
    min-width: 50px;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-content {
    flex: 1;
}

.work-content h3 {
    font-size: 1.15rem;
    margin-bottom: 0.1rem;
}

.work-content .role {
    font-weight: 500;
    color: var(--accent);
}

.work-content .date {
    color: var(--muted);
    font-size: 0.9rem;
}

.work-content .desc {
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 0.95rem;
}

/* ---------- PROJECTS ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
}

.project-card {
    background: var(--bg);
    padding: 1.2rem 1.4rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: 0.2s;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.project-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.project-card p {
    color: var(--muted);
    font-size: 0.95rem;
}

.project-card .tech {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: 0.8rem;
    background: var(--tag-bg);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* ---------- SKILLS (WITH LOGOS) ---------- */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background: var(--bg);
    padding: 0.5rem 1.2rem 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

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

.skill-tag i,
.skill-tag .devicon {
    font-size: 1.4rem;
}

[data-theme="dark"] .skill-tag .devicon {
    color: #e6edf3;
}

/* ---------- ARTICLES ---------- */
.article-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item .icon {
    font-size: 1.5rem;
    color: var(--accent);
    min-width: 40px;
}

.article-item .info h4 {
    font-size: 1.05rem;
}

.article-item .info h4 a {
    color: var(--text);
    text-decoration: none;
    transition: 0.2s;
}

.article-item .info h4 a:hover {
    color: var(--accent);
}

.article-item .info .meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.article-item .info .meta .tag {
    background: var(--tag-bg);
    padding: 0.1rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 0.3rem;
}

/* ---------- CONTACT FORM ---------- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
}

.contact-form input,
.contact-form textarea {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.contact-form textarea {
    min-height: 130px;
    resize: vertical;
}

.contact-form button {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    padding: 0.9rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    align-self: flex-start;
}

.contact-form button:hover {
    opacity: 0.85;
    transform: scale(1.01);
}

/* ---------- FOOTER ---------- */
footer {
    text-align: center;
    padding: 2rem 0 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

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

footer a:hover {
    opacity: 0.7;
}

.social-links {
    margin-top: 0.4rem;
    display: flex;
    justify-content: center;
    gap: 1.2rem;
}

.social-links a {
    font-size: 1.3rem;
    color: var(--muted);
    transition: 0.2s;
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    header h1 {
        font-size: 2rem;
    }
    section {
        padding: 1.2rem 1rem 1.6rem;
    }
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .project-grid {
        grid-template-columns: 1fr;
    }
    .work-item {
        flex-direction: column;
        gap: 0.2rem;
    }
    .work-icon {
        font-size: 1.8rem;
        min-width: auto;
        justify-content: flex-start;
    }
    .profile-photo-wrapper {
        width: 120px;
        height: 120px;
    }
}
