/*
 * The tether landing page (tethr.lol). Plain CSS, no framework. The look is "Night": a near-black
 * violet page, two soft glows, big lowercase headings in Bricolage Grotesque and real pictures of
 * the app.
 *
 * Every colour lives in the :root block below and nowhere else; the rest of this file only uses
 * var(--name). (apps/site/test/site.test.ts checks that.) The developer site copies this block
 * (pnpm --filter @tether/developer tokens), and the docs and legal pages below use it too.
 *
 * Layout: below 1100px (phones, tablets) the pieces stack in one column. From 1100px up the page
 * is laid out for 1440px and scales with the window; the pictures run off the page's edges.
 */

/* ---------------------------------------------------------------------------------------------
 * Colours
 * ------------------------------------------------------------------------------------------- */
:root {
  /* The page */
  --paper: #0c070f;
  --ink: #f8f3fa;
  --ink-soft: #cfc8d4;
  --ink-note: #cfc8d4;
  --quiet: #97939a;
  --accent: #8b7cf6;
  --accent-soft: #b4aafa;
  --accent-strong: #b4aafa;
  --on-accent: #111113;
  --rule: rgba(248, 243, 250, 0.14);
  --link-line: rgba(248, 243, 250, 0.42);

  /* The two glows and the shadow under the pictures */
  --glow-violet: rgba(123, 69, 238, 0.55);
  --glow-plum: rgba(168, 52, 134, 0.5);
  --shadow-pic: rgba(0, 0, 0, 0.6);

  /* Cards and fields of the docs and legal pages */
  --card: #17101c;
  --card-edge: #4a2f3f;
  --mark: #fde68a;
  --mark-ink: #3b3220;

  /* The docs (/docs/): the code in the editor's own colours (the dark theme of
     apps/web/src/styles/tokens.css: kinds, keys, punctuation, values, numbers, #channel and
     @role references, {placeholders}, names) */
  --code-bg: #18181b;
  --code-edge: #2a2a30;
  --code-text: #e4e4e7;
  --tok-kind: #b4aafa;
  --tok-key: #a1a1aa;
  --tok-punct: #8e8e96;
  --tok-value: #fcd34d;
  --tok-number: #fdba74;
  --tok-ref: #7dd3fc;
  --tok-placeholder: #86efac;
  --tok-name: #f4f4f5;
  --copy-bg: #2e2e34;
  --copy-bg-hover: #3a3a42;
  --copy-text: #e4e4e7;
  --word-bg: #231a2b;
  --toc-here: #2a2150;
  --field: #150e19;
  --shadow-menu: rgba(0, 0, 0, 0.6);

  /* The download page (/download/): a drawing of Windows' blue SmartScreen box, its two clicks
     marked in --mark */
  --ss-bg: #1d5fa8;
  --ss-ink: #ffffff;
  --ss-ink-soft: rgba(255, 255, 255, 0.86);
  --ss-button: #2f71bb;
  --ss-edge: rgba(255, 255, 255, 0.4);
}

/* ---------------------------------------------------------------------------------------------
 * Fonts (self-hosted from @fontsource, see apps/site/scripts/fonts.ts)
 * ------------------------------------------------------------------------------------------- */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-latin-800-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/figtree-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/figtree-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/figtree-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/figtree-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/figtree-latin-800-normal.woff2') format('woff2');
}

