:root {
    --color-bg: #FFFFFF;
    --color-text: #444444;
    --color-text-light: #444444;
    --color-border: #444444;
    --font-primary: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --spacing-layout: 8vw;
    --transition-speed: 0.5s;
}

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

strong, b {
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--spacing-layout);
}

.flush-left {
    padding-left: var(--spacing-layout);
    padding-right: var(--spacing-layout);
}

@media (min-width: 1440px) {
    .flush-left {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

body>header {
    padding: 3vh 0 3vh;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

body>header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Centred logo */
.header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.header-logo img {
    height: 36px;
    width: auto;
    display: block;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
}

/* ── Hamburger button (mobile only) ─────────────────────────── */
.burger-btn {
    display: none;
    position: absolute;
    top: 50%;
    right: var(--spacing-layout);
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1100;
    flex-direction: column;
    gap: 5px;
}

.burger-btn span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--color-text);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.burger-btn.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger-btn.is-open span:nth-child(2) { opacity: 0; }
.burger-btn.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Mobile nav links panel (full-screen overlay) ───────────── */
.nav-mobile-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(250, 250, 248, 0.95);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    padding: 5rem var(--spacing-layout) 2rem;
    flex-direction: column;
    gap: 0;
    z-index: 1040;
    overflow-y: auto;
    animation: overlay-in 0.25s ease;
}

@keyframes overlay-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nav-mobile-panel.is-open {
    display: flex;
}

/* Case study sub-links */
.nav-mobile-panel a {
    display: block;
    padding: 0.7rem 0;
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: color 0.2s;
}

.nav-mobile-panel a:hover { color: var(--color-text); }

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

/* Section titles (Case Studies / Contact/About / Thoughts on Design) */
.nav-mobile-panel__heading {
    display: block;
    padding: 1.4rem 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--color-text);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    letter-spacing: 0;
    text-transform: none;
}

.nav-mobile-panel__heading:first-child {
    padding-top: 0.5rem;
}

/* Indented case-study links */
.nav-mobile-panel .case-study-link {
    padding-left: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* Titles that are also links (Contact/About, Thoughts on Design) */
a.nav-mobile-panel__heading {
    text-decoration: none;
    color: var(--color-text);
    font-size: 1.05rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    padding: 1.2rem 0 1.2rem;
    transition: opacity 0.2s;
}

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

h1 {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
}

h1 a {
    color: var(--color-text);
    text-decoration: none;
}

nav a {
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
    color: var(--color-text);
}

/* ── Nav Dropdown ────────────────────────────────────────────── */
.nav-dropdown {
    position: relative;
}

.nav-dropdown__trigger {
    background: none;
    border: none;
    padding: 0;
    padding-top: 3px;
    cursor: pointer;
    color: var(--color-text-light);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-dropdown__trigger:hover,
.nav-dropdown__trigger.active {
    color: var(--color-text);
}

.nav-dropdown__arrow {
    display: inline-flex;
    align-items: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

/* The up-arrow icon, hidden by default */
.nav-dropdown__arrow--up {
    display: none;
}

/* On hover/open: hide down, show up */
.nav-dropdown:hover .nav-dropdown__arrow--down,
.nav-dropdown.is-open .nav-dropdown__arrow--down {
    display: none;
}

.nav-dropdown:hover .nav-dropdown__arrow--up,
.nav-dropdown.is-open .nav-dropdown__arrow--up {
    display: inline-flex;
}

.nav-dropdown__menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 320px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 0.5rem 0;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 200;
}

/* Invisible bridge fills the gap between trigger and menu so hover stays active */
.nav-dropdown__menu::before {
    content: '';
    position: absolute;
    top: -0.8rem;
    left: 0;
    right: 0;
    height: 0.8rem;
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown.is-open .nav-dropdown__menu {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown__menu li {
    display: block;
}

.nav-dropdown__menu a {
    display: block;
    padding: 0.55rem 1.25rem;
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.4;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-dropdown__menu a:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.03);
}

/* ── Mobile nav layout (<768px) ─────────────────────────────── */
@media (max-width: 767px) {
    body>header .container {
        flex-wrap: wrap;
        align-items: center;
        position: relative;
    }

    /* Hide entire nav on mobile (Case Studies goes into burger panel) */
    nav {
        display: none;
    }

    .burger-btn {
        display: flex;
    }

    /* Show logo centred on mobile */
    .header-logo {
        display: flex;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        pointer-events: none;
    }
}

@media (min-width: 768px) {
    body>header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }

    nav {
        gap: 2.5rem;
    }

    .burger-btn { display: none !important; }
    .nav-mobile-panel { display: none !important; }
}

#hero {
    padding-top: 5vh;
    padding-bottom: 10vh;
    text-align: center;
}

#hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.2;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#hero p {
    font-size: 1.5rem;
    color: var(--color-text-light);
    font-weight: 400;
    max-width: 720px;
    line-height: 1.7;
    margin-left: auto;
    margin-right: auto;
}

.work-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8vh 4vw;
    padding-bottom: 10vh;
}

.work-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.image-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background-color: #FAFAFA;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.work-item a:hover .image-wrapper img {
    transform: scale(1.04);
}

.work-content {
    transition: opacity 0.3s;
}

.work-item h3 {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.work-item p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 400;
}

footer {
    padding: 12vh 0 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

footer .back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--color-bg);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

footer .back-to-top.show {
    opacity: 0.9;
    pointer-events: auto;
    visibility: visible;
}

footer .back-to-top:hover {
    color: var(--color-text-light);
    transform: translateY(-2px);
    opacity: 1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* Section Headers */
.section-header {
    margin: 4vh 0 6vh;
    padding-top: 4vh;
    border-top: 1px solid var(--color-border);
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-text-light);
    letter-spacing: 0.05em;
}

/* Tablet and beyond */
@media (min-width: 768px) {
    .work-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop for 3 columns */
@media (min-width: 1024px) {
    .work-grid.other {
        grid-template-columns: repeat(3, 1fr);
        gap: 6vh 3vw;
    }

    .work-grid.other h3 {
        font-size: 1rem;
    }

    .work-grid.other p {
        font-size: 0.85rem;
    }
}

.cs-link {
  color: #009EE2;
  text-decoration: none;
  font-weight: 500;
}

.cs-link:hover {
  text-decoration: underline;
}

.contact-links a {
  color: #009EE2;
  text-decoration: none;
  font-weight: 500;
}

.contact-links a:hover {
  text-decoration: underline;
}
p { text-wrap: pretty; }

@media (max-width: 767px) {
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}
