/* Reset Styles */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img, picture, svg {
    display: block;
    width: 100%;
}

button {
    font: inherit;
    color: inherit;
    background-color: inherit;
    border: none;
    cursor: pointer;
}

/* Import Fonts */

@font-face {
    font-family: 'Literata';
    src:
        local('Literata'),
        url(/fonts/Literata-subset.woff2) format('woff2');
    font-style: normal;
    /* unicode-range: ; */
}

@font-face {
    font-family: 'Literata';
    src:
        local('Literata'),
        url(/fonts/Literata-Italic-subset.woff2) format('woff2');
    font-style: italic;
    /* unicode-range: ; */
}

@font-face {
    font-family: 'Chivo';
    src:
        local('Chivo'),
        url(/fonts/Chivo-Light-subset.woff2) format('woff2');
    font-style: normal;
    font-weight: 300;
    /* unicode-range: ; */
}

/* Primary Styles */

:root {
    --beige: #efe4d1;
    --beige-overlay: #efe4d151;
    --black: #272727;

    --green: #c3ff00;
    --green-darker: hsl(from var(--green) h s calc(l - 2));

    --purple: #af11c1;
    --purple-dark: hsl(from var(--purple) h s calc(l - 8));
    --purple-darkest: hsl(from var(--purple) h s calc(l - 15));

    --thin-border: 2px solid var(--black);
    --thick-border: 3px solid var(--black);

    --nav-width: 4rem;
    --nav-height: 5rem;
    --nav-button-line: 3px;
    --nav-padding: 2rem;

    --content-wide: 1100px;
    --content-narrow: 500px;

    --max-padding: 4rem;
    --padding-width: clamp(2rem, calc(1.4rem + 3.2vw), var(--max-padding));
}

body {
    background-image: url(/imgs/paper-texture.avif);
    background-attachment: fixed;

    -webkit-font-smoothing: antialiased;
    font-optical-sizing: auto;
    
    font-family: 'Literata', serif;
    color: var(--black);

    /* 19px to 21px - 1.75 to 1.5 */
    font-size: clamp(1.188rem, 0.267vw + 1.129rem, 1.313rem);
    line-height: clamp(1.969rem, -0.233vw + 2.129rem, 2.078rem);

    @media (width < 650px) {
        background-attachment: scroll;
    }
}

/* Typography */
/* (Viewport: 350px to 1100px, Line Height: 1.375 to 1.25) */

h1, h2, h3, h4, h5, h6 {
    font-style: italic;
}

.subtitle, .nav-item, .footer-item {
    font-family: 'Chivo', sans-serif;
    font-weight: normal;
    font-style: normal;
}

h1 { 
    /* 48px to 64px */
    font-size: clamp(3rem, 2.133vw + 2.533rem, 4rem);
    line-height: clamp(4.125rem, 1.867vw + 3.717rem, 5rem);
}

h2 {
    /* 36px to 52px */
    font-size: clamp(2.25rem, 2.133vw + 1.783rem, 3.25rem);
    line-height: clamp(3.094rem, 2.067vw + 2.642rem, 4.063rem);
    margin-bottom: 4rem;
}

.index-title, .credits-nav {
    /* 28px to 40px */
    font-size: clamp(1.75rem, 1.6vw + 1.4rem, 2.5rem);
    line-height: clamp(2.406rem, 1.533vw + 2.071rem, 3.125rem);
}

h3 {
    /* 26px to 32px */
    font-size: clamp(1.625rem, 0.8vw + 1.45rem, 2rem);
    line-height: clamp(2.234rem, 0.567vw + 2.11rem, 2.5rem);
}

h3.subtitle {
    /* 19px to 21px - 1.75 to 1.5 */
    font-size: clamp(1.188rem, 0.267vw + 1.129rem, 1.313rem);
    line-height: clamp(1.969rem, -0.233vw + 2.129rem, 2.078rem);
}

h4 {
    /* 20px to 26px */
    font-size: clamp(1.25rem, 0.8vw + 1.075rem, 1.625rem);
    line-height: clamp(1.719rem, 0.667vw + 1.573rem, 2.031rem);
}

h3, h4 {
    margin-bottom: 1rem;
}

p:not(.list-header) {
    margin-bottom: 2rem;
}

.list-header ~ ul {
    margin-bottom: 1rem;
}

li {
    margin-inline-start: 1em;
    padding-inline-start: 0.25em;
    margin-bottom: 0.5rem;
}

button.internal-link {
    text-decoration: underline;
}

