/* ===== Self Employed Website — Design system (dark default, light theme) ===== */

/* --- Theme: dark (default) --- */
:root,
[data-theme="dark"] {
    --bg: #0d1117;
    --bg-surface: #161b22;
    --bg-elevated: #21262d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --border: #30363d;
    --accent: #5CE1E6;
    --accent-hover: #7de9ed;
    --primary: #FF66C4;
    --primary-hover: #ff85cf;
    --danger: #f85149;
    --success: #3fb950;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.35);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    --space-8: 4rem;
    --max-width: 75rem;
    --header-h: 4rem;
}

/* --- Theme: light --- */
[data-theme="light"] {
    --bg: #f6f8fa;
    --bg-surface: #ffffff;
    --bg-elevated: #f6f8fa;
    --text: #1f2328;
    --text-muted: #656d76;
    --border: #d0d7de;
    --accent: #5CE1E6;
    --accent-hover: #3dd5db;
    --primary: #FF66C4;
    --primary-hover: #ff4ab8;
    --danger: #cf222e;
    --success: #1a7f37;
    --shadow: 0 1px 2px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 var(--space-3); font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h3 { font-size: 1.15rem; }
ul { list-style: none; margin: 0; padding: 0; }

/* --- Skip link --- */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-3);
    z-index: 9999;
    padding: var(--space-2) var(--space-3);
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
    border-radius: var(--radius);
    transition: top 0.2s;
}
.skip-link:focus { top: var(--space-3); outline: 2px solid var(--text); outline-offset: 2px; }

/* --- Layout --- */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-4); }
.section { padding: var(--space-6) 0; }
.section-title { text-align: center; margin-bottom: var(--space-5); }

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); }
.logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
    color: inherit;
}
.logo img {
    display: block;
    height: 2.75rem;
    width: auto;
    max-width: min(200px, 55vw);
}
.logo:hover { text-decoration: none; }
.logo:hover img { opacity: 0.92; }
.logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }

/* Nav toggle (mobile) */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    border-radius: var(--radius);
}
.nav-toggle:hover, .nav-toggle:focus-visible { background: var(--bg-elevated); }
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav */
.nav { display: flex; align-items: center; gap: var(--space-4); }
.nav-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.nav-list a {
    display: block;
    padding: var(--space-2) var(--space-3);
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius);
}
.nav-list a:hover, .nav-list a.active { color: var(--text); background: var(--bg-elevated); text-decoration: none; }

/* Theme toggle */
.theme-toggle {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    font-size: 1.25rem;
}
.theme-toggle:hover, .theme-toggle:focus-visible { background: var(--border); }
.theme-icon { display: inline-block; }
[data-theme="light"] .theme-icon.moon { display: none; }
[data-theme="dark"] .theme-icon.sun { display: none; }
:root:not([data-theme]) .theme-icon.sun { display: none; }

/* Mobile nav */
@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-surface);
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-4);
        gap: var(--space-4);
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.25s, visibility 0.25s;
        overflow-y: auto;
    }
    .nav.is-open { transform: translateX(0); visibility: visible; }
    .nav-list { flex-direction: column; gap: 0; }
    .nav-list a { padding: var(--space-3); font-size: 1.1rem; }
    .theme-toggle-wrap { margin-top: auto; padding-top: var(--space-4); }
}
@media (min-width: 769px) {
    .nav-toggle { display: none; }
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.5;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); text-decoration: none; color: #fff; }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--accent); color: var(--bg); text-decoration: none; border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text); text-decoration: none; }

/* --- Hero --- */
.hero {
    position: relative;
    padding: var(--space-8) 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    min-height: 28rem;
}
.hero-bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 0;
}
.hero-bg-slide.active {
    opacity: 1;
    z-index: 1;
}
.hero-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}
.hero-container {
    position: relative;
    z-index: 3;
}
.hero-content { text-align: center; max-width: 40rem; margin: 0 auto; }
.hero-content h1 { margin-bottom: var(--space-3); }
.hero-content p { font-size: 1.125rem; color: var(--text-muted); margin-bottom: var(--space-5); }
.hero-buttons { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; }

