:root {
    --night: #171914;
    --moss: #293227;
    --leaf: #667054;

    --gold: #b89250;
    --red: #873d35;

    --linen: #d8cbaa;
    --paper: #e8dec2;
}


/* --------------------------------
   RESET
-------------------------------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--night);
    color: var(--paper);

    font-family:
        "IBM Plex Mono",
        monospace;

    overflow-x: hidden;
}


/* subtle woven texture */

body::before {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    opacity: .20;

    z-index: 50;

    background-image:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 3px,
            rgba(220,210,170,.12) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 3px,
            rgba(220,210,170,.08) 4px
        );
}


/* --------------------------------
   HEADER
-------------------------------- */

header {
    position: sticky;
    top: 0;

    z-index: 100;

    width: min(1300px, 90vw);

    margin: auto;

    padding: 28px 0;

    display: flex;
    justify-content: space-between;
    align-items: center;

    background: rgba(23,25,20,.92);

    backdrop-filter: blur(4px);
}

.label {
    font-size: 11px;
    letter-spacing: .15em;
    color: var(--gold);
}
.header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    color: var(--paper);

    text-decoration: none;

    font-size: 12px;

    transition:
        color .2s ease;
}

nav a:hover {
    color: var(--gold);
}


/* --------------------------------
   DECORATIVE TOP THREAD
-------------------------------- */

.thread {
    position: absolute;

    pointer-events: none;

    z-index: 1;
}

.thread path {
    fill: none;

    stroke: var(--red);

    stroke-width: 2;

    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;

    animation:
        stitch 4s ease forwards;
}

.thread-top {
    width: 50vw;

    right: 0;
    top: 120px;
}

@keyframes stitch {
    to {
        stroke-dashoffset: 0;
    }
}


/* --------------------------------
   HERO
-------------------------------- */

.hero {
    position: relative;

    min-height: 90vh;

    width: min(1300px, 90vw);

    margin: auto;

    display: flex;
    align-items: center;
}

.hero-copy {
    position: relative;

    z-index: 5;

    width: 55%;
}

.kicker {
    font-size: 11px;

    letter-spacing: .16em;

    text-transform: uppercase;

    color: var(--gold);
}

h1 {
    font-family:
        "Fraunces",
        "DM Serif Display",
        serif;

    font-weight: 400;

    font-size:
        clamp(90px, 14vw, 210px);

    line-height: .72;

    letter-spacing: -.05em;

    margin: 35px 0;

    color: var(--paper);
}

.description {
    max-width: 400px;

    line-height: 1.8;

    color: #aaa98e;
}

/* COLOURS OF PAGES*/


.writing-page {
    background: #4f1d24;
}

.code-page{
    background: #0a1d33
}

/* --------------------------------
   BOTANICAL PLACEHOLDERS
-------------------------------- */

.botanical {
    position: absolute;

    color: var(--leaf);

    font-size: 80px;

    z-index: 2;

    pointer-events: none;

    opacity: .7;
}

.botanical-one {
    left: 0;
    bottom: 12%;
}

.botanical-two {
    right: 0;
    bottom: 3%;

    color: var(--red);
}


/* --------------------------------
   PATCHWORK
-------------------------------- */

/*
   These are section decorations rather
   than fixed objects.

   This means they move with the page
   and don't make the whole site feel static.
*/

.floating-patch {
    position: absolute;

    pointer-events: none;

    z-index: 2;

    filter:
        drop-shadow(
            8px 12px 0 rgba(0,0,0,.25)
        );
}

.floating-patch img {
    display: block;

    width: 100%;
    height: auto;
}


/* HERO PATCHWORK 1 */

.hero-patch {
    width: 270px;

    right: 7%;
    top: 25%;

    transform: rotate(7deg);

    animation:
        hero-patch-float 9s ease-in-out infinite;
}

.hero-patch::after {
    content: "";

    position: absolute;

    inset: 5px;

    border: 2px dashed
        rgba(184,146,80,.7);
}

@keyframes hero-patch-float {
    0%,
    100% {
        transform:
            rotate(7deg)
            translateY(0);
    }

    50% {
        transform:
            rotate(4deg)
            translateY(-10px);
    }
}


