:root {
    --bg: #0b0d12;
    --panel-bg: #0c0f14;
    --edge: rgba(255,255,255,.08);
    --txt: #e6e8ee;
    --muted: #98a2b3;
    /* Brand glow palette (dark -> light) */
    --ac1: #2C1B3E; /* dark */
    --ac2: #64398C; /* light */

    /* Compatibility vars used by docs/demo scripts */
    --primary-purple: var(--ac2);
    --secondary-purple: var(--ac1);
    --border-color: var(--edge);
    --text-primary: var(--txt);
    --text-secondary: var(--muted);
    --bg-dark: #0e1018;

    --accent-glow: rgba(44, 27, 62, 0.28);
    --card-bg: color-mix(in srgb, var(--bg) 96%, rgba(100, 57, 140, 0.22));
    --gradient-primary: linear-gradient(135deg, var(--ac1) 0%, var(--ac2) 100%);
    --gradient-card: radial-gradient(120% 140% at 15% -10%, color-mix(in srgb, var(--ac1) 12%, transparent) 0%, transparent 60%),
                     linear-gradient(180deg, color-mix(in srgb, var(--bg) 96%, rgba(100, 57, 140, 0.14)) 0%, color-mix(in srgb, var(--bg) 100%, transparent) 100%);
    --shadow-card: 0 18px 55px rgba(0,0,0,.70), 0 0 0 1px rgba(0,0,0,.6);
    --shadow-btn-primary: inset 0 1px 0 rgba(255,255,255,.10),
                          0 0 0 1px color-mix(in srgb, var(--ac2) 28%, transparent),
                          0 10px 28px rgba(100, 57, 140, .22);
    --shadow-btn-hover: inset 0 1px 0 rgba(255,255,255,.14),
                        0 0 0 1px color-mix(in srgb, var(--ac2) 38%, transparent),
                        0 14px 34px rgba(100, 57, 140, 0.22);
}

/* ==========================================
   Custom Fonts (local files)
   ========================================== */