/* Page header (inner pages) */
.page-header {
    padding: var(--space-6) 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}
.page-header.page-header-hero {
    position: relative;
    overflow: hidden;
    background: transparent;
}
.page-header.page-header-hero .container { position: relative; z-index: 3; }
.page-header.page-header-hero h1,
.page-header.page-header-hero p { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.page-header.page-header-hero p { color: rgba(255,255,255,0.9); }
.page-header h1 { margin-bottom: var(--space-2); }
.page-header p { color: var(--text-muted); margin: 0; }

/* --- CTA strip --- */
.cta-strip {
    padding: var(--space-4) 0;
    background: var(--accent);
    color: #fff;
    text-align: center;
}
.cta-strip a { color: #fff; }
.cta-strip .btn-primary { background: #fff; color: var(--accent); border-color: #fff; }
.cta-strip .btn-primary:hover { background: var(--bg); color: #fff; border-color: var(--bg); }
.cta-strip .btn-secondary { border-color: #fff; color: #fff; }
.cta-strip .btn-secondary:hover { background: #fff; color: var(--accent); }
.cta-strip .btn-ghost { color: rgba(255,255,255,0.9); }
.cta-strip .btn-ghost:hover { background: rgba(255,255,255,0.2); color: #fff; }
.cta-strip-text { margin: 0 0 var(--space-3); font-weight: 600; }
.cta-strip-buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }

/* --- Cards --- */
.service-card, .portfolio-item, .testimonial-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}
.service-card:hover, .portfolio-item:hover { box-shadow: var(--shadow-lg); border-color: #5CE1E6; }
.process-step:hover, .testimonial:hover { border-color: #5CE1E6; }
.service-card {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.service-card-cta {
    margin-top: auto;
    align-self: center;
}
.service-card-heading {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}
.service-card-heading .service-card-icon {
    margin-top: 0.1em;
}
.service-card-heading h3 {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}
.service-card-icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.3rem;
    box-sizing: border-box;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.service-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.service-card p {
    flex: 1 1 auto;
    margin: 0 0 var(--space-3);
    color: var(--text-muted);
    font-size: 0.95rem;
}
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.portfolio-item { position: relative; }
.portfolio-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
    opacity: 0;
    transition: opacity 0.2s;
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
.portfolio-overlay h3, .portfolio-overlay p { margin: 0 0 var(--space-1); color: #fff; }
.portfolio-overlay .btn { margin-top: var(--space-2); }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }

/* Portfolio filters */
.portfolio-filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); justify-content: center; }
.filter-btn {
    padding: var(--space-2) var(--space-3);
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
}
.filter-btn:hover, .filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Blog --- */
.container-narrow { max-width: 42rem; margin-left: auto; margin-right: auto; }
.blog-list {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0 auto;
}
@media (min-width: 640px) {
    .blog-list { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
    .blog-list { grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
}
.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.blog-card:hover { border-color: #5CE1E6; box-shadow: var(--shadow-lg); }
.blog-card-image { display: block; }
.blog-card-image img { width: 100%; height: auto; display: block; vertical-align: middle; }
.blog-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--space-3);
    min-height: 0;
}
.blog-card-body time { font-size: 0.75rem; color: var(--text-muted); }
.blog-card-body h2 { margin: var(--space-1) 0 var(--space-2); font-size: 1.05rem; line-height: 1.3; }
.blog-card-body h2 a { color: var(--text); text-decoration: none; }
.blog-card-body h2 a:hover { color: var(--accent); }
.blog-card-body p { color: var(--text-muted); margin: 0 0 var(--space-2); font-size: 0.9rem; line-height: 1.45; }
.blog-card-body .btn {
    margin-top: auto;
    align-self: flex-start;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}
.blog-meta { font-size: 0.9rem; color: var(--text-muted); margin-bottom: var(--space-2); }
.blog-meta a { color: var(--accent); }
.blog-article h1 { margin-bottom: var(--space-4); }
.blog-featured { margin: 0 0 var(--space-5); }
.blog-featured img { width: 100%; height: auto; border-radius: var(--radius-lg); }
.blog-body.prose { color: var(--text); line-height: 1.7; }
.blog-body.prose p { margin: 0 0 var(--space-3); }
.blog-body.prose h2, .blog-body.prose h3 { margin: var(--space-5) 0 var(--space-2); color: var(--text); }
.blog-body.prose ul, .blog-body.prose ol { margin: 0 0 var(--space-3); padding-left: 1.5rem; }
.blog-body.prose a { color: var(--accent); }
.legal-doc {
    max-width: 46rem;
}
.legal-doc h2:first-of-type { margin-top: 0; }
.form-group.checkbox a { color: var(--accent); text-decoration: underline; }
.form-group.checkbox a:hover { color: var(--accent-hover); }

/* --- Portfolio project detail --- */
.project-hero {
    position: relative;
    overflow: hidden;
    min-height: clamp(22rem, 52vh, 40rem);
    display: flex;
    align-items: flex-end;
}
.project-hero--fallback {
    background: var(--bg-surface);
}
.project-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.project-hero-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.75) 100%);
}
.project-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: var(--space-8) 0 var(--space-6);
}
.project-hero-meta {
    font-size: 0.9rem;
    margin: 0 0 var(--space-2);
    color: rgba(255, 255, 255, 0.85);
}
.project-hero-meta a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.project-hero-meta a:hover {
    text-decoration: underline;
}
.project-hero-title {
    margin: 0 0 var(--space-2);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    max-width: 52rem;
}
.project-hero-sub {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    max-width: 42rem;
}
.project-hero--fallback .project-hero-inner .project-hero-title {
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.project-hero--fallback .project-hero-inner .project-hero-sub {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.project-hero--fallback .project-hero-inner .project-hero-meta {
    color: rgba(255, 255, 255, 0.85);
}

.project-detail-body {
    padding-top: var(--space-6);
}
.project-detail-grid {
    display: grid;
    gap: var(--space-6);
    align-items: start;
}
.project-detail-grid--split {
    grid-template-columns: 1fr;
}
@media (min-width: 960px) {
    .project-detail-grid--split {
        grid-template-columns: 2fr 1fr;
        gap: var(--space-7);
    }
    .project-detail-gallery-aside {
        position: sticky;
        top: var(--space-4);
    }
}
.project-detail-story .blog-body.prose {
    margin: 0;
}
.project-detail-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}
.project-detail-gallery-aside {
    position: relative;
}
.project-detail-gallery-aside > .project-share-card:first-child {
    margin-top: 0;
}
.blog-post-body .project-detail-story .container-narrow {
    width: 100%;
}
.project-detail-gallery-heading {
    margin: 0 0 var(--space-4);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--accent);
}
.project-gallery-widget {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.project-gallery-feature {
    margin: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow);
    line-height: 0;
}
.project-gallery-feature-link {
    display: block;
}
.project-gallery-feature-open {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    cursor: zoom-in;
    background: transparent;
    font: inherit;
    line-height: 0;
    text-align: left;
}
.project-gallery-feature-open:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.project-gallery-feature-media {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(70vh, 28rem);
    object-fit: contain;
    background: var(--bg-elevated);
}
video.project-gallery-feature-media {
    max-height: min(70vh, 28rem);
    width: 100%;
    background: #111;
}
.project-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
}
.project-gallery-thumb {
    position: relative;
    margin: 0;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-surface);
    line-height: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.project-gallery-thumb:hover {
    border-color: var(--accent);
}
.project-gallery-thumb.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.project-gallery-thumb-media {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.project-gallery-thumb video.project-gallery-thumb-media {
    pointer-events: none;
}
.project-gallery-thumb-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    background: rgba(0, 0, 0, 0.25);
}
@media (max-width: 400px) {
    .project-gallery-thumbs {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Portfolio gallery lightbox (portfolio-detail.php) */
.project-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.project-gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.project-gallery-lightbox-inner {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: 100vw;
}
.project-gallery-lightbox-scrim {
    position: absolute;
    inset: 0;
    z-index: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(5, 8, 12, 0.92);
    cursor: pointer;
}
.project-gallery-lightbox-close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 3;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.project-gallery-lightbox-close:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}
.project-gallery-lightbox-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.project-gallery-lightbox-stage {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5) var(--space-3) var(--space-3);
    box-sizing: border-box;
}
.project-gallery-lightbox-media {
    max-width: min(100vw - var(--space-4), var(--max-width));
    max-height: calc(100vh - 9rem);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
video.project-gallery-lightbox-media {
    width: 100%;
    max-width: min(100vw - var(--space-4), var(--max-width));
    background: #111;
}
.project-gallery-lightbox-thumbs-outer {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 100%;
    padding: var(--space-3) 0 var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}
.project-gallery-lightbox-thumbs-outer[hidden] {
    display: none !important;
}
.project-gallery-lightbox-thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-2);
    justify-content: center;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    padding: var(--space-1) 0;
    -webkit-overflow-scrolling: touch;
}
.project-gallery-lightbox-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-elevated);
    line-height: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.project-gallery-lightbox-thumb:hover {
    border-color: var(--accent);
}
.project-gallery-lightbox-thumb.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.project-gallery-lightbox-thumb-media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.project-gallery-lightbox-thumb video.project-gallery-lightbox-thumb-media {
    pointer-events: none;
}
.project-gallery-lightbox-thumb-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    background: rgba(0, 0, 0, 0.3);
}

