/* Lexflick website: home page and blog. Mobile first where it matters; breakpoints at 820px and 560px. */
:root {
  --ink: #1d2433; --muted: #5b6475; --brand: #1b4f91; --brand-dark: #143c70; --bg: #fbfaf7; --card: #fff;
  --line: #e6e3dc; --hl: #fbe7a6; --hl-line: #e2ba46; --soft: #e8eff8;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.6 var(--sans); color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }

/* ---------- header and footer ---------- */
.site-header { padding: 18px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 22px; text-decoration: none; color: var(--ink); }
.logo img { width: 32px; height: 32px; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 16px; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--soft); color: var(--brand); }
.btn { display: inline-block; background: var(--brand); color: #fff !important; text-decoration: none; font-weight: 600; border-radius: 10px; padding: 10px 18px; }
.btn:hover { background: var(--brand-dark); }
.site-nav .btn { padding: 8px 14px; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 44px; font-size: 14px; color: var(--muted); margin-top: 24px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 14px; }
.site-footer a { color: var(--muted); }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-top: 32px; padding-bottom: 64px; }
h1 { font-size: 44px; line-height: 1.15; margin: 0 0 18px; letter-spacing: -0.5px; }
h1 mark { background: var(--hl); border-radius: 4px; padding: 0 6px; color: inherit; }
.lead { font-size: 19px; color: var(--muted); margin: 0; }
.badge { display: inline-block; font-size: 14px; font-weight: 600; color: var(--brand); background: var(--soft); border-radius: 999px; padding: 4px 12px; margin-bottom: 18px; }
.shot { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(29, 36, 51, .12); background: #fff; }
h2 { font-size: 28px; margin: 0 0 24px; line-height: 1.25; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-bottom: 56px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.feature h3 { margin: 0 0 8px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); font-size: 16px; }
.langs { padding-bottom: 56px; }
.langs ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.langs li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 15px; }
.langs li.soon { color: var(--muted); border-style: dashed; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.home-blog { padding-bottom: 64px; }

/* ---------- post cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
        transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(29, 36, 51, .10); }
.card a.cover { display: block; aspect-ratio: 1200 / 630; overflow: hidden; background: var(--soft); }
.card a.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 19px; line-height: 1.3; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--brand); }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.meta { color: var(--muted); font-size: 14px; }
.tag { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--brand); background: var(--soft); border-radius: 999px; padding: 2px 10px; margin-right: 6px; }

/* the newest post on the blog page */
.featured { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: var(--card); border: 1px solid var(--line);
            border-radius: 16px; overflow: hidden; margin-bottom: 36px; }
.featured a.cover { display: block; }
.featured a.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured .body { padding: 28px 30px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.featured h2 { margin: 0; font-size: 28px; }
.featured h2 a { color: var(--ink); text-decoration: none; }
.featured p { margin: 0; color: var(--muted); }
.blog-head { padding: 28px 0 32px; }
.blog-head h1 { margin-bottom: 10px; }

/* ---------- article ---------- */
.post-head { max-width: 760px; margin: 0 auto; padding: 24px 24px 0; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.post-head h1 { font-size: 42px; }
.post-head .lead { margin-bottom: 16px; }
.post-cover { max-width: 1000px; margin: 28px auto 8px; padding: 0 24px; }
.post-cover img { width: 100%; height: auto; display: block; border-radius: 16px; box-shadow: 0 16px 40px rgba(29, 36, 51, .14); }
.prose { max-width: 720px; margin: 0 auto; padding: 8px 24px 0; font-family: var(--serif); font-size: 19.5px; line-height: 1.7; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose figure { margin: 0 0 1.2em; }
.prose h2, .prose h3 { font-family: var(--sans); line-height: 1.3; scroll-margin-top: 16px; }
.prose h2 { font-size: 27px; margin: 1.8em 0 .6em; }
.prose h3 { font-size: 21px; margin: 1.5em 0 .5em; }
.prose li { margin: .3em 0; }
.prose blockquote { border-left: 4px solid var(--hl-line); background: #fffaf0; padding: 12px 18px; border-radius: 0 10px 10px 0; color: #3b4252; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose mark, .prose .w { background: var(--hl); border-bottom: 2px solid var(--hl-line); border-radius: 4px; padding: 0 3px; color: inherit; }
.prose code { font-size: .85em; background: var(--soft); padding: 1px 5px; border-radius: 5px; }
.prose figure img { display: block; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 10px 26px rgba(29, 36, 51, .10); }
.prose figcaption { font-family: var(--sans); font-size: 14.5px; color: var(--muted); text-align: center; margin-top: 10px; }
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; -webkit-overflow-scrolling: touch; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 16px; line-height: 1.45; background: #fff; margin: 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--soft); color: var(--brand); }
.toc { max-width: 720px; margin: 8px auto 0; padding: 0 24px; font-family: var(--sans); }
.toc details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { margin: 10px 0 2px; padding-left: 22px; font-size: 16px; }
.toc li { margin: 4px 0; }
.cta { max-width: 720px; margin: 36px auto 0; padding: 0 24px; }
.cta .box { background: linear-gradient(135deg, var(--brand), #3d78c4); color: #fff; border-radius: 16px; padding: 26px 28px; display: grid;
            grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.cta h2 { margin: 0 0 6px; font-size: 22px; }
.cta p { margin: 0; color: #dfe8f6; font-size: 16px; }
.cta .btn { background: #fff; color: var(--brand) !important; }
.cta .btn:hover { background: var(--hl); }
.related { padding-top: 48px; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 8px; }
  h1, .post-head h1 { font-size: 33px; }
  .features, .cards { grid-template-columns: minmax(0, 1fr); }
  .featured { grid-template-columns: minmax(0, 1fr); }
  .featured .body { padding: 22px; }
  .featured h2 { font-size: 24px; }
  .prose { font-size: 18px; }
  .cta .box { grid-template-columns: 1fr; }
}
@media (min-width: 560px) and (max-width: 820px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .wrap, .post-head, .prose, .toc, .cta, .post-cover { padding-left: 18px; padding-right: 18px; }
  .site-nav .btn { display: none; }
  .logo { font-size: 20px; }
  h1, .post-head h1 { font-size: 29px; }
  .post-cover { padding: 0; }
  .post-cover img { border-radius: 0; box-shadow: none; }
  .prose table { font-size: 14px; }
  .prose th, .prose td { padding: 6px 8px; }
}

/* ---------- code blocks ---------- */
.prose pre { background: #1e2129; color: #e6e6e6; border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-size: 14.5px; line-height: 1.55;
             margin: 0 0 1.4em; -webkit-overflow-scrolling: touch; }
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; border-radius: 0; }
.prose code { font-family: ui-monospace, "Cascadia Code", Consolas, "SF Mono", Menlo, monospace; }

/* ---------- topics ---------- */
a.tag { text-decoration: none; }
a.tag:hover { background: var(--brand); color: #fff; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip { text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 15px; font-weight: 600; }
.chip span { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 2px; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip[aria-current="page"] span { color: #dfe8f6; }
.blog-head .crumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.blog-head .crumbs a { color: var(--muted); }
@media (max-width: 560px) {
  .topics { flex-wrap: nowrap; overflow-x: auto; margin-right: -18px; padding-right: 18px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .chip { white-space: nowrap; }
  .prose pre { font-size: 13px; border-radius: 0; margin-left: -18px; margin-right: -18px; }
}

/* ---------- home: how it works, in three steps ---------- */
.how { padding-bottom: 40px; }
.step { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; padding: 28px 0 44px; }
.step + .step { border-top: 1px solid var(--line); padding-top: 44px; }
.step:nth-of-type(even) .step-text { order: 2; }
.step-no { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--hl);
           border: 2px solid var(--hl-line); font-weight: 800; margin-bottom: 12px; }
.step h3 { font-size: 25px; line-height: 1.25; margin: 0 0 12px; }
.step p { color: var(--muted); margin: 0 0 12px; }
.step-shot { margin: 0; }
.step-shot figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 10px; }
.shot.dark { border-color: #222; }
.step-shot.phone { text-align: center; }
.step-shot.phone img { width: 100%; max-width: 290px; height: auto; }
@media (max-width: 820px) {
  .step { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 20px 0 32px; }
  .step:nth-of-type(even) .step-text { order: 0; }
  .step h3 { font-size: 22px; }
  .step-shot.phone img { max-width: 260px; }
}

/* keys */
kbd { display: inline-block; font: 600 0.82em/1.2 ui-monospace, "Cascadia Code", Consolas, monospace; background: #fff; color: var(--ink);
      border: 1px solid #cfd5df; border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
