:root {
    --apa-bg: #060914;
    --apa-bg-soft: #0a0f20;
    --apa-surface: rgba(16, 23, 43, 0.82);
    --apa-surface-strong: #11182b;
    --apa-border: rgba(164, 139, 250, 0.18);
    --apa-border-strong: rgba(167, 139, 250, 0.36);
    --apa-text: #f8fafc;
    --apa-muted: #aeb8cc;
    --apa-subtle: #7f8aa3;
    --apa-purple: #9b7cff;
    --apa-purple-strong: #7c4dff;
    --apa-cyan: #39d7f2;
    --apa-pink: #f472b6;
    --apa-green: #47e6a2;
    --apa-warning: #fbbf24;
    --apa-radius: 20px;
    --apa-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
    --apa-glass: rgba(16, 23, 43, 0.62);
    --apa-glass-strong: rgba(16, 23, 43, 0.88);
    --apa-grad-accent: linear-gradient(135deg, #7c4dff, #39d7f2);
    --apa-grad-text: linear-gradient(120deg, #cdbfff 0%, #8ce8ff 52%, #f2a8db 100%);
    --apa-grad-btn: linear-gradient(135deg, #7c4dff 0%, #5a2ee6 100%);
    --apa-radius-lg: 26px;
    --apa-radius-pill: 9999px;
    --apa-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/*
 * Background layering. `main` is the ONLY element painting the opaque base colour, because
 * it is the particle canvas's parent and therefore paints beneath it. `.apa-page` keeps a
 * stacking context above the canvas but only paints translucent accents, so the particles
 * stay visible through the page.
 */
main {
    position: relative;
    background: var(--apa-bg);
}

#particles-canvas {
    position: fixed;
    inset-block-start: 0;
    inset-inline-start: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.shell-footer {
    position: relative;
    z-index: 1;
}

.apa-page {
    position: relative;
    z-index: 1;
    color: var(--apa-text);
    background:
        radial-gradient(circle at 8% 2%, rgba(124, 77, 255, 0.16), transparent 30rem),
        radial-gradient(circle at 92% 16%, rgba(57, 215, 242, 0.09), transparent 28rem);
    font-family: Inter, "Noto Sans Arabic", system-ui, sans-serif;
    overflow: clip;
}

.apa-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
    clip-path: inset(50%);
}

.apa-page *,
.apa-page *::before,
.apa-page *::after {
    box-sizing: border-box;
}

.apa-page h1,
.apa-page h2,
.apa-page h3,
.apa-page p,
.apa-page figure,
.apa-page ul,
.apa-page ol {
    margin: 0;
}

/*
 * `height: auto` is required, not cosmetic: the width/height HTML attributes are mapped as
 * presentational hints, so without this the height hint stays definite, `aspect-ratio` is
 * ignored, and images render at full intrinsic height.
 */
.apa-page img {
    display: block;
    max-width: 100%;
    height: auto;
}

.apa-container {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
}

.apa-section {
    padding-block: 72px;
}

.apa-section-tinted {
    background: linear-gradient(180deg, rgba(13, 19, 37, 0.55), rgba(8, 12, 25, 0.72));
    border-block: 1px solid rgba(255, 255, 255, 0.04);
}

.apa-hero {
    position: relative;
    padding-block: 132px 76px;
    overflow: hidden;
}

.apa-hero::before {
    position: absolute;
    inset: 72px 0 auto;
    z-index: 2;
    height: 1px;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(155, 124, 255, 0.28), transparent);
}

/* Floating gradient orbs, double clipped (here and by .apa-page) so they never widen the page. */
.apa-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.apa-hero > .apa-container {
    position: relative;
    z-index: 1;
}

.apa-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    filter: blur(80px);
    animation: apaOrbFloat 8s ease-in-out infinite;
}

.apa-orb-1 {
    top: -14%;
    inset-inline-end: -6%;
    width: 500px;
    height: 500px;
    background: rgba(124, 77, 255, 0.3);
}

.apa-orb-2 {
    bottom: -18%;
    inset-inline-start: -8%;
    width: 400px;
    height: 400px;
    background: rgba(57, 215, 242, 0.18);
    animation-delay: 2s;
}

.apa-orb-3 {
    top: 46%;
    inset-inline-start: 52%;
    width: 300px;
    height: 300px;
    background: rgba(244, 114, 182, 0.15);
    animation-delay: 4s;
}

@keyframes apaOrbFloat {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -20px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

@keyframes apaRotateBg {
    to {
        transform: rotate(360deg);
    }
}

@keyframes apaPulseDot {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

.apa-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
    gap: 48px;
    align-items: center;
}

.apa-eyebrow,
.apa-section-heading > span,
.apa-manual-kicker {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 6px 14px;
    color: var(--apa-cyan);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(124, 77, 255, 0.1);
    border: 1px solid rgba(124, 77, 255, 0.2);
    border-radius: var(--apa-radius-pill);
}

.apa-eyebrow svg {
    width: 17px;
    height: 17px;
}

.apa-eyebrow-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    background: var(--apa-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(57, 215, 242, 0.8);
    animation: apaPulseDot 2.2s ease-in-out infinite;
}

.apa-hero h1 {
    max-width: 760px;
    margin-top: 18px;
    font-size: clamp(2.55rem, 5vw, 4.65rem);
    line-height: 1.03;
    letter-spacing: -0.055em;
}

.apa-hero-lead {
    max-width: 640px;
    margin-top: 22px !important;
    color: var(--apa-muted);
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.75;
}

.apa-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 26px;
}

.apa-chip-row span {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    min-height: 36px;
    padding: 7px 12px;
    color: #dfe6f5;
    font-size: 0.86rem;
    font-weight: 650;
    background: rgba(17, 24, 43, 0.76);
    border: 1px solid var(--apa-border);
    border-radius: 999px;
}

.apa-chip-row svg {
    width: 15px;
    height: 15px;
    color: var(--apa-purple);
}

.apa-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 30px;
}