.project-share-card {
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow);
}
.project-share-card-title {
    margin: 0 0 var(--space-3);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
}
.blog-related-post-card .project-share-card-title {
    margin-bottom: var(--space-2);
}
.blog-related-post-card-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-md);
    outline-offset: 2px;
    transition: opacity 0.15s;
}
.blog-related-post-card-link:hover {
    opacity: 0.92;
}
.blog-related-post-card-link:focus-visible {
    outline: 2px solid var(--accent);
}
.blog-related-post-card-thumb {
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    line-height: 0;
    background: var(--bg-elevated);
}
.blog-related-post-card-thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    vertical-align: middle;
}
.blog-related-post-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.blog-related-post-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}
.blog-related-post-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.blog-related-post-card-read {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: var(--space-1);
}
.project-share-icons {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
}
.project-share-icons li {
    margin: 0;
}
.project-share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    min-height: 2.75rem;
    box-sizing: border-box;
    padding: 0;
    line-height: 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.12s;
}
button.project-share-icon {
    appearance: none;
    -webkit-appearance: none;
}
.project-share-icon svg {
    display: block;
    flex-shrink: 0;
}
a.project-share-icon:hover,
button.project-share-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
    transform: translateY(-1px);
}
button.project-share-icon.project-share-copy.is-done {
    border-color: #3fb950;
    color: #56d364;
}

