/* =========================
   GLOBAL
========================= */

:root {
    --bg: #0a0f0d;
    --bg-secondary: #101713;
    --card: #121a16;
    --card-hover: #17221c;
    --text: #f2f5f3;
    --muted: #a8b3ad;
    --accent: #b7f34a;
    --accent-dark: #8fca2f;
    --border: #26332c;
    --max-width: 1150px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* NEW: sticky navbar no longer covers section titles */
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

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

/* NEW: visible keyboard focus */
a:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

.container {
    width: min(90%, var(--max-width));
    margin: auto;
}


/* =========================
   NAVBAR
========================= */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 15, 13, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    color: var(--muted);
    font-size: 0.95rem;
    transition: 0.3s ease;
}

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


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

.hero {
    min-height: 88vh;
    display: flex;
    align-items: center;
    padding: 90px 0;
}

.hero-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

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

.hero-tag {
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: clamp(2.8rem, 7vw, 5.8rem);
    line-height: 1;
    letter-spacing: -4px;
    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--accent);
}

.hero h2 {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 25px;
}

.hero-description {
    max-width: 700px;
    color: var(--muted);
    font-size: 1.08rem;
    margin-bottom: 35px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.hero-links {
    display: flex;
    gap: 20px;
    margin-top: 28px;
    color: var(--muted);
    font-size: 0.95rem;
}

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

.hero-photo img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 10px rgba(183, 243, 74, 0.1),
                0 25px 50px rgba(0, 0, 0, 0.5);
}

.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: 0.3s ease;
    font-weight: 600;
}

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

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}


/* =========================
   SECTIONS
========================= */

section {
    padding: 100px 0;
}

.section-header {
    margin-bottom: 45px;
}

.section-label {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -1px;
}

.section-description {
    color: var(--muted);
    max-width: 700px;
    margin-top: 12px;
}


/* =========================
   ABOUT
========================= */

.about-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-text p {
    color: var(--muted);
    margin-bottom: 18px;
}

.about-highlight {
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    color: var(--text) !important;
}

.about-stats {
    display: grid;
    gap: 15px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 25px;
}

.stat-card h3 {
    color: var(--accent);
    font-size: 1.6rem;
    margin-bottom: 0;
}

.stat-card p {
    color: var(--muted);
}


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

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* NEW: a lone last card (7 cards in 3 columns) spans the full row */
.skills-grid .skill-card:last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
}

.skill-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    transition: 0.3s ease;
}

.skill-card:hover {
    background: var(--card-hover);
    border-color: var(--accent);
    transform: translateY(-5px);
}

.skill-card h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

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

.skill-chips span {
    padding: 5px 12px;
    background: #1b251f;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.82rem;
    color: #c8d1cc;
}


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

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

/* Last card spans full width when the count is odd */
.projects-grid .project-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    transition: 0.3s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    background: var(--card-hover);
}

.project-img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.project-number {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.project-card h3 {
    font-size: 1.35rem;
    margin-bottom: 12px;
}

.project-card p {
    color: var(--muted);
    margin-bottom: 18px;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.project-tags span {
    padding: 5px 10px;
    background: #1b251f;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.78rem;
    color: #c8d1cc;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;      /* NEW: links wrap instead of overflowing */
    gap: 10px 20px;
}

.project-link {
    color: var(--accent);
    font-weight: 600;
}

.project-link:hover {
    text-decoration: underline;
}


/* =========================
   EDUCATION (TIMELINE)
========================= */

.timeline {
    border-left: 2px solid var(--border);
    padding-left: 30px;
}

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

.timeline-item::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    left: -37px;
    top: 8px;
}

.timeline-date {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

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

.timeline-item h4 {
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 12px;
}

.timeline-item p {
    color: var(--muted);
}


/* =========================
   CERTIFICATIONS
========================= */

.cert-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

/* NEW: odd last certificate (5 cards) spans the full row */
.cert-grid .cert-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.cert-card {
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.cert-card h3 {
    font-size: 1rem;
    margin-bottom: 7px;
}

.cert-card p {
    color: var(--muted);
    font-size: 0.9rem;
}


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

.contact-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 55px;
    text-align: center;
}

.contact-box h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 15px;
}

.contact-box p {
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto 28px;
}

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


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

footer {
    border-top: 1px solid var(--border);
    padding: 30px 0;
    color: var(--muted);
    text-align: center;
    font-size: 0.9rem;
}

footer span {
    color: var(--accent);
}


/* =========================
   SCROLL REVEAL
========================= */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* Keep card hover effects working after reveal */
.project-card.reveal,
.skill-card.reveal {
    transition: opacity 0.6s ease, transform 0.35s ease,
                border-color 0.3s ease, background 0.3s ease;
}

.project-card.visible:hover {
    transform: translateY(-6px);
}

.skill-card.visible:hover {
    transform: translateY(-5px);
}

/* NEW: respect "reduce motion" system setting */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .project-card,
    .skill-card,
    .btn {
        transition: none;
    }
}


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

@media (max-width: 900px) {

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

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* NEW: with 2 columns the last (7th) skill card is the odd one */
    .skills-grid .skill-card:last-child:nth-child(3n + 1) {
        grid-column: auto;
    }

    .skills-grid .skill-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

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

    .hero-grid {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-buttons,
    .hero-links {
        justify-content: center;
    }

    .hero-photo img {
        width: 220px;
        height: 220px;
    }
}


@media (max-width: 650px) {

    .nav-container {
        min-height: 60px;
        gap: 16px;
    }

    /* CHANGED: links stay visible as a swipeable row instead of being hidden */
    .nav-links {
        display: flex;
        gap: 18px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        font-size: 0.88rem;
    }

    .hero {
        min-height: 80vh;
        padding: 70px 0;
    }

    .hero h1 {
        letter-spacing: -2px;
    }

    section {
        padding: 70px 0;
    }

    .skills-grid,
    .cert-grid {
        grid-template-columns: 1fr;
    }

    .contact-box {
        padding: 35px 20px;
    }
}
