/* ===== CSS Custom Properties (Light / Dark) ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #0d9488;
    --accent-hover: #0f766e;
    --accent-light: #f0fdfa;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #0f172a;
    --footer-text: #94a3b8;
    --stats-bg: #0f172a;
    --stats-text: #ffffff;
    --tag-bg: #f0fdfa;
    --tag-text: #0d9488;
    --input-border: #cbd5e1;
    --input-bg: #ffffff;
    --hero-gradient: linear-gradient(135deg, #f8fafc 0%, #e6f5f3 100%);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-light: rgba(45, 212, 191, 0.12);
    --border: #334155;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(15, 23, 42, 0.95);
    --footer-bg: #020617;
    --footer-text: #64748b;
    --stats-bg: #020617;
    --stats-text: #f1f5f9;
    --tag-bg: rgba(45, 212, 191, 0.12);
    --tag-text: #2dd4bf;
    --input-border: #475569;
    --input-bg: #1e293b;
    --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1a2332 100%);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s, background 0.3s;
}

.navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    gap: 32px;
}

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

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    background: none;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
    margin-left: 16px;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: none;
}

[data-theme="dark"] .icon-moon {
    display: block;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.btn-outline {
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-outline:hover {
    background: var(--accent);
    color: #fff;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--hero-gradient);
    padding-top: 64px;
}

.hero-content {
    max-width: 640px;
}

.hero-greeting {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 8px;
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 12px;
    min-height: 2.2rem;
}

.typing-cursor {
    animation: blink 1s step-end infinite;
    color: var(--accent);
    font-weight: 300;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.hero-location svg {
    color: var(--accent);
}

.hero-tagline {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 520px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.hero-social {
    display: flex;
    gap: 16px;
}

.hero-social a {
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
}

.hero-social a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

/* ===== Impact Stats Bar ===== */
.stats-bar {
    background: var(--stats-bg);
    padding: 48px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    text-align: center;
}

.stat-item {
    color: var(--stats-text);
}

.stat-prefix,
.stat-number,
.stat-suffix {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--stats-text);
}

.stat-label {
    display: block;
    font-size: 0.88rem;
    color: #94a3b8;
    margin-top: 8px;
    font-weight: 400;
}

/* ===== Section ===== */
.section {
    padding: 96px 0;
}

.section-alt {
    background: var(--bg-secondary);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 56px;
    letter-spacing: -0.5px;
}

.section-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--accent);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* ===== About ===== */
.about-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
    align-items: start;
}

.profile-photo {
    width: 240px;
    height: 300px;
    border-radius: 16px;
    object-fit: cover;
    object-position: top;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 1.02rem;
}

/* ===== Education ===== */
.education-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    max-width: 900px;
    margin: 0 auto;
}

.edu-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.edu-card-icon {
    color: var(--accent);
    margin-bottom: 16px;
}

.edu-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.edu-card h4 {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 8px;
}

.edu-date {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.edu-coursework {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.edu-coursework strong {
    color: var(--text-primary);
}

/* ===== Specializations / What I Do ===== */
.spec-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.spec-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.spec-icon {
    color: var(--accent);
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.spec-card h3 {
    font-size: 1.02rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.spec-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Skills ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.skill-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.skill-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--accent);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ===== Experience / Timeline ===== */
.timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

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

.timeline-dot {
    position: absolute;
    left: -32px;
    top: 6px;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--accent);
}

.timeline-content {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.timeline-date {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.timeline-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-content h4 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 12px;
}

.timeline-bullets {
    list-style: none;
    padding: 0;
}

.timeline-bullets li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
    margin-bottom: 10px;
    line-height: 1.55;
}

.timeline-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

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

/* ===== Projects ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

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

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

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

.project-date {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 3px 10px;
    border-radius: 12px;
}

.project-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.project-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.55;
    flex-grow: 1;
}

.project-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.metric {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
}

[data-theme="dark"] .metric {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tags .tag {
    font-size: 0.78rem;
    padding: 4px 10px;
}

/* ===== Contact ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    max-width: 900px;
    margin: 0 auto;
}

.contact-info p {
    color: var(--text-secondary);
    font-size: 1.02rem;
    margin-bottom: 24px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

.contact-link svg {
    flex-shrink: 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.form-group textarea {
    resize: vertical;
}

/* ===== Footer ===== */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 28px 0;
}

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

.footer-content p {
    font-size: 0.88rem;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--footer-text);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 900;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* ===== Fade-in Animation ===== */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Form Success & Error ===== */
.form-success {
    text-align: center;
    padding: 24px;
    color: #16a34a;
    font-weight: 500;
}

.form-error {
    color: #dc2626;
    font-size: 0.88rem;
    margin-top: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .spec-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .about-text {
        text-align: left;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

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

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu li a {
        display: block;
        padding: 12px 0;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-title {
        font-size: 1.2rem;
    }

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

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

    .stat-prefix,
    .stat-number,
    .stat-suffix {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .skills-grid,
    .projects-grid,
    .spec-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .section {
        padding: 64px 0;
    }

    .hero-name {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 360px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-prefix,
    .stat-number,
    .stat-suffix {
        font-size: 1.8rem;
    }
}
