/* ============================================
   PORTFOLIO STYLES - Michael Thumbi Ndegwa
   ============================================ */

/* CSS Variables */
:root {
    --primary: #00ff88;
    --secondary: #0066ff;
    --dark: #0a0e27;
    --darker: #050810;
    --light: #ffffff;
    --gray: #8892b0;
    --accent: #ff006e;
}

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

body {
    font-family: 'Space Mono', monospace;
    background: var(--darker);
    color: var(--light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 102, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 0, 110, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    background: rgba(5, 8, 16, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1001;
}

.logo::before {
    content: '< >';
    color: var(--secondary);
}

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

.nav-links a {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Mobile Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    transition: all 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

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

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 5% 4rem;
    position: relative;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    flex: 1;
}

.hero-image {
    position: relative;
    width: 350px;
    height: 350px;
}

.profile-pic-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--primary);
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.3);
    position: relative;
    z-index: 2;
}

/* Animated ring around profile pic */
.profile-pic-container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 2px solid var(--secondary);
    animation: rotate 20s linear infinite;
    opacity: 0.5;
}

.profile-pic-container::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border-radius: 50%;
    border: 2px dashed var(--primary);
    animation: rotate 15s linear infinite reverse;
    opacity: 0.3;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Placeholder for profile pic */
.profile-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
    border: 4px solid var(--primary);
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.3);
    z-index: 1;
}

.hero-label {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: inline-block;
    animation: slideDown 0.8s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: slideUp 0.8s ease 0.2s backwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 2rem);
    color: var(--gray);
    margin-bottom: 2rem;
    max-width: 800px;
    animation: slideUp 0.8s ease 0.4s backwards;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 700px;
    margin-bottom: 3rem;
    line-height: 1.8;
    animation: slideUp 0.8s ease 0.6s backwards;
}

.github-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    animation: slideUp 0.8s ease 0.7s backwards;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Syne', sans-serif;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    animation: slideUp 0.8s ease 0.8s backwards;
}

.btn {
    padding: 1rem 2.5rem;
    border: none;
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: var(--dark);
    font-weight: 700;
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

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

/* ============================================
   SKILLS SECTION
   ============================================ */

.skills-section {
    padding: 6rem 5%;
    background: var(--dark);
}

.section-header {
    max-width: 1400px;
    margin: 0 auto 4rem;
}

.section-label {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.section-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.skills-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 2.5rem;
    border: 1px solid rgba(0, 255, 136, 0.1);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: rgba(0, 255, 136, 0.05);
}

.skill-card:hover::before {
    transform: scaleX(1);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.skill-card h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.skill-card ul {
    list-style: none;
    color: var(--gray);
}

.skill-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.skill-card li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* ============================================
   PROJECTS SECTION
   ============================================ */

.projects-section {
    padding: 6rem 5%;
    background: var(--darker);
}

.projects-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    gap: 3rem;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
}

.project-card:nth-child(even) {
    direction: rtl;
}

.project-card:nth-child(even)>* {
    direction: ltr;
}

.project-info {
    z-index: 2;
}

.project-label {
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.project-card h3 {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.project-description {
    background: rgba(10, 14, 39, 0.9);
    padding: 2rem;
    border-left: 3px solid var(--primary);
    margin-bottom: 1.5rem;
    color: var(--gray);
    line-height: 1.8;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    font-size: 0.85rem;
    color: var(--primary);
    background: rgba(0, 255, 136, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary);
    transition: all 0.3s;
    display: inline-block;
}

.project-link:hover {
    background: var(--primary);
    color: var(--dark);
    transform: translateY(-2px);
}

.project-visual {
    position: relative;
    width: 100%;
    height: 400px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 136, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
}

.project-visual.has-image .project-image {
    display: block;
}

.project-visual.has-image .project-icon {
    display: none;
}

.project-icon {
    font-size: 4rem;
    opacity: 0.5;
}

/* ============================================
   EXPERIENCE SECTION
   ============================================ */

.experience-section {
    padding: 6rem 5%;
    background: var(--dark);
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.timeline-item {
    padding-left: 4rem;
    margin-bottom: 4rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 20px var(--primary);
    border: 3px solid var(--dark);
}

.timeline-date {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.timeline-item h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
}

.timeline-company {
    color: var(--secondary);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.timeline-item ul {
    list-style: none;
    color: var(--gray);
}

.timeline-item li {
    padding: 0.6rem 0;
    padding-left: 1.8rem;
    position: relative;
    font-size: 1rem;
    line-height: 1.7;
}

.timeline-item li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 1.2rem;
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact-section {
    padding: 6rem 5%;
    background: var(--darker);
    text-align: center;
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-section h2 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 2rem;
}

.contact-section p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.contact-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.contact-link:hover {
    color: var(--secondary);
    transform: translateY(-3px);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    padding: 2rem 5%;
    text-align: center;
    color: var(--gray);
    background: var(--dark);
    border-top: 1px solid rgba(0, 255, 136, 0.1);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s, transform 0.6s;
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet and Below */
@media (max-width: 968px) {

    /* Mobile Navigation */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: rgba(5, 8, 16, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 6rem 2rem 2rem;
        gap: 2rem;
        transition: right 0.3s ease;
        border-left: 1px solid rgba(0, 255, 136, 0.2);
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger {
        display: flex;
    }

    /* Hero Section */
    .hero {
        padding: 6rem 5% 4rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-image {
        width: 250px;
        height: 250px;
        margin: 0 auto;
        order: -1;
    }

    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-description,
    .hero-subtitle {
        text-align: center;
        max-width: 100%;
    }

    /* Projects */
    .project-card {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-card:nth-child(even) {
        direction: ltr;
    }

    .project-visual {
        height: 300px;
    }

    /* Buttons */
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    /* Stats */
    .github-stats {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
        flex-wrap: wrap;
    }

    /* Skills */
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    /* Experience Timeline */
    .timeline-item {
        padding-left: 3rem;
    }

    /* Contact Links */
    .contact-links {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .nav-links {
        width: 80%;
    }

    .github-stats {
        flex-direction: column;
        gap: 1rem;
    }

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

    .timeline-item {
        padding-left: 2.5rem;
    }

    .timeline-item h3 {
        font-size: 1.5rem;
    }

    .timeline-company {
        font-size: 0.95rem;
    }

    .timeline-item li {
        font-size: 0.9rem;
        padding-left: 1.5rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {

    /* Hero Section */
    .hero {
        padding: 5rem 5% 3rem;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-description {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .hero-image {
        width: 180px;
        height: 180px;
    }

    .profile-placeholder {
        font-size: 5rem;
    }

    /* Sections */
    .skills-section,
    .projects-section,
    .experience-section,
    .contact-section {
        padding: 4rem 5%;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-label {
        font-size: 0.85rem;
    }

    .project-card h3 {
        font-size: 1.5rem;
    }

    /* Skills */
    .skill-card {
        padding: 1.5rem;
    }

    .skill-card h3 {
        font-size: 1.3rem;
    }

    .skill-card li {
        font-size: 0.9rem;
    }

    /* Projects */
    .project-description {
        padding: 1.5rem;
        font-size: 0.95rem;
    }

    .project-visual {
        height: 250px;
    }

    /* Stats */
    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    /* Buttons */
    .btn {
        padding: 0.9rem 2rem;
        font-size: 0.95rem;
    }

    /* Timeline */
    .timeline-item {
        padding-left: 2rem;
        margin-bottom: 3rem;
    }

    .timeline-item h3 {
        font-size: 1.3rem;
    }
}