/* Metric website
   No external fonts, scripts or images: the site makes no third-party requests. */

:root {
  color-scheme: light dark;

  --paper: #edf1f0;
  --surface: #ffffff;
  --text: #1e3235;
  --head: #0a3b3b;
  --muted: #4e6568;
  --teal: #0b6e69;
  --teal-ink: #ffffff;
  --brass: #b8801b;
  --line: #c8d4d2;
  --tint: #dcebe8;

  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans-ar: "Segoe UI", "Geeza Pro", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e191b;
    --surface: #152428;
    --text: #d3e1df;
    --head: #ecf6f4;
    --muted: #93aaab;
    --teal: #5cc7bb;
    --teal-ink: #052321;
    --brass: #e2ac3f;
    --line: #26393c;
    --tint: #173033;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  text-rendering: optimizeLegibility;
}

html[lang="ar"] body {
  font-family: var(--sans-ar);
  line-height: 1.9;
}

img, svg { max-width: 100%; }

a { color: var(--teal); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  background: var(--teal);
  color: var(--teal-ink);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  z-index: 20;
}
.skip:focus { top: 0.75rem; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

h1, h2, h3 {
  margin: 0;
  color: var(--head);
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 {
  font-family: var(--sans-ar);
  line-height: 1.4;
}

p { margin: 0 0 1em; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--head);
  font: 700 1.45rem/1 var(--serif);
  text-decoration: none;
}
html[lang="ar"] .brand { font-family: var(--sans-ar); }
.brand .mark { flex: none; }

.nav {
  display: flex;
  gap: 1.4rem;
  margin-inline-start: 1rem;
  flex: 1;
}
.nav a {
  color: var(--text);
  text-decoration: none;
  padding-block: 0.3rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { border-bottom-color: var(--brass); }

.bar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.lang {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  padding: 0.3rem 0.1rem;
}
.lang:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .bar { gap: 0.3rem 0.6rem; }
  .brand { font-size: 1.3rem; }
  .bar-actions { gap: 0.6rem; }
  .btn-sm { padding: 0.45rem 0.75rem; font-size: 0.88rem; }
  .lang { font-size: 0.92rem; }
}

@media (max-width: 760px) {
  .nav {
    order: 3;
    flex-basis: 100%;
    margin-inline-start: 0;
    gap: 1.1rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }
  .bar-actions { margin-inline-start: auto; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  border: 2px solid var(--teal);
  border-radius: 6px;
  background: var(--teal);
  color: var(--teal-ink);
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  transition: filter 0.15s ease;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--teal); }
.btn-ghost:hover { background: var(--tint); filter: none; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.95rem; }

/* ---------- Signature: the ruler ---------- */

.ruler {
  position: relative;
  height: 26px;
  border-bottom: 2px solid var(--head);
  background:
    repeating-linear-gradient(90deg, var(--head) 0 2px, transparent 2px 48px) left bottom / 100% 22px no-repeat,
    repeating-linear-gradient(90deg, var(--muted) 0 1px, transparent 1px 12px) left bottom / 100% 11px no-repeat;
}
[dir="rtl"] .ruler { background-position: right bottom, right bottom; }
.ruler::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 37%;
  width: 4px;
  height: 26px;
  background: var(--brass);
}

/* ---------- Home: hero ---------- */