/* Links & Hover Effects */

.external-link,
.internal-link {
    color: var(--purple);
    font-weight: bold;
}

.external-link:hover,
.internal-link:hover {
    color: var(--purple-dark);
}

.external-link:active,
.internal-link:active {
    color: var(--purple-darkest);
}

/* Main Content */

.content-box {
    padding: 0 var(--padding-width);
    margin: 0 auto;
    max-width: calc(var(--content-wide) + calc(2* var(--max-padding))); 
}

section {
    scroll-margin-top: 2rem;
    margin-bottom: 10rem;

    @media (width < 950px) {
        margin-bottom: 6rem;
    }
}

.section-header {
    display: flex;
    margin-bottom: 4rem;
    gap: 1rem;
    align-items: center;
}

.section-header p {
    margin: 0;
}

.section-header-left,
.section-header-right,
.credits-title-line {
    border-top: 4px solid var(--green);
    border-bottom: 5px solid var(--purple);
    height: 1rem;
}

.section-header-left {
    --marg-left: calc((100% - calc(2 * var(--padding-width)) - var(--content-wide))/2);

    width: 
        max(
            calc(var(--padding-width) - 1rem),
            calc(var(--padding-width) + var(--marg-left) - 1rem)
        );
}

.section-header-right {
    flex: 1;
}

/* Repeating Patterns */

.section-title {
    max-width: 25ch;
}

.sub-heading-box {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    text-align: center;
}

.sub-heading-box::before,
.sub-heading-box::after {
    content: "";
    height: 2px;
    background-color: var(--black);
}

.sub-heading-box::before {
    width: 4rem;
}

.sub-heading-box::after {
    flex: 1;
}

.sub-heading-box .subtitle {
    margin: 0;
    background-color: var(--beige-overlay);
    border: var(--thin-border);
    padding: 0.5rem 1rem;
}

.swap-order {
    order: 1;
}

/* Navigation (Breakpoint: < 650px) and Footer */

main, footer {
    margin-left: var(--nav-width);
}

#nav {
    width: var(--nav-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;

    border-right: var(--thick-border);

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

.logo, .nav-item {
    writing-mode: vertical-rl;
    line-height: var(--nav-width);   
    border-right: var(--thick-border); 
    padding: var(--nav-padding) 0;
}

.logo {
    font-size: 1.75rem;
    font-weight: bold;
    padding-bottom: 2.25rem;
}

.logo-link,
.nav-link {
    color: inherit;
    text-decoration: none;
}

.nav-item, 
.footer-item {
    font-size: 1.25rem;
}

.nav-item {
    border-top: var(--thin-border);
}

.nav-item-box {
    display: flex;
    flex-direction: column;
    min-width: calc(var(--nav-width) + 3px);
}

#nav-toggle,
.nav-button-box {
    display: none;
}

#footer {
    border-top: var(--thick-border);
}

#footer a {
    color: var(--black);
    text-decoration: none;
}

.footer-box {
    display: flex;
    justify-content: end;
    align-items: center;
}

.footer-item {
    border-left: var(--thin-border);
    padding: 0 var(--nav-padding);
    line-height: calc(var(--nav-width) - 1rem);
}

.logo:hover {
    border-bottom: var(--thin-border);
}

.logo:hover,
.nav-item:hover,
.footer-item:hover,
.nav-button-box:hover {
    background-color: var(--green);
}

.logo:active,
.nav-item:active,
.footer-item:active,
.nav-button-box:active {
    background-color: var(--green-darker);
}

