@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=Cairo:wght@400;600;700&display=swap');

/* ============================================================
   AI MicroMind — "Signal Grid"
   Ink ground · brand yellow #F6EB0F (logo, locked) · violet #7C5CFF
   Display: Space Grotesk · Body: IBM Plex Sans · Arabic: Cairo
   ============================================================ */

:root {
    /* ground spectrum */
    --bg: #07080f;
    --bg-2: #0a0c16;
    --surface: #0e1119;
    --elevated: #151a26;
    --line: #242a3a;
    --line-soft: #1a1f2c;

    /* text */
    --text: #edf1fa;
    --muted: #98a2bd;
    --faint: #5d6780;

    /* accents (locked-3) */
    --accent: #f6eb0f; /* exact logo yellow — never altered */
    --accent-2: #7c5cff;
    --accent-ink: #0a0b12;

    /* emphasis ladder */
    --em-high: 1;
    --em-med: 0.78;
    --em-low: 0.62;

    /* signature gradients */
    --grad-brand: linear-gradient(102deg, #fff8a8 0%, var(--accent) 42%, #cfae3a 100%);
    --grad-dual: linear-gradient(115deg, var(--accent) 0%, #d9c93c 45%, var(--accent-2) 100%);
    --grad-glow: radial-gradient(58% 62% at 50% 0%, rgba(246, 235, 15, 0.14), transparent 70%);
    --grad-violet: radial-gradient(50% 50% at 80% 20%, rgba(124, 92, 255, 0.22), transparent 68%);

    /* elevation */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 0 1px rgba(246, 235, 15, 0.34), 0 12px 40px -12px rgba(246, 235, 15, 0.34);

    --radius: 14px;
    --radius-lg: 24px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    /* the shard — the site's one motif, taken from the logo geometry */
    --motif-clip: polygon(0 0, 100% 0, 100% 78%, 88% 100%, 0 100%);
    --motif-clip-rtl: polygon(0 0, 100% 0, 100% 100%, 12% 100%, 0 78%);

    /* fluid type scale */
    --step--2: clamp(0.72rem, 0.7rem + 0.1vw, 0.79rem);
    --step--1: clamp(0.84rem, 0.81rem + 0.14vw, 0.95rem);
    --step-0: clamp(1rem, 0.96rem + 0.22vw, 1.09rem);
    --step-1: clamp(1.22rem, 1.12rem + 0.5vw, 1.55rem);
    --step-2: clamp(1.6rem, 1.34rem + 1.2vw, 2.4rem);
    --step-3: clamp(2rem, 1.5rem + 2.4vw, 3.3rem);
    --step-4: clamp(2.6rem, 1.9rem + 3.4vw, 4.6rem);

    --header-h: 76px;

    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'IBM Plex Sans', system-ui, sans-serif;
    --font-ar: 'Cairo', system-ui, sans-serif;
}

/* ---------- reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.68;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
img {
    max-width: 100%;
    display: block;
}
a {
    color: inherit;
    text-decoration: none;
}
button {
    font: inherit;
    color: inherit;
}
ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}
::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

/* ---------- type ---------- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.06;
    font-weight: 700;
}
h1 {
    font-size: var(--step-4);
}
h2 {
    font-size: var(--step-3);
}
h3 {
    font-size: var(--step-1);
    line-height: 1.2;
}
h4 {
    font-size: var(--step-0);
    letter-spacing: -0.01em;
}
p {
    margin: 0;
}
.lead {
    font-size: var(--step-1);
    color: var(--muted);
    line-height: 1.55;
    max-width: 60ch;
}
.prose {
    max-width: 68ch;
    color: var(--muted);
}
.text-med {
    color: var(--muted);
}
.text-low {
    color: var(--faint);
    font-size: var(--step--1);
}
.grad {
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.num {
    font-variant-numeric: tabular-nums;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: var(--step--2);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}
.eyebrow::before {
    content: '';
    width: 14px;
    height: 14px;
    background: var(--accent);
    clip-path: polygon(0 0, 100% 22%, 78% 100%, 0 72%);
    flex: none;
}

/* ---------- layout ---------- */
.container {
    width: min(1200px, 92vw);
    margin-inline: auto;
}
.section {
    padding-block: clamp(64px, 7.5vw, 132px);
    position: relative;
}
.section-head {
    max-width: 780px;
    margin-bottom: clamp(36px, 4vw, 60px);
    display: grid;
    gap: 16px;
}
.section-head.center {
    margin-inline: auto;
    text-align: center;
    justify-items: center;
}
.skip {
    /* parked ABOVE the viewport, never off to the side: a horizontal offset
       becomes scrollable overflow under dir="rtl" and widens the whole page */
    position: fixed;
    top: -120px;
    inset-inline-start: 12px;
    z-index: 999;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 12px 20px;
    border-radius: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    transition: top 0.2s var(--ease);
}
.skip:focus {
    top: 12px;
}

/* ---------- code-drawn art ---------- */
.grain::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.artfield {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.artfield > * {
    position: relative;
    z-index: 2;
}
.artfield::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(78% 78% at 50% 0%, #000, transparent);
    mask-image: radial-gradient(78% 78% at 50% 0%, #000, transparent);
    opacity: 0.8;
}
.artfield::after {
    content: '';
    position: absolute;
    inset: -10%;
    z-index: 1;
    background: var(--grad-glow), var(--grad-violet);
    pointer-events: none;
}
.dotfield {
    background-image: radial-gradient(rgba(148, 160, 195, 0.16) 1px, transparent 1px);
    background-size: 22px 22px;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.32;
    z-index: 0;
    pointer-events: none;
}
.orb.a {
    width: 420px;
    height: 420px;
    background: var(--accent);
    top: -140px;
    inset-inline-start: -120px;
    animation: float1 16s ease-in-out infinite;
}
.orb.b {
    width: 360px;
    height: 360px;
    background: var(--accent-2);
    bottom: -140px;
    inset-inline-end: -100px;
    animation: float2 19s ease-in-out infinite;
}
@keyframes float1 {
    50% {
        transform: translate(34px, -22px) scale(1.09);
    }
}
@keyframes float2 {
    50% {
        transform: translate(-28px, 20px) scale(1.06);
    }
}

/* shard divider between bands */
.shard-rule {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
    position: relative;
}
.shard-rule::after {
    content: '';
    position: absolute;
    inset-inline-start: 50%;
    top: -6px;
    width: 13px;
    height: 13px;
    background: var(--accent);
    clip-path: polygon(0 0, 100% 22%, 78% 100%, 0 72%);
    opacity: 0.85;
}

/* ---------- header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: color-mix(in oklab, var(--bg) 62%, transparent);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid transparent;
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.header.scrolled {
    background: color-mix(in oklab, var(--bg) 88%, transparent);
    border-bottom-color: var(--line);
}
.header .container {
    display: flex;
    align-items: center;
    gap: 22px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
    min-height: 44px;
}
.brand img {
    height: 38px;
    width: auto;
}
.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: auto;
}
.nav > li > a,
.nav > li > button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 14px;
    min-height: 44px;
    font-size: var(--step--1);
    font-weight: 500;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav > li > a:hover,
.nav > li > button:hover {
    color: var(--text);
    background: var(--surface);
}
.nav > li > a.active {
    color: var(--accent);
}
.has-menu {
    position: relative;
}
.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    min-width: 250px;
    background: var(--elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s var(--ease);
}
.has-menu:hover .dropdown,
.has-menu:focus-within .dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.dropdown a {
    display: block;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: var(--step--1);
    color: var(--muted);
    transition: background 0.2s, color 0.2s;
}
.dropdown a strong {
    display: block;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
}
.dropdown a:hover {
    background: var(--surface);
    color: var(--text);
}
.dropdown a:hover strong {
    color: var(--accent);
}
.lang {
    font-family: var(--font-display);
    font-weight: 600;
    border: 1px solid var(--line);
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}
.menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    cursor: pointer;
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    padding: 13px 24px;
    border-radius: 11px;
    border: 1px solid transparent;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--step--1);
    cursor: pointer;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease),
        border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn svg {
    width: 17px;
    height: 17px;
    flex: none;
}
.btn-primary {
    background: var(--grad-brand);
    color: var(--accent-ink);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.btn-outline {
    border-color: var(--line);
    color: var(--text);
    background: color-mix(in oklab, var(--surface) 70%, transparent);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}
.btn-ghost {
    color: var(--muted);
    padding-inline: 6px;
}
.btn-ghost:hover {
    color: var(--accent);
}
.btn-sm {
    min-height: 44px;
    padding: 10px 18px;
}
.link-underline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--step--1);
    color: var(--accent);
    background-image: linear-gradient(var(--accent), var(--accent));
    background-size: 0% 1.5px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.35s var(--ease);
    padding-block: 6px;
}
.link-underline:hover {
    background-size: 100% 1.5px;
}

/* ---------- surfaces / cards ---------- */
.card {
    position: relative;
    background: linear-gradient(160deg, var(--surface), var(--bg-2));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(22px, 2.4vw, 32px);
    clip-path: var(--motif-clip);
    transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    inset-inline-end: -70px;
    top: -70px;
    width: 190px;
    height: 190px;
    background: radial-gradient(circle, rgba(246, 235, 15, 0.14), transparent 68%);
    opacity: 0;
    transition: opacity 0.45s var(--ease);
    pointer-events: none;
}
.card:hover {
    transform: translateY(-6px);
    border-color: color-mix(in oklab, var(--accent) 42%, var(--line));
    box-shadow: var(--shadow-lg);
}
.card:hover::before {
    opacity: 1;
}
.card h3 {
    margin-bottom: 10px;
}
.card p {
    color: var(--muted);
}
.ico {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: color-mix(in oklab, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in oklab, var(--accent) 26%, transparent);
    color: var(--accent);
    margin-bottom: 20px;
}
.ico svg {
    width: 24px;
    height: 24px;
}
.ico.violet {
    background: color-mix(in oklab, var(--accent-2) 16%, transparent);
    border-color: color-mix(in oklab, var(--accent-2) 34%, transparent);
    color: #b9a6ff;
}

.grid {
    display: grid;
    gap: clamp(16px, 1.6vw, 24px);
}
.g2 {
    grid-template-columns: repeat(2, 1fr);
}
.g3 {
    grid-template-columns: repeat(3, 1fr);
}
.g4 {
    grid-template-columns: repeat(4, 1fr);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: var(--step--2);
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: color-mix(in oklab, var(--accent) 14%, transparent);
    border: 1px solid color-mix(in oklab, var(--accent) 32%, transparent);
    color: var(--accent);
}
.badge.violet {
    background: color-mix(in oklab, var(--accent-2) 18%, transparent);
    border-color: color-mix(in oklab, var(--accent-2) 38%, transparent);
    color: #c3b3ff;
}

/* shard bullet list */
.shardlist {
    display: grid;
    gap: 12px;
}
.shardlist li {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    color: var(--muted);
    font-size: var(--step--1);
}
.shardlist li::before {
    content: '';
    width: 12px;
    height: 12px;
    margin-top: 7px;
    flex: none;
    background: var(--accent);
    clip-path: polygon(0 0, 100% 22%, 78% 100%, 0 72%);
}
.shardlist.violet li::before {
    background: var(--accent-2);
}

/* ---------- hero ---------- */
.hero {
    position: relative;
    min-height: min(100svh, 860px);
    display: flex;
    align-items: center;
    padding-block: clamp(34px, 4vw, 56px);
    overflow: hidden;
    isolation: isolate;
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    gap: clamp(28px, 4vw, 60px);
    align-items: center;
}
.hero-copy {
    display: grid;
    gap: 18px;
    justify-items: start;
}
.hero h1 {
    font-size: var(--step-4);
    line-height: 1.02;
    max-width: 13ch;
}
.hero-sub {
    font-size: var(--step-1);
    color: var(--muted);
    max-width: 46ch;
    line-height: 1.5;
}
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}
.hero-title {
    animation: rise 0.9s var(--ease-out) both;
}
.hero-eyebrow {
    animation: rise 0.8s var(--ease-out) both;
}
.hero-sub {
    animation: rise 0.9s 0.12s var(--ease-out) both;
}
.hero-cta {
    animation: rise 0.9s 0.24s var(--ease-out) both;
}
.hero-art {
    animation: rise 1.1s 0.2s var(--ease-out) both;
}
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
}

/* inner-page hero */
.hero-inner {
    position: relative;
    padding-block: clamp(52px, 6vw, 96px) clamp(40px, 4.5vw, 68px);
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--line-soft);
}
.hero-inner h1 {
    font-size: var(--step-3);
    max-width: 18ch;
}
.hero-inner .hero-sub {
    max-width: 62ch;
}
.crumb {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: var(--step--2);
    color: var(--faint);
    margin-bottom: 18px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: var(--font-display);
}
.crumb a:hover {
    color: var(--accent);
}
.crumb .sep::before {
    content: '/';
}
[dir='rtl'] .crumb .sep::before {
    content: '\\';
}

/* ---------- star: data constellation ---------- */
.constellation {
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
    aspect-ratio: 1 / 0.92;
    display: block;
}
.constellation .track {
    fill: none;
    stroke: var(--line);
    stroke-width: 1.2;
}
.constellation .pulse {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 26 300;
    filter: drop-shadow(0 0 6px rgba(246, 235, 15, 0.8));
    animation: travel 3.4s linear infinite;
}
.constellation .pulse.d2 {
    animation-delay: 0.85s;
}
.constellation .pulse.d3 {
    animation-delay: 1.7s;
    stroke: var(--accent-2);
    filter: drop-shadow(0 0 6px rgba(124, 92, 255, 0.85));
}
.constellation .pulse.d4 {
    animation-delay: 2.55s;
}
@keyframes travel {
    from {
        stroke-dashoffset: 326;
    }
    to {
        stroke-dashoffset: 0;
    }
}
.constellation .island {
    animation: drift 9s ease-in-out infinite;
}
.constellation .island.i2 {
    animation-delay: -2.2s;
}
.constellation .island.i3 {
    animation-delay: -4.4s;
}
.constellation .island.i4 {
    animation-delay: -6.6s;
}
@keyframes drift {
    50% {
        transform: translateY(-7px);
    }
}
.constellation .hub-ring {
    transform-origin: center;
    animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
    50% {
        opacity: 0.25;
        transform: scale(1.14);
    }
}
.constellation .lbl {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    fill: var(--muted);
    letter-spacing: 0.04em;
}
.constellation .lbl-hub {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    fill: var(--accent);
    letter-spacing: 0.02em;
}
.constellation .shardmark {
    fill: var(--accent);
}
.constellation .shardmark.v {
    fill: var(--accent-2);
}
.answer-chip {
    animation: chipIn 3.4s var(--ease-out) infinite;
}
@keyframes chipIn {
    0%,
    58% {
        opacity: 0;
        transform: translateY(8px);
    }
    70%,
    94% {
        opacity: 1;
        transform: none;
    }
    100% {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* ---------- marquee ---------- */
.marquee {
    overflow: hidden;
    border-block: 1px solid var(--line-soft);
    padding-block: 26px;
    background: linear-gradient(var(--bg-2), var(--bg));
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.marquee-track {
    display: flex;
    gap: 18px;
    width: max-content;
    animation: slide 34s linear infinite;
}
@keyframes slide {
    to {
        transform: translateX(-50%);
    }
}
[dir='rtl'] .marquee-track {
    animation-name: slideRtl;
}
@keyframes slideRtl {
    to {
        transform: translateX(50%);
    }
}
.marquee:hover .marquee-track {
    animation-play-state: paused;
}
.logo-plate {
    flex: none;
    width: 216px;
    height: 112px;
    display: grid;
    place-items: center;
    padding: 16px 24px;
    background: linear-gradient(160deg, var(--surface), var(--bg-2));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    clip-path: var(--motif-clip);
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.logo-plate:hover {
    border-color: color-mix(in oklab, var(--accent) 45%, var(--line));
    transform: translateY(-3px);
}
.logo-plate img {
    max-height: 46px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.74;
    transition: filter 0.35s var(--ease), opacity 0.35s var(--ease);
}
.logo-plate img.tall {
    max-height: 78px;
}
.logo-plate img.inv {
    /* logos shipped on a white ground: invert the ground, keep the mark readable */
    filter: invert(1) grayscale(1) contrast(1.06);
    opacity: 0.86;
}
.logo-plate:hover img {
    opacity: 1;
}
.logo-plate:hover img.inv {
    filter: invert(1);
}
.logo-plate:hover img {
    filter: none;
    opacity: 1;
}

/* ---------- split / bento ---------- */
.split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: center;
}
.split.rev {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
.bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: clamp(14px, 1.5vw, 22px);
}
.bento > * {
    grid-column: span 2;
}
.bento .w3 {
    grid-column: span 3;
}
.bento .w4 {
    grid-column: span 4;
}
.bento .w6 {
    grid-column: span 6;
}

/* pain vs solution */
.compare {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: clamp(16px, 2.4vw, 34px);
    align-items: stretch;
}
.compare-arrow {
    display: grid;
    place-items: center;
    color: var(--accent);
}
.compare-arrow svg {
    width: 40px;
    height: 40px;
}
.panel {
    border-radius: var(--radius-lg);
    padding: clamp(24px, 2.6vw, 38px);
    border: 1px solid var(--line);
    background: var(--surface);
    clip-path: var(--motif-clip);
}
.panel.pain {
    background: linear-gradient(165deg, #10121b, #0a0c14);
}
.panel.pain .shardlist li::before {
    background: var(--faint);
}
.panel.solution {
    background: linear-gradient(165deg, color-mix(in oklab, var(--accent) 7%, var(--surface)), var(--bg-2));
    border-color: color-mix(in oklab, var(--accent) 30%, var(--line));
}

/* ---------- step rail ---------- */
.rail {
    position: relative;
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(5, 1fr);
}
.rail::before {
    content: '';
    position: absolute;
    top: 27px;
    inset-inline: 8%;
    height: 2px;
    background: var(--line);
}
.rail::after {
    content: '';
    position: absolute;
    top: 27px;
    inset-inline-start: 8%;
    height: 2px;
    width: var(--rail-progress, 0%);
    max-width: 84%;
    background: var(--grad-brand);
    box-shadow: 0 0 14px rgba(246, 235, 15, 0.5);
    transition: width 0.5s var(--ease);
}
.rail-step {
    position: relative;
    z-index: 2;
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 12px;
}
.rail-dot {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--elevated);
    border: 2px solid var(--line);
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: 700;
    transition: all 0.4s var(--ease);
}
.rail-step.on .rail-dot {
    border-color: var(--accent);
    color: var(--accent-ink);
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(246, 235, 15, 0.12);
}
.rail-step h4 {
    font-size: var(--step--1);
}
.rail-step p {
    font-size: var(--step--2);
    color: var(--faint);
    max-width: 22ch;
}

/* ---------- stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.stat {
    background: var(--surface);
    padding: clamp(22px, 2.4vw, 32px);
    display: grid;
    gap: 6px;
}
.stat b {
    font-family: var(--font-display);
    font-size: var(--step-2);
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.stat span {
    font-size: var(--step--1);
    color: var(--muted);
}

/* ---------- pricing ---------- */
.plan {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.plan.featured {
    border-color: color-mix(in oklab, var(--accent) 46%, var(--line));
    background: linear-gradient(165deg, color-mix(in oklab, var(--accent) 7%, var(--surface)), var(--bg-2));
    box-shadow: var(--shadow-glow);
}
.price {
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.price small {
    display: block;
    font-family: var(--font-body);
    font-size: var(--step--1);
    color: var(--faint);
    font-weight: 400;
    letter-spacing: 0;
}
.spec {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}
.spec div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: var(--step--1);
}
.spec dt,
.spec .k {
    color: var(--faint);
}
.spec .v {
    color: var(--text);
    font-weight: 500;
    text-align: end;
}
.spec-group {
    font-family: var(--font-display);
    font-size: var(--step--2);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    padding-top: 16px;
}

/* ---------- accordion ---------- */
.acc {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.acc + .acc {
    margin-top: 12px;
}
.acc button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    min-height: 56px;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: start;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--step-0);
    transition: color 0.25s;
}
.acc button:hover {
    color: var(--accent);
}
.acc .chev {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--accent);
    transition: transform 0.35s var(--ease);
}
.acc.open .chev {
    transform: rotate(180deg);
}
.acc .body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s var(--ease);
}
.acc.open .body {
    grid-template-rows: 1fr;
}
.acc .body > div {
    overflow: hidden;
}
.acc .body p {
    padding: 0 24px 22px;
    color: var(--muted);
    max-width: 72ch;
}

/* ---------- tabs / filter ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 34px;
}
.filters button {
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--step--1);
    cursor: pointer;
    transition: all 0.25s var(--ease);
}
.filters button:hover {
    color: var(--text);
    border-color: var(--faint);
}
.filters button.on {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

/* ---------- qualifier ---------- */
.qual {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, var(--surface), var(--bg-2));
    padding: clamp(26px, 3vw, 44px);
    box-shadow: var(--shadow-md);
}
.qual-bar {
    height: 4px;
    border-radius: 4px;
    background: var(--line);
    overflow: hidden;
    margin-bottom: 26px;
}
.qual-bar i {
    display: block;
    height: 100%;
    width: 33%;
    background: var(--grad-brand);
    transition: width 0.45s var(--ease);
}
.qual-step {
    display: none;
    animation: rise 0.5s var(--ease-out) both;
}
.qual-step.on {
    display: block;
}
.opts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}
.opts button {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--elevated);
    color: var(--text);
    text-align: start;
    font-size: var(--step--1);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s var(--ease);
}
.opts button::before {
    content: '';
    width: 11px;
    height: 11px;
    flex: none;
    background: var(--faint);
    clip-path: polygon(0 0, 100% 22%, 78% 100%, 0 72%);
    transition: background 0.25s;
}
.opts button:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.opts button:hover::before {
    background: var(--accent);
}
.qual-result {
    display: none;
}
.qual-result.on {
    display: block;
    animation: rise 0.5s var(--ease-out) both;
}