.apa-button {
    position: relative;
    display: inline-flex;
    gap: 9px;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 26px;
    overflow: hidden;
    color: #fff;
    font-size: 0.94rem;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--apa-radius-pill);
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.apa-button svg,
.apa-text-link svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.apa-button-primary {
    background: var(--apa-grad-btn);
    box-shadow: 0 14px 38px rgba(124, 77, 255, 0.28);
}

/* Shine sweep, using logical offsets so it travels the correct way under RTL. */
.apa-button-primary::before {
    position: absolute;
    inset-block: 0;
    inset-inline-start: -100%;
    width: 100%;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transition: inset-inline-start 500ms var(--apa-ease);
}

.apa-button-primary:hover::before {
    inset-inline-start: 100%;
}

.apa-button-secondary {
    background: rgba(17, 24, 43, 0.8);
    border-color: var(--apa-border-strong);
}

.apa-button:hover {
    color: #fff;
    transform: translateY(-2px);
    border-color: rgba(194, 180, 255, 0.62);
}

.apa-button-primary:hover {
    box-shadow: 0 17px 45px rgba(124, 77, 255, 0.38);
}

.apa-text-link {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    min-height: 44px;
    padding: 8px 4px;
    color: #c9bbff;
    font-weight: 700;
    text-decoration: none;
}

.apa-text-link:hover {
    color: #fff;
}

.apa-hero-media {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--apa-border-strong);
    border-radius: 24px;
    box-shadow: var(--apa-shadow), 0 0 70px rgba(124, 77, 255, 0.14);
}

.apa-hero-media::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.apa-hero-media img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.apa-stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 28px;
    margin: 34px 0 0 !important;
}

.apa-stat {
    min-width: 0;
    padding-inline-start: 16px;
    border-inline-start: 2px solid rgba(155, 124, 255, 0.32);
}

.apa-stat-value {
    color: transparent;
    font-size: clamp(1.7rem, 3.4vw, 2.3rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    background: var(--apa-grad-text);
    background-clip: text;
    -webkit-background-clip: text;
}

.apa-stat-label {
    margin: 6px 0 0;
    color: var(--apa-subtle);
    font-size: 0.82rem;
    line-height: 1.45;
}

.apa-value-strip {
    padding-block: 24px;
    background: rgba(12, 17, 32, 0.55);
    border-block: 1px solid var(--apa-border);
    backdrop-filter: blur(10px);
}

.apa-value-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.apa-value-grid > div {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding-inline: 22px;
}

.apa-value-grid > div + div {
    border-inline-start: 1px solid rgba(255, 255, 255, 0.08);
}

.apa-value-grid svg {
    width: 23px;
    height: 23px;
    flex: 0 0 auto;
    color: var(--apa-purple);
}

.apa-value-grid span {
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: var(--apa-subtle);
    font-size: 0.78rem;
    line-height: 1.45;
}

.apa-value-grid strong {
    color: var(--apa-text);
    font-size: 0.92rem;
}

.apa-section-heading {
    max-width: 700px;
    margin-bottom: 34px;
}

.apa-section-heading-center {
    margin-inline: auto;
    text-align: center;
}

.apa-section-heading h2 {
    margin-top: 10px !important;
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.apa-section-heading p {
    margin-top: 12px !important;
    color: var(--apa-muted);
    font-size: 1.02rem;
    line-height: 1.75;
}

.apa-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.apa-card {
    position: relative;
    padding: 24px;
    background: linear-gradient(145deg, rgba(18, 26, 49, 0.9), rgba(11, 17, 33, 0.9));
    border: 1px solid var(--apa-border);
    border-radius: var(--apa-radius);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14);
}

.apa-feature-card {
    overflow: hidden;
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

/* Hover glow lives on ::after so the card's own transition declaration stays untouched. */
.apa-feature-card::after {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    content: "";
    background: radial-gradient(circle at 50% 0%, rgba(124, 77, 255, 0.22), transparent 65%);
    transition: opacity 240ms ease;
}

.apa-feature-card:hover::after {
    opacity: 1;
}

.apa-feature-card > * {
    position: relative;
    z-index: 1;
}

.apa-feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--apa-border-strong);
}

