:root {
    --bg: #111111;
    --surface: #1e1e1e;
    --text: #f5f5f5;
    --muted: #b8b8b8;
    --accent: #c51d4a;
    --accent-strong: #c51d4a;
    --accent-secondary: #f5f5f5;
    --border: #3a3a3a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-wrapper {
    width: min(1100px, 92%);
    margin: 0 auto;
    padding: 1.8rem 0 4rem;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
}

.top-nav {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.top-nav a {
    color: var(--muted);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.top-nav a:hover {
    color: var(--text);
    text-decoration: none;
}

.hero {
    padding: 0;
}

.hero-inner {
    background: linear-gradient(160deg, #2a2a2a, #141414 68%);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 28px 50px rgba(0, 0, 0, 0.3);
}

.brand-logo {
    width: 160px;
    max-width: 100%;
    object-fit: contain;
    filter: brightness(1.08);
}

.brand-logo-link {
    display: inline-flex;
    line-height: 0;
    text-decoration: none;
}

.brand-logo-link:hover .brand-logo {
    filter: brightness(1.14);
}

.brand-title {
    margin: 0;
    font-size: clamp(1.4rem, 2.2vw, 2rem);
}

.profile-block {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.8rem;
    align-items: center;
}

.profile-image {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 3px solid var(--accent-strong);
    object-fit: cover;
    object-position: 74% center;
    background: #0b0f13;
}

.intro-copy h2 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}

.intro-subtitle {
    margin: -0.25rem 0 0.85rem;
    color: var(--muted);
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.eyebrow {
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin: 0 0 0.4rem;
}

.button {
    display: inline-block;
    background: var(--accent);
    color: #f5f5f5;
    border-radius: 999px;
    padding: 0.58rem 1rem;
    font-weight: 400;
    font-family: inherit;
}

.button:hover {
    text-decoration: none;
    filter: brightness(0.95);
}

.hero-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
    align-items: center;
}

.button-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--accent-secondary);
}

.socials {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 10px;
    color: var(--muted);
    transition: color 0.15s ease, background 0.15s ease;
}

.social-icon:hover {
    color: var(--accent);
    background: rgba(197, 29, 74, 0.12);
    text-decoration: none;
}

