/* ---------------------------------------------------------------------------
   Code Clash — shared styles for the legal pages (privacy, terms, deletion).
   One file so the three pages stay visually identical and easy to update.
--------------------------------------------------------------------------- */

:root {
  --bg: #051525;
  --bg-mid: #101a4a;
  --bg-deep: #3a0f63;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef3ff;
  --muted: #aebbd6;
  --accent: #4dd0e1;
  --amber: #f5b301;
  --danger: #e53935;
  --radius: 20px;
  --shell: 1120px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Makes the native scrollbar and form controls dark instead of white. */
  color-scheme: dark;
  background: #051525;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.85;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(77, 208, 225, 0.16), transparent 60%),
    radial-gradient(800px 600px at 5% 20%, rgba(139, 92, 246, 0.18), transparent 65%),
    linear-gradient(175deg, var(--bg) 0%, var(--bg-mid) 52%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

/* The page must look complete even on very tall screens. */
main {
  flex: 1 0 auto;
  width: 100%;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Scrollbar: the browser's default white track was visible on desktop. */
html {
  scrollbar-color: #3f4d78 var(--bg);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #3f4d78;
  border-radius: 999px;
}

/* ------------------------------- header -------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 21, 37, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4dd0e1, #8b5cf6);
  color: #06121f;
  font-size: 18px;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
}

.site-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: #06121f;
  background: var(--accent);
}

.lang-switch {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.lang-switch button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  transition: 0.18s ease;
}

.lang-switch button:hover {
  color: #fff;
}

.lang-switch button.is-active {
  color: #06121f;
  background: var(--accent);
}

/* -------------------------------- hero --------------------------------- */

.legal-hero {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 56px 24px 10px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.legal-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.25;
  font-weight: 800;
}

.legal-hero p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------- content ------------------------------- */

.legal-shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 26px 24px 72px;
}

.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px;
  margin-bottom: 18px;
}

.legal-card--lead {
  background: linear-gradient(140deg, rgba(77, 208, 225, 0.12), rgba(139, 92, 246, 0.12));
  border-color: rgba(77, 208, 225, 0.25);
}

.legal-card h2,
.legal-section h2 {
  margin: 0 0 12px;
  font-size: clamp(19px, 2.2vw, 23px);
  line-height: 1.45;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-no {
  color: var(--amber);
  font-size: 0.8em;
  font-weight: 800;
  letter-spacing: 1px;
}

.legal-section {
  padding: 22px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-section:last-of-type {
  border-bottom: 0;
}

.legal-section p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15.5px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  margin: 6px 0 14px;
  padding-inline-start: 4px;
  list-style: none;
}

.legal-section li {
  position: relative;
  padding-inline-start: 20px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 15.5px;
}

.legal-section li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.legal-section strong {
  color: #fff;
}

.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(245, 179, 1, 0.3);
  background: rgba(245, 179, 1, 0.08);
  margin: 16px 0 4px;
}

.callout__icon {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1.4;
}

.callout p {
  margin: 0;
  color: #f7e6b0;
  font-size: 14.5px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 10px 26px rgba(229, 57, 53, 0.35);
}

.btn--danger:hover {
  background: #c62828;
}

.btn--ghost {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.email-pill {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: rgba(0, 0, 0, 0.35);
  font-size: 15px;
  word-break: break-all;
}

/* RTL adjustments */
html[dir="rtl"] .legal-section li::before {
  inset-inline-start: 0;
}

/* Only one language is rendered at a time. */
.lang-en,
.lang-ar {
  display: none;
}

html[data-lang="en"] .lang-en,
html[data-lang="ar"] .lang-ar {
  display: block;
}

/* -------------------------------- footer ------------------------------- */

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: rgba(3, 12, 23, 0.6);
}

.site-footer__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 26px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  color: var(--muted);
  font-size: 13.5px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-inline-start: auto;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: #fff;
}

/* ------------------------------ responsive ----------------------------- */

