/* What every page of dokay.dev shares: the font, the colours of the app in
   light and dark, the head with the logo, the pill at the bottom, and the
   footer with the wordmark. */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* The green of the app icon, and a deeper one that carries white text at 4.8:1. */
  --brand: #30a58f;
  --field: #13806b;
  --field-shape: #22937d;
  --on-field: #ffffff;
  --bg: #ffffff;
  --surface: #f2f4f7;
  --line: #e2e6ec;
  --line-strong: #c3c9d3;
  --hover: #e7eaf0;
  --text: #171a20;
  --strong: #12151b;
  --muted: #6b7383;
  --accent: #148a73;
  --shadow-window: 0 2px 6px rgba(0, 30, 22, 0.12), 0 44px 90px -30px rgba(0, 30, 22, 0.6);
  --shadow-shot: 0 1px 2px rgba(16, 24, 40, 0.06), 0 18px 40px -16px rgba(16, 24, 40, 0.28);
  --radius: 12px;
  --radius-xl: 20px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gutter: clamp(16px, 4vw, 56px);
  --title-xl: clamp(2.6rem, 7.4vw, 7.25rem);
  --title-l: clamp(2.1rem, 5vw, 4.5rem);
  --lead: clamp(1.0625rem, 1.45vw, 1.375rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --surface: #11141b;
    --line: #232936;
    --line-strong: #3b4252;
    --hover: #1a1e27;
    --text: #e7eaf0;
    --strong: #f2f4f8;
    --muted: #8a93a6;
    --accent: #34b59c;
    --shadow-shot: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 24px 60px -20px rgba(0, 0, 0, 0.9);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
}

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

.skip {
  position: absolute;
  z-index: 20;
  left: 12px;
  top: -64px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--strong);
  color: var(--bg);
}

