/* ==========================================================================
   A9X LABS — TRUST CENTER · LEGAL CORE (privacy / terms)
   Luxury editorial legal template: midnight stage, cyan→violet→magenta,
   animated trust shield, sticky document rail, reading progress.
   ========================================================================== */

.lg {
    --lg-ink: #eef2ff;
    --lg-ink-2: #b9c4de;
    --lg-ink-3: #7e8aa8;
    --lg-line: rgba(126, 158, 255, .14);
    --lg-line-2: rgba(126, 158, 255, .26);
    --lg-cyan: #22d3ee;
    --lg-violet: #7c5cff;
    --lg-violet-hi: #b6a5ff;
    --lg-magenta: #e879f9;
    --lg-gold: #ffd39a;
    --lg-grad: linear-gradient(100deg, #8fd6ff, #7c5cff 46%, #e879f9);
    --lg-glass: linear-gradient(168deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .014));
    --lg-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --lg-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --lg-ease: cubic-bezier(.16, 1, .3, 1);
    position: relative;
    min-width: 0;
    max-width: 100%;
    color: var(--lg-ink);
    font-family: var(--lg-ui);
    -webkit-font-smoothing: antialiased;
}

html[lang="ar"] .lg {
    --lg-ui: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
}

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

.lg .wrap {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: clamp(18px, 3.4vw, 44px);
}

.lg.lg-armed [data-lg-reveal] {
    opacity: 0;
    translate: 0 18px;
    filter: blur(3px);
    transition: opacity .75s ease, translate .7s var(--lg-ease), filter .65s ease;
}

.lg [data-lg-reveal].is-in {
    opacity: 1;
    translate: 0;
    filter: blur(0);
}

/* ── hero ─────────────────────────────────────────────────────── */
.lg-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    align-items: center;
    gap: clamp(26px, 4.6vw, 60px);
    padding-block: clamp(34px, 6vh, 74px) clamp(24px, 4vh, 48px);
    position: relative;
}

.lg-hero::before {
    content: "";
    position: absolute;
    inset: -30% -10% auto;
    height: 560px;
    background:
        radial-gradient(44% 46% at 10% 18%, rgba(34, 211, 238, .14), transparent 70%),
        radial-gradient(42% 48% at 80% 6%, rgba(124, 92, 255, .22), transparent 72%),
        radial-gradient(34% 40% at 96% 62%, rgba(232, 121, 249, .12), transparent 70%);
    filter: blur(22px);
    pointer-events: none;
    z-index: -1;
}

.lg-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--lg-mono);
    font-size: .58rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--lg-ink-3);
}

.lg-kicker::before {
    content: "";
    width: 30px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .9));
}

.lg-hero h1 {
    margin: 16px 0 0;
    font-size: clamp(2.3rem, 5vw, 4rem);
    line-height: 1.02;
    letter-spacing: -.04em;
    font-weight: 850;
    color: #fff;
}

html[lang="ar"] .lg-hero h1 {
    line-height: 1.2;
    letter-spacing: -.01em;
}

.lg-lede {
    margin-block-start: 14px;
    max-width: 54ch;
    font-size: .96rem;
    line-height: 1.8;
    color: var(--lg-ink-2);
}

.lg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-block-start: 18px;
}

.lg-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--lg-line);
    background: rgba(255, 255, 255, .025);
    font-family: var(--lg-mono);
    font-size: .46rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--lg-ink-3);
    white-space: nowrap;
}

.lg-pill i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px 2px rgba(74, 222, 128, .5);
}

.lg-pill.is-draft {
    border-color: rgba(255, 211, 154, .35);
    background: rgba(255, 211, 154, .06);
    color: var(--lg-gold);
}

.lg-pill.is-draft i {
    background: var(--lg-gold);
    box-shadow: 0 0 8px 2px rgba(255, 211, 154, .5);
}

.lg-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-block-start: 20px;
}

