/* ==========================================================================
   SPIM DARK THEME — "Space" layer  (loaded LAST, after site.css)
   Logo colours: indigo #6C5CE7 · violet #9B5CF6 · magenta #E86CF0
   Works with assets/js/shared/space.js (stars + floating objects).
   Remove this <link> + the space.js <script> to roll back.
   ========================================================================== */

:root {
    --spim-indigo: #6c5ce7;
    --spim-violet: #9b5cf6;
    --spim-magenta: #e86cf0;
    --spim-grad: linear-gradient(110deg, #6c5ce7 0%, #9b5cf6 45%, #e86cf0 100%);
    --spim-grad-soft: linear-gradient(110deg, rgba(108, 92, 231, .18), rgba(232, 108, 240, .14));
    --space-bg: #05040c;
    --glow-violet: rgba(155, 92, 246, .38);

    /* layout */
    --page-max: 1380px;
    --page-pad: clamp(20px, 4vw, 56px);
    --header-pad: clamp(20px, 3vw, 48px);
}

/* ---------- 1. Deep-space base ---------- */
html {
    background:
        radial-gradient(1200px 700px at 78% -10%, rgba(155, 92, 246, .22), transparent 60%),
        radial-gradient(900px 600px at -10% 30%, rgba(108, 92, 231, .16), transparent 60%),
        radial-gradient(900px 700px at 110% 85%, rgba(232, 108, 240, .10), transparent 60%),
        var(--space-bg) !important;
    background-attachment: fixed !important;
}
html body, html body.home-page { background: transparent !important; }

.spim-space { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.spim-space__stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.spim-space__objs { position: absolute; inset: 0; }
.spim-obj {
    position: absolute; top: 0;
    opacity: .62;
    will-change: transform;
    filter: drop-shadow(0 0 10px rgba(155, 92, 246, .55)) drop-shadow(0 0 2px rgba(232, 108, 240, .4));
}
.spim-obj.is-far { opacity: .22; filter: blur(.6px) drop-shadow(0 0 6px rgba(155, 92, 246, .4)); }
.spim-obj svg { width: 100%; height: 100%; overflow: visible; }
.spim-obj__float { width: 100%; height: 100%; animation: spim-float var(--dur, 12s) ease-in-out var(--delay, 0s) infinite alternate; }
@keyframes spim-float {
    0%   { transform: translate3d(0, -10px, 0) rotate(calc(var(--rot, 0deg) - 5deg)); }
    100% { transform: translate3d(0, 12px, 0)  rotate(calc(var(--rot, 0deg) + 5deg)); }
}
.spim-obj .rotor { transform-box: fill-box; transform-origin: center; animation: spim-rotor .5s linear infinite; }
@keyframes spim-rotor { 50% { transform: scaleX(.35); } }
@media (max-width: 767px) { .spim-obj { opacity: .32; } }

/* Let space show through page sections (homepage glows are kept) */
html body .section--alt, html body .h-trust, html body .h-cta,
html body main, html body section, html body .footer-section,
html body #main-content, html body .glass-bottom-bar {
    background-color: transparent !important;
}
html body .footer-section { background-image: linear-gradient(180deg, transparent, rgba(8, 5, 20, .75)) !important; }
html body .glass-bottom-bar { background: rgba(6, 4, 14, .7) !important; }
/* text-heavy sections get a whisper of tint so copy stays easy to read over stars */
html body .h-faq details, html body .h-step, html body .h-stat, html body .h-card, html body .h-tab { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ---------- 2. Layout: wider, edge-to-edge like modern product sites ---------- */
html body .container { max-width: var(--page-max); padding-left: var(--page-pad); padding-right: var(--page-pad); }

/* header spans the full width: logo at the left edge, menu centred, CTA at the right edge */
html body header { padding: 16px 0; }
html body header .header-container,
html body header .header-container.container {
    max-width: none; width: 100%;
    padding-left: var(--header-pad); padding-right: var(--header-pad);
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
}
html body header .logo-container { justify-self: start; display: inline-flex; align-items: center; }
html body header .logo-container img { height: 46px; width: auto; }
html body header.scrolled .logo-container img { height: 40px; }
html body header .main-nav { justify-self: center; }
html body header .header-actions { justify-self: end; }
html body header {
    background: rgba(6, 4, 14, .35) !important;
    border-bottom: 1px solid rgba(169, 138, 255, .10) !important;
}
html body header.scrolled {
    background: rgba(6, 4, 14, .72) !important;
    box-shadow: 0 10px 40px -12px rgba(108, 92, 231, .35) !important;
}
html body .main-nav ul li > a { font-size: .82rem; padding: 9px 16px; }
html body .main-nav .submenu { background: rgba(16, 11, 34, .96) !important; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }

@media (max-width: 768px) {
    html body header { padding: 12px 0; }
    html body header .header-container,
    html body header .header-container.container { grid-template-columns: 1fr auto; padding-left: 20px; padding-right: 20px; }
    html body header .main-nav { display: none; }
    html body header .logo-container img, html body header.scrolled .logo-container img { height: 36px; }
}

/* footer + bottom bar follow the same edges */
html body .glass-content-wrap { max-width: var(--page-max); padding-left: var(--page-pad); padding-right: var(--page-pad); }
html body .glass-bottom-bar { padding-left: 0; padding-right: 0; }

/* homepage hero: give the product frame more room on wide screens */
@media (min-width: 1025px) {
    html body .h-hero__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 5vw, 88px); }
    html body .h-hero h1 { font-size: clamp(2.6rem, 4.4vw, 4.1rem); }
}
html body .h-hero { padding-top: 156px; }

