/*
 * Codliy public site — design layer.
 *
 * A plain stylesheet (no build step) loaded last on public pages. It owns the
 * look of the landing sections (cx-* classes, Modules/Website/resources/views/
 * newLanding/panels) and re-tints the shared codliy-* classes the blog,
 * portfolio and CMS pages use, so the whole public site reads as one system.
 *
 * Direction: an engineering studio's working paper. Calm surfaces, strong
 * left-aligned type, hairlines instead of boxes, and one loud element — the
 * release log in the hero, built from markup rather than a picture. The slash
 * of the "Cod/iy" wordmark is the recurring mark.
 *
 * The brand colour is the admin's primary colour (--bs-primary); everything
 * else is defined here for light and dark mode.
 */

/* ── Tokens ─────────────────────────────────────────────────────────── */

:root,
[data-bs-theme="light"] {
    --cx-brand: var(--bs-primary, #0059ff);
    --cx-brand-text: var(--cx-brand);
    /* Fill behind white text (buttons, the call-to-action band). */
    --cx-brand-solid: var(--cx-brand);
    --cx-bg: #f6f7fb;
    --cx-surface: #ffffff;
    --cx-ink: #0b1324;
    --cx-body: #3d4a63;
    --cx-muted: #5b6780;
    --cx-line: #e1e6f0;
    --cx-ok: #0b8a5f;
    --cx-night: #0a1020;
    --cx-night-line: #1f2a44;
    --cx-night-ink: #e9edf6;
    --cx-night-muted: #93a0bb;
    --cx-radius: 14px;
    --cx-radius-sm: 9px;
    --cx-shadow: 0 1px 2px rgba(11, 19, 36, 0.04), 0 12px 32px -16px rgba(11, 19, 36, 0.18);
}

[data-bs-theme="dark"] {
    --cx-brand-text: color-mix(in srgb, var(--cx-brand) 62%, #ffffff);
    /* Dark-mode brand colours are usually light: deepen them so white text stays readable. */
    --cx-brand-solid: color-mix(in srgb, var(--cx-brand) 72%, #000000);
    --cx-bg: #070b16;
    --cx-surface: #0e1526;
    --cx-ink: #f1f4fa;
    --cx-body: #b9c2d6;
    --cx-muted: #8e9ab3;
    --cx-line: #1d2740;
    --cx-ok: #34d399;
    --cx-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -18px rgba(0, 0, 0, 0.7);
}

/* ── Base ───────────────────────────────────────────────────────────── */

body {
    background: var(--cx-bg);
    color: var(--cx-body);
}

main#main-content {
    display: block;
}

.cx-section {
    padding-block: clamp(4rem, 8vw, 7rem);
    background: var(--cx-bg);
    color: var(--cx-body);
    position: relative;
}

.cx-section--surface {
    background: var(--cx-surface);
    border-block: 1px solid var(--cx-line);
}

.cx-title {
    color: var(--cx-ink);
    font-weight: 700;
    font-size: clamp(1.75rem, 3.2vw, 2.75rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
    margin: 0 0 1rem;
    text-wrap: balance;
}

.cx-lead {
    font-size: clamp(1.02rem, 1.25vw, 1.15rem);
    line-height: 1.65;
    color: var(--cx-body);
    max-width: 62ch;
    margin: 0;
}

/* Section label: the wordmark's slash, then a plain sentence-case label. */
.cx-label {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cx-muted);
    margin-bottom: 1rem;
}

.cx-label::before {
    content: "/";
    color: var(--cx-brand-text);
    font-weight: 800;
    font-size: 1.15em;
    transform: skewX(-6deg);
}

.cx-head {
    max-width: 46rem;
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

/* ── Buttons & links ────────────────────────────────────────────────── */

.cx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 3rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--cx-radius-sm);
    border: 1px solid var(--cx-brand-solid);
    background: var(--cx-brand-solid);
    color: #fff;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.cx-btn:hover,
.cx-btn:focus-visible {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -10px var(--cx-brand);
}

.cx-btn--quiet {
    background: transparent;
    border-color: var(--cx-line);
    color: var(--cx-ink);
}

.cx-btn--quiet:hover,
.cx-btn--quiet:focus-visible {
    color: var(--cx-ink);
    border-color: var(--cx-ink);
    box-shadow: none;
}

.cx-btn--inverse {
    background: #fff;
    border-color: #fff;
    color: #0b1324;
}

.cx-btn--inverse:hover,
.cx-btn--inverse:focus-visible {
    color: #0b1324;
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5);
}

.cx-section a:focus-visible,
.cx-hero a:focus-visible,
.cx-btn:focus-visible,
.cx-section button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--cx-brand) 55%, transparent);
    outline-offset: 3px;
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.cx-hero {
    position: relative;
    background: var(--cx-bg);
    color: var(--cx-body);
    padding-block: clamp(7.5rem, 13vw, 11rem) clamp(3.5rem, 7vw, 6rem);
    overflow: hidden;
    isolation: isolate;
}

/* Faint drafting grid, fading out towards the copy. */
.cx-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--cx-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--cx-line) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 0%, transparent 70%);
    opacity: 0.9;
}

[dir="rtl"] .cx-hero::before {
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at 15% 20%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse 70% 80% at 15% 20%, #000 0%, transparent 70%);
}

.cx-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

.cx-hero__title {
    color: var(--cx-ink);
    font-weight: 700;
    font-size: clamp(2.4rem, 5.6vw, 4.6rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin: 0 0 1.25rem;
    text-wrap: balance;
}

[dir="rtl"] .cx-hero__title,
[dir="rtl"] .cx-title {
    letter-spacing: 0;
    line-height: 1.3;
}

.cx-hero__sub {
    color: var(--cx-ink);
    font-weight: 600;
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    margin: 0 0 0.75rem;
}

.cx-hero__lead {
    font-size: clamp(1.05rem, 1.3vw, 1.2rem);
    line-height: 1.65;
    max-width: 56ch;
    margin: 0 0 2rem;
}

.cx-hero__lead a {
    color: var(--cx-brand-text);
}

.cx-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* The stack: plain words separated by the brand slash. */
.cx-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0;
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0;
    font-size: 0.95rem;
    color: var(--cx-muted);
}

