/* ---------- 1. Body & Background ---------- */
body {
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #fafafa;
    margin: 0;
    padding: 0;
}

/* ---------- 2. Header & Navigation ---------- */
header {
    background-color: #111;
    padding: 0.8rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
    justify-content: center;
}

nav ul li {
    display: inline;
}

nav a {
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.4rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

nav a:hover,
nav a:focus {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

/* ---------- 3. Main Content ---------- */
main {
    max-width: 52rem;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ---------- 4. Headings ---------- */
h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.3rem;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.4rem;
}

/* ---------- 5. Paragraphs & Text ---------- */
p {
    margin-bottom: 0.75rem;
    text-align: left;
}

/* ---------- 6. Links ---------- */
a {
    color: #0056b3;
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

/* ---------- 7. Lists ---------- */
ul,
ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

dl {
    margin-bottom: 1rem;
}

dt {
    font-weight: 700;
    margin-top: 0.75rem;
}

dd {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ---------- 8. Sections ---------- */
section {
    background-color: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

/* ---------- 9. Class Selectors ---------- */
.highlight {
    background-color: #fff8e1;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
}

.subtitle {
    font-style: italic;
    color: #555;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.contact-list {
    list-style-type: none;
    padding-left: 0;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.project-card {
    border-left: 3px solid #111;
    padding-left: 1rem;
    margin-bottom: 1.25rem;
}

.project-card p {
    margin-bottom: 0.3rem;
}

.project-card img {
    width: 100%;
    max-width: 36rem;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.tech-line {
    font-size: 0.85rem;
    color: #555;
    font-style: italic;
}

.skill-list {
    list-style-type: none;
    padding-left: 0;
}

.skill-list li {
    margin-bottom: 0.6rem;
}

.skill-list li strong {
    display: inline;
}

.cert-list {
    list-style-type: square;
    list-style-position: inside;
    padding-left: 0;
}

.cert-list li {
    margin-bottom: 0.3rem;
}

/* ---------- 10. ID Selectors ---------- */
#intro {
    text-align: center;
}

#intro img {
    border-radius: 50%;
    border: 3px solid #111;
    margin-bottom: 0.75rem;
}

#intro .contact-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

/* ---------- 11. Images ---------- */
img {
    max-width: 100%;
    height: auto;
}

/* ---------- 12. Footer ---------- */
footer {
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid #ddd;
    font-size: 0.85rem;
    color: #777;
}

footer a {
    color: #555;
    font-weight: 600;
}

/* ---------- 13. Form Elements (contact page) ---------- */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 32rem;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #111;
}

textarea {
    resize: vertical;
    min-height: 6rem;
}

button,
input[type="submit"] {
    background-color: #111;
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background-color 0.2s ease;
}

button:hover,
input[type="submit"]:hover {
    background-color: #333;
}

/* ---------- 14. Table (cv page) ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th,
td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e8e8e8;
}

th {
    font-weight: 700;
    text-transform: capitalize;
}

/* ---------- 15. Responsive Basics ---------- */
@media (max-width: 40em) {
    main {
        padding: 0 1rem;
    }

    section {
        padding: 1rem 1.25rem;
    }

    nav ul {
        gap: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.15rem;
    }

    #intro .contact-list {
        flex-direction: column;
        gap: 0.5rem;
    }
}
/* ---------- 16. Footer credit (all pages) ---------- */
.footer-credit {
    margin-top: 0.25rem;
    text-align: center;
}

/* ---------- 17. Floating Back-to-Top button (all pages) ---------- */
#backToTopFab {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 46px;
    height: 46px;
    box-sizing: border-box;
    padding: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #111111;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
    opacity: 0;
    visibility: hidden;
    transform: translateX(16px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease, box-shadow .2s ease;
    z-index: 60;
}

#backToTopFab svg { display: block; }

#backToTopFab.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

#backToTopFab:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .34);
}

#backToTopFab:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .30);
}

@media (prefers-reduced-motion: reduce) {
    #backToTopFab,
    #backToTopFab.show {
        transform: none;
        transition: opacity .2s ease, visibility .2s ease;
    }
}

