/* Morpho support site. One stylesheet for all pages, LTR and RTL.
   Only logical properties are used, so Arabic pages need no extra CSS.
   No web fonts, no external requests. */

:root {
  color-scheme: light dark;
  /* The app's own tokens (Morpho/Design/MorphoTheme.swift): ink on paper
     laid on a desk, and one blue, the butterfly's, for what can be
     followed. Contrast on the desk / on paper: ink 15.6 / 17.9, quiet ink
     5.5 / 6.3, blue 5.1 / 5.8 (by night 16.5 / 14.6, 9.0 / 7.9, 7.7 / 6.8). */
  --bg: #EDEFF4;      /* desk */
  --card: #FFFFFF;    /* paper */
  --text: #131722;    /* ink */
  --text-2: #566075;  /* quiet ink */
  --accent: #2458E6;  /* the butterfly's blue */
  --on-accent: #FFFFFF;
  --sep: #D9DDE8;     /* hairline */
  --edge: #B4BBCB;    /* a sheet's edge: 3:1 is not needed, but it shows */
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          "Noto Sans Arabic", "Geeza Pro", sans-serif;
  --serif: "New York", ui-serif, Georgia, "Times New Roman", "Noto Naskh Arabic",
           "Geeza Pro", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070C1B;
    --card: #111A35;
    --text: #E8ECFA;
    --text-2: #A5B0CF;
    --accent: #7DA0FF;
    --on-accent: #070C1B;
    --sep: #26335A;
    --edge: #3D4C7A;
  }
}

/* Increase Contrast: the app's deeper inks and firmer hairlines. */
@media (prefers-contrast: more) {
  :root { --text: #0B0E16; --text-2: #3E4659; --sep: #B4BBCB; --edge: #8A93A8; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --text: #F4F6FD; --text-2: #C3CBE3; --sep: #3D4C7A; --edge: #5A6A9C; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  text-align: start;
  -webkit-font-smoothing: antialiased;
}

:lang(ar) body, body:lang(ar) { line-height: 1.8; }

.wrap {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* Links and focus */
a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
a:hover { text-decoration: underline; }
/* In running text a link is underlined too: the blue alone is not far
   enough from the ink (WCAG 1.4.1, colour is never the only signal). */
main p a, main li a { text-decoration: underline; text-underline-offset: 0.18em; }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-start: -100px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 10;
}
.skip:focus { inset-block-start: 12px; text-decoration: none; }

/* Header */
.site-header { border-block-end: 1px solid var(--sep); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding-block: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 17px;
}
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* Main */
main { padding-block: 48px 64px; }
main:focus { outline: none; }

.hero { text-align: center; margin-block-end: 40px; }
.hero img {
  width: 112px;
  height: 112px;
  border-radius: 25px;
  border: 1px solid var(--edge);
}
.eyebrow {
  margin: 20px 0 4px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
h1, h2 { font-family: var(--serif); }
h1 {
  margin: 0;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
}
:lang(ar) h1 { letter-spacing: 0; line-height: 1.35; }
.subtitle {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 19px;
}

h2 {
  margin: 48px 0 12px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}
:lang(ar) h2 { letter-spacing: 0; line-height: 1.5; }
p { margin: 0 0 14px; }
ul { margin: 0 0 14px; padding-inline-start: 1.3em; }
li { margin-block-end: 8px; }
li::marker { color: var(--text-2); }

.lead { font-size: 19px; }
.meta { color: var(--text-2); font-size: 15px; }

/* Cards and inset grouped lists */
.card {
  background: var(--card);
  border: 1px solid var(--sep);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-block: 16px;
}
.card > :last-child { margin-block-end: 0; }

.group {
  background: var(--card);
  border: 1px solid var(--sep);
  border-radius: var(--radius);
  overflow: hidden;
  margin-block: 16px;
}
.group details { margin-inline-start: 20px; }
.group details + details { border-block-start: 1px solid var(--sep); }
.group summary {
  position: relative;
  display: block;
  list-style: none;
  cursor: pointer;
  padding-block: 15px;
  padding-inline: 0 48px;
  font-weight: 600;
  line-height: 1.4;
}
.group summary::-webkit-details-marker { display: none; }
.group summary::after {
  content: "";
  position: absolute;
  inset-inline-end: 22px;
  inset-block-start: 50%;
  width: 9px;
  height: 9px;
  margin-block-start: -7px;
  border-block-end: 2px solid var(--text-2);
  border-inline-end: 2px solid var(--text-2);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.group details[open] > summary::after { transform: rotate(-135deg); margin-block-start: -2px; }
.group summary:hover { color: var(--accent); }
.group summary:focus-visible { outline-offset: -3px; }
.answer { padding-block: 0 16px; padding-inline: 0 22px; }
.answer > :last-child { margin-block-end: 0; }

@media (prefers-reduced-motion: reduce) {
  .group summary::after { transition: none; }
}

/* Steps in an answer */
.answer ol { margin: 0 0 14px; padding-inline-start: 1.4em; }

/* Contact */
.contact-email { font-size: 19px; font-weight: 600; }

/* Footer */
.site-footer {
  border-block-start: 1px solid var(--sep);
  color: var(--text-2);
  font-size: 14px;
}
.site-footer .wrap { padding-block: 24px 40px; }
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.site-footer p { margin: 0; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  main { padding-block: 32px 48px; }
  .card { padding: 16px 18px; }
  .group details { margin-inline-start: 16px; }
  .group summary { padding-inline-end: 42px; }
  .group summary::after { inset-inline-end: 18px; }
  .answer { padding-inline-end: 18px; }
  .lead, .subtitle { font-size: 17px; }
}