.cx-stack li + li::before {
    content: "/";
    color: var(--cx-brand-text);
    font-weight: 700;
    margin-inline: 0.75rem;
}

.cx-hero__image {
    width: 100%;
    height: auto;
    border-radius: var(--cx-radius);
    border: 1px solid var(--cx-line);
    box-shadow: var(--cx-shadow);
}

/* Release log — the one loud element. Dark in both colour modes. */
.cx-log {
    direction: ltr;
    text-align: left;
    background: var(--cx-night);
    color: var(--cx-night-ink);
    border: 1px solid var(--cx-night-line);
    border-radius: var(--cx-radius);
    box-shadow: 0 30px 60px -30px rgba(7, 11, 22, 0.55);
    font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    overflow: hidden;
}

.cx-log__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--cx-night-line);
    color: var(--cx-night-muted);
}

.cx-log__bar strong {
    color: var(--cx-night-ink);
    font-weight: 600;
}

.cx-log__bar i {
    color: color-mix(in srgb, var(--cx-brand) 62%, #ffffff);
    font-style: normal;
    font-weight: 700;
}

.cx-log__status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.cx-log__status::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.cx-log__rows {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.cx-log__row {
    display: grid;
    grid-template-columns: 4.6rem minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: baseline;
    padding: 0.55rem 1.1rem;
}

.cx-log__row + .cx-log__row {
    border-top: 1px dashed var(--cx-night-line);
}

.cx-log__tag {
    color: color-mix(in srgb, var(--cx-brand) 62%, #ffffff);
    font-weight: 600;
}

.cx-log__msg {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cx-log__msg span {
    color: var(--cx-night-muted);
}

.cx-log__state {
    color: #34d399;
    white-space: nowrap;
}

.cx-log__state--run {
    color: #fbbf24;
}

.cx-log__foot {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: end;
    padding: 0.9rem 1.1rem 1.1rem;
    border-top: 1px solid var(--cx-night-line);
    color: var(--cx-night-muted);
}

.cx-log__bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 2.4rem;
}

.cx-log__bars span {
    flex: 1;
    min-width: 2px;
    border-radius: 2px 2px 0 0;
    background: color-mix(in srgb, var(--cx-brand) 70%, #ffffff);
    opacity: 0.85;
}

/* One orchestrated moment: the log writes itself once on load. */
@media (prefers-reduced-motion: no-preference) {
    /* "backwards": hidden only while waiting for its turn — if animations
       never run, every row is simply visible. */
    .cx-log__row {
        animation: cx-log-in 0.5s ease backwards;
    }

    .cx-log__row:nth-child(1) { animation-delay: 0.25s; }
    .cx-log__row:nth-child(2) { animation-delay: 0.55s; }
    .cx-log__row:nth-child(3) { animation-delay: 0.85s; }
    .cx-log__row:nth-child(4) { animation-delay: 1.15s; }
    .cx-log__row:nth-child(5) { animation-delay: 1.45s; }

    .cx-log__bars span {
        transform-origin: bottom;
        animation: cx-bar-in 0.6s ease 1.5s backwards;
    }
}

@keyframes cx-log-in {
    from { opacity: 0; transform: translateY(6px); }
}

@keyframes cx-bar-in {
    from { transform: scaleY(0); }
}

/* ── Services: an index, not a wall of cards ────────────────────────── */

.cx-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
    border-top: 1px solid var(--cx-line);
    border-inline-start: 1px solid var(--cx-line);
    list-style: none;
    padding: 0;
    margin: 0;
}

.cx-service {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: clamp(1.5rem, 2.4vw, 2.25rem);
    border-bottom: 1px solid var(--cx-line);
    border-inline-end: 1px solid var(--cx-line);
    background: var(--cx-surface);
    transition: background-color 0.2s ease;
}

.cx-service:hover {
    background: color-mix(in srgb, var(--cx-brand) 5%, var(--cx-surface));
}

.cx-service__glyph {
    width: 3.25rem;
    height: 3.25rem;
    color: var(--cx-brand-text);
}

.cx-service__glyph svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cx-service__image {
    width: 100%;
    height: auto;
    border-radius: var(--cx-radius-sm);
    border: 1px solid var(--cx-line);
}

.cx-service__title {
    color: var(--cx-ink);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0;
}

.cx-service__text {
    margin: 0;
    line-height: 1.65;
}

/* ── Stats: one band of numbers ─────────────────────────────────────── */

.cx-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
}

.cx-stat {
    padding: 0.5rem clamp(1rem, 2vw, 2rem);
    border-inline-start: 1px solid var(--cx-line);
}

.cx-stat__value {
    display: block;
    color: var(--cx-ink);
    font-size: clamp(2.4rem, 4.6vw, 3.75rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.cx-stat__value small {
    font-size: 0.55em;
    color: var(--cx-brand-text);
    font-weight: 700;
    margin-inline-start: 0.1em;
}

.cx-stat__label {
    display: block;
    margin-top: 0.6rem;
    color: var(--cx-muted);
    max-width: 22ch;
}

/* ── Why: statement left, proof points right ────────────────────────── */

.cx-split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 6vw, 5.5rem);
    align-items: start;
}

.cx-split__aside {
    position: sticky;
    top: 7rem;
}

.cx-points {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--cx-line);
}

.cx-point {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    gap: 1rem;
    padding-block: 1.35rem;
    border-bottom: 1px solid var(--cx-line);
    color: var(--cx-ink);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.5;
}

.cx-point i {
    color: var(--cx-ok);
    font-size: 1.4rem;
    margin-top: 0.1rem;
}

.cx-why__image {
    width: 100%;
    height: auto;
    border-radius: var(--cx-radius);
    border: 1px solid var(--cx-line);
    margin-top: 2rem;
}

/* ── People / process ───────────────────────────────────────────────── */

.cx-people {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 2rem clamp(1.5rem, 3vw, 3rem);
    list-style: none;
    padding: 0;
    margin: 0;
}

.cx-person {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.cx-person__photo {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    overflow: hidden;
    background: color-mix(in srgb, var(--cx-brand) 10%, var(--cx-surface));
    border: 1px solid var(--cx-line);
    display: grid;
    place-items: center;
    color: var(--cx-brand-text);
    font-size: 1.75rem;
}

.cx-person__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cx-person__name {
    color: var(--cx-ink);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.cx-person__role {
    color: var(--cx-muted);
    margin: 0.15rem 0 0;
}

/* The process really is a sequence, so it is numbered. */
.cx-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 2.5rem clamp(1.5rem, 3vw, 3rem);
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: cx-step;
}

.cx-step {
    counter-increment: cx-step;
    border-top: 2px solid var(--cx-ink);
    padding-top: 1.25rem;
}

.cx-step::before {
    content: counter(cx-step, decimal-leading-zero);
    display: block;
    color: var(--cx-brand-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.75rem;
}

.cx-step__title {
    color: var(--cx-ink);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.cx-step__text {
    margin: 0;
    line-height: 1.6;
}

/* ── Reviews ────────────────────────────────────────────────────────── */

.cx-reviews__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.cx-reviews__head .cx-head {
    margin-bottom: 0;
}

.cx-reviews__nav {
    display: flex;
    gap: 0.5rem;
}

.cx-round {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1px solid var(--cx-line);
    background: var(--cx-surface);
    color: var(--cx-ink);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cx-round:hover {
    border-color: var(--cx-ink);
}

.cx-quote {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: clamp(1.5rem, 2.4vw, 2.25rem);
    background: var(--cx-surface);
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius);
    margin: 0;
}

.cx-quote__text {
    flex: 1;
    color: var(--cx-ink);
    font-size: 1.12rem;
    line-height: 1.6;
    margin: 0;
}

.cx-quote__rating {
    color: #f5a524;
    letter-spacing: 0.1em;
    font-size: 0.95rem;
}

.cx-quote__by {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cx-line);
}

.cx-quote__by img,
.cx-quote__avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}

.cx-quote__avatar {
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--cx-brand) 10%, var(--cx-surface));
    color: var(--cx-brand-text);
}