.apa-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    margin-bottom: 18px;
    color: var(--apa-purple);
    background: rgba(124, 77, 255, 0.12);
    border: 1px solid rgba(155, 124, 255, 0.22);
    border-radius: 14px;
}

.apa-icon svg {
    width: 21px;
    height: 21px;
}

.apa-feature-card:nth-child(3n + 2) .apa-icon {
    color: var(--apa-cyan);
    background: rgba(57, 215, 242, 0.09);
    border-color: rgba(57, 215, 242, 0.2);
}

.apa-feature-card:nth-child(3n) .apa-icon {
    color: var(--apa-pink);
    background: rgba(244, 114, 182, 0.09);
    border-color: rgba(244, 114, 182, 0.18);
}

.apa-card h3 {
    font-size: 1.08rem;
    line-height: 1.35;
}

.apa-card p {
    margin-top: 9px !important;
    color: var(--apa-muted);
    font-size: 0.93rem;
    line-height: 1.65;
}

/* Supported models
 * Model names are Latin proper nouns, so every pill carries dir="ltr" in the markup.
 * The full list is a native <details>: it stays in the DOM for crawlers and opens
 * without JavaScript, matching the FAQ pattern further down this file. */
.apa-model-top {
    display: grid;
    gap: 12px;
    margin-top: 32px;
}

.apa-model-top-row {
    display: grid;
    grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
    gap: 12px 20px;
    align-items: center;
    padding: 16px 20px;
    background: var(--apa-glass);
    border: 1px solid var(--apa-border);
    border-radius: 16px;
}

.apa-model-top-label {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    color: var(--apa-text);
    font-size: 0.92rem;
    font-weight: 700;
}

.apa-model-top-label svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--apa-purple);
}

.apa-model-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0 !important;
    list-style: none;
}

.apa-model-list li {
    padding: 6px 12px;
    color: #d7deeb;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    background: rgba(17, 24, 43, 0.76);
    border: 1px solid var(--apa-border);
    border-radius: var(--apa-radius-pill);
}

.apa-model-list li.apa-model-more {
    color: var(--apa-purple);
    background: rgba(124, 77, 255, 0.1);
    border-color: rgba(124, 77, 255, 0.3);
}

.apa-model-all {
    overflow: hidden;
    margin-top: 14px;
    background: var(--apa-glass-strong);
    border: 1px solid var(--apa-border);
    border-radius: 16px;
}

.apa-model-all[open] {
    border-color: var(--apa-border-strong);
}

.apa-model-all > summary {
    display: flex;
    gap: 16px;
    align-items: center;
    min-height: 56px;
    padding: 16px 20px;
    color: var(--apa-text);
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.45;
    cursor: pointer;
    list-style: none;
}

.apa-model-all > summary::-webkit-details-marker {
    display: none;
}

.apa-model-all > summary:hover {
    background: rgba(124, 77, 255, 0.06);
}

.apa-model-all[open] .apa-faq-icon {
    transform: rotate(180deg);
}

.apa-model-all-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding: 4px 20px 22px;
}

.apa-model-group h3 {
    display: flex;
    gap: 9px;
    align-items: center;
    margin: 0 0 12px !important;
    color: var(--apa-text);
    font-size: 0.95rem;
    font-weight: 700;
}

.apa-model-group h3 svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: var(--apa-purple);
}

