@font-face {
    font-family: "Geist";
    src: url("../fonts/Geist-Variable.dfa48d5a8537.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Geist";
    src: url("../fonts/Geist-Italic-Variable.1a9d7927a9f5.woff2") format("woff2");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Noto Serif";
    src: url("../fonts/NotoSerif-Variable.8ef08540a858.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Noto Serif";
    src: url("../fonts/NotoSerif-Italic-Variable.e749e4f0a26a.woff2") format("woff2");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Noto Serif";
    src: url("../fonts/NotoSerifDevanagari-Regular.23be8f0132e3.woff2") format("woff2");
    unicode-range: U+0900-097F, U+200C-200D, U+25CC;
    font-display: swap;
}
@font-face {
    font-family: "Noto Serif";
    src: url("../fonts/NotoSerifKannada-Regular.3a0641ccafc9.woff2") format("woff2");
    unicode-range: U+0C80-0CFF;
    font-display: swap;
}
@font-face {
    font-family: "Noto Serif";
    src: url("../fonts/NotoSerifMalayalam-Regular.2a1eb569325f.woff2") format("woff2");
    unicode-range: U+0D00-0D7F;
    font-display: swap;
}

:root {
    color-scheme: light;
    --primary: #a82929;
    --foreground: #333333;
    --muted-foreground: #666666;
    --border: #e4e1e1;
    --ring: var(--primary);

    --font-sans: "Geist", system-ui, sans-serif;
    --font-serif: "Noto Serif", Georgia, serif;
    --text-regular: var(--text-5);
    --leading-normal: 1.6;

    --container-max: 80rem;
    --container-pad: 2rem;

    --measure: 40rem;
}

main {
    padding-block-start: 0;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 450;
    letter-spacing: -.01em;
    text-wrap: balance;
}
h1 {
    line-height: 1.12;
}
h2 {
    line-height: 1.2;
}
h3 {
    line-height: 1.3;
}

a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: rgb(from var(--primary) r g b / .35);
    text-underline-offset: .22em;
    transition: text-decoration-color .15s;

    &:hover {
        color: var(--primary);
        text-decoration-color: currentColor;
    }
}

img {
    height: auto;
}

figcaption {
    margin-top: .75rem;
    font-size: var(--text-7);
    line-height: 1.5;
    color: var(--muted-foreground);

    a {
        color: inherit;
    }
}

::selection {
    background: rgb(from var(--primary) r g b / .14);
    color: var(--foreground);
}

.prose {
    max-width: var(--measure);
    overflow-wrap: break-word;
}

.site-header {
    .container {
        gap: 1rem 2rem;
        padding-block: 1.75rem;
    }
    ul {
        gap: 2rem;
        margin: 0;
    }
    nav a {
        position: relative;
        display: block;
        padding-block: .4rem;
        color: var(--muted-foreground);
        font-size: var(--text-6);
        text-decoration: none;
    }
    nav a:hover,
    nav [aria-current="page"] {
        color: var(--foreground);
    }
    nav [aria-current="page"] {
        text-decoration: underline wavy var(--primary);
        text-decoration-thickness: 1.5px;
        text-underline-offset: .35em;
    }
}
.site-logo img {
    display: block;
    width: 180px;
}

.hero {
    padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);

    h1 {
        margin: 0;
        line-height: 1.3;
    }
}
.hero-subtitle {
    font-size: var(--text-4);
}

.definition {
    padding-block: clamp(2.5rem, 5vw, 4rem);
    border-top: 1px solid var(--border);

    dt {
        font-family: var(--font-serif);
        font-size: var(--text-1);
        font-weight: 400;
        line-height: 1.2;
    }
    dd em {
        margin-right: .5em;
        font-family: var(--font-serif);
        color: var(--muted-foreground);
    }
}
.definition-scripts {
    gap: .25em 1em;
    font-family: var(--font-serif);
    font-size: var(--text-3);
    color: var(--primary);
}

.home-intro {
    padding-block: 0 clamp(3rem, 6vw, 5rem);

    .prose {
        max-width: 44rem;
    }
}
.lead p {
    font-size: var(--text-4);
}