.cx-quote__name {
    display: block;
    color: var(--cx-ink);
    font-weight: 700;
    font-style: normal;
}

.cx-quote__role {
    display: block;
    color: var(--cx-muted);
    font-size: 0.92rem;
}

/* ── FAQ ────────────────────────────────────────────────────────────── */

.cx-faq {
    border-top: 1px solid var(--cx-line);
}

.cx-faq__item {
    border-bottom: 1px solid var(--cx-line);
}

.cx-faq__q {
    margin: 0;
}

.cx-faq__q .accordion-button {
    background: transparent;
    box-shadow: none;
    color: var(--cx-ink);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    padding: 1.35rem 0;
    gap: 1rem;
    text-align: start;
}

.cx-faq__q .accordion-button:not(.collapsed) {
    color: var(--cx-brand-text);
    background: transparent;
}

.cx-faq__a {
    padding: 0 0 1.5rem;
    max-width: 68ch;
    line-height: 1.7;
    color: var(--cx-body);
}

/* ── Call to action: the one full-colour band ───────────────────────── */

.cx-cta {
    background: var(--cx-brand-solid);
    color: #fff;
    padding-block: clamp(3.5rem, 7vw, 6rem);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* The wordmark's slash, oversized. */
.cx-cta::after {
    content: "/";
    position: absolute;
    z-index: -1;
    inset-inline-end: 4%;
    top: 50%;
    transform: translateY(-50%) skewX(-6deg);
    font-size: clamp(14rem, 34vw, 30rem);
    font-weight: 800;
    line-height: 0.7;
    color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.cx-cta__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cx-cta__title {
    color: #fff;
    font-size: clamp(1.9rem, 3.8vw, 3.1rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 0 0 0.75rem;
    max-width: 20ch;
    text-wrap: balance;
}

[dir="rtl"] .cx-cta__title {
    letter-spacing: 0;
    line-height: 1.35;
}

.cx-cta__text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 52ch;
    margin: 0;
}

.cx-cta__label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 0.85rem;
}

/* ── Contact ────────────────────────────────────────────────────────── */

.cx-contact {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
}

.cx-channels {
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0;
    border-top: 1px solid var(--cx-line);
}

.cx-channel {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    padding-block: 1.15rem;
    border-bottom: 1px solid var(--cx-line);
}

.cx-channel > i {
    color: var(--cx-brand-text);
    font-size: 1.35rem;
    margin-top: 0.15rem;
}

.cx-channel__label {
    display: block;
    color: var(--cx-muted);
    font-size: 0.92rem;
}

.cx-channel__value {
    color: var(--cx-ink);
    font-size: 1.08rem;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

a.cx-channel__value:hover {
    color: var(--cx-brand-text);
    text-decoration: underline;
}

.cx-form {
    background: var(--cx-surface);
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius);
    box-shadow: var(--cx-shadow);
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

.cx-form__title {
    color: var(--cx-ink);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
}

.cx-form__note {
    color: var(--cx-muted);
    margin: 0 0 1.5rem;
}

.cx-form .form-label {
    color: var(--cx-ink);
    font-weight: 600;
}

.cx-form .form-control {
    background: var(--cx-bg);
    border-color: var(--cx-line);
    color: var(--cx-ink);
    min-height: 3rem;
    border-radius: var(--cx-radius-sm);
}

.cx-form .form-control::placeholder {
    color: var(--cx-muted);
    opacity: 0.8;
}

.cx-form .form-control:focus {
    border-color: var(--cx-brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-brand) 22%, transparent);
}

.cx-form__legal {
    color: var(--cx-muted);
    font-size: 0.92rem;
    margin: 1rem 0 0;
}

/* ── Shared codliy-* classes (blog, portfolio, CMS pages) ───────────── */

:root[data-bs-theme] .codliy-section,
:root[data-bs-theme] .codliy-section.bg-codliy {
    background: var(--cx-bg) !important;
    color: var(--cx-body) !important;
}

:root[data-bs-theme] .codliy-hero {
    background: var(--cx-surface) !important;
    color: var(--cx-body) !important;
    border-bottom: 1px solid var(--cx-line);
    padding-top: clamp(7.5rem, 12vw, 10rem);
}

:root[data-bs-theme] .codliy-hero::before {
    display: none;
}

:root[data-bs-theme] .codliy-hero h1,
:root[data-bs-theme] .codliy-hero .codliy-hero__title,
:root[data-bs-theme] .codliy-section .codliy-section__title {
    color: var(--cx-ink) !important;
    letter-spacing: -0.03em;
}

[dir="rtl"]:root[data-bs-theme] .codliy-hero .codliy-hero__title,
[dir="rtl"]:root[data-bs-theme] .codliy-section .codliy-section__title {
    letter-spacing: 0;
}

:root[data-bs-theme] .codliy-hero .codliy-hero__sub,
:root[data-bs-theme] .codliy-section .codliy-section__sub {
    color: var(--cx-body) !important;
}

:root[data-bs-theme] .codliy-hero .codliy-hero__kicker,
:root[data-bs-theme] .codliy-section .codliy-section__kicker,
:root[data-bs-theme] .codliy-card .codliy-card__eyebrow {
    color: var(--cx-muted) !important;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

:root[data-bs-theme] .codliy-card {
    background: var(--cx-surface) !important;
    border: 1px solid var(--cx-line) !important;
    border-radius: var(--cx-radius);
    color: var(--cx-body) !important;
    box-shadow: none;
}

:root[data-bs-theme] .codliy-card .codliy-card__title {
    color: var(--cx-ink) !important;
}

:root[data-bs-theme] .codliy-card .codliy-card__body {
    color: var(--cx-body) !important;
}

:root[data-bs-theme] .text-codliy-soft {
    color: var(--cx-ink) !important;
}

:root[data-bs-theme] .text-codliy-mute {
    color: var(--cx-muted) !important;
}

:root[data-bs-theme] .text-codliy-primary {
    color: var(--cx-brand-text) !important;
}

:root[data-bs-theme] .border-codliy {
    border-color: var(--cx-line) !important;
}

:root[data-bs-theme] .btn-codliy {
    border-radius: var(--cx-radius-sm);
    font-weight: 600;
}

:root[data-bs-theme] .btn-codliy-outline {
    border-radius: var(--cx-radius-sm);
    border-color: var(--cx-line);
    color: var(--cx-ink);
}

:root[data-bs-theme] .codliy-article,
:root[data-bs-theme] .codliy-article p,
:root[data-bs-theme] .codliy-article ul,
:root[data-bs-theme] .codliy-article ol {
    color: var(--cx-body);
}

:root[data-bs-theme] .codliy-article h1,
:root[data-bs-theme] .codliy-article h2,
:root[data-bs-theme] .codliy-article h3,
:root[data-bs-theme] .codliy-article h4 {
    color: var(--cx-ink);
}

/* ── Footer ─────────────────────────────────────────────────────────── */

:root[data-bs-theme] .landing-footer {
    background: var(--cx-surface) !important;
    border-top: 1px solid var(--cx-line);
    color: var(--cx-body) !important;
}

:root[data-bs-theme] .landing-footer .footer-top {
    background: transparent;
    border-radius: 0;
    padding-block: clamp(3rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem);
}

/* The old decorative background picture is retired with this design. */
.landing-footer .footer-bg {
    display: none;
}

:root[data-bs-theme] .landing-footer .footer-text,
:root[data-bs-theme] .landing-footer .footer-logo-description,
:root[data-bs-theme] .landing-footer .footer-form label {
    color: var(--cx-body) !important;
    opacity: 1;
}

:root[data-bs-theme] .landing-footer .footer-title {
    color: var(--cx-ink) !important;
    font-size: 1rem;
    font-weight: 700;
    opacity: 1;
}

:root[data-bs-theme] .landing-footer .footer-link {
    color: var(--cx-body) !important;
    opacity: 1;
    text-decoration: none;
}

:root[data-bs-theme] .landing-footer .footer-link:hover {
    color: var(--cx-brand-text) !important;
    text-decoration: underline;
}

:root[data-bs-theme] .landing-footer .footer-form .form-control {
    background: var(--cx-bg);
    border-color: var(--cx-line);
    color: var(--cx-ink);
}

:root[data-bs-theme] .landing-footer .footer-bottom {
    background: var(--cx-night);
}

:root[data-bs-theme] .landing-footer .footer-form .form-control::placeholder {
    color: var(--cx-muted);
    opacity: 1;
}

/* The bottom bar is dark in both colour modes, so everything on it stays light. */
:root[data-bs-theme] .landing-footer .footer-bottom,
:root[data-bs-theme] .landing-footer .footer-bottom .footer-bottom-text,
:root[data-bs-theme] .landing-footer .footer-bottom a,
:root[data-bs-theme] .landing-footer .footer-bottom a.text-white {
    color: #d3d8e6 !important;
}

:root[data-bs-theme] .landing-footer .footer-bottom a:hover {
    color: #ffffff !important;
}

/* ── Inner pages: journal & portfolio ───────────────────────────────── */

/* Arabic and Turkish headings need more room than the tight Latin setting. */
[dir="rtl"] .cx-title,
[dir="rtl"] .cx-project-hero__title,
[dir="rtl"]:root[data-bs-theme] .codliy-hero .codliy-hero__title {
    line-height: 1.35;
    letter-spacing: 0;
}

:root[data-bs-theme] .codliy-hero .codliy-hero__title {
    font-size: clamp(2rem, 4.4vw, 3.5rem);
    line-height: 1.1;
    text-wrap: balance;
}

:root[data-bs-theme] .codliy-hero .breadcrumb-item,
:root[data-bs-theme] .codliy-hero .breadcrumb-item::before {
    color: var(--cx-muted);
}

/* Search field in the page header. */
:root[data-bs-theme] .codliy-hero .input-group.codliy-card {
    border-radius: var(--cx-radius-sm);
    background: var(--cx-bg) !important;
}

:root[data-bs-theme] .codliy-hero .input-group .form-control {
    color: var(--cx-ink) !important;
    box-shadow: none;
}

:root[data-bs-theme] .codliy-hero .input-group .form-control::placeholder {
    color: var(--cx-muted);
}

:root[data-bs-theme] .btn-codliy,
:root[data-bs-theme] .btn-codliy:hover {
    background: var(--cx-brand-solid);
    border-color: var(--cx-brand-solid);
    color: #fff;
}

:root[data-bs-theme] .btn-codliy-outline:hover {
    border-color: var(--cx-ink);
    background: transparent;
    color: var(--cx-ink);
}

:root[data-bs-theme] .bg-codliy-soft {
    background: var(--cx-surface) !important;
    border-top: 1px solid var(--cx-line);
}

/* Cover: the image when there is one, the wordmark's slash when there is not
   (or when the file fails to load). */
.cx-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background:
        linear-gradient(112deg, transparent calc(50% - 5px), color-mix(in srgb, var(--cx-brand) 55%, var(--cx-surface)) calc(50% - 5px), color-mix(in srgb, var(--cx-brand) 55%, var(--cx-surface)) calc(50% + 5px), transparent calc(50% + 5px)) center / 100% 46% no-repeat,
        color-mix(in srgb, var(--cx-brand) 7%, var(--cx-bg));
    border-bottom: 1px solid var(--cx-line);
}

.cx-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.cx-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--cx-surface);
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cx-card:hover,
.cx-card:focus-within {
    border-color: color-mix(in srgb, var(--cx-brand) 45%, var(--cx-line));
    box-shadow: var(--cx-shadow);
}