/* ---------- forms ---------- */
.form {
    display: grid;
    gap: 18px;
}
.field {
    display: grid;
    gap: 7px;
}
.field label {
    font-size: var(--step--1);
    font-weight: 500;
    color: var(--text);
}
.field input,
.field select,
.field textarea {
    min-height: 50px;
    padding: 13px 16px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text);
    font: inherit;
    font-size: var(--step--1);
    transition: border-color 0.25s, box-shadow 0.25s;
}
.field textarea {
    min-height: 140px;
    resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(246, 235, 15, 0.16);
}
.field .hint {
    font-size: var(--step--2);
    color: var(--faint);
}
.form-note {
    font-size: var(--step--2);
    color: var(--faint);
}

/* ---------- CTA band ---------- */
.cta-band {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-top: 1px solid var(--line-soft);
}
.cta-inner {
    display: grid;
    gap: 22px;
    justify-items: center;
    text-align: center;
    max-width: 780px;
    margin-inline: auto;
}
.cta-inner h2 {
    max-width: 20ch;
}

/* ---------- footer ---------- */
.footer {
    background: var(--bg-2);
    border-top: 1px solid var(--line);
    padding-block: clamp(48px, 5vw, 76px) 28px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: clamp(26px, 3vw, 48px);
}
.footer h4 {
    font-size: var(--step--2);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}