/* ---------------------------------------------------------------------------------------------
 * Base
 * ------------------------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Figtree', system-ui, sans-serif;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
p,
ul,
figure {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
img,
svg {
  display: block;
}
a {
  color: inherit;
}
a:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 4px;
  border-radius: 6px;
}
[hidden] {
  display: none !important;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.ic {
  flex: none;
  fill: currentColor;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page {
  overflow-x: clip;
}

/* ---------------------------------------------------------------------------------------------
 * Header, footer links and the knot (shared with the docs and the legal pages)
 * ------------------------------------------------------------------------------------------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-name {
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand--small .brand-name {
  font-size: 19px;
}
.brand--small {
  gap: 8px;
}
.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.nav-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.nav-link--strong {
  font-weight: 700;
  color: var(--ink);
}
.nav-link:hover,
.foot-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 26px;
  margin-left: auto;
}
.foot-link {
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
}
@media (max-width: 399px) {
  .nav,
  .nav-links {
    gap: 18px;
  }
}
@media (max-width: 359px) {
  .nav,
  .nav-links,
  .docs-head,
  .docs-head .nav-links {
    gap: 13px;
  }
  .nav-link {
    font-size: 14px;
  }
  .nav .brand-name,
  .docs-head .brand-name {
    font-size: 21px;
  }
  .nav .brand-mark,
  .docs-head .brand-mark {
    width: 28px;
    height: 28px;
  }
}

/* ---------------------------------------------------------------------------------------------
 * The landing page (phone layout first, the 1440px layout from 1100px)
 * ------------------------------------------------------------------------------------------- */
.stage {
  --m: clamp(16px, 6.667vw, 96px);
  position: relative;
  isolation: isolate;
  max-width: 1440px;
  margin: 0 auto;
  padding-bottom: 24px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px var(--m) 0;
}
.nav .brand-mark {
  width: 52px;
  height: 52px;
  margin-right: -2px;
}
.nav .brand-name {
  font-size: 26px;
}

/* Headings and words */
.h1,
.h2 {
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-weight: 800;
  letter-spacing: -0.045em;
  color: var(--ink);
}
.h1 {
  font-size: clamp(72px, 24.5vw, 150px);
  line-height: 0.92;
  white-space: nowrap;
}
.h2 {
  font-size: clamp(44px, 12.5vw, 84px);
  line-height: 0.98;
}
.words {
  margin-top: 22px;
  max-width: 460px;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.small {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--quiet);
}
.small a {
  text-decoration: underline;
  text-decoration-color: var(--link-line);
  text-underline-offset: 3px;
}

/* The button and the link beside it */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
  margin-top: 30px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 10px 34px;
  border-radius: 28px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.btn:hover {
  filter: brightness(1.08);
}
.textlink {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--link-line);
  text-underline-offset: 5px;
}
.textlink:hover {
  color: var(--ink);
}
.textlink--plain {
  text-decoration: none;
  color: var(--quiet);
}
.textlink--plain a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--link-line);
  text-underline-offset: 5px;
}

/* The hero */
.hero {
  display: grid;
  gap: 26px;
  padding: 64px var(--m) 0;
}
.hero .words {
  margin-top: 0;
  font-size: 20px;
}
.hero .actions {
  margin-top: 26px;
}

/* The pictures of the app: real screenshots with a soft shadow */
.shot {
  position: relative;
}
.shot img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 40px 90px -20px var(--shadow-pic);
}
.shot--crew {
  margin: 56px 0 0 var(--m);
  width: calc(100% - var(--m) + 28px);
}
.shot--crew::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -20% -10% -22% -10%;
  background: radial-gradient(closest-side, var(--glow-violet), transparent);
}
.feature {
  display: grid;
  gap: 32px;
  margin-top: 96px;
}
.feature .h2 {
  max-width: 7.2em;
}
.feature--call .shot {
  margin: 0 0 0 -24px;
  width: calc(100% + 24px - 4vw);
}
.feature--themes {
  padding-inline: var(--m);
}
.feature--themes .shot {
  margin: 0 -4px;
}
.feature--call .text {
  padding-inline: var(--m);
}

/* Your data */
.data {
  margin-top: 112px;
  padding-inline: var(--m);
}
.data .h2 {
  font-size: clamp(46px, 12.6vw, 116px);
  line-height: 1;
}
.data .words {
  max-width: 740px;
  margin-top: 28px;
  font-size: 20px;
  line-height: 1.8;
}