.lg-hero__note {
    margin-block-start: 14px;
    max-width: 56ch;
    font-family: var(--lg-mono);
    font-size: .48rem;
    line-height: 1.8;
    letter-spacing: .06em;
    color: var(--lg-ink-3);
}

/* hero visual */
.lg-hero__visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 380px;
}

.lg-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(340px, 82%);
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    border: 1px solid rgba(126, 158, 255, .16);
    animation: lg-spin 32s linear infinite;
}

.lg-ring::before {
    content: "";
    position: absolute;
    top: -4px;
    left: calc(50% - 4px);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lg-cyan);
    box-shadow: 0 0 14px 3px rgba(34, 211, 238, .8);
}

.lg-ring--b {
    width: min(260px, 62%);
    border-style: dashed;
    border-color: rgba(232, 121, 249, .22);
    animation-direction: reverse;
    animation-duration: 46s;
}

.lg-ring--b::before {
    width: 5px;
    height: 5px;
    background: var(--lg-magenta);
    box-shadow: 0 0 12px 3px rgba(232, 121, 249, .75);
}

.lg-ring--c {
    width: min(200px, 48%);
    border-color: rgba(34, 211, 238, .18);
    animation-duration: 58s;
}

.lg-hero__visual::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 46%;
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 92, 255, .32), transparent 68%);
    filter: blur(34px);
}

.lg-shield {
    position: relative;
    z-index: 2;
    width: clamp(132px, 15vw, 172px);
    filter: drop-shadow(0 20px 34px rgba(124, 92, 255, .45));
    animation: lg-float 7s ease-in-out infinite;
}

.lg-shield svg {
    width: 100%;
    height: auto;
}

.lg-chip {
    position: absolute;
    z-index: 3;
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid var(--lg-line-2);
    background: rgba(7, 10, 22, .9);
    backdrop-filter: blur(8px);
    font-family: var(--lg-mono);
    font-size: .42rem;
    letter-spacing: .14em;
    color: #c9d4ee;
    animation: lg-bob 6.5s ease-in-out infinite alternate;
}

.lg-chip--a {
    top: 16%;
    inset-inline-start: 4%;
}

.lg-chip--b {
    top: 40%;
    inset-inline-end: 0;
    animation-delay: 1.2s;
}

.lg-chip--c {
    bottom: 16%;
    inset-inline-start: 14%;
    animation-delay: 2.4s;
}

.lg-orbit-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c4b5fd;
    box-shadow: 0 0 10px 2px rgba(196, 181, 253, .6);
    animation: lg-drift 8s ease-in-out infinite alternate;
}

.lg-orbit-dot--a {
    top: 10%;
    inset-inline-end: 22%;
}

.lg-orbit-dot--b {
    bottom: 8%;
    inset-inline-end: 32%;
    animation-delay: 1.8s;
}

/* ── draft banner ─────────────────────────────────────────────── */
.lg-draft {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-block: 4px 26px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 211, 154, .28);
    background: radial-gradient(120% 160% at 8% -20%, rgba(255, 184, 107, .12), transparent 58%), rgba(20, 15, 6, .55);
}

.lg-draft__mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 211, 154, .45);
    background: rgba(255, 211, 154, .12);
    color: var(--lg-gold);
    font-family: var(--lg-mono);
    font-weight: 800;
    font-size: .85rem;
}

.lg-draft b {
    display: block;
    font-size: .86rem;
    color: #f6e6c8;
}

.lg-draft p {
    margin-block-start: 4px;
    font-size: .78rem;
    line-height: 1.7;
    color: #c9b58f;
}

/* ── document grid ────────────────────────────────────────────── */
.lg-grid {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: clamp(22px, 3.4vw, 44px);
    align-items: start;
    padding-block: clamp(6px, 2vh, 18px) clamp(34px, 6vh, 62px);
}

.lg-rail {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 14px;
}

.lg-rail__progress {
    height: 2px;
    border-radius: 2px;
    background: rgba(126, 158, 255, .14);
    overflow: hidden;
}

