/* apps.methodhelm.com: same look as methodhelm.com (font, ink, light
 * background). An app's colour (--app, set on <body>) is only a highlight:
 * its icon, the active tab and section headings. */
:root {
  --ink: #16132e;
  --muted: #5f5b78;
  --paper: #ffffff;
  --soft: #f6f4fd;
  --rule: #e3e0f0;
  --accent: #6a3dff;
  --accent-strong: #5326e6;
  --app: var(--accent);
}

* {
  box-sizing: border-box;
}

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

body {
  /* Darkened app colour for text, so headings keep AA contrast. Defined
   * here, where <body style="--app:…"> applies, not on :root. */
  --app-text: color-mix(in srgb, var(--app) 62%, var(--ink));
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Noto Sans TC", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

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

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

.site-head {
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 max(16px, calc((100% - 880px) / 2));
  border-bottom: 1px solid var(--rule);
  background: rgb(255 255 255 / 92%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
}

/* ---------- Page ---------- */

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.hero {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.app {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-icon {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 22%;
  box-shadow: 0 6px 16px rgb(22 19 46 / 14%);
}

.app-letter {
  display: grid;
  place-items: center;
  background: var(--app);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
}

.app-name {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Support / Privacy / Terms: three equal tabs on a phone (long words
 * like "Конфиденциальность" wrap instead of running off the edge). */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--paper);
}

.tabs a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.tabs a[aria-current] {
  background: var(--app-text);
  color: #fff;
}

@media (min-width: 640px) {
  .hero {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .tabs {
    display: flex;
    border-radius: 999px;
  }

  .tabs a {
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 15px;
    white-space: nowrap;
  }
}

/* The text itself: a white sheet with a comfortable line length. */
.content {
  padding: clamp(22px, 5vw, 48px);
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--paper);
}

.content > :first-child {
  margin-top: 0;
}

.content h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.content h2 {
  margin: 36px 0 8px;
  color: var(--app-text);
  font-size: 19px;
  line-height: 1.35;
}

.content p,
.content li {
  max-width: 68ch;
  margin: 0 0 14px;
}

.content ul,
.content ol {
  padding-left: 1.3em;
}

.content strong {
  font-weight: 700;
}

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

.legal-note {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-left: 3px solid var(--app);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 14px;
}

/* App list page (/ and /<lang>/): one card per app, two columns on wide
 * screens. */
.list .content {
  padding: 0;
  border: 0;
  background: none;
}

.list .content h1 {
  font-size: clamp(30px, 6vw, 42px);
}

.app-cards {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}

@media (min-width: 720px) {
  .app-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.app-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--paper);
}

.app-card h2 {
  margin: 4px 0 6px;
  color: var(--ink);
  font-size: 20px;
}

.app-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 15px;
}

.app-card p:last-child {
  margin: 0;
  font-size: 14px;
}

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

.site-foot {
  padding: 28px max(16px, calc((100% - 880px) / 2)) 40px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  font-size: 14px;
}

.langs p {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
}

.langs div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.langs a {
  color: var(--ink);
  text-decoration: none;
}

.langs a:hover {
  text-decoration: underline;
}

.langs a[aria-current] {
  color: var(--accent-strong);
  font-weight: 800;
}

.foot-line {
  margin: 22px 0 0;
  color: var(--muted);
}

.foot-line a {
  color: var(--muted);
}

/* The app's guides on methodhelm.com, at the end of its support page. */
.content .guides {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule, #e3e0f0);
}
.content .guides ul {
  padding-left: 1.2em;
}
.content .guides a {
  font-weight: 600;
}