@font-face {
    font-family: "Widock Trial";
    src: url("/assets/Widock TRIAL Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "TT Neoris Trial";
    src: url("/assets/TT_Neoris_Trial_DemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cy Grotesk Grand";
    src: url("/assets/cy-grotesk-grand-6.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

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

html {
    scroll-behavior: smooth;
}

/* When Lenis is enabled, disable native smooth scroll to prevent conflicts */
html.has-lenis {
    scroll-behavior: auto !important;
}

body {
    font-family: "Cy Grotesk Grand", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--txt);
    overflow-x: hidden;
}

/* ==========================================
   Page load sequence (background -> brand -> content)
   ========================================== */
body.is-preload .nav-content {
    opacity: 0;
    transform: translateY(-22px);
}

body.is-ready .nav-content {
    opacity: 1;
    transform: translateY(0);
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.7s ease;
    transition-delay: 0.12s;
}

body.is-preload .hero-brand,
body.is-preload .hero-title-plain,
body.is-preload .hero-subtitle,
body.is-preload .hero-kicker,
body.is-preload .hero-buttons {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(2px);
}

body.is-ready .hero-brand,
body.is-ready .hero-title-plain,
body.is-ready .hero-subtitle,
body.is-ready .hero-kicker,
body.is-ready .hero-buttons {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition:
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.8s ease,
        filter 0.8s ease;
}

/* Stagger timing */
body.is-ready .hero-brand { transition-delay: 0.22s; }
body.is-ready .hero-title-plain { transition-delay: 0.32s; }
body.is-ready .hero-subtitle { transition-delay: 0.44s; }
body.is-ready .hero-kicker { transition-delay: 0.56s; }
body.is-ready .hero-buttons { transition-delay: 0.68s; }

/* Headings */
h1, h2, h3, h4, h5, h6,
.section-title,
.feature-title,
.pricing-title,
.card-title {
    font-family: "Cy Grotesk Grand", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: rgba(255,255,255,.90);
}

/* Brand name only */
.logo-text,
.hero-title .gradient-text {
    font-family: "Widock Trial", "TT Neoris Trial", "Cy Grotesk Grand", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 700;
}

/* Two-line brand lockup */
.brand-stack {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.0;
}

.brand-line {
    display: block;
}

/* Keep header logo compact */
.navbar .logo-text.brand-stack {
    line-height: 0.95;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(11, 13, 18, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--edge);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(11, 13, 18, 0.98);
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--txt);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.cta-button {
    height: 36px;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(157,78,221,.8);
    background: linear-gradient(180deg, rgba(157,78,221,.30), rgba(124,58,237,.28));
    box-shadow: inset 0 0 0 1px rgba(157,78,221,.45), 0 8px 22px rgba(157,78,221,.30);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

/* Navbar "Login" button: same look/feel as primary hero button, but compact */
.nav-login-btn {
    height: 36px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: "Cy Grotesk Grand", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    letter-spacing: -0.01em;
    line-height: 1;
    min-width: auto;
}

.cta-button:hover {
    transform: translateY(-1px);
    filter: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.cta-button:active {
    transform: translateY(0);
}

.burger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.burger span {
    width: 25px;
    height: 3px;
    background: var(--txt);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 90px;
    overflow: hidden;
    background: var(--bg);
}

/* =====================
   Section FX Canvases
   ===================== */
.fx-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    mix-blend-mode: screen;
    will-change: transform, opacity;
    transform: translateZ(0);
    contain: strict;
}

/* Keep section content above FX layers */
.hero .container,
.demo-section .container,
.features .container,
.pricing-section .container {
    position: relative;
    z-index: 2;
}

.hero-scanlines {
    opacity: 0.75;
    mix-blend-mode: normal;
}

.features-orbits {
    opacity: 0.55;
    /* Используем наследованные от .fx-canvas стили: position: absolute, inset: 0 */
}

.demo-meteors {
    /* Must stay visually under the demo UI (no blend-mode that mixes over content) */
    opacity: 0.55;
    mix-blend-mode: normal;
}

.pricing-constellation {
    opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
    .fx-canvas { display: none; }
}

/* Hero background image (Fon.png) painted as ::before so it can be "fixed" and clipped by hero */
.hero::before {
    content: "";
    position: absolute;
    inset: -4%;
    z-index: 0;
    pointer-events: none;
    background-image: url("/assets/Fon.png");
    background-size: cover;
    background-repeat: no-repeat;
    /* Cursor: X only, Scroll: move background down via background-position */
    background-attachment: fixed;
    background-position:
        calc(50% + var(--bg-px, 0px))
        calc(20% + var(--bg-scroll, 0px));
    transform: translate3d(var(--bg-tx, 0px), 0, 0) scale(1.06);
    transform-origin: 50% 50%;
    will-change: transform, opacity, background-position;
    opacity: 1;
}

/* Ensure FX canvas sits above hero background image but under content */
.hero .fx-canvas {
    z-index: 1;
}

@media (max-width: 768px) {
    .hero::before {
        background-attachment: scroll;
    }
}

/* Fade-in for background during page load sequence */
body.is-preload .hero::before { opacity: 0; }
body.is-ready .hero::before {
    opacity: 1;
    transition: opacity 1.0s ease;
    transition-delay: 0s;
}

/* Keep behavior consistent on mobile (no background-attachment needed) */


.hero .container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.25rem;
    align-items: center;
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--ac2) 18%, var(--edge));
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
    color: color-mix(in srgb, var(--txt) 88%, var(--muted));
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.hero-title {
    /* Title wrapper: sizing handled by .hero-brand + .hero-title-plain */
    font-size: inherit;
    font-weight: 950;
    line-height: 1.03;
    margin-bottom: 1.2rem;
    letter-spacing: -0.03em;
}

/* Main brand in hero (Cosmos / Panel) */
.hero-brand {
    display: inline-flex;
    flex-direction: column;
    font-size: clamp(2.6rem, 6.6vw, 7.8rem);
    line-height: 0.95;
}

/* Make hero brand white (override gradient only inside hero title) */
.hero-title .hero-brand .gradient-text {
    background: none;
    -webkit-text-fill-color: #ffffff;
    color: #ffffff;
    text-shadow: 0 0 26px rgba(255,255,255,.12);
}

.hero-title-plain {
    display: block;
    font-family: "Cy Grotesk Grand", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: clamp(1.15rem, 2.5vw, 2.15rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: rgba(255,255,255,.78);
    margin-top: 16px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
    background-size: 200% 200%;
    text-shadow: 0 0 18px color-mix(in srgb, var(--ac2) 26%, transparent);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: clamp(1.0rem, 1.4vw, 1.25rem);
    color: color-mix(in srgb, var(--muted) 92%, rgba(255,255,255,.15));
    margin-bottom: 1.4rem;
    max-width: 620px;
    line-height: 1.75;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Hero button labels: heading font + bold + gradient text */
.hero-buttons .hero-btn .btn-label {
    font-family: "Cy Grotesk Grand", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: rgba(255,255,255,.92);
}

.hero-btn {
    height: 48px;
    min-width: 176px;
    padding: 0 18px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.22s ease, border-color 0.2s ease, filter 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
}

.btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
}

.btn-svg {
    width: 16px;
    height: 16px;
    stroke: rgba(255,255,255,.95);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-primary {
    position: relative;
    background: linear-gradient(135deg, rgba(108, 30, 203, 0.95), rgba(72, 16, 156, 0.85));
    border: 1px solid color-mix(in srgb, var(--ac2) 35%, transparent);
    color: white;
    box-shadow: var(--shadow-btn-primary);
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: radial-gradient(500px 120px at 20% 0%, rgba(255,255,255,.22), transparent 60%),
                radial-gradient(500px 120px at 80% 100%, rgba(255,255,255,.12), transparent 65%);
    opacity: 0.75;
    pointer-events: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn-primary);
    filter: none;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
    color: rgba(255,255,255,.92);
    border: 1px solid color-mix(in srgb, #fff 12%, var(--edge));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
    border-color: color-mix(in srgb, var(--ac2) 25%, var(--edge));
    box-shadow: none;
}

.btn-secondary:active {
    transform: translateY(0);
}


.floating-card {
    position: absolute;
    border-radius: 16px;
    padding: 1.2rem 1.25rem;
    backdrop-filter: blur(14px);
    animation: float 6s ease-in-out infinite;
    background: var(--gradient-card);
    border: 1px solid var(--edge);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04),
                0 18px 42px rgba(0,0,0,.32);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.floating-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(120% 140% at 15% -10%, color-mix(in srgb, var(--ac1) 22%, transparent) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.floating-card:hover {
    transform: translateY(-8px);
    border-color: color-mix(in srgb, var(--ac2) 30%, var(--edge));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08),
                0 0 0 1px color-mix(in srgb, var(--ac2) 20%, transparent),
                0 20px 48px rgba(100, 57, 140, .18);
    animation-play-state: paused;
}

.floating-card:hover::before {
    opacity: 1;
}

.card-1 {
    top: 10%;
    left: 0;
    width: 290px;
    animation-delay: 0s;
}

.card-2 {
    top: 38%;
    right: 0;
    width: 270px;
    animation-delay: 2s;
}

.card-3 {
    bottom: 12%;
    left: 18%;
    width: 310px;
    animation-delay: 4s;
}

.card-4 {
    top: 64%;
    right: 14%;
    width: 280px;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-18px) scale(1.02); }
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
    position: relative;
    z-index: 1;
}

.card-title {
    font-weight: 600;
}

.card-stat {
    font-size: 1.35rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--ac2) 26%, transparent), color-mix(in srgb, var(--ac1) 20%, transparent));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ac2) 22%, transparent), 0 10px 26px rgba(100, 57, 140, .14);
    border: 1px solid rgba(255,255,255,.08);
}

