/* ============================= */
/* VARIABLES THEME */
/* ============================= */

:root {
    --bg: #ffffff;
    --text: #111111;
    --accent: #0066cc;
    --card-bg: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] {
    --bg: #121212;
    --text: #f5f5f5;
    --accent: #4da3ff;
    --card-bg: rgba(255, 255, 255, 0.05);
}

/* ============================= */
/* GLOBAL */
/* ============================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3 {
    margin-top: 0;
}

section {
    max-width: 1200px;
    margin: auto;
    padding: 2rem;
}

/* ============================= */
/* HEADER */
/* ============================= */

header {
    text-align: center;
    padding: 3rem 2rem;
}

/* ============================= */
/* PROFILE PHOTO */
/* ============================= */

.profile-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 4px solid var(--accent);
}

/* ============================= */
/* THEME BUTTON */
/* ============================= */

#theme-toggle {
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    border: none;
    cursor: pointer;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

#theme-toggle:hover,
#theme-toggle:focus-visible {
    transform: translateY(-2px);
    opacity: 0.9;
}

#theme-toggle:focus-visible {
    outline: 3px solid var(--text);
    outline-offset: 2px;
}

/* ============================= */
/* ABOUT SECTION */
/* ============================= */

#about p {
    max-width: 700px;
    margin: 1rem auto 0;
}

/* ============================= */
/* SKILLS SECTION */
/* ============================= */

#skills {
    text-align: center;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.skill-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--accent);
    font-size: 0.9rem;
}

/* ============================= */
/* PROJECTS GRID */
/* ============================= */

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.projects-grid article {
    flex: 1 1 calc(25% - 1.5rem);
    background: var(--card-bg);
    padding: 1.2rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease;
}

.projects-grid article:hover {
    transform: translateY(-4px);
}

h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.project-btn {
    display: inline-block;
    margin-top: 0.8rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.project-btn:hover,
.project-btn:focus-visible {
    transform: translateY(-2px);
    opacity: 0.9;
}

.project-btn:focus-visible {
    outline: 3px solid var(--text);
    outline-offset: 2px;
}

.project-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0.8rem 0;
}

/* ============================= */
/* CONTACT SECTION */
/* ============================= */

.contact-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.contact-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    padding: 0.7rem 1.2rem;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.contact-btn svg {
    width: 20px;
    height: 20px;
}

.contact-btn:hover,
.contact-btn:focus-visible {
    transform: translateY(-2px);
    opacity: 0.9;
}

.contact-btn:focus-visible {
    outline: 3px solid var(--text);
    outline-offset: 2px;
}

/* ============================= */
/* FOOTER */
/* ============================= */

footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ============================= */
/* RESPONSIVE */
/* ============================= */

@media (max-width: 1024px) {
    .projects-grid article {
        flex: 1 1 calc(50% - 1.5rem);
    }
}

@media (max-width: 600px) {
    .projects-grid article {
        flex: 1 1 100%;
    }
}

/* ============================= */
/* ACCESSIBILITY */
/* ============================= */

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}