/*==================================================
    Variables
==================================================*/
:root {
    --ff-primary: "Figtree", "Raleway", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --fs-base: 1.8rem;
    --lh-base: 1.6;
    --clr-text: #151924;
    --clr-link: #2497d8;
    --clr-link-hover: #055f90;
    --clr-light-bg: #FEFAF2;
    --clr-alt-bg: #f5f5f5;
    --clr-muted: #666;
    --clr-muted-alt: #858da5;
    --clr-logos-text: #999;
    --clr-white: #fff;
    --clr-date: #bebebe;
    --clr-border: #ddd;
    --clr-divider-alt: #fff;
}

/*==================================================
    Reset & Base
==================================================*/
*, *::before, *::after {
    box-sizing: border-box;
}
html {
    font-size: 62.5%; /* 1rem = 10px */
    height: 100%;
    margin: 0;
}
body {
    margin: 0;
    font: 300 var(--fs-base)/var(--lh-base) var(--ff-primary);
    color: var(--clr-text);
    min-height: 100%;
}

/*==================================================
    Utilities
==================================================*/
.hidden,
.skip-link {
    display: none;
}

/*==================================================
    Grid & Layout
==================================================*/
.wrapper {
    margin: 0 auto;
    padding: 0 3rem;
    grid-template-columns: 1fr;
}
.wrapper > * {
    grid-column: span 8;
}
.wrapper > .contact-deets {
    grid-column: 10 / span 3;
}
.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-6  { grid-column: span 6; }
.col-8  { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/*==================================================
    Typography
==================================================*/
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1.5rem;
    font-family: var(--ff-primary);
    font-weight: 800;
    line-height: 1.3;
}
h1 { font-size: 4.5rem; margin: 0 0 2.5rem; }
h2 { font-size: 3rem; }
h3 { font-size: 2.2rem; }
h4 { font-size: 1.9rem; }

p {
    margin-top: 0;
    margin-bottom: 2rem;
    font-size: 1.9rem;
}

span.pre-head {
    display: block;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}
span.divider {
    display: block;
    width: 50px;
    height: 2px;
    background: var(--clr-text);
    margin-bottom: 2.5rem;
}

/* section-specific overrides */
.home .about span.divider,
footer span.divider {
    background: var(--clr-divider-alt);
}
.home .about span.pre-head,
footer span.pre-head {
    color: var(--clr-white);
}

/*==================================================
    Links & Buttons
==================================================*/
a,
.button {
    color: var(--clr-link);
    text-decoration: none;
}
a:hover,
.button:hover {
    color: var(--clr-link-hover);
    text-decoration: underline;
}
.button,
a.button {
    color: var(--clr-text);
    height: 44px;
    line-height: 44px;
    font-size: 1.2rem;
    text-decoration: none;
}
.button:hover,
a.button:hover {
    color: var(--clr-link);
}
section.about a.button,
section.about .button {
    color: var(--clr-muted-alt);
    text-decoration: none;
    border: 1px solid var(--clr-muted-alt);
}
section.about a.button:hover,
section.about .button:hover {
    color: var(--clr-white);
    border: 1px solid var(--clr-logos-text);
}

/*==================================================
    Lists & Meta
==================================================*/
ul {
    list-style: circle outside;
    padding-left: 2rem;
}
ul ul {
    margin-left: 0;
    font-size: 100%;
}
ol.thoughts-list,
ol.work-history {
    list-style: none;
    padding-left: 0;
}
.post-metadata {
    list-style: none;
}

/*==================================================
    Images & Figures
==================================================*/
img,
figure img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 1rem;
}
figure {
    margin: 5rem 0;
    width: 100%;
}
figcaption {
    color: var(--clr-muted);
    font-size: 1.4rem;
    font-weight: 300;
}

/*==================================================
    Sections & Backgrounds
==================================================*/
header,
section,
footer {
    padding: 10rem 0;
    margin: 0;
}
header {
    background: var(--clr-light-bg);
    color: var(--clr-text);
}
.home header {
    background: var(--clr-white);
}
header .wrapper {
    padding: 5rem 3rem;
}

section.work,
section.newsletter {
    background: var(--clr-light-bg);
}
section.approach,
section.case-studies {
    background: var(--clr-alt-bg);
}