/* Font Awesome brands: one size, slightly larger than before so detail stays clear */
.social-icon .fab {
    font-size: 1.7rem;
    line-height: 1;
    display: block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Raspberry Pi glyph sits a bit high in the font box; nudge for optical alignment */
.social-icon .fa-raspberry-pi {
    transform: translateY(2px);
}

.section {
    margin-top: 2.2rem;
}

.section h2,
.card-project .card-title {
    margin: 0;
    font-size: clamp(1.1rem, 1.9vw, 1.3rem);
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
}

.section-rule {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0.75rem 0 1.1rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
}

.projects-home-more {
    margin: 1.35rem 0 0;
    text-align: center;
}

.projects-page .section-head h1 {
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
}

.projects-page-back {
    margin: 2rem 0 0;
    text-align: center;
}

.pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pill-grid span {
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    padding: 0.3rem 0.7rem;
    font-size: 0.86rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

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

.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #202020;
}

/* Projects: hero-style row, thumbnail left, keel.me-like (full card = link to post) */
.card-project {
    background: linear-gradient(160deg, #2a2a2a, #141414 68%);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    overflow: visible;
}

a.card-project {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

a.card-project:hover {
    border-color: var(--accent);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
}

a.card-project:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.card-project-inner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 1rem;
}

.card-project .card-media {
    flex: 0 0 35%;
    width: 35%;
    min-width: 0;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #2a2a2a;
    border: 1px solid var(--border);
    align-self: center;
}

.card-project .card-media--empty {
    background: linear-gradient(145deg, #2f2f2f, #1a1a1a);
}

.card-project .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.card-project .card-body {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.35rem;
}

.card-title {
    margin: 0;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    line-height: 1.25;
    color: var(--text);
}

.card-date {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.card-project .card-date {
    font-size: 1rem;
    line-height: 1.55;
    letter-spacing: 0.01em;
    color: #c4c4c4;
}

.card-excerpt {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.card-project .card-excerpt {
    flex: 1 1 auto;
    min-height: 0;
    align-self: stretch;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.card-project .card-tags {
    flex-shrink: 0;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.1rem;
}

/* Match About section .pill-grid span; full accent fill on project row hover */
.card-tag {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    padding: 0.3rem 0.7rem;
    font-size: 0.86rem;
    background: transparent;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

a.card-project:hover .card-tag {
    border-color: var(--accent);
    background: var(--accent);
    color: #f5f5f5;
}

.card-project--static {
    cursor: default;
    opacity: 0.95;
}

.card-body p {
    margin: 0 0 0.6rem;
    color: var(--muted);
}

.timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.timeline > div {
    border-left: 2px solid var(--accent);
    padding-left: 0.9rem;
}

/* CV actions: hero-style button row; panel absolutely positioned under that row only (top: 100% ref is correct). Spacer ::after reserves flow space so Projects is not overlapped. */
.cv-actions {
    width: 100%;
    margin-top: 1.35rem;
}

.cv-actions-bar {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

/* In-flow space below the button row when open (panel is out-of-flow, so this holds layout) */
.cv-actions-bar::after {
    content: "";
    display: block;
    width: 100%;
    min-height: 0;
    flex-shrink: 0;
    transition: min-height 0.45s cubic-bezier(0.33, 1, 0.68, 1);
    pointer-events: none;
}

/* Match scroll area (~22rem) + panel chrome + footer; avoid oversized empty gap */
.cv-actions:has(.cv-recommendations[open]) .cv-actions-bar::after {
    min-height: min(28rem, 52vh);
}

.cv-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: flex-start;
    justify-content: flex-start;
    position: relative;
    width: 100%;
}

.cv-download {
    flex: 0 0 auto;
}

.cv-recommendations {
    flex: 0 0 auto;
    position: static;
}

.cv-recommendations .recommendations-summary {
    list-style: none;
    cursor: pointer;
}

.cv-recommendations .recommendations-summary::-webkit-details-marker {
    display: none;
}

.cv-recommendations .recommendations-summary::marker {
    content: "";
}

.cv-recommendations .recommendations-summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.recommendations-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 0.75rem;
    width: 100%;
    max-width: none;
    z-index: 1;
    box-sizing: border-box;
    overflow: hidden;
    transform-origin: top center;
}

details[open] .recommendations-panel {
    animation: recommendations-wipe 0.48s cubic-bezier(0.33, 1, 0.68, 1) both;
}

@keyframes recommendations-wipe {
    from {
        clip-path: inset(0 0 100% 0);
        opacity: 0.85;
    }

    to {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cv-actions-bar::after {
        transition: none;
    }

    details[open] .recommendations-panel {
        animation: none;
    }
}

.recommendations-footer {
    margin: 0.85rem 0 0;
}

.recommendations-linkedin-btn {
    display: inline-block;
}

.recommendations-scroll {
    max-height: 22rem;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 0.35rem 0.45rem 0.35rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #6a6a6a rgba(0, 0, 0, 0.35);
}

.recommendations-scroll::-webkit-scrollbar {
    width: 10px;
}

.recommendations-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 0 10px 10px 0;
    margin: 4px 0;
}

.recommendations-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.recommendations-scroll::-webkit-scrollbar-thumb:hover {
    background: #6a6a6a;
    background-clip: padding-box;
}

.recommendation {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 0.85rem;
    align-items: start;
    padding: 1rem 0.65rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.recommendation:last-child {
    border-bottom: none;
}

.recommendation-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    background: #2a2a2a;
}

.recommendation-body {
    min-width: 0;
}

.recommendation-author {
    margin: 0 0 0.45rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.recommendation-author a {
    color: var(--text);
    text-decoration: none;
}

.recommendation-author a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.recommendation-role {
    margin: 0 0 0.2rem;
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--muted);
}

.recommendation-posted {
    display: block;
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #c4c4c4;
}

.recommendation-meta {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #c4c4c4;
}

.recommendation-quote {
    margin: 0;
    padding: 0 0 0 0.85rem;
    border-left: 2px solid var(--accent);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text);
    font-style: normal;
}

.post-single h1 {
    margin-top: 0;
}

/* Single post / project (matches home hero + project card look) */
.post-detail-section {
    margin-top: 0;
}

.post-detail {
    text-align: left;
}

.post-detail-back {
    display: inline-block;
    margin: 0 0 1.25rem;
    font-size: 0.92rem;
    color: var(--muted);
    text-decoration: none;
}

.post-detail-back:hover {
    color: var(--accent);
    text-decoration: underline;
}

.post-detail-media {
    margin: 0 0 1.25rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 16 / 9;
    background: #2a2a2f;
}

.post-detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.post-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
}

.post-detail .post-content {
    margin-top: 1.15rem;
}

.post-single .page-feature-image {
    display: block;
    width: 100%;
    max-height: min(50vh, 420px);
    object-fit: cover;
    border-radius: 12px;
    margin: 0 0 1rem;
}

.post-meta {
    margin-top: -0.5rem;
    color: var(--muted);
}

.post-content img {
    max-width: 100%;
    border-radius: 8px;
}

/* Koenig editor: wide images / embeds */
.post-content .kg-width-wide {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.post-content .kg-width-wide img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.post-content .kg-width-full {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.post-content .kg-width-full img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 0;
}

.contact-form {
    margin-top: 1.35rem;
    max-width: 28rem;
}

.contact-label {
    display: block;
    margin-top: 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
}

.contact-label:first-of-type {
    margin-top: 0;
}

.contact-input {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    line-height: 1.45;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-input::placeholder {
    color: #6b7785;
}

.contact-input:hover {
    border-color: #c51d4a;
}

.contact-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(197, 29, 74, 0.22);
}

.contact-textarea {
    min-height: 9rem;
    resize: vertical;
}

.contact-submit {
    margin-top: 1.1rem;
    border: none;
    cursor: pointer;
}

/* Virtual business card (Page with template "Business card") */
.page-vcard {
    padding-bottom: 3rem;
}

.vcard-nav {
    margin-bottom: 1.25rem;
}

.vcard-back {
    display: inline-block;
    font-size: 0.92rem;
    color: var(--muted);
    text-decoration: none;
}

.vcard-back:hover {
    color: var(--accent);
}

.vcard {
    max-width: 26rem;
    margin: 0 auto;
    padding: 2rem 1.75rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: linear-gradient(160deg, #2a2a2a, #141414 68%);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.vcard-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 3px solid var(--accent);
    margin: 0 auto 1rem;
    display: block;
    background: #2a2a2a;
}

.vcard-name {
    margin: 0 0 0.5rem;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
}

.vcard-body {
    margin-top: 1.15rem;
    text-align: left;
}

.vcard-body > p {
    margin: 0.65rem 0;
    line-height: 1.55;
}

.vcard-body > p:first-child {
    margin-top: 0;
}

/* Structured contact (paste HTML block in Ghost — see custom-business-card.hbs) */
.vcard-contact {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.25rem;
}

.vcard-contact-link {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.22);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.vcard-contact-link:hover {
    border-color: var(--accent);
    color: var(--text);
    text-decoration: none;
    background: rgba(197, 29, 74, 0.08);
}

.vcard-contact-link i {
    flex: 0 0 1.25rem;
    width: 1.25rem;
    margin-top: 0.1rem;
    text-align: center;
    color: var(--accent);
}

.vcard-contact-link span {
    flex: 1;
    min-width: 0;
    line-height: 1.45;
    word-break: break-word;
}

.vcard-contact-address {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text);
    font-size: 0.96rem;
    line-height: 1.5;
    text-align: left;
}

.vcard-contact-address i {
    flex: 0 0 1.25rem;
    color: var(--accent);
    margin-top: 0.1rem;
}

.page-vcard .post-content a {
    color: var(--accent);
}

.page-vcard .post-content .vcard-contact a.vcard-contact-link {
    color: var(--text);
}

.site-footer {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    padding: 1.6rem 0 2rem;
}

.site-footer-inner {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.site-footer-title {
    margin: 0;
    font-size: 1.05rem;
}

.site-footer-socials {
    margin-top: 0.6rem;
}

.site-footer-meta {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 760px) {
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .top-nav {
        justify-content: flex-start;
    }

    .hero-inner {
        padding: 1.3rem;
    }

    .profile-block {
        grid-template-columns: 1fr;
    }

    .profile-image {
        width: 170px;
        height: 170px;
    }

    a.card-project {
        padding: 1rem 1.15rem;
    }

    .card-project-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .card-project .card-media {
        width: 100%;
        max-width: 200px;
        flex: 0 0 auto;
        align-self: flex-start;
    }

    .card-project .card-excerpt {
        flex: 0 1 auto;
        -webkit-line-clamp: 4;
    }

    .card-project .card-tags {
        margin-top: 0.2rem;
    }

    .cv-actions:has(.cv-recommendations[open]) .cv-actions-bar::after {
        min-height: min(30rem, 56vh);
    }
}
