/* Vistilla's documentation, in Vistilla's own look: the app's teal, soft washes,
   rounded cards and real screenshots. No web fonts and nothing from another
   origin: the server's Content-Security-Policy allows neither. */

/* --- colour ----------------------------------------------------------------- */

:root,
[data-md-color-scheme="default"] {
  --vistilla-teal: #2a7d94;
  --vistilla-teal-deep: #17596b;
  --vistilla-teal-soft: rgba(42, 125, 148, 0.1);
  --vistilla-teal-line: rgba(42, 125, 148, 0.22);
  --vistilla-ground: #f4f9fa;
  --vistilla-card: #ffffff;
  --vistilla-shadow: 0 1px 2px rgba(12, 40, 48, 0.06), 0 12px 32px -16px rgba(12, 40, 48, 0.28);
  --vistilla-shadow-lift: 0 2px 4px rgba(12, 40, 48, 0.06), 0 22px 44px -18px rgba(12, 40, 48, 0.38);

  --md-primary-fg-color: #2a7d94;
  --md-primary-fg-color--light: #4aa9c2;
  --md-primary-fg-color--dark: #17596b;
  --md-accent-fg-color: #1f6b80;
  --md-typeset-a-color: #1f6b80;
  --md-default-bg-color: var(--vistilla-ground);
  --md-code-bg-color: #eef5f7;
}

[data-md-color-scheme="slate"] {
  --vistilla-teal: #5fb9d0;
  --vistilla-teal-deep: #8fd3e4;
  --vistilla-teal-soft: rgba(95, 185, 208, 0.12);
  --vistilla-teal-line: rgba(95, 185, 208, 0.24);
  --vistilla-ground: #0b1719;
  --vistilla-card: #102125;
  --vistilla-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 14px 34px -16px rgba(0, 0, 0, 0.9);
  --vistilla-shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 24px 48px -18px rgba(0, 0, 0, 0.95);

  --md-hue: 192;
  --md-primary-fg-color: #1f5f71;
  --md-accent-fg-color: #8fd3e4;
  --md-typeset-a-color: #8fd3e4;
  --md-default-bg-color: var(--vistilla-ground);
  --md-code-bg-color: #0f2226;
}

/* --- frame ------------------------------------------------------------------ */

body {
  background:
    radial-gradient(900px 600px at 0% 0%, var(--vistilla-teal-soft), transparent 70%),
    radial-gradient(800px 600px at 100% 30%, var(--vistilla-teal-soft), transparent 70%),
    var(--vistilla-ground);
  background-attachment: fixed;
}

