:root {
    --bg-color: #2b2b2f; /* Greyish color, dark but not too dark */
    --surface-color: #36363a;
    --text-primary: #f0f0f2;
    --text-secondary: #9ea0a8;
    --accent: #82aaff;
    --accent-hover: #a1c1ff;
    --border: #42464d;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(-45deg, #2b2b2f, #212630, #1c212b, #2b2b2f);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    z-index: 0;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(rgba(119, 142, 187, 0.15) 1.5px, transparent 1.5px);
    background-size: 35px 35px;
    opacity: 0.6;
}

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

a:hover {
    color: var(--accent);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header & Nav */
header {
    margin-bottom: 4rem;
    animation: fadeInDown 0.8s ease-out forwards;
    opacity: 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6rem;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #ffffff, #a8a8a8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

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

/* Hero Section */
.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    line-height: 1.1;
    letter-spacing: -1.2px;
}

.cursor {
    display: inline-block;
    color: var(--accent);
    animation: blink 1.2s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

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

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.8;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.tab-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    padding: 0.8rem 0;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-button:hover {
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--text-primary);
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.tab-button.active::after {
    width: 100%;
}

/* Projects */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.tab-content.active {
    display: block;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.8rem;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.project-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3), 0 0 20px rgba(119, 142, 187, 0.15);
    border-color: var(--accent);
    background-color: #3e4149;
}

.project-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.project-card .project-date {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 500;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.8rem;
}

.project-card .project-desc {
    max-height: 140px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom Scrollbar for Project Descriptions */
.project-card .project-desc::-webkit-scrollbar {
    width: 6px;
}
.project-card .project-desc::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}
.project-card .project-desc::-webkit-scrollbar-thumb {
    background: #5a5f6b;
    border-radius: 4px;
}
.project-card .project-desc::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.project-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    position: relative;
    display: inline-flex;
    align-items: center;
}

.project-link:hover {
    color: var(--accent-hover);
}

/* Contact Section */
.contact-section {
    margin-top: 6rem;
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.contact-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.contact-section p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
    line-height: 1.6;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.8rem;
    background-color: var(--accent);
    color: #1e1e24;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
}

.contact-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    color: #1e1e24;
}

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

.contact-btn.outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background-color: rgba(130, 170, 255, 0.05);
}

/* Footer */
footer {
    margin-top: 6rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 600px) {
    .tabs {
        flex-direction: column;
        gap: 0.5rem;
        border-bottom: none;
        padding-bottom: 1rem;
    }
    .tab-button::after {
        display: none;
    }
    .tab-button {
        text-align: left;
        padding: 0.8rem 1rem;
        border-radius: 8px;
        background-color: var(--surface-color);
        border: 1px solid var(--border);
    }
    .tab-button.active {
        background-color: #404247;
        color: var(--accent);
        border-color: var(--accent);
    }
}

/* --- Modal Gallery Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-gallery-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    position: relative;
    gap: 30px;
}

.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80%;
}

#modal-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    object-fit: contain;
    user-select: none;
}

.modal-caption {
    margin-top: 15px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--text-secondary);
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 1001;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-nav {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    font-size: 40px;
    padding: 20px 25px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-nav:hover {
    background: var(--accent);
    color: #1e1e24;
}

@media (max-width: 768px) {
    .modal-gallery-container {
        flex-direction: column;
    }
    .modal-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        padding: 10px 15px;
        z-index: 50;
    }
    .prev-btn { left: 10px; }
    .next-btn { right: 10px; }
    .modal-content {
        width: 100%;
        padding: 0 15px;
    }
}