.lg-rail__progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--lg-grad);
    box-shadow: 0 0 12px rgba(124, 92, 255, .8);
    transition: width .15s linear;
}

.lg-rail__label {
    margin: 0;
    font-family: var(--lg-mono);
    font-size: .48rem;
    letter-spacing: .22em;
    color: var(--lg-ink-3);
}

.lg-toc {
    display: grid;
    gap: 2px;
}

.lg-toc:empty::before {
    content: "Document outline loads with the content.";
    content: attr(data-empty);
    font-size: .68rem;
    color: var(--lg-ink-3);
}

.lg-toc a {
    position: relative;
    display: block;
    padding: 7px 10px;
    border-radius: 9px;
    border-inline-start: 1px solid var(--lg-line);
    font-size: .74rem;
    line-height: 1.45;
    color: var(--lg-ink-3);
    text-decoration: none;
    transition: color .2s, background .2s, border-color .2s;
}

.lg-toc a:hover {
    color: var(--lg-ink);
    background: rgba(124, 92, 255, .08);
}

.lg-toc a.is-active {
    color: var(--lg-ink);
    border-inline-start-color: var(--lg-violet);
    background: rgba(124, 92, 255, .12);
}

.lg-toc a.is-sub {
    padding-inline-start: 20px;
    font-size: .7rem;
}

.lg-rail__meta {
    display: grid;
    gap: 7px;
    padding: 13px;
    border-radius: 14px;
    border: 1px solid var(--lg-line);
    background: rgba(255, 255, 255, .022);
}

.lg-rail__meta div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.lg-rail__meta small {
    font-family: var(--lg-mono);
    font-size: .4rem;
    letter-spacing: .14em;
    color: var(--lg-ink-3);
}

.lg-rail__meta b {
    font-size: .66rem;
    font-weight: 650;
    color: var(--lg-ink-2);
}

.lg-rail__actions {
    display: grid;
    gap: 6px;
}

/* ── buttons ──────────────────────────────────────────────────── */
.lg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 11px;
    border: 1px solid var(--lg-line-2);
    background: rgba(255, 255, 255, .04);
    color: #fff;
    font-family: var(--lg-ui);
    font-size: .78rem;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: transform .25s var(--lg-ease), background .25s, border-color .25s, box-shadow .3s;
}

.lg-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 92, 255, .55);
    background: rgba(124, 92, 255, .16);
    box-shadow: 0 16px 36px -20px rgba(124, 92, 255, .9);
}

.lg-btn--solid {
    border-color: transparent;
    background: linear-gradient(120deg, #5b3ff0, #7c5cff 55%, #22d3ee);
    box-shadow: 0 16px 40px -18px rgba(124, 92, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.lg-btn--ghost {
    background: transparent;
    border-color: var(--lg-line);
    color: var(--lg-ink-3);
}

.lg-btn--ghost:hover {
    color: #fff;
}

.lg-btn__ic {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(4, 8, 18, .3);
    font-size: .7rem;
}

/* ── document content ─────────────────────────────────────────── */
.lg-doc {
    min-width: 0;
    max-width: 820px;
}

.lg-section {
    padding-block: 6px 30px;
    border-block-end: 1px solid var(--lg-line);
    margin-block-end: 30px;
}

.lg-section:last-of-type {
    border-block-end: 0;
}

.lg-index {
    display: inline-block;
    font-family: var(--lg-mono);
    font-size: .5rem;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--lg-ink-3);
}

.lg-doc h2,
.lg-prose h2 {
    margin: 10px 0 0;
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    line-height: 1.08;
    letter-spacing: -.03em;
    font-weight: 850;
    color: #fff;
    scroll-margin-top: 100px;
}

.lg-doc h3,
.lg-prose h3 {
    scroll-margin-top: 100px;
}

.lg-section__lede {
    margin-block-start: 10px;
    max-width: 64ch;
    font-size: .84rem;
    line-height: 1.8;
    color: var(--lg-ink-2);
}

/* outline cards */
.lg-outline {
    display: grid;
    gap: 8px;
    margin-block-start: 18px;
}

.lg-outline__item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 15px 16px;
    border-radius: 15px;
    border: 1px solid var(--lg-line);
    background: var(--lg-glass);
    transition: border-color .25s, transform .3s var(--lg-ease), box-shadow .3s;
}

.lg-outline__item:hover {
    border-color: var(--lg-line-2);
    transform: translateX(3px);
    box-shadow: 0 18px 40px -32px rgba(124, 92, 255, .8);
}

[dir="rtl"] .lg-outline__item:hover {
    transform: translateX(-3px);
}

.lg-outline__num {
    font-family: var(--lg-mono);
    font-size: .56rem;
    letter-spacing: .1em;
    color: var(--lg-violet-hi);
    padding-block-start: 3px;
}

.lg-outline__item h3 {
    margin: 0;
    font-size: .95rem;
    font-weight: 750;
    color: var(--lg-ink);
}

.lg-outline__item p {
    margin-block-start: 3px;
    font-size: .78rem;
    line-height: 1.65;
    color: var(--lg-ink-2);
}

.lg-outline__tag {
    align-self: center;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 211, 154, .28);
    background: rgba(255, 211, 154, .06);
    font-family: var(--lg-mono);
    font-size: .4rem;
    letter-spacing: .1em;
    color: var(--lg-gold);
    white-space: nowrap;
}

