/* -------------------
   1. Global Styles & Variables
   ------------------- */
:root {
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-secondary-bg: #334155;
    --color-secondary-bg-hover: #475569;
    --color-background: #0f172a; /* Dark Blue */
    --color-text: #e2e8f0; /* Light Gray */
    --color-text-muted: #94a3b8; /* Lighter Gray */
    --color-card-bg: #1e293b; /* Darker Blue/Gray */
    --color-header-bg: rgba(15, 23, 42, 0.8);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex-grow: 1;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1.5rem;
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* -------------------
   2. Header & Navigation
   ------------------- */
.site-header {
    background-color: var(--color-header-bg);
    backdrop-filter: blur(4px);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid #334155;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
}

.main-nav {
    display: none;
}

.main-nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.main-nav a:hover {
    color: var(--color-primary);
}

.main-nav a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.header-actions {
    display: flex;
    align-items: center;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1rem;
}

.mobile-menu-toggle .icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--color-text-muted);
}

.mobile-nav {
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid #334155;
}

.mobile-nav a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
}

.mobile-nav a:hover {
    background-color: #334155;
}

/* -------------------
   3. Buttons
   ------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
}

.btn-secondary {
    background-color: var(--color-secondary-bg);
    color: white;
}
.btn-secondary:hover {
    background-color: var(--color-secondary-bg-hover);
}

.btn-submit {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    width: 100%;
}

/* -------------------
   4. Page Sections
   ------------------- */
.page-section {
    padding: 3rem 0;
}

.section-header {
    margin-bottom: 3rem;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    max-width: 42rem;
    margin: 0 auto 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

/* -------------------
   5. Home Section
   ------------------- */
.profile-img {
    width: 10rem;
    height: 10rem;
    border-radius: 9999px;
    margin: 0 auto 2.5rem;
    box-shadow: var(--shadow-lg);
    object-fit: cover;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-icon {
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.social-icon:hover {
    color: var(--color-primary);
}

.bmac-wrapper {
    display: inline-block;
    transition: transform 0.2s;
}

.bmac-wrapper:hover {
    transform: scale(1.05);
}

/* -------------------
   6. About Me Section
   ------------------- */
.about-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
    max-width: 56rem;
    margin: 0 auto;
}

.about-image {
    text-align: center;
}

.profile-img-large {
    width: 100%;
    max-width: 20rem; /* Controls the max size */
    height: auto;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
}

.about-text p {
    margin-bottom: 1rem;
}
.about-text p:last-child {
    margin-bottom: 0;
}

/* -------------------
   7. Projects Section
   ------------------- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.project-card {
    background-color: var(--color-card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
    transform: translateY(-0.5rem);
    box-shadow: var(--shadow-lg);
}

.project-img {
    width: 100%;
    height: 12rem;
    object-fit: cover;
}

.project-info {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.project-card:hover .project-title {
    color: var(--color-primary);
}

.project-description {
    color: var(--color-text-muted);
}

/* -------------------
   8. Project Detail & Legal Sections
   ------------------- */
.project-detail-container, .legal-container {
    max-width: 48rem;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
}

.back-link:hover {
    text-decoration: underline;
}

.project-detail-img {
    width: 100%;
    height: auto;
    max-height: 24rem;
    object-fit: cover;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.project-detail-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.prose {
    color: var(--color-text);
}

.prose p {
    margin-bottom: 1rem;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.project-links {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

/* -------------------
   9. Contact Form
   ------------------- */
.form-container {
    max-width: 42rem;
    margin: 0 auto;
    background-color: var(--color-card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #334155;
    border: 1px solid #475569;
    border-radius: 0.375rem;
    font-size: 1rem;
    color: var(--color-text);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.recaptcha-wrapper {
    display: flex;
    justify-content: center;
}

.form-status {
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
    min-height: 1.5rem;
}
.form-status.success { color: #22c55e; }
.form-status.error { color: #ef4444; }
.form-status.sending { color: var(--color-text-muted); }


/* -------------------
   10. Footer
   ------------------- */
.site-footer {
    background-color: var(--color-card-bg);
    border-top: 1px solid #334155;
    padding: 1rem 0;
    text-align: center;
    color: var(--color-text-muted);
}

.footer-links {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    margin: 0 0.75rem;
    font-size: 0.875rem;
}

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

.copyright {
    font-size: 0.875rem;
}

/* -------------------
   11. Responsive Design
   ------------------- */
@media (min-width: 768px) {
    .main-nav {
        display: flex;
        gap: 2rem;
    }
    .mobile-menu-toggle {
        display: none;
    }
    .title {
        font-size: 3rem;
    }
    .section-title {
        font-size: 2.25rem;
    }
    .btn-submit {
        width: auto;
    }
    .about-container {
        grid-template-columns: 1fr 2fr;
        gap: 3rem;
        text-align: left;
    }
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
