/* Download portal, in www.formuly.ai's closing-card style. Tokens mirror
 * formuly-website site/css/site.css; brand rules are its brand/README.md. */

/* Self-hosted because the CSP is default-src 'self'. The ranges must be
 * declared, or font-stretch: 95% clamps back to 100%. */
@font-face {
  font-family: "Special Gothic";
  src: url(font/SpecialGothic-Variable.woff2) format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 125%;
  font-display: swap;
}

:root {
  --phthalo: #00514a;
  /* The site's card fill (site.css --panel), not a brand palette colour. */
  --panel: #00625a;
  --yellow: #e6ff02;
  --electric-green: #bfe600;
  --white: #ffffff;
  --black: #111111;
  --muted: rgba(255, 255, 255, 0.75);
  --hairline: rgba(255, 255, 255, 0.2);
  /* Product-only Errors colour: 2.08:1 on the card, so only ever beside text. */
  --error: #ff3c50;

  --sans: "Special Gothic", "Helvetica Neue", Arial, sans-serif;
  --ease: 200ms;
  --marker: 8px;
  --card-padding: 24px;
  --wordmark: 36px;
  --h1: 32px;
  --button-height: 44px;
  --button-padding: 24px;
  --button-size: 16px;
}

@media (min-width: 768px) {
  :root {
    --marker: 12px;
    --card-padding: 48px;
    --wordmark: 48px;
    --h1: 40px;
    --button-height: 48px;
    --button-padding: 32px;
    --button-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --ease: 0.01ms; }
}

/* An author display rule would otherwise beat the UA's, and app.js shows and
 * hides every view with this attribute. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px 20px;
  box-sizing: border-box;
  background: var(--phthalo);
  color: var(--white);
  font-family: var(--sans);
  font-stretch: 95%;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

.portal {
  width: 100%;
  max-width: 40rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wordmark {
  display: block;
  height: var(--wordmark);
  width: auto;
  margin-bottom: 32px;
}

.card {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: var(--card-padding);
  background: var(--panel);
  border: 1px solid var(--black);
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.2);
  text-align: center;
}

/* The site's corner markers. */
.card::before {
  content: "";
  position: absolute;
  inset: calc(var(--marker) / -2);
  pointer-events: none;
  background:
    linear-gradient(var(--black), var(--black)) 0 0 / var(--marker) var(--marker) no-repeat,
    linear-gradient(var(--black), var(--black)) 100% 0 / var(--marker) var(--marker) no-repeat,
    linear-gradient(var(--black), var(--black)) 0 100% / var(--marker) var(--marker) no-repeat,
    linear-gradient(var(--black), var(--black)) 100% 100% / var(--marker) var(--marker) no-repeat;
}

h1 {
  margin: 0;
  font-size: var(--h1);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.02em;
}

p { margin: 0; }

strong { font-weight: 500; }

a { color: inherit; }

a,
.link {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: text-decoration-thickness var(--ease) ease;
}

a:hover,
.link:hover { text-decoration-thickness: 2px; }

button {
  font: inherit;
  font-stretch: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.lede {
  margin-top: 16px;
  color: var(--muted);
  text-wrap: balance;
}

.error {
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--black);
  border-left: 3px solid var(--error);
  text-align: left;
}

.version { margin-top: 24px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: var(--button-height);
  margin-top: 24px;
  padding: 0 var(--button-padding);
  /* Transparent, not none: forced-colours mode draws it, and drops box-shadow. */
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--black);
  font-size: var(--button-size);
  font-weight: 500;
  line-height: 1;
  transition: background-color var(--ease) ease;
}

.button:hover:not(:disabled) { background: var(--electric-green); }

/* One yellow button per view: the machine-wide one is the outline variant. */
.button--secondary {
  background: none;
  color: var(--white);
  border-color: var(--white);
  font-size: 16px;
  line-height: 1.25;
  padding-block: 10px;
}

.button--secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }

.button:disabled {
  background: rgba(255, 255, 255, 0.12);
  border-color: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: default;
}

/* 73 monospace characters, compared by eye: full white, and the card is wide
 * enough to keep it on one line from 768px. */
.hash {
  margin-top: 12px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 18px;
  word-break: break-all;
}

.hash:empty { display: none; }

.note {
  margin-top: 24px;
  color: var(--muted);
  text-wrap: pretty;
}

.disclosures {
  margin-top: 32px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
}

details { border-top: 1px solid var(--hairline); }

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding-block: 12px;
  box-sizing: border-box;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--ease) ease;
}

details[open] > summary::after { transform: translateY(2px) rotate(225deg); }

summary:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.details-body {
  padding-bottom: 24px;
  color: var(--muted);
}

.details-body p + p { margin-top: 12px; }

.details-body strong { color: var(--white); }

.details-body .button { margin-top: 16px; }

.release-version {
  margin: 20px 0 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: var(--white);
}

.release-version:first-child { margin-top: 0; }

.release-date {
  margin-left: 8px;
  font-weight: 400;
  color: var(--muted);
}

.release-version + p { margin-top: 4px; }

.release-items {
  margin: 4px 0 0;
  padding-left: 20px;
  text-wrap: pretty;
}

.release-items li + li { margin-top: 4px; }

.identity {
  margin-top: 24px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.identity strong { color: var(--white); }

.support {
  margin-top: 40px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  text-align: center;
}