@media (width < 650px) {

    main, footer {
        margin-left: 0;
    }

    #nav {
        position: static;
        width: 100%;
        height: var(--nav-height);

        border-right: none;
        border-bottom: var(--thick-border);

        flex-direction: row;
    }

    .logo, .nav-item {
        writing-mode: horizontal-tb;
    }

    .logo {
        border-right: 0;
        line-height: var(--nav-height);
        border-bottom: var(--thick-border);
        padding: 0 1.5rem 0 1rem;
    }

    .logo:hover {
        border-right: var(--thin-border);
        border-bottom: var(--thick-border);
    }

    .nav-button-box {
        display: flex;
        align-items: center;
        padding: 0 1.5rem;
        height: 100%;
    }

    .nav-button-box:hover {
        border-left: var(--thin-border);
    }

    .nav-button {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        width: 30px;
    }

    .nav-line {
        background-color: var(--black);
        height: var(--nav-button-line);
        transition: 200ms ease-in-out;
    }

    .nav-line:nth-child(2) {
        margin: 0.5rem 0;
    }

    .nav-item-box {
        position: absolute;
        top: var(--nav-height);
        width: 100%;
        border-right: none;
        text-align: center;
    }

    .nav-item {
        overflow: hidden;
        height: 0;
        padding: 0;
        border: 0;
    }

    #nav-toggle:checked ~ .nav-item-box {
        border-bottom: 1px solid var(--black);
    }

    #nav-toggle:checked ~ .nav-item-box .nav-item {
        height: 4rem;
        border-bottom: var(--thin-border);
        background-color: var(--beige);
        transition: height 400ms cubic-bezier(0.23, 1, 0.32, 1);
    }

    #nav-toggle:checked ~ .nav-item-box .nav-item:hover {
        background-color: var(--green);
    }

    #nav-toggle:checked ~ .nav-item-box .nav-item:active {
        background-color: var(--green-darker);
    }

    #nav-toggle:checked + .nav-button-box {
        background-color: var(--green);
        border-left: var(--thin-border);
    }

    #nav-toggle:checked + .nav-button-box .nav-line:nth-child(2) {
        margin: 0;
        background-color: rgba(255, 255, 255, 0);
    }

    #nav-toggle:checked + .nav-button-box .nav-line:nth-child(1) {
        transform: rotate(45deg);
        translate: 0 calc(var(--nav-button-line) + var(--nav-button-line));
    }

    #nav-toggle:checked + .nav-button-box .nav-line:nth-child(3) {
        transform: rotate(45deg);
        transform: rotate(-45deg);
    }

}

/* Hero Section */

#hero {
    margin-top: 8rem;
    margin-bottom: 14rem;

    @media (width < 650px) {
        margin-top: var(--nav-height);
    }
}

.hero-box {
    display: flex;
    align-items: center;
    gap: 6rem;
    margin-bottom: 10rem;
}

.hero-arrow::before {
    content: "→ ";
    vertical-align: 1.5px;
}

.hero-image {
    max-width: 400px;
}

.index-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
}

.index-item > .subtitle {
    margin-bottom: 0.25rem;
}

.index-title {
    font-style: italic;
    margin-bottom: 1.5rem;
}


@media (width < 950px) {
    #hero {
        margin-bottom: 8rem;
    }

    .hero-box {
        flex-direction: column;
        margin-bottom: 8rem;
    }

    .hero-arrow::before {
        content: "↓ ";
        font-size: 0.90em;
        vertical-align: 3px;
    }

    .index-box {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
        gap: 3rem;
    }

}

/* Overview Section */

#overview .sub-heading-box::before {
    flex: 1;
}

.overview-para-box {
    max-width: 800px;
    margin: 3rem auto 6rem;
}

.overview-diagram-box {
    max-width: 1000px;
    margin: 8rem auto 0;
    display: grid;
    column-gap: 2rem;
    grid-template-columns: 150px auto auto 100px 100px auto 180px auto ;
    grid-template-rows: 180px 300px auto;
    grid-template-areas: 
    "o-step-a o-step-a o-diagram o-diagram o-diagram o-diagram . ."
    ". . o-diagram o-diagram o-diagram o-diagram o-step-b o-step-b"
    ". . . o-step-c o-step-c . . .";
}

.overview-letter {
    display: none;
}

.overview-diagram {
    grid-area: o-diagram;
    max-width: 500px;
}

.overview-step-a {
    grid-area: o-step-a;
    padding-top: 1rem;
}

.overview-step-b {
    grid-area: o-step-b;
}

.overview-step-c {
    grid-area: o-step-c;
}

@media (950px <= width < 1200px) {
    .overview-diagram-box {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        column-gap: 6rem;
        row-gap: 1rem;
        grid-template-areas: 
        "o-diagram o-step-a"
        "o-diagram o-step-b"
        ". o-step-c";
    }

    .overview-diagram {
        max-width: 450px;
    }

    .overview-letter {
        display: inline;
    }
}

@media (width < 950px) {
    .overview-para-box {
        margin-bottom: 4rem;
    }

    .overview-diagram-box {
        display: block;
        margin-top: 6rem;
    }

    .overview-diagram {
        max-width: 450px;
        margin: 0 auto;
    }

    .overview-letter {
        display: inline;
    }

    .overview-step-a,
    .overview-step-b,
    .overview-step-c {
        max-width: var(--content-narrow);
        margin: 3rem auto;
    }
}