/* The end */
.end {
  position: relative;
  display: grid;
  gap: 26px;
  margin-top: 120px;
  padding: 0 var(--m);
}
.end::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -90px -10% -120px -10%;
  background: radial-gradient(closest-side, var(--glow-plum), transparent);
}
.end-title {
  display: flex;
  align-items: center;
  gap: 24px;
}
.end-title .h2 {
  font-size: clamp(56px, 16vw, 96px);
  line-height: 1;
}
.end-mark {
  flex: none;
  width: clamp(84px, 22vw, 150px);
  aspect-ratio: 1;
  background: var(--ink);
  mask: url('/logo-mono.svg') center / contain no-repeat;
  -webkit-mask: url('/logo-mono.svg') center / contain no-repeat;
}
.end .actions {
  margin-top: 0;
}

/* The footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin: 72px var(--m) 0;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
}
.foot-note {
  font-size: 14px;
  color: var(--quiet);
}

/* Phones: the nav keeps to what fits (the download buttons are right below; on the download page
   the link is the page you are on) */
@media (max-width: 559px) {
  .nav .nav-link[href='/download/'] {
    display: none;
  }
  .nav,
  .nav-links {
    gap: 16px;
  }
  .nav .brand-mark {
    width: 44px;
    height: 44px;
  }
  .nav .brand-name {
    font-size: 23px;
  }
  .end-title {
    gap: 14px;
  }
  .end-title .h2 {
    font-size: clamp(40px, 12.4vw, 64px);
  }
  .end-mark {
    width: clamp(64px, 18vw, 100px);
  }
  .feature--call .text {
    margin-top: 6px;
  }
}

/* Wider screens: the layout of the 1440px design */
@media (min-width: 1100px) {
  .nav {
    padding-top: 22px;
  }
  .nav .brand-mark {
    width: 64px;
    height: 64px;
  }
  .nav .brand-name {
    font-size: 28px;
  }
  .nav-links {
    gap: 34px;
  }
  .nav-link {
    font-size: 16px;
  }
  .h1 {
    font-size: clamp(120px, 13.9vw, 200px);
  }
  .h2 {
    font-size: clamp(60px, 5.56vw, 80px);
    line-height: 1.02;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr) min(36.1vw, 520px);
    align-items: start;
    gap: 0;
    padding-top: 52px;
  }
  .hero .text {
    padding-top: min(3.2vw, 46px);
  }
  .hero .words {
    font-size: min(1.67vw, 24px);
    line-height: 1.65;
  }
  .hero .actions {
    margin-top: min(2vw, 28px);
  }
  .words {
    font-size: min(1.39vw, 20px);
    line-height: 1.8;
  }
  .btn {
    min-height: 56px;
    min-width: 264px;
    font-size: 18px;
  }
  .shot img {
    border-radius: 24px;
  }
  .shot--crew {
    margin-top: min(5.6vw, 81px);
    margin-left: var(--m);
    width: calc(100% - var(--m) + max(0px, (100vw - 1440px) / 2) + min(5.2vw, 75px));
  }
  .feature {
    margin-top: min(12.6vw, 182px);
  }
  .feature--call {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0;
  }
  .feature--call .shot {
    width: min(59.6vw, 858px);
    margin-left: calc(-1 * max(0px, (100vw - 1440px) / 2) - min(5.4vw, 78px));
  }
  .feature--call .text {
    padding-left: min(6.9vw, 99px);
    padding-right: var(--m);
  }
  .feature--call .h2 {
    max-width: none;
  }
  .feature--themes {
    grid-template-columns: minmax(0, 1fr) min(44.2vw, 637px);
    align-items: start;
    gap: 0;
    padding-right: min(5.6vw, 81px);
    margin-top: min(8.7vw, 126px);
  }
  .feature--themes .text {
    padding-top: min(6vw, 87px);
  }
  /* "make it look / like yours": never "yours" alone on the second line. */
  .feature--themes .h2 {
    max-width: 6.4em;
  }
  .feature--themes .shot {
    margin: 0;
  }
  .data {
    margin-top: min(10.8vw, 156px);
  }
  .data .words {
    margin-top: min(2.4vw, 34px);
  }
  .end {
    grid-template-columns: minmax(0, 1fr) min(36.1vw, 520px);
    align-items: start;
    gap: 0;
    margin-top: min(19.5vw, 280px);
  }
  .end-title {
    gap: min(2.7vw, 40px);
  }
  .end-title .h2 {
    font-size: clamp(64px, 6.67vw, 96px);
  }
  .end-mark {
    width: min(10.4vw, 150px);
  }
  .end .text {
    padding-top: min(0.5vw, 8px);
  }
  .end::before {
    inset: -160px -5% -240px -5%;
  }
  .foot {
    margin-top: min(13.9vw, 200px);
  }
}