.apa-model-count {
    display: inline-grid;
    min-width: 26px;
    padding: 2px 7px;
    place-items: center;
    margin-inline-start: auto;
    color: var(--apa-purple);
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(124, 77, 255, 0.12);
    border: 1px solid rgba(124, 77, 255, 0.26);
    border-radius: var(--apa-radius-pill);
}

.apa-model-note {
    max-width: 640px;
    margin: 16px auto 0 !important;
    color: var(--apa-subtle);
    font-size: 0.82rem;
    line-height: 1.6;
    text-align: center;
}

.apa-story-list {
    display: grid;
    gap: 16px;
}

.apa-story {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 30px;
    align-items: center;
    padding: 20px;
    background: var(--apa-glass);
    border: 1px solid var(--apa-border);
    border-radius: var(--apa-radius-lg);
    backdrop-filter: blur(14px);
}

/* Mirror the track widths too, so the copy keeps the wider column on reversed rows. */
.apa-story-reverse {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.apa-story-reverse .apa-story-copy {
    order: 2;
}

.apa-story-number {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    background: var(--apa-grad-accent);
    border-radius: 11px;
    box-shadow: 0 10px 26px rgba(124, 77, 255, 0.28);
}

.apa-story h3 {
    margin-top: 12px !important;
    font-size: clamp(1.2rem, 1.8vw, 1.5rem);
    line-height: 1.25;
    letter-spacing: -0.025em;
}

.apa-story-copy > p {
    margin-top: 10px !important;
    color: var(--apa-muted);
    line-height: 1.7;
}

.apa-check-list {
    display: grid;
    gap: 7px;
    padding: 0;
    margin-top: 14px !important;
    list-style: none;
}

.apa-check-list li {
    position: relative;
    padding-inline-start: 24px;
    color: #d7deeb;
    font-size: 0.91rem;
    line-height: 1.5;
}

.apa-check-list li::before {
    position: absolute;
    inset-inline-start: 0;
    top: 0.25em;
    width: 15px;
    height: 15px;
    content: "✓";
    color: var(--apa-green);
    font-size: 0.75rem;
    font-weight: 900;
}

/* Same framing rule as the gallery: show the whole screenshot, never crop the UI. */
.apa-story-media {
    display: grid;
    place-items: center;
    padding: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, #0c1120, #070a14);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.apa-story-media img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 9px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
}

.apa-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

/*
 * These are dense application screenshots, so they are never cropped: each one is shown
 * whole inside a window frame. Cards in a row still stretch to equal height and the frame
 * backdrop absorbs the difference, so the grid stays aligned without cutting the UI.
 */
.apa-gallery-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--apa-glass-strong);
    border: 1px solid var(--apa-border);
    border-radius: var(--apa-radius-lg);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
    transition: transform 220ms var(--apa-ease), border-color 220ms ease, box-shadow 220ms ease;
}

.apa-gallery-item:hover {
    transform: translateY(-4px);
    border-color: var(--apa-border-strong);
    box-shadow: 0 26px 60px rgba(124, 77, 255, 0.18);
}

.apa-gallery-bar {
    display: flex;
    gap: 7px;
    align-items: center;
    height: 34px;
    flex: 0 0 auto;
    padding-inline: 16px;
    background: rgba(8, 12, 25, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.apa-gallery-bar > span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.apa-gallery-bar > span:nth-child(1) {
    background: rgba(244, 114, 182, 0.55);
}

.apa-gallery-bar > span:nth-child(2) {
    background: rgba(251, 191, 36, 0.5);
}

.apa-gallery-bar > span:nth-child(3) {
    background: rgba(71, 230, 162, 0.45);
}

/*
 * The screenshots vary in aspect ratio, so the image sits on a mat. Row-mates of different
 * ratios simply get a thicker mat instead of an obvious letterbox void.
 */
.apa-gallery-item a {
    position: relative;
    display: grid;
    flex: 1 1 auto;
    place-items: center;
    padding: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, #0c1120, #070a14);
}

.apa-gallery-item a::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    content: "";
    background: linear-gradient(180deg, rgba(6, 9, 20, 0.05), rgba(6, 9, 20, 0.55));
    transition: opacity 220ms ease;
}

.apa-gallery-item a::after {
    position: absolute;
    inset-block-end: 14px;
    inset-inline-end: 14px;
    z-index: 2;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    content: "\2197";
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    background: var(--apa-grad-btn);
    border-radius: 50%;
    box-shadow: 0 10px 26px rgba(124, 77, 255, 0.42);
    transition: opacity 220ms ease, transform 220ms var(--apa-ease);
    transform: translateY(8px);
}

.apa-gallery-item a:hover::before,
.apa-gallery-item a:focus-visible::before,
.apa-gallery-item a:hover::after,
.apa-gallery-item a:focus-visible::after {
    opacity: 1;
}

.apa-gallery-item a:hover::after,
.apa-gallery-item a:focus-visible::after {
    transform: translateY(0);
}

.apa-gallery-item img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    transition: transform 450ms var(--apa-ease);
}

