:root {
    --bg-color: #0f172a;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --card-bg: #1e293b;
    --primary-color: #60a5fa;
    --primary-hover: #93c5fd;
    --border-color: #334155;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --progress-bg: #334155;
    --gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --border-color: #e2e8f0;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --progress-bg: #e2e8f0;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.7;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

h1, h2, h3 {
    color: var(--text-main);
    font-weight: 800;
}

p {
    color: var(--text-muted);
}

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

section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}
section:last-child {
    border-bottom: none;
}

header {
    text-align: center;
    padding: 100px 20px 60px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.4s ease;
}

header img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid transparent;
    background-image: var(--gradient);
    background-origin: border-box;
    padding: 4px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    transition: transform 0.4s ease;
}

header img:hover {
    transform: scale(1.03);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease;
}

.theme-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.theme-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-icon-moon {
    opacity: 0;
    transform: scale(0.7) rotate(-12deg);
}

.theme-icon-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-toggle.is-light .theme-icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-toggle.is-light .theme-icon-sun {
    opacity: 0;
    transform: scale(0.7) rotate(12deg);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

h2 {
    font-size: 2rem;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gradient);
    margin: 10px auto 0;
    border-radius: 2px;
}

.about-content {
    max-width: 850px;
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.about p {
    text-align: left;
    font-size: 1.06rem;
}

.skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 25px;
}

.skill {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 25px 15px;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skill:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.skill img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0px 4px 4px rgba(0,0,0,0.1));
}

.skill-name {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--progress-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 0; /* Animated via JS */
    background: var(--gradient);
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.1, 0.5, 0.1, 1);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

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

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

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 5px;
    width: 18px;
    height: 18px;
    background: var(--card-bg);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    z-index: 1;
}

.timeline-item h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.timeline-item span {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--primary-color);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.project-card h3 {
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.project-card p {
    margin-top: 15px;
    font-size: 0.95rem;
    font-weight: 600;
}

.project-meta {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.complexity-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.meta-label,
.complexity-level {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}

.complexity-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--progress-bg);
    overflow: hidden;
}

.complexity-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--gradient);
}

.deploy-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 2px;
}

.status-live {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.35);
}

.status-building {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.35);
}

[data-theme="light"] .status-live {
    color: #166534;
    background: #dcfce7;
    border-color: #86efac;
}

[data-theme="light"] .status-building {
    color: #92400e;
    background: #fef3c7;
    border-color: #fcd34d;
}

.project-link-btn {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    margin: 15px 0 0;
    border-radius: 10px;
    background: var(--gradient);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.carousel {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--progress-bg);
}

.carousel-images {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-images img {
    min-width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.72);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.3s;
    z-index: 2;
}

.carousel-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.carousel-btn:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.05);
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.contact-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.contact-link {
    color: var(--text-main);
    transition: color 0.3s ease;
}

.social-icon {
    width: 72px;
    height: 72px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease, filter 0.3s ease;
}

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

.contact-link:hover .social-icon {
    transform: scale(1.08) translateY(-4px);
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.1));
}

footer {
    text-align: center;
    padding: 30px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.theme-toggle:focus-visible,
.carousel-btn:focus-visible,
.contact-link:focus-visible,
.project-link-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .about p {
        text-align: center;
    }
}

.flex-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}