.hero { padding-top: clamp(2.5rem, 7vw, 5.5rem); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.hero h1 {
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 13ch;
}
html[lang="ar"] .hero h1 {
  letter-spacing: 0;
  line-height: 1.25;
  max-width: 15ch;
  font-size: clamp(2.1rem, 4.8vw, 3.5rem);
}

.hero .lead {
  margin: 1.4rem 0 1.8rem;
  max-width: 34rem;
  font-size: 1.2rem;
  color: var(--text);
}

.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.hero-note {
  margin: 1.2rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Discord-style slash command picker (a picture of the product, always dark) */

.cmdmenu {
  direction: ltr;
  text-align: left;
  background: #14262a;
  color: #e4efed;
  border: 1px solid #2a4348;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px -22px rgba(4, 20, 22, 0.6);
  font-family: var(--sans);
  font-size: 0.95rem;
}
.cmdmenu-head {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #2a4348;
  color: #9db7b6;
  font-size: 0.85rem;
}
.cmdmenu-head b { color: #e4efed; }
.cmdmenu ul { list-style: none; margin: 0; padding: 0.35rem; }
.cmdmenu li {
  display: grid;
  grid-template-columns: 2rem auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.65rem;
  border-radius: 6px;
}
.cmdmenu li:first-child { background: #1f3a40; }
.cmdmenu .av {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #0b6e69;
  color: #fff;
  font: 700 0.95rem/1 var(--serif);
}
.cmdmenu .name { font-weight: 650; white-space: nowrap; }
.cmdmenu .desc {
  color: #9db7b6;
  font-size: 0.86rem;
  line-height: 1.4;
}
.cmdmenu-cap {
  margin: 0.8rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .cmdmenu li { grid-template-columns: 2rem minmax(0, 1fr); }
  .cmdmenu .desc { grid-column: 2; }
}

/* ---------- Home: sections ---------- */

.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section-head { max-width: 40rem; margin-bottom: 2.2rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
.section-head p { margin: 0.8rem 0 0; color: var(--muted); font-size: 1.1rem; }

.rows { border-bottom: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 0.6rem 2.5rem;
  padding-block: 1.7rem;
  border-top: 1px solid var(--line);
}
.row h3 { font-size: 1.35rem; }
.row p { margin: 0 0 0.9rem; max-width: 46rem; }
.row .cmds { margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; list-style: none; }
.cmd {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 4px;
  background: var(--tint);
  color: var(--teal);
  font-weight: 650;
  font-size: 0.95rem;
  direction: ltr;
  unicode-bidi: isolate;
}
@media (max-width: 760px) {
  .row { grid-template-columns: minmax(0, 1fr); }
}

.band {
  background: var(--tint);
  border-block: 1px solid var(--line);
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 2rem;
}
.facts div {
  padding: 1.3rem 1.6rem 1.3rem 0;
  border-top: 1px solid var(--line);
}
[dir="rtl"] .facts div { padding: 1.3rem 0 1.3rem 1.6rem; }
.facts dt {
  margin-bottom: 0.3rem;
  font: 700 1.2rem/1.3 var(--serif);
  color: var(--head);
}
html[lang="ar"] .facts dt { font-family: var(--sans-ar); }
.facts dd { margin: 0; max-width: 32rem; }
@media (max-width: 760px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.6rem;
  font: 700 3rem/1 var(--serif);
  color: var(--brass);
}
.steps h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.steps p { margin: 0; }
@media (max-width: 860px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; }
}

/* ---------- Legal pages ---------- */

.legal-head { padding-block: clamp(2.2rem, 5vw, 3.6rem) 2rem; }
.legal-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
html[lang="ar"] .legal-head h1 { line-height: 1.35; }
.meta { margin: 0.9rem 0 0; color: var(--muted); }
.legal-head .lead { margin: 1.3rem 0 0; max-width: 46rem; font-size: 1.15rem; }

.legal {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
  padding-block: 2.5rem 4.5rem;
}

.toc { position: sticky; top: 5.5rem; font-size: 0.95rem; }
.toc summary {
  cursor: pointer;
  margin-bottom: 0.7rem;
  font-weight: 700;
  color: var(--head);
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: flex;
  gap: 0.6rem;
  padding: 0.28rem 0.6rem;
  border-inline-start: 2px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.toc a:hover { border-inline-start-color: var(--brass); color: var(--head); }
.toc .n { flex: none; min-width: 1.5em; color: var(--muted); direction: ltr; unicode-bidi: isolate; }

.prose { max-width: 44rem; }
.prose h2 {
  margin: 3rem 0 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: 1.65rem;
}
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h2 .num {
  display: inline-block;
  min-width: 1.6em;
  margin-inline-end: 0.35em;
  color: var(--brass);
}
.prose h3 { margin: 1.8rem 0 0.5rem; font-size: 1.2rem; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-inline-start: 1.4rem; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--brass); }
.prose strong { color: var(--head); }

.summary {
  margin: 0 0 2.5rem;
  padding: 1.3rem 1.5rem 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--brass);
  border-radius: 6px;
}
.summary h2 {
  margin: 0 0 0.8rem !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 1.25rem !important;
}

.table-wrap {
  margin: 0 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
table.data { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
table.data th, table.data td {
  padding: 0.75rem 1rem;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
table.data tr:last-child td { border-bottom: 0; }
table.data th { background: var(--tint); color: var(--head); font-weight: 700; }
table.data td:first-child { font-weight: 600; color: var(--head); min-width: 9rem; }

.callout {
  margin: 0 0 1.4rem;
  padding: 1rem 1.2rem;
  background: var(--tint);
  border-inline-start: 4px solid var(--teal);
  border-radius: 6px;
}
.callout p:last-child { margin-bottom: 0; }

@media (max-width: 900px) {
  .legal { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 1.5rem; }
  .toc { position: static; }
  .toc details {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    background: var(--surface);
  }
  .toc summary { margin-bottom: 0; }
  .toc details[open] summary { margin-bottom: 0.7rem; }
}

/* ---------- Footer ---------- */

.site-footer { margin-top: 2rem; }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 2rem;
  padding-block: 2.5rem 1.5rem;
}
.footer-grid h2 {
  margin-bottom: 0.7rem;
  font: 700 1rem/1.3 var(--sans);
  color: var(--head);
}
html[lang="ar"] .footer-grid h2 { font-family: var(--sans-ar); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.4rem; }
.footer-grid a { color: var(--text); }
.footer-brand p { max-width: 24rem; color: var(--muted); font-size: 0.95rem; }
.legal-note {
  padding-block: 1.2rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.legal-note p { margin: 0 0 0.3rem; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Print ---------- */

@media print {
  :root {
    --paper: #fff; --surface: #fff; --text: #000; --head: #000;
    --muted: #333; --teal: #000; --line: #999; --tint: #fff;
  }
  .site-header, .toc, .site-footer .footer-grid, .skip, .ruler { display: none !important; }
  .legal { display: block; padding: 0; }
  .prose { max-width: none; }
  a { color: #000; }
  body { font-size: 11pt; }
}

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