.apa-gallery-item a:hover img {
    transform: scale(1.03);
}

.apa-gallery-item figcaption {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 0 0 auto;
    padding: 15px 16px;
    color: #dbe2ef;
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.45;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.apa-gallery-item figcaption svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--apa-purple);
}

.apa-step-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.apa-step-grid li > span {
    position: absolute;
    inset-block-start: 20px;
    inset-inline-end: 20px;
    color: var(--apa-subtle);
    font-size: 0.78rem;
    font-weight: 800;
}

.apa-step-grid li > svg {
    width: 25px;
    height: 25px;
    margin-bottom: 20px;
    color: var(--apa-purple);
}

.apa-centered-link {
    display: flex;
    justify-content: center;
    margin-top: 26px;
}

/* Comparison table */
.apa-compare-scroll {
    overflow-x: auto;
    background: var(--apa-glass);
    border: 1px solid var(--apa-border);
    border-radius: var(--apa-radius-lg);
    backdrop-filter: blur(14px);
}

.apa-compare-scroll:focus-visible {
    outline: 2px solid var(--apa-cyan);
    outline-offset: 3px;
}

.apa-compare {
    width: 100%;
    border-collapse: collapse;
}

.apa-compare th,
.apa-compare td {
    padding: 16px 18px;
    font-size: 0.93rem;
    line-height: 1.5;
    text-align: start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.apa-compare thead th {
    color: var(--apa-subtle);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(8, 12, 25, 0.5);
}

.apa-compare thead th.apa-compare-own {
    position: relative;
    color: var(--apa-text);
    background: rgba(124, 77, 255, 0.14);
}

.apa-compare thead th.apa-compare-own::before {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    content: "";
    background: var(--apa-grad-accent);
}

.apa-compare tbody th {
    color: var(--apa-text);
    font-weight: 650;
}

.apa-compare tbody tr:last-child th,
.apa-compare tbody tr:last-child td {
    border-bottom: 0;
}

.apa-compare-cell {
    color: var(--apa-muted);
    white-space: nowrap;
}

.apa-compare-cell svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    vertical-align: -3px;
}

.apa-compare-cell span {
    margin-inline-start: 8px;
}

.apa-compare-yes {
    color: var(--apa-green);
    background: rgba(124, 77, 255, 0.06);
}

.apa-compare-no {
    color: var(--apa-subtle);
}

.apa-compare-partial {
    color: var(--apa-warning);
}

.apa-compare-note {
    max-width: 640px;
    margin: 16px auto 0 !important;
    color: var(--apa-subtle);
    font-size: 0.82rem;
    line-height: 1.6;
    text-align: center;
}

/* FAQ */
.apa-faq-wrap {
    max-width: 860px;
}

.apa-faq-list {
    display: grid;
    gap: 12px;
}

.apa-faq-item {
    overflow: hidden;
    background: var(--apa-glass-strong);
    border: 1px solid var(--apa-border);
    border-radius: 16px;
}

.apa-faq-item[open] {
    border-color: var(--apa-border-strong);
}

.apa-faq-item > summary {
    display: flex;
    gap: 16px;
    align-items: center;
    min-height: 56px;
    padding: 16px 20px;
    color: var(--apa-text);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.45;
    cursor: pointer;
    list-style: none;
}

.apa-faq-item > summary::-webkit-details-marker {
    display: none;
}

.apa-faq-item > summary:hover {
    background: rgba(124, 77, 255, 0.06);
}

.apa-faq-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    margin-inline-start: auto;
    color: var(--apa-purple);
    transition: transform 250ms var(--apa-ease);
}

.apa-faq-item[open] .apa-faq-icon {
    transform: rotate(180deg);
}

.apa-faq-answer {
    padding: 0 20px 18px;
    color: var(--apa-muted);
    font-size: 0.93rem;
    line-height: 1.7;
}

.apa-faq-more {
    display: flex;
    justify-content: center;
    margin-top: 18px !important;
}

/* Trust */
.apa-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.apa-info-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.apa-info-card .apa-icon {
    flex: 0 0 auto;
    margin: 0;
}

.apa-info-card h3 {
    font-size: 1.16rem;
}