.project-detail-cta {
    padding-top: 0;
}
.project-detail-cta-row {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
}

/* --- Process timeline --- */
.process-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.process-step {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    position: relative;
}
.step-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: var(--space-2);
}
.process-step h3 { margin-bottom: var(--space-1); font-size: 1rem; }
.process-step p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* --- Testimonials --- */
.testimonial-slider {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: var(--space-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE / old Edge */
}
.testimonial-slider::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Chromium Edge */
}
/* Exactly 3 cards visible in the strip (2 gaps between them); same basis as portfolio preview */
.testimonial {
    flex: 0 0 calc((100% - 2 * var(--space-4)) / 3);
    scroll-snap-align: start;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 17.5rem;
    padding: var(--space-4);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.testimonial-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: var(--space-3);
}
.testimonial-quote {
    font-style: italic;
    color: var(--text);
    margin: 0;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
}
.testimonial.is-expanded .testimonial-quote {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}
.testimonial-more {
    align-self: flex-start;
    margin-top: var(--space-2);
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    font-style: normal;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}
.testimonial-more:hover { color: #5CE1E6; }
.testimonial-more:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}
.testimonial-author {
    margin-top: auto;
    flex-shrink: 0;
}
.testimonial-author h4 { margin: 0 0 var(--space-1); font-size: 0.95rem; }
.testimonial-author p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