@media (prefers-reduced-motion: no-preference) {
    .cx-card:hover .cx-cover img {
        transform: scale(1.03);
    }
}

.cx-card__flag {
    position: absolute;
    inset-block-start: 0.85rem;
    inset-inline-start: 0.85rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--cx-brand-solid);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}

.cx-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.35rem 1.4rem 1.4rem;
}

.cx-card__meta {
    color: var(--cx-brand-text);
    font-size: 0.88rem;
    font-weight: 600;
}

.cx-card__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    text-wrap: balance;
}

[dir="rtl"] .cx-card__title {
    line-height: 1.6;
}

.cx-card__title a {
    color: var(--cx-ink);
    text-decoration: none;
}

.cx-card__title a:hover {
    color: var(--cx-brand-text);
}

.cx-card__text {
    margin: 0;
    color: var(--cx-body);
    font-size: 0.97rem;
    line-height: 1.65;
}

.cx-card__foot {
    margin-top: auto;
    padding-top: 0.9rem;
}

.cx-card__stats {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--cx-line);
    color: var(--cx-muted);
    font-size: 0.88rem;
}

.cx-card__stats span,
.cx-side__posts small {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.cx-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.cx-tags > li {
    display: inline-flex;
}

.cx-tags > li:not(:has(a)),
.cx-tags a {
    padding: 0.28rem 0.65rem;
    border: 1px solid var(--cx-line);
    border-radius: 999px;
    color: var(--cx-body);
    font-size: 0.85rem;
    line-height: 1.4;
    text-decoration: none;
}

.cx-tags a:hover,
.cx-tags a.is-active {
    border-color: var(--cx-brand-text);
    color: var(--cx-brand-text);
}

/* Sidebar: hairline-separated lists rather than boxed widgets. */
.cx-side {
    padding-block: 1.5rem;
    border-top: 1px solid var(--cx-line);
}

.cx-side:first-child {
    padding-top: 0;
    border-top: 0;
}

.cx-side__title {
    color: var(--cx-ink);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.cx-side__list,
.cx-side__posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cx-side__list a {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.45rem;
    color: var(--cx-body);
    text-decoration: none;
}

.cx-side__list a:hover,
.cx-side__list a.is-active {
    color: var(--cx-brand-text);
}

.cx-side__count {
    color: var(--cx-muted);
    font-variant-numeric: tabular-nums;
}

/* Ranked by claps, so the order is real and gets a number. */
.cx-side__posts {
    counter-reset: cx-rank;
}

.cx-side__posts li {
    counter-increment: cx-rank;
    display: grid;
    grid-template-columns: 1.6rem minmax(0, 1fr);
    column-gap: 0.75rem;
    padding-block: 0.7rem;
}

.cx-side__posts li + li {
    border-top: 1px solid var(--cx-line);
}

.cx-side__posts li::before {
    content: counter(cx-rank);
    grid-row: span 2;
    color: var(--cx-brand-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cx-side__posts a {
    color: var(--cx-ink);
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}

.cx-side__posts a:hover {
    color: var(--cx-brand-text);
}

.cx-side__posts small {
    color: var(--cx-muted);
}

@media (min-width: 992px) {
    .cx-side-wrap {
        position: sticky;
        top: 7rem;
    }
}

/* Filter chips on the portfolio index. */
.cx-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.cx-filter a {
    padding: 0.5rem 1rem;
    border: 1px solid var(--cx-line);
    border-radius: 999px;
    background: var(--cx-surface);
    color: var(--cx-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}

.cx-filter a:hover {
    border-color: var(--cx-ink);
    color: var(--cx-ink);
}

.cx-filter a.is-active {
    background: var(--cx-ink);
    border-color: var(--cx-ink);
    color: var(--cx-bg);
}

.cx-filter-note {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    color: var(--cx-body);
    margin: 0 0 1.75rem;
}

.cx-filter-note strong {
    color: var(--cx-ink);
}

.cx-filter-note span {
    color: var(--cx-muted);
}

.cx-filter-note a {
    color: var(--cx-brand-text);
}

.cx-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    color: var(--cx-muted);
    font-size: 0.95rem;
}

.cx-post-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.cx-cover--article {
    aspect-ratio: 16 / 9;
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius);
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.cx-empty {
    padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
    border: 1px dashed var(--cx-line);
    border-radius: var(--cx-radius);
    text-align: center;
}

.cx-empty h2,
.cx-empty h3 {
    color: var(--cx-ink);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.cx-empty p {
    margin: 0 auto 1.5rem;
    max-width: 44ch;
}

.cx-empty p:last-child {
    margin-bottom: 0;
}

/* Article body (journal posts, project descriptions, CMS pages). */
:root[data-bs-theme] .codliy-article {
    font-size: 1.08rem;
    line-height: 1.85;
    max-width: 72ch;
}

[dir="rtl"]:root[data-bs-theme] .codliy-article {
    line-height: 2;
}

:root[data-bs-theme] .codliy-article h2 {
    font-size: 1.55rem;
    margin-top: 2.25rem;
}

:root[data-bs-theme] .codliy-article h3 {
    font-size: 1.25rem;
    margin-top: 1.9rem;
}

:root[data-bs-theme] .codliy-article a {
    color: var(--cx-brand-text);
    border-bottom-color: color-mix(in srgb, var(--cx-brand-text) 40%, transparent);
}

:root[data-bs-theme] .codliy-article code {
    background: color-mix(in srgb, var(--cx-brand) 12%, var(--cx-surface));
    color: var(--cx-ink);
    direction: ltr;
    unicode-bidi: isolate;
}

:root[data-bs-theme] .codliy-article pre {
    background: var(--cx-night);
    border-color: var(--cx-night-line);
    color: var(--cx-night-ink);
    direction: ltr;
    text-align: left;
}

:root[data-bs-theme] .codliy-article pre code {
    background: transparent;
    color: inherit;
}

:root[data-bs-theme] .codliy-article blockquote {
    background: transparent;
    border-color: var(--cx-brand-text);
    color: var(--cx-ink);
    font-style: normal;
}

:root[data-bs-theme] .post-tags-row__label,
:root[data-bs-theme] .share-label {
    color: var(--cx-muted);
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.92rem;
}

:root[data-bs-theme] .post-tag {
    background: transparent;
    border-color: var(--cx-line);
    color: var(--cx-body);
}

:root[data-bs-theme] .post-tag:hover {
    background: transparent;
    border-color: var(--cx-brand-text);
    color: var(--cx-brand-text);
    box-shadow: none;
    transform: none;
}

:root[data-bs-theme] .post-action-bar {
    background: var(--cx-surface);
    border-color: var(--cx-line);
    border-radius: var(--cx-radius);
}

:root[data-bs-theme] .post-action-bar__divider {
    background: var(--cx-line);
}

:root[data-bs-theme] .clap-button {
    background: var(--cx-brand-solid);
    border-radius: var(--cx-radius-sm);
    box-shadow: none;
}

:root[data-bs-theme] .share-btn {
    background: transparent;
    border-color: var(--cx-line);
    border-radius: 50%;
    color: var(--cx-ink);
}

/* Project page. */
.cx-project-hero {
    background: var(--cx-surface);
    border-bottom: 1px solid var(--cx-line);
    padding-block: clamp(7.5rem, 12vw, 10rem) clamp(2.5rem, 5vw, 4rem);
    color: var(--cx-body);
}

.cx-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    color: var(--cx-muted);
    font-size: 0.92rem;
}

.cx-crumbs a {
    color: var(--cx-muted);
    text-decoration: none;
}

.cx-crumbs a:hover {
    color: var(--cx-ink);
}

.cx-project-hero__title {
    color: var(--cx-ink);
    font-weight: 700;
    font-size: clamp(2rem, 4.6vw, 3.75rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    max-width: 22ch;
    margin: 0 0 1.25rem;
    text-wrap: balance;
}

.cx-project-hero__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem 2.5rem;
    margin-top: clamp(2rem, 4vw, 3rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--cx-line);
}

.cx-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem clamp(1.75rem, 4vw, 3.5rem);
    margin: 0;
}

.cx-fact dt {
    color: var(--cx-muted);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.cx-fact dd {
    color: var(--cx-ink);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.cx-project {
    padding-top: clamp(2rem, 4vw, 3.5rem);
}

.cx-gallery {
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.gallery-main-swiper {
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius);
    background: var(--cx-surface);
    overflow: hidden;
}

.gallery-main-swiper .swiper-slide {
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(112deg, transparent calc(50% - 7px), color-mix(in srgb, var(--cx-brand) 55%, var(--cx-surface)) calc(50% - 7px), color-mix(in srgb, var(--cx-brand) 55%, var(--cx-surface)) calc(50% + 7px), transparent calc(50% + 7px)) center / 100% 40% no-repeat,
        color-mix(in srgb, var(--cx-brand) 7%, var(--cx-bg));
}

.gallery-main-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.gallery-main-swiper .swiper-button-next,
.gallery-main-swiper .swiper-button-prev {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--cx-surface);
    border: 1px solid var(--cx-line);
    color: var(--cx-ink);
}

.gallery-main-swiper .swiper-button-next::after,
.gallery-main-swiper .swiper-button-prev::after {
    font-size: 1rem;
    font-weight: 700;
}

.gallery-thumbs-swiper {
    margin-top: 0.75rem;
}

.gallery-thumbs-swiper .swiper-slide {
    aspect-ratio: 16 / 10;
    border-radius: var(--cx-radius-sm);
    border: 1px solid var(--cx-line);
    background: color-mix(in srgb, var(--cx-brand) 7%, var(--cx-bg));
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.gallery-thumbs-swiper .swiper-slide:hover,
.gallery-thumbs-swiper .swiper-slide-thumb-active {
    opacity: 1;
}

.gallery-thumbs-swiper .swiper-slide-thumb-active {
    border-color: var(--cx-brand-text);
}

.gallery-thumbs-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cx-gallery__hint {
    color: var(--cx-muted);
    font-size: 0.9rem;
    margin: 0.85rem 0 0;
}

.cx-project__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}

.cx-project__block + .cx-project__block,
.cx-project__quote {
    margin-top: clamp(2.25rem, 4vw, 3.25rem);
}

.cx-project__heading {
    color: var(--cx-ink);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 1.1rem;
}

.cx-points--two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    column-gap: 2rem;
    border-top: 0;
}

.cx-points--two .cx-point {
    font-size: 1rem;
    padding-block: 1rem;
    border-top: 1px solid var(--cx-line);
    border-bottom: 0;
}

.cx-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 2rem clamp(1.5rem, 3vw, 3rem);
}

.cx-pair__item {
    border-top: 2px solid var(--cx-ink);
    padding-top: 1.25rem;
}

.cx-pair__item p {
    margin: 0;
    line-height: 1.75;
}

.cx-project__aside {
    position: sticky;
    top: 7rem;
}

.cx-project__panel {
    padding-block: 1.5rem;
    border-top: 1px solid var(--cx-line);
}

.cx-project__panel:first-child {
    padding-top: 0;
    border-top: 0;
}

.cx-project__panel-title {
    color: var(--cx-ink);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.cx-project__panel--cta {
    padding: 1.5rem;
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius);
    background: var(--cx-surface);
}

.cx-project__panel--cta p {
    margin: 0 0 1.25rem;
}

.cx-share {
    display: flex;
    gap: 0.5rem;
}

.cx-share .cx-round {
    text-decoration: none;
}

.btn-copy-link.copied {
    border-color: var(--cx-ok);
    color: var(--cx-ok);
}

.copy-toast {
    position: fixed;
    inset-block-end: 1.75rem;
    inset-inline: 0;
    margin-inline: auto;
    width: max-content;
    max-width: calc(100vw - 2rem);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.25rem;
    border-radius: var(--cx-radius-sm);
    background: var(--cx-night);
    border: 1px solid var(--cx-night-line);
    color: var(--cx-night-ink);
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.75rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(4, 7, 14, 0.94);
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.3rem;
    display: grid;
    place-items: center;
    z-index: 10001;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-close {
    top: 1.25rem;
    right: 1.25rem;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: 1.25rem;
}

.lightbox-next {
    right: 1.25rem;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--cx-radius-sm);
}

.lightbox-caption,
.lightbox-counter {
    position: absolute;
    inset-inline: 0;
    text-align: center;
    color: #fff;
}

.lightbox-caption {
    bottom: 3.5rem;
    padding-inline: 1rem;
}

.lightbox-counter {
    bottom: 1.25rem;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 991.98px) {
    .cx-project__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cx-project__aside {
        position: static;
    }
}

/* ── Small screens ──────────────────────────────────────────────────── */

@media (max-width: 991.98px) {
    .cx-hero__grid,
    .cx-split,
    .cx-contact {
        grid-template-columns: minmax(0, 1fr);
    }

    .cx-split__aside {
        position: static;
    }

    .cx-log {
        font-size: 0.76rem;
    }
}

@media (max-width: 575.98px) {
    .cx-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 2rem;
    }

    .cx-log__row {
        grid-template-columns: 3.6rem minmax(0, 1fr);
    }

    .cx-log__state {
        display: none;
    }

    .cx-hero__actions .cx-btn {
        flex: 1 1 100%;
    }

    .cx-cta__inner .cx-btn {
        width: 100%;
    }
}

/* ── Navigation bar ─────────────────────────────────────────────────── */

/* A flat bar with a hairline instead of the floating glass pill. */
nav.layout-navbar {
    background: transparent;
    will-change: auto;
    border-bottom: 1px solid var(--cx-line);
}

/* The blur lives on the pseudo-element: a backdrop-filter on the bar itself
   would trap the fixed mobile drawer inside it. */
nav.layout-navbar::before,
nav.layout-navbar.navbar-active::before {
    display: block;
    z-index: -1;
    background: color-mix(in srgb, var(--cx-surface) 92%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
}

:root[data-bs-theme] nav.layout-navbar .navbar.landing-navbar {
    transform: none;
}

:root[data-bs-theme] nav.layout-navbar .navbar.landing-navbar {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    margin-block-start: 0;
    padding-block: 0.8rem;
    padding-inline: 0 !important;
}

:root[data-bs-theme] nav.layout-navbar .landing-topbar {
    border-bottom: 1px solid var(--cx-line);
    color: var(--cx-muted) !important;
}

:root[data-bs-theme] nav.layout-navbar .menu-text,
:root[data-bs-theme] nav.layout-navbar .navbar-nav .nav-link .icon-base,
:root[data-bs-theme] nav.layout-navbar .navbar-toggler .icon-base {
    color: var(--cx-ink) !important;
}

:root[data-bs-theme] nav.layout-navbar .navbar.landing-navbar .landing-nav-menu .nav-link {
    position: relative;
    color: var(--cx-body);
    font-weight: 500;
    padding-inline: 0.75rem;
    margin-inline-end: 0.15rem;
    border-radius: var(--cx-radius-sm);
    transition: color 0.15s ease;
}

:root[data-bs-theme] nav.layout-navbar .navbar.landing-navbar .landing-nav-menu .nav-link:hover,
:root[data-bs-theme] nav.layout-navbar .navbar.landing-navbar .landing-nav-menu .nav-link:focus-visible,
:root[data-bs-theme] nav.layout-navbar .navbar.landing-navbar .landing-nav-menu .nav-link.active,
:root[data-bs-theme] nav.layout-navbar .navbar.landing-navbar .landing-nav-menu .nav-link[aria-current="page"] {
    color: var(--cx-ink) !important;
    background: transparent;
}

/* Current section: a short brand rule under the link. */
@media (min-width: 992px) {
    :root[data-bs-theme] nav.layout-navbar .landing-nav-menu .nav-link.active::after,
    :root[data-bs-theme] nav.layout-navbar .landing-nav-menu .nav-link[aria-current="page"]::after {
        content: "";
        position: absolute;
        inset-inline: 0.75rem;
        inset-block-end: 0.1rem;
        height: 2px;
        border-radius: 2px;
        background: var(--cx-brand-text);
    }
}

nav.layout-navbar a:focus-visible,
nav.layout-navbar button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--cx-brand) 55%, transparent);
    outline-offset: 2px;
}