.card-svg {
    width: 22px;
    height: 22px;
    stroke: rgba(255,255,255,.94);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.features {
    padding: 50px 0;
    background: var(--panel-bg);
    position: relative;
    /* Fixed height for all feature tiles (uniform cards) */
    --feature-tile-height: 570px;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--edge), transparent);
    z-index: 1;
    pointer-events: none;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.demo-section .section-header {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: rgba(255,255,255,.78);
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

/* ==========================================
   Features Slider (carousel of the existing feature tiles)
   ========================================== */
.features-slider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.features-slider-controls {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.features-slider-btn {
    --size: 44px;
    width: var(--size);
    height: var(--size);
    border-radius: 14px;
    border: 1px solid var(--edge);
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
    color: rgba(255,255,255,.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s ease, border-color .2s ease, background .2s ease, opacity .2s ease;
    flex: 0 0 auto;
}

.features-slider-btn:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--ac2) 25%, var(--edge));
}

.features-slider-btn:active {
    transform: translateY(0);
}

.features-grid.features-carousel {
    /* Override the grid layout for the carousel mode */
    display: block;
    position: relative;
    isolation: isolate;
    /* Stronger (more pronounced) perspective */
    perspective: 640px;
    transform-style: preserve-3d;
    /* Slide sizing */
    --feat-slide-width: min(360px, 78vw);
    /* Tighter spacing so 7 tiles are visible at once (+200px extra spacing total) */
    --feat-slide-offset: calc(var(--feat-slide-width) * 0.72 + 200px);

    width: min(100%, calc(var(--feat-slide-width) * 3 + 120px));
    margin: 0 auto;
    /* Height is set by JS to the tallest card */
    min-height: 520px;
}

