/* base.css — reset, typography, prose, RTL. Everything structural; nothing
 * decorative lives here. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  /* The viewer's surface is painted behind the page, so body must state its own
   * background explicitly rather than inheriting anything. */
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-en);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* The aurora glows use negative insets. Without this, they extend the page's
   * scroll width and produce a horizontal scrollbar on every page. Each glow
   * host also clips locally; this is the last line of defence. */
  overflow-x: clip;
}

html[dir="rtl"] body { font-family: var(--font-ar); }

img, svg, video { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--teal); color: var(--on-accent); }

/* ── type ─────────────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  line-height: 1.14;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4 {
  /* Arabic has no uppercase and its letterforms are already tight; negative
   * tracking pinches the joins between letters. */
  letter-spacing: 0;
  line-height: 1.35;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }

.lead {
  font-size: var(--step-1);
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 58ch;
  text-wrap: pretty;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--teal);
  background: rgba(20, 227, 196, .09);
  border: 1px solid rgba(20, 227, 196, .24);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  margin-bottom: 18px;
}
html[dir="rtl"] .eyebrow { letter-spacing: 0; }

/* ── layout ───────────────────────────────────────────────────────────── */

.wrap {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}
@media (max-width: 640px) { .wrap { width: min(100% - 28px, var(--container)); } }

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 200;
  background: var(--teal);
  color: var(--on-accent);
  padding: 12px 20px;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.skip-link:focus { inset-inline-start: 0; }

/* ── prose ────────────────────────────────────────────────────────────── */

.prose { max-width: var(--measure); }
.prose > * + * { margin-block-start: 22px; }
.prose h2 {
  margin-block-start: 64px;
  padding-block-start: 8px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.prose h2:first-child { margin-block-start: 0; }
.prose h3 { margin-block-start: 34px; font-size: var(--step-1); }
.prose p { color: var(--ink-2); text-wrap: pretty; }
.prose strong { color: var(--ink); font-weight: 600; }

.prose a:not(.btn):not(.callout-cta) {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: rgba(20, 227, 196, .38);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s;
}
.prose a:not(.btn):not(.callout-cta):hover { text-decoration-color: var(--teal); }

.prose-list { padding-inline-start: 0; list-style: none; color: var(--ink-2); }
.prose-list li {
  position: relative;
  padding-inline-start: 30px;
  margin-block-start: 12px;
}
.prose-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 6px;
  top: .68em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 12px rgba(20, 227, 196, .7);
}
ol.prose-list { counter-reset: n; }
ol.prose-list li::before {
  counter-increment: n;
  content: counter(n);
  inset-inline-start: 0;
  top: .1em;
  width: 22px; height: 22px;
  border-radius: 7px;
  background: rgba(20, 227, 196, .13);
  border: 1px solid rgba(20, 227, 196, .3);
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: none;
}
ol.prose-list li { padding-inline-start: 36px; }

/* ── tables ───────────────────────────────────────────────────────────── */

/* Wide tables scroll inside their own box; the page body must never scroll
 * horizontally because of one comparison grid. */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--grad-surface);
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
caption {
  caption-side: top;
  text-align: start;
  padding: 16px 18px 12px;
  color: var(--ink);
  font-weight: 600;
  font-size: var(--step-0);
}
th, td {
  padding: 12px 16px;
  text-align: start;
  border-block-start: 1px solid var(--line);
  vertical-align: top;
}
thead th {
  color: var(--teal);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(20, 227, 196, .05);
}
html[dir="rtl"] thead th { letter-spacing: 0; text-transform: none; font-size: var(--step--1); }
tbody th { color: var(--ink); font-weight: 600; }
tbody td { color: var(--ink-2); }
tbody tr:hover { background: rgba(255, 255, 255, .028); }

/* ── the answer block ─────────────────────────────────────────────────── */

/* The 40-60 word direct answer. This is the unit AI Overviews and chat
 * assistants lift, and it is marked speakable in JSON-LD, so it must sit high
 * in the DOM and read as a complete answer on its own. */
.answer {
  position: relative;
  border-inline-start: 2px solid var(--teal);
  background: linear-gradient(90deg, rgba(20, 227, 196, .07), transparent 70%);
  padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
html[dir="rtl"] .answer { border-radius: var(--radius) 0 0 var(--radius); }
.answer-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}
html[dir="rtl"] .answer-label { letter-spacing: 0; text-transform: none; font-size: var(--step--1); }
.answer p { color: var(--ink); font-size: var(--step-1); line-height: 1.6; }