/* ---------- 3. Client logos: plain, no tiles ---------- */
html body .h-trust { border-color: rgba(169, 138, 255, .10) !important; }
html body .h-logos { gap: 28px 40px; }
html body .h-logo {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 6px 4px;
    height: 76px;
}
html body .h-logo img {
    max-height: 52px;
    opacity: .82;
    transition: opacity .25s ease, transform .25s ease, filter .25s ease;
}
html body .h-logo:hover { transform: none; box-shadow: none !important; }
html body .h-logo:hover img { opacity: 1; transform: scale(1.06); filter: drop-shadow(0 0 14px rgba(155, 92, 246, .55)); }
/* the default strip scrolls like a marquee on wide screens (see home.js-free CSS below) */
html body #client-strip:not([hidden]) {
    display: flex; flex-wrap: nowrap; gap: 64px; width: max-content;
    animation: spim-marquee 40s linear infinite;
}
html body #client-strip:hover { animation-play-state: paused; }
html body #client-strip .h-logo { flex: none; }
html body .h-trust .container { overflow: hidden; }
html body .h-trust .container > #client-strip { margin: 0; }
html body .spim-marquee-mask {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    overflow: hidden;
}
@keyframes spim-marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { html body #client-strip:not([hidden]) { animation: none; flex-wrap: wrap; width: auto; } }

/* ---------- 4. Brand gradient on primary actions & accents ---------- */
html body .btn--primary, html body .contact-btn, html body .h-tab[aria-selected="true"],
html body .h-seg button[aria-pressed="true"], html body .cta-button, html body .send-button {
    background: var(--spim-grad) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 10px 30px -8px var(--glow-violet), inset 0 1px 0 rgba(255, 255, 255, .25) !important;
}
html body .btn--primary:hover, html body .contact-btn:hover, html body .cta-button:hover, html body .send-button:hover {
    filter: brightness(1.08);
    box-shadow: 0 14px 40px -8px rgba(232, 108, 240, .5), inset 0 1px 0 rgba(255, 255, 255, .3) !important;
}
html body .h-hero h1 span, html body .h-stat strong {
    background: var(--spim-grad) !important;
    -webkit-background-clip: text !important; background-clip: text !important;
    -webkit-text-fill-color: transparent !important; color: transparent !important;
}
html body .h-stat strong { text-shadow: none; }
html body .h-step::before { background: var(--spim-grad) !important; }
html body .eyebrow { background: var(--spim-grad-soft) !important; }
html body .frame__url i { margin-right: 6px; color: #cbb8ff; }

/* ---------- 5. Other pages: sections transparent, cards glassy ---------- */
html body .feature-card, html body .service-card, html body .blog-card, html body .info-card,
html body .value-card, html body .team-card, html body .benefit-card, html body .faq-item,
html body .contact-left, html body .social-box {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)) padding-box,
        linear-gradient(rgba(12, 9, 26, .78), rgba(12, 9, 26, .78)) padding-box,
        linear-gradient(140deg, rgba(155, 92, 246, .5), rgba(255, 255, 255, .06) 35%, rgba(255, 255, 255, .05) 65%, rgba(232, 108, 240, .4)) border-box !important;
    border: 1px solid transparent !important;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
html body input, html body textarea, html body select {
    background-color: rgba(255, 255, 255, .04);
    color: #f4f2ff;
}

/* ---------- 6. Demo request gate (assets/js/shared/demo-gate.js) ---------- */
.spim-gate {
    position: fixed; inset: 0; z-index: 100000;
    display: none; align-items: center; justify-content: center; padding: 16px;
    background: rgba(3, 2, 10, .72);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.spim-gate.open { display: flex; animation: spim-fade .25s ease; }
@keyframes spim-fade { from { opacity: 0; } to { opacity: 1; } }
.spim-gate__panel {
    position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
    padding: 32px 28px 26px; border-radius: 22px; color: #f4f2ff;
    font-family: 'Inter', 'Poppins', system-ui, sans-serif;
    background:
        radial-gradient(120% 70% at 0% 0%, rgba(108, 92, 231, .22), transparent 60%) padding-box,
        radial-gradient(90% 60% at 100% 100%, rgba(232, 108, 240, .14), transparent 60%) padding-box,
        linear-gradient(#0e0c1f, #0e0c1f) padding-box,
        linear-gradient(140deg, rgba(155, 92, 246, .7), rgba(255, 255, 255, .08) 40%, rgba(232, 108, 240, .55)) border-box;
    border: 1px solid transparent;
    box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .9), 0 0 60px -20px var(--glow-violet);
    animation: spim-rise .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes spim-rise { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.spim-gate__close {
    position: absolute; top: 12px; right: 14px; width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04);
    color: #a9a6c4; font-size: 20px; line-height: 1; cursor: pointer;
}
.spim-gate__close:hover { color: #fff; border-color: rgba(155, 92, 246, .6); }
.spim-gate__badge {
    display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
    padding: 6px 12px; border-radius: 999px; background: var(--spim-grad-soft); border: 1px solid rgba(155, 92, 246, .4); color: #dccfff;
}
.spim-gate__panel h3 { font-size: 1.5rem; font-weight: 700; margin: 14px 0 6px; line-height: 1.25; color: #fff; }
.spim-gate__panel p { color: #a9a6c4; font-size: .92rem; margin: 0 0 18px; }
.spim-gate__form { display: grid; gap: 12px; }
.spim-gate__form label { font-size: .78rem; color: #a9a6c4; display: grid; gap: 6px; }
.spim-gate__form input, .spim-gate__form select {
    width: 100%; padding: 12px 14px; border-radius: 12px; font: inherit; font-size: .95rem;
    background: rgba(255, 255, 255, .04) !important; border: 1px solid rgba(255, 255, 255, .14) !important; color: #f4f2ff !important;
}
.spim-gate__form input:focus, .spim-gate__form select:focus { outline: none; border-color: rgba(155, 92, 246, .7) !important; box-shadow: 0 0 0 4px rgba(155, 92, 246, .18); }
.spim-gate__form input::placeholder { color: #6f6b8f; }
.spim-gate__form select option { background: #0e0c1f; }
.spim-gate__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .spim-gate__row { grid-template-columns: 1fr; } }
.spim-gate__submit {
    margin-top: 6px; padding: 14px; border: 0; border-radius: 12px; cursor: pointer;
    font: 600 1rem inherit; color: #fff; background: var(--spim-grad); box-shadow: 0 10px 30px -8px var(--glow-violet);
}
.spim-gate__submit:disabled { opacity: .6; cursor: wait; }
.spim-gate__alt { text-align: center; font-size: .85rem; color: #a9a6c4; margin-top: 4px; }
.spim-gate__alt a { color: #d4c1ff; text-decoration: none; }
.spim-gate__alt a:hover { text-decoration: underline; }
.spim-gate__msg { min-height: 1.2em; font-size: .9rem; text-align: center; }
.spim-gate__msg.err { color: #f87171; }
.spim-gate__done { text-align: center; padding: 10px 0 4px; }
.spim-gate__done .tick {
    width: 64px; height: 64px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center;
    font-size: 28px; color: #fff; background: var(--spim-grad); box-shadow: 0 0 40px -6px var(--glow-violet);
}
.spim-gate__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
body.spim-gate-lock { overflow: hidden !important; }
[data-demo-open] { cursor: pointer; }

/* blog: keep the sidebar inside narrow screens */
html body .blog-main { max-width: var(--page-max); padding-left: var(--page-pad); padding-right: var(--page-pad); }
@media (max-width: 1024px) {
    html body .blog-main { grid-template-columns: minmax(0, 1fr); }
    html body .blog-sidebar { grid-column: 1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-width: 0; }
}
@media (max-width: 600px)  { html body .blog-sidebar { grid-template-columns: minmax(0, 1fr); } }
html body .blog-sidebar > * { min-width: 0; }

/* ---------- 7. Inner pages: open up dark gradient bands so the space background shows ---------- */
html body .vr-banner-section {
    background: radial-gradient(circle at 85% 80%, rgba(181, 138, 255, .28), transparent 55%) !important;
}
html body .hero-continuation, html body .immersion-hero, html body .faq-section,
html body .digiverse-support-panel, html body .our-story-section, html body .dna-section,
html body .clients-section, html body .team-section {
    background: transparent !important;
}

/* blue-ish legacy gradients -> SPIM logo gradient */
html body .solutions-btn, html body .webverse-banner .explore-btn, html body .icon-box.active,
html body .tech-badge, html body .btn-primary, html body .award-badge, html body .blog-card-category,
html body .pagination-item a:hover, html body .pagination-item.active a, html body .newsletter-button {
    background: var(--spim-grad) !important;
    border-color: transparent !important;
}
html body .hero-continuation h2 span, html body .highlight-gradient, html body .spim-hero-title, html body .gradient-text {
    background: var(--spim-grad) !important;
    -webkit-background-clip: text !important; background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
html body .section-title::after { background: var(--spim-grad) !important; }


/* ---------- 8. Homepage banner hero (glass building art over the starfield) ---------- */
html body .h-hero--banner {
    position: relative; isolation: isolate; overflow: hidden;
    min-height: min(100vh, 940px);
    display: flex; align-items: center;
    padding: 150px 0 140px;
}
html body .h-hero--banner::before { display: none; }              /* no grid here: the art is the visual */
html body .h-hero--banner::after {                                  /* soft violet haze behind the building */
    top: auto; bottom: -10%; left: auto; right: -8%; transform: none;
    width: 70vw; height: 70vh; opacity: .55;
}
.h-hero__art {
    position: absolute; right: 0; bottom: 0; z-index: -1; pointer-events: none;
    display: block;
    height: 100%; aspect-ratio: 2 / 1; max-width: 100%;          /* art keeps its shape; anchored bottom-right */
    -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent 100%), linear-gradient(90deg, transparent 0, #000 10%);
    -webkit-mask-composite: source-in;
            mask-image: linear-gradient(180deg, #000 80%, transparent 100%), linear-gradient(90deg, transparent 0, #000 10%);
            mask-composite: intersect;
}
.h-hero__art img {
    width: 100%; height: 100%; max-width: none;
    object-fit: contain; object-position: 100% 100%;
    animation: spim-art-float 9s ease-in-out infinite alternate;
    transform-origin: 70% 80%;
}
@keyframes spim-art-float {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(0, -10px, 0) scale(1.012); }
}
html body .h-hero__inner { width: 100%; }
html body .h-hero--banner .h-hero__copy { max-width: 860px; }
html body .h-hero--banner h1 {
    margin-top: 22px;
    font-size: clamp(2.4rem, 4vw, 4.1rem); font-weight: 800; line-height: 1.04; letter-spacing: -.035em;
}
html body .h-hero--banner h1 span { display: block; }
html body .h-hero--banner .h-hero__lead { max-width: 600px; font-size: clamp(1.05rem, 1.4vw, 1.3rem); color: #c9c1e6; margin-top: 22px; }
html body .h-hero--banner .h-hero__cta { margin-top: 36px; gap: 18px; }
html body .btn--pill { border-radius: 999px !important; padding: 15px 30px; font-size: 1rem; }
html body .h-hero--banner .btn--ghost { background: rgba(6, 4, 14, .35); border-color: rgba(201, 181, 255, .55); color: #fff; }
html body .h-hero--banner .eyebrow { padding: 8px 16px; font-size: .86rem; color: #fff; }
html body .h-hero--banner .eyebrow i { color: #c9b5ff; }

/* tablet + phone: copy on top, artwork sits underneath it */
@media (max-width: 1100px) {
    html body .h-hero--banner { min-height: 0; display: block; padding: 132px 0 calc(42vw + 20px); }
    .h-hero__art { left: 0; right: 0; height: auto; width: 100%; aspect-ratio: 2 / 1; }
}
@media (max-width: 768px) {
    html body .h-hero--banner { padding: 112px 0 calc(66vw + 12px); }
    .h-hero__art { aspect-ratio: auto; height: 76vw; }
    .h-hero__art img { object-fit: cover; object-position: 76% 100%; }
    html body .h-hero--banner h1 span { display: inline; }
    html body .h-hero--banner .h-hero__cta .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .h-hero__art img { animation: none; } }

/* active page in the top menu: gradient underline (as in the mock-up) */
html body .main-nav ul li > a.active-link { background: transparent; color: #fff; position: relative; }
html body .main-nav ul li > a.active-link::after {
    content: ""; position: absolute; left: 16px; right: 16px; bottom: 2px; height: 2px; border-radius: 2px;
    background: var(--spim-grad);
}