/* fact cards */
.lg-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-block-start: 18px;
}

.lg-fact {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--lg-line);
    background: rgba(255, 255, 255, .022);
}

.lg-fact__ico {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(34, 211, 238, .28);
    background: rgba(34, 211, 238, .09);
    color: var(--lg-cyan);
}

.lg-fact__ico .icon {
    width: 13px;
    height: 13px;
}

.lg-fact b {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    color: var(--lg-ink);
}

.lg-fact span {
    display: block;
    margin-block-start: 2px;
    font-size: .72rem;
    line-height: 1.6;
    color: var(--lg-ink-2);
}

/* data flow */
.lg-flow {
    display: grid;
    gap: 0;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.lg-flow li {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 14px;
    padding-block: 12px;
}

.lg-flow li::before {
    content: "";
    position: absolute;
    top: 38px;
    bottom: -2px;
    inset-inline-start: 17px;
    width: 1px;
    background: linear-gradient(180deg, rgba(124, 92, 255, .5), rgba(34, 211, 238, .08));
}

.lg-flow li:last-child::before {
    display: none;
}

.lg-flow__num {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid rgba(124, 92, 255, .38);
    background: radial-gradient(circle at 35% 30%, rgba(124, 92, 255, .35), rgba(8, 11, 22, .9));
    font-family: var(--lg-mono);
    font-size: .5rem;
    color: #dcd4ff;
}

.lg-flow b {
    display: block;
    padding-block-start: 4px;
    font-size: .86rem;
    color: var(--lg-ink);
}

.lg-flow p {
    margin-block-start: 2px;
    font-size: .76rem;
    line-height: 1.65;
    color: var(--lg-ink-2);
}

/* prose for real CMS content */
.lg-prose {
    font-size: .88rem;
    line-height: 1.85;
    color: var(--lg-ink-2);
}

.lg-prose p {
    margin-block: 0 14px;
}

.lg-prose h2 {
    margin-block: 30px 12px;
    padding-block-start: 14px;
    border-block-start: 1px solid var(--lg-line);
}

.lg-prose h3 {
    margin-block: 22px 8px;
    font-size: 1.05rem;
    color: #fff;
}

.lg-prose ul,
.lg-prose ol {
    margin-block: 0 14px;
    padding-inline-start: 20px;
    display: grid;
    gap: 6px;
}

.lg-prose strong {
    color: #fff;
}

.lg-prose a {
    color: var(--lg-cyan);
}

.lg-prose blockquote {
    margin-block: 20px;
    padding: 14px 18px;
    border-inline-start: 2px solid var(--lg-violet);
    border-radius: 0 14px 14px 0;
    background: rgba(124, 92, 255, .08);
    color: #d5d0f7;
}

.lg-prose figure {
    margin-block: 22px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--lg-line);
}