.features-grid.features-carousel .feature-card {
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--feat-slide-width);
    max-width: 100%;
    margin: 0;

    /* Slider transform pipeline */
    transform:
        translateX(-50%)
        translateX(var(--feat-tx, 0px))
        translateY(var(--feat-ty, 0px))
        translateZ(var(--feat-tz, -200px))
        rotateY(var(--feat-rotY, 0deg))
        scale(var(--feat-scale, 0));

    opacity: var(--feat-opacity, 0);
    filter: var(--feat-filter, none);
    z-index: var(--feat-z, 1);
    pointer-events: none;

    transition:
        transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 600ms ease,
        filter 450ms ease;
}

.features-grid.features-carousel .feature-card[data-current] {
    --feat-tx: 0px;
    /* Exclusive central-tile effect (always on) */
    --feat-ty: -8px;
    --feat-rotY: 0deg;
    --feat-tz: 0px;
    --feat-scale: 1;
    --feat-opacity: 1;
    --feat-filter: none;
    --feat-z: 10;
    pointer-events: auto;
}

/* Always-on highlight/glow for the central tile (without hover) */
.features-grid.features-carousel .feature-card[data-current] {
    border-color: color-mix(in srgb, var(--ac2) 30%, var(--edge));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08),
                0 0 0 1px color-mix(in srgb, var(--ac2) 20%, transparent),
                0 18px 42px color-mix(in srgb, var(--ac2) 14%, transparent),
                0 0 34px color-mix(in srgb, var(--ac2) 10%, transparent),
                0 0 70px color-mix(in srgb, var(--ac2) 6%, transparent);
    filter: saturate(1.03);
}

.features-grid.features-carousel .feature-card[data-current]::before,
.features-grid.features-carousel .feature-card[data-current]::after {
    opacity: 0.125;
}

/* Icon glow (same as hover, but always on for the central tile) */
.features-grid.features-carousel .feature-card[data-current] .feature-icon::after {
    opacity: .9;
    animation: orbit 2.2s linear infinite;
}

/* Position tiers: data-pos = -3..3 (7 tiles visible) */
.features-grid.features-carousel .feature-card[data-pos="1"] {
    --feat-tx: var(--feat-slide-offset);
    /* Exponential progression (k^n): mild step */
    --feat-rotY: -34deg;
    --feat-tz: -180px;
    --feat-scale: 0.88;
    --feat-opacity: 0.90;
    --feat-filter: brightness(0.84) saturate(0.92) blur(0.75px);
    --feat-z: 9;
}

.features-grid.features-carousel .feature-card[data-pos="-1"] {
    --feat-tx: calc(-1 * var(--feat-slide-offset));
    --feat-rotY: 34deg;
    --feat-tz: -180px;
    --feat-scale: 0.88;
    --feat-opacity: 0.90;
    --feat-filter: brightness(0.84) saturate(0.92) blur(0.75px);
    --feat-z: 9;
}

.features-grid.features-carousel .feature-card[data-pos="2"] {
    --feat-tx: calc(var(--feat-slide-offset) * 2);
    /* Exponential progression: stronger step (roughly x1.65 vs pos=1) */
    --feat-rotY: -92deg;
    --feat-tz: -340px;
    --feat-scale: 0.72;
    --feat-opacity: 0.55;
    --feat-filter: brightness(0.76) saturate(0.65) blur(1.95px);
    --feat-z: 8;
}

.features-grid.features-carousel .feature-card[data-pos="-2"] {
    --feat-tx: calc(var(--feat-slide-offset) * -2);
    --feat-rotY: 92deg;
    --feat-tz: -340px;
    --feat-scale: 0.72;
    --feat-opacity: 0.55;
    --feat-filter: brightness(0.76) saturate(0.65) blur(1.95px);
    --feat-z: 8;
}

