/* ── Tokens ── */
:root {
    --bg: #fafafa;
    --panel: #ffffff;
    --panel2: #f5f5f7;
    --text: #1a1a2e;
    --muted: #555770;
    --subtle: #8b8da3;
    --line: rgba(0, 0, 0, .08);
    --line-hover: rgba(0, 0, 0, .15);
    --accent: #4f6df5;
    --accent2: #7c5cfc;
    --shadow: 0 8px 32px rgba(0, 0, 0, .06);
    --shadow-hover: 0 16px 48px rgba(0, 0, 0, .1);
    --radius: 16px;
    --radius-sm: 10px;
    --max: 1080px;
    --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* Ambient glow — kept subtle */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(900px 500px at 15% 0%, rgba(79, 109, 245, .06), transparent 60%),
        radial-gradient(700px 400px at 85% 5%, rgba(124, 92, 252, .05), transparent 55%);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .2s var(--ease);
}

a:hover {
    color: #3b52c7;
}

/* ── Focus ── */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── Layout ── */
.container {
    position: relative;
    z-index: 1;
    width: min(var(--max), calc(100% - 48px));
    margin: 0 auto;
}

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 250, 250, .85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(79, 109, 245, .1), rgba(124, 92, 252, .1));
    border: 1px solid var(--line);
    color: var(--text);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: .02em;
    transition: border-color .2s var(--ease);
}

.logo:hover {
    border-color: var(--line-hover);
    color: var(--text);
}

/* ── Nav ── */
.nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav a {
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: color .2s var(--ease), background .2s var(--ease);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--muted);
    border-radius: 2px;
    transition: transform .25s var(--ease), opacity .2s;
}

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

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

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

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .01em;
    cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s;
    box-shadow: 0 4px 16px rgba(79, 109, 245, .25);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(79, 109, 245, .3);
    filter: brightness(1.05);
    color: #ffffff;
}

.btn.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}

.btn.ghost:hover {
    border-color: var(--line-hover);
    background: rgba(0, 0, 0, .03);
    transform: translateY(-1px);
}

.btn.small {
    padding: 8px 16px;
    font-size: 13px;
    color:#ffffff;
}

/* ── Hero ── */
.hero {
    padding: 80px 0 40px;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.3fr .7fr;
    gap: 40px;
    align-items: start;
}

.eyebrow {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 12px;
    margin: 0 0 16px;
}

h1 {
    font-size: clamp(32px, 5vw, 44px);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 16px;
    letter-spacing: -.02em;
}

.subhead {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
    margin: 0 0 24px;
    max-width: 54ch;
}

.cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 28px;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .03);
    color: var(--subtle);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
    transition: border-color .2s var(--ease), color .2s var(--ease);
}

.badge:hover {
    border-color: var(--line-hover);
    color: var(--muted);
}

/* ── Hero card ── */
.hero-card {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.hero-card h2 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--subtle);
    margin: 0 0 16px;
}