section.about,
section#contact-form,
.about .section_4 {
    background: var(--clr-text);
    background-image: none;
    color: var(--clr-muted-alt);
}
section#contact-form {
    color: var(--clr-white);
}
section.about h2,
.about .section_4 h2 {
    color: var(--clr-white);
}

.about .section_0 {
    background: var(--clr-white) url("/img/background-images/bm.jpg") 50% 100% no-repeat;
    padding-bottom: 75rem;
}
.about .section_1 {
    background: var(--clr-alt-bg) url("/img/background-images/Thirst-Studios-2017.jpg") 50% 100% no-repeat;
    padding-bottom: 75rem;
}

section.logos {
    padding: 7rem 0;
    background: var(--clr-white);
    color: var(--clr-logos-text);
}
section.logos .wrapper {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
}
section.logos .wrapper .col-2 {
    grid-column: span 4;
}

footer {
    background: var(--clr-text);
    color: var(--clr-muted-alt);
    padding-bottom: 5rem;
}
footer h2 {
    color: var(--clr-white);
}
footer a {
    color: var(--clr-white);
    text-decoration: none;
}
footer a:hover {
    color: var(--clr-link);
}
footer ul {
    list-style: none;
    font-size: 1.9rem;
    padding: 0;
}
footer ul li {
    float: left;
    margin-right: 1.5rem;
}
footer .footer-lower {
    clear: both;
    padding: 2rem 0;
}
footer .footer-lower p {
    font-size: 1.7rem;
}

/*==================================================
    Containers
==================================================*/
ul.work_items {
    list-style: none;
    padding-left: 0;
    grid-template-columns: 1fr;
}
ul.work_items li.work-item {
    grid-column: span 4;
    margin-top: 3rem;
}

/*==================================================
    Navigation
==================================================*/
#navbar {
    font-family: var(--ff-primary);
    padding: 2.5rem 0;
    position: relative;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(4px);
    z-index: 1;
    font-weight: 400;
}
#navbar .wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
#navbar.opened {
    height: 100vh;
    background: var(--clr-text);
}
#navbar.opened,
#navbar.opened .logo a {
    color: var(--clr-white);
}

.nav-links,
#navbar ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 1.7rem;
}
.nav-links li {
    margin: 0 15px;
}
#navbar a,
.nav-links a {
    text-decoration: none;
    color: var(--clr-text);
}
#navbar a:hover,
.nav-links a:hover {
    color: var(--clr-link);
}

.logo {
    margin: 0;
}
.logo a {
    font-weight: 700;
    font-size: 2.6rem;
    text-decoration: none;
    color: var(--clr-text);
}

/* Mobile Navigation */
button.mobile-nav-button {
    display: block;
    background: transparent;
    border: 1px solid #1d2939;
    color: #1d2939;
    margin: 0;
    height: 4.2rem;
}
#navbar.opened button.mobile-nav-button {
    border: 1px solid var(--clr-white);
    color: var(--clr-white);
}
#mobile-nav-links {
    display: none;
}
#navbar #mobile-nav-links li {
    margin-top: 2rem;
    text-align: right;
}
#navbar #mobile-nav-links li a {
    color: var(--clr-white);
    font-size: 3rem;
}
.mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.desktop-nav {
    display: none;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
#mobile-nav-links.menu-visible li {
    opacity: 0;
    animation: fadeIn 0.5s cubic-bezier(.48, .43, .56, .82) forwards;
}

/*==================================================
    Blog & Work
==================================================*/
.thoughts .post {
    background: var(--clr-white);
    padding: 30rem 0 5rem;
}
.thoughts .post h1 {
    margin-bottom: 0;
}
.thoughts .post .article-header {
    margin-bottom: 5rem;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 3rem;
    grid-column: span 12;
}
.thoughts .post .article-header h1, 
.thoughts .post .article-header p {
    grid-column: span 8;
}
section.article-nav {
    padding-top: 0;
}
section.article-nav p {
    font-weight: 500;
}
section.article-nav .content {
    border-top: 1px solid #f2f2f2;
    padding-top: 5rem;
    display: flex;
    justify-content: space-between;
    grid-column: span 12;
}
.date {
    color: var(--clr-date);
    margin-bottom: 0;
    font-size: 1.7rem;
}
.thoughts .post p.date figure {
    margin-top: 0;
}