.apa-warning-card .apa-icon {
    color: var(--apa-warning);
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.2);
}

.apa-warning-card .apa-text-link {
    margin-top: 6px;
}

.apa-cta-section {
    padding-top: 28px;
}

.apa-cta-card {
    position: relative;
    max-width: 880px;
    padding: 48px 32px;
    margin-inline: auto;
    overflow: hidden;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(124, 77, 255, 0.25), transparent 50%),
        linear-gradient(145deg, rgba(20, 28, 53, 0.96), rgba(10, 15, 31, 0.96));
    border: 1px solid var(--apa-border-strong);
    border-radius: var(--apa-radius-lg);
    box-shadow: var(--apa-shadow);
}

/* Slow rotating conic sheen behind the CTA content, matching the home page CTA box. */
.apa-cta-card::before {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    z-index: 0;
    width: 160%;
    aspect-ratio: 1;
    margin-block-start: -80%;
    margin-inline-start: -80%;
    opacity: 0.35;
    pointer-events: none;
    content: "";
    background: conic-gradient(from 0deg, transparent 0deg, rgba(124, 77, 255, 0.35) 90deg, transparent 180deg, rgba(57, 215, 242, 0.28) 270deg, transparent 360deg);
    animation: apaRotateBg 18s linear infinite;
}

.apa-cta-card > *:not(dialog) {
    position: relative;
    z-index: 1;
}

.apa-cta-icon {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin-bottom: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--apa-purple-strong), var(--apa-pink));
    border-radius: 14px;
}

.apa-cta-icon svg {
    width: 23px;
    height: 23px;
}

.apa-cta-card h2 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    letter-spacing: -0.04em;
}

.apa-cta-card > p {
    max-width: 600px;
    margin: 12px auto 0 !important;
    color: var(--apa-muted);
    line-height: 1.7;
}

.apa-actions-centered {
    justify-content: center;
}

.apa-release-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 18px !important;
    color: var(--apa-subtle) !important;
    font-size: 0.84rem;
}

.apa-release-line button {
    min-height: 38px;
    padding: 4px 6px;
    color: #c9bbff;
    font: inherit;
    cursor: pointer;
    background: none;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.apa-release-dialog {
    width: min(560px, calc(100% - 32px));
    max-height: min(720px, calc(100vh - 48px));
    padding: 0;
    margin: auto;
    color: var(--apa-text);
    background: #11182b;
    border: 1px solid var(--apa-border-strong);
    border-radius: 18px;
    box-shadow: var(--apa-shadow);
}

.apa-release-dialog::backdrop {
    background: rgba(2, 4, 12, 0.78);
    backdrop-filter: blur(4px);
}

.apa-dialog-header {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 1px solid var(--apa-border);
}

.apa-dialog-header h3 {
    font-size: 1.05rem;
}

.apa-dialog-header button {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    color: var(--apa-text);
    font-size: 1.7rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--apa-border);
    border-radius: 10px;
}

.apa-dialog-body {
    max-height: 60vh;
    padding: 22px;
    overflow-y: auto;
    color: var(--apa-muted);
    text-align: start;
}

.apa-dialog-body ul {
    padding-inline-start: 20px;
}

/* Manual */
.apa-manual-hero {
    padding-block: 124px 50px;
    border-bottom: 1px solid var(--apa-border);
}

.apa-breadcrumb {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    min-height: 44px;
    color: var(--apa-muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.apa-breadcrumb svg {
    width: 17px;
    height: 17px;
}

.apa-manual-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.55fr);
    gap: 40px;
    align-items: end;
    margin-top: 22px;
}

.apa-manual-hero h1 {
    margin-top: 12px !important;
    font-size: clamp(2.35rem, 5vw, 4rem);
    line-height: 1.06;
    letter-spacing: -0.05em;
}

.apa-manual-hero p {
    max-width: 720px;
    margin-top: 16px !important;
    color: var(--apa-muted);
    font-size: 1.08rem;
    line-height: 1.75;
}

.apa-manual-meta {
    display: grid;
    gap: 12px;
    padding: 22px;
    background: rgba(16, 23, 43, 0.82);
    border: 1px solid var(--apa-border);
    border-radius: 18px;
}

.apa-manual-meta span {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--apa-muted);
    font-size: 0.9rem;
}

.apa-manual-meta svg {
    width: 18px;
    height: 18px;
    color: var(--apa-purple);
}

.apa-manual-mobile-nav {
    display: none;
    padding-block: 14px;
    overflow-x: auto;
    background: #0b1020;
    border-bottom: 1px solid var(--apa-border);
}