.hero-card ul {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.hero-card li {
    color: var(--muted);
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    line-height: 1.5;
}

.hero-card li:last-child {
    border-bottom: none;
}

.hero-card li strong {
    color: var(--text);
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 2px;
}

.note {
    color: var(--subtle);
    font-size: 13px;
    font-style: italic;
    margin: 12px 0 0;
}

/* ── Sections ── */
.section {
    padding: 80px 0;
}

.section.alt {
    background: var(--panel2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
    margin: 0 0 8px;
}

h2 {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 800;
    letter-spacing: -.01em;
    margin: 0 0 8px;
}

.section-lede {
    color: var(--muted);
    margin: 0 0 32px;
    max-width: 65ch;
    font-size: 16px;
    line-height: 1.65;
}

/* ── Grid ── */
.grid {
    display: grid;
    gap: 16px;
}

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

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ── Cards ── */
.card {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}

.card:hover {
    border-color: var(--line-hover);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(79, 109, 245, .08), rgba(124, 92, 252, .08));
    color: var(--accent);
    margin-bottom: 16px;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.card p,
.card li {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.card ul {
    margin: 12px 0 0;
    padding-left: 18px;
}

.card li {
    margin-bottom: 4px;
}

/* ── Case studies ── */
.stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.case.card {
    border-left: 3px solid var(--accent);
    padding: 28px 28px 20px;
}

.case-head h3 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.case-number {
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.meta {
    margin: 0 0 4px;
    color: var(--subtle);
    font-size: 13px;
    font-weight: 500;
}

.case-body {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

.case-text h4 {
    margin: 20px 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.case-text h4:first-child {
    margin-top: 0;
}

.case-text p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.65;
}

.case-text ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

.case-text li {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.65;
    margin-bottom: 2px;
}

.case-image {
    border-radius: var(--radius-sm);
    background: var(--panel2);
    border: 1px solid var(--line);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.case-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
}

/* Placeholder for missing images */
.case-image img[src$=".png"]:not([src=""]) {
    background: var(--panel2);
}

.case-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.view-more {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    transition: color .2s var(--ease);
}

.view-more:hover {
    color: #3b52c7;
}

/* ── Lightbox ── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s var(--ease), visibility .3s;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 900px;
    width: calc(100% - 48px);
    z-index: 1;
}

.lightbox-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: var(--radius);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
    object-fit: contain;
    background: var(--panel);
    transition: opacity .25s var(--ease);
}

.lightbox-caption {
    color: #ccc;
    font-size: 14px;
    margin: 16px 0 0;
    text-align: center;
    max-width: 600px;
}

.lightbox-counter {
    color: #888;
    font-size: 12px;
    font-weight: 600;
    margin: 8px 0 0;
    letter-spacing: .05em;
}

.lightbox-close {
    position: absolute;
    top: -48px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 8px;
    opacity: .7;
    transition: opacity .2s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-prev,
.lightbox-next {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    cursor: pointer;
    transition: background .2s var(--ease), border-color .2s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .35);
}

@media (max-width: 768px) {
    .lightbox-container {
        width: calc(100% - 24px);
        gap: 8px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 36px;
        height: 36px;
    }

    .lightbox-prev svg,
    .lightbox-next svg {
        width: 18px;
        height: 18px;
    }

    .lightbox-close {
        top: -40px;
    }
}

/* ── Role tags ── */
.role-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.role-tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(124, 92, 252, .2);
    color: var(--accent2);
    background: rgba(124, 92, 252, .06);
}

/* ── Contact ── */
.contact-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.contact-card > div {
    padding: 4px 0;
}

.label {
    margin: 0 0 6px;
    color: var(--subtle);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.label + p {
    margin: 0;
}

.footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--subtle);
    font-size: 13px;
}

.footer p {
    margin: 0;
}

/* ── Scroll reveal ── */
[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger cards in grids */
.grid [data-reveal]:nth-child(2) {
    transition-delay: .1s;
}

.grid [data-reveal]:nth-child(3) {
    transition-delay: .2s;
}

.stack [data-reveal]:nth-child(2) {
    transition-delay: .1s;
}

.stack [data-reveal]:nth-child(3) {
    transition-delay: .2s;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .container {
        width: calc(100% - 32px);
    }

    .nav-toggle {
        display: flex;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(250, 250, 250, .97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--line);
        padding: 16px 24px;
        gap: 4px;
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        padding: 12px 0;
        font-size: 16px;
    }

    .nav .btn.small {
        margin-top: 8px;
        text-align: center;
        justify-content: center;
    }

    .hero {
        padding: 48px 0 32px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    h1 {
        font-size: 28px;
    }

    .section {
        padding: 56px 0;
    }

    .grid.three,
    .grid.two {
        grid-template-columns: 1fr;
    }

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

    .case-image {
        order: -1;
        min-height: 160px;
    }

    .case.card {
        padding: 20px 20px 16px;
    }

    .contact-card {
        grid-template-columns: 1fr;
    }

    .cta-row {
        flex-direction: column;
    }

    .cta-row .btn {
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }

    .hero {
        padding: 36px 0 24px;
    }

    .section {
        padding: 40px 0;
    }

    .card {
        padding: 20px;
    }
}
