:root {
    --c-hero: #4653ff;
    --c-page: #fafaf8;
    --c-text: #111111;
    --c-light: #f0f0ee;
    --c-border: #d4d4d0;
    --c-white: #ffffff;
    --c-gray-light: #999999;
    --c-gray-dark: #555555;

    --f-heading: 'Zen Antique', serif;
    --f-body: 'Inter', sans-serif;

    --pad-x: 5vw;
    --pad-y: 180px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--f-body);
    color: var(--c-text);
    background-color: var(--c-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
    /* SVG noise via feTurbulence */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography Defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--f-heading);
    font-weight: 400;
}

a {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

ul {
    list-style: none;
}

/* Base Interactions Lift */
a:not(.btn-pill):not(.nav-logo),
button {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

a:not(.btn-pill):not(.nav-logo):not(.contact-email):hover {
    transform: translateY(-1px);
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px var(--pad-x);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 80;
    color: var(--c-white);
    transition: color 0.3s ease;
    pointer-events: auto;
}

.nav.nav-scrolled {
    color: var(--c-text);
}

.nav-left,
.nav-center,
.nav-right {
    flex: 1;
}

.nav-center {
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: opacity 0.2s ease;
}

.nav-right {
    display: flex;
    justify-content: flex-end;
}

.nav-logo {
    font-family: var(--f-heading);
    font-size: 26px;
    opacity: 0;
    color: var(--c-white);
    transition: opacity 0.2s ease, color 0.3s ease;
    white-space: nowrap;
}

.nav.nav-scrolled .nav-logo {
    color: var(--c-hero);
}

/* Pill Button */
.btn-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    color: var(--c-white);
    cursor: pointer;
    z-index: 1;
    transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-pill .btn-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Over the blue hero the fill is white (text turns blue on hover) */
    background-color: var(--c-white);
    transform: translateX(-101%);
    transition: transform 0.3s cubic-bezier(0.45, 0, 0.55, 1);
    z-index: -1;
}

.btn-pill:hover {
    transform: scale(1.03) translateY(-1px);
    border-color: var(--c-white);
    color: var(--c-hero) !important;
}

.btn-pill:hover .btn-bg {
    transform: translateX(0);
}

/* When over the white background: fill flips to blue, text to white */
.nav.nav-scrolled .btn-pill {
    border-color: var(--c-border);
    color: var(--c-text);
}

.nav.nav-scrolled .btn-pill .btn-bg {
    background-color: var(--c-hero);
}

.nav.nav-scrolled .btn-pill:hover {
    border-color: var(--c-hero);
    color: var(--c-white) !important;
}

/* The Flying Wordmark */
.hero-wordmark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--f-heading);
    font-size: clamp(72px, 12vw, 160px);
    color: white;
    z-index: 90;
    white-space: nowrap;
    will-change: transform, color, opacity;
    pointer-events: none;
    transform-origin: center center;
}

/* Section Shared */
section {
    padding: var(--pad-y) var(--pad-x);
    position: relative;
}

.section-label-container {
    display: flex;
    align-items: center;
    margin-bottom: 60px;
    opacity: 0;
}

.section-line {
    width: 48px;
    height: 1px;
    background-color: var(--c-border);
    margin-right: 16px;
}

.section-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* Section: Hero */
.section-hero {
    height: 100vh;
    background-color: var(--c-hero);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding-bottom: 40px;
}

.scroll-indicator {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-white);
    opacity: 0.8;
}

/* Section: What We Do */
.section-what-we-do {
    background-color: var(--c-white);
}

.intro-block {
    max-width: 960px;
    margin-bottom: 100px;
}

.intro-block h2 {
    font-size: clamp(36px, 6vw, 84px);
    line-height: 1.1;
    margin-bottom: 24px;
}

.intro-block p {
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 300;
    color: var(--c-gray-dark);
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--c-border);
}

.pillar {
    padding: 40px 32px 48px 0;
    border-right: 1px solid var(--c-border);
}

.pillar:last-child {
    border-right: none;
    padding-right: 0;
}

/* Desktop: even breathing room on both sides of each column divider */
@media (min-width: 1025px) {
    .pillar {
        padding-left: 32px;
    }

    .pillar:first-child {
        padding-left: 0;
    }
}

.pillar h3 {
    font-family: var(--f-body);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pillar ul li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.75;
    color: var(--c-gray-dark);
}

.pillar ul li::before {
    content: "—";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--c-gray-light);
    font-size: 11px;
}

/* Section: Who We Do It For */
.section-who {
    background-color: var(--c-light);
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
    justify-items: center;
}

.client-logo {
    height: 70px;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.client-logo:hover {
    filter: grayscale(0%) !important;
    opacity: 1 !important;
    transform: translateY(-2px) scale(1.05) !important;
}

/* Section: Contact */
.section-contact {
    background-color: var(--c-white);
    padding: 240px var(--pad-x);
    text-align: center;
}

.section-contact h2 {
    font-size: clamp(56px, 10vw, 140px);
    letter-spacing: -0.02em;
    margin-bottom: 30px;
}

.contact-email {
    font-size: clamp(28px, 4vw, 56px);
    color: var(--c-hero);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.contact-email:hover {
    opacity: 0.7;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background-color: var(--c-text);
    color: var(--c-white);
    padding: 40px var(--pad-x);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --pad-y: 120px;
    }

    .pillars-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pillar {
        border-right: none;
        border-bottom: 1px solid var(--c-border);
    }

    .pillar:nth-child(even) {
        padding-left: 32px;
        padding-right: 0;
    }

    .pillar:nth-child(odd) {
        padding-right: 32px;
    }

    .pillar:last-child,
    .pillar:nth-last-child(2) {
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    :root {
        --pad-x: 6vw;
    }

    /* Hero title must fit on one line on narrow screens */
    .hero-wordmark {
        font-size: clamp(36px, 13vw, 72px);
    }

    .nav-center {
        display: none;
    }

    .pillars-grid {
        grid-template-columns: 1fr;
        border-top: none;
    }

    .pillar {
        padding: 32px 0;
        border-bottom: 1px solid var(--c-border);
    }

    .pillar:first-child {
        border-top: 1px solid var(--c-border);
    }

    .pillar:nth-child(even) {
        padding-left: 0;
    }

    .pillar:last-child {
        border-bottom: none;
    }

    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .client-logo {
        height: 50px;
    }

    .footer {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
}