.lg-prose figure img {
    width: 100%;
    height: auto;
    display: block;
}

.lg-prose figcaption {
    padding: 9px 14px;
    border-top: 1px solid var(--lg-line);
    font-family: var(--lg-mono);
    font-size: .44rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--lg-ink-3);
}

/* ── cinematic figure ─────────────────────────────────────────── */
.lg-figure {
    margin: 8px 0 30px;
    border-radius: 20px;
    border: 1px solid var(--lg-line);
    overflow: hidden;
    background: #05070f;
}

.lg-figure img {
    display: block;
    width: 100%;
    height: clamp(180px, 26vw, 300px);
    object-fit: cover;
    filter: saturate(1.05) contrast(1.02);
    transition: transform 1.2s var(--lg-ease);
}

.lg-figure:hover img {
    transform: scale(1.035);
}

.lg-figure figcaption {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 15px;
    border-top: 1px solid var(--lg-line);
    font-family: var(--lg-mono);
    font-size: .44rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--lg-ink-3);
}

.lg-figure figcaption::before {
    content: "";
    width: 20px;
    height: 1px;
    background: linear-gradient(90deg, var(--lg-cyan), var(--lg-magenta));
}

/* ── contact + related ────────────────────────────────────────── */
.lg-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: clamp(20px, 3vw, 30px);
    border-radius: 20px;
    border: 1px solid rgba(124, 92, 255, .3);
    background:
        radial-gradient(70% 120% at 0% 100%, rgba(124, 92, 255, .26), transparent 60%),
        linear-gradient(180deg, rgba(10, 14, 28, .94), rgba(5, 8, 18, .96));
    box-shadow: 0 34px 80px -54px rgba(124, 92, 255, .9);
}

.lg-contact h2 {
    margin: 8px 0 0;
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
}

.lg-contact p {
    margin-block-start: 5px;
    max-width: 52ch;
    font-size: .8rem;
    line-height: 1.7;
    color: var(--lg-ink-2);
}

.lg-contact__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lg-related {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-block-start: 18px;
}

.lg-rel {
    position: relative;
    display: grid;
    gap: 3px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--lg-line);
    background: rgba(255, 255, 255, .02);
    color: var(--lg-ink-2);
    text-decoration: none;
    transition: border-color .25s, transform .3s var(--lg-ease), background .25s;
}

.lg-rel:hover {
    border-color: var(--lg-line-2);
    background: rgba(124, 92, 255, .1);
    transform: translateY(-2px);
}

.lg-rel b {
    font-size: .8rem;
    color: var(--lg-ink);
}

.lg-rel span {
    font-size: .68rem;
    line-height: 1.5;
    color: var(--lg-ink-3);
}

.lg-rel i {
    position: absolute;
    top: 13px;
    inset-inline-end: 13px;
    font-style: normal;
    font-size: .7rem;
    color: var(--lg-violet-hi);
}

[dir="rtl"] .lg-rel i {
    transform: scaleX(-1);
}

/* ── footnote + top ───────────────────────────────────────────── */
.lg-footnote {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-block: 18px;
    border-block-start: 1px solid var(--lg-line);
    font-family: var(--lg-mono);
    font-size: .46rem;
    letter-spacing: .1em;
    color: var(--lg-ink-3);
}

.lg-footnote a {
    color: var(--lg-cyan);
}

.lg-top {
    position: fixed;
    z-index: 40;
    inset-block-end: 22px;
    inset-inline-end: 22px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--lg-line-2);
    background: rgba(8, 11, 22, .9);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: .95rem;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .3s, visibility .3s, transform .3s, border-color .2s;
}