/* --------------------------------
   WORK SECTION
-------------------------------- */

.work {
    position: relative;
    isolation: isolate;

    width: min(1100px, 85vw);

    margin: auto;

    padding: 150px 0;

    color: var(--night);
}

/* paper */

.work::before {
    content: "";

    position: absolute;

    z-index: -2;

    left: -10vw;
    right: -10vw;

    top: 0;
    bottom: 0;

    background: var(--paper);
}

/* paper grain */

.work::after {
    content: "";

    position: absolute;

    z-index: -1;

    left: -10vw;
    right: -10vw;

    top: 0;
    bottom: 0;

    pointer-events: none;

    opacity: .55;

    background:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 4px,
            rgba(70,50,25,.10) 5px,
            transparent 6px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 5px,
            rgba(70,50,25,.06) 6px,
            transparent 7px
        );
}


/* heading */

.section-heading {
    display: flex;

    align-items: baseline;

    gap: 25px;

    border-bottom:
        1px solid #41443a;

    padding-bottom: 20px;
}

.section-heading span {
    color: var(--gold);

    font-size: 12px;
}

.section-heading h2 {
    font-family:
        "DM Serif Display",
        serif;

    font-size: 45px;

    font-weight: 400;

    margin: 0;
}


/* --------------------------------
   WORK PATCHWORK
-------------------------------- */

.work-patch {
    width: 170px;

    position: absolute;

    right: -60px;
    top: 80px;

    transform: rotate(9deg);

    animation:
        work-patch-float 11s ease-in-out infinite;
}

.work-patch::after {
    content: "";

    position: absolute;

    inset: 5px;

    border: 2px dashed
        rgba(135,61,53,.7);
}

@keyframes work-patch-float {
    0%,
    100% {
        transform:
            rotate(9deg)
            translateY(0);
    }

    50% {
        transform:
            rotate(6deg)
            translateY(8px);
    }
}


/* --------------------------------
   WORK NAVIGATION
-------------------------------- */

/*
   The three links are deliberately
   staggered, but they remain an obvious
   vertical navigation system.
*/

.links {
    position: relative;
    isolation: isolate;

    margin-top: 75px;

    min-height: 760px;
}

/* large woven pattern */

.links::before {
    content: "";

    position: absolute;

    z-index: -1;

    inset: -40px;

    pointer-events: none;

    opacity: .35;

    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 39px,
            rgba(135,61,53,.12) 40px,
            transparent 41px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 39px,
            rgba(184,146,80,.12) 40px,
            transparent 41px
        );
}
.links::after {
    content: "";

    position: absolute;

    inset: -30px;

    z-index: -1;

    pointer-events: none;

    opacity: .18;

    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 5px,
            rgba(70,50,25,.12) 6px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 5px,
            rgba(70,50,25,.10) 6px
        );
}


/* --------------------------------
   FABRIC LABEL
-------------------------------- */

.fabric-label {
    position: absolute;

    display: block;

    width: 340px;

    min-height: 230px;

    padding: 38px;

    color: var(--night);

    text-decoration: none;

    box-shadow:
        12px 15px 0 rgba(0,0,0,.22);

    border: 1px solid
        rgba(50,45,30,.25);

    transform-origin: 50% 10%;

    transition:
        transform .4s ease,
        box-shadow .4s ease;
}


/* different fabrics */

.label-writing {
    left: 2%;
    top: 20px;

    background:
        var(--linen);

    transform: rotate(-4deg);

    animation:
        label-writing-float 8s ease-in-out infinite;
}

.label-art {
    right: 4%;
    top: 260px;

    background:
        #c6c9ad;

    transform: rotate(3deg);

    animation:
        label-art-float 10s ease-in-out infinite;
}

.label-code {
    left: 22%;
    top: 520px;

    background:
        #b7a778;

    transform: rotate(-2deg);

    animation:
        label-code-float 9s ease-in-out infinite;
}


/* --------------------------------
   LABEL STITCHING
-------------------------------- */

.label-stitch {
    position: absolute;

    pointer-events: none;

    opacity: .85;
}


/* top + bottom */

