:root {
    --bg: #09090a;
    --panel: rgba(255, 255, 255, 0.018);
    --panel-strong: rgba(255, 255, 255, 0.03);
    --text: #f3efe8;
    --muted: #a19990;
    --accent: #d7cfc3;
    --line: rgba(255, 255, 255, 0.06);
    --line-soft: rgba(255, 255, 255, 0.035);
    --grid-line: rgba(255, 255, 255, 0.015);
    --max-width: 1220px;
    --radius: 2px;
    --pointer-x: 50%;
    --pointer-y: 24%;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 60px 60px;
    color: var(--text);
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12) 0.5px, transparent 0.75px),
        radial-gradient(circle at 70% 40%, rgba(255, 255, 255, 0.08) 0.5px, transparent 0.75px);
    background-size: 18px 18px, 24px 24px;
    opacity: 0.06;
    pointer-events: none;
    z-index: 10;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.34;
    background:
        linear-gradient(
            180deg,
            transparent,
            rgba(215, 207, 195, 0.08),
            transparent
        ) calc(var(--pointer-x) - 0.5px) 0 / 1px 100% no-repeat,
        linear-gradient(
            90deg,
            transparent,
            rgba(215, 207, 195, 0.035),
            transparent
        ) 0 calc(var(--pointer-y) - 0.5px) / 100% 1px no-repeat,
        radial-gradient(
            circle 120px at var(--pointer-x) var(--pointer-y),
            rgba(215, 207, 195, 0.055),
            rgba(215, 207, 195, 0.018) 38%,
            transparent 72%
        ),
        radial-gradient(
            circle 7px at var(--pointer-x) var(--pointer-y),
            rgba(236, 229, 217, 0.42),
            rgba(236, 229, 217, 0.12) 42%,
            transparent 76%
        );
    transition: opacity 260ms ease, background-position 140ms ease-out;
}

a {
    color: inherit;
}

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

.site-shell {
    position: relative;
    z-index: 2;
    width: min(calc(100% - 56px), var(--max-width));
    margin: 0 auto;
}

.topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 112px;
    padding: 24px 0 18px;
    border-bottom: 1px solid var(--line-soft);
    isolation: isolate;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-mark {
    width: 240px;
    display: inline-flex;
    filter: brightness(1.06);
    transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1), filter 320ms ease;
}

.brand-logo {
    width: 100%;
    height: auto;
}

.nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav a,
.button,
.eyebrow,
.card-index,
.work-tag {
    font-family: "IBM Plex Mono", monospace;
    text-transform: uppercase;
}

.nav a {
    position: relative;
    font-size: 15px;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-decoration: none;
    transition: color 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 220ms ease;
}

.nav a:hover,
.nav a:focus-visible {
    color: var(--text);
    transform: translateY(-1px);
}

.nav a:hover::after,
.nav a:focus-visible::after {
    opacity: 1;
}

.hero {
    display: flex;
    align-items: end;
    min-height: 74vh;
    padding: 110px 0 112px;
}

.hero-content {
    width: min(1020px, 100%);
    --hero-shift: 0px;
    transform: translate3d(var(--hero-shift), 0, 0);
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.eyebrow {
    margin: 0 0 18px;
    font-size: 10px;
    letter-spacing: 0.28em;
    color: var(--accent);
}

.hero h1,
.hero-subhead,
.section-heading h2,
.feature-card h3,
.work-card h3,
.contact-card h2 {
    margin: 0;
    font-weight: 500;
}

.hero h1 {
    max-width: 10.5ch;
    font-size: clamp(3.4rem, 6.6vw, 6rem);
    line-height: 0.92;
    letter-spacing: -0.065em;
    text-transform: none;
    text-wrap: balance;
}

.hero-subhead {
    max-width: 18ch;
    margin-top: 22px;
    font-size: clamp(1.5rem, 2.7vw, 2.35rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
    color: rgba(243, 239, 232, 0.92);
}

.hero-text,
.section-heading p,
.feature-card p,
.work-card p,
.contact-card p {
    color: var(--muted);
    font-size: 1.04rem;
    font-weight: 300;
}

.hero-text {
    max-width: 46rem;
    margin: 26px 0 0;
}

.hero-actions,
.contact-card .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.button {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-decoration: none;
    transition:
        transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 220ms ease,
        background-color 220ms ease,
        color 220ms ease;
}

.button::before {
    content: "";
    position: absolute;
    inset: -1px;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.18) 50%, transparent 80%);
    transform: translateX(-140%);
    opacity: 0;
    transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
    pointer-events: none;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(215, 207, 195, 0.24);
}

.button:hover::before,
.button:focus-visible::before {
    transform: translateX(140%);
    opacity: 1;
}

.button-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: #ece5d9;
    border-color: #ece5d9;
}

.button-ghost {
    background: transparent;
    color: var(--text);
}

.section {
    padding: 96px 0;
    border-top: 1px solid var(--line-soft);
}

.section::before {
    content: "";
    display: block;
    width: min(72px, 10vw);
    height: 1px;
    margin-bottom: 32px;
    background: linear-gradient(90deg, var(--accent), transparent);
    transform-origin: left center;
    transform: scaleX(0.18);
    opacity: 0.26;
    transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1), opacity 480ms ease;
}

.section.is-visible::before {
    transform: scaleX(1);
    opacity: 0.92;
}

.section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
    gap: 28px;
    align-items: end;
}