/* A glassy header over the page, as in the app. */
.md-header {
  background: color-mix(in srgb, var(--md-primary-fg-color) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.md-tabs {
  background: color-mix(in srgb, var(--md-primary-fg-color) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.md-tabs__link { font-weight: 600; opacity: 0.78; }
.md-tabs__link--active, .md-tabs__link:hover { opacity: 1; }
.md-header__button.md-logo img { height: 1.6rem; border-radius: 7px; }
.md-search__form { border-radius: 10px; }

/* The reading column as one soft card. */
.md-main__inner { margin-top: 1.4rem; }
.md-content__inner {
  background: var(--vistilla-card);
  border: 1px solid var(--vistilla-teal-line);
  border-radius: 18px;
  box-shadow: var(--vistilla-shadow);
  padding: 1.6rem 2.2rem 2rem;
  margin-bottom: 2rem;
}
.md-content__inner::before { display: none; }
@media screen and (max-width: 44.9375em) {
  .md-content__inner { border-radius: 0; border-left: 0; border-right: 0; padding: 1rem 1rem 1.4rem; }
}

.md-nav__link--active { font-weight: 700; }
.md-sidebar .md-nav__title,
.md-nav--lifted > .md-nav__list > .md-nav__item--active > .md-nav__link {
  background: transparent !important;
  box-shadow: none !important;
}
.md-sidebar__scrollwrap { background: transparent; }
.md-nav__item--section > .md-nav__link { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.62rem; opacity: 0.75; }

/* --- type ------------------------------------------------------------------- */

.md-typeset { font-size: 0.79rem; line-height: 1.7; }
.md-typeset h1 { font-weight: 800; letter-spacing: -0.025em; color: var(--md-default-fg-color); margin-bottom: 0.6em; }
.md-typeset h2 { font-weight: 750; letter-spacing: -0.015em; margin-top: 2em; padding-top: 0.2em; }
.md-typeset h3 { font-weight: 700; }
.md-typeset h2 + p, .md-typeset h1 + p { margin-top: 0.4em; }

/* The opening paragraph of a page reads as its summary. */
.md-typeset .lead { font-size: 0.95rem; line-height: 1.6; color: var(--md-default-fg-color--light); margin-top: -0.2rem; }

.md-typeset code { border-radius: 6px; padding: 0.1em 0.38em; }
.md-typeset pre > code { white-space: pre; border-radius: 12px; }
.md-typeset pre { border-radius: 12px; }
.md-typeset kbd {
  border-radius: 6px;
  box-shadow: inset 0 -2px 0 var(--vistilla-teal-line), 0 0 0 1px var(--vistilla-teal-line);
  background: var(--vistilla-card);
}

/* --- tables ----------------------------------------------------------------- */

.md-typeset table:not([class]) {
  border: 1px solid var(--vistilla-teal-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  font-size: 0.74rem;
}
.md-typeset table:not([class]) th {
  background: var(--vistilla-teal-soft);
  color: var(--md-default-fg-color);
  font-weight: 700;
}
.md-typeset table:not([class]) tr:hover { background: color-mix(in srgb, var(--vistilla-teal-soft) 50%, transparent); }

/* --- admonitions ------------------------------------------------------------ */

.md-typeset .admonition,
.md-typeset details {
  border-radius: 12px;
  border-width: 1px;
  border-left-width: 4px;
  box-shadow: none;
  font-size: 0.76rem;
}
.md-typeset .admonition-title,
.md-typeset summary { border-radius: 10px 10px 0 0; font-weight: 700; }

/* --- screenshots ------------------------------------------------------------ */

.md-typeset .shot {
  display: block;
  margin: 1.2em auto;
  border-radius: 14px;
  border: 1px solid var(--vistilla-teal-line);
  box-shadow: var(--vistilla-shadow);
}
.md-typeset .shot.small { max-width: 460px; }
.md-typeset .shot.medium { max-width: 640px; }
.md-typeset figure { margin: 1.4em auto; }
.md-typeset figure .shot { margin: 0 auto; }
.md-typeset figcaption {
  margin-top: 0.7em;
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
  font-style: normal;
  max-width: 34rem;
}

/* A screenshot in a browser window frame. */
.md-typeset .window {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--vistilla-teal-line);
  box-shadow: var(--vistilla-shadow-lift);
  background: var(--vistilla-card);
}
.md-typeset .window::before {
  content: "";
  display: block;
  height: 28px;
  background:
    radial-gradient(circle at 16px 14px, #ff5f57 5px, transparent 5.5px),
    radial-gradient(circle at 34px 14px, #febc2e 5px, transparent 5.5px),
    radial-gradient(circle at 52px 14px, #28c840 5px, transparent 5.5px),
    color-mix(in srgb, var(--vistilla-teal-soft) 60%, var(--vistilla-card));
  border-bottom: 1px solid var(--vistilla-teal-line);
}
.md-typeset .window img { display: block; width: 100%; }

/* --- the home page ---------------------------------------------------------- */

.md-typeset .hero {
  position: relative;
  margin: -1.6rem -2.2rem 1.5rem;
  padding: 3rem 2.2rem 2.4rem;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  background:
    radial-gradient(600px 300px at 10% 0%, rgba(95, 185, 208, 0.35), transparent 70%),
    radial-gradient(500px 300px at 95% 20%, rgba(42, 125, 148, 0.28), transparent 70%),
    linear-gradient(180deg, var(--vistilla-teal-soft), transparent);
  border-bottom: 1px solid var(--vistilla-teal-line);
}
@media screen and (max-width: 44.9375em) {
  .md-typeset .hero { margin: -1rem -1rem 1.2rem; padding: 2rem 1rem 1.6rem; border-radius: 0; }
}
.md-typeset .hero .eyebrow {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vistilla-teal-deep);
  background: var(--vistilla-teal-soft);
  border: 1px solid var(--vistilla-teal-line);
  border-radius: 999px;
  padding: 0.25em 0.9em;
}
.md-typeset .hero h1 {
  font-size: 2.3rem;
  line-height: 1.12;
  margin: 0.5em 0 0.35em;
  max-width: 18em;
}
.md-typeset .hero h1 .grad {
  background: linear-gradient(90deg, var(--vistilla-teal), #5fb9d0 60%, var(--vistilla-teal-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.md-typeset .hero p { font-size: 0.95rem; max-width: 36em; color: var(--md-default-fg-color--light); margin: 0 0 1.2em; }
.md-typeset .hero .md-button { margin: 0.2em 0.4em 0.2em 0; border-radius: 10px; font-weight: 700; }
.md-typeset .hero .window { margin-top: 2rem; }

/* Cards: Material's grid, softened. */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  border: 1px solid var(--vistilla-teal-line);
  border-radius: 16px;
  background: var(--vistilla-card);
  box-shadow: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  padding: 1rem 1.1rem;
}
.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid > .card:hover {
  transform: translateY(-2px);
  box-shadow: var(--vistilla-shadow-lift);
  border-color: color-mix(in srgb, var(--vistilla-teal) 45%, transparent);
}
.md-typeset .grid.cards .twemoji.lg,
.md-typeset .grid.cards > ul > li > p:first-child .twemoji {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 11px;
  background: var(--vistilla-teal-soft);
  color: var(--vistilla-teal);
  vertical-align: middle;
  margin-right: 0.35rem;
}
.md-typeset .grid.cards .twemoji svg { width: 1.2rem; height: 1.2rem; }
.md-typeset .grid.cards hr { margin: 0.6em 0; border-color: var(--vistilla-teal-line); }

@media screen and (min-width: 45em) {
  .md-typeset .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Numbered steps, each in a circle. */
.md-typeset .steps > ol { counter-reset: step; list-style: none; padding-left: 0; margin-left: 0; }
.md-typeset .steps > ol > li {
  counter-increment: step;
  position: relative;
  padding: 0.1em 0 0.9em 2.6em;
  margin: 0;
  border-left: 2px solid var(--vistilla-teal-line);
  margin-left: 0.9em;
}
.md-typeset .steps > ol > li:last-child { border-left-color: transparent; }
.md-typeset .steps > ol > li::before {
  content: counter(step);
  position: absolute;
  left: -0.95em;
  top: 0;
  width: 1.8em;
  height: 1.8em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8em;
  color: #fff;
  background: linear-gradient(135deg, #5fb9d0, var(--vistilla-teal) 60%, var(--vistilla-teal-deep));
  box-shadow: 0 0 0 4px var(--vistilla-card);
}

/* A row of small facts. */
.md-typeset .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6em 0 1.2em; }
.md-typeset .chips span {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.25em 0.75em;
  border-radius: 999px;
  background: var(--vistilla-teal-soft);
  border: 1px solid var(--vistilla-teal-line);
  color: var(--vistilla-teal-deep);
}

.md-footer { background: transparent; color: var(--md-default-fg-color); }
.md-footer__inner { padding-top: 0.6rem; }
.md-footer__link { opacity: 0.85; }
.md-footer-meta { background: color-mix(in srgb, var(--md-primary-fg-color) 92%, black); }

/* Phones: a smaller headline, last so it wins over the rules above. */
@media screen and (max-width: 44.9375em) {
  .md-typeset .hero h1 { font-size: 1.6rem; }
  .md-typeset .hero p { font-size: 0.82rem; }
  .md-typeset .hero .md-button { padding: 0.5em 1.2em; }
}

/* --- choosing web or mobile ------------------------------------------------- */

/* The home page's two doors: the web app and the mobile app, each a large
   card with its device drawn as a glowing tile. */
.md-typeset .chooser {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.1rem;
  margin: 1.6rem 0 2.2rem;
}
.md-typeset .chooser a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.6rem 1.5rem 1.4rem;
  border-radius: 24px;
  background: var(--vistilla-card);
  border: 1px solid var(--vistilla-teal-line);
  box-shadow: var(--vistilla-shadow);
  color: var(--md-default-fg-color);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.md-typeset .chooser a::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% auto;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--vistilla-teal-soft), transparent);
  pointer-events: none;
}
.md-typeset .chooser a:hover {
  transform: translateY(-3px);
  box-shadow: var(--vistilla-shadow-lift);
  border-color: var(--vistilla-teal);
}
.md-typeset .chooser .tile {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 18px;
  background: linear-gradient(140deg, #4cc9dc, var(--vistilla-teal) 55%, var(--vistilla-teal-deep));
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--vistilla-teal) 70%, transparent);
  color: #fff;
}
.md-typeset .chooser .tile svg { width: 1.8rem; height: 1.8rem; max-height: none; fill: #fff; }
.md-typeset .chooser .tile .twemoji { display: grid; place-items: center; }
/* Markdown wraps each card in a paragraph; the grid sees the cards. */
.md-typeset .chooser > p { display: contents; }
.md-typeset .chooser .name, .md-typeset .chooser .what, .md-typeset .chooser .go { display: block; }
.md-typeset .chooser .name { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.015em; margin-top: 0.4rem; }
.md-typeset .chooser .what { color: var(--md-default-fg-color--light); line-height: 1.55; }
.md-typeset .chooser .go { margin-top: auto; padding-top: 0.6rem; font-weight: 700; color: var(--md-typeset-a-color); }

/* --- a tutorial's head ------------------------------------------------------ */

/* Under a tutorial's title: how long it takes and what is needed, as chips,
   then what you will have done by the end, on a soft wash. */
.md-typeset .tut-goal {
  margin: 0.4rem 0 1.6rem;
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  background: var(--vistilla-teal-soft);
  border: 1px solid var(--vistilla-teal-line);
}
.md-typeset .tut-goal p { margin: 0; }
.md-typeset .tut-goal strong { color: var(--md-typeset-a-color); }

/* The "what's next" cards at the foot of a tutorial sit closer together. */
.md-typeset .next.grid.cards { margin-top: 0.6rem; }

/* --- Arabic ------------------------------------------------------------------ */

/* The Arabic pages (/docs/ar/) in Cairo, the typeface the app uses in Arabic,
   served by the site itself; Latin words keep the system font. */
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC;
}
[dir="rtl"] body, [dir="rtl"] .md-typeset, [dir="rtl"] .md-nav, [dir="rtl"] .md-header, [dir="rtl"] .md-tabs {
  font-family: "Cairo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[dir="rtl"] .md-typeset { line-height: 1.85; }
[dir="rtl"] .md-typeset h1, [dir="rtl"] .md-typeset h2, [dir="rtl"] .md-typeset .hero h1 { letter-spacing: 0; }
/* Numbered steps hang on the right in Arabic. */
[dir="rtl"] .md-typeset .steps > ol > li {
  padding: 0.1em 2.6em 0.9em 0;
  margin-left: 0;
  margin-right: 0.9em;
  border-left: none;
  border-right: 2px solid var(--vistilla-teal-line);
}
[dir="rtl"] .md-typeset .steps > ol > li:last-child { border-right-color: transparent; }
[dir="rtl"] .md-typeset .steps > ol > li::before { left: auto; right: -0.95em; }
/* The language button stands out a little, as on the site. */
.md-header__option .md-select .md-header__button { border-radius: 999px; }