.apa-manual-mobile-nav > div {
    display: flex;
    gap: 8px;
    width: max-content;
}

.apa-manual-mobile-nav a {
    min-height: 40px;
    padding: 9px 13px;
    color: var(--apa-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--apa-border);
    border-radius: 999px;
}

.apa-manual-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 44px;
    align-items: start;
    padding-block: 56px 80px;
}

.apa-manual-toc {
    position: sticky;
    top: 94px;
    padding: 18px;
    background: rgba(13, 19, 36, 0.88);
    border: 1px solid var(--apa-border);
    border-radius: 16px;
}

.apa-manual-toc h2 {
    margin-bottom: 12px !important;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--apa-subtle);
}

.apa-manual-toc nav {
    display: grid;
    gap: 3px;
}

.apa-manual-toc a {
    display: block;
    padding: 8px 10px;
    color: var(--apa-muted);
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
    border-radius: 8px;
}

.apa-manual-toc a:hover,
.apa-manual-toc a:focus-visible {
    color: #fff;
    background: rgba(124, 77, 255, 0.12);
}

.apa-manual-content {
    min-width: 0;
}

.apa-manual-section {
    padding-bottom: 52px;
    scroll-margin-top: 96px;
}

.apa-manual-section + .apa-manual-section {
    padding-top: 52px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.apa-manual-section > h2 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.apa-manual-section > p,
.apa-manual-section > .apa-manual-intro {
    margin-top: 12px !important;
    color: var(--apa-muted);
    line-height: 1.8;
}

.apa-manual-section h3 {
    margin-top: 28px !important;
    font-size: 1.14rem;
}

.apa-manual-section h3 + p {
    margin-top: 8px !important;
}

.apa-manual-section ol,
.apa-manual-section ul {
    display: grid;
    gap: 9px;
    padding-inline-start: 24px;
    margin-top: 14px !important;
    color: #d8dfec;
    line-height: 1.65;
}

.apa-manual-section li::marker {
    color: var(--apa-purple);
    font-weight: 800;
}

.apa-manual-callout {
    display: flex;
    gap: 14px;
    padding: 18px;
    margin-top: 22px;
    color: var(--apa-muted);
    background: rgba(57, 215, 242, 0.055);
    border: 1px solid rgba(57, 215, 242, 0.18);
    border-radius: 14px;
    line-height: 1.65;
}

.apa-manual-callout svg {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--apa-cyan);
}

.apa-manual-callout-warning {
    background: rgba(251, 191, 36, 0.055);
    border-color: rgba(251, 191, 36, 0.2);
}

.apa-manual-callout-warning svg {
    color: var(--apa-warning);
}

.apa-manual-figure {
    margin-top: 24px !important;
    overflow: hidden;
    background: rgba(13, 19, 36, 0.9);
    border: 1px solid var(--apa-border);
    border-radius: 18px;
}

.apa-manual-figure img {
    width: 100%;
    height: auto;
}

.apa-manual-figure figcaption {
    padding: 13px 16px;
    color: var(--apa-muted);
    font-size: 0.85rem;
}

.apa-manual-figure-compact {
    max-width: 605px;
}

.apa-manual-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.apa-manual-card-grid .apa-card h3 {
    margin-top: 0 !important;
}

.apa-manual-card-grid .apa-card ul {
    font-size: 0.9rem;
}

.apa-manual-path {
    display: inline-block;
    max-width: 100%;
    padding: 3px 7px;
    overflow-wrap: anywhere;
    color: #d8cdfd;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.88em;
    background: rgba(124, 77, 255, 0.1);
    border-radius: 6px;
}

.apa-manual-footer-cta {
    padding: 30px;
    text-align: center;
    background: linear-gradient(145deg, rgba(20, 28, 53, 0.96), rgba(10, 15, 31, 0.96));
    border: 1px solid var(--apa-border-strong);
    border-radius: 20px;
}

.apa-manual-footer-cta h2 {
    font-size: 1.7rem;
}

.apa-manual-footer-cta p {
    margin-top: 9px !important;
    color: var(--apa-muted);
}

/*
 * Manual page background layer. Kept outside the manual block above so that block stays
 * byte-identical; these only add properties the original rules never declare.
 */
.apa-manual-hero {
    position: relative;
    overflow: hidden;
}

.apa-manual-hero > .apa-container {
    position: relative;
    z-index: 1;
}

.apa-manual-toc,
.apa-manual-mobile-nav {
    backdrop-filter: blur(12px);
}

/*
 * Scroll reveal. Content is only hidden once /apa/app.js has confirmed it can reveal it
 * again, so a failed script load can never strand a section at opacity 0.
 */