@media (max-width: 768px) {
    .testimonial {
        flex: 0 0 min(85%, 20rem);
        min-height: 16rem;
    }
}

/* --- Homepage portfolio preview (same behaviour as testimonial strip) --- */
.portfolio-preview-slider {
    display: flex;
    width: 100%;
    gap: var(--space-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.portfolio-preview-slider::-webkit-scrollbar {
    display: none;
}
.portfolio-preview-slider .portfolio-item {
    flex: 0 0 calc((100% - 2 * var(--space-4)) / 3);
    scroll-snap-align: start;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

/* --- FAQ accordion --- */
.faq-list { max-width: 48rem; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--space-2); overflow: hidden; background: var(--bg-surface); }
.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
}
.faq-question:hover { background: var(--bg-elevated); }
.faq-question:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq-question h3 { margin: 0; font-size: inherit; }
.faq-toggle { font-size: 1.25rem; color: var(--text-muted); transition: transform 0.2s; }
.faq-item[aria-expanded="true"] .faq-toggle { transform: rotate(45deg); }
.faq-answer { padding: 0 var(--space-4) var(--space-3); }
.faq-answer p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.faq-item[aria-expanded="false"] .faq-answer { display: none; }

/* --- Contact form --- */
.contact-grid { display: grid; gap: var(--space-6); }
@media (min-width: 769px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-details h2 { margin-bottom: var(--space-3); }
.contact-method { margin-bottom: var(--space-4); }
.contact-method h3 { margin-bottom: var(--space-1); font-size: 1rem; }
.contact-form-container { background: var(--bg-surface); padding: var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--border); transition: border-color 0.2s, box-shadow 0.2s; }
.contact-form-container:hover { border-color: #5CE1E6; box-shadow: var(--shadow-lg); }
.form-group { margin-bottom: var(--space-3); }
.form-group label { display: block; margin-bottom: var(--space-1); font-weight: 500; font-size: 0.95rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}
.form-group.checkbox { display: flex; align-items: flex-start; gap: var(--space-2); }
.form-group.checkbox input { width: auto; margin-top: 0.25rem; }
.form-messages { margin-bottom: var(--space-3); padding: var(--space-3); border-radius: var(--radius); }
.form-messages.success-message { background: rgba(63, 185, 80, 0.15); border: 1px solid var(--success); color: var(--success); }
.form-messages.error-message { background: rgba(248, 81, 73, 0.1); border: 1px solid var(--danger); color: var(--danger); }
.form-messages ul { margin: var(--space-2) 0 0; padding-left: 1.25rem; }
.form-messages li { list-style: disc; }

/* --- Map --- */
.map-container { display: grid; gap: var(--space-4); }
@media (min-width: 769px) { .map-container { grid-template-columns: 1fr 1fr; } }
.map-embed { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.map-embed iframe { width: 100%; height: 300px; display: block; }
.map-directions p { margin: 0 0 var(--space-2); color: var(--text-muted); }

/* --- Footer --- */
.site-footer { padding: var(--space-6) 0 var(--space-4); border-top: 1px solid var(--border); background: var(--bg-surface); }
.footer-grid { display: grid; gap: var(--space-5); margin-bottom: var(--space-5); }
@media (min-width: 600px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-brand .footer-logo {
    display: inline-block;
    margin-bottom: var(--space-2);
    line-height: 0;
    text-decoration: none;
}
.footer-brand .footer-logo img {
    display: block;
    height: 3.25rem;
    width: auto;
    max-width: min(240px, 70vw);
}
.footer-brand .footer-logo:hover img { opacity: 0.92; }
.footer-brand .footer-logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.footer-links h3, .footer-contact h3, .footer-social h3 { margin-bottom: var(--space-2); font-size: 0.95rem; }
.footer-links ul a, .footer-contact a { color: var(--text-muted); }
.footer-links ul a:hover, .footer-contact a:hover { color: var(--accent); }
.social-links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.social-links.social-icons { gap: var(--space-3); }
.social-icons .social-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; color: var(--text-muted); transition: color 0.2s; }
.social-icons .social-icon svg { width: 1.5rem; height: 1.5rem; }
.social-icons a:hover .social-icon { color: var(--accent); }
.social-icons a:focus-visible .social-icon { color: var(--accent); }
.footer-bottom { padding-top: var(--space-4); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); font-size: 0.85rem; color: var(--text-muted); }
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--accent); }