.cx-nav__cta {
    min-height: 2.6rem;
    padding: 0.5rem 1.1rem;
    margin-inline-start: 0.5rem;
    white-space: nowrap;
}

:root[data-bs-theme] nav.layout-navbar .dropdown-menu {
    background: var(--cx-surface);
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius-sm);
    box-shadow: var(--cx-shadow);
    padding: 0.35rem;
}

:root[data-bs-theme] nav.layout-navbar .dropdown-item {
    border-radius: 6px;
    color: var(--cx-body);
}

:root[data-bs-theme] nav.layout-navbar .dropdown-item:hover,
:root[data-bs-theme] nav.layout-navbar .dropdown-item.active {
    background: color-mix(in srgb, var(--cx-brand) 10%, var(--cx-surface));
    color: var(--cx-ink);
}

/* Mobile drawer. */
@media (max-width: 991.98px) {
    :root[data-bs-theme] nav.layout-navbar .navbar.landing-navbar .landing-nav-menu {
        background: var(--cx-surface);
        border-inline-end: 1px solid var(--cx-line);
        padding: 4rem 1.25rem 1.5rem;
    }

    :root[data-bs-theme] nav.layout-navbar .navbar.landing-navbar .landing-nav-menu .nav-link {
        padding: 0.95rem 0;
        margin: 0;
        border-radius: 0;
        border-bottom: 1px solid var(--cx-line);
        color: var(--cx-ink);
        font-size: 1.1rem;
        font-weight: 600;
    }

    :root[data-bs-theme] nav.layout-navbar .landing-nav-menu .nav-link.active,
    :root[data-bs-theme] nav.layout-navbar .landing-nav-menu .nav-link[aria-current="page"] {
        color: var(--cx-brand-text) !important;
    }

    .cx-nav__cta {
        padding-inline: 0.7rem;
        margin-inline-start: 0.25rem;
    }
}

