/* CSS Variables & Design System */
:root {
    /* Colors - Light Mode (Forest & Gold Premium - White BG) */
    --bg-color: #ffffff;
    /* User requested White */
    --bg-secondary: #f8fafc;
    /* Very light slate for subtle contrast */
    --text-color: #111827;
    /* Standard Dark Grey/Black (Not Green) */
    --text-muted: #6b7280;
    /* Standard Muted Grey */
    --primary-color: #064e3b;
    /* Deep Forest Green (Buttons) */
    --primary-hover: #065f46;
    --accent-color: #d97706;
    /* Gold/Mustard */
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(6, 78, 59, 0.05);
    /* Tinted with green */
    --shadow-md: 0 4px 6px -1px rgba(6, 78, 59, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(6, 78, 59, 0.1);

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Playfair Display', 'Merriweather', serif;

    /* Spacing */
    --container-width: 1100px;
    --header-height: 70px;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 200ms ease;
    --transition-normal: 400ms ease;
}

[data-theme="dark"] {
    --bg-color: #050806;
    /* Almost Black (Deepest Green-Black) */
    --bg-secondary: #0f1712;
    /* Slightly lighter */
    --text-color: #f9fafb;
    /* White text */
    --text-muted: #9ca3af;
    --primary-color: #10b981;
    /* Brighter green for dark mode visibility */
    --primary-hover: #34d399;
    --accent-color: #fbbf24;
    --border-color: #1f2937;
    --card-bg: #0f1712;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

button {
    font: inherit;
    cursor: pointer;
    background: none;
    border: none;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.display-title {
    font-size: 3.5rem;
    letter-spacing: -0.02em;
}

.section-title {
    font-size: 2.25rem;
    margin-bottom: 2rem;
    text-align: center;
}

.lead-text {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    transition: all var(--transition-fast);
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: background-color var(--transition-fast);
}

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

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: border-color var(--transition-normal), background-color var(--transition-normal);
}

[data-theme="dark"] .navbar {
    background-color: rgba(15, 17, 21, 0.8);
}

.navbar.scrolled {
    border-bottom-color: var(--border-color);
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
}

/* Hero Section */
.hero-section {
    padding-top: calc(var(--header-height) + 4rem);
    padding-bottom: 6rem;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-avatar {
    margin-bottom: 2rem;
}

.avatar-circle {
    width: 150px;
    height: 150px;
    background-color: var(--bg-secondary);
    border-radius: 50%;
    margin: 0 auto;
    background-image: url('assets/profile.jpg?v=2');
    /* User to replace */
    background-size: cover;
    background-position: center;
    border: 3px solid var(--bg-color);
    box-shadow: var(--shadow-lg);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.availability-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
}

/* Sections General */
section {
    padding: 5rem 0;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 4rem;
    align-items: start;
}

.highlight-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card h3 {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

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

/* Timeline (Experience & Education) */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 5px;
    width: 16px;
    height: 16px;
    background-color: var(--bg-color);
    border: 2px solid var(--text-color);
    border-radius: 50%;
    transform: translateX(-50%);
}

.timeline-content h3 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.timeline-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

.timeline-desc ul {
    list-style: disc;
    padding-left: 1.25rem;
    color: var(--text-muted);
}

.timeline-desc li {
    margin-bottom: 0.5rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
}

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

.project-image {
    height: 200px;
    background-color: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-info {
    padding: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-full);
    color: var(--text-color);
}

/* Skills */
.skills-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.skill-category h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    font-family: var(--font-sans);
}

.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chip {
    padding: 0.5rem 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

/* Forms */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input,
.form-textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--text-color);
    ring: 1px solid var(--text-color);
}

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

.success-message {
    padding: 1rem;
    background-color: #d1fae5;
    color: #065f46;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-top: 1rem;
    display: none;
}

[data-theme="dark"] .success-message {
    background-color: #064e3b;
    color: #a7f3d0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    background-color: var(--bg-color);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
    z-index: 2010;
}

.modal[aria-hidden="false"] .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-muted);
}

.modal-content {
    padding: 2rem;
}

/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-link {
    text-decoration: underline;
    color: var(--text-muted);
}

.btn-link:hover {
    color: var(--text-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .display-title {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
        /* simple mobile menu hidden for now, can be sophisticated later */
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--bg-color);
        flex-direction: column;
        padding: 2rem;
        border-bottom: 1px solid var(--border-color);
        gap: 1.5rem;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
        width: 30px;
        height: 20px;
        position: relative;
    }

    .mobile-menu-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--text-color);
        margin-bottom: 6px;
    }

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

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

/* Print Styles */
@media print {

    .navbar,
    .footer,
    .hero-actions,
    .nav-controls,
    #back-to-top,
    .modal,
    .btn {
        display: none !important;
    }

    body {
        background-color: white;
        color: black;
        font-size: 12pt;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    section {
        padding: 1rem 0;
        page-break-inside: avoid;
    }

    a {
        text-decoration: none;
        color: black;
    }

    /* Reveal URLs for print */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8rem;
    }

    .timeline {
        border-left: 1px solid #ccc;
    }

    .timeline-dot {
        border: 1px solid black;
        background: white;
    }
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 140px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    text-align: center;
    border-radius: var(--radius-sm);
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    /* Above */
    left: 50%;
    margin-left: -70px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    pointer-events: none;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}