ol.thoughts-list h3,
ol.work-history h3 {
    margin-bottom: 1rem;
}
ol.work-history h4 {
    margin-bottom: 0.5rem;
}
ol.work-history .date {
    margin-bottom: 1rem;
}
ol.thoughts-list li,
ol.work-history li {
    padding-top: 2rem;
    border-top: 1px solid var(--clr-border);
    margin-top: 2rem;
}
ol.thoughts-list li:first-child,
ol.work-history li:first-child {
    border-top: none;
    margin-top: 0;
}
.thoughts .post p + h2 {
    margin-top: 2rem;
}
.thoughts .post p + h3 {
    margin-top: 1.5rem;
}

.back-link a {
    font-size: 2.2rem;
    text-decoration: none;
}

/* Next/Prev Links */
ol.links-nextprev,
ul.links-nextprev {
    list-style: none;
    display: flex;
    justify-content: space-between;
    margin-top: 10rem;
}
ul.links-nextprev li {
    width: 45%;
}
span.link-title {
    color: #ccc;
    font-size: 1.4rem;
    text-transform: uppercase;
    font-weight: 500;
}

.article-header figure, figure.wide {
    grid-column: span 12;
}
.article-header figure {
    margin: 0;
}

/*==================================================
    Substack Form
==================================================*/
.custom-substack-widget {
    box-sizing: border-box;
    flex-direction: column !important;
    align-items: stretch !important;
    max-width: 100% !important;
}
.custom-substack-widget .csw-container {
    display: flex;
    gap: 8px;
}
.custom-substack-widget button,
.custom-substack-widget input {
    border: 1px solid var(--clr-text) !important;
    box-sizing: border-box;
}
.custom-substack-widget button {
    flex: 0 0 auto;
    background: #f2ece0 !important;
    font-size: 1.2rem !important;
}
.custom-substack-widget input {
    color: var(--clr-text) !important;
    flex: 1 1 auto !important;
}
.custom-substack-widget input::placeholder {
    color: #999 !important;
}

/*==================================================
    404 Page
==================================================*/
html#fourofour {
    height: 100%;
    margin: 0;
}
#fourofour body {
    background: var(--clr-white) url("/img/background-images/fugazi.jpg") 0 0 no-repeat;
    background-size: cover;
    height: 100%;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
#fourofour .centre-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: none;
}
#fourofour .content {
    background: rgba(255, 255, 255, 0.85);
    padding: 5rem 8rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    text-align: center;
    font-weight: 400;
}
#fourofour a.button {
    background: var(--clr-link);
    color: var(--clr-white);
    border: none;
    height: 48px;
    line-height: 48px;
}

/*==================================================
    Media Queries
==================================================*/
@media (min-width: 750px) {
    h1 { font-size: 6rem; }
    h2 { font-size: 3.5rem; }
    h3 { font-size: 2.8rem; }
    h4 { font-size: 2.2rem; }

    header .wrapper {
        padding: 25rem 3rem 15rem;
    }
    section,
    footer {
        padding: 15rem 0;
    }
    footer {
        padding: 15rem 0 10rem;
    }
    .mobile-nav {
        display: none;
    }
    .desktop-nav {
        display: flex;
    }
    #navbar {
        position: fixed;
    }
    #navbar .wrapper {
        align-items: center;
    }
    .newsletter-form-container {
        margin: 5rem 0 0 0;
        max-width: 55rem;
    }
    .custom-substack-widget {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
}

@media (min-width: 1000px) {
    footer .footer-lower {
        grid-column: span 12;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
    }
    section.logos .wrapper .col-2 {
        grid-column: span 2;
    }
    ul.work_items {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        gap: 3rem;
    }
    .wrapper {
        grid-template-columns: repeat(12, 1fr);
        display: grid;
        gap: 0 3rem;
        max-width: 120rem;
    }
}

@media (min-width: 1200px) {
    section.about {
        background: var(--clr-text) url("/img/background-images/bt-cutout.png") 55vw 100% no-repeat;
    }
}