.features-grid.features-carousel .feature-card[data-pos="3"] {
    --feat-tx: calc(var(--feat-slide-offset) * 3);
    /* Exponential progression: strongest step (roughly x1.6 vs pos=2) */
    --feat-rotY: -124deg;
    --feat-tz: -560px;
    --feat-scale: 0.58;
    --feat-opacity: 0.25;
    --feat-filter: brightness(0.68) saturate(0.40) blur(3.60px);
    --feat-z: 7;
}

.features-grid.features-carousel .feature-card[data-pos="-3"] {
    --feat-tx: calc(var(--feat-slide-offset) * -3);
    --feat-rotY: 124deg;
    --feat-tz: -560px;
    --feat-scale: 0.58;
    --feat-opacity: 0.25;
    --feat-filter: brightness(0.68) saturate(0.40) blur(3.60px);
    --feat-z: 7;
}

/* Tiles without data-pos: collapse/disappear in place (scale to 0, fade out, move back in Z) */
.features-grid.features-carousel .feature-card:not([data-pos]) {
    --feat-scale: 0;
    --feat-opacity: 0;
    --feat-tz: -200px;
    --feat-tx: 0px;
    --feat-ty: 0px;
    --feat-rotY: 0deg;
}

/* Prevent the global `.feature-card:hover { transform: ... }` rule from breaking carousel positioning */
.features-grid.features-carousel .feature-card:hover {
    transform:
        translateX(-50%)
        translateX(var(--feat-tx, 0px))
        translateY(var(--feat-ty, 0px))
        translateZ(var(--feat-tz, 0px))
        rotateY(var(--feat-rotY, 0deg))
        scale(var(--feat-scale, 0.94));
}

@media (max-width: 900px) {
    .features-grid.features-carousel {
        width: min(100%, calc(var(--feat-slide-width) * 1 + 20px));
        /* On small screens keep it readable: show current + 1 on each side */
        --feat-slide-offset: calc(var(--feat-slide-width) * 0.86);
    }

    .features-slider-btn {
        --size: 42px;
    }
}

@media (max-width: 900px) {
    /* Hide far tiles on small screens (keep 3 visible) */
    .features-grid.features-carousel .feature-card[data-pos="2"],
    .features-grid.features-carousel .feature-card[data-pos="-2"],
    .features-grid.features-carousel .feature-card[data-pos="3"],
    .features-grid.features-carousel .feature-card[data-pos="-3"] {
        --feat-opacity: 0;
        pointer-events: none;
    }
}

.feature-card {
    background: var(--gradient-card);
    border: 1px solid var(--edge);
    border-radius: 16px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    transform-style: preserve-3d;
    will-change: transform;
}

/* Force identical height for every tile in the Features section */
.features .feature-card {
    height: var(--feature-tile-height);
    min-height: var(--feature-tile-height);
}

@media (max-width: 640px) {
    .features {
        --feature-tile-height: 510px;
    }
}

/* Feature tile header: icon + title in one row */
.feature-card {
    --feature-icon-size: 52px;
    --feature-header-shift: -6px; /* lift icon+title slightly */
    /* Fixed description height baseline (take Subs as the reference) */
    --feature-desc-lines: 2;
    display: grid;
    grid-template-columns: var(--feature-icon-size) 1fr;
    grid-template-areas:
        "icon title"
        "desc desc"
        "list list";
    column-gap: 14px;
    row-gap: 24px;
    align-items: start;
}

.feature-card > .feature-icon {
    grid-area: icon;
    margin-bottom: 0; /* old stacked layout spacing */
    width: var(--feature-icon-size);
    height: var(--feature-icon-size);
    align-self: center;
    transform: translateY(var(--feature-header-shift));
}

.feature-card > .feature-title {
    grid-area: title;
    margin: 0; /* align with icon nicely */
    align-self: center;
    transform: translateY(var(--feature-header-shift));
}

.feature-card > .feature-description {
    grid-area: desc;
    margin: 0;
    /* Allow normal wrapping to next line */
    overflow: visible;
    display: block;
    white-space: normal;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    -webkit-box-orient: unset;
}

