/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:           #0a0a0a;
    --surface:      #111111;
    --border:       #1c1c1c;
    --text:         #f0eeeb;
    --muted:        #aaaaaa;
    --accent:       #cc2222;
    --nav-h:        68px;
    --max-w:        1100px;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body:    'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* =============================================
   UTILITY
   ============================================= */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 2rem;
}

.accent { color: var(--accent); }

/* Persistent heat glow fixed to viewport bottom — shows through all sections */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40vh;
    background: radial-gradient(ellipse 100% 100% at 50% 100%, rgba(90, 14, 3, 0.42) 0%, transparent 70%);
    pointer-events: none;
    z-index: 999;
    mix-blend-mode: screen;
}

/* =============================================
   NAVIGATION
   ============================================= */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;  /* above the fire canvas */
    transition: border-color 0.4s ease;
    border-bottom: 1px solid transparent;
}

/* Blur/tint lives on a pseudo-element, not #nav itself — backdrop-filter on
   #nav would make it the containing block for its position:fixed .nav-links
   descendant, collapsing the mobile menu to the nav bar's height. */
#nav::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

#nav.scrolled {
    border-bottom-color: var(--border);
}

#nav.scrolled::before {
    opacity: 1;
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    height: var(--nav-h);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.2s;
}

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

/* Mobile hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 110;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text);
    transition: transform 0.28s ease, opacity 0.28s ease;
    transform-origin: center;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* =============================================
   HERO
   ============================================= */
#hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-h) + 5rem) 2rem 7rem;
    position: relative;
    background: var(--bg);
}

#fire-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 1000;
    /* Screen blend: dark canvas areas vanish, fire particles glow luminously over any section */
    mix-blend-mode: screen;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--max-w);
    margin: 0 auto;
    width: 100%;
}

.hero-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2.5rem;
}

.hero-headline {
    font-family: var(--font-display);
    font-size: clamp(4rem, 11vw, 10rem);
    font-weight: 300;
    line-height: 0.95;
    letter-spacing: -0.045em;
    display: flex;
    flex-direction: column;
    margin-bottom: 3rem;
}

.hero-headline span {
    display: block;
}

.hero-sub {
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--muted);
    max-width: 420px;
    margin-bottom: 3.5rem;
    line-height: 1.75;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--accent);
    transition: color 0.2s, gap 0.25s;
}

.hero-cta::after {
    content: '→';
    transition: transform 0.25s;
}

.hero-cta:hover {
    color: var(--accent);
}

.hero-cta:hover::after {
    transform: translateX(4px);
}

/* =============================================
   SHARED SECTION STYLES
   ============================================= */
section:not(#hero) {
    padding: 9rem 0;
}

.section-label {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.75rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 300;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin-bottom: 2rem;
}

.section-body {
    font-size: 1rem;
    color: var(--muted);
    max-width: 540px;
    line-height: 1.85;
}

.section-body + .section-body {
    margin-top: 1.25rem;
}

/* =============================================
   SERVICES — PILLARS
   ============================================= */
.pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 5rem;
    border: 1px solid var(--border);
}

.pillar {
    padding: 3rem 2.5rem;
    background: var(--surface);
    border-right: 1px solid var(--border);
    transition: background 0.2s;
}

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

.pillar:hover {
    background: #161616;
}

.pillar h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.pillar p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.75;
}

/* =============================================
   WORK — CASE STUDIES
   ============================================= */
.case-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    margin-top: 5rem;
    background: var(--border);
    border: 1px solid var(--border);
}

.case {
    background: var(--surface);
    padding: 3rem 2.5rem;
    transition: background 0.2s;
}

.case:hover {
    background: #161616;
}

.case h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 2.25rem;
}

.case-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem 2.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stat-num {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Trusted-by logo strip */
.trusted-by {
    margin-top: 6rem;
    padding-top: 3.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.trusted-by p {
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 560px;
    margin: 0 auto 2.75rem;
    line-height: 1.75;
}

.logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
}

/* These logos were designed for white backgrounds, so their colour state
   still carries pale fill/fringe pixels that look harsh on pure black.
   A soft white wash behind the mark on hover gives it somewhere to sit,
   instead of that white showing up as a hard, isolated edge. */
.logo-glow {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.5rem;
}

.logo-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 70% at center, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.6) 40%, rgba(255, 255, 255, 0) 78%);
    filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.logo-glow:hover::before {
    opacity: 1;
}

.logo-item {
    position: relative;
    height: 42px;
    width: auto;
    /* Force every mark to a flat white silhouette regardless of source
       colour, so mismatched logo assets read as one consistent set. */
    filter: brightness(0) invert(1) opacity(0.5);
    transition: filter 0.25s, opacity 0.25s;
}

/* Keyed off the padded wrapper, not the image itself, so the colour
   reveal triggers across the same hit area as the glow behind it —
   otherwise the glow can appear while the mark is still greyscale. */
.logo-glow:hover .logo-item {
    filter: none;
    opacity: 1;
}

/* BMW's mark reads as a checker pattern + ring, not a single silhouette —
   flattening it to solid white erases the pattern entirely. Desaturate
   instead of flattening so it stays legible. */
.logo-bmw {
    filter: grayscale(1) brightness(1.3) contrast(1.3) opacity(0.6);
}

/* =============================================
   ABOUT
   ============================================= */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: start;
    margin-top: 0.5rem;
}

.about-body p {
    color: var(--muted);
    line-height: 1.85;
    margin-bottom: 1.5rem;
}

.about-body p:last-child {
    margin-bottom: 0;
}

/* =============================================
   CONTACT
   ============================================= */
/* Extra bottom padding so the heading sweep (script.js) has room to reach
   the viewport centre and rest at full white before the page runs out of
   scroll room — matches section:not(#hero)'s specificity via the type+id
   selector so it reliably overrides the shared padding-bottom. */
section#contact {
    padding-bottom: 20rem;
}

.contact-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-headline {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 8vw, 7rem);
    font-weight: 300;
    letter-spacing: -0.045em;
    line-height: 1;
    margin-bottom: 1.5rem;
}

.contact-sub {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 3rem;
}

.contact-email {
    display: inline-block;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 4px;
    transition: color 0.2s;
}

.contact-email:hover {
    color: var(--accent);
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    padding: 2.5rem 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
}

.footer-copy {
    font-size: 0.78rem;
    color: var(--muted);
}

/* =============================================
   SCROLL FADE-IN
   ============================================= */
.fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: none;
}

/* Stagger pillars & list items */
.pillar.fade-up:nth-child(2) { transition-delay: 0.1s; }
.pillar.fade-up:nth-child(3) { transition-delay: 0.2s; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

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

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

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

    .case-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3rem;
        z-index: 100;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        font-size: 1.1rem;
    }

    .nav-toggle {
        display: flex;
    }

    #hero {
        padding-top: calc(var(--nav-h) + 3rem);
        padding-bottom: 5rem;
    }

    section:not(#hero) {
        padding: 5.5rem 0;
    }

    .footer-inner {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}
