/* ── Projects page ── */
.projects-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

/* Header */
.projects-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.65rem;
}
.projects-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
}
html.dark .projects-subtitle { color: #aaa; }

/* Proportional colour bar */
.area-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2rem;
    gap: 2px;
}
.area-bar-a { background: #ef9052; border-radius: 3px; }
.area-bar-b { background: #0a8f37; border-radius: 3px; }
.area-bar-c { background: #dc1a17; border-radius: 3px; }
.area-bar-q { background: #aaa;    border-radius: 3px; }

/* Areas title */
.projects-areas-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Intro row: text left, figure right */
.projects-intro-row {
    display: flex;
    gap: 4%;
    align-items: flex-start;
    margin-bottom: 3rem;
}
.projects-intro-text {
    flex: 1;
}
.projects-intro-text p { margin-bottom: 0.75rem; color: #444; font-size: 0.95rem; line-height: 1.7; }
html.dark .projects-intro-text p { color: #bbb; }
.projects-intro-text ul { margin: 0.5rem 0 1.25rem 1.2rem; }
.projects-intro-text li { margin-bottom: 0.3rem; font-size: 0.95rem; }
.projects-intro-figure {
    flex: 0 0 42%;
    max-width: 42%;
}
.projects-intro-figure img {
    width: 100%;
    height: auto;
}
html.dark .projects-intro-figure img {
    filter: invert(0.85) hue-rotate(180deg);
}

/* Area buttons */
.area-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.25rem;
}
.area-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s;
}
.area-btn:hover { opacity: 0.85; }
.area-btn-a { background: #ef9052; }
.area-btn-b { background: #0a8f37; }
.area-btn-c { background: #dc1a17; }
.area-btn-q { background: #888; }

/* Group section */
.projects-group { margin-bottom: 3rem; }
.group-label {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 1.25rem;
    padding-left: 0.75rem;
    border-left: 4px solid;
}
.group-label-a { border-color: #ef9052; color: #ef9052; }
.group-label-b { border-color: #0a8f37; color: #0a8f37; }
.group-label-c { border-color: #dc1a17; color: #dc1a17; }
.group-label-q { border-color: #888;    color: #888; }

/* Project grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

/* Project card */
.project-card {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
}
.project-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
html.dark .project-card {
    background: #242424;
    border-color: rgba(255,255,255,0.08);
}
html.dark .project-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.project-card-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}
.project-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.project-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.project-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.12);
    text-decoration: none;
    color: #555;
    transition: border-color 0.2s, color 0.2s;
}
.project-tag:hover { border-color: #0a8f37; color: #0a8f37; }
html.dark .project-tag { border-color: rgba(255,255,255,0.15); color: #aaa; }
html.dark .project-tag:hover { border-color: #0a8f37; color: #0a8f37; }
.project-tag-topic { background: rgba(0,0,0,0.03); }
html.dark .project-tag-topic { background: rgba(255,255,255,0.04); }

.project-excerpt {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #555;
    flex: 1;
}
html.dark .project-excerpt { color: #aaa; }

.project-arrow {
    align-self: flex-end;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #555;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
}
.project-arrow:hover { background: #0a8f37; color: #fff; border-color: #0a8f37; }
html.dark .project-arrow { border-color: rgba(255,255,255,0.15); color: #aaa; }

/* Responsive */
@media (max-width: 700px) {
    .projects-grid { grid-template-columns: 1fr; }
    .projects-intro-row { flex-direction: column; }
    .projects-intro-figure { max-width: 100%; }
}