.feature-card > .feature-list {
    grid-area: list;
    margin: 0;
    margin-top: 24px;
}

/* Keep list items aligned (avoid multi-line wrapping shifting rows) */
.feature-card > .feature-list li {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Glow wash + dynamic light hotspot (controlled by --hl-x/--hl-y) */
    background:
        radial-gradient(
            165% 155% at var(--hl-x, 50%) var(--hl-y, -12%),
            color-mix(in srgb, rgba(255,255,255,.55) 14%, var(--ac2)) 0%,
            transparent 80%
        ),
        radial-gradient(95% 115% at 15% -10%, color-mix(in srgb, var(--ac2) 42%, transparent) 0%, transparent 58%),
        radial-gradient(75% 95% at 85% 20%, color-mix(in srgb, var(--ac2) 18%, transparent) 0%, transparent 56%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* Specular highlight that follows the tilt/light */
    background:
        radial-gradient(
            165% 125% at var(--hl-x, 50%) var(--hl-y, -12%),
            rgba(100,57,140,.22) 0%,
            rgba(100,57,140,.10) 28%,
            transparent 82%
        );
    opacity: 0;
    transition: opacity 0.35s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: color-mix(in srgb, var(--ac2) 30%, var(--edge));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08),
                0 0 0 1px color-mix(in srgb, var(--ac2) 20%, transparent),
                /* Colored glow layers (near + far) */
                0 18px 42px color-mix(in srgb, var(--ac2) 14%, transparent),
                0 0 34px color-mix(in srgb, var(--ac2) 10%, transparent),
                0 0 70px color-mix(in srgb, var(--ac2) 6%, transparent);
    filter: saturate(1.03);
}

.feature-card:hover::before {
    opacity: 0.125;
}

.feature-card:hover::after {
    opacity: 0.125;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ac2) 28%, transparent),
                0 8px 24px rgba(100, 57, 140, .18);
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.feature-description {
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.feature-list {
    list-style: none;
    position: relative;
    z-index: 1;
}

.feature-list li {
    color: var(--muted);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.35;
}

.feature-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--ac2);
}

.demo-section {
    padding: 50px 0;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.demo-container {
    background: var(--gradient-card);
    border: 1px solid var(--edge);
    border-radius: 16px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 800px;
    box-shadow: var(--shadow-card);
}

.demo-sidebar {
    background: rgba(11, 13, 18, 0.6);
    border-right: 1px solid var(--edge);
    padding: 1.5rem 0;
}

.demo-nav-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
    font-weight: 600;
    border-left: 3px solid transparent;
}

.demo-nav-item:hover {
    background: color-mix(in srgb, var(--ac1) 10%, transparent);
    color: var(--txt);
}

.demo-nav-item.active {
    background: color-mix(in srgb, var(--ac1) 14%, transparent);
    color: var(--txt);
    border-left-color: var(--ac2);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac2) 14%, transparent);
}

.demo-icon {
    font-size: 1.5rem;
}

.demo-content {
    padding: 3rem;
    overflow-y: auto;
}

.logo-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(104, 56, 177, 0.25));
}

.footer .footer-logo-icon {
    width: 26px;
    height: 26px;
    opacity: 0.85;
    filter: drop-shadow(0 0 6px rgba(123, 56, 248, 0.18));
}


@media (max-width: 1100px) {
    .hero .container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-top: 10px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 1.25rem;
    }

    .hero-brand {
        font-size: clamp(2.35rem, 13vw, 5.7rem);
    }

    .hero-buttons {
        gap: 10px;
    }

    .hero-btn {
        min-width: 100%;
    }

}


/* Feature icons — panel style (like nav-icon) */
.feature-icon{
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: radial-gradient(55% 55% at 30% 30%, rgba(255,255,255,.06), rgba(0,0,0,0));
    border: 1px solid rgba(255,255,255,.12);
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.02), 0 0 16px rgba(100, 57, 140, .14);
}

/* Glow ring (conic) */
.feature-icon::after{
    content:"";
    position:absolute;
    inset:-1px;
    border-radius: 16px;
    background: conic-gradient(
        from 0deg,
        rgba(157,78,221,0),
        rgba(157,78,221,.55),
        rgba(139, 58, 237, 0) 70%
    );
    filter: blur(8px);
    opacity: 0;
    transition: opacity .3s ease;
}

