
/* ========================================
   SHARED SITE STYLES
   ======================================== */

:root {
    --colour-cream: #fff5df;
    --colour-olive: #82743b;
    --colour-dark: #49412d;
    --colour-black: #171717;
    --colour-accent: #1768b2;
    --font-body: Arial, Helvetica, sans-serif;
    --font-display: Georgia, "Times New Roman", serif;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 5%;
    background: var(--colour-cream);
}

.site-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: min(1100px, 90%);
    height: 1px;
    background: var(--colour-olive);
    opacity: 0.6;
    transform: translateX(-50%);
}

.main-nav {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 28px;
    min-width: 0;
}

.nav-group--left {
    justify-content: flex-end;
    padding-right: 68px;
}

.nav-group--right {
    justify-content: flex-start;
    padding-left: 68px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    color: var(--colour-olive);
    font-family: "Playfair Display", serif;
    font-size: 25px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.25s ease;
}

.nav-link:hover {
    opacity: 0.65;
}

.nav-logo {
    display: grid;
    place-items: center;
    justify-self: center;
    box-sizing: border-box;
    width: 60px;
    height: 60px;
    border: 1px solid var(--colour-olive);
    border-radius: 50%;
    color: var(--colour-olive);
    font-family: var(--font-display);
    font-size: 29px;
    font-style: italic;
    text-decoration: none;
    transition: color 0.25s ease, background-color 0.25s ease;
}

.nav-logo:hover {
    color: var(--colour-cream);
    background: var(--colour-olive);
}

* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--colour-cream);
    color: var(--colour-dark);
    font-family: var(--font-body);
}

/* Shared case-study page container */
.case-study-page {
    width: min(1100px, 90%);
    margin: 0 auto;
    padding: clamp(55px, 8vw, 105px) 0 70px;
    color: var(--colour-black);
}

a {
    color: inherit;
    text-decoration: none;
}

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

button,
input,
textarea {
    font: inherit;
}

.work-page-footer {
    min-height: 90px;
    padding: 24px 7%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-top: 1px solid rgba(73, 65, 45, 0.2);
    font-size: 10px;
    letter-spacing: 0.12em;
}

.work-page-footer a:first-child {
    font-family: "Playfair Display", var(--font-display);
    font-size: 17px;
    letter-spacing: 0;
}

.work-page-footer p {
    margin: 0;
    text-align: center;
}

.work-page-footer .about-socials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.work-page-footer .about-socials a {
    display: block;
    width: 20px;
    height: 20px;
}

.work-page-footer .about-socials img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.icon-credits {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 5% 18px;
    border-top: 1px solid rgba(73, 65, 45, 0.3);
}

.icon-credits-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: var(--colour-dark);
    font-size: 9px;
    line-height: 1.5;
    opacity: 0.75;
}

.icon-credits-title {
    margin: 0;
    color: var(--colour-olive);
    font-size: 9px;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

.icon-credits > p:not(.icon-credits-title) {
    margin: 0;
}

.icon-credits a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ========================================
   MAIN NAVIGATION HOVER UNDERLINE
   ======================================== */

.nav-link {
    position: relative;
    text-decoration: none;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 1px;
    background: var(--colour-olive);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
    transform: scaleX(1);
}

/* ========================================
   MOBILE NAVIGATION DROPDOWN
   ======================================== */

.mobile-nav {
    display: none;
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    list-style: none;
}

.mobile-nav-toggle::-webkit-details-marker {
    display: none;
}

.mobile-nav-toggle span {
    display: block;
    width: 24px;
    height: 1.7px;
    background: var(--colour-olive);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-nav[open] .mobile-nav-toggle span:first-child {
    transform: translateY(6.5px) rotate(45deg);
}

.mobile-nav[open] .mobile-nav-toggle span:nth-child(2) {
    opacity: 0;
}

.mobile-nav[open] .mobile-nav-toggle span:last-child {
    transform: translateY(-6.5px) rotate(-45deg);
}

.mobile-nav-dropdown {
    position: absolute;
    top: calc(100% + 18px);
    left: 0;
    display: flex;
    flex-direction: column;
    min-width: 170px;
    padding: 12px 20px;
    background: var(--colour-cream);
    border: 1px solid var(--colour-olive);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.mobile-nav-dropdown a {
    padding: 12px 0;
    color: var(--colour-olive);
    font-family: "Playfair Display", serif;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-decoration: none;
    border-bottom: 1px solid rgba(130, 116, 59, 0.2);
}

.mobile-nav-dropdown a:last-child {
    border-bottom: none;
}

.mobile-nav-dropdown a:hover {
    opacity: 0.6;
}

/* ========================================
   TABLET AND MOBILE NAVIGATION
   ======================================== */

@media (max-width: 768px) {
    .site-header {
        position: sticky;
        z-index: 100;
    }

    .main-nav {
        display: flex;
        justify-content: center;
        position: relative;
        min-height: 60px;
    }

    .nav-group--left,
    .nav-group--right {
        display: none;
    }

    .nav-logo {
        flex-shrink: 0;
    }

    .mobile-nav {
        display: block;
    }
}

/* ========================================
   LOADING SCREEN
   ======================================== */

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    background: var(--colour-cream);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.loading-emblem {
    position: relative;
    width: 190px;
    height: 190px;
    color: var(--colour-olive);
}

.loading-emblem svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    animation: loading-rotate 18s linear infinite;
}

.loading-emblem text {
    fill: currentColor;
    font-family: var(--font-body);
    font-size: 13px;
    letter-spacing: 2.5px;
}

.loading-logo {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 55px;
    font-style: italic;
}

.loading-spinner {
    width: 25px;
    height: 25px;
    border: 1px solid rgba(130, 116, 59, 0.2);
    border-top-color: var(--colour-olive);
    border-radius: 50%;
    animation: loading-rotate 0.9s linear infinite;
}

@keyframes loading-rotate {
    to {
        transform: rotate(360deg);
    }
}

/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
    .loading-emblem,
    .loading-spinner {
        animation: none;
    }

    .loading-screen {
        transition: none;
    }
}