/* ═══════════════════════ DESIGN TOKENS (matches main Mythx site) ═══════════════════════ */
:root {
    --bg:       #07080f;
    --bg2:      #0a0b16;
    --card:     #0e1020;
    --card2:    #121528;
    --accent:   #7B5CF0;
    --accent-b: #3D6FE8;
    --accent2:  #9D82F5;
    --accent3:  #b8a6f8;
    --sky:      #4EAAFF;
    --sky-dim:  rgba(78,170,255,0.13);
    --gold:     #E8B94A;
    --gold-b:   #F0C96A;
    --gold-dim: rgba(232,185,74,0.13);
    --text:     #eef0ff;
    --muted:    #6b6f99;
    --muted2:   #9096c0;
    --border:   rgba(123,92,240,0.13);
    --border-h: rgba(123,92,240,0.42);
    --glow:     rgba(123,92,240,0.25);
    --r-xl: 28px;
    --r-lg: 20px;
    --r-md: 14px;
    --r-sm: 8px;
    --grad-brand: linear-gradient(135deg, var(--accent) 0%, var(--accent-b) 60%, var(--sky) 100%);
    --grad-gold:  linear-gradient(135deg, var(--gold) 0%, var(--gold-b) 100%);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 200ms;
    --dur-med:  300ms;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { background: var(--bg); color: var(--text); font-family: 'Rubik', sans-serif; overflow-x: hidden; line-height: 1.6; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 20px; }
::selection { background: rgba(123,92,240,0.35); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100%; left: 16px; background: var(--accent); color: #fff; padding: 8px 16px; border-radius: var(--r-sm); font-weight: 600; font-size: .9rem; text-decoration: none; z-index: 9999; transition: top var(--dur-fast); }
.skip-link:focus { top: 16px; }

/* ═══ BACKGROUND LAYERS (aurora / grid / grain — same as main site) ═══ */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image: radial-gradient(rgba(123,92,240,0.055) 1px, transparent 1px);
    background-size: 32px 32px;
}
.bg-gradient {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(123,92,240,0.22) 0%, transparent 60%),
                radial-gradient(ellipse 60% 40% at 100% 80%, rgba(78,170,255,0.09) 0%, transparent 60%),
                radial-gradient(ellipse 50% 40% at 0% 60%, rgba(61,111,232,0.07) 0%, transparent 60%);
}
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.aurora span:nth-child(1) { width: 480px; height: 480px; top: -140px; left: 8%; background: radial-gradient(circle, rgba(123,92,240,0.55), transparent 70%); animation: drift-1 22s ease-in-out infinite; }
.aurora span:nth-child(2) { width: 420px; height: 420px; top: 8%; right: 4%; background: radial-gradient(circle, rgba(78,170,255,0.4), transparent 70%); animation: drift-2 26s ease-in-out infinite; }
.aurora span:nth-child(3) { width: 360px; height: 360px; bottom: -100px; left: 38%; background: radial-gradient(circle, rgba(157,130,245,0.35), transparent 70%); animation: drift-3 30s ease-in-out infinite; }
@keyframes drift-1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,40px) scale(1.12); } }
@keyframes drift-2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,60px) scale(1.08); } }
@keyframes drift-3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-50px) scale(1.1); } }
@media (max-width: 768px) { .aurora span { filter: blur(60px); opacity: .35; } }

.grain {
    position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .035; mix-blend-mode: overlay;
    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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (max-width: 768px) { .grain { display: none; } }

.mythx {
    background: var(--grad-brand);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    animation: glow-breathe 3.5s ease-in-out infinite;
}
@keyframes glow-breathe { 0%,100% { filter: drop-shadow(0 0 12px rgba(123,92,240,0.45)); } 50% { filter: drop-shadow(0 0 28px rgba(78,170,255,0.65)); } }

/* ═══════════════════════ HEADER ═══════════════════════ */
header {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    padding: 0 6%; height: 68px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(7,8,15,0.6);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.15rem; }
.logo-mark {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    background: var(--grad-brand);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 1.05rem; color: #fff;
    box-shadow: 0 4px 16px rgba(123,92,240,0.4);
}
.header-actions { display: flex; align-items: center; gap: 12px; }

/* ═══ Language switcher (liquid glass) ═══ */
.lang-wrapper { position: relative; }
.lang-btn {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(14px) saturate(1.5);
    -webkit-backdrop-filter: blur(14px) saturate(1.5);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
    color: var(--text);
    padding: 8px 14px; border-radius: 999px;
    cursor: pointer; font-family: 'Rubik', sans-serif;
    font-size: .82rem; font-weight: 600;
    transition: border-color var(--dur-fast), background var(--dur-fast);
    position: relative; overflow: hidden;
}
.lang-btn::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.28) 45%, transparent 60%);
    transform: translateX(-120%);
    transition: transform .7s var(--ease-out);
    pointer-events: none;
}
.lang-btn:hover::after { transform: translateX(120%); }
.lang-btn:hover, .lang-btn.open { border-color: rgba(123,92,240,0.4); background: rgba(255,255,255,0.08); }
.lang-btn .lb-inner { display: flex; align-items: center; gap: 6px; }
.lang-btn .arrow { font-size: 9px; color: var(--muted2); transition: transform var(--dur-fast); }
.lang-btn.open .arrow { transform: rotate(180deg); }