.stitch-top,
.stitch-bottom {
    left: 12px;
    right: 12px;

    height: 2px;

    background:
        repeating-linear-gradient(
            90deg,
            var(--red) 0 8px,
            transparent 8px 13px
        );
}

.stitch-top {
    top: 9px;
}

.stitch-bottom {
    bottom: 9px;
}


/* left + right */

.stitch-left,
.stitch-right {
    top: 12px;
    bottom: 12px;

    width: 2px;

    background:
        repeating-linear-gradient(
            0deg,
            var(--red) 0 8px,
            transparent 8px 13px
        );
}

.stitch-left {
    left: 9px;
}

.stitch-right {
    right: 9px;
}



/* --------------------------------
   LABEL TEXT
-------------------------------- */

.label-number {
    display: block;

    margin-bottom: 20px;

    font-size: 10px;

    letter-spacing: .15em;

    color: var(--red);
}

.label-title {
    display: block;

    font-family:
        "DM Serif Display",
        serif;

    font-size: 48px;

    line-height: .9;

    margin-bottom: 18px;
}

.label-description {
    display: block;

    max-width: 230px;

    color: #68624f;

    font-size: 11px;

    line-height: 1.6;
}

.label-arrow {
    position: absolute;

    right: 30px;
    bottom: 25px;

    font-size: 28px;

    color: var(--red);

    transition:
        transform .3s ease;
}


/* --------------------------------
   LABEL MOVEMENT
-------------------------------- */

@keyframes label-writing-float {
    0%,
    100% {
        transform:
            rotate(-4deg)
            translateY(0);
    }

    50% {
        transform:
            rotate(-3deg)
            translateY(4px);
    }
}

@keyframes label-art-float {
    0%,
    100% {
        transform:
            rotate(3deg)
            translateY(0);
    }

    50% {
        transform:
            rotate(4deg)
            translateY(-5px);
    }
}

@keyframes label-code-float {
    0%,
    100% {
        transform:
            rotate(-2deg)
            translateY(0);
    }

    50% {
        transform:
            rotate(-3deg)
            translateY(5px);
    }
}


/* hover */

.fabric-label:hover {
    z-index: 10;

    box-shadow:
        20px 25px 0 rgba(0,0,0,.3);
}

.label-writing:hover {
    transform:
        rotate(-1deg)
        translateY(-12px);
}

.label-art:hover {
    transform:
        rotate(5deg)
        translateY(-12px);
}

.label-code:hover {
    transform:
        rotate(-4deg)
        translateY(-12px);
}

.fabric-label:hover .label-arrow {
    transform:
        translate(8px,-8px)
        rotate(-5deg);
}


/* --------------------------------
   ABOUT
-------------------------------- */

.about {
    position: relative;

    min-height: 80vh;

    background:
        var(--moss);

    display: grid;

    grid-template-columns:
        1fr 1fr;

    align-items: center;

    gap: 80px;

    padding: 100px 10vw;
}

.about-image {
    transform:
        rotate(-3deg);
}

.about-image img {
    width: 100%;

    max-height: 600px;

    object-fit: cover;

    box-shadow:
        10px 14px 0 rgba(0,0,0,.2);
}

.about-text {
    max-width: 500px;
}

.about-text h2 {
    font-family:
        "DM Serif Display",
        serif;

    font-weight: 400;

    font-size: 70px;

    line-height: .9;
}

.about-text p:not(.kicker) {
    color: #b8b69b;

    line-height: 1.8;
}


/* --------------------------------
   ELSEWHERE
-------------------------------- */

.elsewhere {
    position: relative;

    min-height: 70vh;

    width: min(900px, 85vw);

    margin: auto;

    padding: 150px 0;
}

.elsewhere h2 {
    font-family:
        "DM Serif Display",
        serif;

    font-weight: 400;

    font-size:
        clamp(50px, 8vw, 100px);

    line-height: .9;

    max-width: 700px;
}

.elsewhere-links {
    display: flex;

    flex-wrap: wrap;

    gap: 15px;
}

.elsewhere-links a {
    border:
        1px solid var(--gold);

    padding:
        15px 25px;

    color: var(--paper);

    text-decoration: none;

    transition:
        background .2s ease,
        color .2s ease;
}

