/* --- Base Styles & Variables --- */
:root {
    --bg-color: #081b29;
    --second-bg-color: #112e42;
    --text-color: #ededed;
    --main-color: #00aeff;
    --glow-color: rgba(0, 174, 255, 0.8);
    --card-bg-color: rgba(17, 46, 66, 0.6);
    
    /* UPDATED: Font variables now use 'Space Grotesk' */
    --font-main: 'Space Grotesk', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    font-family: var(--font-main); /* Apply the new font globally */
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* --- Particles.js Background --- */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: var(--bg-color);
}

/* --- Header / Navbar --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(8, 27, 41, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.logo {
    font-size: 2.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
}

.navbar a {
    font-size: 1.15rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: 35px;
    transition: 0.3s;
    position: relative;
}

.navbar a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--main-color);
    transition: width 0.3s ease;
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
}

.navbar a:hover::after,
.navbar a.active::after {
    width: 100%;
}

/* --- Sections General Styling --- */
section {
    min-height: 100vh;
    padding: 10rem 10% 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}
.section-title {
    font-size: 3rem;
    margin-bottom: 4rem;
    text-align: center;
    font-weight: 700;
    color: var(--main-color);
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: var(--main-color);
    margin: 10px auto;
    border-radius: 5px;
}

/* --- Hero Section --- */
.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
}

.hero-content h1 {
    font-size: 4.5rem; /* Slightly larger for impact */
    font-weight: 700;
    line-height: 1.2;
}

.hero-content h3 {
    font-size: 2rem;
    font-weight: 500; /* Adjusted for Space Grotesk */
    color: var(--main-color);
    margin: 1rem 0;
}

.hero-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 2rem 0 3rem;
    font-weight: 300; /* Lighter weight for body text */
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background: transparent;
    border: 2px solid var(--main-color);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--main-color);
    text-decoration: none;
    margin: 0 8px;
    transition: 0.5s;
    opacity: 0;
    animation: slideLeft 1s ease forwards;
    animation-delay: calc(0.2s * var(--i));
}
.social-links a:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
    box-shadow: 0 0 20px var(--main-color);
}

.btn-glow {
    display: inline-block;
    padding: 12px 28px;
    background: var(--main-color);
    border-radius: 40px;
    font-size: 1rem;
    color: var(--second-bg-color);
    letter-spacing: 1px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 2rem;
    transition: 0.5s;
    box-shadow: 0 0 10px var(--glow-color);
}
.btn-glow:hover {
    box-shadow: 0 0 25px var(--glow-color), 0 0 50px var(--glow-color);
    transform: scale(1.05);
}

/* --- About Section --- */
.about {
    background: var(--second-bg-color);
}
.about-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}
.about-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--main-color);
    box-shadow: 0 0 30px var(--glow-color);
}
.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.about-text {
    max-width: 600px;
}
.about-text h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}
.about-text p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    font-weight: 300;
}

/* --- Experience Timeline --- */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: var(--second-bg-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    border-radius: 3px;
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}
.timeline-item:nth-child(odd) {
    left: 0;
}
.timeline-item:nth-child(even) {
    left: 50%;
}
.timeline-dot {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--main-color);
    border: 4px solid var(--bg-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-item:nth-child(even) .timeline-dot {
    left: -10px;
}
.timeline-content {
    padding: 20px 30px;
    background: var(--card-bg-color);
    backdrop-filter: blur(5px);
    position: relative;
    border-radius: 8px;
    border: 1px solid var(--main-color);
}
.timeline-date {
    position: absolute;
    top: 18px;
    font-size: 0.9rem;
    color: var(--main-color);
    font-weight: bold;
}
.timeline-item:nth-child(odd) .timeline-date {
    right: -170px;
}
.timeline-item:nth-child(even) .timeline-date {
    left: -170px;
}
.timeline-content h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 5px;
}
.timeline-content .company {
    font-style: italic;
    color: var(--main-color);
    margin-bottom: 10px;
}
.timeline-content ul {
    list-style-type: none;
    padding-left: 0;
}
.timeline-content ul li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 300;
}
.timeline-content ul li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--main-color);
    font-size: 0.8rem;
}

/* --- Projects Section --- */
.projects {
    background: var(--second-bg-color);
}
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.project-card {
    background: var(--card-bg-color);
    border: 1px solid var(--main-color);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
}
.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px var(--glow-color);
}
.project-info {
    padding: 25px;
}
.project-info h3 {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--main-color);
    margin-bottom: 10px;
}
.project-info p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
    font-weight: 300;
}
.tech-stack span {
    display: inline-block;
    background: var(--second-bg-color);
    color: var(--main-color);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-top: 5px;
}

/* base grid (fix your earlier typo 'place-items:ce') */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  /* no place-items here */
}

/* default: items fill their column */
.skills-grid > * {
  justify-self: stretch;
}

/* WIDE: when there are >= 3 columns (300px * 3 = 900px),
   place the last card explicitly into the center column and let it fill that column */
@media (min-width: 900px) {
  .skills-grid > :last-child {
    grid-column: 2 / 3;   /* put it in the middle column */
    justify-self: stretch; /* fill that column like other cards */
  }
}

/* MEDIUM: 2-column layout — center the last card and constrain it to the column-min width */
@media (min-width: 600px) and (max-width: 899px) {
  .skills-grid > :last-child {
    grid-column: 1 / -1;    /* take a full row */
    justify-self: center;   /* center it */
    max-width: 300px;       /* match your min column width */
    width: 100%;
  }
}

/* SMALL / MOBILE: single-column — leave normal flow */
@media (max-width: 599px) {
  .skills-grid > :last-child {
    grid-column: auto;
    justify-self: stretch;
  }
}


.skill-category {
    background: var(--card-bg-color);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid var(--main-color);
}
.skill-category h3 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--main-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.skill-category ul {
    list-style: none;
}
.skill-category ul li {
    padding: 8px 0;
    position: relative;
    padding-left: 25px;
    font-weight: 300;
}
.skill-category ul li::before {
    content: '\f00c'; /* Font Awesome check icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--main-color);
}

/* --- Contact Section --- */
.contact {
    text-align: center;
    background: var(--second-bg-color);
}
.contact-subtitle {
    font-size: 1.2rem;
    margin: -3rem auto 2rem;
    max-width: 600px;
    font-weight: 300;
}
.contact-social-links {
    margin-top: 3rem;
}
.contact-social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 2px solid var(--main-color);
    border-radius: 50%;
    font-size: 1.8rem;
    color: var(--main-color);
    text-decoration: none;
    margin: 0 10px;
    transition: 0.5s;
}
.contact-social-links a:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
    box-shadow: 0 0 20px var(--main-color);
}

/* --- Footer --- */
.footer {
    padding: 20px 10%;
    text-align: center;
    background: var(--bg-color);
    min-height: auto;
}
.footer .fa-heart {
    color: var(--main-color);
}

/* --- Keyframes for animations --- */
@keyframes slideLeft {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .header { padding: 20px 5%; }
    section { padding: 10rem 5% 2rem; }
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item:nth-child(even) { left: 0; }
    .timeline-dot { left: 21px; }
    .timeline-date { position: static; display: block; margin-bottom: 10px; }
}

@media (max-width: 768px) {
    .navbar { display: none; /* Add logic for mobile menu toggle if needed */ }
    .hero-content h1 { font-size: 3rem; }
    .hero-content h3 { font-size: 1.5rem; }
    .about-content { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .section-title { font-size: 2.5rem; }
    .hero-content h1 { font-size: 2.5rem; }
}