.footer a {
    color: var(--muted);
    font-size: var(--step--1);
    display: inline-block;
    padding-block: 7px;
    transition: color 0.25s;
}
.footer a:hover {
    color: var(--accent);
}
.footer .blurb {
    color: var(--faint);
    font-size: var(--step--1);
    max-width: 34ch;
    margin-top: 16px;
}
.socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.socials a {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    transition: all 0.25s var(--ease);
}
.socials a:hover {
    color: var(--accent-ink);
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.socials svg {
    width: 18px;
    height: 18px;
}
.footer-base {
    margin-top: 40px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    color: var(--faint);
    font-size: var(--step--2);
}

/* ---------- reveals ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}
[data-reveal='left'] {
    transform: translateX(-30px);
}
[data-reveal='right'] {
    transform: translateX(30px);
}
[data-reveal='scale'] {
    transform: scale(0.95);
}
[data-reveal].in {
    opacity: 1;
    transform: none;
}
[data-reveal-group] > * {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}
[data-reveal-group] > *.in {
    opacity: 1;
    transform: none;
}

/* ============================================================
   RTL
   ============================================================ */
[dir='rtl'] {
    font-family: var(--font-ar);
}
[dir='rtl'] h1,
[dir='rtl'] h2,
[dir='rtl'] h3,
[dir='rtl'] h4,
[dir='rtl'] .eyebrow,
[dir='rtl'] .badge,
[dir='rtl'] .btn,
[dir='rtl'] .price,
[dir='rtl'] .link-underline,
[dir='rtl'] .filters button,
[dir='rtl'] .acc button,
[dir='rtl'] .footer h4,
[dir='rtl'] .spec-group,
[dir='rtl'] .rail-dot,
[dir='rtl'] .crumb {
    font-family: var(--font-ar);
    letter-spacing: 0;
}
[dir='rtl'] h1,
[dir='rtl'] h2 {
    line-height: 1.25;
}
[dir='rtl'] h3 {
    line-height: 1.4;
}
[dir='rtl'] .hero h1 {
    line-height: 1.3;
    max-width: 16ch;
    padding-bottom: 0.08em;
}
[dir='rtl'] .hero-inner h1 {
    line-height: 1.35;
    max-width: 22ch;
    padding-bottom: 0.08em;
}
[dir='rtl'] .constellation .lbl,
[dir='rtl'] .constellation .lbl-hub {
    font-size: 12.5px;
}
[dir='rtl'] body,
[dir='rtl'] .lead,
[dir='rtl'] .hero-sub {
    line-height: 1.85;
}
[dir='rtl'] .card {
    clip-path: var(--motif-clip-rtl);
}
[dir='rtl'] .panel,
[dir='rtl'] .logo-plate {
    clip-path: var(--motif-clip-rtl);
}
[dir='rtl'] .eyebrow::before,
[dir='rtl'] .shardlist li::before,
[dir='rtl'] .opts button::before,
[dir='rtl'] .shard-rule::after {
    transform: scaleX(-1);
}
[dir='rtl'] .link-underline {
    background-position: 100% 100%;
}
[dir='rtl'] [data-reveal='left'] {
    transform: translateX(30px);
}
[dir='rtl'] [data-reveal='right'] {
    transform: translateX(-30px);
}
[dir='rtl'] .dir-icon {
    transform: scaleX(-1);
}
[dir='rtl'] .qual-bar {
    transform: scaleX(-1);
}
[dir='rtl'] .card::before {
    inset-inline-end: auto;
    inset-inline-start: -70px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
    .g4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .rail {
        grid-template-columns: repeat(3, 1fr);
        gap: 26px;
    }
    .rail::before,
    .rail::after {
        display: none;
    }
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 960px) {
    .menu-toggle {
        display: flex;
    }
    .nav {
        position: fixed;
        inset: var(--header-h) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 18px;
        background: var(--bg-2);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-lg);
        max-height: calc(100dvh - var(--header-h));
        overflow-y: auto;
        display: none;
        margin: 0;
    }
    .nav.open {
        display: flex;
    }
    .nav > li > a,
    .nav > li > button {
        width: 100%;
        justify-content: space-between;
        font-size: var(--step-0);
        padding: 14px;
    }
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--surface);
        margin-top: 6px;
    }
    .nav-actions .btn-ghost {
        display: none;
    }
    .hero-grid,
    .split,
    .split.rev {
        grid-template-columns: 1fr;
    }
    .hero {
        min-height: 0;
        padding-block: 44px 64px;
    }
    .hero h1 {
        max-width: 100%;
    }
    .hero-art {
        order: 2;
    }
    .compare {
        grid-template-columns: 1fr;
    }
    .compare-arrow {
        transform: rotate(90deg);
    }
    .bento > *,
    .bento .w3,
    .bento .w4 {
        grid-column: span 6;
    }
    .g3 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 680px) {
    .g2,
    .g3,
    .g4,
    .opts {
        grid-template-columns: 1fr;
    }
    .rail {
        grid-template-columns: 1fr;
    }
    .stats {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .hero-cta .btn {
        width: 100%;
    }
    .constellation {
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    [data-reveal],
    [data-reveal-group] > * {
        opacity: 1 !important;
        transform: none !important;
    }
}
