/* ============================================================
   AlNakhli — "Digital Palm" design layer
   Loaded only by the public layout (views/layouts/main.php) on top of style.css.
   Palette: deep navy + electric blue light streaks + frosted glass.
   Contrast: body text >= 7:1, secondary >= 4.5:1 on every surface used here.
   ============================================================ */

@property --spin {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

:root[data-fx] {
    /* Surfaces */
    --bg-0: #020817;
    --bg-1: #041230;
    --bg-2: #071a45;
    --glass: rgba(8, 26, 72, 0.8);
    --glass-strong: rgba(6, 20, 58, 0.78);
    --glass-hover: rgba(14, 40, 104, 0.62);
    --glass-border: rgba(120, 172, 255, 0.18);
    --glass-border-hi: rgba(140, 190, 255, 0.42);

    /* Blues */
    --blue-700: #1d4ed8;
    --blue-600: #2563eb;
    --blue-500: #2f74ff;
    --blue-400: #4f8fff;
    --blue-300: #7db8ff;
    --cyan-300: #7fd8ff;

    /* Text (checked against --bg-2, the lightest surface) */
    --ink-1: #f3f7ff;   /* 15.7:1 */
    --ink-2: #c3d2ee;   /* 11.1:1 */
    --ink-3: #93a8cf;   /*  7.0:1 */

    /* Map onto the legacy tokens used by style.css */
    --bg-primary: var(--bg-0);
    --bg-secondary: var(--bg-1);
    --bg-card: var(--glass);
    --bg-card-hover: var(--glass-hover);
    --bg-input: rgba(3, 12, 36, 0.72);
    --bg-navbar: rgba(2, 8, 23, 0.92);
    --text-primary: var(--ink-1);
    --text-secondary: var(--ink-2);
    --text-muted: var(--ink-3);
    --accent: var(--blue-300);
    --accent-hover: #a9d0ff;
    --accent-glow: rgba(47, 116, 255, 0.45);
    --accent-soft: rgba(47, 116, 255, 0.14);
    --border-color: var(--glass-border);
    --border-accent: rgba(125, 184, 255, 0.35);
    --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 40px rgba(47, 116, 255, 0.25);
    --gradient-accent: linear-gradient(135deg, var(--blue-700), var(--blue-600));
    --gradient-card: linear-gradient(160deg, rgba(16, 44, 112, 0.72), rgba(5, 15, 44, 0.88));

    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 28px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --font-main: 'Space Grotesk', 'IBM Plex Sans Arabic', system-ui, sans-serif;
    --font-ar: 'IBM Plex Sans Arabic', 'Space Grotesk', system-ui, sans-serif;

    color-scheme: dark;
    background: var(--bg-0);
}

/* ---------- Base ---------- */
body.fx {
    /* Transparent so the fixed background layers (negative z-index) show through */
    background: transparent;
    color: var(--ink-1);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
[dir="rtl"] body.fx { font-family: var(--font-ar); }

/* Static background: works with or without WebGL */
body.fx::before {
    z-index: -3;
    background:
        radial-gradient(60vw 50vh at 85% 10%, rgba(37, 99, 235, 0.28), transparent 70%),
        radial-gradient(50vw 60vh at 0% 100%, rgba(29, 78, 216, 0.30), transparent 70%),
        linear-gradient(180deg, #020817 0%, #041230 55%, #020817 100%);
}
/* Vignette + fine grain keep text readable over the scene */
body.fx::after {
    z-index: -1;
    background:
        radial-gradient(120% 80% at 50% 40%, transparent 40%, rgba(1, 5, 15, 0.75) 100%),
        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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#fx-scene {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.4s var(--ease-out);
}
#fx-scene.ready { opacity: 1; }

/* Cursor spotlight */
.fx-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 840px;
    height: 840px;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(closest-side, rgba(79, 143, 255, 0.10), transparent 70%);
    transform: translate3d(calc(50vw - 420px), calc(30vh - 420px), 0);
    will-change: transform;
}

/* Scroll progress */
.fx-progress {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    height: 2px;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(var(--p, 0));
    background: linear-gradient(90deg, var(--blue-600), var(--cyan-300));
    box-shadow: 0 0 12px var(--blue-400);
    z-index: 1200;
}
[dir="rtl"] .fx-progress { transform-origin: right center; }

::selection { background: rgba(79, 143, 255, 0.45); color: #fff; }
body.fx ::-webkit-scrollbar-track { background: var(--bg-0); }
body.fx ::-webkit-scrollbar-thumb { background: linear-gradient(var(--blue-600), var(--blue-400)); }

body.fx h1, body.fx h2, body.fx h3, body.fx h4 { color: var(--ink-1); letter-spacing: -0.01em; }
[dir="ltr"] body.fx h1, [dir="ltr"] body.fx h2 { letter-spacing: -0.03em; }
body.fx p { color: var(--ink-2); }
body.fx a { color: var(--blue-300); }
body.fx a:hover { color: var(--accent-hover); }
body.fx .text-accent { color: var(--blue-300) !important; }

body.fx :focus-visible {
    outline: 2px solid var(--cyan-300);
    outline-offset: 3px;
    border-radius: 6px;
}

.fx-gradient-text {
    background: linear-gradient(100deg, #ffffff 0%, var(--blue-300) 45%, var(--cyan-300) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Navbar ---------- */
body.fx .navbar {
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.4s, border-color 0.4s;
}
body.fx .navbar.scrolled {
    background: var(--bg-navbar);
    border-bottom-color: var(--glass-border);
    box-shadow: none !important;
}
body.fx .navbar-brand { color: var(--ink-1); font-weight: 700; }
body.fx .nav-links a {
    color: var(--ink-2);
    border-radius: 999px;
    position: relative;
}
body.fx .nav-links a:hover,
body.fx .nav-links a.active {
    color: #fff;
    background: rgba(79, 143, 255, 0.14);
}
body.fx .nav-links a.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--cyan-300);
    box-shadow: 0 0 8px var(--cyan-300);
    transform: translateX(-50%);
}
body.fx .nav-toggle-btn,
body.fx .mobile-toggle {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--ink-1);
}

/* ---------- Buttons ---------- */
body.fx .btn {
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s, background 0.35s, color 0.2s;
    will-change: transform;
}
body.fx .btn-primary {
    background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
    color: #fff;                         /* 5.2:1 or better on both stops */
    border: 1px solid rgba(160, 200, 255, 0.35);
    box-shadow: 0 10px 30px -8px rgba(37, 99, 235, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    position: relative;
    overflow: hidden;
}
body.fx .btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.9s var(--ease-out);
}
body.fx .btn-primary:hover::after { transform: translateX(120%); }
body.fx .btn-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 16px 40px -10px rgba(47, 116, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
body.fx .btn-outline {
    background: rgba(8, 26, 72, 0.72);
    color: var(--ink-1);
    border: 1px solid var(--glass-border-hi);
}
body.fx .btn-outline:hover {
    background: rgba(47, 116, 255, 0.2);
    color: #fff;
    border-color: var(--blue-300);
    transform: translateY(-2px);
}
body.fx .btn-ghost { color: var(--ink-2); }

/* ---------- Glass surfaces ---------- */
body.fx .card,
body.fx .service-card,
body.fx .stat-card,
body.fx .faq-item,
body.fx .table-wrap {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body.fx .card:hover,
body.fx .service-card:hover {
    border-color: var(--glass-border-hi);
    box-shadow: var(--shadow), 0 0 0 1px rgba(125, 184, 255, 0.12), 0 0 50px -10px rgba(47, 116, 255, 0.45);
}
body.fx .card p, body.fx .service-card p { color: var(--ink-2); }

body.fx .card-icon,
body.fx .stat-icon {
    background: linear-gradient(145deg, rgba(47, 116, 255, 0.28), rgba(29, 78, 216, 0.12));
    border: 1px solid rgba(125, 184, 255, 0.3);
    color: var(--blue-300);
    border-radius: 16px;
    box-shadow: inset 0 0 20px rgba(79, 143, 255, 0.2), 0 0 24px -6px rgba(47, 116, 255, 0.6);
}

/* 3D tilt (set by fx.js). Beats legacy :hover translateY rules in style.css. */
body.fx [data-tilt],
body.fx [data-tilt]:hover {
    transform-style: preserve-3d;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
    transition: transform 0.6s var(--ease-out), opacity 0.9s var(--ease-out), filter 0.9s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
    transition-delay: var(--d, 0s);
}
body.fx [data-tilt].tilting { transition: transform 0.08s linear, border-color 0.3s, box-shadow 0.3s; }
[data-tilt] > * { transform: translateZ(28px); }
[data-tilt]::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(125, 184, 255, 0.16), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
[data-tilt]:hover::after { opacity: 1; }
body.fx .card, body.fx .service-card { position: relative; }

/* Reveal on scroll */
[data-reveal] {
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
    transition-delay: var(--d, 0s);
}
body.fx [data-reveal]:not(.in) {
    opacity: 0;
    transform: translate3d(0, 40px, 0) scale(0.98);
}

/* ---------- Hero ---------- */
body.fx .hero.hero-fx {
    min-height: 100vh;
    min-height: 100svh;
    padding: 7rem 0 5rem;
    overflow: visible;
}
body.fx .hero.hero-fx::before { display: none; }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
}
.hero-fx .hero-content { position: relative; }
/* Soft scrim behind copy so it stays readable over moving light */
.hero-fx .hero-content::before {
    content: '';
    position: absolute;
    inset: -12% -18%;
    z-index: -1;
    background: radial-gradient(closest-side, rgba(2, 8, 23, 0.72), rgba(2, 8, 23, 0.35) 60%, transparent);
}
.hero-fx h1 {
    font-size: clamp(2.5rem, 5.6vw, 4.6rem);
    line-height: 1.08;
    font-weight: 700;
    margin-bottom: 1.4rem;
    text-shadow: 0 2px 30px rgba(2, 8, 23, 0.8);
}
[dir="rtl"] .hero-fx h1 { line-height: 1.3; }
.hero-fx .hero-lead {
    font-size: clamp(1.02rem, 1.4vw, 1.2rem);
    color: var(--ink-2);
    max-width: 560px;
    margin-bottom: 2.2rem;
    line-height: 1.85;
}
body.fx .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem 0.45rem 0.8rem;
    background: rgba(8, 26, 72, 0.85);
    border: 1px solid var(--glass-border-hi);
    color: var(--ink-1);
    font-weight: 500;
    letter-spacing: 0.01em;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan-300);
    box-shadow: 0 0 0 0 rgba(127, 216, 255, 0.7);
    animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(127, 216, 255, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(127, 216, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(127, 216, 255, 0); }
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 2.4rem;
    list-style: none;
}
.hero-chips li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    color: var(--ink-2);
    background: rgba(4, 18, 48, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
}
.hero-chips i { color: var(--blue-300); }


.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 1.6rem;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink-3);
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}
.scroll-cue .mouse {
    width: 22px;
    height: 34px;
    border: 1.5px solid var(--glass-border-hi);
    border-radius: 12px;
    position: relative;
}
.scroll-cue .mouse::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    width: 3px;
    height: 7px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--cyan-300);
    animation: wheel 1.8s infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }

/* ---------- Marquee band ---------- */
.fx-marquee {
    position: relative;
    overflow: hidden;
    padding: 1.3rem 0;
    border-block: 1px solid var(--glass-border);
    background: rgba(2, 10, 30, 0.82);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.fx-marquee-track {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: marquee 38s linear infinite;
}
[dir="rtl"] .fx-marquee-track { animation-direction: reverse; }
.fx-marquee span {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
}
.fx-marquee span i { color: var(--blue-400); font-size: 0.6rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
body.fx .section { position: relative; padding: 7rem 0; }
body.fx .section-alt { background: linear-gradient(180deg, transparent, rgba(4, 18, 48, 0.55) 20%, rgba(4, 18, 48, 0.55) 80%, transparent); }
body.fx .section-header { margin-bottom: 3.5rem; }
body.fx .section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
}
body.fx .section-header p { color: var(--ink-2); font-size: 1.08rem; }
.section-kicker {
    display: inline-block;
    margin-bottom: 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cyan-300);
}
body.fx .accent-line {
    width: 72px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--blue-400), var(--cyan-300), transparent);
    box-shadow: 0 0 14px var(--blue-400);
}

/* Services */
body.fx .service-premium-card {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
/* Rotating light border, shown on hover */
body.fx .service-premium-card::before {
    inset: 0;
    width: auto;
    height: auto;
    padding: 1px;
    border-radius: inherit;
    transform: none;
    opacity: 0;
    background: conic-gradient(from var(--spin), transparent 0 65%, var(--blue-400) 78%, var(--cyan-300) 84%, transparent 92%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: spin 5s linear infinite paused;
    transition: opacity 0.4s;
}
body.fx .service-premium-card:hover::before { opacity: 1; transform: none; animation-play-state: running; }
@keyframes spin { to { --spin: 360deg; } }
body.fx .service-premium-card .card-glow {
    background: radial-gradient(420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(79, 143, 255, 0.22), transparent 60%);
}
body.fx .service-icon-box {
    background: linear-gradient(145deg, rgba(47, 116, 255, 0.3), rgba(29, 78, 216, 0.1));
    border: 1px solid rgba(125, 184, 255, 0.32);
    color: var(--cyan-300);
    box-shadow: 0 0 30px -6px rgba(47, 116, 255, 0.8);
}
body.fx .service-premium-card h3 { color: var(--ink-1); }
body.fx .service-premium-card p { color: var(--ink-2); }
body.fx .service-link { color: var(--blue-300); }
body.fx .service-link:hover { color: #fff; }

/* Steps timeline */
body.fx .steps-grid { position: relative; }
body.fx .steps-grid::before {
    content: '';
    position: absolute;
    top: 46px;
    inset-inline: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(125, 184, 255, 0.45), transparent);
}
body.fx .step-number {
    background: radial-gradient(circle at 30% 30%, var(--blue-500), var(--blue-700));
    color: #fff;
    border: 1px solid rgba(170, 210, 255, 0.5);
    box-shadow: 0 0 0 6px rgba(47, 116, 255, 0.12), 0 0 30px rgba(47, 116, 255, 0.7);
    font-family: 'Space Grotesk', sans-serif;
}

/* Testimonials */
body.fx .testimonial-card .stars i { color: #ffc861; }
body.fx .testimonial-card .quote { color: var(--ink-1); }
body.fx .author-avatar { background: var(--gradient-accent); color: #fff; }
body.fx .author-role { color: var(--ink-3); }

/* FAQ */
body.fx .faq-question { color: var(--ink-1); }
body.fx .faq-item.open { border-color: var(--glass-border-hi); }
body.fx .faq-answer-inner { color: var(--ink-2); }

/* CTA with animated border */
body.fx .cta-section {
    position: relative;
    margin: 4rem auto 6rem;
    max-width: 1100px;
    width: calc(100% - 3rem);
    padding: 5rem 2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, rgba(29, 78, 216, 0.5), rgba(4, 18, 48, 0.92));
    isolation: isolate;
    overflow: hidden;
}
body.fx .cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--spin), rgba(125, 184, 255, 0.15), var(--cyan-300), rgba(125, 184, 255, 0.15) 40%, var(--blue-400) 70%, rgba(125, 184, 255, 0.15));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: spin 8s linear infinite;
}
body.fx .cta-section::after {
    content: '';
    position: absolute;
    inset: auto -10% -60% -10%;
    height: 120%;
    z-index: -2;
    background: radial-gradient(closest-side, rgba(47, 116, 255, 0.45), transparent);
}
body.fx .cta-section h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
body.fx .cta-section p { color: var(--ink-2); }