.section-heading-compact {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

.section-heading h2,
.contact-card h2 {
    font-size: clamp(1.9rem, 3.4vw, 3rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.section-heading p,
.contact-card p {
    margin: 0;
    max-width: 32rem;
}

.divisions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-top: 32px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.spec-card {
    min-height: 0;
    padding: 28px 28px 32px;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--line-soft);
    transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1), background-color 280ms ease;
}

.spec-card:last-child {
    border-right: 0;
}

.card-index,
.work-tag {
    display: inline-flex;
    align-items: center;
    margin-bottom: 22px;
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--accent);
}

.feature-card h3,
.work-card h3 {
    font-size: clamp(1.6rem, 2.2vw, 2.55rem);
    line-height: 0.96;
    letter-spacing: -0.048em;
}

.feature-card p,
.work-card p {
    max-width: 34rem;
    margin: 16px 0 0;
}

.engagement-list,
.protocol-list {
    display: grid;
    gap: 0;
    margin-top: 32px;
    border-top: 1px solid var(--line);
}

.engagement-card,
.protocol-card {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    padding: 28px 0 30px;
    border-bottom: 1px solid var(--line-soft);
    background: transparent;
    transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1), border-color 260ms ease;
}

.engagement-card .work-tag,
.protocol-card .work-tag {
    grid-column: 1;
    margin-bottom: 0;
    padding-top: 8px;
}

.engagement-card h3,
.protocol-card h3 {
    grid-column: 2;
    margin-bottom: 10px;
}

.engagement-card p,
.protocol-card p {
    grid-column: 2;
}

.spec-card:hover,
.spec-card:focus-within,
.engagement-card:hover,
.engagement-card:focus-within,
.protocol-card:hover,
.protocol-card:focus-within {
    transform: translateX(8px);
}

.spec-card:hover,
.spec-card:focus-within {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.018), transparent 72%);
}

.engagement-card:hover,
.engagement-card:focus-within,
.protocol-card:hover,
.protocol-card:focus-within {
    border-color: rgba(215, 207, 195, 0.16);
}

.engagement-card.featured h3 {
    font-size: clamp(1.9rem, 2.7vw, 3rem);
}

.protocol-intro {
    font-style: italic;
}

.contact-card {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.contact-card .hero-text {
    margin: 22px 0 0;
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(10px);
    transition:
        opacity 1100ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 1100ms cubic-bezier(0.22, 1, 0.36, 1),
        filter 1100ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.hero-content > * {
    opacity: 0;
    transform: translateY(22px);
    animation: hero-enter 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-content .eyebrow { animation-delay: 120ms; }
.hero-content h1 { animation-delay: 220ms; }
.hero-content .hero-subhead { animation-delay: 340ms; }
.hero-content .hero-text { animation-delay: 460ms; }
.hero-content .hero-actions { animation-delay: 580ms; }

@keyframes hero-enter {
    from {
        opacity: 0;
        transform: translateY(22px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.nav a:focus-visible,
.button:focus-visible {
    outline: 1px solid rgba(215, 207, 195, 0.55);
    outline-offset: 4px;
}

@media (max-width: 1100px) {
    .site-shell {
        width: min(calc(100% - 36px), var(--max-width));
    }

    .topbar {
        min-height: auto;
        padding: 20px 0 18px;
    }

    .brand-mark {
        width: 200px;
    }

    .nav {
        gap: 20px;
    }

    .nav a {
        font-size: 13px;
    }

    .hero {
        min-height: auto;
        padding: 82px 0 88px;
    }

    .hero h1 {
        font-size: clamp(2.8rem, 9vw, 5rem);
    }

    .hero-subhead {
        font-size: clamp(1.3rem, 3vw, 2rem);
    }
}

@media (max-width: 900px) {
    .topbar {
        flex-wrap: wrap;
        gap: 18px;
    }

    .nav {
        position: static;
        transform: none;
        order: 3;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 14px 20px;
    }

    .section-heading,
    .divisions-grid {
        grid-template-columns: 1fr;
    }

    .spec-card {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line-soft);
    }

    .spec-card:last-child {
        border-bottom: 0;
    }

    .engagement-card,
    .protocol-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .engagement-card .work-tag,
    .protocol-card .work-tag {
        grid-column: auto;
        padding-top: 0;
    }

    .engagement-card h3,
    .protocol-card h3,
    .engagement-card p,
    .protocol-card p {
        grid-column: auto;
    }

    .spec-card:hover,
    .spec-card:focus-within,
    .engagement-card:hover,
    .engagement-card:focus-within,
    .protocol-card:hover,
    .protocol-card:focus-within {
        transform: none;
    }
}

@media (max-width: 640px) {
    .site-shell {
        width: min(calc(100% - 24px), var(--max-width));
    }

    .brand-mark {
        width: 170px;
    }

    .hero {
        padding: 68px 0 72px;
    }

    .hero h1 {
        max-width: none;
        font-size: clamp(2.4rem, 12vw, 4rem);
        line-height: 0.96;
    }

    .hero-subhead {
        max-width: none;
        line-height: 1.08;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button {
        width: 100%;
    }

    .section {
        padding: 72px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

    .reveal,
    .reveal.is-visible {
        opacity: 1;
        transform: none;
        filter: none;
    }

    .hero-content > * {
        opacity: 1;
        transform: none;
        animation: none !important;
        filter: none;
    }

    .section::before {
        transform: scaleX(1);
        opacity: 0.92;
    }

    body::before {
        opacity: 0;
    }
}
