@layer layout {
    html {
        --scale: 1.6;

        /* generate the scale using pow() */
        --xxx-small: calc(1rem * pow(var(--scale), -2.5));
        --xx-small: calc(1rem * pow(var(--scale), -0.5));
        --x-small: calc(1rem * pow(var(--scale), -0.25));
        --small: calc(1rem * pow(var(--scale), -0.125));
        --medium: 1rem;
        --large: calc(1rem * pow(var(--scale), 1));
        --x-large: calc(1rem * pow(var(--scale), 2));
        --xx-large: calc(1rem * pow(var(--scale), 3));
        --xxx-large: calc(1rem * pow(var(--scale), 4));
    }

    body {
        min-height: 100svh;
        position: relative;
    }

    main {
        width: fit-content;
        margin-inline: auto;
        position: relative;
        z-index: 1;
    }

    header {
        text-align: center;
        margin-bottom: var(--small);
        display: grid;
        @media (width < 75em) {
            grid-template-columns: 1fr min-content 1fr;
            /* Same as `header > *`, every child in header */
            > * { grid-column: 1 / -1; }

        }
    }

    h1 {
        margin-bottom: 0;
        margin-top: -6rem;
        max-width: 95vw;
        @media (width < 75em) {
            grid-column: 2;
            /*width: min-content;*/
            margin-block:0;
        }
    }

    #copy {
        margin-bottom: 0;
        margin-top: -6rem;
        text-align: right;
        @media (width < 75em) {
            grid-column: 2;
            margin-top: 0;
        }
    }

    #tagline {
        margin-block: 0;
    }

    #about {
        display: grid;
    }

    #about p {
        width: min(70ch, 90svw);
        justify-self: center;
    }

    ol {
        contain: inline-size;
        display: grid;
        padding: 0;
        list-style: none;
        counter-reset: project;
    }

    li {
        width: min(100ch, 90svw);
        justify-self: center;
        counter-increment: project;
        padding-bottom: 1em;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "num heading"
            ".   url"
            ".   meta"
            ".   desc";
        @media (width >= 48em) {
            grid-template-columns: auto minmax(0, 1fr) fit-content(18rem);
            /* 1fr last row: a tall meta column grows the description row, not the heading */
            grid-template-rows: auto auto 1fr;
            grid-template-areas:
                "num heading meta"
                ".   url     meta"
                ".   desc    meta";
        }
    }
    li[hidden] {
        display: none;
    }

    li::before {
        grid-area: num;
        align-self: baseline;
        padding-inline-end: 1ch;
    }

    .project-heading { grid-area: heading; align-self: baseline; }
    .project-artifact {
        white-space: nowrap;
        margin-left: var(--small);
    }
    .project-url { grid-area: url; }
    .project-meta {
        grid-area: meta;
        align-self: baseline;
    }
    .project-desc { grid-area: desc; }

    li .project-desc {
        max-width: 50ch;
    }

    .project-meta {
        display: flex;
        flex-wrap: wrap;
        column-gap: 1rem;
        align-items: baseline;
        align-content: start;
        @media (width >= 48em) {
            justify-content: flex-end;
        }
    }

    #filter {
        width: min(105ch, 90svw);
        justify-self: right;
        display: grid;
    }

    .filter-heading {
        margin-block: var(--xxx-small);
    }

    #filter-btn-group {
        text-align: right;
    }
    #filter-btn-group > * {
        margin: var(--xxx-small);
    }

    #filter > * {
        justify-self: right;
    }
    footer {
        text-align: center;
    }
}
@layer theme {
    html {
        --charteuse: #abbd00;
        --darkbrown: #160d0b;
        --skyblue: #91afd0;
        --skyblue20: #91afd020;
        --orange: #ff8125;
        --pink: #f1b6c4;
    }

    body {
        background-color: var(--darkbrown);
        color: var(--charteuse);
    }

    body::before {
        content: '';
        position: absolute;
        inset: 0 0 auto;          /* top, left, right; height comes from aspect-ratio */
        aspect-ratio: 3 / 2;      /* blur-bg.png is 6000 × 4000; setting the box to image height */
        background:
            linear-gradient(
                color-mix(in srgb, var(--darkbrown) 70%, transparent),
                color-mix(in srgb, var(--darkbrown) 70%, transparent)
            ),
            url("../images/blur-bg.webp") top / 100% auto no-repeat;
        mask-image: linear-gradient(var(--darkbrown) 60%, transparent);
        -webkit-mask-image: linear-gradient(var(--darkbrown) 60%, transparent);
        z-index: -1;              /* under all the content and the star trail */
    }

    body::after {
        content: '';
        position: absolute;
        inset: 0;
        background-color: var(--skyblue20);
        mask-image: url("../images/bg-star-trail-1.webp");
        mask-size: cover;
        -webkit-mask-image: url("../images/bg-star-trail-1.webp");
        -webkit-mask-size: cover;
        -webkit-mask-repeat: no-repeat;
        -webkit-mask-position: bottom;
        z-index: 0;
    }

    h1 {
        color: var(--skyblue);
    }

    header p:first-child {
        color: var(--skyblue);
    }

    ol {
        border-top: solid 3px var(--charteuse);
    }

    li {
        border-bottom: solid 3px var(--charteuse);
    }

    .project-cat:first-child::after {
        content: '';
        mask-image: url("../images/circle-solid-full.svg");
        margin-left: 1rem;
        width: 0.4em;
        height: 0.4em;
        background-color: currentColor;
        mask-size: contain;
        display: inline-block;
        mask-repeat: no-repeat;
        -webkit-mask-image: url("../images/circle-solid-full.svg");
        -webkit-mask-size: contain;
        -webkit-mask-repeat: no-repeat;
    }

    .project-theme:not(:last-child)::after {
        content: '';
        mask-image: url("../images/circle-solid-full.svg");
        margin-left: 0.5rem;
        margin-right: 0.25rem;
        width: 0.4em;
        height: 0.4em;
        background-color: currentColor;
        mask-size: contain;
        display: inline-block;
        mask-repeat: no-repeat;
        -webkit-mask-image: url("../images/circle-solid-full.svg");
        -webkit-mask-size: contain;
        -webkit-mask-repeat: no-repeat;
    }

    .label {
        color: var(--orange);
    }

    a, summary:is(.label) {
        color: var(--pink);
        cursor: pointer;
    }

    a[data-content="&sect"]{
        text-decoration: none;
    }

    .filter-btn {
        background-color: var(--darkbrown);
        color: var(--pink);
        border: solid 1.5px var(--pink);
    }

    .filter-btn:hover {
        background-color: var(--pink);
        color:  var(--darkbrown);
        cursor: pointer;
    }
}
@layer typography {
    html {
        --titlefont: "Danfo";
        --basefont: "Montserrat";
        --basefontsize: 16px;
        --scale: 1.6; ;

        /* generate the scale using pow() */
        --xx-small: calc(1rem * pow(var(--scale), -0.5));
        --x-small: calc(1rem * pow(var(--scale), -0.25));
        --small: calc(1rem * pow(var(--scale), -0.125));
        --medium: var(--basefontsize);
        --large: calc(1rem * pow(var(--scale), 1));
        --x-large: calc(1rem * pow(var(--scale), 2));
        --xx-large: calc(1rem * pow(var(--scale), 3));
        --xxx-large: calc(1rem * pow(var(--scale), 4));
        --titlesize: clamp(4.5rem,
        1.78rem + 11.61vw,
        calc(1rem * pow(var(--scale), 5)
        ));
    }

    body, p, ol, li, a {
        font-family: var(--basefont), "sans-serif";
        font-size: var(--medium);
        line-height: 2;
    }

    h1 {
        font-family: var(--titlefont), "serif";
        font-size: var(--titlesize);
        @media (width < 75em) {
            line-height: 1;
        }
    }

    #tagline {
        font-weight: 300;
        text-transform: uppercase;
        letter-spacing: 0.5rem;
    }

    #copy {
        font-size: var(--xx-small);
    }

    .filter-btn {
        font-family: var(--basefont), "sans-serif";
        font-size: var(--medium);
    }

    .label, .project-name {
        text-transform: uppercase;
        font-weight: 700;
        font-size: var(--xx-small);
        letter-spacing: 0.07rem;
    }

    .project-item::before {
        content: counter(project, decimal-leading-zero) ".";
        font-weight: 700;
    }

    .project-name, small {
        font-size: var(--medium);
    }

    footer {
        font-weight: 500;
    }

}


a[href='#'] {
    text-decoration: underline blue;
}