/* ---------- 18. Projects grid + cards ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.proj {
    position: relative;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 1.9rem 2.1rem;
    min-height: 170px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.proj:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(16, 24, 40, .08);
    border-color: #d8d8d8;
}

.proj-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .7rem;
}

.proj-head h3 { margin: 0; font-size: 1.4rem; }

.proj-badge {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #fff8e1;
    color: #7a5c00;
    padding: .22rem .55rem;
    border-radius: 4px;
    white-space: nowrap;
}

.proj p { margin: 0 0 .65rem; font-size: 1rem; }

.proj-label {
    display: inline-block;
    font-weight: 700;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #888;
    margin-right: .35rem;
}

.proj-label.problem { color: #c0392b; }   /* red */
.proj-label.solution { color: #e67e22; }  /* orange */

.tech-tags {
    list-style: none;
    padding: 0;
    margin: .4rem 0 1.1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.tech-tags li {
    font-size: .75rem;
    background: #f2f2f2;
    color: #444;
    padding: .25rem .6rem;
    border-radius: 999px;
}

.proj-link {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    font-size: .9rem;
    color: #0056b3;
}

.proj-link .arr { display: inline-block; transition: transform .18s ease; }
.proj-link:hover { text-decoration: none; }
.proj-link:hover .arr { transform: translateX(4px); }

/* Stretched link: make the whole card clickable via the existing link */
.proj-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
}

.proj { cursor: pointer; }

@media (max-width: 40em) {
    .projects-grid { grid-template-columns: 1fr; }
}

/* ---------- 18b. Projects filter + list ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
    margin: .5rem 0 2rem;
}

.filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
}

.filter-group .flabel {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: #9aa4b0;
    margin-right: .3rem;
}

.filter-btn {
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    color: #3a4654;
    background: #fff;
    border: 1px solid #d9dee6;
    border-radius: 999px;
    padding: .3rem .85rem;
    cursor: pointer;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.filter-btn:hover { border-color: #2e86ab; color: #2e86ab; }
.filter-btn.active { background: #1f2a37; border-color: #1f2a37; color: #fff; }

.project-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #ededed;
}

a.project-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1.15rem .35rem;
    border-bottom: 1px solid #ededed;
    text-decoration: none;
    color: inherit;
    transition: background .15s ease, padding-left .15s ease;
}

a.project-row:hover {
    background: #f6f9fb;
    padding-left: .8rem;
    text-decoration: none;
}

.pr-main { flex: 1 1 auto; min-width: 0; }
.pr-title {
    display: inline;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    font-size: 1.18rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.7;
    padding: 0 .15rem;
    background: linear-gradient(transparent 60%, #aef0cf 60%);
}
.pr-desc { display: block; font-size: .95rem; color: #586472; line-height: 1.45; margin-top: .45rem; margin-bottom: .55rem; }

/* Tech-stack chips with a colored type chip up front */
.pr-stack { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }

.pr-tag {
    font-size: .78rem;
    font-weight: 600;
    color: #243b53;
    background: #f4f8fb;
    border: 1px solid #d6e4f0;
    border-left: 3px solid #2e86ab;
    border-radius: 6px;
    padding: .3rem .65rem;
}

.pr-type {
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .3rem .6rem;
    border-radius: 6px;
}
.pr-type.ml { background: #1d6a8f; color: #fff; }
.pr-type.ba { background: #b5651d; color: #fff; }
.pr-type.web { background: #4a4fb0; color: #fff; }

.pr-arr { flex: 0 0 auto; align-self: center; color: #2e86ab; font-size: 1.15rem; transition: transform .15s ease; }
a.project-row:hover .pr-arr { transform: translateX(5px); }

.project-row.hidden { display: none; }

/* Not-yet-written projects: unclickable, faded, with a "Soon" badge */
.project-row.coming-soon { pointer-events: none; }
.project-row.coming-soon .pr-main { opacity: .55; }
.pr-soon {
    flex: 0 0 auto;
    align-self: center;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #8a94a0;
    background: #f0f2f5;
    border: 1px solid #e2e6eb;
    padding: .25rem .6rem;
    border-radius: 999px;
}

.no-results { color: #8a94a0; font-style: italic; padding: 1.5rem .35rem; }

@media (max-width: 40em) {
    .pr-arr { display: none; }
}

/* ---------- 19. Blog post ---------- */
/* One continuous article card (no cuts between sections) */
.blog-article {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 2rem 2.4rem 2.4rem;
    margin-bottom: 1.5rem;
}

/* Section headers: highlighter-marker style */
.blog-article h2 {
    display: inline-block;
    margin: 2.4rem 0 .8rem;
    line-height: 1.55;
    background: linear-gradient(transparent 62%, #ffe49f 62%);
    padding: 0 .25rem;
}
.blog-article h2:first-of-type { margin-top: 1.6rem; }

.blog-article > p + ul,
.blog-article ul + p { margin-top: .6rem; }

/* Business-question blocks: clear gap before each question, tight to its answer */
.blog-article .bq-q {
    font-weight: 700;
    color: #1a1a1a;
    margin: 2rem 0 .4rem;
}
.blog-article .bq-q:first-of-type { margin-top: 1.2rem; }
.blog-article .bq-q + p { margin-top: 0; }

.blog-back {
    display: inline-flex;
    align-items: center;
    color: #6b7682;
    transition: color .15s ease, transform .15s ease;
}
.blog-back:hover { color: #2e86ab; transform: translateX(-3px); }
.blog-back svg { display: block; }

/* Source repository card (dashed) */
.src-card {
    position: relative;
    background: #ffffff;
    border: 1.5px dashed #c4ccd6;
    border-radius: 10px;
    padding: 1.7rem 1.5rem 1.4rem;
    margin-top: 1rem;
}
.src-card::before {
    content: "REPOSITORY";
    position: absolute;
    top: -.6rem;
    left: 1.2rem;
    background: #ffffff;
    padding: 0 .5rem;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #8a94a0;
}
.src-card ul { list-style: none; padding: 0; margin: .4rem 0 1.2rem; display: grid; gap: .55rem; }
.src-card li { font-size: .95rem; color: #475160; line-height: 1.5; }
.src-card li strong { color: #1a1a1a; }

/* GitHub "View Repository" button */
.repo-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: #159588;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
    padding: .55rem .95rem;
    border-radius: 8px;
    transition: background .15s ease;
}
.repo-link:hover { background: #11796e; text-decoration: none; }
.repo-link .gh-ico { width: 18px; height: 18px; filter: brightness(0) invert(1); }

/* Action buttons (live demo, report) + resources card */
.src-card.resources::before { content: "RESOURCES"; }

.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin: .2rem 0; }
.demo-link, .report-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    padding: .58rem 1rem;
    border-radius: 8px;
    transition: background .15s ease, color .15s ease;
}
.demo-link { background: #159588; color: #ffffff; }
.demo-link:hover { background: #11796e; text-decoration: none; }
.report-link { background: #ffffff; color: #159588; border: 1.5px solid #159588; }
.report-link:hover { background: #eef9f7; text-decoration: none; }
.demo-link svg, .report-link svg { width: 17px; height: 17px; }

.blog-shot {
    display: block;
    width: 100%;
    max-width: 42rem;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin: .5rem auto 1rem;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}

/* Picture gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .8rem;
    margin: 1rem 0 1.2rem;
}
.gallery a { display: block; overflow: hidden; border-radius: 8px; border: 1px solid #e8e8e8; box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
.gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform .25s ease;
}
.gallery a:hover img { transform: scale(1.04); }
/* keep the portrait's face in view in the cropped thumbnail */
.gallery a:first-child img { object-position: center 20%; }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }

/* In-page image viewer (lightbox) */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 20, .88);
    cursor: zoom-out;
    padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: 94vw;
    max-height: 92vh;
    border-radius: 6px;
    box-shadow: 0 12px 50px rgba(0, 0, 0, .55);
    cursor: default;
}
.lightbox-close {
    position: absolute;
    top: .7rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
    opacity: .85;
}
.lightbox-close:hover { opacity: 1; }

/* Contact form success banner */
.form-success {
    background: #eef9f4;
    border: 1px solid #bfe8d4;
    color: #1d6a4f;
    padding: .85rem 1.1rem;
    border-radius: 8px;
    margin-bottom: 1.1rem;
    font-weight: 500;
}

.blog-placeholder {
    background: #fafafa;
    border: 1px dashed #ccc;
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
    color: #999;
    font-size: .9rem;
}

/* Blog hero image (full-width banner under the subtitle) */
.blog-hero {
    display: block;
    width: 100%;
    max-width: 46rem;
    aspect-ratio: 16 / 7;
    object-fit: cover;
    border-radius: 12px;
    margin: 1rem auto 1.5rem;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .08);
}

/* Lede (subtitle restyle: clean, non-italic, editorial) */
.lede {
    font-style: normal;
    font-weight: 500;
    font-size: 1.18rem;
    line-height: 1.5;
    color: #33404f;
    letter-spacing: .1px;
    max-width: 40rem;
    padding-left: .8rem;
    border-left: 3px solid #2e86ab;
}

/* Tech-stack chips (squared cards with a colored accent, not pill ovals) */
.tech-stack {
    list-style: none;
    padding: 0;
    margin: .6rem 0 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.tech-stack li {
    font-size: .82rem;
    font-weight: 600;
    color: #243b53;
    background: #f4f8fb;
    border: 1px solid #d6e4f0;
    border-left: 3px solid #2e86ab;
    border-radius: 6px;
    padding: .35rem .7rem;
}

/* "What's in the repo" list with icons */
.repo-list {
    list-style: none;
    padding: 0;
    margin: .6rem 0 1.2rem;
    display: grid;
    gap: .55rem;
}

.repo-list li {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .95rem;
    color: #333;
}

.repo-list .repo-ico {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    object-fit: contain;
}
