/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Theme variables */
:root {
    --bg: #ffe6f2;
    --text: #3a3a3a;
    --muted: #3f3f3f;
    --surface: #fdfaf6;
    --card: #ffffff;
    --accent: #d16ba5;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
}
header,
footer,
.project,
.project-details,
input,
textarea,
button {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

/* Skip link (accessibility) */
.skip-link {
    position: absolute;
    top: -999px;
    left: 12px;
    padding: 10px 12px;
    background: var(--surface);
    color: var(--muted);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 999;
}
.skip-link:focus {
    top: 12px;
}

/* Focus styles (don't remove outlines!) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(209, 107, 165, 0.75);
    outline-offset: 3px;
    border-radius: 8px;
}

/* Layout */
main section {
    width: 90%;
    max-width: 1100px;
    margin: 60px auto;
}

main section h1,
main section h2 {
    margin-bottom: 20px;
}

/* Navbar */
header {
    background: var(--surface);
    color: var(--muted);
    padding: 15px 0;
}

nav {
    width: 90%;
    max-width: 1100px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.logo {
    letter-spacing: 0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
}

.nav-links a:hover {
    text-decoration: underline;
    text-underline-offset: 6px;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project {
    background: var(--card);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-height: 140px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.project img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 12px;
    object-fit: cover;
    display: block;
}

.project-details {
    margin-top: 14px;
    padding: 12px;
    background: rgba(209, 107, 165, 0.08);
    border-radius: 10px;
}

/* Form */
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 520px;
}

label {
    font-weight: bold;
}

input,
textarea {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: #fff;
    color: var(--text);
}

input:focus,
textarea:focus {
    border-color: var(--accent);
}

.form-status {
    margin-top: 12px;
    min-height: 1.2em;
}

.form-status.success {
    color: #0a7a28;
    font-weight: bold;
}

.form-status.error {
    color: #b00020;
    font-weight: bold;
}

/* Buttons */
button {
    padding: 10px 12px;
    border: none;
    background: var(--surface);
    color: var(--muted);
    font-weight: bold;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    background: var(--accent);
    color: white;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

/* Theme toggle button */
button.theme-btn {
    background: transparent;
    box-shadow: none;
    border: 1px solid transparent;
    color: var(--accent);
    padding: 8px 12px;
    border-radius: 10px;
}

button.theme-btn:hover {
    background: var(--accent);
    color: white;
    transform: none;
    box-shadow: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: var(--surface);
    color: var(--muted);
}

/* Dark Mode */
html.dark {
    --bg: #111;
    --text: #eee;
    --muted: #eee;
    --surface: #151515;
    --card: #1b1b1b;
    --shadow: 0 4px 12px rgba(255, 255, 255, 0.06);
}

html.dark header,
html.dark footer {
    border-bottom: 1px solid rgba(209, 107, 165, 0.35);
}

html.dark footer {
    border-bottom: none;
    border-top: 1px solid rgba(209, 107, 165, 0.35);
}

html.dark .project {
    border: 1px solid #2a2a2a;
}

html.dark .project-details {
    background: rgba(255, 230, 242, 0.08);
}

html.dark input,
html.dark textarea {
    background: #1b1b1b;
    color: #eee;
    border-color: #333;
}

html.dark input:focus,
html.dark textarea:focus {
    border-color: #ffe6f2;
}

html.dark button {
    background: #1b1b1b;
    color: #ffe6f2;
    border: 1px solid #333;
}

html.dark button:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

html.dark button.theme-btn {
    background: transparent;
    color: #ffe6f2;
    border-color: rgba(209, 107, 165, 0.25);
}

html.dark button.theme-btn:hover {
    background: #ffe6f2;
    color: #111;
}

/* Animation */
.fade-in {
    animation: fadeInUp 0.8s ease;
}

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

/* Mobile tap highlight */
a,
button {
    -webkit-tap-highlight-color: transparent;
}

/* Responsive */
@media (max-width: 600px) {
    nav {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    main section {
        margin: 40px auto;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    form {
        width: 100%;
    }
}

/* Reduce motion (accessibility) */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    button,
    .project,
    .fade-in {
        transition: none;
        animation: none;
    }
}