/* ---------- Inner pages ---------- */
body.fx .page-header {
    padding: 9rem 0 4.5rem;
}
body.fx .page-header::before {
    background:
        radial-gradient(50% 70% at 50% 0%, rgba(47, 116, 255, 0.28), transparent 70%);
}
body.fx .page-header h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 700;
    text-shadow: 0 2px 30px rgba(2, 8, 23, 0.8);
}
body.fx .page-header p { color: var(--ink-2); }

/* Forms */
body.fx .form-label { color: var(--ink-1); font-weight: 500; }
body.fx .form-control {
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    color: var(--ink-1);
    border-radius: var(--radius-sm);
}
body.fx .form-control::placeholder { color: #7f93b8; } /* 4.9:1 on input bg */
body.fx .form-control:focus {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 4px rgba(47, 116, 255, 0.22);
    background: rgba(4, 16, 46, 0.9);
}
body.fx select.form-control option { background: var(--bg-1); color: var(--ink-1); }

/* Alerts keep readable solid backgrounds */
body.fx .alert { border-radius: var(--radius-sm); }
body.fx .alert-success { background: rgba(6, 60, 44, 0.85); color: #c9f7e3; border-color: rgba(52, 211, 153, 0.4); }
body.fx .alert-danger  { background: rgba(80, 14, 24, 0.85); color: #ffd6dc; border-color: rgba(248, 113, 113, 0.45); }
body.fx .alert-warning { background: rgba(80, 56, 6, 0.85); color: #ffeab8; border-color: rgba(251, 191, 36, 0.45); }
body.fx .alert-info    { background: rgba(10, 36, 92, 0.85); color: #d6e6ff; border-color: rgba(125, 184, 255, 0.45); }

body.fx .table th { color: var(--ink-1); }
body.fx .table td { color: var(--ink-2); }
body.fx .price { color: var(--ink-1); }

/* ---------- Footer ---------- */
body.fx .footer {
    position: relative;
    background: linear-gradient(180deg, transparent, rgba(2, 8, 23, 0.92) 30%);
    border-top: 1px solid var(--glass-border);
}
body.fx .footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--blue-400), var(--cyan-300), transparent);
    box-shadow: 0 0 16px var(--blue-400);
}
body.fx .footer h4 { color: var(--ink-1); }
body.fx .footer-links a, body.fx .footer p, body.fx .footer li { color: var(--ink-2) !important; }
body.fx .footer-links a:hover { color: #fff !important; }
body.fx .footer-contact i { color: var(--blue-300); }
body.fx .social-links a {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--ink-1);
}
body.fx .social-links a:hover { background: var(--blue-600); color: #fff; border-color: var(--blue-300); }
body.fx .footer-bottom { border-top-color: var(--glass-border); }
body.fx .footer-bottom p { color: var(--ink-3) !important; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-fx .hero-lead { margin-inline: auto; }
    .hero-actions, .hero-chips { justify-content: center; }
    .hero-visual { height: 280px; order: -1; }
    body.fx .steps-grid::before { display: none; }
    .scroll-cue { display: none; }
}
@media (max-width: 768px) {
    body.fx .nav-links.open {
        background: rgba(2, 8, 23, 0.96);
        border: 1px solid var(--glass-border);
    }
    body.fx .section { padding: 4.5rem 0; }
    body.fx .hero.hero-fx { padding-top: 6rem; }
    .hero-fx .hero-content::before { inset: -6% -6%; background: radial-gradient(closest-side, rgba(2, 8, 23, 0.82), rgba(2, 8, 23, 0.5) 70%, transparent); }
    body.fx .cta-section { padding: 3.5rem 1.4rem; width: calc(100% - 2rem); }
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
    body.fx .service-premium-card::before, .scroll-cue .mouse::after, .float-tile .tile-bar::after { animation: none; }
    [data-tilt] { transform: none !important; }
}

/* ---------- Fixed navbar + toast flashes ---------- */
body.fx .navbar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
}
body.fx .fx-flash {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 2rem));
    padding: 0;
    z-index: 1100;
}
body.fx .fx-flash .alert { box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8); }