.lg-top.is-on {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.lg-top:hover {
    border-color: rgba(124, 92, 255, .6);
}

/* ── light theme ──────────────────────────────────────────────── */
html[data-theme="light"] .lg {
    --lg-ink: #130c2b;
    --lg-ink-2: #4d4669;
    --lg-ink-3: #7d7697;
    --lg-line: rgba(37, 22, 84, .12);
    --lg-line-2: rgba(37, 22, 84, .2);
    --lg-glass: #fff;
}

html[data-theme="light"] .lg-hero h1,
html[data-theme="light"] .lg-doc h2,
html[data-theme="light"] .lg-prose h2 {
    color: #130c2b;
}

html[data-theme="light"] .lg-outline__item,
html[data-theme="light"] .lg-fact,
html[data-theme="light"] .lg-rel,
html[data-theme="light"] .lg-rail__meta {
    background: #fff;
    box-shadow: 0 20px 50px -48px rgba(50, 30, 120, .5);
}

html[data-theme="light"] .lg-chip {
    background: rgba(255, 255, 255, .94);
    color: #4d4669;
}

html[data-theme="light"] .lg-draft {
    background: rgba(255, 211, 154, .14);
}

html[data-theme="light"] .lg-draft b {
    color: #5b430f;
}

html[data-theme="light"] .lg-draft p {
    color: #7a6337;
}

html[data-theme="light"] .lg-toc a.is-active {
    color: #130c2b;
}

html[data-theme="light"] .lg-contact {
    color: #eef2ff;
}

html[data-theme="light"] .lg-contact h2 {
    color: #fff;
}

/* ── responsive ───────────────────────────────────────────────── */
@media (max-width: 960px) {
    .lg-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .lg-hero__visual {
        min-height: 320px;
        order: -1;
    }

    .lg-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .lg-rail {
        position: static;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 14px;
        border: 1px solid var(--lg-line);
        background: rgba(255, 255, 255, .025);
    }

    .lg-rail .lg-toc {
        display: none;
    }

    .lg-rail__label {
        display: none;
    }

    .lg-rail__meta {
        display: none;
    }

    .lg-rail__actions {
        grid-auto-flow: column;
    }

    .lg-rail__progress {
        grid-column: 1 / -1;
        order: -1;
        width: 100%;
    }
}

@media (max-width: 680px) {
    .lg-hero h1 {
        font-size: clamp(2rem, 9.6vw, 2.7rem);
    }

    .lg-hero__visual {
        min-height: 250px;
    }

    .lg-hero__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .lg-hero__actions .lg-btn--ghost {
        grid-column: 1 / -1;
    }

    .lg-outline__item {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .lg-outline__tag {
        grid-column: 2;
        justify-self: start;
        margin-block-start: 4px;
    }

    .lg-facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .lg-related {
        grid-template-columns: minmax(0, 1fr);
    }

    .lg-contact {
        align-items: flex-start;
    }

    .lg-contact__actions {
        width: 100%;
    }

    .lg-contact__actions .lg-btn {
        flex: 1;
    }

    .lg-top {
        inset-block-end: 14px;
        inset-inline-end: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lg [data-lg-reveal] {
        opacity: 1 !important;
        translate: none !important;
        filter: none !important;
        transition: none !important;
    }

    .lg-ring,
    .lg-shield,
    .lg-chip,
    .lg-orbit-dot {
        animation: none !important;
    }
}

@keyframes lg-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes lg-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

@keyframes lg-bob {
    from {
        translate: 0 -4px;
    }

    to {
        translate: 0 5px;
    }
}

@keyframes lg-drift {
    from {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: .5;
    }

    to {
        transform: translate3d(8px, -12px, 0) scale(1.4);
        opacity: 1;
    }
}

/* mobile shell rescue — scoped to legal pages only (never global) */
.lg {
    width: 100%;
}

@media (max-width: 960px) {
    .em-app-grid:has(.lg) {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0 !important;
    }

    .em-main:has(.lg),
    .em-body:has(.lg) {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .em-main:has(.lg) {
        display: block !important;
    }

    .lg-hero__visual {
        order: 0;
    }
}
