/* The download page (/download): the desktop launchers for Windows and the Mac,
   the install from the browser that needs neither, and the Android test build.

   Loaded after theme.css and built from its tokens. The page is one column of
   text with two cards side by side; the server marks what the visitor seems to
   be using on <body data-os>, which moves the emphasis and nothing else: both
   downloads are always there. No script depends on a selector in this file. */

.page-download { --page-max: 62rem; }
.page-download main { padding-top: 3rem; padding-bottom: 4.5rem; }
.page-download h2 { margin: 0; font-size: 1.2rem; font-weight: 650; letter-spacing: 0; }
.page-download h3 { margin: 0 0 .7rem; font-size: 1.02rem; }
.page-download code { font: .82em/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

/* ---- Head ------------------------------------------------------------------ */
.dl-head { max-width: 41rem; margin: 0 0 2.4rem; }
.dl-eyebrow { margin: 0 0 .75rem; color: var(--gold-deep); font-size: .8rem; font-weight: 650; letter-spacing: .18em; }
.dl-eyebrow [lang="en"] { margin-left: .55rem; color: var(--muted); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.page-download h1 { margin: 0 0 1rem; font-size: clamp(1.9rem, 4.4vw, 2.65rem); line-height: 1.22; letter-spacing: -.015em; text-wrap: balance; }
.dl-lead { margin: 0; color: var(--ink-soft); font-size: 1.07rem; line-height: 1.85; }
.dl-site { color: var(--ink); font-weight: 600; white-space: nowrap; }
.dl-pointer { margin: .9rem 0 0; color: var(--muted); font-size: .95rem; }
.dl-pointer a { font-weight: 600; }

/* ---- A phone, or WeChat's own browser --------------------------------------- */
.dl-note { display: none; max-width: 41rem; margin: 0 0 1.6rem; padding: .95rem 1.15rem; border: 1px solid var(--lapis-line); border-left: 3px solid var(--lapis); border-radius: var(--radius-sm); background: var(--lapis-tint); color: var(--ink-soft); font-size: .97rem; line-height: 1.75; }
.dl-note p { margin: 0; }
.dl-note strong { color: var(--lapis-deep); }
body[data-os="phone"] .dl-phone { display: block; }
/* On a phone the first note already says what to do; this one is for WeChat on a computer. */
body[data-wechat]:not([data-os="phone"]) .dl-wechat { display: block; }

/* ---- The two downloads ------------------------------------------------------ */
.dl-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: stretch; }
.dl-card { position: relative; display: flex; flex-direction: column; padding: 1.7rem 1.8rem 1.5rem; }
.dl-card-head { display: flex; align-items: center; gap: .95rem; min-height: 3rem; }
.dl-glyph { flex: none; width: 2.9rem; height: 2.9rem; padding: .68rem; border-radius: 12px; background: var(--lapis-tint); color: var(--lapis); box-shadow: inset 0 0 0 1px var(--lapis-line); }
.dl-card-name { flex: 1 1 auto; min-width: 0; }
.dl-card-name h2 { font-size: 1.45rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.dl-card-name p { margin: .15rem 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; text-wrap: balance; }
/* In the corner, beside the name and above the line under it, so that it takes no room from either. */
.dl-yours { display: none; position: absolute; top: 1.3rem; right: 1.4rem; padding: .12rem .65rem; border-radius: 1rem; background: var(--gold-tint); color: var(--warning-ink); font-size: .76rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }

/* A button of two lines: what it does, and the same in English under it. */
.dl-button {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .12rem;
	width: 100%; min-height: 4.1rem; margin: 1.5rem 0 0; padding: .65rem 1.2rem;
	border: 1px solid var(--field-line); border-radius: 12px; background: var(--surface); color: var(--lapis);
	font: inherit; font-size: 1.14rem; font-weight: 650; line-height: 1.3; letter-spacing: .01em; text-align: center; text-decoration: none;
	box-shadow: 0 1px 0 rgba(10, 23, 54, .04); cursor: pointer; -webkit-tap-highlight-color: transparent;
	transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.dl-button .dl-en { font-size: .78rem; font-weight: 500; letter-spacing: .03em; opacity: .8; }
a.dl-button:hover, button.dl-button:hover { background: var(--lapis-tint); border-color: var(--lapis-line); color: var(--lapis-deep); }
a.dl-button:active, button.dl-button:active { transform: translateY(1px); box-shadow: none; }

/* The emphasis: the visitor's own system; where that is not known (and it is
   not a phone), both downloads alike; and the install from the browser. */
body[data-os="windows"] .dl-card[data-for="windows"],
body[data-os="mac"] .dl-card[data-for="mac"] { box-shadow: inset 0 3px 0 var(--gold), var(--shadow-card); }
body[data-os="windows"] .dl-card[data-for="windows"] .dl-yours,
body[data-os="mac"] .dl-card[data-for="mac"] .dl-yours { display: inline-block; }
body[data-os="windows"] .dl-card[data-for="windows"] a.dl-button,
body[data-os="mac"] .dl-card[data-for="mac"] a.dl-button,
body[data-os=""] .dl-card a.dl-button,
.dl-install button.dl-button {
	border-color: var(--lapis-strong); color: #fff;
	background: linear-gradient(180deg, #2a4f93 0%, var(--lapis) 55%, #193669 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(10, 23, 54, .25), 0 6px 14px -8px rgba(28, 61, 120, .7);
}
body[data-os="windows"] .dl-card[data-for="windows"] a.dl-button:hover,
body[data-os="mac"] .dl-card[data-for="mac"] a.dl-button:hover,
body[data-os=""] .dl-card a.dl-button:hover,
.dl-install button.dl-button:hover {
	border-color: var(--lapis-deep); color: #fff;
	background: linear-gradient(180deg, #23457f 0%, var(--lapis-strong) 55%, #132b56 100%);
}

/* ---- The Android test build ------------------------------------------------- */
/* A card of its own under the two (above them on an Android phone: the server
   puts it there and marks it data-yours). It is a test build, so it is never
   the page's recommended download for a visitor whose system is not known. */
.dl-mobile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.dl-test { display: inline-block; margin: 0 .45rem 0 0; padding: 0 .55rem; border-radius: 1rem; background: var(--warning-tint); color: var(--warning-ink); font-size: .78rem; font-weight: 650; letter-spacing: .06em; line-height: 1.6; white-space: nowrap; }
.dl-test-note { margin: 1.2rem 0 0; padding: .8rem 1rem; border-left: 3px solid var(--warning); border-radius: var(--radius-xs); background: var(--warning-tint); color: var(--ink-soft); font-size: .9rem; line-height: 1.7; }
.dl-test-note p { margin: 0; }
.dl-test-note p + p { margin-top: .35rem; }
.dl-test-note strong { color: var(--warning-ink); }
.dl-android-wechat { margin: 1.15rem 0 0; padding: .75rem 1rem; border: 1px solid var(--lapis-line); border-left: 3px solid var(--lapis); border-radius: var(--radius-xs); background: var(--lapis-tint); color: var(--lapis-deep); font-size: .9rem; font-weight: 600; line-height: 1.7; }
.page-download .dl-android-title { margin: 1.5rem 0 .5rem; }
.dl-android-steps { margin: 0; padding-left: 1.3rem; color: var(--ink-soft); font-size: .92rem; line-height: 1.75; }
.dl-android-steps li { margin: 0 0 .45rem; padding-left: .2rem; }
.dl-android-steps li::marker { color: var(--lapis); font-weight: 650; }
.dl-card[data-yours] { box-shadow: inset 0 3px 0 var(--gold), var(--shadow-card); }
.dl-card[data-yours] .dl-yours { display: inline-block; }
.dl-card[data-yours] a.dl-button {
	border-color: var(--lapis-strong); color: #fff;
	background: linear-gradient(180deg, #2a4f93 0%, var(--lapis) 55%, #193669 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(10, 23, 54, .25), 0 6px 14px -8px rgba(28, 61, 120, .7);
}
.dl-card[data-yours] a.dl-button:hover { border-color: var(--lapis-deep); color: #fff; background: linear-gradient(180deg, #23457f 0%, var(--lapis-strong) 55%, #132b56 100%); }
body[data-os=""] .dl-card[data-for="android"] a.dl-button { border-color: var(--field-line); background: var(--surface); color: var(--lapis); box-shadow: 0 1px 0 rgba(10, 23, 54, .04); }
body[data-os=""] .dl-card[data-for="android"] a.dl-button:hover { border-color: var(--lapis-line); background: var(--lapis-tint); color: var(--lapis-deep); }

/* A download this server does not have. */
.dl-none { border-style: dashed; background: var(--paper); color: var(--muted); box-shadow: none; cursor: default; }
.dl-none-note { margin: .85rem 0 0; color: var(--ink-soft); font-size: .92rem; line-height: 1.7; }

.dl-meta { display: grid; gap: .3rem; margin: 1.15rem 0 0; font-size: .84rem; line-height: 1.6; }
.dl-meta div { display: grid; grid-template-columns: 4.3rem minmax(0, 1fr); column-gap: .6rem; align-items: baseline; }
.dl-meta dt { color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .05em; }
.dl-meta dd { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; }
/* The digest breaks in the middle (the <wbr>) before it breaks anywhere else. */
.dl-meta code { color: var(--muted); font-size: .76rem; letter-spacing: .01em; }
.dl-how { margin: auto 0 0; padding-top: 1.15rem; color: var(--muted); font-size: .86rem; line-height: 1.65; }

/* ---- Install from the browser ------------------------------------------------ */
.dl-install { margin-top: 1.5rem; padding: 1.8rem 1.9rem 1.7rem; scroll-margin-top: calc(var(--bar-h) + 1rem); }
.dl-tag { display: inline-block; margin: 0 0 .7rem; padding: .1rem .7rem; border-radius: 1rem; background: var(--success-tint); color: var(--success-ink); font-size: .76rem; font-weight: 600; letter-spacing: .08em; line-height: 1.7; }
.dl-install h2 { font-size: 1.28rem; line-height: 1.4; text-wrap: balance; }
.dl-install-lead { max-width: 44rem; margin: .6rem 0 0; color: var(--ink-soft); line-height: 1.8; }
.dl-install button.dl-button { max-width: 22rem; margin-top: 1.3rem; }
.dl-steps { max-width: 44rem; margin: 1.3rem 0 0; padding: 0; list-style: none; counter-reset: step; }
.dl-steps li { position: relative; margin: 0; padding: .5rem 0 .5rem 2.9rem; color: var(--ink-soft); line-height: 1.75; counter-increment: step; }
.dl-steps li::before {
	content: counter(step); position: absolute; left: 0; top: .5rem; display: grid; place-items: center; width: 1.9rem; height: 1.9rem;
	border-radius: 50%; background: var(--lapis-tint); color: var(--lapis); font-size: .86rem; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--lapis-line);
}

/* ---- The first start ---------------------------------------------------------- */
.dl-first { margin-top: 3.25rem; }
.dl-first-why { max-width: 41rem; margin: .5rem 0 1.3rem; color: var(--ink-soft); line-height: 1.8; }
.dl-first-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
.dl-first-grid .card { padding: 1.4rem 1.6rem 1.35rem; }
.dl-first-grid ol { margin: 0; padding-left: 1.3rem; color: var(--ink-soft); line-height: 1.75; }
.dl-first-grid li { margin: 0 0 .5rem; padding-left: .2rem; }
.dl-first-grid li::marker { color: var(--lapis); font-weight: 650; }
.dl-fine { margin: .9rem 0 0; padding-top: .85rem; border-top: 1px solid var(--hairline); color: var(--muted); font-size: .86rem; line-height: 1.7; }

/* ---- Checking a file, and the last line ---------------------------------------- */
.dl-verify { margin: 2.4rem 0 0; color: var(--ink-soft); font-size: .92rem; }
.dl-verify summary { display: inline-flex; align-items: center; border-radius: var(--radius-xs); color: var(--ink-soft); font-weight: 600; }
.dl-verify summary:hover { color: var(--lapis); }
.dl-verify p { margin: .55rem 0 0; }
.dl-verify code { padding: .12rem .45rem; border-radius: var(--radius-xs); background: var(--paper-deep); color: var(--ink); overflow-wrap: anywhere; }
.dl-foot { margin: 2.2rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--hairline); color: var(--muted); font-size: .86rem; line-height: 1.7; }

/* ---- Small screens -------------------------------------------------------------- */
@media (max-width: 760px) {
	.page-download main { padding-top: 1.9rem; padding-bottom: 3rem; }
	.dl-head { margin-bottom: 1.8rem; }
	.dl-lead { font-size: 1.02rem; }
	.dl-cards, .dl-mobile, .dl-first-grid { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
	.dl-mobile { margin: 1.1rem 0; }
	.dl-card { padding: 1.35rem 1.2rem 1.25rem; }
	.dl-yours { top: 1rem; right: 1rem; }
	.dl-install { margin-top: 1.1rem; padding: 1.4rem 1.2rem 1.3rem; }
	.dl-install h2 { font-size: 1.14rem; }
	.dl-install button.dl-button { max-width: none; }
	.dl-first { margin-top: 2.5rem; }
	.dl-first-grid .card { padding: 1.2rem 1.15rem 1.15rem; }
	.dl-meta div { grid-template-columns: minmax(0, 1fr); }
}
