:root {
    --bg: #07080b;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --text: #f2f3f7;
    --muted: #8e93a3;
    --accent: #8b7bff;
    --accent-2: #4fd1ff;
    --accent-3: #ff6fb5;
    --grad: linear-gradient(120deg, var(--accent-2), var(--accent) 45%, var(--accent-3));
    --max: 1180px;
    --prose: 760px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

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

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

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

.serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; }

.grad-text {
    background: var(--grad);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

/* Grain overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scroll progress */
.progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 100%;
    background: var(--grad);
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 60;
}

/* Header */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
    border-bottom: 1px solid transparent;
}
.header.scrolled,
.header.solid {
    background: rgba(7, 8, 11, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--border);
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}
.logo-img {
    height: 25px;
    width: auto;
    display: block;
    transition: transform 0.5s var(--ease);
}
.logo:hover .logo-img { transform: rotate(-6deg) scale(1.08); }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a { color: var(--muted); font-size: 0.93rem; transition: color 0.25s; position: relative; }
.nav a:not(.nav-cta)::after {
    content: "";
    position: absolute;
    left: 0; bottom: -4px;
    width: 100%; height: 1px;
    background: var(--text);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta {
    color: var(--text) !important;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    transition: background 0.25s, border-color 0.25s !important;
}
.nav-cta:hover { background: var(--surface-hover); border-color: rgba(255,255,255,0.18); }

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 140px 0 100px;
    overflow: hidden;
}
.orbs { position: absolute; inset: 0; pointer-events: none; }
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    will-change: transform;
}
.orb-1 { width: 520px; height: 520px; background: var(--accent); top: -120px; right: -80px; animation: float1 18s ease-in-out infinite; }
.orb-2 { width: 420px; height: 420px; background: var(--accent-2); bottom: -140px; left: -100px; opacity: 0.35; animation: float2 22s ease-in-out infinite; }
.orb-3 { width: 300px; height: 300px; background: var(--accent-3); top: 40%; left: 45%; opacity: 0.25; animation: float3 26s ease-in-out infinite; }
@keyframes float1 { 50% { transform: translate(-120px, 90px) scale(1.1); } }
@keyframes float2 { 50% { transform: translate(140px, -80px) scale(1.15); } }
@keyframes float3 { 50% { transform: translate(-160px, -60px) scale(0.9); } }

.grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}

.hero .container { position: relative; z-index: 1; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    backdrop-filter: blur(8px);
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 32px;
}
.badge-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #3ee08f;
    box-shadow: 0 0 0 0 rgba(62, 224, 143, 0.6);
    animation: pulse 2.2s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(62, 224, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 224, 143, 0); } }

.hero h1 {
    font-size: clamp(2.8rem, 8vw, 6.4rem);
    line-height: 1;
    letter-spacing: -0.045em;
    font-weight: 700;
    max-width: 13ch;
    margin-bottom: 28px;
}
.hero h1 .serif { letter-spacing: -0.02em; font-size: 1.08em; }
.line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.line > span {
    display: inline-block;
    transform: translateY(110%);
    animation: rise 1.1s var(--ease) forwards;
}
.line:nth-child(2) > span { animation-delay: 0.12s; }
.line:nth-child(3) > span { animation-delay: 0.24s; }
@keyframes rise { to { transform: translateY(0); } }

.hero-sub {
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    max-width: 52ch;
    margin-bottom: 44px;
}
.fade-in { opacity: 0; animation: fadeUp 1s var(--ease) forwards; }
.d1 { animation-delay: 0.45s; }
.d2 { animation-delay: 0.6s; }
.d3 { animation-delay: 0.75s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 26px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.97rem;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.25s;
    overflow: hidden;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--grad);
    opacity: 0;
    transition: opacity 0.35s var(--ease);
}
.btn-primary span, .btn-primary svg { position: relative; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -10px rgba(139, 123, 255, 0.7); }
.btn-primary:hover::before { opacity: 1; }
.btn-ghost { color: var(--text); border: 1px solid var(--border); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-hover); transform: translateY(-2px); }
.btn svg { transition: transform 0.35s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.scroll-hint {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px; height: 38px;
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    z-index: 1;
}
.scroll-hint::after {
    content: "";
    position: absolute;
    left: 50%; top: 8px;
    width: 3px; height: 7px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--text);
    animation: scrollDot 2s var(--ease) infinite;
}
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* Marquee */
.marquee {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 26px 0;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
    display: flex;
    gap: 64px;
    width: max-content;
    animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
    color: var(--muted);
    font-size: 1.15rem;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 64px;
}
.marquee-track span::after { content: "✦"; color: var(--accent); font-size: 0.8rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sections */
.section { padding: 140px 0; position: relative; }
.eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.section-title {
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    max-width: 18ch;
    margin-bottom: 64px;
}

/* Services */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
    position: relative;
    padding: 36px 32px 40px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    overflow: hidden;
    transition: transform 0.5s var(--ease), border-color 0.4s;
    --mx: 50%;
    --my: 50%;
}
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at var(--mx) var(--my), rgba(139, 123, 255, 0.16), transparent 45%);
    opacity: 0;
    transition: opacity 0.4s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(255,255,255,0.16); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }
.card-num { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; margin-bottom: 52px; display: block; }
.card-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(139, 123, 255, 0.12);
    border: 1px solid rgba(139, 123, 255, 0.25);
    margin-bottom: 24px;
    color: var(--accent);
    transition: transform 0.5s var(--ease);
}
.card:hover .card-icon { transform: rotate(-8deg) scale(1.08); }
.card h3 { font-size: 1.3rem; letter-spacing: -0.02em; margin-bottom: 12px; }
.card p { color: var(--muted); }

/* Approach */
.approach { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.approach .section-title { margin-bottom: 24px; position: sticky; top: 120px; }
.approach-lead { color: var(--muted); font-size: 1.1rem; max-width: 42ch; position: sticky; top: 300px; }
.steps { display: flex; flex-direction: column; }
.step {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 20px;
    padding: 34px 0;
    border-top: 1px solid var(--border);
}
.step:last-child { border-bottom: 1px solid var(--border); }
.step-num {
    font-family: "Instrument Serif", Georgia, serif;
    font-style: italic;
    font-size: 2rem;
    line-height: 1;
}
.step h3 { font-size: 1.2rem; letter-spacing: -0.015em; margin-bottom: 8px; }
.step p { color: var(--muted); }

/* Principles band */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.principle {
    padding: 40px 32px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
}
.principle .big {
    display: block;
    font-size: clamp(2.6rem, 5vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 14px;
}
.principle p { color: var(--muted); }

/* CTA */
.cta {
    position: relative;
    border-radius: 32px;
    padding: 110px 48px;
    text-align: center;
    overflow: hidden;
    border: 1px solid var(--border);
    background: radial-gradient(ellipse at 50% 0%, rgba(139, 123, 255, 0.3), transparent 60%), rgba(255,255,255,0.02);
}
.cta::before {
    content: "";
    position: absolute;
    width: 200%; aspect-ratio: 1;
    left: -50%; top: -50%;
    background: conic-gradient(from 0deg, transparent 0 70%, rgba(79, 209, 255, 0.25), rgba(139, 123, 255, 0.35), transparent 100%);
    animation: spin 10s linear infinite;
}
.cta::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 31px;
    background: radial-gradient(ellipse at 50% 0%, rgba(139, 123, 255, 0.22), transparent 60%), var(--bg);
}
@keyframes spin { to { transform: rotate(360deg); } }
.cta > * { position: relative; z-index: 1; }
.cta h2 {
    font-size: clamp(2.2rem, 6vw, 4.4rem);
    letter-spacing: -0.04em;
    line-height: 1.02;
    margin: 0 auto 22px;
    max-width: 15ch;
}
.cta p { color: var(--muted); font-size: 1.1rem; margin: 0 auto 40px; max-width: 46ch; }
.cta .actions { justify-content: center; }

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
    transition-delay: var(--delay, 0s);
}
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Legal pages */
.legal { padding: 160px 0 120px; position: relative; overflow: hidden; }
.legal .orb-1 { width: 420px; height: 420px; top: -220px; right: -120px; opacity: 0.35; }
.legal .container { max-width: var(--prose); position: relative; }
.legal h1 {
    font-size: clamp(2.4rem, 6vw, 4rem);
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 12px;
}
.legal .updated { color: var(--muted); font-size: 0.92rem; margin-bottom: 56px; }
.legal h2 { font-size: 1.3rem; letter-spacing: -0.015em; margin: 48px 0 14px; }
.legal p, .legal li { color: #c3c6d0; margin-bottom: 12px; }
.legal ul { padding-left: 22px; margin-bottom: 12px; }
.legal li::marker { color: var(--accent); }
.legal a:hover { text-decoration: underline; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 72px 0 40px; margin-top: 40px; }
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 32px;
    flex-wrap: wrap;
    margin-bottom: 56px;
}
.footer-word {
    font-size: clamp(3.5rem, 13vw, 10rem);
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 0.85;
    background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.02));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    user-select: none;
}
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.footer p { color: var(--muted); font-size: 0.9rem; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 0.9rem; transition: color 0.25s; }
.footer-links a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 900px) {
    .cards, .principles { grid-template-columns: 1fr; }
    .approach { grid-template-columns: 1fr; gap: 24px; }
    .approach .section-title, .approach-lead { position: static; }
    .section { padding: 100px 0; }
}
@media (max-width: 600px) {
    .container { padding: 0 16px; }
    .nav a:not(.nav-cta) { display: none; }
    .hero { padding: 120px 0 90px; }
    .section { padding: 80px 0; }
    .section-title { margin-bottom: 40px; }
    .cta { padding: 72px 22px; border-radius: 24px; }
    .cta::after { border-radius: 23px; }
    .orb-1 { width: 320px; height: 320px; }
    .orb-2 { width: 280px; height: 280px; }
    .scroll-hint { display: none; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    .marquee-track { animation: none; }
}