@media (max-width: 760px) {
  .site-header__inner {
    padding: 10px 16px;
    gap: 10px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-inline-start: 0;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .lang-switch {
    margin-inline-start: auto;
  }

  .legal-hero {
    padding: 34px 18px 6px;
  }

  .legal-hero p {
    font-size: 15px;
  }

  .legal-shell {
    padding: 18px 16px 56px;
  }

  .legal-card {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .legal-section {
    padding: 18px 2px;
  }

  .legal-section p,
  .legal-section li {
    font-size: 15px;
  }

  .btn-row {
    gap: 10px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .site-footer__inner {
    padding: 22px 18px 30px;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer__links {
    margin-inline-start: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Full-screen document layout
   The legal pages previously stopped at a narrow 1120px column and left a
   large empty band on wide screens. They now use the whole viewport: a wide
   document column plus a sticky table of contents that follows the reader.
   ========================================================================== */

:root {
  --shell: 1320px;
  --aside: 304px;
}

body {
  min-height: 100vh;
  min-height: 100svh;
}

.legal-hero {
  position: relative;
  max-width: var(--shell);
  padding: 60px 28px 18px;
}

.legal-hero::after {
  content: "";
  position: absolute;
  inset-inline-end: 0;
  top: 40px;
  width: min(46vw, 560px);
  height: 220px;
  background: radial-gradient(
    circle at 70% 40%,
    rgba(77, 208, 225, 0.16),
    transparent 65%
  );
  pointer-events: none;
  z-index: -1;
}

.legal-hero h1 {
  font-size: clamp(34px, 4.8vw, 54px);
  letter-spacing: -0.5px;
}

.legal-hero p {
  max-width: 780px;
  font-size: 16.5px;
}

.legal-shell {
  max-width: var(--shell);
  padding: 22px 28px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--aside);
  align-items: start;
  gap: 0 48px;
}

.legal-main {
  min-width: 0;
}

.legal-aside {
  position: sticky;
  top: 92px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 4px;
}

.aside-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  padding: 16px;
  backdrop-filter: blur(10px);
}

.aside-title {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent);
}

.toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  transition: background 0.16s ease, color 0.16s ease;
}

.toc a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  text-decoration: none;
}

.toc a.is-active {
  background: rgba(77, 208, 225, 0.14);
  color: #fff;
}

.toc-num {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: 10.5px;
  font-weight: 800;
}

.aside-meta {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--muted);
}

.aside-card--help .aside-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 4px;
  color: var(--muted);
  font-size: 13.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.aside-card--help .aside-link:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.aside-card--help .aside-link:hover {
  color: #fff;
  text-decoration: none;
}

.aside-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(77, 208, 225, 0.12);
  color: var(--accent);
  font-size: 14px;
}

/* Closing block so every document has a visible end instead of stopping. */
.legal-end {
  margin-top: 26px;
  padding: 22px;
  border: 1px solid rgba(77, 208, 225, 0.22);
  border-radius: 18px;
  background: linear-gradient(
    140deg,
    rgba(77, 208, 225, 0.1),
    rgba(139, 92, 246, 0.1)
  );
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.legal-end__icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #06121f;
  font-size: 20px;
  font-weight: 800;
}

.legal-end strong {
  display: block;
  font-size: 16px;
  color: #fff;
}

.legal-end p {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.legal-end .btn {
  margin-inline-start: auto;
}

.legal-section {
  scroll-margin-top: 100px;
}

/* Scroll progress bar, injected by legal.js. */
.read-progress {
  position: fixed;
  inset-inline: 0;
  top: 0;
  height: 3px;
  z-index: 100;
  pointer-events: none;
}

.read-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  box-shadow: 0 0 12px rgba(77, 208, 225, 0.55);
  transition: width 0.08s linear;
}

@media (max-width: 1024px) {
  .legal-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .legal-aside {
    position: static;
    max-height: none;
    overflow: visible;
    order: -1;
    width: 100%;
  }

  /* Every section stays visible on phones: no hidden horizontal strip. */
  .toc {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
  }

  .toc a {
    align-items: flex-start;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 10px;
    line-height: 1.45;
    white-space: normal;
  }


  .aside-card--help {
    display: none;
  }

  .legal-end .btn {
    margin-inline-start: 0;
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 1025px) and (max-width: 1180px) {
  :root {
    --aside: 268px;
  }

  .legal-shell {
    gap: 0 30px;
  }
}

@media (max-width: 760px) {
  .legal-hero {
    padding: 36px 18px 12px;
  }

  .legal-shell {
    padding: 18px 16px 48px;
  }

  /* Compact header: brand + language on one line, links scroll beneath. */
  .site-header__inner {
    padding: 10px 14px 8px;
    gap: 8px 10px;
  }

  .brand {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 16px;
    gap: 8px;
  }

  .brand__mark {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .lang-switch {
    margin-inline-start: auto;
    padding: 3px;
  }

  .lang-switch button {
    padding: 5px 10px;
    font-size: 12px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-inline-start: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    flex: 0 0 auto;
    padding: 6px 11px;
    font-size: 13px;
  }

  .aside-card {
    padding: 14px;
  }

  .legal-hero h1 {
    font-size: clamp(30px, 8.6vw, 40px);
  }
}

/* Shared editorial typography and Code Clash palette. */
:root{--bg:#070711;--bg-mid:#0f0f23;--bg-deep:#0f0f23;--text:#f0f9ff;--muted:#94a3b8;--accent:#00f5ff;--amber:#f59e0b}
body{font-family:'Alexandria',Arial,sans-serif;background:radial-gradient(900px 500px at 85% -10%,rgba(139,92,246,.14),transparent 60%),var(--bg)}
html[lang=en] body{font-family:'Montserrat',Arial,sans-serif}
.site-header{background:rgba(7,7,17,.92)}
.legal-hero h1{letter-spacing:0}