/* ── Newsletter field (footer) ──────────────────────────────────────── */

.cx-subscribe {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 26rem;
    margin-top: 0.6rem;
    padding: 0.3rem;
    background: var(--cx-bg);
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cx-subscribe:focus-within {
    border-color: var(--cx-brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-brand) 22%, transparent);
}

.cx-subscribe input {
    flex: 1;
    min-width: 0;
    min-height: 2.5rem;
    padding: 0 0.75rem;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--cx-ink);
    font: inherit;
}

.cx-subscribe input::placeholder {
    color: var(--cx-muted);
    opacity: 1;
}

.cx-subscribe button {
    flex: none;
    min-height: 2.5rem;
    padding: 0 1.1rem;
    border: 0;
    border-radius: 6px;
    background: var(--cx-brand-solid);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.cx-subscribe button:hover {
    background: color-mix(in srgb, var(--cx-brand-solid) 88%, #000);
}

/* ── Policies, forms and CMS pages ──────────────────────────────────── */

.cx-project-hero .cx-lead + .cx-lead {
    margin-top: 0.75rem;
}

.cx-legal__doc {
    scroll-margin-top: 7rem;
}

.cx-legal__doc + .cx-legal__doc {
    margin-top: clamp(3rem, 6vw, 4.5rem);
    padding-top: clamp(2.5rem, 5vw, 3.5rem);
    border-top: 1px solid var(--cx-line);
}

.cx-legal__doc > .cx-lead {
    margin-bottom: 1.5rem;
}

.cx-legal__clause {
    max-width: 68ch;
    padding-block: 1.5rem;
    border-top: 1px solid var(--cx-line);
}

.cx-legal__doc:first-child .cx-legal__clause:first-child {
    padding-top: 0;
    border-top: 0;
}

.cx-legal__clause h3 {
    color: var(--cx-ink);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 0.75rem;
}

.cx-legal__clause p,
.cx-legal__clause ul {
    margin: 0;
    font-size: 1.03rem;
    line-height: 1.8;
}

.cx-legal__clause ul {
    padding-inline-start: 1.2rem;
}

.cx-legal__clause li + li {
    margin-top: 0.35rem;
}

.cx-legal__clause li::marker {
    color: var(--cx-brand-text);
}

.cx-form--narrow {
    max-width: 46rem;
}

.cx-form .form-select {
    background-color: var(--cx-bg);
    border-color: var(--cx-line);
    color: var(--cx-ink);
    min-height: 3rem;
    border-radius: var(--cx-radius-sm);
}

.cx-form textarea.form-control {
    padding-block: 0.8rem;
}

.cx-form .form-check-label {
    color: var(--cx-body);
}

.cx-form__hint {
    display: block;
    margin-top: 0.35rem;
    color: var(--cx-muted);
    font-size: 0.88rem;
}

.cx-page__updated {
    margin: clamp(2rem, 4vw, 3rem) 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cx-line);
    color: var(--cx-muted);
    font-size: 0.92rem;
}
