* {
    box-sizing: border-box;
}

body {
    color: #E5E7EB;
    background-color: #3b3d3c;
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
}

h1, h2, h3, h4 {
    color: #1ba31b;
}

.About-me-h2 {
    text-align: center;
}

/* ── Header ── */
header {
    background-image: url("images/coding.jpg");
    background-size: cover;
    background-position: center;
    height: 25vh;
    width: 100%;
    border-radius: 12px;
}

.header-overlay {
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ── Nav ── */
nav {
    font-size: 1.5em;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem 1rem;
}

nav b {
    display: contents;
}

nav a, .links {
    color: #4ade80;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

nav a:hover, .links:hover {
    color: #1ba31b;
}

nav a.nav-active {
    color: #fff;
    background-color: #1ba31b;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

/* ── Main ── */
main {
    padding: 2px 10px 20px 10px;
    display: block;
    animation: fadeInUp 0.4s ease both;
}

.main-page {
    width: 75%;
    margin: 0 auto;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Footer ── */
footer {
    padding: 1.5rem;
    text-align: center;
}

footer div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    justify-content: center;
}

footer ul li br { display: none; }

/* ── Pill buttons ── */
.pill-btn {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    border-radius: 999px;
    background-color: #212429;
    color: #4ade80;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid #1ba31b;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.pill-btn:hover {
    transform: scale(1.1);
    background-color: #1ba31b;
    color: #fff;
}

.stat-card {
    background-color: #212429;
    border-radius: 12px;
    padding: 1.2rem 1rem;
    text-align: center;
    box-shadow: 0 8px 20px #313339;
    border-top: 3px solid #1ba31b;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1ba31b;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.centered-tags {
    justify-content: center;
}

.tag {
    background-color: rgba(27,163,27,0.15);
    color: #4ade80;
    border: 1px solid rgba(27,163,27,0.35);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
}

.project-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.project-title-row h4 {
    margin: 0;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
}

.status-completed {
    background-color: rgba(27,163,27,0.2);
    color: #4ade80;
    border: 1px solid rgba(27,163,27,0.4);
}

.status-inprogress {
    background-color: rgba(234,179,8,0.15);
    color: #facc15;
    border: 1px solid rgba(234,179,8,0.35);
}

/* ── HOME page ── */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: center;
    margin-top: 1.5rem;
}

.home-image a { display: block; }

.home-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    object-fit: cover;
    aspect-ratio: 3/4;
    transition: transform 0.2s ease-in-out;
}

.home-image img:hover { transform: scale(1.03); }

.home-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.home-highlights {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.highlight-card {
    background-color: #212429;
    border-radius: 12px;
    padding: 1.2rem 1rem;
    text-align: center;
    box-shadow: 0 8px 20px #313339;
    border-top: 3px solid #1ba31b;
}

.highlight-icon {
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
}

.highlight-title {
    font-weight: 700;
    color: #1ba31b;
    font-size: 0.95rem;
}

.highlight-sub {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 0.2rem;
}

/* ── ABOUT page ── */
.about-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
    margin-top: 1rem;
}

.about-image-col .about-me { margin: 0; }
.about-image-col .about-me a { display: block; }

.about-image-col .about-me img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    object-fit: cover;
    transition: transform 0.2s ease-in-out;
}

.about-image-col .about-me img:hover { transform: scale(1.03); }

.about-me {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.about-text-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

/* ── PROJECTS page ── */
.project {
    background-color: #212429;
    border-radius: 12px;
    box-shadow: 0 8px 20px #313339;
    padding: 1.5rem;
    margin-bottom: 1.5em;
    display: flex;
    flex-direction: row;
    gap: 1.2rem;
    align-items: flex-start;
}

.project-image {
    flex: 0 0 25%;
    max-width: 25%;
}

.project-image img {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    min-height: 160px;
    max-height: 350px;
}

.project-content { flex: 1; }

/* ── SKILLS page ── */
main.skills-main {
    text-align: center;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.skills {
    background-color: #212429;
    border-radius: 12px;
    box-shadow: 0 8px 20px #313339;
    padding: 1.5rem;
    margin-bottom: 0;
}

.cert-table {
    background-color: #212429;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px #313339;
    margin-top: 1rem;
}

.cert-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid #3b3d3c;
}

.cert-row:last-child { border-bottom: none; }

.cert-name {
    font-size: 0.95rem;
    color: #E5E7EB;
}

.cert-badge-inprogress {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background-color: rgba(234,179,8,0.15);
    color: #facc15;
    border: 1px solid rgba(234,179,8,0.35);
    white-space: nowrap;
}

.cert-badge-planned {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background-color: rgba(156,163,175,0.15);
    color: #9ca3af;
    border: 1px solid rgba(156,163,175,0.3);
    white-space: nowrap;
}

/* ── HOBBIES page ── */
.hobbies-txt{
    width: 50%;
}

.bike-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1rem 0 1.5rem 0;
}

.bike-card {
    background-color: #212429;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 8px 20px #313339;
    border-top: 3px solid #1ba31b;
}

