/*
 * The catalog of SMeet Mini Apps (/mini-apps/) and the pages of the platform's own applications
 * (/mini-apps/<name>/), MINI_APPS_DESIGN.md 16.6 and 19.3. Served from /mini-apps/_site/ under
 * style-src 'self': no inline styles, no style attributes, no web fonts (the system font only, so the
 * pages load nothing from another site).
 */

:root {
  color-scheme: light dark;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --ink: #17181c;
  --muted: #5b5f6a;
  --line: #e2e0da;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --note: #fff6dc;
  --note-line: #ecd48b;
  --mark: #e8eefb;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111215;
    --surface: #1a1c21;
    --ink: #eceef2;
    --muted: #a3a8b3;
    --line: #2c2f36;
    --accent: #6ea1ff;
    --accent-ink: #0d1626;
    --note: #2a2516;
    --note-line: #5f522a;
    --mark: #1f2a40;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
}

/* Both languages are in the page. Once the script has chosen one, the other is hidden; without the
   script both stay visible, and the switch, which needs the script, is not shown. */
html[data-lang="en"] .ru,
html[data-lang="ru"] .en,
html:not([data-lang]) .lang-switch {
  display: none !important;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- header and footer ---- */

.head {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.head__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.head__nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-left: auto;
  font-size: 15px;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  padding: 4px 12px;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--surface);
}

.foot {
  margin-top: 56px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

/* ---- the intro ---- */

.intro {
  padding: 40px 0 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
}

.lede {
  margin: 0 0 12px;
  max-width: 44em;
  color: var(--muted);
  font-size: 18px;
}

/* ---- the Safari hint and the status line ---- */

.hint {
  margin: 20px 0;
  padding: 14px 16px;
  background: var(--note);
  border: 1px solid var(--note-line);
  border-radius: var(--radius);
}

.hint p {
  margin: 0;
}

.hint p + p {
  margin-top: 6px;
}

.hint__title {
  font-weight: 650;
}

.status {
  margin: 16px 0;
  color: var(--muted);
}

.status__text {
  margin: 0 0 8px;
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button--quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

/* ---- the list ---- */

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}

.app__head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app__icon,
.app__mark {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.app__icon {
  object-fit: cover;
  background: var(--mark);
}

.app__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mark);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}

.app__title {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.app__badge {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--mark);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.app__desc {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 12px;
  margin: 0;
  font-size: 14px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.app__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: auto 0 0;
  padding-top: 4px;
}

.app__address {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.app__nolink {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---- the page of one application ---- */

.card {
  margin-top: 24px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.card p {
  margin: 0 0 10px;
}

.card ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.open {
  margin-top: 8px;
}

.open__area p {
  margin: 8px 0 0;
}

@media (max-width: 560px) {
  .head__nav {
    margin-left: 0;
    width: 100%;
  }

  .intro {
    padding-top: 28px;
  }
}
