/* ==========================================================================
   asas — legal documents (privacy, terms)
   Uses assets/site.css for tokens, type, nav and controls.
   ========================================================================== */

.legal-main { padding-block: clamp(108px, 11vw, 152px) clamp(64px, 8vw, 112px); }

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  margin-inline-end: 6px;
  font-size: 15px;
  color: var(--ink-soft);
  transition: color .2s ease;
}
.nav-back:hover { color: var(--ink); }
.nav-back i { font-style: normal; font-size: 18px; line-height: 1; }
html[dir="rtl"] .nav-back i { transform: rotate(180deg); }
@media (max-width: 640px) {
  .nav-back { padding-inline: 4px; margin-inline-end: 0; }
  .nav-back-text { display: none; }
}

.legal-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 7vw, 112px);
  align-items: start;
}

.legal-aside { display: flex; flex-direction: column; align-self: stretch; }

.legal-head h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 6.4vw, 88px);
  line-height: .96;
  letter-spacing: -.03em;
  max-width: 10ch;
  text-wrap: balance;
}
html[lang="ar"] .legal-head h1 { line-height: 1.1; letter-spacing: 0; max-width: 7ch; }

.legal-lede {
  margin-top: 22px;
  max-width: 30ch;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}
html[lang="ar"] .legal-lede { line-height: 1.8; }

.legal-updated {
  margin-top: 18px;
  font-size: 14.5px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.toc {
  margin-top: clamp(30px, 3.6vw, 46px);
  position: sticky;
  top: calc(var(--nav-h) + 28px);
  align-self: start;
}
.toc-title {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.toc-list { counter-reset: item; display: grid; gap: 1px; }
.toc-list li { counter-increment: item; }
.toc a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-block: 7px;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink-soft);
  transition: color .2s ease;
}
.toc a::before {
  content: counter(item, decimal-leading-zero);
  flex: none;
  min-width: 22px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--accent-text); }

.legal-body { padding-top: 4px; counter-reset: sec; }
.legal-body section { scroll-margin-top: calc(var(--nav-h) + 28px); counter-increment: sec; }
.legal-body section + section { margin-top: clamp(32px, 3.6vw, 48px); }
.legal-body h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(23px, 2.1vw, 29px);
  line-height: 1.22;
  letter-spacing: -.012em;
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
html[lang="ar"] .legal-body h2 { line-height: 1.45; letter-spacing: 0; }
.legal-body section > h2::before {
  content: counter(sec, decimal-leading-zero);
  flex: none;
  min-width: 22px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}
.legal-body p {
  font-size: 17px;
  line-height: 1.82;
  color: var(--ink);
  max-width: 70ch;
  text-wrap: pretty;
}
html[lang="ar"] .legal-body p { line-height: 2; }
.legal-body p + p { margin-top: 12px; }
.legal-body p a, .legal-body li a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

.legal-callout {
  margin-top: clamp(40px, 5vw, 64px);
  padding: clamp(24px, 3vw, 38px);
  background: var(--accent-soft);
}
.legal-callout h2 { font-size: clamp(22px, 2vw, 28px); display: block; }
.legal-callout p { color: var(--ink-soft); font-size: 16px; }
.legal-callout-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.legal-callout .btn { min-height: 46px; padding: 11px 20px; font-size: 15px; }
.legal-callout .btn-outline { --btn-border: var(--accent-text); }

.legal-foot { background: var(--ink-deep); color: #8CA0B8; }
.legal-foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  padding-block: 26px;
  font-size: 13.5px;
}
.legal-foot a { color: #DDE6F0; text-decoration: underline; text-underline-offset: 3px; }
.legal-foot a:hover { color: #fff; }
.legal-foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }

@keyframes legal-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.legal-head h1,
.legal-lede,
.legal-updated,
.toc-title,
.toc-list li { animation: legal-in .6s cubic-bezier(.22, .61, .36, 1) both; }
.legal-head h1 { animation-delay: .04s; }
.legal-lede { animation-delay: .1s; }
.legal-updated { animation-delay: .16s; }
.toc-title { animation-delay: .22s; }
.toc-list li:nth-child(1) { animation-delay: .26s; }
.toc-list li:nth-child(2) { animation-delay: .29s; }
.toc-list li:nth-child(3) { animation-delay: .32s; }
.toc-list li:nth-child(4) { animation-delay: .35s; }
.toc-list li:nth-child(5) { animation-delay: .38s; }
.toc-list li:nth-child(6) { animation-delay: .41s; }
.toc-list li:nth-child(7) { animation-delay: .44s; }
.toc-list li:nth-child(8) { animation-delay: .47s; }
.toc-list li:nth-child(9) { animation-delay: .5s; }

.legal-body section > h2.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .55s cubic-bezier(.22, .61, .36, 1);
}
.legal-body section > h2.reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .legal-grid { grid-template-columns: 1fr; gap: 34px; }
  .legal-head h1 { max-width: 16ch; }
  .toc { margin-top: 26px; position: static; }
  .toc-list { grid-template-columns: 1fr 1fr; gap: 0 22px; }
}

@media (max-width: 560px) {
  .toc-list { grid-template-columns: 1fr; }
  .legal-lede { max-width: 34ch; }
  .legal-body p { font-size: 16.5px; }
  .legal-foot-inner { flex-direction: column; align-items: flex-start; }
}

@media print {
  .hdr, .legal-foot, .toc, .legal-callout-actions { display: none; }
  .legal-grid { grid-template-columns: 1fr; }
  .legal-head h1, .legal-lede, .legal-updated { animation: none; }
  body { background: #fff; }
}

/* Legal pages: the header has only the brand pill and the language pill, so
   the middle grid column is empty. Flex keeps them on opposite edges. */
.hdr-in { display: flex; justify-content: space-between; }
