/* Shared stylesheet for the HEU launcher's own pages (download, docs, changelog, groups, licence).
 *
 * Plain CSS with no build step and no JavaScript. These pages are the only place a user is told what
 * they are about to download and how to check it, so they have to render on whatever an old browser
 * on a campus machine does - and they have to keep rendering when nothing else about the project is
 * working. System fonts and no external requests for the same reason: a page that needs a CDN is a
 * page that can fail for a reason the user cannot see.
 */

:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --ink: #1c1c1e;
  --ink-soft: #55555c;
  --ink-faint: #85858d;
  --line: #e2e2de;
  --accent: #2f6f4f;
  --accent-soft: #eaf3ee;
  --warn-bg: #fdf6e6;
  --warn-line: #e8d9a8;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --panel: #1e2024;
    --ink: #eceef1;
    --ink-soft: #b3b7be;
    --ink-faint: #85898f;
    --line: #303338;
    --accent: #6fbf95;
    --accent-soft: #1d2a24;
    --warn-bg: #2a2418;
    --warn-line: #4a4028;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
        "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
}

.wrap { max-width: 780px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .mono { font-family: var(--mono); }

code {
  background: var(--accent-soft);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
}

pre code { background: none; padding: 0; font-size: 0.9em; }

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

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

.top .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand { font-weight: 600; letter-spacing: 0.01em; }

.top nav a { margin-left: 16px; color: var(--ink-soft); font-size: 0.94em; }
.top nav a:first-child { margin-left: 0; }

.bottom {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 20px 0;
  font-size: 0.9em;
  color: var(--ink-soft);
}

.bottom p { margin: 4px 0; }

/* ---------------------------------------------------------------- main */

main { padding: 32px 0 8px; }

h1 { font-size: 1.75em; line-height: 1.3; margin: 0 0 16px; }

h2 {
  font-size: 1.18em;
  margin: 40px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

h3 { font-size: 1.02em; margin: 24px 0 8px; }

p { margin: 10px 0; }

.lede { font-size: 1.03em; color: var(--ink-soft); }

.muted { color: var(--ink-faint); font-size: 0.9em; }

/* ---------------------------------------------------------------- download card */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0;
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.card-main { flex: 1 1 320px; min-width: 0; }

.filename {
  font-family: var(--mono);
  font-size: 1.05em;
  font-weight: 600;
  overflow-wrap: anywhere;
  margin-bottom: 12px;
}

.facts { margin: 0; display: grid; gap: 4px; }
.facts > div { display: flex; gap: 10px; }
.facts dt { flex: 0 0 84px; color: var(--ink-faint); font-size: 0.92em; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.card-action { flex: 0 0 auto; text-align: center; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 26px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; filter: brightness(1.08); }

@media (prefers-color-scheme: dark) {
  .btn { color: #10231a; }
}

.btn-note { margin-top: 8px; font-size: 0.82em; color: var(--ink-faint); }

.hash { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }

.hash-label { font-size: 0.86em; color: var(--ink-faint); margin-bottom: 5px; }

.hash-value {
  display: block;
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 0.92em;
  overflow-wrap: anywhere;
  user-select: all;
}

.served { margin: 16px 0 0; font-size: 0.92em; color: var(--ink-soft); }

/* ---------------------------------------------------------------- lists */

.steps, .notes { padding-left: 22px; }
.steps li, .notes li { margin: 10px 0; }

.doc-list { list-style: none; padding: 0; margin: 16px 0; }

.doc-list li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.doc-list .title { font-weight: 600; }
.doc-list .desc { color: var(--ink-soft); font-size: 0.92em; margin-top: 3px; }

/* ---------------------------------------------------------------- notices */

.notice {
  border-radius: 6px;
  padding: 12px 16px;
  margin: 18px 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); }

.notice p:first-child { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- changelog */

.release {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.release > h1 {
  font-size: 1.3em;
  margin: 0 0 4px;
}

.release .meta { color: var(--ink-faint); font-size: 0.86em; margin: 0 0 14px; }

.release ul { padding-left: 22px; margin: 10px 0; }
.release li { margin: 8px 0; }

.release h2 { font-size: 1em; border: 0; padding: 0; margin: 18px 0 6px; color: var(--ink-soft); }

.tag {
  display: inline-block;
  font-size: 0.78em;
  font-family: var(--mono);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  padding: 1px 6px;
  vertical-align: 1px;
}

/* ---------------------------------------------------------------- licence */

.license-text {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 18px;
  font-family: var(--mono);
  font-size: 0.82em;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- front page
 *
 * Everything below is used only by index.html, the site's front door. It is appended to this file
 * rather than put in a second stylesheet on purpose: one product, one visual language, and one file
 * whose colour tokens every page already shares. The rules are additive and introduce no new class
 * that an existing page uses, so the six pages that were here before render identically.
 */

.hero {
  padding: 8px 0 0;
}

.hero h1 {
  font-size: 2.1em;
  margin-bottom: 10px;
}

.hero .lede {
  font-size: 1.1em;
  max-width: 46em;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 26px 0 8px;
}

.btn-secondary {
  display: inline-block;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 11px 22px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.btn-secondary:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

.btn-note { font-size: 0.84em; color: var(--ink-faint); }

/* Screenshots. The launcher is a GUI program, and a page of prose does not say so; a picture of the
 * actual window does. `height: auto` plus the width/height attributes in the HTML keeps the layout
 * from jumping while the image loads, which on a slow connection is the difference between a page
 * that settles and one that keeps moving under the reader's finger. */
.shot {
  margin: 22px 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.shot figcaption {
  margin-top: 8px;
  font-size: 0.86em;
  color: var(--ink-faint);
}

.shot-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  margin: 22px 0;
}

@media (min-width: 700px) {
  .shot-grid { grid-template-columns: 1fr 1fr; }
}

.shot-grid .shot { margin: 0; }

.feature {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 12px 0;
}

.feature .name { font-weight: 600; }
.feature .what { margin: 6px 0 0; }
.feature .caveat {
  margin: 8px 0 0;
  font-size: 0.9em;
  color: var(--ink-soft);
  border-left: 2px solid var(--line);
  padding-left: 10px;
}

a.callout {
  display: block;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  margin: 18px 0;
  font-weight: 600;
}

a.callout:hover { text-decoration: none; border-color: var(--accent); }
a.callout .sub { display: block; font-weight: 400; font-size: 0.9em; color: var(--ink-soft); margin-top: 3px; }

/* ---------------------------------------------------------------- front page, second pass
 *
 * Appended for the same reason the block above was: one product, one stylesheet, one set of colour
 * tokens that every page already shares. Every class here is new - none of the names below appears in
 * any other page under release/web, so nothing that was already rendering can change because of this
 * block. The `home-`/`showcase`/`news-`/`req`/`reason`/`notlist`/`foot-` prefixes are there to keep it
 * that way as more pages are added.
 *
 * The front page is the only page here that is laid out as a product page rather than a document, so
 * it is also the only page with a full-bleed band (the hero) and multi-column grids. Grids collapse to
 * one column by default and gain columns at a breakpoint, rather than the other way round: a layout
 * that is correct when narrow and merely roomier when wide fails visibly, whereas one that is correct
 * when wide and squeezed when narrow fails by overflowing.
 */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 10;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 8px 12px;
}

/* The front page needs more than the document measure the other pages use.
 *
 * `.wrap` is 780px because the pages that use it are read: a licence, a changelog, a set of
 * instructions. The front page also *shows* things, and its feature sections put an 816px-wide
 * screenshot in one column and text in the other. Inside a 780px wrapper each column is about 375px,
 * so a screenshot is scaled to less than half size - measured on the deployed page, and the result was
 * a picture whose contents could not be read at all.
 *
 * So the front page gets its own wider wrapper, and the *text* inside it keeps a readable measure
 * rather than the full width: `--home-measure`. Widening the column without that would trade an
 * unreadable screenshot for an unreadable paragraph. The other pages are untouched - they do not use
 * this class.
 */
.wrap.home-wide {
  max-width: 1120px;
}

.wrap.home-wide {
  --home-measure: 46em;
}

/* Prose blocks on the front page hold the readable measure even though the container is wider. The
 * grids, the figures and the cards use the full width. */
.home-wide > p,
.home-wide > ul.notlist,
.home-wide > ol.steps,
.home-wide > ul.notes,
.home-wide > .notice,
.home-wide > a.callout,
.home-wide > h3,
.home-wide > h2 + p {
  max-width: var(--home-measure);
}

.home-hero .wrap.home-wide {
  max-width: 1120px;
}

/* The hero: text beside the screenshot once there is room for both, so the top of the page shows the
 * product and its picture together instead of stacking them. Below the breakpoint it is the same
 * content in source order - text, then picture.
 *
 * Flex rather than grid on purpose. The text half is five sibling elements (eyebrow, heading, lede,
 * buttons, note) and the picture is a sixth; with grid each of them would need an explicit row, and
 * getting that wrong is a layout that looks fine at one width and stacks wrongly at another. Flex puts
 * the five in one column and the figure in the other without anything needing to know how many they
 * are. */
@media (min-width: 980px) {
  .home-hero-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 34px;
    align-items: center;
  }
  .home-hero-inner > .home-hero-text { flex: 1 1 46%; }
  .home-hero-inner > .home-hero-shot { flex: 1 1 44%; margin: 0; }
}

.home-hero-text { min-width: 0; }

/* The hero. A full-bleed band so the product name and the download button sit on their own surface
 * instead of competing with the body text below. The gradient is two flat colours from the shared
 * palette rather than an image: a product site whose hero is a photograph needs a photograph we do
 * not have, and inventing one with a stock image is the thing this page is careful not to do. */
.home-hero {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 34px 0 30px;
}

.home-hero-inner { padding-top: 0; }

.home-eyebrow {
  font-size: 0.88em;
  color: var(--ink-soft);
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}

.home-hero h1 {
  font-size: 2.35em;
  line-height: 1.22;
  margin: 0 0 14px;
}

.home-lede {
  font-size: 1.12em;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 40em;
  margin: 0;
}

.home-hero-shot { margin: 28px 0 0; }

/* Section headings. The shared h2 has a rule above it, which is right for a document; on the front
 * page the headings separate marketing-length sections, so they get more room above them and no rule
 * of their own where one already exists. */
.home-h2 {
  font-size: 1.5em;
  margin: 52px 0 10px;
  padding-top: 0;
  border-top: 0;
}

.home-facts { margin-top: 18px; }

.home-facts-source {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 0.88em;
  line-height: 1.7;
}

/* ---------------------------------------------------------------- reasons (numbered grid) */

.reasons {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin: 22px 0;
}

@media (min-width: 760px) {
  .reasons { grid-template-columns: 1fr 1fr; }
}

.reason {
  display: flex;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.reason-num {
  font-family: var(--mono);
  font-size: 0.95em;
  font-weight: 600;
  color: var(--accent);
  flex: 0 0 auto;
  line-height: 1.5;
}

.reason-body { min-width: 0; }
.reason-body h3 { margin: 0 0 6px; font-size: 1.02em; }
.reason-body p { margin: 0; font-size: 0.95em; color: var(--ink-soft); line-height: 1.72; }

/* ---------------------------------------------------------------- showcase (image beside text)
 *
 * One section per feature: text in a column, a real screenshot in the other. They alternate sides on
 * wide screens via .showcase-flip so the eye is not led down a single hard edge; on narrow screens
 * both collapse to text-then-image, which is the order the text is written in. */

.showcase {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  align-items: start;
  margin: 34px 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

@media (min-width: 820px) {
  .showcase {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  .showcase-flip .showcase-text { order: 2; }
  .showcase-flip .showcase-shot { order: 1; }
}

.showcase-text { min-width: 0; }
.showcase-text h3 { margin: 0 0 10px; font-size: 1.22em; }

.showcase-kicker {
  display: inline-block;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 3px;
  padding: 2px 8px;
  margin: 0 0 10px;
}

.showcase-text p { margin: 10px 0; }

/* The cost of a feature, set apart from its description. This is the part of the page that is easiest
 * to drop for looking less appealing, and the part a reader most needs, so it is styled to be read
 * rather than to be skipped: a rule down the side and full-size text, not small grey print. */
.showcase-caveat {
  font-size: 0.94em;
  color: var(--ink-soft);
  border-left: 3px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: 0 4px 4px 0;
  padding: 10px 12px;
  line-height: 1.72;
}

.showcase-caveat strong { color: var(--ink); }

.showcase-shot { margin: 0; }
.showcase-shot figcaption { line-height: 1.65; }

/* ---------------------------------------------------------------- "what is not here" list */

.notlist { list-style: none; padding: 0; margin: 18px 0; }

.notlist li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 0 6px 6px 0;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-size: 0.95em;
  line-height: 1.75;
}

/* ---------------------------------------------------------------- requirements grid */

.req {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin: 20px 0;
}

@media (min-width: 700px) {
  .req { grid-template-columns: 1fr 1fr; }
}

.req-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
}

.req-label {
  font-size: 0.78em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.req-value {
  font-size: 1.1em;
  font-weight: 600;
  margin: 4px 0 8px;
}

.req-note { font-size: 0.9em; color: var(--ink-soft); line-height: 1.72; }

/* ---------------------------------------------------------------- news
 *
 * Shared by the front page's announcements block and news/index.html, so that one entry looks the same
 * in both places and there is one place to change how it looks. */

.news-list {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin: 20px 0;
}

@media (min-width: 700px) {
  .news-list { grid-template-columns: 1fr 1fr; }
}

/* The front page's entries are links to the full entry, so the whole card is the target. */
a.news-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  color: var(--ink);
}

a.news-card:hover { text-decoration: none; border-color: var(--accent); }

.news-card-top { display: block; margin-bottom: 8px; }
.news-card-text { display: block; font-size: 0.93em; color: var(--ink-soft); line-height: 1.72; }

.news-version {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--accent);
  margin-right: 10px;
}

.news-date { font-size: 0.88em; color: var(--ink-faint); font-family: var(--mono); }

.news-flag {
  display: inline-block;
  font-size: 0.76em;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  padding: 1px 7px;
  margin-left: 8px;
  vertical-align: 1px;
}

.news-more { font-size: 0.95em; }

/* One release on the announcements page. */
.news-entry {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 22px;
  margin: 18px 0;
}

.news-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  align-items: baseline;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.news-head .news-version { font-size: 1.28em; }

.news-summary { font-size: 1.02em; margin: 0 0 12px; }

.news-entry h3 { font-size: 1em; color: var(--ink-soft); margin: 18px 0 6px; }
.news-entry ul { padding-left: 22px; margin: 8px 0; }
.news-entry li { margin: 8px 0; font-size: 0.95em; line-height: 1.75; }

.news-facts {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.news-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}

.news-actions .btn-secondary { font-size: 0.9em; padding: 8px 16px; }

/* ---------------------------------------------------------------- footer, with link columns
 *
 * The footer of a product site is where people look for the thing they could not find in the header,
 * so it repeats the site's destinations in labelled columns. It carries the derivative disclosure
 * again: that sentence is the one thing on this site that must not be reachable only from the top of
 * one page. */

.foot-cols {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
  margin-bottom: 24px;
}

@media (min-width: 700px) {
  .foot-cols { grid-template-columns: repeat(3, 1fr); }
}

.foot-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.92em;
  margin-bottom: 8px;
}

.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin: 6px 0; font-size: 0.92em; }

.foot-note {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin: 0 0 8px;
  font-size: 0.88em;
  line-height: 1.75;
}