/* ---------------------------------------------------------------------------------------------
 * The docs (/docs/, written by scripts/docs-page.ts). Their own classes (docs-*), so none of the
 * landing page's rules above reach them; phone layout first, the side contents from 960px.
 * ------------------------------------------------------------------------------------------- */
.docs-page,
.legal-page {
  font-size: 17px;
  line-height: 1.6;
}
.docs-wrap,
.legal-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}
.docs-head {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-link--here {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.docs-page button:focus-visible,
.docs-page summary:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}
.docs-page pre,
.docs-page code {
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}

/* The contents: in a menu at the top on phones, at the side from 960px */
.docs-menu {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 14px -16px 0;
  padding: 10px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.docs-menu-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--field);
  font-size: 15px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.docs-menu-button::-webkit-details-marker {
  display: none;
}
.docs-menu[open] .docs-menu-button .ic {
  transform: rotate(180deg);
}
.docs-menu-panel {
  max-height: min(70vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 10px;
  padding: 4px 2px 8px;
}
.docs-menu[open] {
  box-shadow: 0 14px 24px -18px var(--shadow-menu);
}
.docs-side {
  display: none;
}
.docs-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  margin-bottom: 6px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink-soft);
}
.docs-filter:focus-within {
  outline: 3px solid var(--accent-strong);
  outline-offset: 1px;
}
.docs-filter input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.docs-toc-list > li + li,
.docs-toc-list > li:first-child {
  margin-top: 14px;
}
.docs-toc-head {
  display: block;
  padding: 2px 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.docs-toc-list ul a {
  display: block;
  padding: 3px 10px;
  border-radius: 8px;
  color: var(--ink-note);
  font-size: 15px;
  line-height: 1.45;
  text-decoration: none;
}
.docs-toc-list a:hover {
  background: var(--word-bg);
}
.docs-toc-list a[aria-current] {
  background: var(--toc-here);
  color: var(--accent-strong);
  font-weight: 700;
}

/* The words */
.docs-main {
  display: block;
  min-width: 0;
  max-width: 780px;
  padding-top: 28px;
}
.docs-kicker {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.docs-title {
  margin-top: 6px;
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-size: clamp(46px, 11vw, 76px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.docs-lede {
  max-width: 34em;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1.5;
}
.docs-text {
  max-width: 64ch;
  margin-top: 12px;
  color: var(--ink-note);
}
.docs-group {
  margin-top: 64px;
  padding-top: 26px;
  border-top: 2px solid var(--rule);
}
.docs-group-title {
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-size: clamp(30px, 7vw, 38px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.docs-group-title a,
.docs-entry-title a {
  text-decoration: none;
}
.docs-group-title a:hover,
.docs-entry-title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--link-line);
  text-underline-offset: 5px;
}
.docs-group--intro > .docs-code {
  margin-top: 18px;
}
.docs-entry {
  margin-top: 44px;
  scroll-margin-top: 84px;
}
.docs-group > .docs-entry:first-of-type {
  margin-top: 26px;
}
.docs-group,
.docs-intro {
  scroll-margin-top: 84px;
}
.docs-entry-title {
  margin: 0;
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.docs-usage {
  display: inline-block;
  max-width: 100%;
  margin: 10px 0 0;
  padding: 5px 12px;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre;
}
.docs-where {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 15px;
}
.docs-where a {
  text-decoration: none;
}
.docs-label {
  margin: 24px 0 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.docs-rows {
  margin: 0;
  border-top: 1px solid var(--rule);
}
.docs-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.docs-row dt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.docs-row dd {
  margin: 0;
  min-width: 0;
}
.docs-row dd p {
  font-size: 16px;
  line-height: 1.5;
}
.docs-key {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
}
.docs-takes {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.4;
}
a.docs-takes {
  text-decoration: underline;
  text-decoration-color: var(--link-line);
  text-underline-offset: 3px;
}
.docs-row dd .docs-also {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 14px;
}
.docs-chip {
  display: inline-block;
  max-width: 100%;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.docs-word {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--word-bg);
  color: var(--ink);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}
.docs-code {
  position: relative;
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--code-edge);
  border-radius: 14px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre;
  tab-size: 2;
}
.docs-code--small {
  margin-top: 6px;
  padding: 10px 14px;
  font-size: 13.5px;
}
.docs-ctx {
  opacity: 0.45;
}
.tok-kind {
  color: var(--tok-kind);
}
.tok-key {
  color: var(--tok-key);
}
.tok-punct,
.tok-comment {
  color: var(--tok-punct);
}
.tok-value {
  color: var(--tok-value);
}
.tok-number {
  color: var(--tok-number);
}
.tok-ref {
  color: var(--tok-ref);
}
.tok-placeholder {
  color: var(--tok-placeholder);
}
.tok-name {
  color: var(--tok-name);
}
.docs-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--copy-bg);
  color: var(--copy-text);
  font:
    600 12.5px/1.2 'Figtree',
    system-ui,
    sans-serif;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.docs-code:hover .docs-copy,
.docs-copy:focus-visible {
  opacity: 1;
}
.docs-copy:hover {
  background: var(--copy-bg-hover);
}
@media (hover: none) {
  .docs-copy {
    opacity: 0.85;
  }
}
.docs-points {
  max-width: 64ch;
  margin-top: 20px;
  padding-left: 22px;
  list-style: disc;
  color: var(--ink-note);
}
.docs-points li + li {
  margin-top: 8px;
}
.docs-points li::marker {
  color: var(--accent);
}
.docs-pair {
  display: grid;
  gap: 4px 18px;
  margin-top: 8px;
}
.docs-pair > div {
  min-width: 0;
}
.docs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.docs-chips .docs-word {
  display: inline-block;
  padding: 3px 9px;
  font-size: 14px;
}
.docs-empty {
  margin-top: 40px;
  color: var(--ink-soft);
  font-size: 19px;
}
.docs-foot {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 80px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

@media (min-width: 360px) and (max-width: 399px) {
  .docs-head,
  .docs-head .nav-links {
    gap: 16px;
  }
}
@media (min-width: 640px) {
  .docs-row {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 22px;
  }
  .docs-rows--words .docs-row {
    grid-template-columns: 210px minmax(0, 1fr);
  }
}
@media (min-width: 720px) {
  .docs-wrap,
  .legal-wrap {
    padding: 24px 32px 48px;
  }
  .docs-menu {
    margin-inline: -32px;
    padding-inline: 32px;
  }
  .docs-pair {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 960px) {
  .docs-menu {
    display: none;
  }
  .docs-layout {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 64px;
  }
  .docs-side {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 28px 0 20px;
  }
  .docs-toc {
    flex: 1;
    min-height: 0;
    margin-right: -10px;
    padding-right: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .docs-toc .docs-toc-list > li:first-child {
    margin-top: 6px;
  }
  .docs-entry,
  .docs-group,
  .docs-intro {
    scroll-margin-top: 24px;
  }
}

/* ---------------------------------------------------------------------------------------------
 * The legal pages (/terms/, /privacy/, /guidelines/, written by scripts/legal-page.ts): one
 * readable column of words, the header and footer of the docs, the draft note.
 * ------------------------------------------------------------------------------------------- */
.legal-main {
  display: block;
  max-width: 760px;
  margin: 0 auto;
  padding-top: 28px;
}
.legal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.legal-tab {
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}
.legal-tab:hover {
  color: var(--ink);
}
.legal-tab[aria-current] {
  border-color: var(--accent-soft);
  background: var(--toc-here);
  color: var(--accent-strong);
}
.legal-title {
  margin-top: 26px;
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-size: clamp(42px, 10vw, 68px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.legal-draft {
  display: inline-block;
  max-width: 100%;
  margin: 22px 0 0;
  padding: 12px 18px 14px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.5;
}
.legal-doc .legal-draft p {
  max-width: none;
  margin: 0;
  color: inherit;
}
.legal-doc .legal-draft p + p {
  margin-top: 4px;
}
.legal-draft .legal-ph {
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 15px;
}
.legal-ph {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--mark);
  color: var(--mark-ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.legal-doc .legal-date {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 15px;
}
.legal-doc p {
  max-width: 66ch;
  margin-top: 14px;
  color: var(--ink-note);
}
.legal-doc h2 {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 2px solid var(--rule);
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-size: clamp(27px, 6.5vw, 34px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  scroll-margin-top: 24px;
}
.legal-doc h3 {
  margin: 32px 0 0;
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  scroll-margin-top: 24px;
}
.legal-doc h2 + p,
.legal-doc h3 + p,
.legal-doc h2 + ul,
.legal-doc h3 + ul {
  margin-top: 12px;
}
.legal-doc ul {
  max-width: 66ch;
  margin-top: 14px;
  padding-left: 1.3em;
  list-style: disc;
  color: var(--ink-note);
}
.legal-doc li + li {
  margin-top: 8px;
}
.legal-doc li::marker {
  color: var(--accent);
}
.legal-doc strong {
  color: var(--ink);
  font-weight: 700;
}
.legal-doc a {
  color: var(--accent-strong);
  text-decoration-color: var(--link-line);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.legal-doc a:hover {
  text-decoration-color: var(--accent-strong);
}
.legal-doc .legal-toc {
  margin-top: 30px;
  padding: 16px 20px 18px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--field);
}
.legal-doc .legal-toc-title {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal-doc .legal-toc ul {
  max-width: none;
  margin-top: 8px;
  padding: 0;
  list-style: none;
}
.legal-doc .legal-toc li + li {
  margin-top: 2px;
}
.legal-doc .legal-toc a {
  display: block;
  padding: 2px 0;
  color: var(--ink-note);
  font-size: 15px;
  text-decoration: none;
}
.legal-doc .legal-toc a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}
.foot-link[aria-current] {
  color: var(--ink);
}
@media (min-width: 640px) {
  .legal-doc .legal-toc ul {
    columns: 2;
    column-gap: 28px;
  }
  .legal-doc .legal-toc li {
    break-inside: avoid;
  }
}

/* ---------------------------------------------------------------------------------------------
 * The download page (/download/, written by scripts/download-page.ts). The landing page's header,
 * headings, buttons and footer; Windows and Linux side by side from 900px, stacked below.
 * ------------------------------------------------------------------------------------------- */
.nav-link[aria-current] {
  color: var(--accent-soft);
}
.dl-page button:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}
.dl-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  padding: 64px var(--m) 0;
}
.dl-hero .h1 {
  font-size: clamp(56px, 17vw, 150px);
}
.dl-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -200px 20% -120px -20%;
  background: radial-gradient(closest-side, var(--glow-violet), transparent);
  opacity: 0.55;
}
.dl-hero .words {
  margin-top: 0;
  max-width: 640px;
  font-size: 20px;
}
.dl-systems {
  display: grid;
  gap: 88px;
  margin-top: 88px;
  padding: 0 var(--m);
}
.dl-system {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.dl-name {
  margin-bottom: 30px;
}
.dl-rule {
  align-self: stretch;
  margin: 44px 0 40px;
  border: 0;
  border-top: 1px solid var(--rule);
}
.dl-sub {
  margin: 0;
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}
.dl-text {
  max-width: 560px;
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.dl-sub + .dl-text {
  margin-top: 10px;
}
.dl-text strong {
  font-weight: 700;
  color: var(--ink);
}
.dl-actions {
  margin: 22px 0 36px;
}
.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--link-line);
}
.btn--outline:hover {
  filter: none;
  border-color: var(--ink-soft);
}

/* The commands */
.dl-code {
  position: relative;
  align-self: stretch;
  margin: 14px 0 22px;
  padding: 18px 20px;
  border: 1px solid var(--code-edge);
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* The Copy button: under the commands on narrow screens, beside the last line from 900px */
.dl-code--copy {
  padding-bottom: 54px;
}
.dl-code code {
  font: inherit;
}
.dl-copy {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--copy-bg);
  color: var(--copy-text);
  font:
    600 13px/1.2 'Figtree',
    system-ui,
    sans-serif;
  cursor: pointer;
}
.dl-copy:hover {
  background: var(--copy-bg-hover);
}

/* The drawing of SmartScreen's box */
.ss {
  align-self: stretch;
  max-width: 480px;
  margin-top: 24px;
  padding: 24px 24px 20px;
  border-radius: 4px;
  background: var(--ss-bg);
  color: var(--ss-ink);
}
.ss-title {
  font-size: 21px;
  font-weight: 500;
}
.ss-words {
  max-width: 300px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ss-ink-soft);
}
.ss-more,
.ss-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ss-more {
  margin-top: 10px;
}
.ss-buttons {
  justify-content: flex-end;
  margin-top: 18px;
}
.ss-link {
  padding: 2px 8px;
  border: 2px solid var(--mark);
  border-radius: 4px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ss-button {
  padding: 7px 18px;
  border: 1px solid var(--ss-edge);
  background: var(--ss-button);
  font-size: 13px;
  white-space: nowrap;
}
.ss-button--marked {
  border: 2px solid var(--mark);
}
.ss-step {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mark);
  color: var(--mark-ink);
  font-size: 12px;
  font-weight: 800;
}

/* Mac and phones */
.dl-other {
  position: relative;
  display: grid;
  gap: 28px;
  margin: 110px var(--m) 0;
  padding-top: 88px;
  border-top: 1px solid var(--rule);
}
.dl-other::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 -10% -200px 30%;
  background: radial-gradient(closest-side, var(--glow-plum), transparent);
  opacity: 0.6;
}
.dl-other .h2 {
  font-size: clamp(44px, 12.5vw, 72px);
}
.dl-other .words {
  margin-top: 0;
}
.dl-other .actions {
  margin-top: 28px;
}
@media (max-width: 559px) {
  .ss {
    padding: 20px 16px 16px;
  }
  .ss-buttons {
    flex-wrap: wrap;
  }
}
@media (min-width: 900px) {
  .dl-code {
    font-size: 13.5px;
  }
  .dl-code--copy {
    padding-right: 86px;
    padding-bottom: 18px;
  }
  .dl-systems {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    margin-top: 140px;
  }
  .dl-system + .dl-system {
    padding-left: 40px;
    border-left: 1px solid var(--rule);
  }
  .dl-system:first-child {
    padding-right: 40px;
  }
  .dl-other {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 48px;
    margin-top: 140px;
  }
  .dl-other-text {
    padding-top: 12px;
  }
}
@media (min-width: 1100px) {
  .dl-hero {
    padding-top: 52px;
  }
  .dl-hero .words {
    font-size: min(1.67vw, 22px);
    line-height: 1.65;
  }
  .dl-hero .h1 {
    font-size: clamp(120px, 12.2vw, 176px);
  }
  .dl-name {
    font-size: 80px;
  }
  .dl-sub {
    font-size: 32px;
  }
  .dl-other .h2 {
    font-size: 72px;
  }
  .dl-other .words {
    font-size: 20px;
  }
}