/* --- CTA banner --- */
.cta-banner { padding: var(--space-6) 0; text-align: center; background: var(--bg-surface); border-top: 1px solid var(--border); }
.cta-banner h2 { margin-bottom: var(--space-2); }
.cta-banner p { color: var(--text-muted); margin: 0 0 var(--space-4); }

/* --- Service list (alternating layout) --- */
.service-item { display: grid; gap: var(--space-4); padding: var(--space-5) 0; border-bottom: 1px solid var(--border); }
.service-item:last-child { border-bottom: none; }
.service-item .service-image img { width: 100%; border-radius: var(--radius-lg); }
.service-item .service-content h3 { margin-bottom: var(--space-2); }
.service-item .service-content ul { padding-left: 1.25rem; margin: 0 0 var(--space-3); }
.service-item .service-content li { list-style: disc; margin-bottom: var(--space-1); color: var(--text-muted); font-size: 0.95rem; }
@media (min-width: 769px) {
    .service-item { grid-template-columns: 1fr 1fr; align-items: center; }
    .service-item:nth-child(even) .service-image { order: 2; }
}

/* --- About block --- */
.about-grid { display: grid; gap: var(--space-5); align-items: center; }
.about-grid img { border-radius: var(--radius-lg); }
@media (min-width: 769px) { .about-grid { grid-template-columns: 1fr 1fr; } }
.about-content p { color: var(--text-muted); margin: 0 0 var(--space-3); }

/* --- Cookie consent banner --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    padding: var(--space-4) 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
}
.cookie-banner-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.cookie-banner p { margin: 0; color: var(--text); font-size: 0.95rem; max-width: 36rem; }
.cookie-banner-buttons { display: flex; gap: var(--space-2); flex-shrink: 0; }

/* --- Utilities --- */
.text-center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[aria-live] { padding: var(--space-2); }

/* Scroll to top */
.scroll-top {
    position: fixed;
    bottom: var(--space-4);
    right: var(--space-4);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 90;
}
.scroll-top.show { opacity: 1; visibility: visible; }
.scroll-top:hover, .scroll-top:focus-visible { opacity: 1; background: var(--accent-hover); }
.scroll-top:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Optional site-wide image overlay (config image_watermark_overlay) */
html.fhm-wm-overlay #main .img-wm-wrap {
    display: inline-block;
    position: relative;
    max-width: 100%;
    line-height: 0;
    vertical-align: middle;
}
html.fhm-wm-overlay #main .img-wm-wrap img {
    display: block;
    width: 100%;
    height: auto;
}
html.fhm-wm-overlay #main .img-wm-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/images/logo.png') no-repeat right 0.5rem bottom 0.5rem;
    background-size: min(22%, 9rem) auto;
    opacity: 0.32;
    pointer-events: none;
}

/* Optional mild save deterrent (config image_discourage_download + app.js) */
html.fhm-img-protect #main img,
html.fhm-img-protect .site-header img,
html.fhm-img-protect .site-footer img,
html.fhm-img-protect #projectGalleryLightbox img {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