/* Services Section */

.services-info-box {
    display: flex;
    gap: 8rem;
    margin-bottom: 6rem;
}

.services-info,
#services .sub-heading-box::before {
    flex: 1;
}

.services-diagram-box {
    margin-top: 6rem;
    display: grid;
    grid-template-columns: 440px auto;
    column-gap: 3rem;
    grid-template-areas: 
        "s-diagram s-step-a"
        "s-diagram s-step-b"
        ". s-step-c"
}

.services-diagram-box h4 {
    line-height: 0;
    margin-bottom: 2rem;
}

.services-diagram {
    grid-area: s-diagram;
}

.services-step-a {
    grid-area: s-step-a;
}

.services-step-b {
    grid-area: s-step-b;
}

.services-step-c {
    grid-area: s-step-c;
}

.custom-services-box {
    margin-top: 4rem;
}

.custom-text-box {
    max-width: 600px;
    margin: 4rem auto 0;
}

@media (950px <= width < 1100px) {
    .services-diagram-box {
        grid-template-columns: auto;
        column-gap: 6rem;
        row-gap: 4rem;
    }
}

@media (width < 950px) {
    .services-info-box {
        flex-direction: column;
        gap: 2rem;
    }

    .services-text-box {
        max-width: var(--content-narrow);
        margin: 0 auto;
    }

    .services-diagram-box {
        display: block;
    }

    .services-diagram {
        max-width: 450px;
        margin: 0 auto 6rem;
    }

    .services-step-a,
    .services-step-b,
    .services-step-c {
        max-width: var(--content-narrow);
        margin: 4rem auto;
    }

    .custom-text-box {
        margin-top: 2rem
    }
}

/* Approach Section */

.approach-item-box {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 8rem;
}

.approach-illustration {
    border: var(--thin-border);
    padding: 3.5rem;
    flex: 0.5;
    max-width: 450px;
}

.approach-text-box {
    flex: 1;
}

.approach-para-box {
    padding: 0 4rem;
}

@media (width < 950px) {
    .approach-item-box {
        flex-direction: column;
        max-width: var(--content-narrow);
        align-items: center;
        margin: 6rem auto
    }

    .swap-order {
        order: 0;
    }

    .approach-illustration {
        max-width: 400px;
    }

    .approach-text-box .sub-heading-box {
        margin: 0;
    }

    .approach-text-box .sub-heading-box::before {
        flex: 1;
    }

    .approach-para-box {
        margin-top: 2rem;
        padding: 0;
    }

    .approach-connector {
        height: 2rem;
        background-color: var(--black);
        position: relative;
        top: 0;
        left: 50%;
        width: 2px;
    }
}

/* About Section */

.about-box {
    display: flex;
    gap: 8rem;
    align-items: flex-start;
    justify-content: center;
    margin-top: 6rem;
    margin-bottom: 12rem;
}

.about-image {
    max-width: 350px;
    flex: 0.8;
}

.about-text-box {
    margin-top: 4rem;
    flex: 1;
}

.about-text-box h3 {
    margin-bottom: 0.25rem;
}

.about-pronouns {
    font-style: italic;
}

@media (width < 950px) {
    .about-box {
        flex-direction: column;
        gap: 2rem;
        align-items: center;
        margin: 0 auto 6rem;
        max-width: var(--content-narrow);
    }
}

/* Contact Section */

.contact-box {
    display: flex;
    align-items: center;
    gap: 6rem;
}

.contact-illustration {
    max-width: 500px;
}

p.contact-method {
    margin-bottom: 0.5rem;
}

@media (width < 950px) {
    .contact-box {
        flex-direction: column;
        max-width: var(--content-narrow);
        margin: 0 auto;
    }
}

/* Credits Page */

.page-box {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#main-credits {
    flex: 1;
}

#credits-info > .content-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content
}

.credits-title-box {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 6rem 0;
    width: 100%;
    text-align: center;
}

.credits-title-line {
    flex: 1;
}

.credits-nav {
    font-style: italic;
    text-align: center;
}

.credits-info {
    margin-top: 6rem;
    border: var(--thin-border);
    padding: 4rem;
    display: grid;
    grid-template-columns: 200px 1fr;
    row-gap: 2rem;
    column-gap: 2rem;
}

.design-info > p {
    margin-bottom: 0.5rem;
}

@media (width < 800px) {
    .credits-info {
        display: block;
    }

    p.credits-item {
        margin-bottom: 3rem;
    }
}