/* ============================================================
   v2 — Circuit palm story (home)
   ============================================================ */
:root[data-fx] { --font-mono: 'JetBrains Mono', ui-monospace, monospace; }
.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

.hero-visual { position: relative; height: min(70vh, 620px); }
@media (max-width: 960px) { .hero-visual { height: min(44svh, 360px); order: -1; } }

/* Badge: system status line */
body.fx .hero-badge { gap: 0.55rem; font-size: 0.82rem; }
.hero-badge .mono { color: var(--cyan-300); font-size: 0.72rem; }
.badge-sep { width: 1px; height: 12px; background: var(--glass-border-hi); }

/* Hero meta: three numbered pillars on a hairline */
.hero-meta {
    display: flex;
    gap: 2rem;
    margin-top: 2.6rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--glass-border);
    max-width: 560px;
}
.hero-meta div { display: flex; flex-direction: column; gap: 0.25rem; color: var(--ink-1); font-weight: 500; font-size: 0.95rem; }
.hero-meta .mono { color: var(--blue-300); font-size: 0.72rem; }
.scroll-cue { text-decoration: none; }
.scroll-cue .mono { letter-spacing: 0.12em; text-transform: none; color: var(--ink-3); }
body.fx .scroll-cue:hover .mono { color: var(--ink-1); }