.apa-js .apa-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms var(--apa-ease), transform 600ms var(--apa-ease);
}

.apa-js .apa-reveal.apa-visible {
    opacity: 1;
    transform: none;
}

html[dir="rtl"] .apa-page {
    letter-spacing: normal;
}

html[dir="rtl"] .apa-eyebrow,
html[dir="rtl"] .apa-section-heading > span,
html[dir="rtl"] .apa-manual-kicker {
    letter-spacing: 0;
}

@media (max-width: 980px) {
    .apa-hero-grid {
        grid-template-columns: 1fr;
        gap: 38px;
    }

    .apa-hero-copy {
        max-width: 760px;
    }

    .apa-value-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px 0;
    }

    .apa-value-grid > div:nth-child(3) {
        border-inline-start: 0;
    }

    .apa-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .apa-stat-row {
        gap: 14px 24px;
    }

    .apa-manual-hero-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .apa-section {
        padding-block: 48px;
    }

    .apa-compare th,
    .apa-compare td {
        padding: 13px 14px;
        font-size: 0.87rem;
    }

    .apa-orb-3 {
        display: none;
    }

    .apa-story,
    .apa-story-reverse {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .apa-story-reverse .apa-story-copy {
        order: 0;
    }

    .apa-step-grid,
    .apa-info-grid,
    .apa-model-all-body {
        grid-template-columns: 1fr;
    }

    .apa-model-top-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .apa-manual-mobile-nav {
        display: block;
    }

    .apa-manual-layout {
        grid-template-columns: 1fr;
        padding-top: 44px;
    }

    .apa-manual-toc {
        display: none;
    }
}

@media (max-width: 640px) {
    .apa-container {
        width: min(100% - 32px, 1180px);
    }

    .apa-hero {
        padding-block: 112px 48px;
    }

    .apa-section {
        padding-block: 40px;
    }

    .apa-hero h1 {
        font-size: clamp(2.35rem, 12vw, 3.4rem);
    }

    .apa-actions {
        align-items: stretch;
    }

    .apa-actions .apa-button {
        width: 100%;
    }

    .apa-actions .apa-text-link {
        justify-content: center;
        width: 100%;
    }

    .apa-value-grid,
    .apa-feature-grid,
    .apa-gallery-grid,
    .apa-manual-card-grid {
        grid-template-columns: 1fr;
    }

    .apa-value-grid {
        gap: 0;
    }

    .apa-value-grid > div {
        padding: 15px 2px;
    }

    .apa-value-grid > div + div {
        border-inline-start: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.07);
    }

    .apa-story,
    .apa-card {
        padding: 22px;
    }

    .apa-model-top-row {
        padding: 14px 16px;
    }

    .apa-model-all-body {
        padding-inline: 16px;
    }

    /* Long names such as "Nano Banana (Gemini Image)" must wrap inside their pill
     * rather than push the page wider than the viewport. */
    .apa-model-list li {
        max-width: 100%;
        overflow-wrap: anywhere;
        font-size: 0.82rem;
    }

    .apa-cta-card {
        padding: 36px 20px;
    }

    .apa-info-card {
        flex-direction: column;
    }

    .apa-manual-hero {
        padding-block: 108px 40px;
    }

    .apa-manual-section,
    .apa-manual-section + .apa-manual-section {
        padding-block: 38px;
    }

    .apa-stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .apa-compare th,
    .apa-compare td {
        padding: 11px 10px;
        font-size: 0.8rem;
    }

    /* Icon plus the row header carry the meaning here; the repeated label would force a scroll. */
    .apa-compare-cell span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        white-space: nowrap;
        border: 0;
        clip-path: inset(50%);
    }

    .apa-compare-cell svg {
        width: 19px;
        height: 19px;
    }

    .apa-orb-1,
    .apa-orb-2 {
        width: 300px;
        height: 300px;
    }

    .apa-gallery-item a {
        padding: 10px;
    }

    .apa-gallery-item figcaption {
        padding: 13px 14px;
    }

    .apa-faq-item > summary {
        padding: 14px 16px;
        font-size: 0.93rem;
    }

    .apa-faq-answer {
        padding: 0 16px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .apa-page *,
    .apa-page *::before,
    .apa-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    /* Sits outside .apa-page, so it needs its own rule. JS draws a single static frame. */
    #particles-canvas {
        opacity: 0.45;
    }

    .apa-orb {
        animation: none !important;
    }

    .apa-reveal,
    .apa-js .apa-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