.skip:focus {
  top: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9em 1.4em;
  border-radius: 999px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.button:hover {
  transform: translateY(-1px);
}

.button-light {
  background: #ffffff;
  color: var(--field);
  box-shadow: 0 8px 24px -10px rgba(0, 30, 22, 0.6);
}

.button-brand {
  background: var(--field);
  color: #ffffff;
  box-shadow: 0 10px 28px -12px rgba(19, 128, 107, 0.8);
}

.button-large {
  font-size: 1.125rem;
  padding: 1.05em 1.75em;
}

.masthead {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px var(--gutter);
  color: var(--on-field);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.375rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
}

.masthead-news {
  padding: 0.55em 0.95em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.masthead-news:hover {
  background: rgba(255, 255, 255, 0.24);
}

.pill {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(11, 13, 18, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  color: #f2f4f8;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill a {
  border-radius: 999px;
  text-decoration: none;
}

.pill-home {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
}

.pill-home svg {
  width: 34px;
  height: 34px;
}

.pill-link {
  padding: 0.6em 0.85em;
  color: rgba(242, 244, 248, 0.8);
}

.pill-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.pill-cta {
  margin-left: 4px;
  padding: 0.6em 1.05em;
  background: var(--field);
  color: #ffffff;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 32px;
  margin: 8px 0 0;
}

.facts div {
  display: grid;
  gap: 2px;
}

.facts dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
  color: var(--strong);
  font-weight: 600;
}

.footer {
  display: grid;
  gap: 28px;
  overflow: clip;
  padding: 0 var(--gutter) calc(88px + env(safe-area-inset-bottom));
  background: var(--bg);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  font-size: 0.9375rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--strong);
}

.wordmark {
  margin: 0;
  color: var(--brand);
  font-size: 33vw;
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.075em;
  text-align: center;
  /* The tracking after the last letter would pull it off centre. */
  translate: -0.0375em 0;
  user-select: none;
  -webkit-user-select: none;
  /* Its letters reach above its line, over the links of the footer. */
  pointer-events: none;
}

/* The icon's lines and boxes, large and tone on tone */
.motif {
  position: absolute;
  z-index: -1;
  top: -14%;
  right: -16%;
  width: min(125vh, 110vw);
  aspect-ratio: 1;
  color: var(--field-shape);
}

.motif i {
  position: absolute;
  background: currentColor;
}

.motif-line {
  left: 18.75%;
  height: 6.25%;
  border-radius: 999px;
}

.motif-line-1 {
  top: 21.875%;
  width: 62.5%;
}

.motif-line-2 {
  top: 34.375%;
  width: 43.75%;
}

.motif-box {
  width: 21.875%;
  height: 18.75%;
  border-radius: 21% / 25%;
}

.motif-box-a {
  left: 21.875%;
  top: 53.125%;
}

.motif-box-b {
  left: 56.25%;
  top: 62.5%;
}

.motif-link-1 {
  left: 42.19%;
  top: 60%;
  width: 11.875%;
  height: 5%;
}

.motif-link-2 {
  left: 49.06%;
  top: 60%;
  width: 5%;
  height: 14.375%;
}

.motif-link-3 {
  left: 49.06%;
  top: 69.375%;
  width: 8.75%;
  height: 5%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Every page but the start page: the title in a green head with the icon's
   shapes, and the text on a sheet that lies over its lower edge. */
.doc-head {
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: grid;
  align-content: end;
  min-height: clamp(300px, 44vh, 440px);
  padding: 112px var(--gutter) calc(clamp(36px, 6vh, 64px) + 28px);
  background: var(--field);
  color: var(--on-field);
}

.doc-head .motif {
  top: -34%;
  right: -10%;
  width: min(84vh, 76vw);
}

.doc-intro {
  position: relative;
  display: grid;
  gap: 16px;
  max-width: 40rem;
}

/* Keeps the shapes of the motif out from under the text. */
.doc-intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -56px -72px;
  background: radial-gradient(closest-side, var(--field) 70%, rgba(19, 128, 107, 0));
}

.doc-intro h1 {
  font-size: var(--title-l);
  line-height: 1;
  letter-spacing: -0.04em;
}

.doc-lead {
  font-size: var(--lead);
  line-height: 1.42;
}

.doc-lead a {
  text-underline-offset: 3px;
}

/* A small note under the lead, from a quote right after it. */
.doc-note {
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.875rem;
  line-height: 1.5;
}

.doc-note a {
  color: inherit;
  text-underline-offset: 3px;
}

.doc {
  position: relative;
  z-index: 1;
  margin-top: -28px;
  padding: clamp(44px, 7vh, 88px) var(--gutter) clamp(72px, 12vh, 140px);
  border-radius: 28px 28px 0 0;
  background: var(--bg);
}

/* A word longer than a phone is wide, such as a host name, breaks rather than
   pushing the page sideways. */
.prose {
  max-width: 44rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.prose > * + *,
.prose li > * + * {
  margin-top: 1em;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin-top: 2.2em;
  color: var(--strong);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  scroll-margin-top: 24px;
}

.prose h3 {
  margin-top: 1.8em;
  color: var(--strong);
  font-size: 1.1875rem;
  line-height: 1.3;
}

.prose a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose strong {
  color: var(--strong);
  font-weight: 700;
}

.prose ul,
.prose ol {
  margin-bottom: 0;
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose li::marker {
  color: var(--muted);
}

.prose code {
  padding: 0.12em 0.38em;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 500 0.875em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

.prose pre {
  overflow-x: auto;
  margin-bottom: 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.prose pre code {
  padding: 0;
  background: none;
  box-shadow: none;
  overflow-wrap: normal;
}

.prose img {
  border-radius: 12px;
  box-shadow: var(--shadow-shot);
}

.prose blockquote {
  margin: 1em 0 0;
  padding-left: 16px;
  border-left: 3px solid var(--brand);
  color: var(--muted);
}

.prose hr {
  margin: 2.5em 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.prose th,
.prose td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

/* The changelog: a row of versions, then one section per version. */
/* One row however many versions come, scrolling sideways and fading out at
   its end; the side lines list them all. */
.versions {
  display: flex;
  gap: 8px;
  max-width: 44rem;
  margin: 0 auto clamp(36px, 6vh, 56px);
  padding: 4px 48px 4px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
}

.versions::-webkit-scrollbar {
  display: none;
}

.versions a {
  flex: none;
  padding: 0.4em 0.85em;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--strong);
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
}

.versions a:hover {
  color: var(--accent);
}

.release + .release {
  margin-top: clamp(44px, 8vh, 80px);
  padding-top: clamp(44px, 8vh, 80px);
  border-top: 1px solid var(--line);
}

.release h2 {
  margin-top: 0;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  letter-spacing: -0.035em;
}

.release h2 a {
  color: var(--accent);
  text-decoration: none;
}

.release-name {
  color: var(--strong);
}

.prose .release-date {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.release-intro {
  font-size: 1.125rem;
}

.release-intro > * + * {
  margin-top: 1em;
}

.release h3 {
  margin-top: 2em;
  color: var(--accent);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prose .entries {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  margin-top: 14px;
  padding: 0;
  list-style: none;
}

.prose .entries > li + li {
  margin-top: 0;
}

/* The download page: the button and the facts of the newest version. */
.get {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 20px clamp(20px, 3vw, 32px);
  max-width: 44rem;
  margin: 0 auto clamp(40px, 7vh, 64px);
  padding: clamp(20px, 4vw, 32px);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px -28px rgba(16, 24, 40, 0.35);
}

.get-icon {
  width: clamp(64px, 9vw, 96px);
  filter: drop-shadow(0 12px 22px rgba(19, 128, 107, 0.3));
}

.get-body {
  display: grid;
  justify-items: start;
  gap: 18px;
}

.get h2 {
  color: var(--strong);
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.get .facts {
  justify-content: flex-start;
  margin: 0;
}

.checksum {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.checksum dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checksum dd {
  margin: 0;
}

/* macOS or Windows on the download page; #windows, or a link into it, shows Windows. */
.platform-switch {
  display: flex;
  gap: 4px;
  width: max-content;
  margin: 0 auto 20px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

.platform-switch a {
  padding: 6px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.platform {
  scroll-margin-top: 96px;
}

.platform-windows,
.platforms:has(.platform-windows:target, .platform-windows :target) .platform-macos {
  display: none;
}

.platforms:has(.platform-windows:target, .platform-windows :target) .platform-windows {
  display: block;
}

.platforms:not(:has(.platform-windows:target, .platform-windows :target)) .platform-switch a[href="#macos"],
.platforms:has(.platform-windows:target, .platform-windows :target) .platform-switch a[href="#windows"] {
  background: var(--field);
  color: var(--on-field);
}

.get-other,
.get-planned {
  color: var(--muted);
  font-size: 0.875rem;
}

.get-planned {
  max-width: 44rem;
  margin: calc(-1 * clamp(24px, 5vh, 48px)) auto clamp(40px, 7vh, 64px);
  text-align: center;
}

.get-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.875rem;
}

.get-check {
  max-width: 44rem;
  margin: 0 auto clamp(40px, 7vh, 64px);
  scroll-margin-top: 96px;
}

.get-check h3 {
  color: var(--strong);
  font-size: 1.125rem;
}

.get-check > * + *,
.get-check details > * + * {
  margin-top: 12px;
}

.get-check pre {
  overflow-x: auto;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.8125rem;
}

.get-check summary {
  cursor: pointer;
  font-weight: 600;
}

.thumbprint {
  overflow-wrap: anywhere;
}

.get-fine {
  color: var(--muted);
  font-size: 0.8125rem;
}

.checksum code {
  color: var(--strong);
  font: 500 0.8125rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .get {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pill-link[aria-current="page"] {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.footer-links a[aria-current="page"] {
  color: var(--strong);
}

/* The side lines of the changelog, like the headings at a page in dokay: a
   line per version and per change, longer for a version, dark where the
   reader is. Over them, or with the focus on them, the list of all of them
   slides in. Only where the page leaves room beside the text. */
.outline {
  display: none;
}

@media (min-width: 1040px) {
  .outline {
    position: absolute;
    z-index: 2;
    inset: 0 0 0 auto;
    display: block;
    width: 80px;
    pointer-events: none;
  }

  .outline-stick {
    position: sticky;
    top: 96px;
    display: flex;
    justify-content: flex-end;
    padding-right: 22px;
    pointer-events: auto;
  }
}

.outline-lines {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-height: calc(100vh - 240px);
  max-height: calc(100svh - 240px);
  padding: 8px 4px;
  border-radius: 6px;
}

/* A slot that shrinks when many lines share the height, with its line in the middle. */
.outline-line {
  display: flex;
  flex: 0 1 8px;
  align-items: center;
  min-height: 3px;
}

.outline-line::before {
  content: "";
  width: 10px;
  height: 2px;
  border-radius: 1px;
  background: var(--line-strong);
}

.outline-line.is-version {
  flex-basis: 14px;
}

.outline-line.is-version::before {
  width: 18px;
  background: var(--muted);
}

.outline-line.is-active::before {
  background: var(--strong);
}

.outline-panel {
  position: absolute;
  top: -10px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 300px;
  max-height: calc(100vh - 200px);
  max-height: calc(100svh - 200px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -16px rgba(16, 24, 40, 0.35);
  opacity: 0;
  visibility: hidden;
  translate: 12px 0;
  transition: opacity 0.16s ease, translate 0.16s ease, visibility 0s linear 0.16s;
}

.outline-stick:hover .outline-panel,
.outline-stick:focus-within .outline-panel {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
  transition: opacity 0.16s ease, translate 0.16s ease, visibility 0s;
}

.outline-entry {
  flex: none;
  padding: 4px 8px 4px 22px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.35;
  text-decoration: none;
}

.outline-entry.is-version {
  margin-top: 8px;
  padding-left: 8px;
  color: var(--strong);
  font-weight: 650;
}

.outline-entry.is-version:first-child {
  margin-top: 0;
}

.outline-entry:hover,
.outline-entry:focus-visible {
  background: var(--hover);
  color: var(--strong);
}

.outline-entry.is-active {
  color: var(--accent);
  font-weight: 650;
}

/* Versions and changes fade in while one scrolls. Only the opacity changes:
   a shift would move the place a link to them scrolls to. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .release > :not(.entries),
    .entry {
      animation: fade-in linear both;
      animation-timeline: view();
      animation-range: entry 0px entry 140px;
    }
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .outline-panel,
  .outline-stick:hover .outline-panel,
  .outline-stick:focus-within .outline-panel {
    translate: 0 0;
    transition: none;
  }
}
