/* STOS V1.50 - Text-local readability */

section.stos-samos-background {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 0 !important;
    box-shadow: none !important;
    background: #E5D6B8 !important;

    --samos-opacity: .54;
    --samos-edge-x: 8%;
    --samos-edge-y: 24px;
    --samos-halo: #E5D6B8;
}

/* Sharp, full-width ASCII artwork */

section.stos-samos-background::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;

    background: url('ascii/samos.svg')
        center 57% / cover no-repeat;

    opacity: var(--samos-opacity);

    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;

    -webkit-mask-image:
        linear-gradient(
            to right,
            transparent,
            black var(--samos-edge-x),
            black calc(100% - var(--samos-edge-x)),
            transparent
        ),
        linear-gradient(
            to bottom,
            transparent,
            black var(--samos-edge-y),
            black calc(100% - var(--samos-edge-y)),
            transparent
        );

    -webkit-mask-composite: source-in;

    mask-image:
        linear-gradient(
            to right,
            transparent,
            black var(--samos-edge-x),
            black calc(100% - var(--samos-edge-x)),
            transparent
        ),
        linear-gradient(
            to bottom,
            transparent,
            black var(--samos-edge-y),
            black calc(100% - var(--samos-edge-y)),
            transparent
        );

    mask-composite: intersect;
}

/* Remove all previous blur panels */

section.stos-samos-background::after,
section.stos-samos-background .section-heading::before,
section.stos-samos-background .section-heading::after,
section.stos-samos-background .section-heading > div::before,
section.stos-samos-background .section-heading > div::after,
section.stos-samos-background .text-link::before {
    content: none !important;
    display: none !important;
}

/* Preserve the original content layout */

section.stos-samos-background > .wrap {
    position: relative;
    z-index: 1;
}

section.stos-samos-background .section-heading,
section.stos-samos-background .section-heading > div {
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Soft beige halo around individual letters */

section.stos-samos-background .section-heading
:is(.eyebrow, .section-title, .section-desc, .text-link) {
    --halo-width: 6px;

    text-shadow:
        -6px -6px 2px var(--samos-halo),
         0   -6px 2px var(--samos-halo),
         6px -6px 2px var(--samos-halo),
        -6px  0   2px var(--samos-halo),
         6px  0   2px var(--samos-halo),
        -6px  6px 2px var(--samos-halo),
         0    6px 2px var(--samos-halo),
         6px  6px 2px var(--samos-halo),
         0    0   14px var(--samos-halo),
         0    0   22px var(--samos-halo);
}

/* Stronger protection for the subtitle */

section.stos-samos-background .section-heading .section-desc {
    --halo-width: 14px;
    color: #352D23;
}

section.stos-samos-background .section-heading .section-title {
    --halo-width: 14px;
}

section.stos-samos-background .section-heading .text-link {
    --halo-width: 12px;
}

/* Render the halo behind the letters */

@supports (paint-order: stroke fill) {
    section.stos-samos-background .section-heading
    :is(.eyebrow, .section-title, .section-desc, .text-link) {
        -webkit-text-stroke:
            var(--halo-width) var(--samos-halo);

        paint-order: stroke fill;
    }
}

/* Keep project cards clean and opaque */

section.stos-samos-background .card {
    background: #EDE2C9;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Mobile optimization */

@media (max-width: 670px) {
    section.stos-samos-background {
        --samos-opacity: .45;
        --samos-edge-y: 18px;
    }
}