.lang-dropdown {
    display: flex; flex-direction: column;
    position: absolute; top: calc(100% + 8px);
    background: var(--card2);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--border-h);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
    opacity: 0; transform: translateY(-6px);
    pointer-events: none; transition: all var(--dur-fast);
    min-width: 130px; z-index: 99;
}
[dir="ltr"] .lang-dropdown { right: 0; left: auto; }
[dir="rtl"] .lang-dropdown { left: 0; right: auto; }
.lang-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.lang-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; cursor: pointer;
    font-size: .85rem; color: var(--muted2); transition: var(--dur-fast);
}
.lang-option:hover { background: rgba(123,92,240,0.1); color: var(--text); }
.lang-option.active { background: rgba(123,92,240,0.18); color: #fff; font-weight: 600; }

.btn-back {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(14px) saturate(1.5);
    -webkit-backdrop-filter: blur(14px) saturate(1.5);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
    color: var(--text);
    padding: 8px 16px; border-radius: 999px;
    font-size: .82rem; font-weight: 600; text-decoration: none;
    transition: transform var(--dur-fast), background var(--dur-fast);
}
.btn-back:hover { transform: translateY(-2px); background: rgba(255,255,255,0.1); }

/* ═══════════════════════ MAIN LAYOUT ═══════════════════════ */
main { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 130px 6% 60px; }

.legal-hero { text-align: center; margin-bottom: 36px; }
.section-label {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(123,92,240,0.1); border: 1px solid var(--border-h);
    color: var(--accent2); font-size: .78rem; font-weight: 700;
    padding: 6px 16px; border-radius: 999px; margin-bottom: 18px;
    letter-spacing: .3px;
}
.legal-hero h1 { font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 900; letter-spacing: -0.02em; margin-bottom: 10px; }
.legal-hero h1 .dot { color: var(--accent2); }
.legal-subtitle { color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.intro-text {
    color: var(--muted2); font-size: .92rem; line-height: 1.8;
    padding: 18px 22px;
    background: rgba(123,92,240,0.05);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-md);
    text-align: left;
}
[dir="rtl"] .intro-text { border-left: 1px solid var(--border); border-right: 3px solid var(--accent); text-align: right; }

/* ═══ Table of contents (pill tabs, like cmd-tabs on main site) ═══ */
.legal-toc {
    position: sticky; top: 78px; z-index: 50;
    display: flex; gap: 8px; overflow-x: auto;
    padding: 12px 4px 20px;
    margin-bottom: 8px;
    scrollbar-width: none;
}
.legal-toc::-webkit-scrollbar { display: none; }
.toc-pill {
    display: inline-flex; align-items: center; gap: 7px;
    flex-shrink: 0;
    padding: 8px 16px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(14,16,32,0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--muted2);
    font-size: .8rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: color var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
}
.toc-pill i { font-size: .74rem; color: var(--accent2); }
.toc-pill:hover, .toc-pill.active { color: var(--text); border-color: rgba(123,92,240,0.4); background: rgba(123,92,240,0.12); }

/* ═══════════════════════ SECTION CARDS ═══════════════════════ */
.legal-sections { display: flex; flex-direction: column; gap: 18px; }
.legal-card {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--r-xl);
    padding: 28px 30px;
    scroll-margin-top: 150px;
    transition: transform var(--dur-med) var(--ease-out), border-color var(--dur-med), box-shadow var(--dur-med);
    position: relative;
    overflow: hidden;
}
.legal-card::before {
    content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent2), transparent);
    opacity: 0; transition: opacity var(--dur-med);
}
.legal-card:hover { transform: translateY(-4px); border-color: rgba(123,92,240,0.25); box-shadow: 0 20px 50px rgba(0,0,0,0.35); }
.legal-card:hover::before { opacity: .5; }

