/* ============================================================
   ChaosQueue — design tokens
   Palette grounded in the product's own mechanic: a queue fills,
   then splits into two teams. Orange / blue = Team A / Team B,
   used as a recurring structural device (dividers, stats, hovers)
   rather than decoration.
   ============================================================ */
:root {
    --bg: #0a0a11;
    --surface: #14141f;
    --surface-2: #1b1b29;
    --border: #2a2a3d;
    --text: #f2f2f7;
    --text-muted: #90909f;
    --text-dim: #5c5c6e;

    --team-a: #ff6a39;
    --team-a-dim: #ff6a3933;
    --team-b: #3e8eff;
    --team-b-dim: #3e8eff33;
    --gold: #ffc94d;

    --split-gradient: linear-gradient(90deg, var(--team-a), var(--team-b));

    --display: "Tajawal", "Space Grotesk", sans-serif;
    --body: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 28px;

    --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

html[dir="rtl"] body { direction: rtl; }
html[dir="ltr"] body { direction: ltr; }

/* language toggling — coarse blocks */
html[data-lang="en"] .lang-ar { display: none !important; }
html[data-lang="ar"] .lang-en { display: none !important; }

h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
}

p { color: var(--text-muted); margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(10, 10, 17, 0.75);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; max-width: var(--container); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 20px; }
.brand-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--split-gradient); flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; color: var(--text-muted); }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-mobile-toggle { display: none; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 22px; border-radius: 999px; font-weight: 700; font-size: 15px;
    border: 1px solid transparent; cursor: pointer; transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--text); color: #0a0a11; }
.btn-primary:hover { background: var(--gold); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-gold {
    background: var(--gold); color: #0a0a11; box-shadow: 0 0 0 rgba(255,201,77,0);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-gold:hover { box-shadow: 0 0 24px rgba(255,201,77,0.45); transform: translateY(-1px); }
.btn-ghost:hover { border-color: var(--text-muted); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.lang-switch {
    display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px;
}
.lang-switch button {
    border: none; background: transparent; color: var(--text-muted); font-family: var(--body); font-weight: 700; font-size: 12px;
    padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.lang-switch button.active { background: var(--text); color: #0a0a11; }

/* ---------- hero ---------- */
.hero { padding: 88px 0 60px; position: relative; }
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; }
.hero-byline { font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--text-dim); letter-spacing: 0.02em; }
.hero-byline-dim { color: var(--text-dim); font-weight: 500; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text-muted);
    border: 1px solid var(--border); padding: 6px 14px; border-radius: 999px; background: var(--surface);
}
.eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: #4fd97a; box-shadow: 0 0 0 0 rgba(79,217,122,0.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(79,217,122,0.5);} 70% { box-shadow: 0 0 0 8px rgba(79,217,122,0);} 100% { box-shadow: 0 0 0 0 rgba(79,217,122,0);} }

.hero h1 { font-size: clamp(34px, 6vw, 62px); max-width: 900px; }
.hero h1 .accent { background: var(--split-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { font-size: 18px; max-width: 620px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

.games-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 720px; margin-top: 12px; }
.games-label { font-size: 12.5px; color: var(--text-dim); font-weight: 700; margin-inline-end: 4px; }
.game-chip {
    font-size: 12.5px; color: var(--text-muted); border: 1px solid var(--border); background: var(--surface);
    padding: 5px 13px; border-radius: 999px; direction: ltr; unicode-bidi: isolate;
}

/* ---------- signature: queue → split visualization ---------- */
.queue-viz {
    margin-top: 56px; width: 100%; max-width: 640px;
    display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.queue-track {
    display: flex; gap: 10px; padding: 18px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border);
    transition: gap 0.5s cubic-bezier(.2,.8,.2,1), padding 0.5s ease;
}
.queue-track.split { gap: 46px; }
.queue-slot {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--surface-2); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s cubic-bezier(.2,.8,.2,1);
    font-size: 16px;
}
.queue-slot.filled { transform: scale(1.05); }
.queue-slot.team-a.filled { background: var(--team-a-dim); border-color: var(--team-a); }
.queue-slot.team-b.filled { background: var(--team-b-dim); border-color: var(--team-b); }
.queue-status { font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--text-muted); letter-spacing: 0.02em; min-height: 20px; }
.queue-status.matched { color: var(--gold); }

/* ---------- section shell ---------- */
section { padding: 96px 0; }
.section-head { max-width: 640px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.divider { height: 2px; background: var(--split-gradient); border: none; opacity: 0.5; margin: 0; }

/* ---------- features grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 28px; transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--text-dim); transform: translateY(-3px); }
.card .icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 18px; }
.card:nth-child(3n+1) .icon { background: var(--team-a-dim); }
.card:nth-child(3n+2) .icon { background: var(--team-b-dim); }
.card:nth-child(3n+3) .icon { background: rgba(255,201,77,0.16); }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { font-size: 14.5px; margin: 0; }

/* ---------- how it works (real sequence — numbers earn their place here) ---------- */
.steps { display: flex; flex-direction: column; gap: 0; max-width: 720px; margin: 0 auto; }
.step { display: flex; gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--border); }
.step:last-child { border-bottom: none; }
.step-num {
    font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--bg);
    background: var(--split-gradient); width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-body h4 { font-size: 17px; margin-bottom: 4px; }
.step-body p { margin: 0; font-size: 14.5px; }

/* ---------- commands preview (mock discord message) ---------- */
.mock-discord {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 20px 24px; max-width: 560px; margin: 0 auto;
}
.mock-line { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.mock-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--split-gradient); flex-shrink: 0; }
.mock-cmd { font-family: monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; font-size: 13px; color: var(--gold); direction: ltr; unicode-bidi: isolate; display: inline-block; }
.mock-reply { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* ---------- stats strip ---------- */
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat .num { font-family: var(--display); font-weight: 800; font-size: 34px; background: var(--split-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .label { color: var(--text-muted); font-size: 13.5px; margin-top: 4px; }

/* ---------- CTA band ---------- */
.cta-band {
    text-align: center; padding: 72px 24px; border-radius: var(--radius-lg);
    background: linear-gradient(160deg, var(--surface), var(--surface-2));
    border: 1px solid var(--border);
}
.cta-band h2 { font-size: clamp(26px, 4vw, 36px); }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 48px 0 32px; }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; margin-bottom: 32px; }
.footer-col h5 { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.footer-col a { display: block; color: var(--text-muted); font-size: 14.5px; margin-bottom: 10px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--text-dim); font-size: 13px; border-top: 1px solid var(--border); padding-top: 24px; }

/* ---------- policy pages ---------- */
.policy { padding: 64px 0 100px; }
.policy .container { max-width: 760px; }
.policy h1 { font-size: clamp(28px, 4vw, 40px); }
.policy .updated { color: var(--text-dim); font-size: 14px; margin-bottom: 40px; }
.policy h2 { font-size: 20px; margin-top: 40px; padding-top: 8px; }
.policy ul { color: var(--text-muted); padding-inline-start: 22px; }
.policy li { margin-bottom: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 14.5px; margin-bottom: 32px; }
.back-link:hover { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .grid { grid-template-columns: 1fr 1fr; }
    .stats-strip { grid-template-columns: 1fr 1fr; }
    .nav-links { display: none; }
}
@media (max-width: 560px) {
    .grid { grid-template-columns: 1fr; }
    .stats-strip { grid-template-columns: 1fr 1fr; }
    .hero { padding: 64px 0 40px; }
    section { padding: 64px 0; }
    .queue-track.split { gap: 24px; }
    .footer-grid { gap: 24px; }
}

/* focus visibility */
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