/* Subtle engineering grid behind sections */
.fx-grid-bg { position: relative; isolation: isolate; }
.fx-grid-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(125, 184, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 184, 255, 0.06) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 75%);
}

/* Section heads */
.section-head { margin-bottom: 3.5rem; }
.section-head h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.12; font-weight: 700; }
[dir="rtl"] .section-head h2, [dir="rtl"] .terminal-copy h2, [dir="rtl"] .why-sticky h2 { line-height: 1.35; }
.section-head.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: end; }
.section-head.split p { font-size: 1.05rem; color: var(--ink-2); max-width: 440px; justify-self: end; }
.section-head.center { text-align: center; }
.section-kicker { text-transform: none; letter-spacing: 0.08em; }
.section-kicker .mono { color: var(--blue-300); }

.fx-marquee span { font-size: 0.98rem; }
.fx-marquee span i { font-size: 0.8rem; color: var(--blue-400); }

/* ---------- Bento of chip cards ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.25rem; }
.bento-card {
    grid-column: span 2;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 280px;
    padding: 1.8rem;
    overflow: hidden;
    text-decoration: none;
    color: var(--ink-1);
    border-radius: var(--radius-lg);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.bento-card.wide { grid-column: span 3; }
.bento-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--spin), transparent 0 65%, var(--blue-400) 78%, var(--cyan-300) 84%, transparent 92%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    animation: spin 5s linear infinite paused;
    transition: opacity 0.4s;
    pointer-events: none;
}
.bento-card:hover::before { opacity: 1; animation-play-state: running; }
body.fx .bento-card:hover { color: var(--ink-1); border-color: var(--glass-border-hi); }
.bento-card h3 { font-size: 1.3rem; font-weight: 600; margin-top: 0.4rem; }
.bento-card p { color: var(--ink-2); font-size: 0.95rem; line-height: 1.75; }
.bento-index { position: absolute; top: 1.6rem; inset-inline-end: 1.8rem; font-size: 0.75rem; color: var(--ink-3); }
.bento-link { margin-top: auto; display: inline-flex; align-items: center; gap: 0.5rem; color: var(--blue-300); font-weight: 600; font-size: 0.9rem; }
.bento-card:hover .bento-link { color: #fff; }
.bento-link i { transition: transform 0.3s var(--ease-out); }
.bento-card:hover .bento-link i { transform: translateX(4px); }
[dir="rtl"] .bento-card:hover .bento-link i { transform: translateX(-4px); }
.bento-traces { width: 100%; height: 56px; margin-top: 0.4rem; opacity: 0.6; }
.bento-traces path { fill: none; stroke: rgba(125, 184, 255, 0.35); stroke-width: 1.5; stroke-dasharray: 6 10; animation: trace 6s linear infinite paused; }
.bento-traces circle { fill: var(--cyan-300); }
.bento-card:hover .bento-traces path { stroke: rgba(127, 216, 255, 0.75); animation-duration: 1.6s; animation-play-state: running; }
@keyframes trace { to { stroke-dashoffset: -160; } }

/* Microchip icon: package with pins on four sides */
.chip-icon {
    position: relative;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(145deg, #0b2463, #061433);
    border: 1px solid rgba(127, 216, 255, 0.55);
    color: var(--cyan-300);
    font-size: 1.3rem;
    box-shadow: 0 0 0 4px rgba(47, 116, 255, 0.08), 0 0 30px -4px rgba(47, 116, 255, 0.8), inset 0 0 14px rgba(79, 143, 255, 0.35);
    margin: 8px;
}
.chip-icon::before, .chip-icon::after { content: ''; position: absolute; }
.chip-icon::before {
    inset: -9px 10px;
    background:
        repeating-linear-gradient(90deg, rgba(169, 200, 238, 0.85) 0 3px, transparent 3px 9px) top / 100% 6px no-repeat,
        repeating-linear-gradient(90deg, rgba(169, 200, 238, 0.85) 0 3px, transparent 3px 9px) bottom / 100% 6px no-repeat;
}
.chip-icon::after {
    inset: 10px -9px;
    background:
        repeating-linear-gradient(0deg, rgba(169, 200, 238, 0.85) 0 3px, transparent 3px 9px) left / 6px 100% no-repeat,
        repeating-linear-gradient(0deg, rgba(169, 200, 238, 0.85) 0 3px, transparent 3px 9px) right / 6px 100% no-repeat;
}
.chip-icon i { position: relative; z-index: 1; filter: drop-shadow(0 0 6px rgba(127, 216, 255, 0.8)); }

/* Glows must never widen the page (clip keeps position: sticky working) */
body.fx main { overflow-x: clip; }

/* ---------- Terminal ---------- */
.terminal-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 4rem; align-items: center; }
.terminal {
    border-radius: 16px;
    overflow: hidden;
    background: rgba(2, 8, 23, 0.9);
    border: 1px solid var(--glass-border-hi);
    box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.9), 0 0 60px -20px rgba(47, 116, 255, 0.5);
    text-align: left;
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: rgba(8, 26, 72, 0.7); border-bottom: 1px solid var(--glass-border); }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: 10px; font-size: 0.75rem; color: var(--ink-3); }
.terminal-body { margin: 0; padding: 1.4rem 1.5rem 1.8rem; min-height: 290px; font-size: 0.84rem; line-height: 1.9; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.terminal-body .c-p { color: var(--cyan-300); }
.terminal-body .c-a { color: var(--blue-400); }
.terminal-body .c-ok { color: #6ee7a8; }
.terminal-body .c-w { color: #fcd171; }
.terminal-body .c-l { color: var(--blue-300); text-decoration: underline; }
.terminal-body.typing::after { content: '_'; color: var(--cyan-300); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.terminal-copy h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.12; margin-bottom: 1.2rem; }
.terminal-copy p { font-size: 1.05rem; margin-bottom: 1.8rem; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.mini-grid div {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.85rem 1rem; border-radius: 12px;
    background: rgba(8, 26, 72, 0.5); border: 1px solid var(--glass-border);
    color: var(--ink-1); font-size: 0.92rem;
}
.mini-grid i { color: var(--cyan-300); }

/* ---------- Why us ---------- */
.why-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 4rem; align-items: start; }
.why-sticky { position: sticky; top: 120px; }
.why-sticky h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.12; margin-bottom: 1rem; }
.why-list { display: grid; gap: 1rem; }
.why-item {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    transition: border-color 0.4s, transform 0.5s var(--ease-out);
}
.why-item:hover { border-color: var(--glass-border-hi); transform: translateX(6px); }
[dir="rtl"] .why-item:hover { transform: translateX(-6px); }
.why-num { font-size: 2.6rem; font-weight: 600; line-height: 1; background: linear-gradient(180deg, var(--blue-300), rgba(79, 143, 255, 0.35)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.why-item h3 { font-size: 1.25rem; margin-bottom: 0.3rem; }
.why-item p { margin: 0; font-size: 0.95rem; }
.why-icon { font-size: 1.4rem; color: var(--blue-300); opacity: 0.7; }

/* ---------- Process beam ---------- */
.beam-steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.process { --sp: 0; }
.beam { position: absolute; top: 31px; inset-inline: 12%; height: 2px; background: rgba(125, 184, 255, 0.15); border-radius: 2px; overflow: hidden; }
.beam-fill {
    position: absolute; inset: 0;
    transform-origin: left center;
    transform: scaleX(min(1, calc(var(--sp) * 1.3)));
    background: linear-gradient(90deg, var(--blue-600), var(--cyan-300));
    box-shadow: 0 0 14px var(--cyan-300);
}
[dir="rtl"] .beam-fill { transform-origin: right center; }
.beam-step { position: relative; text-align: center; padding: 0 0.5rem; }
.beam-node {
    width: 64px; height: 64px; margin: 0 auto 1.1rem;
    display: grid; place-items: center;
    border-radius: 18px;
    font-size: 1.2rem;
    color: var(--ink-3);
    background: rgba(4, 16, 46, 0.95);
    border: 1px solid var(--glass-border);
    transition: all 0.6s var(--ease-out);
}
.beam-step.active .beam-node {
    color: #fff;
    background: linear-gradient(145deg, var(--blue-600), var(--blue-700));
    border-color: rgba(170, 210, 255, 0.6);
    box-shadow: 0 0 0 6px rgba(47, 116, 255, 0.12), 0 0 30px rgba(47, 116, 255, 0.8);
    transform: translateY(-4px);
}
.beam-index { font-size: 0.72rem; color: var(--blue-300); }
.beam-step h3 { font-size: 1.12rem; margin: 0.35rem 0 0.4rem; }
.beam-step p { font-size: 0.92rem; }

body.fx .cta-section .section-kicker { display: inline-block; margin-bottom: 1rem; }

/* ---------- v2 responsive ---------- */
@media (max-width: 1100px) {
    .bento-card, .bento-card.wide { grid-column: span 3; }
    .bento-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
    .hero-meta { justify-content: center; margin-inline: auto; }
    .section-head.split, .terminal-grid, .why-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .section-head.split p { justify-self: start; }
    .why-sticky { position: static; }
    .beam-steps { grid-template-columns: 1fr 1fr; row-gap: 2.5rem; }
    .beam { display: none; }
    .beam-step .beam-node { color: #fff; background: linear-gradient(145deg, var(--blue-600), var(--blue-700)); }
}
@media (max-width: 640px) {
    .bento { grid-template-columns: 1fr; }
    .bento-card, .bento-card.wide, .bento-card:last-child:nth-child(odd) { grid-column: auto; min-height: 0; }
    .hero-meta { gap: 1.1rem; font-size: 0.85rem; }
    .why-item { grid-template-columns: auto 1fr; padding: 1.5rem; }
    .why-icon { display: none; }
    .mini-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .bento-traces path, .bento-card::before { animation: none; }
}

/* Footer: brand + quick links + contact (pages column removed) */
body.fx .footer-grid { grid-template-columns: 2fr 1fr 1.3fr; }
@media (max-width: 960px) { body.fx .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { body.fx .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Performance ----------
   The WebGL scene redraws behind the page, so any backdrop blur would be recomputed on every
   frame. Surfaces above use near-opaque fills instead; this also cancels blurs from style.css. */
body.fx *, body.fx *::before, body.fx *::after { -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Looping animations pause while their block is off screen (fx.js toggles .fx-off) */
.fx-off, .fx-off *, .fx-off::before, .fx-off *::before, .fx-off::after, .fx-off *::after { animation-play-state: paused !important; }