.home-projects {
    padding-block: clamp(3rem, 6vw, 5rem);

    h2 {
        margin-block-end: 2rem;
    }
}
.project-index {
    margin-block-end: 2rem;
    border-top: 1px solid var(--border);

    li {
        margin: 0;
        border-bottom: 1px solid var(--border);
    }
    a {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: .25rem 2rem;
        align-items: baseline;
        padding-block: 1.25rem;
        color: var(--foreground);
        text-decoration: none;

        &::before {
            content: "";
            position: absolute;
            left: 0;
            top: 1.25rem;
            translate: -.6rem .55rem;
            width: .6rem;
            height: .7rem;
            background: var(--primary);
            clip-path: polygon(0 0, 100% 50%, 0 100%);
            opacity: 0;
            transition: opacity .2s, translate .35s cubic-bezier(.16, .8, .3, 1);
        }
    }
    strong {
        font-family: var(--font-serif);
        font-size: var(--text-3);
        font-weight: 400;
        line-height: 1.3;
        transition: color .2s, translate .35s cubic-bezier(.16, .8, .3, 1);
    }
    span {
        font-size: var(--text-6);
    }
    a:hover::before {
        opacity: 1;
        translate: 0 .55rem;
    }
    a:hover strong {
        color: var(--primary);
        translate: 1.4rem 0;
    }
}
.more-link {
    font-weight: 500;
}

.space-feature {
    padding-block: clamp(2rem, 5vw, 4rem) clamp(4rem, 8vw, 7rem);

    img {
        display: block;
        width: 100%;
        height: clamp(18rem, 40vw, 34rem);
        object-fit: cover;
    }
    figcaption {
        text-align: right;
    }
}
.space-text {
    position: relative;
    max-width: 30rem;
    margin-top: clamp(-8rem, -8vw, -3rem);
    padding: clamp(1.75rem, 4vw, 3rem);
    background: var(--background);
}

.page-content {
    padding-block: clamp(2rem, 5vw, 4rem) clamp(4rem, 8vw, 6rem);

    > .prose {
        margin-inline: auto;
    }
}
.page-heading {
    margin-bottom: 4.5rem;
    position: relative;
    width: 100%;

    &::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: calc(-1 * var(--space-8));
        width: 100%;
        height: 6px;

        background-color: var(--border);

        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='6'%3E%3Cpath d='M0 3 Q3 0 6 3 T12 3' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
        mask-repeat: repeat-x;
    }
    > .prose {
        font-size: var(--text-4);
        color: var(--muted-foreground);
    }
}

.projects {
    display: grid;
    grid-template-columns: 18rem minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
}
.project-nav {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding: 0;

    li {
        margin: 0;
        border-bottom: 1px solid var(--border);

        &:last-child {
            border-bottom: 0;
        }
    }
    a {
        display: flex;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-4);
        color: var(--muted-foreground);
        font-size: var(--text-7);
        line-height: 1.4;
        text-decoration: none;

        &::before {
            content: "";
            flex: none;
            width: 5px;
            height: 5px;
            margin-top: calc(.7em - 2.5px);
            border-radius: 50%;
            background: var(--muted-foreground);
            opacity: .4;
        }
        &:hover {
            color: var(--primary);
        }
    }
}
.project {
    padding-block: 2.5rem;
    scroll-margin-top: 1.5rem;

    &:first-child {
        padding-top: 0;
        border-top: 0;
    }
    h2 {
        margin: 0 0 1.5rem;
        transition: color .3s;
    }
    &:target h2 {
        color: var(--primary);
    }
}
.project-links {
    gap: .5rem 1.75rem;
    font-size: var(--text-6);
    font-weight: 500;
}
.project-why {
    max-width: var(--measure);
    padding: var(--space-1) 0 var(--space-1) var(--space-5);
    border-left: 3px solid var(--border);
    font-size: var(--text-8);

    strong {
        display: block;
        margin-bottom: var(--space-1);
        font-weight: 600;
        letter-spacing: .12em;
        text-transform: uppercase;
    }
    p {
        margin: 0;
        font-size: var(--text-7);
        color: var(--muted-foreground);
    }
}

.site-footer {
    padding-block: clamp(2.5rem, 5vw, 3.5rem) 2.5rem;
    border-top: 1px solid var(--border);
    color: var(--muted-foreground);
    font-size: var(--text-6);
}
.footer-meta strong.colored {
    color: var(--primary);
    border-bottom: 3px solid var(--muted);
    display: inline-block;
    margin-bottom: var(--space-2);
}

.skip-link {
    position: absolute;
    z-index: 2;
    padding: .75rem;
    background: var(--background);
}
.skip-link:not(:focus),
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 860px) {
    :root {
        --container-pad: 1.25rem;
    }
    .projects {
        grid-template-columns: minmax(0, 1fr);
    }
    .project-nav {
        display: none;
    }
    .site-header {
        .container {
            flex-direction: column;
            flex-wrap: nowrap;
        }
        ul {
            justify-content: center;
        }
    }
}

@media (max-width: 700px) {
    .site-header {
        .container {
            padding-block: 1.25rem;
        }
        ul {
            gap: 1.5rem;
        }
    }
    .site-logo img {
        width: 160px;
    }
    .project-index a {
        grid-template-columns: minmax(0, 1fr);
    }
    .space-feature figcaption {
        text-align: left;
    }
    .space-text {
        margin-top: 0;
        padding-inline: 0;
    }
}