.elsewhere-links a:hover {
    background:
        var(--gold);

    color:
        var(--night);
}


/* --------------------------------
   ELSEWHERE PATCH
-------------------------------- */

.links-patch {
    width: 150px;

    position: absolute;

    right: -80px;
    bottom: 80px;

    transform:
        rotate(-7deg);

    animation:
        elsewhere-patch-float 12s ease-in-out infinite;
}

.links-patch::after {
    content: "";

    position: absolute;

    inset: 5px;

    border:
        2px dashed
        rgba(184,146,80,.7);
}

@keyframes elsewhere-patch-float {
    0%,
    100% {
        transform:
            rotate(-7deg)
            translateY(0);
    }

    50% {
        transform:
            rotate(-3deg)
            translateY(-8px);
    }
}


/* --------------------------------
   FOOTER
-------------------------------- */

footer {
    border-top:
        1px solid #35382f;

    padding:
        30px 5vw;

    display: flex;

    justify-content: space-between;

    color:
        #777a69;

    font-size: 10px;

    letter-spacing: .1em;
}


/* --------------------------------
   REDUCED MOTION
-------------------------------- */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration:
            .01ms !important;

        animation-iteration-count:
            1 !important;

        scroll-behavior:
            auto !important;
    }
}
/* --------------------------------
   WRITING / POST PAGES
-------------------------------- */

.post {
    width: min(750px, 85vw);

    margin: auto;

    padding: 130px 0 180px;
}

.post h1 {
    font-size:
        clamp(60px, 9vw, 120px);

    line-height: .85;

    margin:
        30px 0 50px;
}

.post-intro {
    max-width: 600px;

    font-family:
        "DM Serif Display",
        serif;

    font-size: 25px;

    line-height: 1.4;

    color:
        var(--linen);
}

.post-body {
    margin-top: 70px;

    font-size: 14px;

    line-height: 2;

    color: #b8b69b;
}

.post-body h2 {
    margin-top: 70px;

    font-family:
        "DM Serif Display",
        serif;

    font-size: 42px;

    font-weight: 400;

    color:
        var(--paper);
}

.post-body p {
    margin:
        0 0 30px;
}

/* --------------------------------
   MOBILE
-------------------------------- */

@media (max-width: 750px) {

    header {
        width: 90vw;

        padding:
            22px 0;
    }

    nav {
        gap: 15px;
    }


    /* hero */

    .hero {
        min-height:
            760px;

        align-items:
            flex-start;
    }

    .hero-copy {
        width: 100%;

        padding-top:
            90px;
    }

    h1 {
        font-size:
            23vw;
    }


    /* hero patch */

    .hero-patch {
        width: 180px;

        right: -25px;
        top: 52%;
    }


    /* work */

    .work {
        width: 85vw;

        padding:
            100px 0;
    }

    .section-heading h2 {
        font-size:
            35px;
    }

    .links {
        min-height:
            auto;

        display:
            flex;

        flex-direction:
            column;

        gap:
            35px;

        margin-top:
            50px;
    }


    /*
       On mobile the labels become a normal
       readable sequence.
    */

    .fabric-label {
        position:
            relative;

        left:
            auto;

        right:
            auto;

        top:
            auto;

        width:
            100%;

        min-height:
            220px;

        transform:
            none !important;

        animation:
            none;
    }

    .fabric-label:hover {
        transform:
            translateY(-7px) !important;
    }


    /* hide decorative thread on small screens */

    .label-threads {
        display:
            none;
    }


    .work-patch {
        width:
            110px;

        right:
            -25px;

        top:
            70px;
    }


    /* about */

    .about {
        grid-template-columns:
            1fr;

        padding:
            80px 10vw;

        gap:
            50px;
    }

    .about-text h2 {
        font-size:
            55px;
    }


    /* elsewhere */

    .elsewhere {
        padding:
            100px 0;
    }

    .links-patch {
        width:
            100px;

        right:
            -25px;

        bottom:
            40px;
    }


    /* footer */

    footer {
        flex-direction:
            column;

        gap:
            10px;
    }
}
