/* Verso download page. One typeface, the one the app reads in. */

@font-face {
  font-family: "Literata";
  src: url("fonts/Literata-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/Literata-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/Literata-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* The page corner peels back once on load, see .sheet. */
@property --fold {
  syntax: "<length>";
  inherits: true;
  initial-value: 56px;
}

:root {
  --bg: #e9edf4;
  --page: #fdfdfe;
  --ink: #141821;
  --muted: #475066;
  --rule: #cdd4e2;
  --accent: #2457d6;
  --on-accent: #ffffff;
  --mark: #ffe27a;
  --flap-a: #f1f3f8;
  --flap-b: #c9d0e0;
  --lift: rgba(20, 24, 33, 0.16);
  --fold: 56px;
  --serif: "Literata", Charter, "Bitstream Charter", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d111c;
    --page: #182033;
    --ink: #e9ecf5;
    --muted: #a3abc0;
    --rule: #2a3350;
    --accent: #8fb0ff;
    --on-accent: #0a2463;
    --mark: rgba(255, 214, 64, 0.3);
    --flap-a: #2b3652;
    --flap-b: #0f1424;
    --lift: rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  max-width: 74rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

.top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
}
.top img { border-radius: 22%; }

/* Hero */

.hero { padding: 1.5rem 0 3.5rem; }

h1 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.5rem, 9.5vw, 4.5rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lede {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  font-size: 1.1875rem;
  color: var(--muted);
}

.get { margin-top: 2rem; }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 1.1875rem;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.button:hover { filter: brightness(1.08); }
.button:active { transform: translateY(1px); }

.fine {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
}

.builds { margin-top: 0.5rem; font-size: 0.9375rem; color: var(--muted); }
.builds summary { cursor: pointer; padding: 0.4rem 0; width: fit-content; }
.builds ul { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.builds li { padding: 0.5rem 0; border-top: 1px solid var(--rule); }
.builds li:last-child { border-bottom: 1px solid var(--rule); }
.builds a { color: var(--ink); font-weight: 600; }

code {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 0.8125rem;
  word-break: break-all;
  color: var(--ink);
}

/* The page. It is what Verso shows, so it is what the page shows. */

.stage { margin-top: 3rem; }

.shadow {
  max-width: 26rem;
  margin: 0 auto;
  filter: drop-shadow(0 1px 0 var(--lift)) drop-shadow(0 22px 26px var(--lift));
}

.sheet {
  position: relative;
  padding: 1.9rem 1.6rem 3.4rem;
  background: var(--page);
  border-radius: 2px;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--fold)),
    calc(100% - var(--fold)) 100%,
    0 100%
  );
  animation: peel 0.9s 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

.sheet p {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.75;
  hyphens: auto;
}

mark {
  color: inherit;
  background: linear-gradient(transparent 10%, var(--mark) 10% 94%, transparent 94%);
  padding: 0 0.1em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.folio {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.1rem;
  text-align: center;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--muted);
}

.fold {
  position: absolute;
  right: 0;
  bottom: 0;
  width: var(--fold);
  height: var(--fold);
  background: linear-gradient(
    to bottom right,
    var(--flap-a) 0,
    var(--flap-b) 50%,
    transparent 50%
  );
}

@keyframes peel { from { --fold: 0px; } }

/* Sections */

.block {
  padding: 2rem 0 2.25rem;
  border-top: 1px solid var(--rule);
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
}

#new-version { font-weight: 400; color: var(--muted); }
#new-version:not(:empty)::before { content: " in "; }

.body { max-width: 38rem; }
.body p { margin: 0 0 1rem; }
.body > :last-child { margin-bottom: 0; }

.body ol, .body ul { margin: 0 0 1rem; padding-left: 1.4rem; }
.body li { margin-bottom: 0.5rem; padding-left: 0.2rem; }
.body li::marker { color: var(--muted); font-variant-numeric: tabular-nums lining-nums; }

dl { margin: 0; }
dt { margin-top: 1.1rem; font-weight: 600; }
dt:first-child { margin-top: 0; }
dd { margin: 0.1rem 0 0; color: var(--muted); }

.foot {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--muted);
}
.foot p { margin: 0; }

/* Wider screens: text left, the page right, section titles in the margin. */

@media (min-width: 40rem) {
  .button { display: inline-flex; min-width: 17rem; }
}

@media (min-width: 60rem) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 5rem;
    align-items: center;
    padding: 3rem 0 5rem;
  }
  .stage { margin-top: 0; }
  .shadow { transform: rotate(-1.4deg); margin-right: 0; }
  .sheet { padding: 2.6rem 2.3rem 4.4rem; --fold: 72px; }
  .sheet p { font-size: 1.1875rem; }
  .block {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 2rem;
    padding: 2.5rem 0 2.75rem;
  }
  h2 { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
  .button { transition: none; }
}