.legal-card h2 {
    font-size: 1.02rem; font-weight: 800; letter-spacing: .2px;
    margin-bottom: 16px; display: flex; align-items: center; gap: 12px;
}
.legal-card h2 i {
    width: 34px; height: 34px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(123,92,240,0.14);
    border-radius: 10px;
    font-size: .85rem;
    color: var(--accent2);
}
.legal-card p, .legal-card li { color: var(--muted2); font-size: .87rem; line-height: 1.75; }
.legal-card p + p { margin-top: 8px; }
.legal-card ul { padding-left: 20px; display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
[dir="rtl"] .legal-card ul { padding-left: 0; padding-right: 20px; }
.legal-card li::marker { color: var(--accent2); }
.legal-card a { color: var(--accent2); text-decoration: none; }
.legal-card a:hover { text-decoration: underline; }

.highlight-box {
    display: flex; align-items: flex-start; gap: 10px;
    background: rgba(232,185,74,0.07);
    border: 1px solid rgba(232,185,74,0.25);
    border-radius: var(--r-md); padding: 14px 16px;
    margin-top: 16px;
    font-size: .82rem; color: var(--muted2); line-height: 1.7;
}
.highlight-box strong { color: var(--gold); font-weight: 700; }
.highlight-box.note { background: rgba(123,92,240,0.07); border-color: rgba(123,92,240,0.25); }
.highlight-box.note strong { color: var(--accent2); }

.data-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.data-item {
    display: flex; align-items: center; gap: 9px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    font-size: .78rem; font-weight: 600; color: var(--muted2);
}
.data-item i { color: var(--accent2); font-size: .8rem; width: 16px; text-align: center; }
@media (max-width: 560px) { .data-grid { grid-template-columns: 1fr; } }

.btn-discord {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--grad-brand);
    color: #fff; text-decoration: none;
    padding: 12px 26px; border-radius: 999px;
    font-weight: 700; font-size: .88rem;
    margin-top: 14px;
    position: relative; overflow: hidden;
    box-shadow: 0 8px 24px rgba(123,92,240,0.35);
    transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}
.btn-discord::after {
    content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
    transform: skewX(-20deg);
    transition: left .65s var(--ease-out);
}
.btn-discord:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(123,92,240,0.5); }
.btn-discord:hover::after { left: 130%; }

/* ═══════════════════════ FOOTER ═══════════════════════ */
.legal-footer {
    position: relative; z-index: 1;
    max-width: 880px; margin: 20px auto 0; padding: 24px 6% 40px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    border-top: 1px solid var(--border);
    font-size: .78rem; color: var(--muted); text-align: center;
}
.legal-footer a { color: var(--muted2); text-decoration: none; font-weight: 600; }
.legal-footer a:hover { color: var(--accent2); text-decoration: underline; }
.footer-dot { width: 6px; height: 6px; background: var(--accent2); border-radius: 50%; box-shadow: 0 0 8px var(--accent2); flex-shrink: 0; }

/* ═══ Scroll reveal (matches main site kinetic style) ═══ */
[data-reveal] {
    opacity: 0; transform: translateY(24px);
    transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
    transition-delay: calc(var(--d, 0) * 60ms);
}
[data-reveal].in-view { opacity: 1; transform: translateY(0); }
@media (max-width: 768px) { [data-reveal] { transition-delay: 0s !important; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; transition: none; } }

/* ═══════════════════════ ICON PROTECTION (RTL / translation safety) ═══════════════════════ */
/* Font Awesome icons must never inherit page direction or get caught by translation/RTL
   reflow tools — they are glyphs, not language content. This keeps them pinned LTR and
   isolated from the surrounding bidi context regardless of page language. */
i[class*="fa-"] {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}
i.fa-brands { font-family: "Font Awesome 6 Brands" !important; }

/* ═══════════════════════ RESPONSIVE ═══════════════════════ */
@media (max-width: 640px) {
    header { padding: 0 4%; height: 60px; }
    .logo span.brand-text { display: none; }
    main { padding: 100px 4% 50px; }
    .legal-card { padding: 22px 20px; border-radius: var(--r-lg); }
    .legal-hero h1 { font-size: 1.7rem; }
}

/* ═══ Touch devices ═══ */
@media (hover: none), (pointer: coarse) {
    .legal-card:hover { transform: none; box-shadow: none; }
    .legal-card:hover::before { opacity: 0; }
}