.bike-card-year {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1ba31b;
    line-height: 1;
}

.bike-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.3rem;
    color: #E5E7EB;
}

.bike-card-sub {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.2rem;
}

.bike-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.bike-image {
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    border-radius: 12px;
    padding: 0.75rem;
    margin: 0;
    transition: transform 0.2s ease-in-out;
}

.bike-image a { display: block; }
.bike-image:hover { transform: scale(1.05); }

.bike-image .image {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
}

.bike-image figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #E5E7EB;
}

.gttsrd    { background-image: url("images/gttsrd.jpeg"); }
.bike2     { background-image: url("images/ggbridge.jpeg"); }
.bike3     { background-image: url("images/trackday-1.jpg"); }
.bike4     { background-image: url("images/trackday-2.jpg"); }
.gaming-pc { background-image: url("images/gaming-pc.jpg"); }

/* ── YouTube embed ── */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
}

.video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: 12px;
}

/* ── CONTACT page ── */
main.contact-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

main.contact-main h2 {
    width: 100%;
    text-align: center;
}

main.contact-main form {
    max-width: 700px;
    width: 100%;
}

.contact-info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 700px;
    margin-bottom: 1.5rem;
}

.contact-info-card {
    background-color: #212429;
    border-radius: 12px;
    padding: 1.1rem 1rem;
    text-align: center;
    box-shadow: 0 8px 20px #313339;
    border-top: 3px solid #1ba31b;
}

.contact-info-icon {
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}

.contact-info-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #E5E7EB;
    margin-top: 0.2rem;
}


.social-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

form {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 550px;
}

form label {
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 4px;
    display: block;
}

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

form textarea { resize: vertical; }

form button {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
    width: 100%;
}

form button:hover { background-color: #555; }

/* ── EXPERIENCE page ── */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0 2rem 0;
}

.timeline {
    position: relative;
    padding-left: 2rem;
    margin: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.45rem;
    top: 0; bottom: 0;
    width: 2px;
    background: #1ba31b;
    opacity: 0.4;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-dot {
    position: absolute;
    left: -1.7rem;
    top: 1.1rem;
    width: 14px; height: 14px;
    border-radius: 50%;
    background-color: #1ba31b;
    border: 2px solid #3b3d3c;
    box-shadow: 0 0 0 3px rgba(27,163,27,0.25);
}

.timeline-card {
    background-color: #212429;
    border-radius: 12px;
    padding: 1.4rem;
    box-shadow: 0 8px 20px #313339;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.timeline-header h4 { margin: 0 0 0.2rem 0; }

.timeline-company {
    font-size: 0.85rem;
    color: #9ca3af;
}

.timeline-date {
    font-size: 0.8rem;
    color: #4ade80;
    background-color: rgba(27,163,27,0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
    font-weight: 600;
}

.methodology-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.method-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: #212429;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    box-shadow: 0 4px 12px #313339;
}

.step-num {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1ba31b;
    opacity: 0.7;
    flex-shrink: 0;
    min-width: 2rem;
}

.step-text {
    font-size: 0.9rem;
    color: #E5E7EB;
}

/* ── Media queries ── */
@media (max-width: 900px) {
    nav { font-size: 1.1em; gap: 0.4rem 0.75rem; }
}

@media (max-width: 768px) {
    header { height: 18vh; border-radius: 0; }
    nav { font-size: 0.95em; gap: 0.3rem 0.6rem; }
    main { padding: 10px 14px 24px 14px; }

    .main-page { width: 100%; }

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

    .home-image img { max-height: 280px; aspect-ratio: auto; }

    .home-highlights,
    .stat-cards,
    .bike-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 1rem;
    }

    .contact-info-cards { grid-template-columns: 1fr; }

    .bike-gallery { grid-template-columns: 1fr; }
    .bike-image .image { height: 180px; }

    .project { flex-direction: column; }
    .project-image { flex: none; max-width: 100%; }
    .project-image img { min-height: 180px; max-height: 220px; width: 100%; }

    .methodology-steps { grid-template-columns: 1fr; }
    .timeline-header { flex-direction: column; }

    footer ul { flex-direction: column; gap: 0.5rem; }
}

@media (max-width: 480px) {
    nav { font-size: 0.82em; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }
    main { padding: 8px 10px 20px 10px; }

    .home-highlights,
    .about-stats,
    .stat-cards,
    .bike-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

#error-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeInUp 0.2s ease both;
}

#error-popup {
    background-color: #212429;
    border-radius: 14px;
    border-top: 4px solid #e53e3e;
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    max-width: 340px;
    width: 90%;
}

#error-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

#error-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e53e3e;
    margin-bottom: 0.4rem;
}

#error-message {
    font-size: 0.95rem;
    color: #E5E7EB;
    margin-bottom: 1.5rem;
}

#error-close {
    padding: 0.5rem 2rem;
    background-color: #e53e3e;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

#error-close:hover {
    background-color: #c53030;
    transform: scale(1.05);
}
